linwenxin hai 7 meses
pai
achega
b6f911dbf0
Modificáronse 1 ficheiros con 26 adicións e 25 borrados
  1. 26 25
      src/packageMaterial/pages/newSale/index.vue

+ 26 - 25
src/packageMaterial/pages/newSale/index.vue

@@ -138,35 +138,35 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
      }
    },
 
-   onLoad({type, oid = ''}) {
+  onLoad({type, oid = ''}) {
      this.type = type;
      this.hasOid = oid.length > 0;
      uni.setNavigationBarTitle({
       title: '配件收款'
      })
-     this.getWebsitList();
-     if(this.hasOid) {
-       this.$api.post('/pg/order/base/detail', {
-         orderBaseId: oid,
-       }).then((res) => {
-         const data = res.data;
-         this.orderNo = oid;
-         this.userMobile = data.userMobile;
-         this.websit = {
-           websitId: data.websitId,
-           name: data.websitName,
-         }
-         if(data.pgOrderProducts && data.pgOrderProducts.length > 0) {
-           this.brand = {
-             id: data.pgOrderProducts[0].brandId,
-             brandName: data.pgOrderProducts[0].brandName
-           }
-         }
-         this.wbId = data.rpProjectRepairId || '';
-         this.wbIsAllFee = data.isAllFee || '';
-         this.wbPayType = data.feePayMethod || '';
-       })
-     }
+    this.getWebsitList(() => {
+      if(this.hasOid) {
+        this.$api.post('/pg/order/base/detail', {
+          orderBaseId: oid,
+        }).then((res) => {
+          console.log(res.data)
+          const data = res.data;
+          this.orderNo = oid;
+          this.userMobile = data.userMobile;
+          this.websit = this.websitList.find(item => item.websitId == data.websitId) || {}
+          if(data.pgOrderProducts && data.pgOrderProducts.length > 0) {
+            this.brand = {
+              id: data.pgOrderProducts[0].brandId,
+              brandName: data.pgOrderProducts[0].brandName
+            }
+          }
+          this.wbId = data.rpProjectRepairId || '';
+          this.wbIsAllFee = data.isAllFee || '';
+          this.wbPayType = data.feePayMethod || '';
+        })
+      }
+    });
+
   },
 
   onShow() {
@@ -204,13 +204,14 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
       this.rpMaterialOrderItemList.splice(index, 1)
     },
 
-     getWebsitList() {
+     getWebsitList(cb) {
        this.$api.get('/user/apply/websit')
        .then(res => {
          this.websitList = res.data;
          if (this.websitList.length == 1) {
           this.websit = this.websitList[0]
          }
+         cb?.()
        })
      },