From b811e2fa4cdcb5949047faa78aa9299aec1d2f67 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期三, 27 三月 2024 15:08:45 +0800 Subject: [PATCH] 确认采购单接口换位post请求,产品列表字段替换 --- src/views/other/commonDialog/SelectCommonDialog.vue | 70 +++++++++++++++++++++-------------- 1 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue index 2b2516f..74d664a 100644 --- a/src/views/other/commonDialog/SelectCommonDialog.vue +++ b/src/views/other/commonDialog/SelectCommonDialog.vue @@ -28,12 +28,15 @@ <el-button type="primary" size="mini" disabled>蹇�熷垱寤�</el-button> --> </div> </div> - <TableCommonView + <TableCommonView + class="bg-list" ref="tableListRef" :table-list="tableList" - :select-box="false" + :select-box="editCommonConfig.isSelectBox" + :selectBoxList="selectBoxList" @selCommonClick="selNameClick" @selTableCol="selTableCol" + @getSelectArray="getSelectArray" > </TableCommonView> <div slot="footer" class="dialog-footer"> @@ -42,6 +45,10 @@ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> + </div> + <div slot="footer" class="dialog-footer" v-if="editCommonConfig.isSelectBox"> + <el-button type="primary" size="small" @click="saveClick()">纭畾</el-button> + <el-button size="small" @click="editConfig.editVisible = false">鍙栨秷</el-button> </div> </el-dialog> </div> @@ -60,7 +67,11 @@ default: () => { return { editVisible: false, + isSelectBox: false, title: "", + clientId: 0, + isRequest: true, + client_name: "", tableInfomation: [] } } @@ -68,6 +79,10 @@ sign: { type: String, default: "" + }, + selectBoxList: { + type: Array, + default: () => [] } }, components: {}, @@ -87,13 +102,18 @@ searchSel: {}, keyword: "", keywordType: "", - showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿"], + showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "閿�鍞崟浠�", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"], tableProductColumn: [ { label: "浜у搧鍚嶇О", prop: "name", isClick: true }, - { label: "浜у搧缂栧彿", prop: "number" } + { label: "浜у搧缂栧彿", prop: "number" }, + { label: "閿�鍞崟浠�", prop: "purchasePrice" }, + { label: "鍗曚綅", prop: "unit" }, + { label: "浜у搧瑙勬牸", prop: "specifications" }, + { label: "鍨嬪彿", prop: "modelNumber" } ], showCol: [], - tableColumn: [] + tableColumn: [], + selectArray: [] } }, created() { @@ -133,17 +153,17 @@ } }, selTableCol(val) { - this.showcol = val; - this.tableList.tableColumn = this.setColumnVisible(val); + this.showcol = val + this.tableList.tableColumn = this.setColumnVisible(val) }, - // setColumnVisible(showCol){ - // return this.tableColumn.map(ele=>{ - // return { - // ...ele, - // isShowColumn:showCol.includes(ele.label) - // } - // }) - // }, + // 鍒楄〃澶氶�� + getSelectArray(val) { + this.selectArray = val + }, + saveClick() { + this.$emit("getSelectArray", this.selectArray) + this.editConfig.editVisible = false + }, // 璇锋眰鏁版嵁 async getData() { this.loading = true @@ -155,21 +175,19 @@ async getProductList() { let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc await fn({ - productName: this.keywordType === "浜у搧鍚嶇О" ? this.keyword : "", - productNumber: this.keywordType === "浜у搧缂栧彿" ? this.keyword : "", + keyword: this.keyword, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - console.log(res.data) - if (res.data.code === 200) { - if (res.data.data.list && res.data.data.list.length > 0) { - const list = res.data.data.list.map((item) => { + if (res.code === 200) { + if (res.data.list && res.data.list.length > 0) { + const list = res.data.list.map((item) => { return { ...item } }) this.tableList.tableInfomation = list - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.data.total } else { this.tableList.tableInfomation = [] } @@ -187,13 +205,9 @@ } }, // 鎼滅储 - searchClick(val, content) { - console.log(val, content) - this.search_map = { - [val.value]: content - } + searchClick(content) { + console.log(content) this.keyword = content - this.keywordType = val.label this.getData() }, resetClick() { -- Gitblit v1.8.0