From b496da6315314d9bd048ac2214d8bc95d2f1df02 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期三, 13 十一月 2024 08:59:18 +0800 Subject: [PATCH] 优化 --- company/src/components/enterprise/addEmployeeWithDu.vue | 49 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 36 insertions(+), 13 deletions(-) diff --git a/company/src/components/enterprise/addEmployeeWithDu.vue b/company/src/components/enterprise/addEmployeeWithDu.vue index 7565552..1988fb2 100644 --- a/company/src/components/enterprise/addEmployeeWithDu.vue +++ b/company/src/components/enterprise/addEmployeeWithDu.vue @@ -14,7 +14,7 @@ <el-form-item label="韬唤璇佸彿" required> <el-input v-model="item.idCard" maxlength="18" placeholder="璇疯緭鍏�"></el-input> </el-form-item> - <el-form-item label="娲鹃仯鍗曚綅" > + <el-form-item label="娲鹃仯鍗曚綅" v-if="!companyId"> <el-select v-model="item.duId" @change="selectChange(index)" placeholder="璇烽�夋嫨" clearable> <el-option v-for="item in dispatching" @@ -57,6 +57,7 @@ tempIndex: -1, dispatching: [], solutionId: null, + companyId: null, list: [ { memberName: '', @@ -79,6 +80,7 @@ this.visible = true this.tempIndex = tempIndex this.solutionId = obj.solutionId + this.companyId = obj.companyId this.dispatching = [] this.list = [ { @@ -94,7 +96,14 @@ ] this.arr = obj.arr this.price = obj.price - this.getFindListByDTO() + if (!obj.companyId) { + this.getFindListByDTO() + } else { + worktype({ id: obj.solutionId, queryType: 0 }) + .then(res => { + this.list[0].options = res + }) + } }, getFindListByDTO () { findListByDTO({ @@ -128,17 +137,31 @@ }) }, add () { - this.list.push({ - memberName: '', - idCard: '', - workTypeName: '', - worktypeId: '', - duName: '', - duId: '', - options: [], - fee: '', - id: this.tempIndex - 1 - }) + if (!this.companyId) { + this.list.push({ + memberName: '', + idCard: '', + workTypeName: '', + worktypeId: '', + duName: '', + duId: '', + options: [], + fee: '', + id: this.tempIndex - 1 + }) + } else { + this.list.push({ + memberName: '', + idCard: '', + workTypeName: '', + worktypeId: '', + duName: '', + duId: '', + options: JSON.parse(JSON.stringify(this.list[0].options)), + fee: '', + id: this.tempIndex - 1 + }) + } }, dele (index) { this.list.splice(index, 1) -- Gitblit v1.9.3