From 302858f921bed077ab54dd31102f086bfe1add3c Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期三, 07 二月 2024 11:59:47 +0800 Subject: [PATCH] srm项目 系统参数设置的前端页面开发+增加相关路由+公共列表组件增加是否可以配置表头的逻辑 --- src/views/purchaseManage/purchase/DetailSupplier.vue | 143 ++++++++++++++++++++++++++--------------------- 1 files changed, 80 insertions(+), 63 deletions(-) diff --git a/src/views/purchaseManage/purchase/DetailSupplier.vue b/src/views/purchaseManage/purchase/DetailSupplier.vue index c3f9e39..75feb1e 100644 --- a/src/views/purchaseManage/purchase/DetailSupplier.vue +++ b/src/views/purchaseManage/purchase/DetailSupplier.vue @@ -12,10 +12,10 @@ <span class="header-title">{{ detailConfig.infomation.name }}</span> </div> <div class="btn" style="float: right; margin-right: 30px"> - <el-button type="primary" size="mini" style="margin-right: 5px" + <el-button type="primary" size="mini" disabled style="margin-right: 5px" >鎵撳嵃</el-button > - <el-button type="primary" size="mini" @click="emailClick" + <el-button type="primary" disabled size="mini" @click="emailClick" >Email閫氱煡涓嬪崟</el-button > @@ -74,7 +74,7 @@ </ul> <div class="business_scope"> <div class="content-title">{{ "澶囨敞淇℃伅锛�" }}</div> - <div class="content-data">{{ record ? record : "--" }}</div> + <div class="content-data">{{ remark ? remark : "--" }}</div> </div> </div> </div> @@ -121,26 +121,27 @@ ref="tableListRef" :showSummary="showSummary" :table-list="tableList" + @selTableCol="selTableCol" > </TableCommonView> <div class="table-bottom"> <div class="table-bottom-item"> <div class="table-bottom-l"> - 鏁村崟鎶樻墸锛氱洿鎺ラ檷浠� + 鏁村崟鎶樻墸锛歿{ detailConfig.infomation.wholeDiscountType==1?'鐧惧垎姣旈檷浠�':'鐩存帴闄嶄环' }} </div> - <div class="table-bottom-r">0.00</div> + <div class="table-bottom-r">{{detailConfig.infomation.wholeDiscount }}</div> </div> <div class="table-bottom-item"> <div class="table-bottom-l"> - 璋冩暣锛氬鍔� + 璋冩暣锛歿{ detailConfig.infomation.priceAdjustmentType==1?'澧炲姞':'鍑忓皯' }} </div> - <div class="table-bottom-r">0.00</div> + <div class="table-bottom-r">{{ detailConfig.infomation.priceAdjustment }}</div> </div> <div class="table-bottom-item"> <div class="table-bottom-l"> 鍚堣 </div> - <div class="table-bottom-r">26000.00</div> + <div class="table-bottom-r">{{detailConfig.infomation.realTotalPrice }}</div> </div> </div> </div> @@ -152,7 +153,8 @@ </template> <script> -import { getDeleteSalesLeads } from "@/api/client/salesLead"; +import { deletePurchase } from "@/api/purchaseManage/purchase"; +import { getDataByType } from "@/api/data"; export default { name: "DetailSupplier", props: { @@ -177,33 +179,49 @@ basicInfoList: [], isDynamicExpand: true, // 璐︽埛淇℃伅 dynamicInfoList: [], - addConfig: {}, - record: "", // 鏈�鏂拌繘灞� + remark: "", // 鏈�鏂拌繘灞� noContactDays: 0, newContactDays: "", isExpandThree: true, //浜у搧淇℃伅 tableList: {}, showSummary:{ show: true, - sumProp: ["number", "total"], - mergeNumber: 4, + sumProp: ["amount", "total"], + mergeNumber: 5, totalName:'灏忚' }, + showCol: ['浜у搧鍚嶇О', '浜у搧缂栫爜', '璁¢噺鍗曚綅', '瑙勬牸鍨嬪彿', '鏁伴噺', '閿�鍞崟浠�','浠风◣鍚堣','鎻忚堪'], + purchaseStatusList:getDataByType('purchaseStatus'), + tableColumn: [ + { label: "浜у搧鍚嶇О", prop: "name", min: 160, }, + { label: "浜у搧缂栫爜", prop: "number", min: 130, }, + { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 }, + { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 }, + { label: "鏁伴噺", prop: "amount", min: 130 }, + { label: "閿�鍞崟浠�", prop: "price", min: 130 }, + { label: "浠风◣鍚堣", prop: "total", min: 130 }, + { label: "鎻忚堪", prop: "remark", min: 130 }, + ], }; }, created() { this.setData(this.detailConfig.infomation); - this.addConfig = { - id_name: "sales_leads_id", - id: this.detailConfig.infomation.id, - common_name: this.detailConfig.infomation.id, - sales_leads_name: this.detailConfig.infomation.name, - sales_leads_id: this.detailConfig.infomation.id, - }; + }, mounted() {}, computed: {}, methods: { + getpurchaseStatus(val) { + if (val) { + for (let i in this.purchaseStatusList) { + if (this.purchaseStatusList[i].id == val) { + return this.purchaseStatusList[i].name; + } + } + } else { + return "--"; + } + }, // email 閫氱煡涓嬪崟 emailClick() {}, // 鍒犻櫎 @@ -214,10 +232,11 @@ type: "warning", }) .then(() => { - getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { + deletePurchase({ id: this.commonDetail.infomation.ID }).then((response) => { if (response.code === 200) { this.$message.success("鍒犻櫎鎴愬姛"); - this.getData(); + this.detailConfig.visible=false; + this.$parent.getData(); } else { this.$message.warning("鍒犻櫎澶辫触"); } @@ -227,44 +246,41 @@ }, setData(item) { if (item.FollowRecord && item.FollowRecord.length > 0) { - this.record = item.FollowRecord[0].record; - console.log(item.FollowRecord[0].follow_time); - let follow_time = item.FollowRecord[0].follow_time; - this.newContactDays = follow_time.substring(0, 10); this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays); } + this.remark =item.remark?item.remark:'' this.formInfoList = [ { str: "渚涘簲鍟嗗悕绉�", - value: "", + value: item.supplier.name, }, { str: "鍚堣", - value: "", + value:item.realTotalPrice, }, { str: "宸叉敹绁ㄩ噾棰�", - value: "", + value: item.invoiceAmount, }, { str: "宸蹭粯閲戦", - value: "", + value: item.paidAmount, }, { str: "绛剧害鏃ユ湡", - value: "", + value:item.signingDate, }, { str: "閲囪喘璐熻矗浜�", - value: "", + value: item.principal, }, { str: "鏈敹绁ㄩ噾棰�", - value: "", + value: item.unInvoiceAmount, }, { str: "搴斾粯閲戦", - value: "", + value: item.shouldPayAmount, }, ]; this.basicInfoList = [ @@ -272,29 +288,29 @@ leftStr: "閲囪喘璁㈠崟缂栧彿", leftValue: item.number, rightStr: "渚涘簲鍟嗗悕绉�", - rightValue: item.name, + rightValue: item.supplier.name, }, { leftStr: "閲囪喘鍗曠姸鎬�", - leftValue: item.contact_name, + leftValue: this.getpurchaseStatus(item.status), rightStr: "閲囪喘璐熻矗浜�", - rightValue: item.contact_position, + rightValue: item.principal, }, { leftStr: "閲囪喘鑱旂郴浜�", - leftValue: item.contact_phone, + leftValue: item.contact, rightStr: "鑱旂郴鐢佃瘽", - rightValue: "18513375588", + rightValue: item.phone, }, { leftStr: "绛剧害鏃ユ湡", - leftValue: item.sales_resources, + leftValue: item.signingDate, rightStr: "浜や粯鏃ユ湡", - rightValue: item.member_name, + rightValue: item.deliveryDate, }, { leftStr: "鍒拌揣浠撳簱", - leftValue: item.sales_resources, + leftValue: item.warehouse, rightStr: "", rightValue: "", }, @@ -302,42 +318,43 @@ this.dynamicInfoList = [ { leftStr: "鍚堣", - leftValue: this.noContactDays, + leftValue: item.realTotalPrice, rightStr: "宸叉敹绁ㄩ噾棰�", - rightValue: this.newContactDays, + rightValue: item.invoiceAmount, }, { leftStr: "宸蹭粯鎬婚", - leftValue: "", + leftValue:item.paidAmount, rightStr: "鏈敹绁ㄩ噾棰�", - rightValue: "", + rightValue: item.unInvoiceAmount, }, { leftStr: "搴斾粯閲戦", - leftValue: "", + leftValue: item.shouldPayAmount, rightStr: "", rightValue: "", }, ]; this.tableList = { - tableInfomation: [ - { - number:1, - total:1, - } - ], + tableInfomation: item.productList?item.productList:[], selectIndex: true, - tableColumn: [ - { label: "浜у搧鍚嶇О", prop: "number", min: 190, isCommonClick: true }, - { label: "浜у搧缂栫爜", prop: "total", min: 130, isCommonClick: true }, - { label: "璁¢噺鍗曚綅", prop: "contact_name", min: 130 }, - { label: "瑙勬牸鍨嬪彿", prop: "contact_phone", min: 130 }, - { label: "鏁伴噺", prop: "contact_phone", min: 130 }, - { label: "閿�鍞崟浠�", prop: "sales_resources", min: 130 }, - { label: "浠风◣鍚堣", prop: "province", min: 130 }, - { label: "鎻忚堪", prop: "province", min: 130 }, - ], + 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; -- Gitblit v1.8.0