|
@@ -1,6 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <el-row :gutter="10">
|
|
|
|
- <!-- v-if="isShowForm" -->
|
|
|
|
|
|
+ <el-row :gutter="10" :loading="loading">
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form
|
|
<el-form
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
@@ -12,8 +11,9 @@
|
|
>
|
|
>
|
|
<el-form-item label="离职人" prop="resign_name">
|
|
<el-form-item label="离职人" prop="resign_name">
|
|
<search-account
|
|
<search-account
|
|
- :value="ruleForm.resign_name"
|
|
|
|
|
|
+ :value="ruleForm.id"
|
|
:size="searchSize"
|
|
:size="searchSize"
|
|
|
|
+ :names="ruleForm.resign_name[0]"
|
|
:disabled="isDetail"
|
|
:disabled="isDetail"
|
|
:placeholder="'离职人名称'"
|
|
:placeholder="'离职人名称'"
|
|
@searchChange="handleResignName"
|
|
@searchChange="handleResignName"
|
|
@@ -21,18 +21,16 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="接受人" prop="hand_name">
|
|
<el-form-item label="接受人" prop="hand_name">
|
|
<search-account
|
|
<search-account
|
|
- :value="ruleForm.hand_name"
|
|
|
|
|
|
+ :value="ruleForm.id"
|
|
:size="searchSize"
|
|
:size="searchSize"
|
|
|
|
+ :names="ruleForm.hand_name[0]"
|
|
:disabled="isDetail"
|
|
:disabled="isDetail"
|
|
:placeholder="'接受人名称'"
|
|
:placeholder="'接受人名称'"
|
|
@searchChange="handleHandoverName"
|
|
@searchChange="handleHandoverName"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- 123 showModel:{{ showModel }} + id:{{ id }} + isDetail:{{
|
|
|
|
- isDetail
|
|
|
|
- }}
|
|
|
|
- showModelThis:{{ showModelThis }}
|
|
|
|
|
|
+ 123:{{ ruleForm.id }}{{ ruleForm.resign_name[0] }}
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" style="text-align: right">
|
|
<el-col :span="24" style="text-align: right">
|
|
<el-button v-if="!isDetail" type="primary" @click="submitForm"
|
|
<el-button v-if="!isDetail" type="primary" @click="submitForm"
|
|
@@ -48,35 +46,22 @@
|
|
import asyncRequest from "@/apis/service/interest/handover";
|
|
import asyncRequest from "@/apis/service/interest/handover";
|
|
import resToken from "@/mixins/resToken";
|
|
import resToken from "@/mixins/resToken";
|
|
export default {
|
|
export default {
|
|
- name: "Account",
|
|
|
|
- props: ["id", "isDetail", "showModelThis"],
|
|
|
|
|
|
+ name: "handover",
|
|
|
|
+ props: ["id", "isDetail", "showModelThis", "parmValue1"],
|
|
mixins: [resToken],
|
|
mixins: [resToken],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- isShowForm: true, //控制表格显示隐藏
|
|
|
|
|
|
+ parmValue: "parmValue",
|
|
roleList: [],
|
|
roleList: [],
|
|
loading: false,
|
|
loading: false,
|
|
- // title: "添加离职交接",
|
|
|
|
showModelThis: this.showModel,
|
|
showModelThis: this.showModel,
|
|
- // hand_uid: "", //接受人ID
|
|
|
|
- // resign_uid: "", //离职人ID
|
|
|
|
ruleForm: {
|
|
ruleForm: {
|
|
resign_name: [], //离职人
|
|
resign_name: [], //离职人
|
|
- // leaves_part: [], //离职人部门
|
|
|
|
hand_name: [], //交接人
|
|
hand_name: [], //交接人
|
|
- // Handover_part: [], //交接人部门
|
|
|
|
|
|
+ id: [],
|
|
},
|
|
},
|
|
rulesThis: this.rules,
|
|
rulesThis: this.rules,
|
|
rules: {
|
|
rules: {
|
|
- // leaves_part: [
|
|
|
|
- // {
|
|
|
|
- // type: "array",
|
|
|
|
- // required: true,
|
|
|
|
- // message: "请选择离职人部门",
|
|
|
|
- // trigger: "change",
|
|
|
|
- // },
|
|
|
|
- // ],
|
|
|
|
-
|
|
|
|
resign_name: [
|
|
resign_name: [
|
|
{
|
|
{
|
|
type: "array",
|
|
type: "array",
|
|
@@ -85,14 +70,6 @@ export default {
|
|
trigger: "change",
|
|
trigger: "change",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- // Handover_part: [
|
|
|
|
- // {
|
|
|
|
- // type: "array",
|
|
|
|
- // message: "请选择接受人部门",
|
|
|
|
- // required: true,
|
|
|
|
- // trigger: "change",
|
|
|
|
- // },
|
|
|
|
- // ],
|
|
|
|
hand_name: [
|
|
hand_name: [
|
|
{
|
|
{
|
|
type: "array",
|
|
type: "array",
|
|
@@ -104,24 +81,17 @@ export default {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- // watch: {
|
|
|
|
- // showModel: function (val) {
|
|
|
|
- // this.showModelThis = val;
|
|
|
|
- // if (val) {
|
|
|
|
- // console.log("初始化");
|
|
|
|
- // this.initForm();
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // showModelThis(val) {
|
|
|
|
- // if (!val) {
|
|
|
|
- // this.$emit("cancel");
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // },
|
|
|
|
- // created
|
|
|
|
mounted() {
|
|
mounted() {
|
|
this.initForm();
|
|
this.initForm();
|
|
|
|
+ console.log(this.ruleForm);
|
|
|
|
+ console.log(this.parmValue1);
|
|
},
|
|
},
|
|
|
|
+ // watch: {
|
|
|
|
+ // parmValue: function (newV, oldV) {
|
|
|
|
+ // console.log(newV);
|
|
|
|
+ // console.log(oldV);
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
methods: {
|
|
methods: {
|
|
// 关闭弹窗,直接隐藏表单
|
|
// 关闭弹窗,直接隐藏表单
|
|
closeAddEdit() {
|
|
closeAddEdit() {
|
|
@@ -131,30 +101,37 @@ export default {
|
|
|
|
|
|
async initForm() {
|
|
async initForm() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- // console.log(this.id);add
|
|
|
|
- if (this.id === "add") {
|
|
|
|
- this.title = "添加离职交接";
|
|
|
|
- this.rulesThis = this.rules;
|
|
|
|
- await this.resetForm();
|
|
|
|
- } else {
|
|
|
|
- if (this.isDetail) {
|
|
|
|
- // this.title = "离职交接详情";
|
|
|
|
- this.rulesThis = {};
|
|
|
|
- }
|
|
|
|
- await this.resetForm();
|
|
|
|
- await this.initData();
|
|
|
|
|
|
+ // if (this.id === "add") {
|
|
|
|
+ // // this.title = "添加离职交接";
|
|
|
|
+ // this.rulesThis = this.rules;
|
|
|
|
+ // await this.resetForm();
|
|
|
|
+ // } else {
|
|
|
|
+ // if (this.isDetail) {
|
|
|
|
+ // this.rulesThis = {};
|
|
|
|
+ // }
|
|
|
|
+ // await this.resetForm();
|
|
|
|
+ // await this.initData();
|
|
|
|
+ // }
|
|
|
|
+ console.log("initform");
|
|
|
|
+ if (this.isDetail) {
|
|
|
|
+ this.rulesThis = {};
|
|
}
|
|
}
|
|
|
|
+ await this.resetForm();
|
|
|
|
+ await this.initData();
|
|
this.loading = false;
|
|
this.loading = false;
|
|
},
|
|
},
|
|
-
|
|
|
|
async initData() {
|
|
async initData() {
|
|
- const res = await asyncRequest.detail({ id: this.id });
|
|
|
|
|
|
+ console.log(this.parmValue1);
|
|
|
|
+ const res = await asyncRequest.detail({ id: this.parmValue1.id });
|
|
if (res && res.code === 0 && res.data) {
|
|
if (res && res.code === 0 && res.data) {
|
|
console.log(res);
|
|
console.log(res);
|
|
- let { hand_name, resign_name } = res.data;
|
|
|
|
- console.log(hand_name + "12" + resign_name);
|
|
|
|
|
|
+ let { hand_name, resign_name, id } = res.data;
|
|
this.ruleForm.resign_name = hand_name.split(",");
|
|
this.ruleForm.resign_name = hand_name.split(",");
|
|
this.ruleForm.hand_name = resign_name.split(",");
|
|
this.ruleForm.hand_name = resign_name.split(",");
|
|
|
|
+ // this.ruleForm.id = id.split(",");
|
|
|
|
+ this.ruleForm.id = id.split(",");
|
|
|
|
+
|
|
|
|
+ console.log(this.ruleForm.id);
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
await this.logout();
|
|
await this.logout();
|
|
} else {
|
|
} else {
|
|
@@ -175,17 +152,16 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
async submitForm() {
|
|
async submitForm() {
|
|
- let resign_name = this.ruleForm.resign_name;
|
|
|
|
- let hand_name = this.ruleForm.hand_name;
|
|
|
|
- if (resign_name != "" && resign_name !== hand_name) {
|
|
|
|
- await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let resign_name1 = this.ruleForm.resign_name;
|
|
|
|
+ let hand_name1 = this.ruleForm.hand_name;
|
|
|
|
+ if (resign_name1.toString() !== hand_name1.toString()) {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- console.log();
|
|
|
|
const model = {
|
|
const model = {
|
|
id: this.id,
|
|
id: this.id,
|
|
- resign_uid: this.ruleForm.resign_name.toString(),
|
|
|
|
- hand_uid: this.ruleForm.hand_name.toString(),
|
|
|
|
|
|
+ resign_uid: resign_name1.toString(),
|
|
|
|
+ hand_uid: hand_name1.toString(),
|
|
};
|
|
};
|
|
let res = {};
|
|
let res = {};
|
|
console.log(this.id);
|
|
console.log(this.id);
|
|
@@ -212,13 +188,15 @@ export default {
|
|
this.$message.warning(res.message);
|
|
this.$message.warning(res.message);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("error submit!!");
|
|
|
|
- return false;
|
|
|
|
|
|
+ console.log("12");
|
|
|
|
+
|
|
|
|
+ this.$message.error("离职人和接收人不能相同");
|
|
}
|
|
}
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("离职人和接收人不能相同");
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ console.log("error submit!!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
handleResignName(e) {
|
|
handleResignName(e) {
|