From d4e287e1002aa8d547490374bc386b71d18032ea Mon Sep 17 00:00:00 2001
From: zzw <wander.zheng@qq.com>
Date: 星期五, 23 二月 2024 10:51:18 +0800
Subject: [PATCH] 编号

---
 web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue
index daa8cb2..13128b3 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,7 +420,19 @@
       },
       // 琛ㄥ崟鎻愪氦
       async formSubmit(submitType) {
-        if (this.showColumn && submitType == 'bl') {
+        let isFiles = true;
+        let flag = true;
+        console.log(this.dataForm, "this.dataForm11111")
+        this.dataForm.configItemList.forEach(item => {
+          if (parseInt(item.secretClass) > localStorage.getItem('userSecretClass')) {
+            this.$alert("褰撳墠椤圭洰璁剧疆鐨勫瘑绾ч珮浜庡綋鍓嶇敤鎴风殑瀵嗙骇锛岃閲嶆柊璁剧疆")
+            flag =false
+          }
+        })
+        if (!flag){
+          return
+        }
+        if (this.showColumn && submitType === 'bl') {
           for (let item of this.dataForm.configItemList) {
             if (item) {
               if (this.pageNameCode[item.itemName] && !item.checkId) {
@@ -414,7 +442,22 @@
             }
           }
         }
-        if (submitType == 'tj' || submitType == 'bl') {
+        if (submitType === 'tj' || submitType === 'bl') {
+          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 (!isFiles){
+            return
+          }
           let flowInfo = {
             flowCode: 'pzxrk',
             stepIdMark: this.stepMarker,

--
Gitblit v1.9.1