qymljy 1 anno fa
parent
commit
2880fa9fd0

+ 54 - 34
src/HDrpManagement/orderManage/details/index.vue

@@ -172,7 +172,7 @@ export default {
       rebateamount:'',
       isusedrebate:'',
       checked:0,
-
+      typeNew:''
     }
   },
   provide () {
@@ -205,30 +205,46 @@ export default {
       this.options = res.data
       this.value = res.data[0].value
     },
-    async queryMainData(id) {
-      return new Promise(async (re,rj) => {
+    async queryMainData() {
+      if (this.typeNew == '提交'){
         const res = await this.$api.requested({
-          "id":'20221108151302',
+          "id": 20221108153402,
           "content": {
-            "nocache":true,
-            "sa_orderid": this.$route.query.id
+            "sa_orderid": this.mainData.sa_orderid,
+            "sys_enterpriseid": this.mainData.sys_enterpriseid,
+            "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
+            "reviewtype":''
+          },
+        })
+        this.tool.showMessage(res,async ()=>{
+          this.typeNew = ''
+          this.visible = false
+          this.queryMainData()
+        })
+      }else {
+        return new Promise(async (re,rj) => {
+          const res = await this.$api.requested({
+            "id":'20221108151302',
+            "content": {
+              "nocache":true,
+              "sa_orderid": this.$route.query.id
+            }
+          })
+          this.mainData = res.data
+          this.checked = this.mainData.rebate_used
+          if (this.mainData.rebateamount > this.mainData.defaultamount) {
+            this.rebateamount = this.tool.formatAmount(+this.mainData.defaultamount / 2)
+          } else {
+            this.rebateamount = this.mainData.rebateamount
           }
+          console.log(this.mainData);
+          this.$refs.prod.listData(this.$refs.prod.param.content.pageNumber = 1)
+          this.queryUsedrebate()
+          this.changeDataStructure()
+          this.orderreviewtype()
+          re()
         })
-        this.mainData = res.data
-        this.checked = this.mainData.rebate_used
-        if (this.mainData.rebateamount > this.mainData.defaultamount) {
-          this.rebateamount = this.tool.formatAmount(+this.mainData.defaultamount / 2)
-        } else {
-          this.rebateamount = this.mainData.rebateamount
-        }
-        console.log(this.mainData);
-        this.$refs.prod.listData(this.$refs.prod.param.content.pageNumber = 1)
-        this.queryUsedrebate()
-        this.changeDataStructure()
-        this.orderreviewtype()
-        re()
-      })
-
+      }
     },
     changeDataStructure() {
       let that = this
@@ -412,19 +428,23 @@ export default {
         cancelButtonText: this.$t('取消'),
         type: 'warning'
       }).then(async () => {
-        const res = await this.$api.requested({
-          "id": type === '审核'?20221108153502:20221108153402,
-          "content": {
-            "sa_orderid": this.mainData.sa_orderid,
-            "sys_enterpriseid": this.mainData.sys_enterpriseid,
-            "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
-            "reviewtype":type === '审核'?this.value:''
-          },
-        })
-        this.tool.showMessage(res,async ()=>{
-          this.visible = false
-          this.queryMainData()
-        })
+        if (this.$refs.prod.time == null){
+          const res = await this.$api.requested({
+            "id": type === '审核'?20221108153502:20221108153402,
+            "content": {
+              "sa_orderid": this.mainData.sa_orderid,
+              "sys_enterpriseid": this.mainData.sys_enterpriseid,
+              "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
+              "reviewtype":type === '审核'?this.value:''
+            },
+          })
+          this.tool.showMessage(res,async ()=>{
+            this.visible = false
+            this.queryMainData()
+          })
+        }else {
+          this.typeNew = type
+        }
       }).catch((err) => {
         this.$message({
           type: 'info',

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

@@ -449,6 +449,7 @@ export default {
       if(this.time !== null){
         clearTimeout(this.time);
       }
+      this.newData = val
       this.time = setTimeout(() => {
         val.amount = val.qty * val.price
         this.$set(this.tableData,index,val)
@@ -472,6 +473,7 @@ export default {
       })
     },
     async updateOrder (val,fn) {
+      console.log(this.typeNew,'shuchu1111***')
       const res  = await this.$api.requested({
         "id": 20221109093602,
         "content": val