Commit 7124d62e authored by zhengke's avatar zhengke

修改

parent 73c168da
<template>
<div class="transfer-order">
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale"
@hide="$emit('close')">
<q-card style="width: 850px;max-width:850px;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">转订单</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-card-section class="q-pt-none scroll">
<q-stepper v-model="step" ref="stepper" color="primary" animated flat>
<q-step :name="1" title="选择课程" icon="settings" :done="step > 1">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-select @input="resetSearch" filled option-value="Id" option-label="Name" v-model="msg.Type"
:options="studyList" emit-value map-options label="类型" />
</div>
<div class="col-3">
<q-input @change="resetSearch" clearable filled v-model="msg.Name" label="项目名称" @clear="resetSearch"
maxlength="20" />
</div>
</div>
</div>
<abroadlist :dataList="dataList" :loading="loading" @select="selectCourse" :select="defaultCourse"></abroadlist>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="PageCount"
:input="true" @input="changePage" />
</q-step>
<q-step :name="2" title="确认" icon="settings" :done="step > 2">
<studyForm ref="orderForm" :save-obj="saveObj" @success="$emit('close')" @cancelloading='cancelloading'></studyForm>
</q-step>
</q-stepper>
</q-card-section>
<q-card-actions align="right" class="bg-white q-mx-md ">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" v-close-popup />
<q-btn @click="$refs.stepper.previous()" color="primary" label="上一步" v-if="step > 1" />
<q-btn @click="next" color="primary" label="下一步" v-if="step < 2" />
<q-btn label="保存" color="primary" :loading="loading1" @click="saveOrderForm" v-if="step == 2" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import {
queryStudyAbroadPage
} from '../../../api/studyabroad/index'
import abroadlist from "./transfer-order/abroadlist";
import studyForm from "./transfer-order/study-form";
export default {
props: {
select: {
type: Array,
default: () => []
}
},
components: {
abroadlist,
studyForm
},
data() {
return {
persistent: true,
step: 1,
loading1: false, //防止多次点击
msg: {
Type: 1, //1留学 2就业
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
Name: "",
IsQPrice: 1,
SaleState: "", //销售状态
ProductType: "", //产品类型
StudyCountryId: "", //国家编号
},
dataList: [],
defaultCourse: [],
saveObj: {}, //所选数据
loading:false,
studyList: [{
Id: 1,
Name: '留学'
}, {
Id: 2,
Name: '就业'
}],
PageCount: 0
};
},
mounted() {
this.getList();
},
methods: {
//获取留学 就业数据
getList() {
this.loading = true;
queryStudyAbroadPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.PageCount = res.Data.PageCount;
}
})
},
// 课程翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList();
},
// 选择课程
selectCourse(val) {
if(val&&val.length>0){
this.saveObj = val[0];
this.saveObj.Id = this.saveObj.Id;
this.defaultCourse = val;
}
},
next() {
if (!this.saveObj.Id || this.saveObj.Id == 0) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择项目名称`
});
return;
}
this.$refs.stepper.next();
},
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
saveOrderForm() {
this.loading1 = true
this.$refs.orderForm.saveOrderInfo();
},
cancelloading() {
this.loading1 = false
},
}
};
</script>
<style scoped>
/deep/.el-input__inner {
background-color: transparent;
border: none;
}
/deep/.q-stepper__step-inner {
padding: 0 24px;
}
</style>
......@@ -68,6 +68,8 @@
v-if="userInfo.IsCourseConsultant == 0" @click="pushMode = true" />
<q-btn color="accent" class="q-mr-md" size="sm" icon="swap_horiz" label="转订单"
:disable="selection.length === 0" @click="transferOrder" />
<q-btn color="accent" class="q-mr-md" size="sm" icon="swap_horiz" label="转留学"
:disable="selection.length === 0" @click="transferAbroad" />
<q-btn color="accent" class="q-mr-md" size="sm" icon="add" label="新增学员" @click="EditStudent(null)" />
<q-btn v-if="authObj&&authObj.isShowDownload" color="accent" class="q-mr-md" size="sm" icon="download" label="下载"
@click="downloadStudent" />
......@@ -204,6 +206,7 @@
</studentAdd-form>
<transfer-order v-if="isShowTransfer" :select="selection" @close="closeStuForm" @success="refreshStuList">
</transfer-order>
<abroad-form v-if="isShowAbroad" :select="selection" @close="closeStuForm" @success="refreshStuList"></abroad-form>
</div>
</template>
<script>
......@@ -211,6 +214,7 @@
import studentRightForm from "./studentRight-form";
import studentAddForm from "./studentAdd-form";
import transferOrder from "./transfer-order";
import abroadForm from "./abroad-form";
import {
mapGetters
} from "vuex";
......@@ -249,7 +253,8 @@
studentForm,
studentRightForm,
studentAddForm,
transferOrder
transferOrder,
abroadForm
},
data() {
return {
......@@ -429,6 +434,7 @@
pushing: false,
assistListFormat: [],
checkType:1,
isShowAbroad: false
};
},
watch: {
......@@ -596,6 +602,7 @@
this.isShowStuRight = false;
this.isShowAdd = false;
this.isShowTransfer = false;
this.isShowAbroad = false;
},
//点击学生姓名弹出
getStuRight(obj,type) {
......@@ -608,6 +615,7 @@
}
this.isShowStuRight = true;
},
//转订单
transferOrder() {
const firstId = this.selection[0].CustomerId;
const flag = this.selection.every(e => {
......@@ -623,6 +631,10 @@
}
this.isShowTransfer = true;
},
//转留学
transferAbroad(){
this.isShowAbroad = true;
},
getCurseManager(row) {
let managerName = "<span class='text-grey-4'>暂未推送</span>";
if (row.AssistList && row.AssistList.length > 0) {
......
<template>
<q-table :pagination="msg" selection="single" :loading="loading" :selected.sync="selection" no-data-label="暂无相关数据" flat
class="sticky-tow-column-table sticky-two-header-table" separator="none" :data="dataList" :columns="columns"
row-key="Id" @update:selected="emitSel" table-class="table" hide-bottom>
</q-table>
</template>
<script>
export default {
props: {
dataList: {
type: Array,
default: () => []
},
select: {
type: Array,
default: () => []
},
loading: {
type: Boolean,
default: null
}
},
data() {
return {
selection: [],
msg: {
pageIndex: 1,
rowsPerPage: 0
},
columns: [{
name: "ProductTypeName",
label: "类型",
align: "left",
field: "ProductTypeName"
},
{
name: "Name",
label: "项目名称",
field: "Name",
align: "left"
},
{
name: "StudyCountryName",
label: "留学国家",
field: "StudyCountryName",
align: "left"
},
{
name: "SellPrice",
label: "实际卖价",
field: "SellPrice",
align: "left"
}
]
};
},
mounted() {
this.selection = this.select
},
methods: {
emitSel(val) {
this.$emit("select", val)
},
}
};
</script>
<style>
.table {
max-height: 400px;
}
.table::-webkit-scrollbar {
width: 5px;
height: 5px;
}
.table::-webkit-scrollbar-track {
background: #fff;
border-radius: 2px;
}
.table::-webkit-scrollbar-thumb {
background: #444;
border-radius: 10px;
}
.table::-webkit-scrollbar-thumb:hover {
background: #999;
}
.table::-webkit-scrollbar-corner {
background: #204754;
}
</style>
<!--订单操作-->
<template>
<div>
<div class="q-mb-sm text-accent">
<span class="text-primary" v-if="mode === 1">班级:</span>
<span v-if="mode === 1">{{ saveObj.ClassName }}</span>
<span class="q-ml-md text-primary">课程:</span>{{ saveObj.CourseName }}
</div>
<div class="row q-mb-md">
<!-- <div class="col-10 flex">
<div v-for="(item, index) in stuData.StuList">
<q-chip icon="person" class="primary"
>{{ item.StuName }}
<span v-if="item.IsRenewGuest === 1">(续费)</span>
</q-chip>
</div>
</div> -->
<div class="col-2" v-if="mode == 1">
<q-toggle
v-model="OrderMsg.IsChaBan"
:true-value="1"
:false-value="0"
label="插班报入"
/>
</div>
</div>
<div style="row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<q-input
filled
stack-label
maxlength="3"
:dense="false"
@keyup.native="checkInteger(OrderMsg, 'GuestNum')"
v-model="OrderMsg.GuestNum"
@input="calcPrice()"
label="人数"
:rules="[val => !!val || '请填写人数']"
disable
class="col-6 q-py-sm"
/>
<q-input
filled
stack-label
:dense="false"
v-model="OrderMsg.Unit_Price"
:disable="true"
@input="calcPrice()"
class="col-6 q-py-sm"
label="成交单价"
:rules="[val => !!val || '请填成交单价']"
/>
<q-input
filled
stack-label
:dense="false"
v-model="OrderMsg.DiscountMoney"
:disable="true"
class="col-6 q-py-sm"
label="优惠金额"
/>
<q-input
filled
stack-label
:disable="true"
:dense="false"
maxlength="10"
@keyup.native="checkPrice(OrderMsg, 'PreferPrice')"
v-model="OrderMsg.PreferPrice"
class="col-6 q-py-sm"
label="应收"
/>
<q-select
standout="bg-primary text-white"
option-value="Id"
option-label="Name"
v-model="OrderMsg.OrderSource"
:options="SourceEnumList"
emit-value
map-options
class="col-6 q-py-sm"
label="客人来源"
/>
<q-select
v-model="OrderMsg.HelpEnterId"
:options="EmployeeList"
filled
use-input
label="协助老师"
option-label="EmployeeName"
option-value="Id"
ref="EmployeeName"
class="col-6 q-py-sm"
emit-value
map-options
@filter="filterFn"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<q-select
v-model="OrderMsg.CourseConsultantId"
:options="EmployeeList2"
filled
use-input
label="课程顾问"
option-label="EmployeeName"
option-value="Id"
ref="EmployeeName2"
class="col-6 q-py-sm"
emit-value
map-options
@filter="filterFn2"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<q-input
filled
stack-label
:dense="false"
v-model="OrderMsg.SaleRemark"
type="textarea"
class="col-12 q-py-sm"
label="备注"
/>
</div>
</div>
<div
class="dialog-out-close"
@click="closeEditOrder"
style="height:40px !important;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;"
>
<q-icon name="iconfont icon-jujue1" size="26px" />
</div>
<q-dialog v-model="inception">
<q-card v-if="inceptionData">
<q-card-section>
<div class="text-h6">提示</div>
</q-card-section>
<q-card-section class="q-pt-none">
{{ inceptionData.Message }}
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn flat label="取消" size="sm" v-close-popup />
<q-btn
label="立即查看"
size="sm"
color="accent q-px-md"
style="font-weight:400 !important"
@click="goorder"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {
getClassOrderInfo, //获取订单操作日志列表
getOrderSourceEnumList, //获取订单来源 枚举
setClassOrder, //修改订单
queryChaClassInfo,
} from "../../../../api/sale/sale";
import { queryEmployee } from "../../../../api/users/user"; //获取员工
export default {
props: {
saveObj: {
type: Object,
default: null
},
mode: {
type: Number, //1:约课,2:班课
default: 1
},
//订单类型
orderType: {
type: Number,
default: 1
},
schoolList: {
type: Array,
default: () => []
}
},
data() {
return {
IsShowEditOrder: true,
UnitPrice: 0,
SourceEnumList: [], //订单来源
EmployeeList: [], //教师列表
AllemployeeList: [], //所有教师列表
EmployeeList2: [], //课程顾问列表
AllemployeeList2: [], //所有课程顾问列表
inception: false,
inceptionData: null,
OrderMsg:{}
};
},
created() {
if (this.saveObj && this.saveObj.CourseId) {
this.OrderMsg.CourseId = this.saveObj.CourseId;
}
this.getOrderSEList();
this.getEmployee(0);
this.getEmployee(2);
this.initConfig();
},
mounted() {
this.initData();
},
methods: {
//获取班级课程信息
initConfig() {
},
//计算课程单价和应收金额
calcPrice() {
},
initData() {
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList));
} else {
const needle = val.toLowerCase();
this.EmployeeList = this.AllemployeeList.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//筛选课程顾问
filterFn2(val, update) {
update(() => {
if (val === "") {
this.EmployeeList2 = JSON.parse(
JSON.stringify(this.AllemployeeList2)
);
} else {
const needle = val.toLowerCase();
this.EmployeeList2 = this.AllemployeeList2.filter(
v => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//获取业务员
getEmployee(n) {
var qMsg = {
IsLeave: 1,
UserRole: n
};
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
if (n == 0) {
//教师
this.EmployeeList = res.Data;
this.AllemployeeList = res.Data;
let obj = {
Id: 0,
EmployeeName: "不限"
};
this.EmployeeList.unshift(obj);
}
if (n == 2) {
//课程顾问
this.EmployeeList2 = res.Data;
this.AllemployeeList2 = res.Data;
let obj = {
Id: 0,
EmployeeName: "不限"
};
this.EmployeeList2.unshift(obj);
}
}
});
},
//关闭弹窗
closeEditOrder() {
this.IsShowEditOrder = false;
this.$emit("close");
},
//获取订单来源
getOrderSEList() {
getOrderSourceEnumList({}).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
this.SourceEnumList = tempArray;
this.OrderMsg.OrderSource = tempArray[0].Id;
}
});
},
//修改订单
saveOrderInfo() {
},
goorder() {
this.OpenNewUrl("/sale/myOrder", {
OrderId: this.inceptionData.Data
});
this.inception = false;
},
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment