Browse Source

订单管理调整折扣

qymljy 2 years ago
parent
commit
c34b6db8be
1 changed files with 34 additions and 2 deletions
  1. 34 2
      src/HDrpManagement/orderManage/details/tabs/productlist.vue

+ 34 - 2
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -255,7 +255,8 @@ export default {
       deleteIds:[],
       discountrate:null,
       hdkw:sessionStorage.getItem('hdkw'),
-      selectionChangeData:[]
+      selectionChangeData:[],
+      selectNumber:[]
     }
   },
   methods:{
@@ -267,6 +268,9 @@ export default {
       this.totalPage = Math.ceil(this.total /200)
       this.currentPage = res.pageNumber
       this.queryBasicInfo()
+      if (this.selectNumber[this.param.content.pageNumber -1]){
+        this.$refs.multipleTable.toggleRowSelection(this.tableData[3])
+      }
     },
     handlePullApi (pullApi) {
       pullApi.content = {
@@ -294,6 +298,15 @@ export default {
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
+
+      if (this.selectNumber[this.param.content.pageNumber -1]){
+        this.selectNumber[this.param.content.pageNumber -1] = this.selectionChangeData
+      }else {
+        this.selectNumber[this.param.content.pageNumber -1] = this.selectionChangeData
+      }
+      if (this.selectNumber[val - 1]){
+        this.$refs.multipleTable.toggleRowSelection(this.tableData[3])
+      }
       this.param.content.pageNumber = val
       this.listData()
     },
@@ -478,6 +491,16 @@ export default {
         },
       })
       this.freefreightamount = res.data.freefreightamount?res.data.freefreightamount:0
+      if (this.selectNumber[this.param.content.pageNumber -1]){
+        this.selectNumber[this.param.content.pageNumber -1].forEach(row => {
+          if (this.param.content.pageNumber > 1){
+            this.$refs.multipleTable.toggleRowSelection(this.tableData[(row.rowindex - (this.param.content.pageNumber * 10)) -1]);
+          }else {
+            this.$refs.multipleTable.toggleRowSelection(this.tableData[row.rowindex -1]);
+          }
+
+        })
+      }
     },
     async clockOrderRow (row) {
       const res = await this.$api.requested({
@@ -508,12 +531,21 @@ export default {
       }
     },
     async quickDiscountrate (row) {
+      this.selectNumber[this.param.content.pageNumber -1] = this.selectionChangeData
+      let itemids = []
+      for (var i=0;i<this.selectNumber.length ;i++){
+        let selectNow = this.selectNumber[i]
+        for (var j=0;j<selectNow.length;j++){
+          itemids.push(selectNow[j].itemid)
+        }
+
+      }
       const res = await this.$api.requested({
         "id": 20230508101703,
         "content": {
           "sa_orderid":this.$route.query.id,
           "discountrate":this.discountrate,
-          "itemids":this.selectionChangeData.map(e=>e.itemid)
+          "itemids":itemids
         },
       })
       this.tool.showMessage(res,()=>{