From ebddc02611b0373c1d5bfa342bd781fb5eb82009 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期二, 01 八月 2023 14:23:31 +0800 Subject: [PATCH] 侧边栏样式机销售明细单增加销售机会选择弹窗 --- src/views/service/orderManage/index.vue | 116 +++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 71 insertions(+), 45 deletions(-) diff --git a/src/views/service/orderManage/index.vue b/src/views/service/orderManage/index.vue index 8e03943..e76d7f3 100644 --- a/src/views/service/orderManage/index.vue +++ b/src/views/service/orderManage/index.vue @@ -12,13 +12,14 @@ <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" /> <div class="btn-pager"> <PublicFunctionBtnView :receive="true" :submit-approval="true" :operates-list="operatesList" /> - <PagerView class="page" /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="120"> + <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> </template> </el-table-column> </template> @@ -30,10 +31,13 @@ <script> import AddOrderManageDialog from "@/views/service/orderManage/AddOrderManageDialog" +import { getOrderManageList, getDelOrderManage } from "@/api/serviceManage/orderManage" +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" export default { name: "SalesLead", props: {}, + mixins: [pageMixin], components: { AddOrderManageDialog }, @@ -73,28 +77,19 @@ }, created() { this.setTable() + this.getData() }, methods: { setTable() { this.tableList = { - tableInfomation: [ - { - orderNumber: "LEA110", - customName: "涓婃捣閫氱敤鏈烘鏈夐檺鍏徃", - contactName: "钁e浼�", - servicePerson: "绯荤粺绠$悊鍛�", - orderStatus: "宸茬粨鍗�", - repairSource: "鐢佃瘽鎶ヤ慨", - orderType: "淇濆唴鏀惰垂" - } - ], + tableInfomation: [], tableColumn: [ - { label: "宸ュ崟缂栧彿", prop: "orderNumber", min: 100 }, // 宸ュ崟缂栧彿 - { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 130 }, // 瀹㈡埛鍚嶇О + { label: "宸ュ崟缂栧彿", prop: "number", min: 100 }, // 宸ュ崟缂栧彿 + { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 130 }, // 瀹㈡埛鍚嶇О { label: "鑱旂郴浜哄鍚�", prop: "contactName" }, // 鑱旂郴浜哄鍚� - { label: "鏈嶅姟浜哄憳", prop: "servicePerson" }, // 鏈嶅姟浜哄憳 - { label: "宸ュ崟鐘舵��", prop: "orderStatus" }, // 宸ュ崟鐘舵�� - { label: "鎶ヤ慨鏉ユ簮", prop: "repairSource" }, // 鎶ヤ慨鏉ユ簮 + { label: "鏈嶅姟浜哄憳", prop: "name" }, // 鏈嶅姟浜哄憳 + { label: "宸ュ崟鐘舵��", prop: "orderType" }, // 宸ュ崟鐘舵�� + { label: "鎶ヤ慨鏉ユ簮", prop: "reportSourceId" }, // 鎶ヤ慨鏉ユ簮 { label: "宸ュ崟绫诲瀷", prop: "orderType" } // 宸ュ崟绫诲瀷 ] } @@ -104,6 +99,39 @@ this.searchOptions.push({ value: (i + 1).toString(), label: label }) } }, + // 璇锋眰鏁版嵁 + async getData() { + this.loading = true + await getOrderManageList({ + keyword: "", + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }) + .then((res) => { + console.log(res) + 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.count + } else { + this.tableList.tableInfomation = [] + } + } else { + this.tableList.tableInfomation = [] + } + this.loading = false + }) + .catch((err) => { + console.log(err) + this.tableList.tableInfomation = [] + this.loading = false + }) + }, // tab鍒囨崲 tabsClick(tab, event) { console.log(tab, event) @@ -112,39 +140,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - orderNumber: "CS21", - orderName: "", - orderType: "", - contactName: "", - repairSource: "", - selSourceOrder: "", - problemDesc: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - orderNumber: row.orderNumber, - orderName: row.orderName, - orderType: row.orderType, - contactName: row.contactName, - repairSource: row.repairSource, - selSourceOrder: row.selSourceOrder, - problemDesc: row.problemDesc, - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelOrderManage({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getData() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } -- Gitblit v1.8.0