From b169e0fe3ecad3713880626bd6152c58d8ed4222 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 10 十月 2023 19:59:57 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into wn --- src/views/service/serviceContract/index.vue | 119 +++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 70 insertions(+), 49 deletions(-) diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue index 1cdb09c..633af84 100644 --- a/src/views/service/serviceContract/index.vue +++ b/src/views/service/serviceContract/index.vue @@ -14,8 +14,8 @@ @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" type="primary" @click="addBtnClick">鏂板缓</el-button> + <!-- <el-button size="small" @click="delClick">鍒犻櫎</el-button> --> </template> </CommonSearch> </div> @@ -25,27 +25,26 @@ <div class="body-card"> <div class="list-view"> <TableCommonView - ref="tableListRef" - :table-list="tableList" - :select-box="!isDetail" - @selClientClick="selClientClick" - @selCommonClick="selCommonClick" - @getSelectArray="getSelectArray" - @selTableCol="selTableCol" + ref="tableListRef" + :table-list="tableList" + @selClientClick="selClientClick" + @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" + @selTableCol="selTableCol" > <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="100"> <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="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> </TableCommonView> </div> - <div class="btn-pager"> - <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> - </div> + <div class="btn-pager"> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> </div> </div> <!-- 鏂板缓/缂栬緫 --> @@ -142,7 +141,18 @@ { label: "鏈嶅姟鍒版湡鏃�", prop: "endTime" }, // 鏈嶅姟鍒版湡鏃� { label: "浠风◣鍚堣", prop: "amountTotal" } // 浠风◣鍚堣 ], - showCol:["鏈嶅姟鍚堝悓缂栧彿", "瀹㈡埛鍚嶇О", "绛剧害鏃ユ湡", "鍚堝悓绫诲瀷", "鍚堝悓鐘舵��", "璐熻矗浜�", "浜у搧鍚嶇О", "鏈嶅姟寮�濮嬫棩", "鏈嶅姟鍒版湡鏃�", "浠风◣鍚堣"] + showCol: [ + "鏈嶅姟鍚堝悓缂栧彿", + "瀹㈡埛鍚嶇О", + "绛剧害鏃ユ湡", + "鍚堝悓绫诲瀷", + "鍚堝悓鐘舵��", + "璐熻矗浜�", + "浜у搧鍚嶇О", + "鏈嶅姟寮�濮嬫棩", + "鏈嶅姟鍒版湡鏃�", + "浠风◣鍚堣" + ] } }, created() { @@ -159,12 +169,13 @@ methods: { setTable() { this.tableList = { + selectIndex: true, tableInfomation: [], allcol: [], showcol: this.showCol, - 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++) { const label = this.tableList.tableColumn[i].label @@ -172,17 +183,17 @@ this.searchOptions.push({ value: value, label: label }) } }, - 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) } }) }, selTableCol(val) { - this.showcol = val; - this.tableList.tableColumn = this.setColumnVisible(val); + this.showcol = val + this.tableList.tableColumn = this.setColumnVisible(val) }, // 璇锋眰鏁版嵁 async getData() { @@ -223,7 +234,7 @@ }) }, // 鎼滅储 - onFilterSearch(searchText){ + onFilterSearch(searchText) { this.keyword = searchText ?? "" this.keywordType = "鏈嶅姟鍚堝悓缂栧彿" this.pagerOptions.currPage = 1 @@ -233,7 +244,15 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { ...this.addConfig, currency: "浜烘皯甯�" } + this.editConfig.infomation = { + ...this.addConfig, + currency: "浜烘皯甯�", + client_name: "", + contact_name: "", + sale_chance_name: "", + contract_number: "", + quotation_number: "" + } }, // 缂栬緫 handleClick(row) { @@ -244,31 +263,33 @@ ...row, contract_number: row.salesDetails.number, quotation_number: row.quotation.number, - currency: "浜烘皯甯�" + currency: "浜烘皯甯�", + sale_chance_name: row.SaleChance.name, + contact_name: row.contact.name } }, // 鍒犻櫎 - delClick() { - if (this.selValueList && this.selValueList.length > 0) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(() => { - getDelServiceContract({ ids: this.selValueList }).then((response) => { - if (response.code === 200) { - this.$message.success("鍒犻櫎鎴愬姛") - this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") - } - }) + delClick(id) { + // if (this.selValueList && this.selValueList.length > 0) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + getDelServiceContract({ ids: [id] }).then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getData() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } }) - .catch(() => {}) - } else { - this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") - } + }) + .catch(() => {}) + // } else { + // this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") + // } }, getSelectArray(val) { console.log(val) @@ -302,15 +323,15 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> -.service-contract{ +.service-contract { 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; @@ -321,7 +342,7 @@ background-color: #fff; } } - .body{ + .body { box-sizing: border-box; padding: 10px 20px; border-radius: 12px; -- Gitblit v1.8.0