From 3bd59622961f569ac181a0f17aeffd44858efa4f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期日, 28 四月 2024 17:19:13 +0800
Subject: [PATCH]  价税合计和数量,采购单价 3者之间计算管理的逻辑处理

---
 src/views/supplierManage/supplier/DetailSupplier.vue |  129 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 118 insertions(+), 11 deletions(-)

diff --git a/src/views/supplierManage/supplier/DetailSupplier.vue b/src/views/supplierManage/supplier/DetailSupplier.vue
index 509d4ca..9029af4 100644
--- a/src/views/supplierManage/supplier/DetailSupplier.vue
+++ b/src/views/supplierManage/supplier/DetailSupplier.vue
@@ -65,19 +65,29 @@
               </ul>
               <div class="business_scope">
                 <div class="content-title">{{ "鍚堝悓闄勪欢" }}</div>
-                <div class="content-data">
-                  {{ detailConfig.infomation.contract.fileName ? detailConfig.infomation.contract.fileName : "--" }}
-                </div>
+                  <div class="content-data downFlie" @click="downLoadFiles">
+                    {{ detailConfig.infomation.contract.fileName ? detailConfig.infomation.contract.fileName : "--" }}
+                  </div>
               </div>
             </div>
           </div>
         </div>
-        <div v-if="activeName === 'second'" class="second">
-          <!-- <FollowupRecords
-            :isDetail="true"
-            :follow-record="detailConfig.infomation.FollowRecord"
-            :add-config="addConfig"
-          /> -->
+        <div v-if="activeName === 'second'" class="detail">
+          <!-- 閲囪喘璁㈠崟-鍩烘湰淇℃伅 -->
+          <!-- 浜у搧淇℃伅 -->
+          <div class="basic-info">
+            <div class="basic-info-content" >
+              <el-button type="primary" size="mini" @click="toPurchaseBtn"><i class="el-icon-plus"></i>   鏂板缓</el-button>
+              <TableCommonView
+                style="margin-top: 2px"
+                class="content-table"
+                ref="tableListRef"
+                :table-list="tableList"
+                @selTableCol="selTableCol"
+              >
+              </TableCommonView>
+            </div>
+          </div>
         </div>
       </div>
     </el-drawer>
@@ -85,6 +95,7 @@
 </template>
 
 <script>
+import download from "downloadjs"
 export default {
   name: "DetailSupplier",
   props: {
@@ -93,7 +104,8 @@
       default: () => {
         return {
           visible: false,
-          infomation: {}
+          infomation: {},
+          productListInfo:[]
         }
       }
     }
@@ -111,10 +123,23 @@
       addConfig: {},
       record: "", // 鏈�鏂拌繘灞�
       noContactDays: 0,
-      newContactDays: ""
+      newContactDays: "",
+      tableList:{},
+      showCol: ['閲囪喘鍗曞彿', '閲囪喘鍗曞悕绉�', '鍗曟嵁绫诲瀷', '渚涘簲鍟嗗悕绉�', '閲囪喘鏁伴噺', '鏀惰揣浠撳簱','缁忓姙浜�','鍒跺崟浜�'],
+      tableColumn: [
+        { label: "鍗曟嵁绫诲瀷", prop: "orderType", min: 130 },
+        { label: "閲囪喘鍗曞彿", prop: "number", min: 150,default:true},
+        { label: "閲囪喘鍗曞悕绉�", prop: "name", min: 130 },
+        { label: "渚涘簲鍟嗗悕绉�", prop: "supplierName", min: 130 },
+        { label: "閲囪喘鏁伴噺", prop: "quantity", min: 130 },
+        { label: "鏀惰揣浠撳簱", prop: "warehouse", min: 130 },
+        { label: "缁忓姙浜�", prop: "handledBy", min: 130 },
+        { label: "鍒跺崟浜�", prop: "creator", min: 130 }
+      ],
     }
   },
   created() {
+    console.log(this.commonDetail,"鎶藉眽缁勪欢props")
     this.setData(this.detailConfig.infomation)
     this.addConfig = {
       id_name: "sales_leads_id",
@@ -166,6 +191,44 @@
           rightValue: ""
         }
       ]
+      this.purchaseList = [
+        {
+          leftStr: "閲囪喘鍗曞彿",
+          leftValue: item.number,
+          rightStr: "閲囪喘鍗曞悕绉�",
+          rightValue: item.name
+        },
+        {
+          leftStr: "渚涘簲鍟嗙被鍨�",
+          leftValue: item.supplierType,
+          rightStr: "鎵�灞炶涓�",
+          rightValue: item.industry
+        },
+        {
+          leftStr: "鍗曟嵁绫诲瀷",
+          leftValue: item.contact,
+          rightStr: "渚涘簲鍟嗗悕绉�",
+          rightValue: item.phone
+        },
+        {
+          leftStr: "閲囪喘鏁伴噺",
+          leftValue: item.responsiblePersonName,
+          rightStr: "鏀惰揣浠撳簱",
+          rightValue: item.url
+        },
+        {
+          leftStr: "缁忓姙浜�",
+          leftValue: item.email,
+          rightStr: "鍒跺崟浜�",
+          rightValue: ""
+        },
+        {
+          leftStr: "鐘舵��",
+          leftValue: item.email,
+          rightStr: "",
+          rightValue: ""
+        },
+      ]
       this.dynamicInfoList = [
         {
           leftStr: "鎴峰悕",
@@ -180,6 +243,29 @@
           rightValue: ""
         }
       ]
+      this.detailConfig.productListInfo.map((item)=>{
+        item.supplierName=item.supplier.name
+      })
+      this.tableList = {
+        tableInfomation: this.detailConfig.productListInfo?this.detailConfig.productListInfo:[],
+        selectIndex: true,
+        showcol: this.showCol,
+        allcol:[],
+        tableColumn:this.setColumnVisible(this.showCol),
+      };
+      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
+    },
+    selTableCol(val) {
+      this.showcol = val;
+      this.tableList.tableColumn = this.setColumnVisible(val);
+    },
+    setColumnVisible(showCol){
+      return  this.tableColumn.map(ele=>{
+        return {
+          ...ele,
+          isShowColumn:showCol.includes(ele.label)
+        }
+      })
     },
     handleClose() {
       this.detailConfig.visible = false
@@ -209,6 +295,22 @@
       // console.log(totalDays)
 
       return totalDays // 鐩稿樊鐨勫ぉ鏁�
+    },
+    toPurchaseBtn(){
+      this.$router.push({  
+        name: 'purchase', 
+        params: {
+          supplierId:this.commonDetail.infomation.ID,
+          supplierName:this.commonDetail.infomation.name
+        }
+      });
+    },
+    // 涓嬭浇鍚堝悓闄勪欢
+    downLoadFiles(){
+      if(this.detailConfig.infomation.contract.fileName){
+        let url = "/api-srm/downloadContract?id=" + this.commonDetail.infomation.fileId
+        download(url, "", "")
+      }
     }
   }
 }
@@ -261,6 +363,7 @@
           font-size: 14px;
         }
         .basic-info-content {
+          margin-top: 10px;
           background: #fff;
           ul {
             padding-inline-start: 0;
@@ -343,4 +446,8 @@
     margin: 0;
   }
 }
+  .downFlie{
+    color: blue !important;
+    cursor: pointer;
+  }
 </style>

--
Gitblit v1.8.0