Преглед изворни кода

采购单增加当前实时金价字段

lucky пре 2 година
родитељ
комит
f0a9a7b78d

+ 6 - 0
src/views/purchaseIn/purchaseOrder/components/ShowDataTableColumns.js

@@ -71,5 +71,11 @@ export default [
     label: "创建时间",
     span: 6
   },
+  {
+    prop: "gold_price",
+    label: "当前实时金价",
+    _slot_: "gold_price",
+    span: 24
+  },
 ]
 

+ 33 - 2
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -32,6 +32,7 @@
                 :columns="ShowDataTableColumns"
               >
                 <template slot="supplier_name">
+                  
                   <span>{{ sitem.supplier_name }}</span>
                   <el-popover placement="top" width="300" trigger="hover">
                     <ul>
@@ -126,6 +127,23 @@
                     <i class="el-icon-warning-outline fr" slot="reference"></i>
                   </el-popover>
                 </template>
+
+
+
+
+                <template slot="gold_price" >
+                  <div v-if="sitem.status == '0' && sitem.can[0].id == '6' && cost_detailArr.is_gold_price == '1'">
+                    {{sitem.gold_price}}
+                  </div>
+                  <div v-else>
+                    ----
+                  </div>
+                </template>
+
+
+
+
+
               </show-data-table>
             </el-collapse-item>
             <el-collapse-item title="商品信息" name="2">
@@ -151,7 +169,7 @@
 
 
 
-
+            
 
 
 
@@ -280,7 +298,7 @@ export default {
       loading: false,
       queryId: "",
       ReturnAddModel: false, //采购单退货弹窗
-      
+      cost_detailArr:[],
       fileUrl: urlConfig.baseURL,
     };
   },
@@ -289,6 +307,7 @@ export default {
     this.initData();
   },
   methods: {
+    
     //导出文件 (需要修改)
     download() {
       if (!this.loading) {
@@ -361,12 +380,24 @@ export default {
         await this.setStatus(type, "提交入库方审核", e.remark);
       }
     },
+    async goldPrice(){
+      const res = await asyncRequest.cost_detail({ spuCode: this.sitem.spuCode });
+      if (res && res.code === 0 && res.data) {
+        this.cost_detailArr = res.data;
+        console.log(this.cost_detailArr)
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
     async initData() {
       this.loading = true;
       const res = await asyncRequest.detail({ cgdNo: this.queryId });
       if (res && res.code === 0 && res.data) {
         this.sitem = res.data;
         console.log("11111111111111111",this.sitem)
+        this.goldPrice()
         const { status, can, cgdNo } = this.sitem;
         this.status = status;
         if (can && can.length > 0) {