qymljy 9 месяцев назад
Родитель
Сommit
23d1e55af7

+ 12 - 5
src/HDrpManagement/logistics/modules/dispatchTable.vue

@@ -12,7 +12,7 @@
       <div v-else>{{scope.column.data[scope.column.columnname]||scope.column.columnname ==='operation'?scope.column.data[scope.column.columnname] : '--'}}</div>
     </template>
     <template v-slot:opreation="scope">
-      <el-button type="text" @click="deleteDisBill(scope.data)" size="small" :disabled="status != '新建'">{{$t('删 除')}}</el-button>
+      <el-button type="text" @click="deleteDisBill(scope.data,'删除')" size="small" :disabled="status != '新建'">{{$t('删 除')}}</el-button>
     </template>
   </tableDetail>
 </div>
@@ -33,7 +33,10 @@
       this.needQuery?this.listData():''
     },
     methods:{
-      async deleteDisBill (row) {
+      async deleteDisBill (row,val) {
+        if (val == '删除'){
+          this.needQuery = true
+        }
         if (this.needQuery) {
           const res = await this.$api.requested({
             "id": "20221122133404",
@@ -42,13 +45,18 @@
                 "sa_logistics_itemsids":[row.sa_logistics_itemsid]
             }
           })
-          this.tool.showMessage(res,()=>{
+          if (res.code == 0){
+            this.tool.showMessage(res,()=>{
+            })
+          }else {
             this.listData('删除')
-          })
+          }
+
         } else {
           this.tableData = this.tableData.filter(e=>{
             return e.sa_dispatchid !== row.sa_dispatchid
           })
+
         }
       },
       async listData(val){
@@ -63,7 +71,6 @@
             }
           }
         })
-        console.log(res.data,'111111数据输出')
         if(res.data && res.data.length > 0) this.$emit('onInit',res.data[0]);
         this.tableData = res.data
         if (res.data && res.data.length){

+ 2 - 2
src/HDrpManagement/logistics/modules/edit.vue

@@ -66,7 +66,7 @@ ed<template>
         </div>
         <el-row :gutter="10">
           <el-col :span="setcol">
-            <dispatch-table type="edit" :needQuery="true" ref="dislist" @isCorrelation="isCorrelation" @delSuccess="delSuccess" :status="data.status"></dispatch-table>
+            <dispatch-table type="edit" :needQuery="false" ref="dislist" @isCorrelation="isCorrelation" @delSuccess="delSuccess" :status="data.status"></dispatch-table>
           </el-col>
           <el-col :span="24 - setcol">
             <add-disbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm" :addList="selectList"></add-disbill>
@@ -149,7 +149,7 @@ export default {
         this.$refs['ent'].form.enterprisename = this.data.enterprisename
         this.$refs['logis'].form.abbreviation = this.data.logiscomp_enterprisename
         this.selectList = []
-        // this.$refs.dislist.listData()
+        this.$refs.dislist.listData()
         this.setcol = 24
       })