huangmp преди 2 години
родител
ревизия
b8b232075e
променени са 1 файла, в които са добавени 81 реда и са изтрити 18 реда
  1. 81 18
      src/views/modules/order/tgorder.vue

+ 81 - 18
src/views/modules/order/tgorder.vue

@@ -918,7 +918,8 @@ export default {
     this.status = this.sts === 0 ? null : Number(this.sts)
 
     // 携带参数查询
-    this.getDataList(this.page, this.$route.query)
+    // 携带参数查询
+    this.init(this.page, this.$route.query)
 
     // 请求物流公司
     this.getLogisticsList()
@@ -927,7 +928,8 @@ export default {
     // 携带参数查询
     var query = this.$route.query
     if (Object.keys(query).length > 0) {
-      this.getDataList(this.page, query)
+      // 携带参数查询
+      this.init(this.page, query)
     }
   },
   mounted () {
@@ -948,22 +950,34 @@ export default {
 
   },
   methods: {
-    orderConfirmPay(order){
-      this.$confirm('确定完成支付吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        let dataBody = {"orderNumbers": order.orderNumber, "payType":9};
-        this.$http({
-          url: this.$http.adornUrl('/order/order/pay'),
-          method: 'post',
-          data:this.$http.adornData(dataBody)
-        }).then(({ data }) => {
-          this.$message.success("下单确认成功")
-          this.getDataList(this.page)
-        })
-      });
+      orderConfirmPay(order){
+        let _this = this
+        if (order.orderItems[0].actualTotal === 0.01){
+          toConfirmPay()
+        }else{
+          this.orderAmountUpdateVisible = true
+          this.$nextTick(()=>{
+            this.$refs.orderAmountUpdate.init(order)
+            this.$refs.orderAmountUpdate.setOrderAmountAndFreight(order, toConfirmPay)
+          })
+        }
+        function toConfirmPay() {
+          _this.$confirm('确定完成支付吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            let dataBody = {"orderNumbers": order.orderNumber, "payType":9};
+            _this.$http({
+              url: _this.$http.adornUrl('/order/order/pay'),
+              method: 'post',
+              data:_this.$http.adornData(dataBody)
+            }).then(({ data }) => {
+              _this.$message.success("下单确认成功")
+              _this.getDataList(this.page)
+            })
+          });
+        }
     },
     scanDelivery(order){
 
@@ -1291,6 +1305,55 @@ export default {
       this.confirmList = []  // 清空确认列表
     },
 
+    init (page, params, newData = false) {
+      page = (page === undefined ? this.page : page)
+      this.dataListLoading = true
+      if (newData || !this.theData) {
+        this.theData = {
+          current: page == null ? this.page.currentPage : page.currentPage,
+          size: page == null ? this.page.pageSize : page.pageSize,
+          'orderNumber': this.dataForm.orderNumber,
+          'orderType': this.dataForm.orderType,
+          'orderMold': this.dataForm.orderMold,
+          'payType': this.dataForm.payType,
+          'receiver': this.dataForm.receiver,
+          'mobile': this.dataForm.mobile,
+          'status': this.status,
+          'dvyType': this.dataForm.dvyType,
+          'stationName': this.dataForm.stationName,
+          'refundStatus': this.dataForm.refundStatus,
+          'startTime': this.dateRange === null ? null : this.dateRange[0], // 开始时间
+          'endTime': this.dateRange === null ? null : this.dateRange[1], // 结束时间
+          'startProductNums': this.productNumsRange === null ? null : this.productNumsRange[0], // 订购数量起
+          'endProductNums': this.productNumsRange === null ? null : this.productNumsRange[1], // 订购数量起
+          'auditStatus': this.dataForm.auditStatus, // 审阅状态
+          'prodName': this.dataForm.prodName, // 产品名称,
+          'dvyFlowId': this.dataForm.dvyFlowId, //快递单号
+          'skuName': this.dataForm.skuName,
+          'isPromotion': this.dataForm.isPromotion,
+          'prodZone': this.dataForm.prodZone,
+          'actualTotal': 0.01
+        }
+      } else {
+        this.theData.current = page == null ? this.page.currentPage : page.currentPage
+        this.theData.size = page == null ? this.page.pageSize : page.pageSize
+        this.theData.status = this.status
+      }
+      this.$http({
+        url: this.$http.adornUrl('/order/order/getTgPage'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign(this.theData, params
+          ), false
+        )
+      }).then(({ data }) => {
+        this.dataList = data.records
+        this.page.total = data.total
+        this.sts = !this.status ? 0 : this.status
+        this.dataListLoading = false
+        this.activeName = !this.status ? '0' : this.status + ''
+      })
+    },
     /**
      * 获取数据列表
      */