From acdff03246ce648082192dfb069c3a006a7fbee6 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 09 八月 2023 18:46:06 +0800 Subject: [PATCH] 客户管理模块 批量删除、推进、跟进接口联调 --- src/api/client/followupRecords.js | 5 src/views/client/client/index.vue | 135 +++++-- src/views/client/salesLead/AdvanceDialog.vue | 223 ++++++++++++ src/components/makepager/PublicFunctionBtnView.vue | 14 src/api/client/client.js | 5 src/api/client/salesLead.js | 14 src/views/client/client/DetailClientManage.vue | 81 +++- src/components/makepager/SearchCommonView.vue | 29 + src/views/client/salesLead/AddSalesLeadDialog.vue | 29 - src/views/client/client/AddClientManageDialog.vue | 104 +++-- src/views/client/contacts/index.vue | 101 ++++- src/views/client/salesLead/DetailSalesLead.vue | 22 src/views/other/commonDialog/HighViewScopeDialog.vue | 14 src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue | 12 src/views/client/salesLead/index.vue | 136 ++++++- src/api/client/contacts.js | 5 src/views/client/followupRecords/index.vue | 61 ++- src/views/client/contacts/DetailContacts.vue | 34 18 files changed, 761 insertions(+), 263 deletions(-) diff --git a/src/api/client/client.js b/src/api/client/client.js index fdd0751..24473aa 100644 --- a/src/api/client/client.js +++ b/src/api/client/client.js @@ -19,8 +19,9 @@ // 鍒犻櫎瀹㈡埛绠$悊 export function getDeleteClient(data) { return request({ - url: "/api/client/delete/" + data.id, - method: "delete" + url: "/api/client/delete", + method: "delete", + data }) } // 鏇存柊瀹㈡埛绠$悊 diff --git a/src/api/client/contacts.js b/src/api/client/contacts.js index 0aba282..3c4932f 100644 --- a/src/api/client/contacts.js +++ b/src/api/client/contacts.js @@ -19,8 +19,9 @@ // 鍒犻櫎鑱旂郴浜� export function getDeleteContact(data) { return request({ - url: "/api/contact/delete/" + data.id, - method: "delete" + url: "/api/contact/delete", + method: "delete", + data }) } // 鏇存柊鑱旂郴浜� diff --git a/src/api/client/followupRecords.js b/src/api/client/followupRecords.js index 804778a..a2af2ab 100644 --- a/src/api/client/followupRecords.js +++ b/src/api/client/followupRecords.js @@ -19,8 +19,9 @@ // 鍒犻櫎璺熻繘璁板綍 export function getDeleteFollowRecord(data) { return request({ - url: "/api/followRecord/delete/" + data.id, - method: "delete" + url: "/api/followRecord/delete", + method: "delete", + data }) } // 鏇存柊璺熻繘璁板綍 diff --git a/src/api/client/salesLead.js b/src/api/client/salesLead.js index 1926fc9..4e6ee0a 100644 --- a/src/api/client/salesLead.js +++ b/src/api/client/salesLead.js @@ -19,8 +19,9 @@ // 鍒犻櫎閿�鍞嚎绱� export function getDeleteSalesLeads(data) { return request({ - url: "/api/salesLeads/delete/" + data.id, - method: "delete" + url: "/api/salesLeads/delete", + method: "delete", + data }) } // 鏇存柊閿�鍞嚎绱� @@ -32,6 +33,15 @@ }) } +// 鎺ㄨ繘閿�鍞嚎绱� +export function pushSalesSources(data) { + return request({ + url: "/api/salesLeads/push", + method: "post", + data + }) +} + // 鍟嗘満鏉ユ簮鍒楄〃 export function getSalesSourcesList() { return request({ diff --git a/src/components/makepager/PublicFunctionBtnView.vue b/src/components/makepager/PublicFunctionBtnView.vue index e7d3b84..3036c9e 100644 --- a/src/components/makepager/PublicFunctionBtnView.vue +++ b/src/components/makepager/PublicFunctionBtnView.vue @@ -3,12 +3,14 @@ <div class="btn-list"> <el-button size="small" type="text" class="blue" @click="addBtnClick">鏂板缓</el-button> <!-- <el-button v-if="receive" size="small" type="text" class="gray" @click="receiveBtnClick">棰嗗彇</el-button> --> - <el-button v-if="allocation" size="small" type="text" class="gray" @click="allocationBtnClick">鍒嗛厤</el-button> + <el-button v-if="allocation" size="small" type="text" class="gray" @click="allocationBtnClick" disabled + >鍒嗛厤</el-button + > <el-button v-if="deleteButton" size="small" type="text" class="gray" @click="deleteBtnClick">鍒犻櫎</el-button> <!-- <el-button v-if="submitApproval" size="small" type="text" class="gray width64" @click="submitApprovalBtnClick" >鎻愪氦瀹℃壒 </el-button> --> - <el-button v-if="duplicateCheck" size="small" type="text" class="gray" @click="duplicateCheckBtnClick" + <el-button v-if="duplicateCheck" size="small" type="text" class="gray" @click="duplicateCheckBtnClick" disabled >鏌ラ噸</el-button > <!-- <el-button v-if="importButton" size="small" type="text" class="gray" @click="importBtnClick">瀵煎叆</el-button> @@ -153,9 +155,13 @@ // 棰嗗彇 receiveBtnClick() {}, // 鍒嗛厤 - allocationBtnClick() {}, + allocationBtnClick() { + this.$emit("allocationBtnClick") + }, // 鍒犻櫎 - deleteBtnClick() {}, + deleteBtnClick() { + this.$emit("batchDelete") + }, // 鎻愪氦瀹℃壒 submitApprovalBtnClick() {}, // 鏌ラ噸 diff --git a/src/components/makepager/SearchCommonView.vue b/src/components/makepager/SearchCommonView.vue index 3ba9a99..ed2292d 100644 --- a/src/components/makepager/SearchCommonView.vue +++ b/src/components/makepager/SearchCommonView.vue @@ -1,7 +1,7 @@ <template> <div class="search-list"> <div class="search-top"> - <div class="query-class"> + <!-- <div class="query-class"> <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"> @@ -10,15 +10,21 @@ <div class="query-class-btn" @click="queryClassClick"> <i class="el-icon-setting"></i> </div> - </div> + </div> --> <div class="search"> <el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchInput" class="input-with-select" clearable> <el-select v-model="searchSelValue" slot="prepend" placeholder="璇烽�夋嫨" class="search-sel"> <el-option v-for="item in searchOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> - <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> + <!-- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> --> </el-input> + </div> + <div class="btn"> + <el-button type="primary" size="mini" @click="searchClick" icon="el-icon-search" style="margin-right: 5px" + >鎼滅储</el-button + > + <el-button size="mini" icon="el-icon-refresh-left" @click="resetClick">閲嶇疆</el-button> </div> <!-- <div class="other-search"> <div class="other-search-high" @click="highSearchClick"> @@ -35,7 +41,7 @@ </div> </div> --> </div> - <div v-if="isTileSearch" class="search-bottom"> + <!-- <div v-if="isTileSearch" class="search-bottom"> <el-table :data="tileSearchData" style="width: 100%"> <el-table-column prop="selField" label="閫夋嫨瀛楁" width="430"> <template slot-scope="scope"> @@ -82,7 +88,7 @@ <el-button size="small">鍙栨秷</el-button> </div> </div> - </div> + </div> --> <!-- 鏌ヨ鍒嗙被寮圭獥 --> <QueryClassSettingDialog v-if="queryClassSetConfig.visible" :editCommonConfig="queryClassSetConfig" /> </div> @@ -105,7 +111,7 @@ }, searchSel: { type: String, - default: "1" + default: "name" }, searchOptions: { type: Array, @@ -159,7 +165,12 @@ } }, searchClick() { - console.log("sssssssssss") + this.$emit("searchClick", this.searchSelValue, this.searchInput) + }, + resetClick() { + this.searchSelValue = this.searchSel + this.searchInput = "" + this.$emit("resetClick") }, // 楂樼骇鏌ユ壘 highSearchClick() {}, @@ -194,6 +205,7 @@ color: #333; .search-top { display: flex; + align-items: center; .query-class { display: flex; height: 60px; @@ -220,6 +232,9 @@ margin-top: 7px; } } + .btn { + margin-left: 10px; + } .other-search { display: flex; height: 60px; diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue index c262d24..7200b7d 100644 --- a/src/views/client/client/AddClientManageDialog.vue +++ b/src/views/client/client/AddClientManageDialog.vue @@ -5,6 +5,8 @@ :visible.sync="editConfig.visible" :width="dialogWidth" :before-close="handleClose" + append-to-body + custom-class="iframe-dialog" > <el-form ref="form" @@ -475,7 +477,7 @@ <div slot="footer" class="dialog-footer"> <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆苟鎻愪氦瀹℃壒</el-button> --> <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button> - <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button> + <el-button size="small" @click="handleClose">鍙栨秷</el-button> </div> </el-dialog> </div> @@ -492,6 +494,7 @@ return { visible: false, title: "鏂板缓", + isSalesOpportunity: false, infomation: {} } } @@ -546,7 +549,6 @@ getCommonData() { getAllData() .then((res) => { - console.log(res) this.memberOptions = res.data.member this.clientSourceOptions = res.data.client_origin this.clientStatusOptions = res.data.client_status @@ -567,6 +569,9 @@ }, handleClose() { this.editConfig.visible = false + if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) { + this.$parent.handleClose() + } }, // 淇濆瓨 saveClick(formName) { @@ -585,7 +590,13 @@ message: "娣诲姞鎴愬姛", type: "success" }) - this.$parent.getData() + if (this.editConfig.isSalesOpportunity) { + this.$emit("salesOpportunityClick", this.editConfig.infomation) + } else if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) { + this.$parent.handleClose() + } else { + this.$parent.getData() + } } }) .catch((err) => { @@ -657,7 +668,8 @@ registration_time: data.registration_time || "", remark: data.remark || "", representative: data.representative || "", - service_member_id: data.service_member_id || 0 + service_member_id: data.service_member_id || 0, + sales_leads_id: data.sales_leads_id || 0 } return params }, @@ -677,54 +689,56 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> -.add-client-manage { - .basic-info { - .basic-info-title { - background-color: #f4f8fe; - padding-left: 10px; - font-size: 15px; - font-weight: bold; - color: #666; - height: 42px; - line-height: 42px; - } - .basic-info-view { - margin-top: 10px; - padding-right: 40px; - .custom-name, - .common-select { +::v-deep { + .iframe-dialog .el-dialog__body { + .basic-info { + .basic-info-title { + background-color: #f4f8fe; + padding-left: 10px; + font-size: 15px; + font-weight: bold; + color: #666; + height: 42px; + line-height: 42px; + } + .basic-info-view { + margin-top: 10px; + padding-right: 40px; + .custom-name, + .common-select { + display: flex; + .common-select-btn { + margin-left: 5px; + font-size: 18px; + cursor: pointer; + } + } + .common-select { + .common-select-sel { + width: 270px; + } + } + } + .annex-view { display: flex; - .common-select-btn { - margin-left: 5px; - font-size: 18px; - cursor: pointer; - } - } - .common-select { - .common-select-sel { - width: 270px; + color: #6166d3; + .setFormat { + margin-left: 10px; } } } - .annex-view { + .unflod-collapse { display: flex; + height: 30px; + justify-content: center; + align-items: center; color: #6166d3; - .setFormat { - margin-left: 10px; - } } - } - .unflod-collapse { - display: flex; - height: 30px; - justify-content: center; - align-items: center; - color: #6166d3; - } - .dialog-footer { - background-color: #f5f5f5; - height: 55px; - line-height: 55px; + .dialog-footer { + background-color: #f5f5f5; + height: 55px; + line-height: 55px; + } } } </style> diff --git a/src/views/client/client/DetailClientManage.vue b/src/views/client/client/DetailClientManage.vue index 388075c..428d650 100644 --- a/src/views/client/client/DetailClientManage.vue +++ b/src/views/client/client/DetailClientManage.vue @@ -154,7 +154,7 @@ <li> <div class="left remark"> <div class="content-title">{{ "澶囨敞锛�" }}</div> - <div class="content-data">{{ "澶囨敞鍐呭" }}</div> + <div class="content-data">{{ detailConfig.infomation.remark }}</div> </div> </li> </ul> @@ -247,35 +247,35 @@ } }, created() { - this.setData() + this.setData(this.detailConfig.infomation) }, mounted() {}, methods: { - setData() { + setData(item) { this.basicInfoList = [ { leftStr: "瀹㈡埛鍚嶇О", - leftValue: this.detailConfig.infomation.client_name, + leftValue: item.client_name, rightStr: "瀹㈡埛缂栧彿", - rightValue: this.detailConfig.infomation.number + rightValue: item.number }, { leftStr: "瀹㈡埛鐘舵��", - leftValue: this.detailConfig.infomation.contact_name, + leftValue: item.client_status, rightStr: "閿�鍞礋璐d汉", - rightValue: this.detailConfig.infomation.contact_position + rightValue: item.member_id }, { leftStr: "瀹㈡埛绫诲瀷", - leftValue: this.detailConfig.infomation.contact_phone, + leftValue: item.client_type.name, rightStr: "瀹㈡埛鏉ユ簮", - rightValue: "鏂板缓" + rightValue: item.client_origin.name }, { leftStr: "閲嶈绾у埆", - leftValue: this.detailConfig.infomation.sales_sources_id, + leftValue: item.client_level, rightStr: "鍏捣鐘舵��", - rightValue: this.detailConfig.infomation.member_id + rightValue: "" }, { leftStr: "鎵�灞炲叕娴�", @@ -287,13 +287,13 @@ leftStr: "绛惧埌", leftValue: "", rightStr: "涓嬫鍥炶鏃ユ湡", - rightValue: "" + rightValue: this.processTime(item.next_visit_time) }, { leftStr: "鍒涘缓鏃堕棿", leftValue: "", rightStr: "鏈�鏅氭湇鍔″埌鏈熸棩", - rightValue: "" + rightValue: this.processTime(item.latest_service_time) }, { leftStr: "鍒涘缓浜�", @@ -305,9 +305,9 @@ this.contactList = [ { leftStr: "鑱旂郴浜哄鍚�", - leftValue: "", + leftValue: item.contact_name, rightStr: "鑱旂郴浜烘墜鏈�", - rightValue: "" + rightValue: item.contact_phone }, { leftStr: "鑱旂郴浜鸿亴鍔�", @@ -339,25 +339,25 @@ this.businessInfoList = [ { leftStr: "鎵�灞炶涓�", - leftValue: "", + leftValue: item.Industry.name, rightStr: "娉曞畾浠h〃浜�", - rightValue: "" + rightValue: item.representative }, { leftStr: "娉ㄥ唽鏃堕棿", - leftValue: "", + leftValue: this.processTime(item.registration_time), rightStr: "娉ㄥ唽璧勯噾", - rightValue: "" + rightValue: item.RegisteredCapital.name }, { leftStr: "鍏徃鎬ц川", - leftValue: "", + leftValue: item.EnterpriseNature.name, rightStr: "瀹㈡埛瑙勬ā", - rightValue: "" + rightValue: item.EnterpriseScale.name }, { leftStr: "缁忚惀鑼冨洿", - leftValue: "", + leftValue: item.business_scope, rightStr: "", rightValue: "" } @@ -365,19 +365,19 @@ this.addressInfoList = [ { leftStr: "鍥藉", - leftValue: "", + leftValue: item.Country.name, rightStr: "鐪佷唤", - rightValue: "" + rightValue: item.Province.name }, { leftStr: "鍩庡競", - leftValue: "", + leftValue: item.City.name, rightStr: "鍖哄煙", - rightValue: "" + rightValue: item.Region.name }, { leftStr: "璇︾粏鍦板潃", - leftValue: "", + leftValue: item.detail_address, rightStr: "", rightValue: "" } @@ -408,6 +408,33 @@ } else if (value === "annex") { this.isAnnexExpand = !this.isAnnexExpand } + }, + // 澶勭悊鏃堕棿 + processTime(dateTime) { + return this.dateFormat("YYYY-mm-dd HH:MM:SS", dateTime) === "1900-01-01 08:00:00" + ? "--" + : this.dateFormat("YYYY-mm-dd HH:MM:SS", dateTime) + }, + // 鏃堕棿鏄剧ず + dateFormat(fmt, date) { + let ret = "" + date = new Date(date) + const opt = { + "Y+": date.getFullYear().toString(), // 骞� + "m+": (date.getMonth() + 1).toString(), // 鏈� + "d+": date.getDate().toString(), // 鏃� + "H+": date.getHours().toString(), // 鏃� + "M+": date.getMinutes().toString(), // 鍒� + "S+": date.getSeconds().toString() // 绉� + // 鏈夊叾浠栨牸寮忓寲瀛楃闇�姹傚彲浠ョ户缁坊鍔狅紝蹇呴』杞寲鎴愬瓧绗︿覆 + } + for (let k in opt) { + ret = new RegExp("(" + k + ")").exec(fmt) + if (ret) { + fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")) + } + } + return fmt } } } diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue index c6688f2..63111a9 100644 --- a/src/views/client/client/index.vue +++ b/src/views/client/client/index.vue @@ -2,14 +2,14 @@ <div class="custom-manage"> <div class="tab-view"> <el-tabs v-model="activeName" @tab-click="tabsClick"> - <el-tab-pane label="鍏ㄩ儴(鍚墍鏈夊叕娴�)" name="first"></el-tab-pane> - <el-tab-pane label="鍏ㄩ儴(鍚叕娴�)" name="second"></el-tab-pane> - <el-tab-pane label="鍏ㄩ儴(涓嶅惈鍏捣)" name="third"></el-tab-pane> - <el-tab-pane label="鍏捣宸插垎閰�" name="fourth"></el-tab-pane> - <el-tab-pane label="鍏湭鍒嗛厤" name="aaa"></el-tab-pane> + <el-tab-pane label="鍏ㄩ儴(鍚墍鏈夊叕娴�)" name="first" disabled></el-tab-pane> + <el-tab-pane label="鍏ㄩ儴(鍚叕娴�)" name="second" disabled></el-tab-pane> + <el-tab-pane label="鍏ㄩ儴(涓嶅惈鍏捣)" name="third" disabled></el-tab-pane> + <el-tab-pane label="鍏捣宸插垎閰�" name="fourth" disabled></el-tab-pane> + <el-tab-pane label="鍏湭鍒嗛厤" name="aaa" disabled></el-tab-pane> </el-tabs> <div class="sel-gonghai"> - <el-select v-model="gonghaiValue" placeholder="璇烽�夋嫨" class="query-class-sel" size="mini"> + <el-select v-model="gonghaiValue" placeholder="璇烽�夋嫨" class="query-class-sel" size="mini" disabled> <el-option v-for="item in gonghaiOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -23,6 +23,8 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> <PublicFunctionBtnView @@ -31,6 +33,7 @@ :map-button="true" :statistics="true" :operates-list="operatesList" + @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> @@ -41,14 +44,15 @@ :table-list="tableList" @selClientClick="selClientClick" @selContactsClick="selContactsClick" + @getSelectArray="getSelectArray" > <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="180"> + <el-table-column label="鎿嶄綔" width="150"> <template slot-scope="scope"> - <el-button type="text" size="small">鍙樻洿鍏捣</el-button> + <el-button type="text" size="small" disabled>鍙樻洿鍏捣</el-button> <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="followupClick(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> @@ -59,6 +63,8 @@ <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" /> <!-- 鑱旂郴浜鸿鎯� --> <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" /> + <!-- 鏂板缓/缂栬緫璺熻繘璁板綍 --> + <AddFollowupRecordsDialog v-if="editFollowupConfig.visible" :edit-contacts-config="editFollowupConfig" /> </div> </template> @@ -66,6 +72,7 @@ import AddClientManageDialog from "@/views/client/client/AddClientManageDialog" import { getClientList, getDeleteClient } from "@/api/client/client" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog" export default { name: "CustomManage", @@ -74,13 +81,10 @@ components: { AddClientManageDialog, DetailContacts: () => import("@/views/client/contacts/DetailContacts"), - DetailClientManage: () => import("@/views/client/client/DetailClientManage") + DetailClientManage: () => import("@/views/client/client/DetailClientManage"), + AddFollowupRecordsDialog }, - computed: { - searchCommonHeight() { - return this.$refs.searchCommonView.offsetHeight - } - }, + computed: {}, data() { return { tableList: {}, @@ -119,6 +123,13 @@ clientDeail: { visible: false, infomation: {} + }, + search_map: {}, + selValueList: [], + editFollowupConfig: { + visible: false, + title: "鏂板缓", + infomation: {} } } }, @@ -132,11 +143,11 @@ tableInfomation: [], tableColumn: [ { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100, isClientClick: true }, // 瀹㈡埛鍚嶇О - { label: "閿�鍞礋璐d汉", prop: "member_id" }, // 閿�鍞礋璐d汉 - { label: "閲嶈绾у埆", prop: "client_level_id" }, // 閲嶈绾у埆 + { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉 + { label: "閲嶈绾у埆", prop: "client_level" }, // 閲嶈绾у埆 { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", isTime: true, min: 90 }, // 涓嬫鍥炶鏃ユ湡 { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃 - { label: "瀹㈡埛鐘舵��", prop: "client_status_id" }, // 瀹㈡埛鐘舵�� + { label: "瀹㈡埛鐘舵��", prop: "client_status" }, // 瀹㈡埛鐘舵�� { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚� { label: "鎵嬫満鍙风爜", prop: "contact_phone" } // 鎵嬫満鍙风爜 ] @@ -144,14 +155,15 @@ 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 getClientList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -173,7 +185,9 @@ return { ...item, contact_name: contact_name, - contact_phone: contact_phone + contact_phone: contact_phone, + client_level: item.client_level.name, + client_status: item.client_status.name } }) this.tableList.tableInfomation = list || [] @@ -195,6 +209,18 @@ tabsClick(tab, event) { console.log(tab, event) }, + // 鎼滅储 + searchClick(val, content) { + console.log(val, content) + this.search_map = { + [val]: content + } + this.getData() + }, + resetClick() { + this.search_map = {} + this.getData() + }, // 鏂板缓 addBtnClick() { this.editConfig.visible = true @@ -214,7 +240,6 @@ } }) } - console.log(contactObj) this.editConfig.infomation = { ...row, contact_wechat: contactObj.length > 0 ? contactObj.wechat : "", @@ -222,27 +247,35 @@ } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDeleteClient({ 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(() => { + getDeleteClient({ 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) { @@ -254,7 +287,27 @@ selContactsClick(row) { console.log(row) this.contactsDeail.visible = true - this.contactsDeail.infomation = { ...row } + let contact = {} + if (row.contacts.length !== 0) { + for (let i = 0; i < row.contacts.length; i++) { + if (row.contacts[i].is_first) { + contact = row.contacts[i] + } + } + } + this.contactsDeail.infomation = { ...contact, Client: { name: row.name } } + }, + // 璺熻繘 + followupClick(row) { + console.log(row) + this.editFollowupConfig.visible = true + this.editFollowupConfig.title = "鏂板缓" + this.editFollowupConfig.infomation = { + ...row, + client_name: row.name, + number: "", + next_follow_time: row.next_visit_time + } } } } diff --git a/src/views/client/contacts/DetailContacts.vue b/src/views/client/contacts/DetailContacts.vue index 18907ff..38a94bb 100644 --- a/src/views/client/contacts/DetailContacts.vue +++ b/src/views/client/contacts/DetailContacts.vue @@ -83,7 +83,7 @@ <li> <div class="left remark"> <div class="content-title">{{ "澶囨敞锛�" }}</div> - <div class="content-data">{{ "澶囨敞鍐呭" }}</div> + <div class="content-data">{{ detailConfig.infomation.desc }}</div> </div> </li> </ul> @@ -154,41 +154,41 @@ } }, created() { - this.setData() + this.setData(this.detailConfig.infomation) }, mounted() {}, methods: { - setData() { + setData(item) { this.basicInfoList = [ { leftStr: "鑱旂郴浜哄鍚�", - leftValue: "", + leftValue: item.name, rightStr: "鑱旂郴浜虹紪鍙�", - rightValue: "" + rightValue: item.number }, { leftStr: "瀹㈡埛鍚嶇О", - leftValue: "", + leftValue: item.Client.name, rightStr: "鎵嬫満", - rightValue: "" + rightValue: item.phone }, { leftStr: "鑱屽姟", - leftValue: "", + leftValue: item.position, rightStr: "閿�鍞礋璐d汉", - rightValue: "" + rightValue: item.member_id }, { leftStr: "棣栬鑱旂郴浜�", - leftValue: "", + leftValue: item.is_first, rightStr: "寰俊鍙�", - rightValue: "" + rightValue: item.wechat }, { leftStr: "鐢熸棩", - leftValue: "", + leftValue: item.birthday, rightStr: "鑱旂郴浜篍mail", - rightValue: "" + rightValue: item.email }, { leftStr: "绛惧埌", @@ -206,15 +206,15 @@ this.addressInfoList = [ { leftStr: "鍥藉", - leftValue: "", + leftValue: item.Country.name, rightStr: "鐪佷唤", - rightValue: "" + rightValue: item.Province.name }, { leftStr: "鍩庡競", - leftValue: "", + leftValue: item.City.name, rightStr: "鍖哄煙", - rightValue: "" + rightValue: item.Region.name }, { leftStr: "閭紪", diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue index ec669d5..014eb51 100644 --- a/src/views/client/contacts/index.vue +++ b/src/views/client/contacts/index.vue @@ -11,7 +11,7 @@ :search-options="searchOptions" /> <div class="btn-pager"> - <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" /> + <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -21,13 +21,14 @@ :table-list="tableList" @selContactsClick="selContactsClick" @selClientClick="selClientClick" + @getSelectArray="getSelectArray" > <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="120" fixed="right"> + <el-table-column label="鎿嶄綔" width="90" fixed="right"> <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="followupClick(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> @@ -38,6 +39,8 @@ <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" /> <!-- 瀹㈡埛璇︽儏 --> <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" /> + <!-- 鏂板缓/缂栬緫璺熻繘璁板綍 --> + <AddFollowupRecordsDialog v-if="editFollowupConfig.visible" :edit-contacts-config="editFollowupConfig" /> </div> </template> @@ -45,6 +48,7 @@ import AddContactsDialog from "@/views/client/contacts/AddContactsDialog" import { getContactList, getDeleteContact } from "@/api/client/contacts" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog" export default { name: "ContactsView", props: { @@ -57,7 +61,8 @@ components: { AddContactsDialog, DetailContacts: () => import("@/views/client/contacts/DetailContacts"), - DetailClientManage: () => import("@/views/client/client/DetailClientManage") + DetailClientManage: () => import("@/views/client/client/DetailClientManage"), + AddFollowupRecordsDialog }, computed: {}, data() { @@ -94,6 +99,12 @@ clientDeail: { visible: false, infomation: {} + }, + selValueList: [], + editFollowupConfig: { + visible: false, + title: "鏂板缓", + infomation: {} } } }, @@ -118,7 +129,8 @@ 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 }) } }, // 璇锋眰鏁版嵁 @@ -170,27 +182,52 @@ this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDeleteContact({ id: id }) + 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: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" }) - .then((response) => { - if (response.code === 200) { - this.$message.success("鍒犻櫎鎴愬姛") - this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") - } - }) - .catch(function () {}) + .then(() => { + getDeleteContact({ 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 }, // 鑱旂郴浜鸿鎯� selContactsClick(row) { @@ -202,7 +239,23 @@ selClientClick(row) { console.log(row) this.clientDeail.visible = true - this.clientDeail.infomation = { ...row, client_name: row.Client.name } + this.clientDeail.infomation = { + ...row.Client, + client_name: row.Client.name, + client_level: row.Client.client_level.name, + client_status: row.Client.client_status.name + } + }, + // 璺熻繘 + followupClick(row) { + console.log(row) + this.editFollowupConfig.visible = true + this.editFollowupConfig.title = "鏂板缓" + this.editFollowupConfig.infomation = { + ...row, + client_name: row.Client.name, + number: "" + } } } } diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue index 24a3a97..a9486b0 100644 --- a/src/views/client/followupRecords/index.vue +++ b/src/views/client/followupRecords/index.vue @@ -11,7 +11,7 @@ :search-options="searchOptions" /> <div class="btn-pager"> - <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" /> + <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -22,12 +22,13 @@ :select-box="!isDetail" @selContactsClick="selContactsClick" @selClientClick="selClientClick" + @getSelectArray="getSelectArray" > <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="120" fixed="right"> + <el-table-column label="鎿嶄綔" width="60" fixed="right"> <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 +102,8 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [] } }, created() { @@ -181,39 +183,52 @@ this.editConfig.infomation = { ...row, sale_chance_name: "", sales_leads_name: "" } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDeleteFollowRecord({ 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(() => { + getDeleteFollowRecord({ 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 }, // 鑱旂郴浜鸿鎯� selContactsClick(row) { console.log(row) this.contactsDeail.visible = true - this.contactsDeail.infomation = { ...row } + this.contactsDeail.infomation = { ...row.contact, Client: { name: row.client_name } } }, // 瀹㈡埛鍚嶇О璇︽儏 selClientClick(row) { console.log(row) this.clientDeail.visible = true - this.clientDeail.infomation = { ...row } + this.clientDeail.infomation = { + ...row.client, + client_name: row.client.name, + client_level: row.client.client_level.name, + client_status: row.client.client_status.name + } } } } diff --git a/src/views/client/salesLead/AddSalesLeadDialog.vue b/src/views/client/salesLead/AddSalesLeadDialog.vue index 69e2c71..4c9ec58 100644 --- a/src/views/client/salesLead/AddSalesLeadDialog.vue +++ b/src/views/client/salesLead/AddSalesLeadDialog.vue @@ -87,7 +87,7 @@ <el-col :span="12"> <el-form-item label="璐熻矗浜�" prop="member_id"> <el-select v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini"> - <el-option v-for="item in ownerOptions" :key="item.id" :label="item.username" :value="item.id"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -244,11 +244,7 @@ } }, components: { EditDropdownDialog }, - computed: { - searchCommonHeight() { - return this.$refs.searchCommonView.offsetHeight - } - }, + computed: {}, data() { return { dialogWidth: "80%", @@ -269,7 +265,7 @@ ] }, businessSourceOptions: [], - ownerOptions: [], + memberOptions: [], countryOptions: [], // 鍥藉 provinceOptions: [], // 鐪佷唤 cityOptions: [], // 鍩庡競 @@ -286,9 +282,7 @@ created() { this.getCommonData() }, - mounted() { - this.setData() - }, + mounted() {}, methods: { getCommonData() { getAllData() @@ -299,7 +293,7 @@ this.provinceOptions = res.data.province this.cityOptions = res.data.city this.regionOptions = res.data.region - this.ownerOptions = res.data.member + this.memberOptions = res.data.member }) .catch((err) => { console.log(err) @@ -382,19 +376,6 @@ editDropdownBox() { this.editDropdownConfig.editVisible = true this.editDropdownConfig.title = "鍟嗘満鏉ユ簮" - }, - // 鏁版嵁澶勭悊 - setData() { - this.editConfig.infomation.city_id = - this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id - this.editConfig.infomation.member_id = - this.editConfig.infomation.member_id === 0 ? "" : this.editConfig.infomation.member_id - this.editConfig.infomation.province_id = - this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id - this.editConfig.infomation.region_id = - this.editConfig.infomation.region_id === 0 ? "" : this.editConfig.infomation.region_id - this.editConfig.infomation.country_id = - this.editConfig.infomation.country_id === 0 ? "" : this.editConfig.infomation.country_id }, // 鎵嬫満鍙疯緭鍏� confirmPhone(value) { diff --git a/src/views/client/salesLead/AdvanceDialog.vue b/src/views/client/salesLead/AdvanceDialog.vue new file mode 100644 index 0000000..849f044 --- /dev/null +++ b/src/views/client/salesLead/AdvanceDialog.vue @@ -0,0 +1,223 @@ +<template> + <div class="advance"> + <el-dialog + :title="'鎺ㄨ繘'" + append-to-body + :visible.sync="commonConfig.visible" + :width="dialogWidth" + :before-close="handleClose" + custom-class="advance-dialog" + > + <div class="content"> + <el-radio-group v-model="radio"> + <div class="one"> + <el-radio :label="1"> + <span>鎺ㄨ繘鍒颁笅涓�闃舵</span> + <el-select v-model="value1" size="mini" disabled> + <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option> + </el-select> + </el-radio> + </div> + <div class="two"> + <el-radio :label="2"> + <span>鎺ㄨ繘鍒版寚瀹氶樁娈�</span> + <el-select v-model="value" size="mini" @change="designatedStageClick"> + <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option> + </el-select> + <div v-if="value === '澶辫触鍏抽棴'" class="reason"> + <div class="label"><span style="color: red">*</span>鍘熷洜</div> + <el-input class="input" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" v-model="reason"></el-input> + </div> + </el-radio> + </div> + </el-radio-group> + </div> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" size="small" @click="saveClick()">鎺ㄨ繘</el-button> + <el-button size="small" @click="commonConfig.visible = false">鍙栨秷</el-button> + </div> + <!-- 鏂板缓/缂栬緫瀹㈡埛绠$悊 --> + <AddClientManageDialog + v-if="editConfig.visible" + :edit-client-manage-config="editConfig" + @salesOpportunityClick="salesOpportunityClick" + /> + <!-- 鏂板缓/缂栬緫閿�鍞満浼� --> + <AddSalesOpportunityDialog v-if="editOpportunityConfig.visible" :edit-common-config="editOpportunityConfig" /> + </el-dialog> + </div> +</template> + +<script> +import { pushSalesSources } from "@/api/client/salesLead" +import AddClientManageDialog from "@/views/client/client/AddClientManageDialog" +import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog" +export default { + name: "AdvanceDialog", + props: { + advanceConfig: { + type: Object, + default: () => { + return { + visible: false, + infomation: {} + } + } + } + }, + components: { AddClientManageDialog, AddSalesOpportunityDialog }, + computed: {}, + data() { + return { + dialogWidth: "25%", + radio: 1, + commonConfig: this.advanceConfig, + value1: "", + value: "", + options: [], + reason: "", + editConfig: { + visible: false, + title: "鏂板缓", + isSalesOpportunity: false, + infomation: {} + }, + editOpportunityConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + } + } + }, + watch: {}, + created() { + this.setData(this.advanceConfig.infomation.sales_status) + }, + methods: { + setData(status) { + if (status === 1) { + this.options = ["鏂板缓", "澶辫触鍏抽棴", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�"] + this.value = "澶辫触鍏抽棴" + this.value1 = "澶辫触鍏抽棴" + } else if (status === -1) { + this.options = ["鏂板缓", "璺熻繘涓�", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�"] + this.value = "鍗囩骇鍒板鎴�" + this.value1 = "鍗囩骇鍒板鎴�" + } else { + this.options = ["璺熻繘涓�", "澶辫触鍏抽棴", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�"] + this.value = "璺熻繘涓�" + this.value1 = "璺熻繘涓�" + } + }, + handleClose() { + this.commonConfig.visible = false + if (this.value === "鍗囩骇鍒板鎴峰拰閿�鍞満浼�") { + this.$parent.getData() + } + }, + designatedStageClick(val) { + console.log(val) + this.radio = 2 + }, + saveClick() { + console.log(this.value) + if (this.value === "璺熻繘涓�") { + // val === '鏂板缓' || + this.pushSalesSources(1) + } else if (this.value === "澶辫触鍏抽棴") { + if (this.reason.length > 0) { + this.pushSalesSources(-1) + } else { + this.$message.warning("鍘熷洜涓嶈兘涓虹┖") + } + } else if (this.value === "鍗囩骇鍒板鎴�") { + this.$confirm('鍗囩骇鍚庡皢杞叆"瀹㈡埛绠$悊"妯″潡, 鏄惁缁х画?', "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + this.editConfig.visible = true + this.editConfig.title = "鏂板缓" + this.editConfig.infomation = { + ...this.commonConfig.infomation, + sales_leads_id: this.commonConfig.infomation.id + } + }) + .catch(() => {}) + } else if (this.value === "鍗囩骇鍒板鎴峰拰閿�鍞満浼�") { + this.$confirm('鍗囩骇鍚庡皢杞叆"瀹㈡埛绠$悊"鍜�"閿�鍞満浼�"妯″潡, 鏄惁缁х画?', "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + this.editConfig.visible = true + this.editConfig.title = "鏂板缓" + this.editConfig.isSalesOpportunity = true + this.editConfig.infomation = { + ...this.commonConfig.infomation, + sales_leads_id: this.commonConfig.infomation.id + } + }) + .catch(() => {}) + } + }, + // 鎺ㄨ繘鎺ュ彛 + async pushSalesSources(step) { + await pushSalesSources({ + id: this.commonConfig.infomation.id, + reason: this.reason, + step: step + }).then((res) => { + console.log(res) + this.$message.success("鎺ㄨ繘鎴愬姛") + this.handleClose() + this.$parent.getData() + }) + }, + // 閿�鍞満浼� + salesOpportunityClick(item) { + console.log(item) + this.editOpportunityConfig.visible = true + this.editOpportunityConfig.title = "鏂板缓" + this.editOpportunityConfig.infomation = { client_name: item.name } + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped> +::v-deep { + .advance-dialog .el-dialog__body { + padding: 10px 20px; + .content { + .el-select { + margin-left: 10px; + } + .two { + margin-top: 15px; + .reason { + display: flex; + margin-top: 10px; + align-items: center; + .label { + width: 122px; + text-align: right; + } + .input { + margin-left: 10px; + width: 195px; + } + } + } + } + .dialog-footer { + background-color: #f5f5f5; + height: 55px; + line-height: 55px; + } + } +} +</style> diff --git a/src/views/client/salesLead/DetailSalesLead.vue b/src/views/client/salesLead/DetailSalesLead.vue index b5b4d88..f10ef5c 100644 --- a/src/views/client/salesLead/DetailSalesLead.vue +++ b/src/views/client/salesLead/DetailSalesLead.vue @@ -31,11 +31,11 @@ <li v-for="(item, i) in basicInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> @@ -53,11 +53,11 @@ <li v-for="(item, i) in dynamicInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> @@ -75,11 +75,11 @@ <li v-for="(item, i) in addressInfoList" :key="i"> <div class="left"> <div class="content-title">{{ item.leftStr + "锛�" }}</div> - <div class="content-data">{{ item.leftValue }}</div> + <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div> </div> - <div class="right"> - <div class="content-title">{{ item.rightStr }}</div> - <div class="content-data">{{ item.rightValue }}</div> + <div v-if="item.rightStr && item.rightStr.length > 0" class="right"> + <div class="content-title">{{ item.rightStr + "锛�" }}</div> + <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div> </div> </li> </ul> @@ -97,7 +97,7 @@ <li> <div class="left remark"> <div class="content-title">{{ "澶囨敞锛�" }}</div> - <div class="content-data">{{ "澶囨敞鍐呭" }}</div> + <div class="content-data">{{ detailConfig.desc }}</div> </div> </li> </ul> diff --git a/src/views/client/salesLead/index.vue b/src/views/client/salesLead/index.vue index 565eae5..ad1e2e0 100644 --- a/src/views/client/salesLead/index.vue +++ b/src/views/client/salesLead/index.vue @@ -3,22 +3,32 @@ <div class="top"> <SearchCommonView 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" + @allocationBtnClick="allocationBtnClick" + /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> - <TableCommonView ref="tableListRef" :table-list="tableList" @selSalesLeadClick="selSalesLeadClick"> + <TableCommonView + ref="tableListRef" + :table-list="tableList" + @selSalesLeadClick="selSalesLeadClick" + @getSelectArray="getSelectArray" + > <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="160"> + <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 type="text" size="small">鎺ㄨ繘</el-button> - <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> + <el-button @click="followupClick(scope.row)" type="text" size="small">璺熻繘</el-button> + <el-button @click="advanceClick(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> @@ -29,6 +39,12 @@ <ImportFileDialog v-if="importConfig.visible" :import-file-config="importConfig" /> <!-- 璇︽儏 --> <DetailSalesLead v-if="salesLeadDeail.visible" :sales-lead-detail="salesLeadDeail" /> + <!-- 鏂板缓/缂栬緫璺熻繘璁板綍 --> + <AddFollowupRecordsDialog v-if="editConfig.visible" :edit-contacts-config="editConfig" /> + <!-- 鎺ㄨ繘 --> + <AdvanceDialog v-if="advanceConfig.visible" :advance-config="advanceConfig" /> + <!-- 鍒嗛厤 --> + <HighViewScopeDialog v-if="highViewScopeConfig.visible" :editCommonConfig="highViewScopeConfig" /> </div> </template> @@ -38,6 +54,9 @@ import ImportFileDialog from "@/views/other/commonDialog/ImportFileDialog" import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" import DetailSalesLead from "@/views/client/salesLead/DetailSalesLead" +import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog" +import AdvanceDialog from "@/views/client/salesLead/AdvanceDialog" +import HighViewScopeDialog from "@/views/other/commonDialog/HighViewScopeDialog" export default { name: "SalesLead", @@ -45,13 +64,17 @@ components: { AddSalesLeadDialog, ImportFileDialog, - DetailSalesLead + DetailSalesLead, + AddFollowupRecordsDialog, + AdvanceDialog, + HighViewScopeDialog }, mixins: [pageMixin], computed: {}, data() { return { tableList: {}, + selValueList: [], queryClassOptions: [ { value: "1", label: "鍏ㄩ儴" }, { value: "2", label: "骞垮憡瀹d紶" }, @@ -82,6 +105,21 @@ salesLeadDeail: { visible: false, infomation: {} + }, + editConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + }, + advanceConfig: { + visible: false, + sales_status: 1 + }, + search_map: {}, + highViewScopeConfig: { + // 鍒嗛厤 + visible: false, + infomation: {} } } }, @@ -107,13 +145,14 @@ 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() { await getSalesLeadsList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -132,6 +171,18 @@ console.log(err) }) }, + // 鎼滅储 + searchClick(val, content) { + console.log(val, content) + this.search_map = { + [val]: content + } + this.getData() + }, + resetClick() { + this.search_map = {} + this.getData() + }, // 鏂板缓 addBtnClick() { this.editSalesLeadConfig.visible = true @@ -145,39 +196,68 @@ this.editSalesLeadConfig.title = "缂栬緫" this.editSalesLeadConfig.infomation = { ...row, businessStatus: "鏂板缓" } }, + // 璺熻繘 + followupClick(row) { + this.editConfig.visible = true + this.editConfig.title = "鏂板缓" + this.editConfig.infomation = { sales_leads_name: row.name } + }, // 瀵煎叆 importClitk() { this.importConfig.visible = true this.importConfig.title = "閿�鍞嚎绱�" }, + // 鍒嗛厤 + allocationBtnClick() { + if (this.selValueList && this.selValueList.length > 0) { + this.highViewScopeConfig.visible = true + } else { + this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") + } + }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDeleteSalesLeads({ 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(() => { + console.log("dddd") + getDeleteSalesLeads({ 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 }, // 璇︽儏 selSalesLeadClick(row) { console.log(row) this.salesLeadDeail.visible = true this.salesLeadDeail.infomation = { ...row } + }, + // 鎺ㄨ繘 + advanceClick(row) { + console.log(row) + this.advanceConfig.visible = true + this.advanceConfig.sales_status = row.sales_status + this.advanceConfig.infomation = { ...row } } } } diff --git a/src/views/other/commonDialog/HighViewScopeDialog.vue b/src/views/other/commonDialog/HighViewScopeDialog.vue index ad23916..8a88786 100644 --- a/src/views/other/commonDialog/HighViewScopeDialog.vue +++ b/src/views/other/commonDialog/HighViewScopeDialog.vue @@ -6,12 +6,12 @@ :width="dialogWidth" :before-close="handleClose" > - <div class="view-sel-bg"> + <!-- <div class="view-sel-bg"> <div class="title">鏌ヨ閫夋嫨</div> <el-input v-model="searchInput" size="mini" placeholder="璇疯緭鍏ヨ鏌ユ壘鐨勬垚鍛�"></el-input> <el-checkbox v-model="resignMember">鏄剧ず绂昏亴鎴愬憳</el-checkbox> <el-checkbox v-model="defaultCollapse">瀛愰儴闂ㄩ粯璁ゆ敹璧�</el-checkbox> - </div> + </div> --> <div class="view-tree"> <el-tree :data="data" @@ -22,6 +22,10 @@ highlight-current :props="defaultProps" :filter-node-method="filterNode" + @check="handleCheckChange" + :default-checked-keys="[id]" + :check-strictly="true" + :check-on-click-node="true" > </el-tree> </div> @@ -139,6 +143,12 @@ filterNode(value, data) { if (!value) return true return data.label.indexOf(value) !== -1 + }, + handleCheckChange(node, list) { + this.id = node.id + if (list.checkedKeys.length === 2) { + this.$refs.tree.setCheckedKeys([node.id]) + } } } } diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue index e86938c..61fd54a 100644 --- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue +++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue @@ -497,7 +497,7 @@ <div slot="footer" class="dialog-footer"> <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button> - <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button> + <el-button size="small" @click="handleClose">鍙栨秷</el-button> </div> <!-- 閫夋嫨瀹㈡埛 --> <SelectClientDialog @@ -615,6 +615,10 @@ }, handleClose() { this.editConfig.visible = false + console.log(this.editConfig.infomation.client_name) + if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name) { + this.$parent.handleClose() + } }, // 淇濆瓨 saveClick(formName) { @@ -633,7 +637,11 @@ message: "娣诲姞鎴愬姛", type: "success" }) - this.$parent.getData() + if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name) { + this.$parent.handleClose() + } else { + this.$parent.getData() + } } }) .catch((err) => { -- Gitblit v1.8.0