From 28e0aa1d40bff8985ac3e662d3a7726594d919c3 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期一, 14 八月 2023 19:45:26 +0800 Subject: [PATCH] 销售机会联调及bug修复 --- src/views/sales/salesReturn/index.vue | 145 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 116 insertions(+), 29 deletions(-) diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue index 09c24fa..9654087 100644 --- a/src/views/sales/salesReturn/index.vue +++ b/src/views/sales/salesReturn/index.vue @@ -1,22 +1,50 @@ <template> <div class="sales-return"> - <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" /> - <div class="btn-pager"> - <PublicFunctionBtnView :receive="false" :import-button="false" receive:operates-list="operatesList" /> + <div v-if="isDetail" class="detail-top"> + <DetailListCommonBtn :query-class-options="queryClassOptions" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> - <TableCommonView ref="tableListRef" :table-list="tableList"> + <div v-else class="top"> + <SearchCommonView + ref="searchCommonView" + :query-class-options="queryClassOptions" + :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" + /> + <div class="btn-pager"> + <PublicFunctionBtnView + :receive="false" + :import-button="false" + receive:operates-list="operatesList" + @batchDelete="delClick" + /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> + </div> + <TableCommonView + ref="tableListRef" + :table-list="tableList" + :select-box="!isDetail" + @selClientClick="selClientClick" + @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" + > <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="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> --> </template> </el-table-column> </template> </TableCommonView> <!-- 鏂板缓/缂栬緫 --> <AddSalesReturnDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> + <!-- 閿�鍞��璐у崟璇︽儏 --> + <DetailReturn v-if="returnDetail.visible" :return-detail="returnDetail" /> + <!-- 瀹㈡埛璇︽儏 --> + <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" /> </div> </template> @@ -24,13 +52,21 @@ import AddSalesReturnDialog from "@/views/sales/salesReturn/AddSalesReturnDialog" import { getSalesReturnList, getDelSalesReturn } from "@/api/sales/salesReturn" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import DetailReturn from "@/views/sales/salesReturn/DetailReturn" export default { name: "SalesReturn", - props: {}, + props: { + isDetail: { + type: Boolean, + default: false + } + }, mixins: [pageMixin], components: { - AddSalesReturnDialog + AddSalesReturnDialog, + DetailReturn, + DetailClientManage: () => import("@/views/client/client/DetailClientManage") }, computed: { searchCommonHeight() { @@ -62,7 +98,17 @@ visible: false, title: "鏂板缓", infomation: {} - } + }, + returnDetail: { + visible: false, + infomation: {} + }, + clientDeail: { + visible: false, + infomation: {} + }, + selValueList: [], + search_map: {} } }, created() { @@ -74,8 +120,8 @@ this.tableList = { tableInfomation: [], tableColumn: [ - { label: "閿�鍞��璐у崟缂栧彿", prop: "number", min: 120 }, - { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 90 }, + { label: "閿�鍞��璐у崟缂栧彿", prop: "number", min: 120, isCommonClick: true }, + { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 90, isClientClick: true }, { label: "閫�璐ф棩鏈�", prop: "returnDate", isTime: true, min: 130 }, { label: "鐘舵��", prop: "status" }, { label: "閫�鍏ヤ粨搴�", prop: "repository" }, @@ -95,7 +141,7 @@ async getData() { this.loading = true await getSalesReturnList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -124,6 +170,18 @@ this.loading = false }) }, + // 鎼滅储 + searchClick(val, content) { + console.log(val, content) + this.search_map = { + [val.value]: content + } + this.getData() + }, + resetClick() { + this.search_map = {} + this.getData() + }, // 鏂板缓 addBtnClick() { this.editConfig.visible = true @@ -138,27 +196,47 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSalesReturn({ id: id }) + delClick() { + if (this.selValueList && this.selValueList.length > 0) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" }) - .then((response) => { - if (response.code === 200) { - this.$message.success("鍒犻櫎鎴愬姛") - this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") - } - }) - .catch(function () {}) + .then(() => { + getDelSalesReturn({ ids: this.selValueList }).then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getData() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + }) + .catch(() => {}) + } else { + this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") + } }, getSelectArray(val) { console.log(val) + this.selValueList = [] + const list = val.map((item) => { + return item.id + }) + this.selValueList = list + }, + // 瀹㈡埛鍚嶇О璇︽儏 + selClientClick(row) { + console.log(row) + this.clientDeail.visible = true + this.clientDeail.infomation = { ...row, client_name: row.name } + }, + // 鑱旂郴浜鸿鎯� + selCommonClick(row) { + console.log(row) + this.returnDetail.visible = true + this.returnDetail.infomation = { ...row } } } } @@ -167,7 +245,16 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> .sales-return { - .btn-pager { + .top { + margin-bottom: 20px; + .btn-pager { + display: flex; + .page { + margin-left: auto; + } + } + } + .detail-top { display: flex; .page { margin-left: auto; -- Gitblit v1.8.0