Przeglądaj źródła

物流单调整

qymljy 9 miesięcy temu
rodzic
commit
b21b8b1828

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

@@ -69,7 +69,7 @@ ed<template>
             <dispatch-table type="edit" :needQuery="false" ref="dislist" @isCorrelation="isCorrelation" @delSuccess="delSuccess" :status="data.status"></dispatch-table>
           </el-col>
           <el-col :span="24 - setcol">
-            <addDisbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm" :addList="selectList"></addDisbill>
+            <addDisbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm" :addList="selectList" type="编辑" :delList="delList"></addDisbill>
           </el-col>
         </el-row>
       </div>
@@ -119,21 +119,7 @@ export default {
       isCorrelate:0,
       selectList:[],
       delList:[],
-      form:{
-       "freightamount": "",
-        "logisticno": "",
-        "paytype": "",
-        "remarks": "",
-        "sa_dispatchids": [],
-        "sa_logiscompid": 0,
-        "sa_logisticsid": 0,
-        "sys_enterpriseid": '',
-        "carnum":"",
-        "logisphone":"",
-         "logiscontact":"",
-        "rec_contactsid":'',
-        "billdate":'',
-      },
+      form:{},
       enterpriseInfo:null,
        pickerOptions: {
         disabledDate(time) {
@@ -204,21 +190,6 @@ export default {
       this.tool.showMessage(res,()=>{
         this.drawer = false
         this.$emit('onSuccess')
-        this.form = {
-          "freightamount": "",
-          "logisticno": "",
-          "paytype": "",
-          "remarks": "",
-          "sa_dispatchids": [],
-          "sa_logiscompid": 0,
-          "sa_logisticsid": 0,
-          "sys_enterpriseid": '',
-          "carnum":"",
-          "logisphone":"",
-          "logiscontact":"",
-          "rec_contactsid":'',
-          "billdate":''
-        }
       })
       // if (res.code == 0){
       //   this.tool.showMessage(res,()=>{})

+ 47 - 17
src/template/logisyticCanUseDisBill/index.vue

@@ -33,7 +33,7 @@
 
   <script>
     export default {
-      props:['data','paytype','addList'],
+      props:['data','paytype','addList','type','delList'],
       data() {
         return {
           tableSelectData:[],
@@ -65,28 +65,58 @@
           const res = await this.$api.requested(this.params)
 
           // this.tableData = res.data
-
-          if (this.addList && this.addList.length > 0){
-            let indexof = 0
-            let dataNew = []
-            res.data.forEach((t,indexs)=>{
-              let float = 0
-              this.addList.forEach((i,index)=>{
-                if (t.sa_dispatchid == i.sa_dispatchid){
-                  float = 1
+          if (this.type == '编辑'){
+            if (this.addList && this.addList.length > 0){
+              let indexof = 0
+              let dataNew = []
+              res.data.forEach((t,indexs)=>{
+                let float = 0
+                this.addList.forEach((i,index)=>{
+                  if (t.sa_dispatchid == i.sa_dispatchid){
+                    float = 1
+                  }
+                })
+                if (float != 1){
+                  dataNew[indexof] = res.data[indexs]
+                  indexof = indexof + 1
                 }
               })
-              if (float != 1){
-                dataNew[indexof] = res.data[indexs]
-                indexof = indexof + 1
+              if (this.delList && this.delList.length > 0){
+                this.tableData = [...dataNew,...this.delList]
+              }else {
+                this.tableData = dataNew
               }
-            })
-            this.tableData = dataNew
-
+            }else {
+              if (this.delList && this.delList.length > 0){
+                this.tableData = [...res.data,...this.delList]
+              }else {
+                this.tableData = res.data
+              }
+            }
           }else {
-            this.tableData = res.data
+            if (this.addList && this.addList.length > 0){
+              let indexof = 0
+              let dataNew = []
+              res.data.forEach((t,indexs)=>{
+                let float = 0
+                this.addList.forEach((i,index)=>{
+                  if (t.sa_dispatchid == i.sa_dispatchid){
+                    float = 1
+                  }
+                })
+                if (float != 1){
+                  dataNew[indexof] = res.data[indexs]
+                  indexof = indexof + 1
+                }
+              })
+              this.tableData = dataNew
+
+            }else {
+              this.tableData = res.data
+            }
           }
 
+
           // this.total = res.total
           // this.currentPage = res.pageNumber
         },