|
@@ -12,7 +12,7 @@
|
|
|
<el-form-item label="离职人" prop="resign_uid">
|
|
|
<!-- :disabled="parmValue1.type == 1" -->
|
|
|
<search-account
|
|
|
- :disabled="isDetail"
|
|
|
+ :disabled="status != 0"
|
|
|
:is-detail="isDetail"
|
|
|
:value="ruleForm.resign_uid"
|
|
|
:size="searchSize"
|
|
@@ -25,7 +25,7 @@
|
|
|
<!--
|
|
|
-->
|
|
|
<search-account
|
|
|
- :disabled="isDetail"
|
|
|
+ :disabled="status != 0"
|
|
|
:is-detail="isDetail"
|
|
|
:value="ruleForm.hand_uid"
|
|
|
:size="searchSize"
|
|
@@ -34,20 +34,32 @@
|
|
|
@searchChange="handleHandoverName"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- isDetail:{{ isDetail }} ---------id:{{ id }}-------status{{ status }}
|
|
|
+ isDetail:{{ isDetail }} ---------id:{{ id }}-------status{{
|
|
|
+ status == 0
|
|
|
+ }}
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="id === 'add'">{{
|
|
|
- id === "add" ? "保 存" : "关 闭"
|
|
|
- }}</el-button>
|
|
|
- <!-- <el-button type="primary" @click="submitForm('flow')" v-if="isBtn"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitForm"
|
|
|
+ v-if="id === 'add' || status != 1"
|
|
|
+ >{{ id === "add" || status != 1 ? "保 存" : "关 闭" }}</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitForm('flow')"
|
|
|
+ v-if="status == 0 && id != 'add'"
|
|
|
>保 存 并 发 起 流 程
|
|
|
- </el-button> -->
|
|
|
- <!-- <el-button @click="closeAddEdit" v-if="isBtn"
|
|
|
- >取 消 审 核 流 程</el-button
|
|
|
- > -->
|
|
|
- <el-button @click="closeAdd"> 关 闭</el-button>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click="closeAddEdit"
|
|
|
+ v-if="status == 0 && id != 'add'"
|
|
|
+ type="danger"
|
|
|
+ >作 废 审 核 流 程</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-button @click="closeAdd" v-if="id == 'add'"> 关 闭</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -56,7 +68,7 @@ import asyncRequest from "@/apis/service/interest/handover";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
export default {
|
|
|
name: "handover",
|
|
|
- props: ["id", "isDetail", "showModelThis"],
|
|
|
+ props: ["id", "isDetail", "showModelThis", "newTime"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
return {
|
|
@@ -107,12 +119,19 @@ export default {
|
|
|
this.initForm();
|
|
|
}
|
|
|
},
|
|
|
+ newTime: function (val) {
|
|
|
+ console.log(val);
|
|
|
+ if (val) {
|
|
|
+ this.initForm();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 关闭弹窗,直接隐藏表单
|
|
|
async closeAddEdit() {
|
|
|
- this.$emit("closeModel", false); //抛出一个事件,关闭弹窗
|
|
|
- const res = await asyncRequest.delete({ id: this.parmValue1.id });
|
|
|
+ // this.$emit("closeModel", false); //抛出一个事件,关闭弹窗
|
|
|
+ console.log("121");
|
|
|
+ const res = await asyncRequest.delete({ id: this.id });
|
|
|
console.log(res);
|
|
|
if (res && res.code === 0) {
|
|
|
window.vm.$router.push({
|
|
@@ -125,7 +144,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
closeAdd() {
|
|
|
- this.$emit("closeModel", false);
|
|
|
+ // window.vm.$router.push({
|
|
|
+ // path: "handover",
|
|
|
+ // });
|
|
|
+ this.showModelThis = false;
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
@@ -135,7 +157,7 @@ export default {
|
|
|
this.rulesThis = this.rules;
|
|
|
await this.resetForm();
|
|
|
} else {
|
|
|
- if (this.isDetail) {
|
|
|
+ if (this.status == 1) {
|
|
|
this.rulesThis = {};
|
|
|
} else {
|
|
|
this.rulesThis = this.rules;
|
|
@@ -150,7 +172,7 @@ export default {
|
|
|
const model = {
|
|
|
// id: this.parmValue1.id,
|
|
|
};
|
|
|
- console.log(model);
|
|
|
+ // console.log(model);
|
|
|
const res = await asyncRequest.detail({ id: this.id });
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
let { hand_name, resign_name, hand_uid, resign_uid, id, status } =
|
|
@@ -187,53 +209,55 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async submitForm(flow) {
|
|
|
- await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- let resign_uid = this.ruleForm.resign_uid;
|
|
|
- let hand_uid = this.ruleForm.hand_uid;
|
|
|
- if (resign_uid.toString() !== hand_uid.toString()) {
|
|
|
- this.loading = true;
|
|
|
- const model = {
|
|
|
- id: this.ruleForm.id,
|
|
|
- resign_uid: resign_uid.toString(),
|
|
|
- hand_uid: hand_uid.toString(),
|
|
|
- };
|
|
|
- let res = {};
|
|
|
- if (this.id === "add") {
|
|
|
- delete model["id"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
- } else {
|
|
|
- res = await asyncRequest.update(model);
|
|
|
- if (flow == "flow") {
|
|
|
- this.updateStatus();
|
|
|
- }
|
|
|
- }
|
|
|
- window.vm.$router.push({
|
|
|
- path: "handover",
|
|
|
- });
|
|
|
- this.loading = false;
|
|
|
- if (res && res.code === 0) {
|
|
|
- const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
- this.$notify.success({
|
|
|
- title,
|
|
|
- message: "",
|
|
|
- });
|
|
|
- this.showModelThis = false;
|
|
|
- // 刷新
|
|
|
- this.$emit("refresh", false);
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message.error("离职人和接收人不能相同");
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ console.log("12");
|
|
|
+ this.$emit("refreshDom",this.ruleForm);
|
|
|
+ // await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ // if (valid) {
|
|
|
+ // let resign_uid = this.ruleForm.resign_uid;
|
|
|
+ // let hand_uid = this.ruleForm.hand_uid;
|
|
|
+ // if (resign_uid.toString() !== hand_uid.toString()) {
|
|
|
+ // this.loading = true;
|
|
|
+ // const model = {
|
|
|
+ // id: this.ruleForm.id,
|
|
|
+ // resign_uid: resign_uid.toString(),
|
|
|
+ // hand_uid: hand_uid.toString(),
|
|
|
+ // };
|
|
|
+ // let res = {};
|
|
|
+ // if (this.id === "add") {
|
|
|
+ // delete model["id"];
|
|
|
+ // res = await asyncRequest.add(model);
|
|
|
+ // } else {
|
|
|
+ // res = await asyncRequest.update(model);
|
|
|
+ // if (flow == "flow") {
|
|
|
+ // this.updateStatus();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // window.vm.$router.push({
|
|
|
+ // // path: "handover",
|
|
|
+ // // });
|
|
|
+ // this.loading = false;
|
|
|
+ // if (res && res.code === 0) {
|
|
|
+ // const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
+ // this.$notify.success({
|
|
|
+ // title,
|
|
|
+ // message: "",
|
|
|
+ // });
|
|
|
+ // this.showModelThis = false;
|
|
|
+ // // 刷新
|
|
|
+ // this.$emit("refresh", false);
|
|
|
+ // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ // await this.logout();
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // this.$message.error("离职人和接收人不能相同");
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // console.log("error submit!!");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
async updateStatus() {
|
|
|
let { id, type } = this.ruleForm;
|