From 52a302b11c08cbc564ff3931038ae57a305a95d6 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 23 一月 2024 09:23:52 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue
index daa8cb2..79f3511 100644
--- a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue
+++ b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue
@@ -92,6 +92,11 @@
                                     v-model="row.files"/>
                   </template>
                 </el-table-column>
+                <el-table-column v-if="stepMarker=='pzxrk_first'" fixed="right" label="鎿嶄綔" align="center">
+                  <template slot-scope="scope">
+                    <zt-table-button @click="deleteRow(scope.$index,scope.row.id)">鍒犻櫎</zt-table-button>
+                  </template>
+                </el-table-column>
               </el-table>
               <div v-if="showAddAndEdit && !dataForm.disabled" class="icon-container">
                 <el-dropdown @command="handleCommand">
@@ -248,6 +253,7 @@
   import AddOrUpdateCheck from '../testCheckOrder/TestCheckOrder-AddOrUpdate'
   import qs from "qs";
   import Cookies from "js-cookie";
+  import cloneDeep from "lodash/cloneDeep";
 
   export default {
     data() {
@@ -329,7 +335,7 @@
           console.log(row.libraryType,"row.libraryType")
           this.dataForm.configItemWarehouse.libraryType = row.libraryType
         }
-        this.getInfo()
+        this.getInfo2()
         if (!this.dataForm.disabled) {
           if (!row.stepMarker) {
             this.stepMarker = 'pzxrk_first'
@@ -372,17 +378,13 @@
         this.$set(row, 'checkId', checkId)
       },
       // 鑾峰彇淇℃伅
-      async getInfo() {
+      async getInfo2() {
         let params = {
           warehouseId: this.dataForm.id,
           projectId: this.dataForm.projectId,
           libraryType:this.dataForm.configItemWarehouse.libraryType
         }
         let res = await this.$http.get(`/configItemWarehouse/ConfigItemWarehouse/getDto`, {params: params})
-        this.dataForm = {
-          ...this.dataForm,
-          ...res.data
-        }
         if (this.dataForm.project === null) {
           this.dataForm.project = {}
         }
@@ -392,7 +394,21 @@
         if (this.dataForm.flowInfoDto === null) {
           this.dataForm.flowInfoDto = {}
         }
+        setTimeout(()=>{
+          this.dataForm = {
+            ...this.dataForm,
+            ...res.data
+          }
+        },100)
         console.log(this.dataForm, "getInfo this.dataForm")
+      },
+      async deleteRow(index, id){
+          if (await this.$tip.confirm(this.$t('prompt.info', {'handle': this.$t('delete')}))) {
+            if (id != null) {
+            let res = await this.$http.delete('/configItemWarehouse/WarehouseConfigItem/', {data: [id]})
+          }
+            this.dataForm.configItemList.splice(index, 1)
+        }
       },
       async print(){
         var params = qs.stringify({
@@ -404,6 +420,19 @@
       },
       // 琛ㄥ崟鎻愪氦
       async formSubmit(submitType) {
+        let isFiles = true;
+        this.dataForm.configItemList.forEach(item => {
+          console.log(item, "his.dataForm.technicalList.forEach")
+          item.files.groups.forEach(groups => {
+            groups.fields.forEach(files => {
+              if (files.files.length === 0) {
+                this.$alert("褰撳墠瀛樺湪鏈笂浼犻檮浠剁殑鎶�鏈祫鏂欙紝璇烽噸鏂颁笂浼�")
+                isFiles = false
+                return isFiles
+              }
+            })
+          })
+        })
         if (this.showColumn && submitType == 'bl') {
           for (let item of this.dataForm.configItemList) {
             if (item) {
@@ -414,7 +443,10 @@
             }
           }
         }
-        if (submitType == 'tj' || submitType == 'bl') {
+        if (submitType === 'tj' || submitType === 'bl') {
+          if (!isFiles){
+            return
+          }
           let flowInfo = {
             flowCode: 'pzxrk',
             stepIdMark: this.stepMarker,

--
Gitblit v1.9.1