Browse Source

物流单详情页面调整删除接口

qymljy 5 months ago
parent
commit
ec58bf2e0b

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

@@ -64,9 +64,9 @@
             }
           }
         })
-        if(res.data.length > 0) this.$emit('onInit',res.data[0]);
+        if(res.data && res.data.length > 0) this.$emit('onInit',res.data[0]);
         this.tableData = res.data
-        this.$emit('isCorrelation',res.data.length)
+        this.$emit('isCorrelation',res.data.length,res.data)
         console.log(this.tableData);
 
         res.data.length > 0?this.rowClick(res.data[0]):''

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

@@ -69,7 +69,7 @@ ed<template>
             <dispatch-table type="edit" :needQuery="true" ref="dislist" @isCorrelation="isCorrelation" @delSuccess="delSuccess"></dispatch-table>
           </el-col>
           <el-col :span="24 - setcol">
-            <add-disbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm"></add-disbill>
+            <add-disbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm" :addList="selectList"></add-disbill>
           </el-col>
         </el-row>
       </div>
@@ -117,6 +117,7 @@ export default {
       visible:false,
       setcol:24,
       isCorrelate:0,
+      selectList:[],
       form:{
        "freightamount": "",
         "logisticno": "",
@@ -155,8 +156,9 @@ export default {
     delSuccess(){
       this.$refs['addbill'].listData()
     },
-    isCorrelation(val){
+    isCorrelation(val,data){
       this.isCorrelate = val
+      this.selectList = data
     },
     addMoreBill () {
       if (this.enterpriseInfo === null) return this.$message({
@@ -182,6 +184,7 @@ export default {
       this.$refs['dislist'].tableData = unique([...this.$refs['dislist'].tableData,...data],'billno')
       this.isCorrelate = this.$refs.dislist.tableData.length
       this.form.remarks = this.$refs['dislist'].tableData[0].remarks
+      this.selectList = this.$refs['dislist'].tableData
     },
     async onSubmit () {
       this.form.sa_dispatchids = this.$refs['dislist'].tableData.map(e=>{

+ 4 - 4
src/HDrpManagement/logistics/modules/productlist.vue

@@ -63,10 +63,9 @@
         width="90">
         <template slot-scope="scope">
           <el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}</el-tag>
-
         </template>
       </el-table-column>
-      <el-table-column v-if="type === 'edit'" width="90" fixed="right">
+      <el-table-column v-if="type === 'edit'" width="90" fixed="right" :label="$t('操作')">
         <template slot-scope="scope">
           <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">{{$t('删 除')}}</el-button>
         </template>
@@ -132,9 +131,10 @@ export default {
     },
     async deleteOrderProduct (row) {
       const res = await this.$api.requested({
-        "id": 20221115104803,
+        "id": 2025071013452502,
         "content": {
-          "sa_dispatch_itemsids": [row.sa_dispatch_itemsid]
+          "sa_logisticsid":this.$route.query.id,
+          "sa_logistics_items_mxids": [row.sa_logistics_items_mxid]
         },
       })
       this.tool.showMessage(res,()=>{

+ 43 - 16
src/template/logisyticCanUseDisBill/index.vue

@@ -16,24 +16,24 @@
         <div v-else>{{scope.column.data[scope.column.columnname]||scope.column.columnname ==='operation'?scope.column.data[scope.column.columnname] : '--'}}</div>
       </template>
     </tableDetail>
-    <div style="margin-top:16px;text-align:right">
-      <el-pagination
-        background
-        small
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-size="params.content.pageSize"
-        layout="total, prev, pager, next, jumper"
-        :total="total">
-      </el-pagination>
-    </div>
+<!--    <div style="margin-top:16px;text-align:right">-->
+<!--      <el-pagination-->
+<!--        background-->
+<!--        small-->
+<!--        @size-change="handleSizeChange"-->
+<!--        @current-change="handleCurrentChange"-->
+<!--        :current-page="currentPage"-->
+<!--        :page-size="params.content.pageSize"-->
+<!--        layout="total, prev, pager, next, jumper"-->
+<!--        :total="total">-->
+<!--      </el-pagination>-->
+<!--    </div>-->
   </div>
 </template>
 
   <script>
     export default {
-      props:['data','paytype'],
+      props:['data','paytype','addList'],
       data() {
         return {
           tableSelectData:[],
@@ -58,13 +58,40 @@
       },
       methods:{
         async listData () {
+          console.log('重新查询')
+          this.tableData = []
           this.params.content.sa_logisticsid = this.$route.query.id?this.$route.query.id:0
           this.params.content.sys_enterpriseid = this.data.sys_enterpriseid
           this.params.content.paytype = this.params.content.freightstatus = this.paytype
           const res = await this.$api.requested(this.params)
-          this.tableData = res.data
-          this.total = res.total
-          this.currentPage = res.pageNumber
+          console.log(this.addList,'列表1111')
+          // this.tableData = res.data
+          if (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
+                }
+              })
+              console.log(float,'float')
+              if (float != 1){
+                dataNew[indexof] = res.data[indexs]
+                indexof = indexof + 1
+              }
+            })
+            this.tableData = dataNew
+            console.log(res.data,'11111')
+            console.log(this.tableData,'1111%%%%')
+
+          }else {
+            this.tableData = res.data
+          }
+
+          // this.total = res.total
+          // this.currentPage = res.pageNumber
         },
         handleSizeChange(val) {
           // console.log(`每页 ${val} 条`);