From c58678b4bed3394da8cc90cd6e2c580da4741dde Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 17 十月 2023 20:22:45 +0800 Subject: [PATCH] 联系人编号去掉 --- src/views/sales/masterOrder/index.vue | 77 ++++++++++++++++++++++++++++++-------- 1 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/views/sales/masterOrder/index.vue b/src/views/sales/masterOrder/index.vue index 7705a43..99aa01c 100644 --- a/src/views/sales/masterOrder/index.vue +++ b/src/views/sales/masterOrder/index.vue @@ -8,15 +8,13 @@ <div class="filter-card"> <CommonSearch :show-add="false" - :show-download="false" :amount-view="false" - :show-action-btn="false" placeholder="璇疯緭鍏ュ崟鎹紪鍙�" @searchClick="onFilterSearch" > <template slot="leftButton"> <el-button size="small" type="primary" @click="addBtnClick">鏂板缓</el-button> - <el-button size="small" @click="delClick">鍒犻櫎</el-button> +<!-- <el-button size="small" @click="delClick">鍒犻櫎</el-button>--> </template> </CommonSearch> </div> @@ -29,16 +27,16 @@ ref="tableListRef" :show-summary="showSummary" :table-list="tableList" - :select-box="!isDetail" @selClientClick="selClientClick" @selCommonClick="selCommonClick" @getSelectArray="getSelectArray" + @selTableCol="selTableCol" > <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> - <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> --> + <el-button @click="deleteItem(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -113,7 +111,7 @@ infomation: {} }, showSummary: { - show: true, + show: false, sumProp: ["money"], mergeNumber: 5 }, @@ -130,7 +128,17 @@ searchSel: { value: "number", label: "鍗曟嵁缂栧彿" - } + }, + tableColumn: [ + { label: "鍗曟嵁缂栧彿", prop: "number", min: 100, isCommonClick: true, default: true }, // 鍗曟嵁缂栧彿 + { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О + { label: "鏈嶅姟寮�濮嬫椂闂�", prop: "start_time" }, // 鏈嶅姟寮�濮嬫椂闂� + { label: "鏈嶅姟鎴鏃堕棿", prop: "end_time" }, // 鏈嶅姟鎴鏃堕棿 + { label: "鍚堝悓閲戦", prop: "money" }, // 鍚堝悓閲戦 + { label: "璐熻矗浜�", prop: "member_name" } // 璐熻矗浜� + // { label: "瀹℃壒鐘舵��", prop: "approvalStatus" } // 瀹℃壒鐘舵�� + ], + showCol:["鍗曟嵁缂栧彿", "瀹㈡埛鍚嶇О", "鏈嶅姟寮�濮嬫椂闂�", "鏈嶅姟鎴鏃堕棿", "鍚堝悓閲戦", "璐熻矗浜�"] } }, created() { @@ -147,23 +155,31 @@ methods: { setTable() { this.tableList = { + selectIndex:true, tableInfomation: [], - tableColumn: [ - { label: "鍗曟嵁缂栧彿", prop: "number", min: 100, isCommonClick: true }, // 鍗曟嵁缂栧彿 - { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О - { label: "鏈嶅姟寮�濮嬫椂闂�", prop: "start_time" }, // 鏈嶅姟寮�濮嬫椂闂� - { label: "鏈嶅姟鎴鏃堕棿", prop: "end_time" }, // 鏈嶅姟鎴鏃堕棿 - { label: "鍚堝悓閲戦", prop: "money" }, // 鍚堝悓閲戦 - { label: "璐熻矗浜�", prop: "member_name" } // 璐熻矗浜� - // { label: "瀹℃壒鐘舵��", prop: "approvalStatus" } // 瀹℃壒鐘舵�� - ] + allcol: [], + showcol: this.showCol, + tableColumn:this.setColumnVisible(this.showCol) } + 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++) { const label = this.tableList.tableColumn[i].label const value = this.tableList.tableColumn[i].prop this.searchOptions.push({ value: value, label: label }) } + }, + setColumnVisible(showCol){ + return this.tableColumn.map(ele=>{ + return { + ...ele, + isShowColumn:showCol.includes(ele.label) + } + }) + }, + selTableCol(val) { + this.showcol = val; + this.tableList.tableColumn = this.setColumnVisible(val); }, // 璇锋眰鏁版嵁 async getData() { @@ -225,7 +241,7 @@ this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } }, - // 鍒犻櫎 + // 鎵归噺鍒犻櫎 delClick() { if (this.selValueList && this.selValueList.length > 0) { this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { @@ -248,6 +264,33 @@ this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") } }, + /** + * 鍗曚釜鍒犻櫎 + * @param id 閿�鍞�诲崟id + */ + deleteItem(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + getDelMasterOrder({ids: [id]}).then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getData() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + }) + .catch((err) => { + if (err !== 'cancel') { + console.error(err) + this.$message.warning("鍒犻櫎澶辫触") + } + }) + }, getSelectArray(val) { console.log(val) this.selValueList = [] -- Gitblit v1.8.0