Commit b2f7c682 authored by 姬鋆屾's avatar 姬鋆屾

推修改请假记录弹窗内的部门和请假人联动

parent d397307c
...@@ -18,6 +18,15 @@ ...@@ -18,6 +18,15 @@
:maxLength="10" :maxLength="10"
:disabled="pageInfo.type == 'view'" :disabled="pageInfo.type == 'view'"
/> --> /> -->
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
type="select"
placeholder="请选择所属部门"
:enumData="dict.deptId"
@change="changeDept(form.deptId)"
/>
<Field <Field
label="请假人" label="请假人"
prop="leavePerson" prop="leavePerson"
...@@ -26,20 +35,11 @@ ...@@ -26,20 +35,11 @@
remote remote
v-model="form.leavePerson" v-model="form.leavePerson"
placeholder="请输入请假人" placeholder="请输入请假人"
@change="changeStaff(form.leavePerson)" :remote-method="remoteMethod"
:maxLength="10" :maxLength="10"
:enumData="dict.staffList" :enumData="dict.staffList"
:disabled="pageInfo.type == 'view'" :disabled="pageInfo.type == 'view'"
/> />
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
type="select"
placeholder="请选择所属部门"
:enumData="dict.deptId"
:disabled="true"
/>
<!-- <Field label="所属部门" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入所属部门"/> --> <!-- <Field label="所属部门" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入所属部门"/> -->
<Field <Field
label="电话号码" label="电话号码"
...@@ -228,6 +228,17 @@ export default { ...@@ -228,6 +228,17 @@ export default {
this.remoteMethod(); this.remoteMethod();
}, },
methods: { methods: {
changeDept(val) {
console.log(val);
this.form.leavePerson = "";
let arr = this.staffList.filter((v) => v.deptId == val);
let obj = {};
for (let key in arr) {
obj[arr[key].id] = arr[key].name;
}
this.dict.staffList = obj;
console.log(this.staffList);
},
changeStaff(val) { changeStaff(val) {
let person = this.staffList.filter((v) => v.id == val); let person = this.staffList.filter((v) => v.id == val);
this.form.deptId = person ? person[0].deptId : ""; this.form.deptId = person ? person[0].deptId : "";
......
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