Commit 29ae8348 authored by youjie's avatar youjie
parents 0f1f93bf c60284f7
<style> <style>
.stuCloseBtn { .stuCloseBtn {
position: absolute; position: absolute;
right: -8px; right: -8px;
top: -9px; top: -9px;
width: 20px; width: 20px;
height: 20px; height: 20px;
border: 1px solid red; border: 1px solid red;
background-color: red; background-color: red;
color: #fff; color: #fff;
line-height: 18px; line-height: 18px;
text-align: center; text-align: center;
border-radius: 50%; border-radius: 50%;
cursor:pointer; cursor: pointer;
} }
</style>
</style> <template>
<template> <div>
<div> <q-card flat class="q-pa-lg q-my-lg" >
<q-card flat class="q-pa-lg q-my-lg" v-loading="loading"> <div class="text-h6 text-weight-bold">学员预约截止日期</div>
<div class="text-h6 text-weight-bold">分配给以下部门/成员</div> <div style="display:flex;margin-bottom:10px;position:relative;width:620px;" :key="index">
<div style="display:flex;justify-content:end;width:600px;margin-bottom:10px;"> <q-select class="col-6 q-pb" v-model="dictObjEmp.Code" style="width:300px;margin-right:10px;" clearable filled
<q-btn round color="primary" icon="iconfont icon-img_haha" @click="addEmployee()" /> stack-label use-input option-value="Id" option-label="Name" ref="ManagerId" :options="WeekList" label="截止日期"
</div> :dense="false" emit-value map-options>
<div style="display:flex;margin-bottom:10px;position:relative;width:620px;" v-for="(item,index) in List" :key="index"> </q-select>
<q-select class="col-6 q-pb" v-model="item.Content" @input="getName(item.Content,index)" </div>
style="width:300px;margin-right:10px;" clearable filled stack-label use-input option-value="Id" <q-btn class="q-mt-xl q-px-lg" unelevated color="primary" :loading="saving" @click="saveHandler">立即保存</q-btn>
option-label="EmployeeName" ref="ManagerId" :options="EmployeeList" label="留学顾问" :dense="false" emit-value </q-card>
map-options @filter="filterFn"> </div>
<template v-slot:no-option> </template>
<q-item>
<q-item-section class="text-grey"> <script>
未找到相关数据 import {
</q-item-section> saveDict
</q-item> } from "../../api/system/notiveSysSet";
</template>
</q-select>
<q-select filled v-model="item.CodeList" multiple option-value="Id" option-label="Name" :options="NeedData" export default {
label="客户需求" style="width: 300px" emit-value map-options /> components: {
<div class="stuCloseBtn">
<i @click="delStepStu(index)" class="iconfont icon-guanbi"></i> },
</div> data() {
</div> return {
<q-btn class="q-mt-xl q-px-lg" unelevated color="primary" :loading="saving" @click="saveHandler">立即保存</q-btn>
</q-card> outerVisible: false,
<choiceapproval v-if="outerVisible" @close="getclose()" :singleCheck="true" @success="getsuccess2" saving: false,
:byval="chosenUser" cptype="0"> loading: false,
</choiceapproval> dictObjEmp: {
</div> ID: 0,
</template> Code: "",
Content: "",
<script> DictKey: "PUSH_STU_STUDYABROAD",
import choiceapproval from "../../components/enterprise/choiceapproval"; Mask: "",
import { Name: "学员预约分配规则",
getDictValue
} from "../../api/administration/administration";
import {
saveDict
} from "../../api/system/notiveSysSet";
import {
GetNeedsList
} from "../../api/school/index";
import {
queryEmployee
} from "../../api/users/user"; //获取员工
export default {
components: {
choiceapproval
},
data() {
return {
chosenUser: [],
outerVisible: false,
saving: false,
loading: false,
dictObjEmp: {
ID: 0,
Code: "",
Content: "",
DictKey: "PUSH_STU_STUDYABROAD",
Mask: "",
Name: "学员预约分配规则",
},
multiCheck: [],
NeedData: [], //多选
EmployeeList: [], // 员工
AllemployeeList: [],
List: [{
CodeList: [],
Code: '',
Content: '',
Mask: ""
}]
};
},
created() {
this.getGetNeedsList();
this.getEmployee();
this.init();
},
methods: {
//点击添加
addEmployee() {
let obj = {
CodeList: [],
Code: '',
Content: '',
Mask: ""
}
this.List.push(obj);
},
delStepStu(index){
this.List.splice(index,1);
},
//选择Name
getName(Id, index) {
this.EmployeeList.forEach(x => {
if (x.Id == Id) {
this.List[index].Mask = x.EmployeeName;
}
})
},
//获取业务员
getEmployee() {
var qMsg = {
EmployeeName: ''
}
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeList = res.Data;
this.AllemployeeList = res.Data;
}
})
},
//筛选员工
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);
}
})
},
//获取客户需求
getGetNeedsList() {
GetNeedsList().then(res => {
if (res.Code == 1) {
this.NeedData = res.Data;
}
});
}, },
getclose() { WeekList: [{
// 企业关闭 Id: 1,
this.ismember = false; Name: "星期一"
this.outerVisible = false; },
}, {
getsuccess2(list, type) { Id: 2,
this.chosenUser = list; Name: "星期二"
this.outerVisible = false; },
}, {
init() { Id: 3,
this.loading = true; Name: "星期三"
getDictValue({ },
Key: "PUSH_STU_STUDYABROAD" {
}).then(res => { Id: 4,
this.loading = false; Name: "星期四"
if (res.Code == 1) { },
var tempObj = res.Data; {
if (tempObj) { Id: 5,
this.dictObjEmp.ID = tempObj.ID; Name: "星期五"
this.dictObjEmp.Content = tempObj.Content; },
if (tempObj.Content) { {
this.List = JSON.parse(tempObj.Content); Id: 6,
} Name: "星期六"
},
{
Id: 7,
Name: "星期天"
},
]
};
},
created() {
this.init();
},
methods: {
init() {
this.loading = true;
getDictValue({
Key: "PUSH_STU_STUDYABROAD"
}).then(res => {
this.loading = false;
if (res.Code == 1) {
var tempObj = res.Data;
if (tempObj) {
this.dictObjEmp.ID = tempObj.ID;
this.dictObjEmp.Content = tempObj.Content;
if (tempObj.Content) {
this.List = JSON.parse(tempObj.Content);
} }
} }
});
},
saveHandler() {
if(this.List.length==0){
this.$q.notify({
type: 'negative',
position: "top",
message: `请添加数据`
});
return
} }
if(this.List.length>0){ });
for(let i=0;i<this.List.length;i++){ },
if(this.List[i].Content==''||this.List[i].Content==null){ saveHandler() {
this.$q.notify({ if (this.List.length == 0) {
type: 'negative', this.$q.notify({
position: "top", type: 'negative',
message: `请选择第${i+1}条留学顾问` position: "top",
}); message: `请添加数据`
return });
} return
if(this.List[i].CodeList.length==0){ }
this.$q.notify({ if (this.List.length > 0) {
type: 'negative', for (let i = 0; i < this.List.length; i++) {
position: "top", if (this.List[i].Content == '' || this.List[i].Content == null) {
message: `请选择第${i+1}条客户需求` this.$q.notify({
}); type: 'negative',
return position: "top",
} message: `请选择第${i+1}条留学顾问`
});
return
} }
this.List.forEach(x => { if (this.List[i].CodeList.length == 0) {
x.Code = x.CodeList.toString();
})
}
this.dictObjEmp.Content = JSON.stringify(this.List);
this.saving = true;
saveDict(this.dictObjEmp).then(r => {
this.saving = false;
if (r.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: "iconfont icon-chenggong", type: 'negative',
color: "accent", position: "top",
timeout: 2000, message: `请选择第${i+1}条客户需求`
message: "数据保存成功!",
position: "top"
}); });
this.init(); return
} else {
this.saving = false;
} }
}); }
this.List.forEach(x => {
x.Code = x.CodeList.toString();
})
} }
this.dictObjEmp.Content = JSON.stringify(this.List);
this.saving = true;
saveDict(this.dictObjEmp).then(r => {
this.saving = false;
if (r.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.init();
} else {
this.saving = false;
}
});
} }
}; }
};
</script> </script>
<style>
<style></style> </style>
\ No newline at end of file
\ No newline at end of file
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