Quellcode durchsuchen

物流单装箱调整

qymljy vor 11 Monaten
Ursprung
Commit
b8098f3abe

+ 6 - 2
src/HDrpManagement/logistics/details/index.vue

@@ -24,7 +24,7 @@
           <defalutInfo :mainData="mainData" ref="info"></defalutInfo>
         </div>
         <div slot="slot1" >
-          <dispatchTable ref="dispatch" @onInit="onInit" @rowClick="rowClick" :needQuery="true" :status="mainData.status" :delSuccess="delSuccess"></dispatchTable>
+          <dispatchTable ref="dispatch" @onInit="onInit" @rowClick="rowClick" :needQuery="true" :status="mainData.status" @delSuccess="delSuccess" @isEmpty="$refs.dismx.tableData = []"></dispatchTable>
           <dismx ref="dismx" style="margin-top: 10px" type="edit" :status="mainData.status" :logistics_qty_editable="logistics_qty_editable"></dismx>
         </div>
         <div  slot="slot2">
@@ -234,7 +234,11 @@
         this.$refs.dismx.listData(data.sa_orderid,data.sa_logistics_itemsid)
       },
       delSuccess(data){
-        this.$refs.dismx.listData(data.sa_orderid,data.sa_logistics_itemsid)
+        console.log(data,data.length)
+        if (data.length == 0){
+          this.$refs.dismx.tableData = []
+        }
+        // this.$refs.dismx.listData(data.sa_orderid,data.sa_logistics_itemsid)
       },
       async queryEdit(){
         const res = await this.$api.requested({

+ 9 - 2
src/HDrpManagement/logistics/details/tabs/logisticsBox/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button type="primary" size="small" @click="drawer = true">{{$t(`新建装箱信息`)}}</el-button>
+    <el-button type="primary" size="small" @click="addShow">{{$t(`新建装箱信息`)}}</el-button>
     <el-drawer
       :title="$t(`新建装箱信息`)"
       :visible.sync="drawer"
@@ -81,6 +81,7 @@
               </el-table-column>
               <el-table-column
                 :label="$t('操作')"
+                fixed="right"
                 width="90">
                 <template slot-scope="scope">
                   <el-button type="text" size="mini" @click="deleteRow(scope.row)">{{$t('删 除')}}</el-button>
@@ -89,7 +90,7 @@
             </el-table>
           </el-col>
           <el-col :span="24 - setcol">
-            <logisticsCanUseProduct ref="logislist" :sa_logistics_boxid="0" @onConfirm="onConfirm">
+            <logisticsCanUseProduct ref="logislist" :sa_logistics_boxid="0" @onConfirm="onConfirm" :addList="tableData">
               <el-button class="inline-16" slot="allBtn" type="primary" size="small" @click="handlePullData">{{$t(`一键全选`)}}</el-button>
             </logisticsCanUseProduct>
           </el-col>
@@ -129,6 +130,12 @@ export default {
     uploadAllData
   },
   methods:{
+    addShow(){
+      this.drawer = true
+      this.tableData = []
+      this.$refs.logislist.tableData = []
+      this.setcol = 24
+    },
    onSubmit (){
       this.$refs.form.validate(async(valid)=>{
         if (!valid) return false

+ 1 - 0
src/HDrpManagement/logistics/details/tabs/logisticsBox/edit.vue

@@ -68,6 +68,7 @@
               </el-table-column>
               <el-table-column
                 :label="$t('操作')"
+                fixed="right"
                 width="90">
                 <template slot-scope="scope">
                   <el-button type="text" size="mini" @click="deleteRow(scope.row)">{{$t('删 除')}}</el-button>

+ 1 - 0
src/HDrpManagement/logistics/details/tabs/logisticsBox/logisticsBox.vue

@@ -19,6 +19,7 @@
         </el-table-column>
         <el-table-column
           :label="$t('操作')"
+          fixed="right"
           width="120">
           <template slot-scope="scope">
             <!-- <el-button class="inline-16" type="text" size="small" slot="reference">{{$t('编 辑')}}</el-button> -->

+ 7 - 4
src/HDrpManagement/logistics/modules/dispatchTable.vue

@@ -63,16 +63,19 @@
             }
           }
         })
+        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){
           this.$emit('isCorrelation',res.data.length,res.data)
         }
-
         res.data && res.data.length > 0?this.rowClick(res.data[0]):''
-        // if (val == '删除'){
-        //   this.$emit('delSuccess',res.data[0])
-        // }
+        if (res.data.length == 0){
+          this.$emit('isEmpty')
+        }
+        if (val == '删除'){
+          this.$emit('delSuccess',res.data)
+        }
       },
       rowClick (row) {
         this.$emit('rowClick',row)

+ 1 - 0
src/HDrpManagement/logistics/modules/edit.vue

@@ -148,6 +148,7 @@ export default {
       this.$nextTick(()=>{
         this.$refs['ent'].form.enterprisename = this.data.enterprisename
         this.$refs['logis'].form.abbreviation = this.data.logiscomp_enterprisename
+        this.selectList = []
         this.$refs.dislist.listData()
         this.setcol = 24
       })

+ 41 - 20
src/template/logisticsCanUseProduct/index.vue

@@ -57,31 +57,31 @@
         :label="$t(`装箱数量`)">
       </el-table-column>
     </el-table>
-    <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:['sa_logistics_boxid'],
+  props:['sa_logistics_boxid','addList'],
   data () {
     return {
       params:{
         "id": 20230110112204,
         "content": {
           "pageNumber": 1,
-          "pageSize": 20,
+          "pageSize": 99999,
           "sa_logisticsid":0,
           "sa_logistics_boxid":1,
           "where": {
@@ -98,15 +98,36 @@ export default {
   },
   methods:{
     async listData () {
+      console.log(this.addList)
       this.params.content.sa_logisticsid = this.$route.query.id
       this.params.content.sa_logistics_boxid = this.sa_logistics_boxid
       const res = await this.$api.requested(this.params)
       res.data.forEach(e => {
         e.remarks = ''
       });
-      this.tableData = res.data
-      this.total = res.total
-      this.currentPage = res.pageNumber
+      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.itemid == i.itemid){
+              float = 1
+            }
+          })
+          if (float != 1){
+            dataNew[indexof] = res.data[indexs]
+            indexof = indexof + 1
+          }
+        })
+        this.tableData = dataNew
+
+      }else {
+        this.tableData = res.data
+      }
+      // this.tableData = res.data
+      // this.total = res.total
+      // this.currentPage = res.pageNumber
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -122,10 +143,10 @@ export default {
       this.tableSelectData = val
     },
     onConfirm () {
-      this.tableData.forEach((item,index) => {
-        this.tableSelectData.forEach(item2 => {
+      this.tableSelectData.forEach((item,index) => {
+        this.tableData.forEach((item2,indexs) => {
           if (item.itemid == item2.itemid) {
-            this.tableData.splice(index,1)
+            this.tableData.splice(indexs,1)
           }
         })
       })

+ 1 - 0
src/template/logisyticCanUseDisBill/index.vue

@@ -65,6 +65,7 @@
           const res = await this.$api.requested(this.params)
 
           // this.tableData = res.data
+
           if (this.addList && this.addList.length > 0){
             let indexof = 0
             let dataNew = []