From 6291de84d5f68f1f1cd90031c18183a2c1489555 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 11 八月 2023 18:20:04 +0800 Subject: [PATCH] 销售模块 删除和查询 --- src/views/service/serviceContract/DetailServiceContract.vue | 16 src/views/service/serviceFollowup/AddServiceFollowupDialog.vue | 36 +- src/views/service/clientServiceOrder/DetailClientServiceOrder.vue | 16 src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 34 - src/api/sales/contractManage.js | 5 src/api/sales/generatePlan.js | 5 src/views/sales/masterOrder/index.vue | 67 ++- src/api/sales/masterOrder.js | 5 src/api/sales/salesDetails.js | 5 src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue | 154 +++---- src/components/makepager/TableCommonView.vue | 2 src/views/sales/salesReturn/index.vue | 72 ++- src/views/client/followupRecords/index.vue | 12 src/views/client/contacts/DetailContacts.vue | 7 src/api/sales/quotation.js | 5 src/views/service/serviceContract/index.vue | 3 src/views/service/serviceFollowup/index.vue | 29 + src/views/sales/contractManage/index.vue | 72 ++- src/views/sales/salesDetails/index.vue | 67 ++- src/views/client/client/index.vue | 5 src/views/sales/subOrder/index.vue | 67 ++- src/views/client/client/DetailClientManage.vue | 7 src/components/makepager/DetailListCommonBtn.vue | 4 src/views/sales/refundForm/index.vue | 72 ++- src/api/sales/subOrder.js | 5 src/views/client/contacts/index.vue | 20 - src/views/client/salesLead/DetailSalesLead.vue | 6 src/api/sales/refundForm.js | 5 src/views/sales/quotation/AddQuotationDialog.vue | 7 src/api/sales/salesReturn.js | 5 src/views/sales/salesOpportunity/index.vue | 94 +++- src/api/sales/salesOpportunity.js | 5 src/views/service/clientServiceOrder/index.vue | 6 src/views/sales/generatePlan/index.vue | 73 ++- src/views/sales/quotation/index.vue | 69 ++- 35 files changed, 671 insertions(+), 391 deletions(-) diff --git a/src/api/sales/contractManage.js b/src/api/sales/contractManage.js index f1c6342..cc57f57 100644 --- a/src/api/sales/contractManage.js +++ b/src/api/sales/contractManage.js @@ -19,8 +19,9 @@ // 鍒犻櫎鍚堝悓绠$悊 export function getDelContract(data) { return request({ - url: "/api/contract/delete/" + data.id, - method: "delete" + url: "/api/contract/delete", + method: "delete", + data }) } // 鏇存柊鍚堝悓绠$悊 diff --git a/src/api/sales/generatePlan.js b/src/api/sales/generatePlan.js index 4059e08..9a262da 100644 --- a/src/api/sales/generatePlan.js +++ b/src/api/sales/generatePlan.js @@ -19,8 +19,9 @@ // 鍒犻櫎鐢熸垚璁″垝 export function getDelPlan(data) { return request({ - url: "/api/plan/delete/" + data.id, - method: "delete" + url: "/api/plan/delete", + method: "delete", + data }) } // 鏇存柊鐢熸垚璁″垝 diff --git a/src/api/sales/masterOrder.js b/src/api/sales/masterOrder.js index 8f06921..1e7622f 100644 --- a/src/api/sales/masterOrder.js +++ b/src/api/sales/masterOrder.js @@ -19,8 +19,9 @@ // 鍒犻櫎涓昏鍗� export function getDelMasterOrder(data) { return request({ - url: "/api/masterOrder/delete/" + data.id, - method: "delete" + url: "/api/masterOrder/delete", + method: "delete", + data }) } // 鏇存柊涓昏鍗� diff --git a/src/api/sales/quotation.js b/src/api/sales/quotation.js index 2e991fc..fac0256 100644 --- a/src/api/sales/quotation.js +++ b/src/api/sales/quotation.js @@ -19,8 +19,9 @@ // 鍒犻櫎鎶ヤ环鍗� export function getDelQuotation(data) { return request({ - url: "/api/quotation/delete/" + data.id, - method: "delete" + url: "/api/quotation/delete", + method: "delete", + data }) } // 鏇存柊鎶ヤ环鍗� diff --git a/src/api/sales/refundForm.js b/src/api/sales/refundForm.js index 06f1c19..8ecbdea 100644 --- a/src/api/sales/refundForm.js +++ b/src/api/sales/refundForm.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞��娆惧崟 export function getDelSalesRefund(data) { return request({ - url: "/api/salesRefund/delete/" + data.id, - method: "delete" + url: "/api/salesRefund/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞��娆惧崟 diff --git a/src/api/sales/salesDetails.js b/src/api/sales/salesDetails.js index 821224a..642dc67 100644 --- a/src/api/sales/salesDetails.js +++ b/src/api/sales/salesDetails.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞槑缁� export function getDelSalesDetails(data) { return request({ - url: "/api/salesDetails/delete/" + data.id, - method: "delete" + url: "/api/salesDetails/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞槑缁� diff --git a/src/api/sales/salesOpportunity.js b/src/api/sales/salesOpportunity.js index befccd2..eb5d7a5 100644 --- a/src/api/sales/salesOpportunity.js +++ b/src/api/sales/salesOpportunity.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞満浼� export function getDelSaleChance(data) { return request({ - url: "/api/saleChance/delete/" + data.id, - method: "delete" + url: "/api/saleChance/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞満浼� diff --git a/src/api/sales/salesReturn.js b/src/api/sales/salesReturn.js index d59ba55..20a4910 100644 --- a/src/api/sales/salesReturn.js +++ b/src/api/sales/salesReturn.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞��璐у崟 export function getDelSalesReturn(data) { return request({ - url: "/api/salesReturn/delete/" + data.id, - method: "delete" + url: "/api/salesReturn/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞��璐у崟 diff --git a/src/api/sales/subOrder.js b/src/api/sales/subOrder.js index 2d9c0c3..cdcc8c1 100644 --- a/src/api/sales/subOrder.js +++ b/src/api/sales/subOrder.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞瓙鍗� export function getDelSubOrder(data) { return request({ - url: "/api/subOrder/delete/" + data.id, - method: "delete" + url: "/api/subOrder/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞瓙鍗� diff --git a/src/components/makepager/DetailListCommonBtn.vue b/src/components/makepager/DetailListCommonBtn.vue index 5e3f4c1..1e9e2fa 100644 --- a/src/components/makepager/DetailListCommonBtn.vue +++ b/src/components/makepager/DetailListCommonBtn.vue @@ -5,11 +5,11 @@ <span>鏂板缓</span> </div> <div class="query-class"> - <div class="query-class-title">鏌ヨ鍒嗙被</div> + <!-- <div class="query-class-title">鏌ヨ鍒嗙被</div> <el-select v-model="queryClassValue" placeholder="璇烽�夋嫨" class="query-class-sel" size="mini"> <el-option v-for="item in queryClassOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> - </el-select> + </el-select> --> </div> </div> </template> diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index 3e14cf8..ae1083e 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -28,7 +28,7 @@ <span v-if="item.price">{{ "锟�" + number_format(scope.row[item.prop], 2, ".", ",") }}</span> <div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div> <span v-else-if="item.isTime">{{ - dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 08:00:00" + dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 00:06:26" ? "--" : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) }}</span> diff --git a/src/views/client/client/DetailClientManage.vue b/src/views/client/client/DetailClientManage.vue index 966d3a5..6ff1c1a 100644 --- a/src/views/client/client/DetailClientManage.vue +++ b/src/views/client/client/DetailClientManage.vue @@ -254,10 +254,13 @@ created() { this.setData(this.detailConfig.infomation) this.addConfig = { - client: this.detailConfig.infomation.id, + id_name: "client_id", + id: this.detailConfig.infomation.id, client_name: this.detailConfig.infomation.name, contact_name: this.detailConfig.infomation.contact_name, - client_status_id: this.detailConfig.infomation.client_status_id + client_status_id: this.detailConfig.infomation.client_status_id, + client_id: this.detailConfig.infomation.id, + contact_id: this.detailConfig.infomation.contact_id } }, mounted() {}, diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue index c321210..cdadd62 100644 --- a/src/views/client/client/index.vue +++ b/src/views/client/client/index.vue @@ -174,11 +174,13 @@ const list = res.data.list.map((item) => { let contact_name = "" let contact_phone = "" + let contact_id = 0 if (item.contacts.length !== 0) { for (let i = 0; i < item.contacts.length; i++) { if (item.contacts[i].is_first) { contact_name = item.contacts[i].name contact_phone = item.contacts[i].phone + contact_id = item.contacts[i].id } } } @@ -187,7 +189,8 @@ contact_name: contact_name, contact_phone: contact_phone, client_level: item.client_level.name, - client_status: item.client_status.name + client_status: item.client_status.name, + contact_id: contact_id } }) this.tableList.tableInfomation = list || [] diff --git a/src/views/client/contacts/DetailContacts.vue b/src/views/client/contacts/DetailContacts.vue index 98716b9..99ee946 100644 --- a/src/views/client/contacts/DetailContacts.vue +++ b/src/views/client/contacts/DetailContacts.vue @@ -157,10 +157,13 @@ created() { this.setData(this.detailConfig.infomation) this.addConfig = { - contact: this.detailConfig.infomation.id, + id_name: "contact_id", + id: this.detailConfig.infomation.id, client_name: this.detailConfig.infomation.client_name, contact_name: this.detailConfig.infomation.name, - client_status_id: this.detailConfig.infomation.Client.client_status_id + client_status_id: this.detailConfig.infomation.Client.client_status_id, + contact_id: this.detailConfig.infomation.id, + client_id: this.detailConfig.infomation.client_id } }, mounted() {}, diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue index 4285667..303b3d4 100644 --- a/src/views/client/contacts/index.vue +++ b/src/views/client/contacts/index.vue @@ -152,7 +152,8 @@ return { ...item, client_name: item.Client.name, - is_first: item.is_first ? "鏄�" : "鍚�" + is_first: item.is_first ? "鏄�" : "鍚�", + client_id: item.Client.id } }) this.tableList.tableInfomation = list || [] @@ -198,23 +199,6 @@ }, // 鍒犻櫎 delClick() { - // this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - // confirmButtonText: "纭畾", - // cancelButtonText: "鍙栨秷", - // type: "warning" - // }) - // .then(function () { - // return getDeleteContact({ id: id }) - // }) - // .then((response) => { - // if (response.code === 200) { - // this.$message.success("鍒犻櫎鎴愬姛") - // this.getData() - // } else { - // this.$message.warning("鍒犻櫎澶辫触") - // } - // }) - // .catch(function () {}) if (this.selValueList && this.selValueList.length > 0) { this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { confirmButtonText: "纭畾", diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue index 457eb0b..8cd65b5 100644 --- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue +++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue @@ -398,29 +398,19 @@ if (valid) { const params = this.saveParams() if (this.editConfig.title === "鏂板缓") { - getAddFollowRecord(params) - .then((res) => { - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getAddFollowRecord(params).then((res) => { + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("娣诲姞鎴愬姛") + this.$parent.getData() + } + }) } else { getUpdateFollowRecord(params) .then((res) => { this.editConfig.visible = false if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) + this.$message.success("缂栬緫鎴愬姛") this.$parent.getData() } }) @@ -438,9 +428,9 @@ let data = this.editConfig.infomation let follow_record = { follow_record: { - client_id: parseInt(this.clientId), + client_id: this.clientId || 0, client_status_id: data.client_status_id || 0, - contact_id: parseInt(this.contactId), + contact_id: this.contactId || 0, contact_information_id: data.contact_information_id || 0, content: data.content || "", follow_time: data.follow_time || "", @@ -449,8 +439,8 @@ number: data.number || "", purpose: data.purpose || "", record: data.record || "", - sale_chance_id: parseInt(this.saleChanceId), //data.sale_chance_id || - sales_leads_id: parseInt(this.saleLeadId), // data.sales_leads_id || + sale_chance_id: this.saleChanceId || 0, + sales_leads_id: this.saleLeadId || 0, topic: data.topic || "" } } diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue index bb04e8b..060adca 100644 --- a/src/views/client/followupRecords/index.vue +++ b/src/views/client/followupRecords/index.vue @@ -129,10 +129,13 @@ created() { this.setTable() if (!this.isDetail) { - this.getData() + this.search_map = {} } else { - this.tableList.tableInfomation = this.followRecord + this.search_map = { + [this.addConfig.id_name]: this.addConfig.id + } } + this.getData(this.search_map) }, methods: { setTable() { @@ -146,7 +149,7 @@ { label: "鑱旂郴鏂瑰紡", prop: "phone", min: 100 }, // 鑱旂郴鏂瑰紡 { label: "鑱旂郴浜烘棩鏈�", prop: "follow_time", isTime: true, min: 130 }, // 鑱旂郴浜烘棩鏈� { label: "涓嬫鍥炶鏃ユ湡", prop: "next_follow_time", isTime: true, min: 130 }, // 涓嬫鍥炶鏃ユ湡 - { label: "璐熻矗浜�", prop: "member_id", min: 110 }, // 璐熻矗浜� + { label: "璐熻矗浜�", prop: "member_name", min: 110 }, // 璐熻矗浜� { label: "璺熻繘璁板綍", prop: "record", min: 130 } // 璺熻繘璁板綍 ] } @@ -175,7 +178,8 @@ client_name: item.client.name, contact_name: item.contact.name, client_status_id: item.client.client_status_id, - phone: item.contact.phone + phone: item.contact.phone, + member_name: item.member.username } }) this.tableList.tableInfomation = list || [] diff --git a/src/views/client/salesLead/DetailSalesLead.vue b/src/views/client/salesLead/DetailSalesLead.vue index 1172a5a..4df0d87 100644 --- a/src/views/client/salesLead/DetailSalesLead.vue +++ b/src/views/client/salesLead/DetailSalesLead.vue @@ -151,8 +151,10 @@ created() { this.setData() this.addConfig = { - sealsLead: this.detailConfig.infomation.id, - sales_leads_name: this.detailConfig.infomation.name + id_name: "sales_leads_id", + id: this.detailConfig.infomation.id, + sales_leads_name: this.detailConfig.infomation.name, + sales_leads_id: this.detailConfig.infomation.id } }, mounted() {}, diff --git a/src/views/sales/contractManage/index.vue b/src/views/sales/contractManage/index.vue index 99243fa..4b4bf52 100644 --- a/src/views/sales/contractManage/index.vue +++ b/src/views/sales/contractManage/index.vue @@ -6,6 +6,8 @@ :label-search="true" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> <PublicFunctionBtnView @@ -13,16 +15,22 @@ :submit-approval="true" ::statistics="true" :operates-list="operatesList" + @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> - <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick"> + <TableCommonView + ref="tableListRef" + :table-list="tableList" + @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" + > <template slot="tableButton"> <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> @@ -83,7 +91,9 @@ contractDetail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -112,7 +122,7 @@ async getData() { this.loading = true await getContractList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -141,6 +151,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 @@ -155,27 +177,35 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelContract({ 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(() => { + getDelContract({ 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 }, // 鍚堝悓绠$悊璇︽儏 selCommonClick(row) { diff --git a/src/views/sales/generatePlan/index.vue b/src/views/sales/generatePlan/index.vue index bf56574..f6ae8f7 100644 --- a/src/views/sales/generatePlan/index.vue +++ b/src/views/sales/generatePlan/index.vue @@ -5,18 +5,25 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :operates-list="operatesList" /> + <PublicFunctionBtnView :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> - <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick"> + <TableCommonView + ref="tableListRef" + :table-list="tableList" + @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" + > <template slot="tableButton"> <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> @@ -77,7 +84,9 @@ planDetail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -106,7 +115,7 @@ async getData() { this.loading = true await getPlanList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -135,6 +144,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 @@ -149,27 +170,35 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelPlan({ 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(() => { + getDelPlan({ 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 }, // 鍚堝悓绠$悊璇︽儏 selCommonClick(row) { diff --git a/src/views/sales/masterOrder/index.vue b/src/views/sales/masterOrder/index.vue index 685e9e5..d279298 100644 --- a/src/views/sales/masterOrder/index.vue +++ b/src/views/sales/masterOrder/index.vue @@ -9,9 +9,11 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :operates-list="operatesList" /> + <PublicFunctionBtnView :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -22,12 +24,13 @@ :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> @@ -101,7 +104,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -132,7 +137,7 @@ async getData() { this.loading = true await getMasterOrderList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -162,6 +167,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 @@ -176,27 +193,35 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelMasterOrder({ 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(() => { + getDelMasterOrder({ 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) { diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue index fe44f26..17e48af 100644 --- a/src/views/sales/quotation/AddQuotationDialog.vue +++ b/src/views/sales/quotation/AddQuotationDialog.vue @@ -74,7 +74,12 @@ </el-col> <el-col :span="12"> <el-form-item label="鏈夋晥鏈熻嚦" prop="validity_date"> - <el-date-picker v-model="editConfig.infomation.validity_date" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-date-picker + v-model="editConfig.infomation.validity_date" + value-format="yyyy-MM-dd HH:mm:ss" + type="datetime" + placeholder="閫夋嫨鏃ユ湡" + > </el-date-picker> </el-form-item> </el-col> diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue index 8f73b84..b75379a 100644 --- a/src/views/sales/quotation/index.vue +++ b/src/views/sales/quotation/index.vue @@ -10,9 +10,11 @@ :label-search="true" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" /> + <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -23,12 +25,13 @@ @selClientClick="selClientClick" @selContactsClick="selContactsClick" @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> @@ -106,7 +109,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -122,7 +127,7 @@ { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120, isClientClick: true }, // 瀹㈡埛鍚嶇О { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚� { label: "閿�鍞礋璐d汉", prop: "member_id" }, // 閿�鍞礋璐d汉 - { label: "鏈夋晥鏈�", prop: "validity_date", isTime: true, min: 100 }, // 淇敼鏃堕棿 + { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿 { label: "灏忚", prop: "subTotal" }, // 灏忚 { label: "鍚堣", prop: "total" }, // 鍚堣 { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О @@ -140,7 +145,7 @@ async getData() { this.loading = true await getQuotationList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -171,6 +176,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 @@ -185,27 +202,35 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelQuotation({ 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(() => { + getDelQuotation({ 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) { diff --git a/src/views/sales/refundForm/index.vue b/src/views/sales/refundForm/index.vue index df1d464..dca05e4 100644 --- a/src/views/sales/refundForm/index.vue +++ b/src/views/sales/refundForm/index.vue @@ -9,9 +9,16 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :receive="false" :submit-approval="true" :operates-list="operatesList" /> + <PublicFunctionBtnView + :receive="false" + :submit-approval="true" + :operates-list="operatesList" + @batchDelete="delClick" + /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -21,12 +28,13 @@ :select-box="!isDetail" @selClientClick="selClientClick" @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" > <template slot="tableButton"> <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> @@ -97,7 +105,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -130,7 +140,7 @@ async getData() { this.loading = true await getSalesRefundList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -159,6 +169,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 @@ -173,27 +195,35 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSalesRefund({ 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(() => { + getDelSalesRefund({ 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) { diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue index b318dad..61f25db 100644 --- a/src/views/sales/salesDetails/index.vue +++ b/src/views/sales/salesDetails/index.vue @@ -9,9 +9,11 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" /> + <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -22,12 +24,13 @@ :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> @@ -113,7 +116,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -152,7 +157,7 @@ async getData() { this.loading = true await getSalesDetailsList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -182,6 +187,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 @@ -196,27 +213,35 @@ this.editConfig.infomation = { ...row, sale_chance_name: "" } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSalesDetails({ 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(() => { + getDelSalesDetails({ 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) { diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue index 9518def..6a1ded9 100644 --- a/src/views/sales/salesOpportunity/index.vue +++ b/src/views/sales/salesOpportunity/index.vue @@ -9,6 +9,8 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> <PublicFunctionBtnView @@ -16,6 +18,7 @@ :statistics="true" :custom-funnel="true" :operates-list="operatesList" + @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> @@ -26,13 +29,14 @@ @selClientClick="selClientClick" @selContactsClick="selContactsClick" @selCommonClick="selCommonClick" + @getSelectArray="getSelectArray" > <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="120"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> <el-button 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> @@ -119,7 +123,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + search_map: {}, + selValueList: [] } }, created() { @@ -135,25 +141,26 @@ { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 90, isClientClick: true }, // 瀹㈡埛鍚嶇О { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙� { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100, isContactClick: true }, // 鑱旂郴浜哄鍚� - { label: "閿�鍞樁娈�", prop: "sale_stage_id" }, // 閿�鍞樁娈� - { label: "鍙兘鎬�(%)", prop: "possibilities_id" }, // 鍙兘鎬� + { label: "閿�鍞樁娈�", prop: "sale_stage" }, // 閿�鍞樁娈� + { label: "鍙兘鎬�(%)", prop: "possibilities" }, // 鍙兘鎬� { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time", isTime: true, min: 130 }, // 棰勮鎴愪氦鏃ユ湡 { label: "棰勮鍚堝悓閲戦", prop: "projected_amount" }, // 棰勮鍚堝悓閲戦 { label: "棰勭畻缁濆鍊�", prop: "capital_budget" }, // 棰勭畻缁濆鍊� - { label: "閿�鍞礋璐d汉", prop: "member_id" } // 閿�鍞礋璐d汉 + { label: "閿�鍞礋璐d汉", prop: "member_name" } // 閿�鍞礋璐d汉 ] } this.searchOptions = [] for (let i = 0; i < this.tableList.tableColumn.length; i++) { const label = this.tableList.tableColumn[i].label - this.searchOptions.push({ value: (i + 1).toString(), label: label }) + const value = this.tableList.tableColumn[i].prop + this.searchOptions.push({ value: value, label: label }) } }, // 璇锋眰鏁版嵁 async getData() { this.loading = true await getSaleChanceList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -184,6 +191,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 @@ -198,27 +217,54 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSaleChance({ id: id }) + delClick() { + // this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + // confirmButtonText: "纭畾", + // cancelButtonText: "鍙栨秷", + // type: "warning" + // }) + // .then(function () { + // return getDelSaleChance({ id: id }) + // }) + // .then((response) => { + // if (response.code === 200) { + // this.$message.success("鍒犻櫎鎴愬姛") + // this.getData() + // } else { + // this.$message.warning("鍒犻櫎澶辫触") + // } + // }) + // .catch(function () {}) + + 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(() => { + console.log("dddd") + getDelSaleChance({ 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) { diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue index 32c0634..9654087 100644 --- a/src/views/sales/salesReturn/index.vue +++ b/src/views/sales/salesReturn/index.vue @@ -9,9 +9,16 @@ 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" /> + <PublicFunctionBtnView + :receive="false" + :import-button="false" + receive:operates-list="operatesList" + @batchDelete="delClick" + /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -21,12 +28,13 @@ :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> @@ -98,7 +106,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -131,7 +141,7 @@ async getData() { this.loading = true await getSalesReturnList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -160,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 @@ -174,27 +196,35 @@ 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) { diff --git a/src/views/sales/subOrder/index.vue b/src/views/sales/subOrder/index.vue index 44eff2f..6e647bd 100644 --- a/src/views/sales/subOrder/index.vue +++ b/src/views/sales/subOrder/index.vue @@ -9,9 +9,11 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :operates-list="operatesList" /> + <PublicFunctionBtnView :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -23,12 +25,13 @@ @selClientClick="selClientClick" @selMasterClick="selMasterClick" @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> @@ -113,7 +116,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -144,7 +149,7 @@ async getData() { this.loading = true await getSubOrderList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -174,6 +179,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 @@ -188,27 +205,35 @@ this.editConfig.infomation = { ...row, masterOrderNumber: "" } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSubOrder({ 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(() => { + getDelSubOrder({ 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) { diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue index 6483d54..e308dae 100644 --- a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue +++ b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue @@ -116,7 +116,7 @@ </div> </el-form-item> </el-col> - <el-col :span="12"> + <!-- <el-col :span="12"> <el-form-item label="浜у搧绫诲埆" prop="productCategory"> <div class="common-select"> <el-select @@ -136,7 +136,7 @@ <div class="common-select-btn"><i class="el-icon-setting"></i></div> </div> </el-form-item> - </el-col> + </el-col> --> <el-col :span="12"> <el-form-item label="浜у搧鍚嶇О" prop="product_name"> <div class="custom-name"> @@ -167,7 +167,6 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" - @focus="getServiceTypeList" > <el-option v-for="item in serviceTypeOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -226,7 +225,6 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" - @focus="getSeverityList" > <el-option v-for="item in severityOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -253,7 +251,6 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" - @focus="getPriorityLevelList" > <el-option v-for="item in priorityLevelOptions" @@ -341,12 +338,24 @@ </el-col> <el-col :span="12"> <el-form-item label="浜ら�氳垂" prop="carFare"> - <el-input v-model="editConfig.infomation.carFare"></el-input> + <el-input-number + v-model="editConfig.infomation.carFare" + placeholder="璇疯緭鍏�" + :min="0" + :controls="false" + style="width: 100%; margin-right: 5px" + ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="鏀惰垂閲戦" prop="chargeAmount"> - <el-input v-model="editConfig.infomation.chargeAmount"></el-input> + <el-input-number + v-model="editConfig.infomation.chargeAmount" + placeholder="璇疯緭鍏�" + :min="0" + :controls="false" + style="width: 100%; margin-right: 5px" + ></el-input-number> </el-form-item> </el-col> <el-col :span="12"> @@ -357,7 +366,6 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" - @focus="getTimeSpentList" > <el-option v-for="item in timeSpentOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -601,7 +609,7 @@ serviceNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″崟缂栧彿", trigger: "blur" }], faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], subject: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }], - productCategory: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], + // productCategory: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], serviceManId: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], serviceOrderStatusId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], problemDesc: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] @@ -654,8 +662,8 @@ }, clientId: this.editCommonConfig.infomation.clientId, contactId: this.editCommonConfig.infomation.contactId, - serviceContractId: this.editCommonConfig.infomation.contractId, - contractId: this.editCommonConfig.infomation.orderId, + serviceContractId: this.editCommonConfig.infomation.serviceContractId, + SalesDetailsId: this.editCommonConfig.infomation.SalesDetailsId, productNameId: this.editCommonConfig.infomation.productId, saleChanceId: this.editCommonConfig.infomation.saleChanceId } @@ -664,6 +672,16 @@ this.$store.dispatch("geClient") this.getCommonData() this.setTable() + }, + mounted() { + this.$store.dispatch("geServiceContract") + this.$store.dispatch("geSalesDetails") + this.$store.dispatch("geContact") + this.$store.dispatch("geChance") + this.getFaultTypeList() + this.getSeverityList() + this.getPriorityLevelList() + this.getTimeSpentList() }, methods: { setTable() { @@ -696,37 +714,23 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddServiceOrder(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getAddServiceOrder(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("娣诲姞鎴愬姛") + this.$parent.getData() + } + }) } else { - getUpdateServiceOrder(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getUpdateServiceOrder(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } + }) } } else { console.log("error submit") @@ -741,20 +745,20 @@ appointmentTime: data.appointmentTime || "", carFare: data.carFare || 0, chargeAmount: data.chargeAmount || 0, - clientId: this.clientId, - contactId: this.contactId, - contractId: this.serviceContractId, + clientId: this.clientId || 0, + contactId: this.contactId || 0, + serviceContractId: this.serviceContractId || 0, expectTime: data.expectTime || "", faqId: data.faqId || 0, faultTypeId: data.faultTypeId || 0, id: data.id || 0, - orderId: this.contractId, + SalesDetailsId: this.SalesDetailsId || 0, priorityLevelId: data.priorityLevelId || 0, problemDesc: data.problemDesc || "", productId: this.productNameId, realTime: data.realTime || "", remark: data.remark || "", - saleChanceId: this.saleChanceId, + saleChanceId: this.saleChanceId || 0, serviceManId: data.serviceManId || 0, serviceNumber: data.serviceNumber || "", serviceTypeId: data.serviceTypeId || 0, @@ -772,10 +776,6 @@ }, // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶 querySearchAsync(queryString, cb, value) { - this.$store.dispatch("geServiceContract") - this.$store.dispatch("geSalesDetails") - this.$store.dispatch("geContact") - this.$store.dispatch("geChance") var restaurants = [] if (value === "client") { restaurants = this.clientList @@ -808,7 +808,7 @@ } else if (value === "serviceContract") { this.serviceContractId = item.id } else if (value === "contract") { - this.contractId = item.id + this.SalesDetailsId = item.id } else if (value === "productName") { this.productCategoryId = item.id } else if (value === "contact") { @@ -852,7 +852,7 @@ this.serviceContractId = row.id } else if (value === "contract") { this.editConfig.infomation.number = row.number - this.contractId = row.id + this.SalesDetailsId = row.id } else if (value === "productName") { this.editConfig.infomation.product_name = row.name this.productNameId = row.id @@ -871,7 +871,7 @@ this.serviceContractId = 0 } else if (value === "contract") { this.editConfig.infomation.number = "" - this.contractId = 0 + this.SalesDetailsId = 0 } else if (value === "productName") { this.editConfig.infomation.product_name = "" this.productNameId = 0 @@ -899,53 +899,32 @@ // 鏁呴殰绫诲埆 async getFaultTypeList() { await getFaultTypeList().then((res) => { - console.log(res) this.faultTypeOptions = res.data.data }) }, // 鏈嶅姟鏂瑰紡 async getServiceTypeList() { - await getServiceTypeList() - .then((res) => { - console.log(res) - this.serviceTypeOptions = res.data.data - }) - .catch((err) => { - console.log(err) - }) + await getServiceTypeList().then((res) => { + this.serviceTypeOptions = res.data.data + }) }, // 涓ラ噸绋嬪害 async getSeverityList() { - await getSeverityList() - .then((res) => { - console.log(res) - this.severityOptions = res.data.data - }) - .catch((err) => { - console.log(err) - }) + await getSeverityList().then((res) => { + this.severityOptions = res.data.data + }) }, // 浼樺厛绾у埆 async getPriorityLevelList() { - await getPriorityLevelList() - .then((res) => { - console.log(res) - this.priorityLevelOptions = res.data.data - }) - .catch((err) => { - console.log(err) - }) + await getPriorityLevelList().then((res) => { + this.priorityLevelOptions = res.data.data + }) }, // 鑺辫垂鏃堕棿 async getTimeSpentList() { - await getTimeSpentList() - .then((res) => { - console.log(res) - this.timeSpentOptions = res.data.data - }) - .catch((err) => { - console.log(err) - }) + await getTimeSpentList().then((res) => { + this.timeSpentOptions = res.data.data + }) } } } @@ -1017,6 +996,9 @@ height: 55px; line-height: 55px; } + .el-input__inner { + text-align: left; + } } } </style> diff --git a/src/views/service/clientServiceOrder/DetailClientServiceOrder.vue b/src/views/service/clientServiceOrder/DetailClientServiceOrder.vue index ccd05dd..88ccd46 100644 --- a/src/views/service/clientServiceOrder/DetailClientServiceOrder.vue +++ b/src/views/service/clientServiceOrder/DetailClientServiceOrder.vue @@ -261,7 +261,7 @@ <!-- <Contacts :isDetail="true" /> --> </div> <div v-if="activeName === 'followup'" class="second"> - <ServiceFollowup :isDetail="true" /> + <ServiceFollowup :isDetail="true" :add-config="addConfig" /> </div> </div> </el-drawer> @@ -311,12 +311,24 @@ isServiceContractExpand: true, // 鏈嶅姟鍚堝悓淇℃伅 serviceContractList: [], isHistoryExpand: true, // 瀹㈡埛鏈嶅姟鍗曞巻鍙茶褰� - historyList: [] + historyList: [], + addConfig: {} } }, created() { this.setData() this.setTable() + console.log(this.detailConfig.infomation.contact_name) + this.addConfig = { + keyword: this.detailConfig.infomation.serviceNumber, + keywordType: "瀹㈡埛鏈嶅姟鍗�", + client_name: this.detailConfig.infomation.client_name, + clientId: this.detailConfig.infomation.clientId, + contactId: this.detailConfig.infomation.contactId, + contact_name: this.detailConfig.infomation.contact_name, + service_number: this.detailConfig.infomation.serviceNumber, + serviceId: this.detailConfig.infomation.id + } }, mounted() {}, methods: { diff --git a/src/views/service/clientServiceOrder/index.vue b/src/views/service/clientServiceOrder/index.vue index d231635..b091743 100644 --- a/src/views/service/clientServiceOrder/index.vue +++ b/src/views/service/clientServiceOrder/index.vue @@ -125,7 +125,7 @@ { label: "瀹為檯澶勭悊鏃堕棿", prop: "realTime" }, // 瀹為檯澶勭悊鏃堕棿 { label: "鏈嶅姟浜哄憳", prop: "serviceManId" }, // 鏈嶅姟浜哄憳 { label: "鏈嶅姟鏂瑰紡", prop: "serviceType_name" }, // 鏈嶅姟鏂瑰紡 - { label: "浜у搧绫诲埆", prop: "reportSourceId" }, // 浜у搧绫诲埆 + // { label: "浜у搧绫诲埆", prop: "reportSourceId" }, // 浜у搧绫诲埆 { label: "鏁呴殰绫诲埆", prop: "faultType_name" } // 鏁呴殰绫诲埆 ] } @@ -197,7 +197,7 @@ console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row } + this.editConfig.infomation = { ...row, contact_name: row.Contact.name, service_number: row.serviceContractId } }, // 鍒犻櫎 delClick() { @@ -245,7 +245,7 @@ selCommonClick(row) { console.log(row) this.clientServiceDetail.visible = true - this.clientServiceDetail.infomation = { ...row } + this.clientServiceDetail.infomation = { ...row, contact_name: row.Contact.name } } } } diff --git a/src/views/service/serviceContract/DetailServiceContract.vue b/src/views/service/serviceContract/DetailServiceContract.vue index f7b3d0d..02dbc24 100644 --- a/src/views/service/serviceContract/DetailServiceContract.vue +++ b/src/views/service/serviceContract/DetailServiceContract.vue @@ -83,9 +83,10 @@ <div class="termsConditions"> <div class="content-title">{{ "鏉℃涓庢潯绾�" + "锛�" }}</div> <div class="content-termsConditions"> - <ul> + {{ "\n" + detailConfig.infomation.terms }} + <!-- <ul> <li v-for="(item, index) in Status.serviceContract" :key="index">{{ item }}</li> - </ul> + </ul> --> </div> </div> </div> @@ -501,13 +502,14 @@ color: #555; } .content-termsConditions { - margin-left: 25px; + margin: 0px 25px 15px; font-size: 13px; color: #333; - li { - margin: 5px 0; - border-bottom: 0px solid #f9f9fb; - } + white-space: pre-wrap; + // li { + // margin: 5px 0; + // border-bottom: 0px solid #f9f9fb; + // } } } } diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue index 6c36084..9c32304 100644 --- a/src/views/service/serviceContract/index.vue +++ b/src/views/service/serviceContract/index.vue @@ -237,7 +237,8 @@ ...row.client, client_name: row.client.name, client_level: row.client.client_level.name, - client_status: row.client.client_status.name + client_status: row.client.client_status.name, + contact_name: row.contact.name } }, // 鏈嶅姟鍚堝悓璇︽儏 diff --git a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue index 83ed22f..a4071bb 100644 --- a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue +++ b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue @@ -51,7 +51,7 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contactId"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_name"> <div class="custom-name"> <el-autocomplete v-model="editConfig.infomation.contact_name" @@ -112,10 +112,10 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="婊℃剰搴�" prop="satisfaction"> + <el-form-item label="婊℃剰搴�" prop="satisfactionId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.satisfaction" + v-model="editConfig.infomation.satisfactionId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" @@ -128,10 +128,10 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍙婃椂鐜�" prop="timelyRate"> + <el-form-item label="鍙婃椂鐜�" prop="timelyRateId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.timelyRate" + v-model="editConfig.infomation.timelyRateId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" @@ -144,10 +144,10 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="瑙e喅鐜�" prop="solveRate"> + <el-form-item label="瑙e喅鐜�" prop="solveRateId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.solveRate" + v-model="editConfig.infomation.solveRateId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" @@ -168,10 +168,10 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="isVisit"> + <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="isVisitId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.isVisit" + v-model="editConfig.infomation.isVisitId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" @@ -319,7 +319,7 @@ }, clientId: this.editCommonConfig.infomation.clientId, contactId: this.editCommonConfig.infomation.contactId, - serviceId: this.editCommonConfig.infomation.serviceId + serviceOrderId: this.editCommonConfig.infomation.serviceOrderId } }, created() { @@ -382,16 +382,16 @@ clientId: this.clientId || 0, contactId: this.contactId || 0, file: data.file || "", - isVisit: data.isVisit || 0, + isVisit: data.isVisitId || 0, memberId: data.memberId || 0, number: data.number || "", oldMemberId: data.oldMemberId || 0, planId: data.planId || 0, remark: data.remark || "", - satisfaction: data.satisfaction || 0, - serviceId: this.serviceId || 0, - solveRate: data.solveRate || 0, - timelyRate: data.timelyRate || 0 + satisfaction: data.satisfactionId || 0, + serviceOrderId: this.serviceOrderId || 0, + solveRate: data.solveRateId || 0, + timelyRate: data.timelyRateId || 0 } return params }, @@ -428,7 +428,7 @@ } else if (value === "contact") { this.contactId = item.id } else if (value === "customService") { - this.serviceId = item.id + this.serviceOrderId = item.id } }, selClientClick(value) { @@ -452,7 +452,7 @@ this.clientId = row.id } else if (value === "customService") { this.editConfig.infomation.service_number = row.serviceNumber - this.serviceId = row.id + this.serviceOrderId = row.id } }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 @@ -465,7 +465,7 @@ this.contactId = 0 } else if (value === "customService") { this.editConfig.infomation.service_number = "" - this.serviceId = 0 + this.serviceOrderId = 0 } }, // 娣诲姞闄勪欢 diff --git a/src/views/service/serviceFollowup/index.vue b/src/views/service/serviceFollowup/index.vue index 5fb5107..04ab17e 100644 --- a/src/views/service/serviceFollowup/index.vue +++ b/src/views/service/serviceFollowup/index.vue @@ -62,6 +62,12 @@ isDetail: { type: Boolean, default: false + }, + addConfig: { + type: Object, + default: () => { + return {} + } } }, mixins: [pageMixin], @@ -117,11 +123,18 @@ value: "number", label: "鍥炶鍗曠紪鍙�" }, - selValueList: [] + selValueList: [], + keyword: "", + keywordType: "" } }, created() { this.setTable() + if (this.isDetail) { + console.log(this.addConfig) + this.keyword = this.addConfig.keyword + this.keywordType = this.addConfig.keywordType + } this.getData() }, methods: { @@ -146,11 +159,11 @@ } }, // 璇锋眰鏁版嵁 - async getData(keyword, keywordType) { + async getData() { this.loading = true await getServiceFollowupList({ - keyword: keyword, - keywordType: keywordType, + keyword: this.keyword, + keywordType: this.keywordType, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -187,7 +200,9 @@ // 鎼滅储 searchClick(val, content) { console.log(val, content) - this.getData(content, val.label) + this.keyword = content + this.keywordType = val.label + this.getData() }, resetClick() { this.search_map = {} @@ -197,14 +212,14 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = {} + this.editConfig.infomation = { ...this.addConfig } }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row } + this.editConfig.infomation = { ...row, service_number: row.ServiceOrder.serviceNumber } }, // 鍒犻櫎 delClick() { -- Gitblit v1.8.0