Jelajahi Sumber

人员附件修改

@dongkboy 4 bulan lalu
induk
melakukan
8cfaad425d

File diff ditekan karena terlalu besar
+ 410 - 308
src/views/operationManagement/modules/addOperation.vue


+ 209 - 214
src/views/personnel/modules/addOperation.vue

@@ -42,8 +42,8 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :span="12 " v-if="operationForm.isAddSalesman == '1'">
-                <el-form-item prop="typeAttr" label="业务员类型" >
+              <el-col :span="12" v-if="operationForm.isAddSalesman == '1'">
+                <el-form-item prop="typeAttr" label="业务员类型">
                   <el-select v-model="operationForm.typeAttr" placeholder="请选择业务员类型" @change="typeAttrChange">
                     <el-option key="1" value="6" label="个代"></el-option>
                     <el-option key="2" value="8" label="渠道"></el-option>
@@ -59,13 +59,13 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :span="12" >
+              <el-col :span="12">
                 <el-form-item prop="deptId" label="所属机构">
                   <!-- <el-select v-model="operationForm.deptId" placeholder="请选择所属机构">
                           <el-option key="1" value="机构1"></el-option>
                         </el-select> -->
-                  <el-cascader  clearable style="width: 100%"
-                    v-model="operationForm.deptId" :options="tableData" :props="tableProps" @change="deptChange" />
+                  <el-cascader clearable style="width: 100%" v-model="operationForm.deptId" :options="tableData"
+                    :props="tableProps" @change="deptChange" />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -275,19 +275,19 @@
           <template #default>
             <el-form-item prop="" label="身份证(人像面)" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!IDCardFront" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 1)">
+                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 'sfz1')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="file-box">
                   <div class="btn-top">
-                    <img class="image-close" @click="deleteImage(1)" src="@/assets/images/close.png" />
+                    <img class="image-close" @click="deleteImage('sfz1')" src="@/assets/images/close.png" />
                     <!--                    <el-icon class="btn-icon"><Delete /></el-icon>-->
                   </div>
                   <img class="file-img" :src="IDCardFront" />
                   <div class="btn-bottom">
                     <el-upload class="width-50" :show-file-list="false" :auto-upload="false" accept=".png, .jpg, .jpeg"
-                      @change="uploadImage($event, 1)"
+                      @change="uploadImage($event, 'sfz1')"
                       style="display: flex; align-items: center; justify-content: center; color: white">
                       <el-icon>
                         <Upload />
@@ -295,7 +295,7 @@
                     </el-upload>
                     <div class="width-50"
                       style="display: flex; align-items: center; justify-content: center; color: white; cursor:pointer;"
-                      @click="downloadImage(1)">
+                      @click="downloadImage('sfz1')">
                       <el-icon>
                         <Download />
                       </el-icon>下载资料
@@ -324,19 +324,19 @@
             </el-form-item>
             <el-form-item prop="" label="身份证(国徽面)" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!IDCardBack" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 2)">
+                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 'sfz2')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="file-box">
                   <div class="btn-top">
-                    <img class="image-close" @click="deleteImage(2)" src="@/assets/images/close.png" />
+                    <img class="image-close" @click="deleteImage('sfz2')" src="@/assets/images/close.png" />
                     <!--                    <el-icon class="btn-icon"><Delete /></el-icon>-->
                   </div>
                   <img class="file-img" :src="IDCardBack" />
                   <div class="btn-bottom">
                     <el-upload class="width-50" :show-file-list="false" :auto-upload="false" accept=".png, .jpg, .jpeg"
-                      @change="uploadImage($event, 2)"
+                      @change="uploadImage($event, 'sfz2')"
                       style="display: flex; align-items: center; justify-content: center; color: white">
                       <el-icon>
                         <Upload />
@@ -344,48 +344,30 @@
                     </el-upload>
                     <div class="width-50"
                       style="display: flex; align-items: center; justify-content: center; color: white; cursor:pointer;"
-                      @click="downloadImage(2)">
+                      @click="downloadImage('sfz2')">
                       <el-icon>
                         <Download />
                       </el-icon>下载资料
                     </div>
                   </div>
                 </div>
-                <!--                <div class="fileName">{{ IDCardBackName }}</div>
-                <div class="fileBtn">
-                  <el-upload
-                    :auto-upload="false"
-                    action="#"
-                    :show-file-list="false"
-                    accept=".png, .jpg, .jpeg"
-                    @change="uploadImage($event, 2)"
-                    style="display: flex; align-items: center"
-                  >
-                    <el-icon class="btn-icon"><Upload /></el-icon>
-                  </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(2)"
-                    ><View
-                  /></el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(2)"><Download /></el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(2)"><Delete /></el-icon>
-                </div>-->
               </div>
             </el-form-item>
-            <el-form-item prop="" label="银行卡" label-width="150" label-position="left">
-              <el-upload :auto-upload="false" v-if="!bankSize" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 3)">
+            <el-form-item prop="" label="展业资格证" label-width="150" label-position="left">
+              <el-upload :auto-upload="false" v-if="!businessLicense" action="#" :show-file-list="false"
+                accept=".png, .jpg, .jpeg" @change="uploadImage($event, 'qualification')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
                 <div class="file-box">
                   <div class="btn-top">
-                    <img class="image-close" @click="deleteImage(3)" src="@/assets/images/close.png" />
+                    <img class="image-close" @click="deleteImage('qualification')" src="@/assets/images/close.png" />
                     <!--                    <el-icon class="btn-icon"><Delete /></el-icon>-->
                   </div>
-                  <img class="file-img" :src="bankSize" />
+                  <img class="file-img" :src="businessLicense" />
                   <div class="btn-bottom">
                     <el-upload class="width-50" :show-file-list="false" :auto-upload="false" accept=".png, .jpg, .jpeg"
-                      @change="uploadImage($event, 3)"
+                      @change="uploadImage($event, 'qualification')"
                       style="display: flex; align-items: center; justify-content: center; color: white">
                       <el-icon>
                         <Upload />
@@ -393,36 +375,18 @@
                     </el-upload>
                     <div class="width-50"
                       style="display: flex; align-items: center; justify-content: center; color: white; cursor:pointer;"
-                      @click="downloadImage(3)">
+                      @click="downloadImage('qualification')">
                       <el-icon>
                         <Download />
                       </el-icon>下载资料
                     </div>
                   </div>
                 </div>
-                <!--                <div class="fileName">{{ bankName }}</div>
-                <div class="fileBtn">
-                  <el-upload
-                    :auto-upload="false"
-                    action="#"
-                    :show-file-list="false"
-                    accept=".png, .jpg, .jpeg"
-                    @change="uploadImage($event, 3)"
-                    style="display: flex; align-items: center"
-                  >
-                    <el-icon class="btn-icon"><Upload /></el-icon>
-                  </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(3)"
-                    ><View
-                  /></el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(3)"><Download /></el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(3)"><Delete /></el-icon>
-                </div>-->
               </div>
             </el-form-item>
             <el-form-item prop="" label="劳动合同" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!contract" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 4)">
+                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'contract')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
@@ -431,19 +395,19 @@
                 <div class="fileName">{{ contractName }}</div>
                 <div class="fileBtn">
                   <el-upload :auto-upload="false" action="#" :show-file-list="false"
-                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 4)"
+                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'contract')"
                     style="display: flex; align-items: center">
                     <el-icon class="btn-icon">
                       <Upload />
                     </el-icon>
                   </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(4)">
+                  <el-icon class="btn-icon" @click="imageView('contract')">
                     <View />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(4)">
+                  <el-icon class="btn-icon" @click="downloadImage('contract')">
                     <Download />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(4)">
+                  <el-icon class="btn-icon" @click="deleteImage('contract')">
                     <Delete />
                   </el-icon>
                 </div>
@@ -451,7 +415,7 @@
             </el-form-item>
             <el-form-item prop="" label="应聘表" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!applicant" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 5)">
+                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'applicant')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
@@ -460,19 +424,19 @@
                 <div class="fileName">{{ applicantName }}</div>
                 <div class="fileBtn">
                   <el-upload :auto-upload="false" action="#" :show-file-list="false"
-                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 5)"
+                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'applicant')"
                     style="display: flex; align-items: center">
                     <el-icon class="btn-icon">
                       <Upload />
                     </el-icon>
                   </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(5)">
+                  <el-icon class="btn-icon" @click="imageView('applicant')">
                     <View />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(5)">
+                  <el-icon class="btn-icon" @click="downloadImage('applicant')">
                     <Download />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(5)">
+                  <el-icon class="btn-icon" @click="deleteImage('applicant')">
                     <Delete />
                   </el-icon>
                 </div>
@@ -480,7 +444,7 @@
             </el-form-item>
             <el-form-item prop="" label="定薪表" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!decidePay" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 6)">
+                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'salaryTable')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
@@ -489,19 +453,19 @@
                 <div class="fileName">{{ decidePayName }}</div>
                 <div class="fileBtn">
                   <el-upload :auto-upload="false" action="#" :show-file-list="false"
-                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 6)"
+                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'salaryTable')"
                     style="display: flex; align-items: center">
                     <el-icon class="btn-icon">
                       <Upload />
                     </el-icon>
                   </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(6)">
+                  <el-icon class="btn-icon" @click="imageView('salaryTable')">
                     <View />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(6)">
+                  <el-icon class="btn-icon" @click="downloadImage('salaryTable')">
                     <Download />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(6)">
+                  <el-icon class="btn-icon" @click="deleteImage('salaryTable')">
                     <Delete />
                   </el-icon>
                 </div>
@@ -509,7 +473,7 @@
             </el-form-item>
             <el-form-item prop="" label="离职表" label-width="150" label-position="left">
               <el-upload :auto-upload="false" v-if="!dimission" action="#" :show-file-list="false"
-                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 7)">
+                accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'leaveTable')">
                 <el-button link type="primary" icon="Upload">上传</el-button>
               </el-upload>
               <div class="fileInfo" v-else>
@@ -518,19 +482,19 @@
                 <div class="fileName">{{ dimissionName }}</div>
                 <div class="fileBtn">
                   <el-upload :auto-upload="false" action="#" :show-file-list="false"
-                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 7)"
+                    accept=".png, .jpg, .jpeg, .pdf, .doc, .docx" @change="uploadImage($event, 'leaveTable')"
                     style="display: flex; align-items: center">
                     <el-icon class="btn-icon">
                       <Upload />
                     </el-icon>
                   </el-upload>
-                  <el-icon class="btn-icon" @click="imageView(7)">
+                  <el-icon class="btn-icon" @click="imageView('leaveTable')">
                     <View />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="downloadImage(7)">
+                  <el-icon class="btn-icon" @click="downloadImage('leaveTable')">
                     <Download />
                   </el-icon>
-                  <el-icon class="btn-icon" @click="deleteImage(7)">
+                  <el-icon class="btn-icon" @click="deleteImage('leaveTable')">
                     <Delete />
                   </el-icon>
                 </div>
@@ -568,6 +532,7 @@ import image from "@/assets/images/image.png";
 import pdf from "@/assets/images/pdf.png";
 import word from "@/assets/images/word.png";
 import VueOfficeDocx from "@vue-office/docx";
+import { el } from "element-plus/es/locale/index.mjs";
 
 interface dictType {
   value: string;
@@ -608,70 +573,49 @@ onMounted(async () => {
         id: route.query.id || "",
       })
       .then((res: any) => {
-        // console.log(res);
         if (res.code === 200) {
           operationForm.value = res.data;
           console.log(operationForm.value)
           if (operationForm.value.typeAttr != 6) {
             initTeamData(operationForm.value.typeAttr === '5' ? '1' : operationForm.value.typeAttr === '8' ? '2' : operationForm.value.typeAttr === '7' ? '3' : '')
           }
-          let formData = res.data
-          if (formData.fileList) {
-            let sfz1 = formData.fileList.find(item => item.fileType == 'sfz1')
-            let sfz2 = formData.fileList.find(item => item.fileType == 'sfz2')
-            let qualification = formData.fileList.find(item => item.fileType == 'bankCard')
-            let contractImg = formData.fileList.find(item => item.fileType == 'contract')
-            let applicantImg = formData.fileList.find(item => item.fileType == 'applicant')
-            let salaryTable = formData.fileList.find(item => item.fileType == 'salary')
-            let leaveTable = formData.fileList.find(item => item.fileType == 'leave')
-            if (sfz1) {
-              operationForm.value.sfz1 = sfz1.id
-              IDCardFrontName.value = sfz1.fileName
-              IDCardFront.value = sfz1.fileUrl
-              sfz1.value = sfz1.id
-            }
-            if (sfz2) {
-              operationForm.value.sfz2 = sfz2.id
-              IDCardBackName.value = sfz2.fileName
-              IDCardBack.value = sfz2.fileUrl
-              sfz2.value = sfz2.id
-
-            }
-            if (qualification) {
-              operationForm.value.bankCard = qualification.id
-              bankName.value = qualification.fileName
-              bankSize.value = qualification.fileUrl
-              bankCard.value = qualification.id
-            }
-            if (contractImg) {
-              operationForm.value.contract = contractImg.id
-              contractName.value = contractImg.fileName
-              contract.value = contractImg.fileUrl
-              contractId.value = contractImg.id
-
-
-            }
-            if (applicantImg) {
-              operationForm.value.applicant = applicantImg.id
-              applicantName.value = applicantImg.fileName
-              applicant.value = applicantImg.fileUrl
-              applicantId.value = applicantImg.id
+          res.data.fileList.map((item: any) => {
+            switch (item.fileType) {
+              case "sfz1":
+                IDCardFrontName.value = res.data.fileName;
+                IDCardFront.value = res.data.downloadUrl;
+                break;
+              case "sfz2":
+                IDCardBackName.value = res.data.fileName;
+                IDCardBack.value = res.data.downloadUrl;
+                break;
+              case "qualification":
+                businessLicenseName.value = res.data.fileName;
+                businessLicense.value = res.data.downloadUrl;
+                break;
+              case "contract":
+                contractName.value = res.data.fileName;
+                contract.value = res.data.downloadUrl;
+                break;
+              case "applicant":
+                applicantName.value = res.data.fileName;
+                applicant.value = res.data.downloadUrl;
+                break
+              case "salaryTable":
+                decidePayName.value = res.data.fileName;
+                decidePay.value = res.data.downloadUrl;
+                break;
+              case "leaveTable":
+                dimissionName.value = res.data.fileName;
+                dimission.value = res.data.downloadUrl;
 
+                break;
             }
-            if (salaryTable) {
-              operationForm.value.salaryTable = salaryTable.id
-              decidePayName.value = salaryTable.fileName
-              decidePay.value = salaryTable.fileUrl
-              salaryTable.value = salaryTable.id
-
-            }
-            if (leaveTable) {
-              operationForm.value.leaveTable = leaveTable.id
-              dimissionName.value = leaveTable.fileName
-              dimission.value = leaveTable.fileUrl
-              leaveTable.value = leaveTable.id;
-            }
-          }
+          })
+          fileListId.value = res.data.fileList.map((item: any) => ({
+            fileId: item.fileId,
+            fileType: item.fileType
+          }))
           if (res.data.address == null) {
             operationForm.value.address = []
           }
@@ -868,35 +812,29 @@ const institutionList = () => {
     }
   })
 }
-
+let fileListId = ref<{ fileId: string, fileType: string }[]>([]); // 上传文件id
 // 身份证人像面
 let IDCardFrontName = ref("");
 let IDCardFront = ref("");
-let sfz1 = ref("");
 // 身份证国徽面
 let IDCardBackName = ref("");
 let IDCardBack = ref("");
-let sfz2 = ref("");
-// 银行卡
-let bankName = ref("");
-let bankSize = ref("");
-let bankCard = ref("");
+// 展业资格证
+let businessLicenseName = ref("");
+let businessLicense = ref("");
 // 劳务合同
 let contractName = ref("");
 let contract = ref("");
-let contractId = ref("");
 // 应聘表
 let applicantName = ref("");
 let applicant = ref("");
-let applicantId = ref("");
 // 定薪表
 let decidePayName = ref("");
 let decidePay = ref("");
-let salaryTable = ref('')
 // 离职表
 let dimissionName = ref("");
 let dimission = ref("");
-let leaveTable = ref("");
+
 // 图片预览地址
 let imageShow = ref(false);
 let imageUrl = ref("");
@@ -931,55 +869,124 @@ function deptChange(e: any) {
 //数组去重
 
 // 上传图片
-const uploadImage = (file, type) => {
+const uploadImage = (file: any, type: string) => {
   let files = file.raw;
-  let url = window.URL.createObjectURL(files); //转临时路径
   const params = new FormData(); // 声明formData数据类型
   params.append("file", files);
-  console.log(files)
-
-  // params.append("multipartFile", files);
-  // params.append("type", "image");
   api.areaApi.fileUpload(params).then((res: any) => {
     if (res.code === 200) {
       switch (type) {
-        case 1:
+        case "sfz1":
           IDCardFrontName.value = res.data.fileName;
           IDCardFront.value = res.data.downloadUrl;
-          sfz1.value = res.data.id
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 2:
+        case "sfz2":
           IDCardBackName.value = res.data.fileName;
           IDCardBack.value = res.data.downloadUrl;
-          sfz2.value = res.data.id
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 3:
-          bankName.value = res.data.fileName;
-          bankSize.value = res.data.downloadUrl;
-          bankCard.value = res.data.id
+        case "qualification":
+          businessLicenseName.value = res.data.fileName;
+          businessLicense.value = res.data.downloadUrl;
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 4:
+        case "contract":
           contractName.value = res.data.fileName;
           contract.value = res.data.downloadUrl;
-          contractId.value = res.data.id
-
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 5:
+        case "applicant":
           applicantName.value = res.data.fileName;
           applicant.value = res.data.downloadUrl;
-          applicantId.value = res.data.id
-
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 6:
+        case "salaryTable":
           decidePayName.value = res.data.fileName;
           decidePay.value = res.data.downloadUrl;
-          salaryTable.value = res.data.id
-
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
-        case 7:
+        case "leaveTable":
           dimissionName.value = res.data.fileName;
           dimission.value = res.data.downloadUrl;
-          leaveTable.value = res.data.id;
+          if (fileListId.value.some(v => v.fileType == type)) {
+            fileListId.value.map(val => {
+              if (val.fileType == type) {
+                val.fileId = res.data.id;
+              }
+            })
+          } else {
+            fileListId.value.push({
+              fileId: res.data.id,
+              fileType: type
+            })
+          }
           break;
       }
     }
@@ -1018,59 +1025,59 @@ const download = (url, name) => {
   // image.src = url
 }
 
-const downloadImage = (type) => {
+const downloadImage = (type: string) => {
   switch (type) {
-    case 1:
+    case "sfz1":
       download(IDCardFront.value, IDCardFrontName.value)
       break;
-    case 2:
+    case "sfz2":
       download(IDCardBack.value, IDCardBackName.value)
       break;
-    case 3:
-      download(bankSize.value, bankName.value)
+    case "qualification":
+      download(businessLicense.value, businessLicenseName.value)
       break;
-    case 4:
+    case "contract":
       download(contract.value, contractName.value)
       break;
-    case 5:
+    case "applicant":
       download(applicant.value, applicantName.value)
       break;
-    case 6:
+    case "salaryTable":
       download(decidePay.value, decidePayName.value)
       break;
-    case 7:
+    case "leaveTable":
       download(dimission.value, dimissionName.value)
       break;
   }
 }
 // 图片删除
-const deleteImage = (type) => {
+const deleteImage = (type: string) => {
   switch (type) {
-    case 1:
+    case "sfz1":
       IDCardFront.value = ''
       IDCardFrontName.value = ''
       break;
-    case 2:
+    case "sfz2":
       IDCardBack.value = ''
       IDCardBackName.value = ''
       break;
-    case 3:
-      bankSize.value = ''
-      bankName.value = ''
+    case "qualification":
+      businessLicense.value = ''
+      businessLicenseName.value = ''
       break;
-    case 4:
+    case "contract":
       contract.value = ''
       contractName.value = ''
       break;
-    case 5:
+    case "applicant":
       applicant.value = ''
       applicantName.value = ''
       break;
-    case 6:
+    case "salaryTable":
       decidePay.value = ''
       decidePayName.value = ''
       break;
-    case 7:
+    case "leaveTable":
       dimission.value = ''
       dimissionName.value = ''
       break;
@@ -1087,21 +1094,21 @@ const filePreview = (file) => {
   })
 }
 
-const imageView = (type) => {
+const imageView = (type: string) => {
   switch (type) {
-    case 1:
+    case "sfz1":
       imageShow.value = true;
       imageUrl.value = IDCardFront.value;
       break;
-    case 2:
+    case "sfz2":
       imageShow.value = true;
       imageUrl.value = IDCardBack.value;
       break;
-    case 3:
+    case "qualification":
       imageShow.value = true;
-      imageUrl.value = bankSize.value;
+      imageUrl.value = businessLicense.value;
       break;
-    case 4:
+    case "contract":
       imageUrl.value = contract.value;
       nextTick(() => {
         // loadPdf(contract.value)
@@ -1117,7 +1124,7 @@ const imageView = (type) => {
         }
       })
       break;
-    case 5:
+    case "applicant":
       imageUrl.value = applicant.value;
       nextTick(() => {
         // loadPdf(applicant.value)
@@ -1131,7 +1138,7 @@ const imageView = (type) => {
         }
       })
       break;
-    case 6:
+    case "salaryTable":
       imageUrl.value = decidePay.value;
       nextTick(() => {
         // loadPdf(decidePay.value)
@@ -1145,7 +1152,7 @@ const imageView = (type) => {
         }
       })
       break;
-    case 7:
+    case "leaveTable":
       imageUrl.value = dimission.value;
       nextTick(() => {
         // loadPdf(dimission.value)
@@ -1167,6 +1174,8 @@ const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
     emits("closeDialog", false);
     return;
   }
+  console.log(fileListId.value)
+  // return
   await OperationFormRef.validate((valid) => {
     if (valid) {
       if (!route.query.id) {
@@ -1176,15 +1185,8 @@ const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
           city: operationForm.value.address?.length ? operationForm.value.address[1] : '',
           district: operationForm.value.address?.length ? operationForm.value.address[2] : '',
           deptId: operationForm.value.deptId,
-          typeAttr: operationForm.value.isAddSalesman=='1'?operationForm.value.typeAttr:2,
-          sfz1: sfz1.value,
-          sfz2: sfz2.value,
-          bankCard:bankCard.value,
-          contract: contractId.value,
-          applicant: applicantId.value,
-          salaryTable: salaryTable.value,
-          leaveTable: leaveTable.value,
-
+          typeAttr: operationForm.value.isAddSalesman == '1' ? operationForm.value.typeAttr : 2,
+          fileList: fileListId.value
         }).then((res: any) => {
           // console.log(123, res);
           if (res.code === 200) {
@@ -1199,16 +1201,9 @@ const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
           city: operationForm.value.address?.length ? operationForm.value.address[1] : '',
           district: operationForm.value.address?.length ? operationForm.value.address[2] : '',
           deptId: operationForm.value.deptId,
-          typeAttr: operationForm.value.isAddSalesman=='1'?operationForm.value.typeAttr:2,
-          sfz1: sfz1.value,
-          sfz2: sfz2.value,
-          bankCard: bankCard.value,
-          contract: contractId.value,
-          applicant: applicantId.value,
-          salaryTable: salaryTable.value,
-          leaveTable: leaveTable.value,
+          typeAttr: operationForm.value.isAddSalesman == '1' ? operationForm.value.typeAttr : 2,
+          fileList: fileListId.value,
           id: operationForm.value.id
-
         }).then((res: any) => {
           // console.log(123, res);
           if (res.code === 200) {

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini