瀏覽代碼

采购单

shish 4 年之前
父節點
當前提交
8af6e37c75
共有 2 個文件被更改,包括 18 次插入14 次删除
  1. 1 1
      hdApp/src/api/purchase/index.js
  2. 17 13
      hdApp/src/pagesPurchase/purDetails.vue

+ 1 - 1
hdApp/src/api/purchase/index.js

@@ -80,7 +80,7 @@ export const createPurchaseOrderApi = async data => {
 /** *
 /** *
  * 采购详情   /purchase/wx-pay
  * 采购详情   /purchase/wx-pay
  */
  */
- export const purchaseDetail = async data => {
+ export const purchaseDetail = data => {
 	return https.get("/purchase/detail", data);
 	return https.get("/purchase/detail", data);
 };
 };
 
 

+ 17 - 13
hdApp/src/pagesPurchase/purDetails.vue

@@ -217,7 +217,7 @@
 
 
 <script>
 <script>
 
 
-import { purchaseDetail, purchaseDebtPay, purchaseClearCreateOrder } from "@/api/purchase/index";
+import { purchaseDetail, purchaseDebtPay } from "@/api/purchase";
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
 export default {
   name: "info",
   name: "info",
@@ -288,22 +288,26 @@ export default {
       });
       });
     },
     },
     init() {
     init() {
-      this.initData()
+      let id = 0
+      if(this.option.id){
+        id = this.option.id
+      }else{
+		//小票上的二维码打开
+		//https://api.shop.huaml.com/#/pagesPurchase/purDetails?id=1292
+		if(this.option.q){
+			let currentUrl = decodeURIComponent(this.option.q)
+			id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
+		}
+      }
+      this.initData(id)
     },
     },
-    async initData () {
-      return purchaseDetail({ id: this.option.id }).then(res => {
+    initData (id) {
+      return purchaseDetail({ id: id }).then(res => {
         this.detailInfo = res.data
         this.detailInfo = res.data
-
-			this.settlePrice = Number(this.detailInfo.bookPrice) - Number(this.detailInfo.orderPrice)
-			this.settlePrice = parseFloat(this.settlePrice.toFixed(2))
-
+        this.settlePrice = Number(this.detailInfo.bookPrice) - Number(this.detailInfo.orderPrice)
+        this.settlePrice = parseFloat(this.settlePrice.toFixed(2))
         this.$forceUpdate()
         this.$forceUpdate()
       })
       })
-      
-    },
-    // 修改花材
-    editFlr () {
-
     },
     },
     toPay () {
     toPay () {
       uni.navigateTo({
       uni.navigateTo({