From 302858f921bed077ab54dd31102f086bfe1add3c Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期三, 07 二月 2024 11:59:47 +0800 Subject: [PATCH] srm项目 系统参数设置的前端页面开发+增加相关路由+公共列表组件增加是否可以配置表头的逻辑 --- src/views/productManage/product/index.vue | 53 +++++++++++++++++++++-------------------------------- 1 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue index 7ea3200..4549c5c 100644 --- a/src/views/productManage/product/index.vue +++ b/src/views/productManage/product/index.vue @@ -2,25 +2,14 @@ <div class="product-manage"> <div class="filter"> <div class="filter-card"> -<!-- <SearchCommonView--> -<!-- ref="searchCommonView"--> -<!-- :search-options="searchOptions"--> -<!-- @searchClick="searchClick"--> -<!-- @resetClick="resetClick"--> -<!-- />--> - <CommonSearch :show-add="false" - :show-download="false" + :show-download="true" :amount-view="false" :show-action-btn="false" :placeholder="'璇疯緭鍏ヤ骇鍝佸悕绉�/渚涘簲鍟�'" @searchClick="onFilterSearch" /> - - <div class="add-view"> - <!-- <el-button type="primary" size="mini" @click="addBtnClick">鏂板缓</el-button>--> - </div> </div> </div> <div class="body"> @@ -46,7 +35,6 @@ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> - </div> <!-- 鏂板缓/缂栬緫浜у搧 --> <AddProduct v-if="editConfig.visible" :add-common-config="editConfig" /> @@ -69,7 +57,7 @@ computed: {}, data() { return { - searchText:'', + searchText: "", tableList: {}, searchOptions: [], commonDetail: { @@ -84,7 +72,7 @@ }, tableColumn: [ { label: "浜у搧缂栫爜", prop: "number", min: 190, isCommonClick: true }, - { label: "浜у搧鍚嶇О", prop: "name", min: 130 }, + { label: "浜у搧鍚嶇О", prop: "name", min: 130, default: true }, { label: "渚涘簲鍟�", prop: "supplierName", min: 130 }, { label: "浜у搧绫诲埆", prop: "productType", min: 130 }, { label: "瑙勬牸", prop: "specifications", min: 130 }, @@ -94,7 +82,7 @@ { label: "鏈�浣庡簱瀛�", prop: "minimumStock", min: 80 }, { label: "鏈�楂樺簱瀛�", prop: "maximumStock", min: 80 } ], - showCol: ['浜у搧缂栫爜', '浜у搧鍚嶇О', '渚涘簲鍟�', '浜у搧绫诲埆', '瑙勬牸', '鍨嬪彿', '鍗曚綅', '浠锋牸', '鏈�浣庡簱瀛�', '鏈�楂樺簱瀛�'] + showCol: ["浜у搧缂栫爜", "浜у搧鍚嶇О", "渚涘簲鍟�", "浜у搧绫诲埆", "瑙勬牸", "浠锋牸", "鏈�浣庡簱瀛�", "鏈�楂樺簱瀛�"] } }, created() { @@ -102,11 +90,11 @@ this.getData() }, methods: { - setColumnVisible(showCol){ - return this.tableColumn.map(ele=>{ + setColumnVisible(showCol) { + return this.tableColumn.map((ele) => { return { ...ele, - isShowColumn:showCol.includes(ele.label) + isShowColumn: showCol.includes(ele.label) } }) }, @@ -116,9 +104,9 @@ selectIndex: true, showcol: this.showCol, allcol: [], - tableColumn:this.setColumnVisible(this.showCol) + tableColumn: this.setColumnVisible(this.showCol) } - this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label); + this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) this.searchOptions = [] for (let i = 0; i < this.tableList.tableColumn.length; i++) { @@ -128,8 +116,8 @@ } }, selTableCol(val) { - this.showcol = val; - this.tableList.tableColumn = this.setColumnVisible(val); + this.showcol = val + this.tableList.tableColumn = this.setColumnVisible(val) }, // 璇锋眰鏁版嵁 async getData() { @@ -138,15 +126,16 @@ page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data.list.map((item) => { + if (res.code === 200) { + const list = res.data.list.map((item) => { return { ...item, + supplierName: item.supplier.name, supplierNumber: item.supplier.number } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.data.total } }) }, @@ -156,8 +145,8 @@ // this.getData(val.value, content) // }, - onFilterSearch(val){ - this.searchText = val ?? '' + onFilterSearch(val) { + this.searchText = val ?? "" this.pagerOptions.currPage = 1 this.getData() }, @@ -208,15 +197,15 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> -.product-manage{ +.product-manage { height: 100%; overflow: hidden; - .filter{ + .filter { height: 80px; display: flex; align-items: center; padding: 12px 20px 0 20px; - &-card{ + &-card { height: 80px; display: flex; align-items: center; @@ -227,7 +216,7 @@ background-color: #fff; } } - .body{ + .body { box-sizing: border-box; padding: 10px 20px; border-radius: 12px; -- Gitblit v1.8.0