From 50fb58286ed3b718c39a97e0987ee7561a295651 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 04 七月 2025 17:56:41 +0800
Subject: [PATCH] git ch

---
 company/src/components/enterprise/addEmployeeWithDu.vue |   63 ++++++++++++++++++++++++-------
 1 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/company/src/components/enterprise/addEmployeeWithDu.vue b/company/src/components/enterprise/addEmployeeWithDu.vue
index e181877..0e85fc6 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="hasDispatchUnit !== 1">
                 <el-select v-model="item.duId" @change="selectChange(index)" placeholder="璇烽�夋嫨" clearable>
                   <el-option
                       v-for="item in dispatching"
@@ -57,6 +57,8 @@
       tempIndex: -1,
       dispatching: [],
       solutionId: null,
+      companyId: null,
+      hasDispatchUnit: null,
       list: [
         {
           memberName: '',
@@ -79,6 +81,9 @@
       this.visible = true
       this.tempIndex = tempIndex
       this.solutionId = obj.solutionId
+      this.companyId = obj.companyId
+      this.hasDispatchUnit = obj.hasDispatchUnit
+      this.dispatching = []
       this.list = [
         {
           memberName: '',
@@ -93,7 +98,14 @@
       ]
       this.arr = obj.arr
       this.price = obj.price
-      this.getFindListByDTO()
+      if (obj.hasDispatchUnit === 0) {
+        this.getFindListByDTO()
+      } else {
+        worktype({ id: obj.solutionId, queryType: 0 })
+          .then(res => {
+            this.list[0].options = res
+          })
+      }
     },
     getFindListByDTO () {
       findListByDTO({
@@ -107,6 +119,7 @@
       this.list[index].options = []
       let duSolutionId = ''
       this.list[index].duName = null
+      this.list[index].worktypeId = ''
       this.dispatching.forEach(item => {
         if (item.id === this.list[index].duId) {
           duSolutionId = item.duSolutionId
@@ -119,7 +132,7 @@
         })
     },
     selectChangeWT (index) {
-      this.list[index].workTypeName =null
+      this.list[index].workTypeName = null
       this.list[index].options.forEach(item => {
         if (item.id === this.list[index].worktypeId) {
           this.list[index].workTypeName = item.name
@@ -127,17 +140,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)
@@ -166,6 +193,13 @@
           this.$message.warning(`绗�${i + 1}椤瑰憳宸ヨ韩浠借瘉涓嶅悎娉昤)
           return
         }
+        const s=parseInt(this.list[i].idCard.substring(16,17))
+        // const s = parseInt(this.list[i].idCard.slice(16, 1))
+        if (s % 2 === 0) {
+          this.list[i].sex = 1
+        } else {
+          this.list[i].sex = 0
+        }
       }
       // 鍒ゆ柇璇︽儏鍒楄〃鏁版嵁韬唤璇佹槸鍚︽湁閲嶅
       let next = true
@@ -180,6 +214,7 @@
         this.list.forEach(item => {
           item.fee = this.price
         })
+        console.log(this.list)
         this.$emit('result', this.list)
         this.visible = false
       } else {

--
Gitblit v1.9.3