diff --git a/src/views/rpm/rpj_show.vue b/src/views/rpm/rpj_show.vue index 8159a60e..768d2f94 100644 --- a/src/views/rpm/rpj_show.vue +++ b/src/views/rpm/rpj_show.vue @@ -14,8 +14,7 @@ {{ form.belong_dept_name }} {{ form.rparty_name }} - 添加成员 @@ -49,7 +48,8 @@ @@ -61,15 +61,14 @@ @@ -100,13 +99,9 @@ - - + :bindEmployee="bindEmployee" @success="showBindBltSuccess" @closed="showBindBltClose"> + + @@ -119,75 +114,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,13 +180,14 @@ export default { }, data() { return { - leaveVisible:false, - workerVisible:false, + certificatesOptions: [], + leaveVisible: false, + workerVisible: false, loading: false, visible: false, isSaveing: false, showBindBlt: false, - btnloading:false, + btnloading: false, state_: { 10: "创建中", 20: "审批中", @@ -228,7 +201,7 @@ export default { 30: "保安保洁服务", 40: "其他", }, - formworker : { + formworker: { duty: "", rcertificates: [], rpj: "", @@ -238,14 +211,14 @@ export default { bindType: 10, bindBtl: null, bindEmployee: '', - logLists:[], + logLists: [], rpjFileList: [], memeberList: [], - remployeeoptions:[], - reason:"", - leaveId:"", - workDialogType:"add", - workDialogTitle:"添加项目成员" + remployeeoptions: [], + reason: "", + leaveId: "", + workDialogType: "add", + workDialogTitle: "添加项目成员" }; }, @@ -310,7 +283,7 @@ export default { }); }, //成员变动操作日志 - getLogs(){ + getLogs() { this.$API.rpm.rpj.logs.req({ rpj: this.form.id, page: 0 }).then((res) => { debugger; this.logLists = res; @@ -327,16 +300,16 @@ export default { this.$API.rpm.rcertificate.list .req({ remployee: this.formworker.remployee, page: 0 }) .then((res) => { - this.certificatesOptions = res; - }); + this.certificatesOptions = res; + }); }, - addWorker(type,row){ + addWorker(type, row) { let that = this; that.workDialogType = type; - if(type=='add'){ + if (type == 'add') { that.workDialogTitle = "添加项目成员"; that.getremployee(); - }else{ + } else { that.workDialogTitle = "项目成员编辑"; that.formworker = row; that.formworker.remployee_name = row.remployee_.name; @@ -346,32 +319,32 @@ export default { } that.workerVisible = true; }, - //提交作业成员信息 - submitWorker() { + //提交作业成员信息 + submitWorker() { let that = this; that.btnloading = true; that.formworker.rpj = that.form.id; - if(that.workDialogType=="add"){ + if (that.workDialogType == "add") { that.$refs.workerForm.validate(async (valid) => { that.$API.rpm.member.create - .req(that.formworker) - .then((res) => { - that.$message.success("项目成员添加成功"); - that.workerVisible = false; - that.btnloading = false; - that.getMemberList(); - }) - .catch((err) => { - this.btnloading = false; - return err; - }); + .req(that.formworker) + .then((res) => { + that.$message.success("项目成员添加成功"); + that.workerVisible = false; + that.btnloading = false; + that.getMemberList(); + }) + .catch((err) => { + this.btnloading = false; + return err; + }); }); - }else{ + } else { let formworker = {}; formworker.is_manager = that.formworker.is_manager; formworker.rcertificates = that.formworker.rcertificates; that.$API.rpm.member.update - .req(that.formworker.id,formworker) + .req(that.formworker.id, formworker) .then((res) => { that.$message.success("项目成员证书添加成功"); that.workerVisible = false; @@ -383,31 +356,31 @@ export default { return err; }); } - + }, - leaveDialog(row){ + leaveDialog(row) { // debugger; this.leaveVisible = true; - this.leaveId=row.id; + this.leaveId = row.id; console.log(this.leaveId) }, - preLeave(){ + preLeave() { // debugger; this.btnloading = true; - if(this.reason!=''){ - this.$API.rpm.member.leave.req(this.leaveId,{reason:this.reason}).then(res=>{ + if (this.reason != '') { + this.$API.rpm.member.leave.req(this.leaveId, { reason: this.reason }).then(res => { this.leaveVisible = false; this.btnloading = false; this.getMemberList(); this.getLogs(); - }).catch(e=>{ + }).catch(e => { this.btnloading = false; }) - }else{ + } else { this.btnloading = false; this.$message.error("请填写离厂原因"); } - + }, }, };