From 02a1ab651bb79684cf0656bd6fad0611fe568b2b Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期四, 20 七月 2023 18:28:17 +0800 Subject: [PATCH] 服务模块相关接口联调 --- src/api/serviceManage/serviceFollowup.js | 0 src/views/sales/generatePlan/AddGeneratePlanDialog.vue | 6 src/views/service/serviceFollowup/AddServiceFollowupDialog.vue | 177 +++-- src/views/service/serviceFeeManage/index.vue | 111 +-- src/views/sales/masterOrder/index.vue | 32 src/components/makepager/TableCommonView.vue | 6 src/views/service/orderManage/AddOrderManageDialog.vue | 126 ++- src/views/client/salesLead/index.vue | 87 +- src/views/sales/salesReturn/index.vue | 34 src/views/client/followupRecords/index.vue | 72 - src/views/service/serviceContract/index.vue | 76 - src/views/service/serviceFollowup/index.vue | 62 src/views/sales/contractManage/index.vue | 50 src/views/service/serviceFeeManage/AddServiceFeeManageDialog.vue | 447 ++++++++---- src/api/serviceManage/serviceContract.js | 0 src/views/sales/salesDetails/index.vue | 32 src/views/service/serviceContract/AddServiceContractDialog.vue | 174 +++-- src/api/serviceManage/orderManage.js | 0 src/views/client/client/index.vue | 87 - src/views/sales/subOrder/index.vue | 48 src/views/sales/masterOrder/AddMasterOrderDialog.vue | 6 src/views/sales/refundForm/index.vue | 28 src/views/client/client/AddClientManageDialog.vue | 2 /dev/null | 33 - src/views/client/contacts/index.vue | 65 - src/views/service/orderManage/index.vue | 57 src/views/sales/quotation/AddQuotationDialog.vue | 2 src/views/sales/salesOpportunity/index.vue | 30 src/views/sales/subOrder/AddSubOrderDialog.vue | 15 src/views/sales/contractManage/AddContractManageDialog.vue | 16 src/views/sales/generatePlan/index.vue | 26 src/views/sales/quotation/index.vue | 30 32 files changed, 1,104 insertions(+), 833 deletions(-) diff --git a/src/api/service/serviceFeeManage.js b/src/api/service/serviceFeeManage.js deleted file mode 100644 index 2d3667f..0000000 --- a/src/api/service/serviceFeeManage.js +++ /dev/null @@ -1,33 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鏈嶅姟鏀惰垂绠$悊鍒楄〃 -export function getServiceFeeManageList() { - return request({ - url: "/api/serviceFeeManage/list", - method: "get" - }) -} -// 娣诲姞鏈嶅姟鏀惰垂绠$悊 -export function getAddServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/add", - method: "post", - data - }) -} -// 鍒犻櫎鏈嶅姟鏀惰垂绠$悊 -export function getDelServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/delete", - method: "delete", - data - }) -} -// 鏇存柊鏈嶅姟鏀惰垂绠$悊 -export function getUpdateServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/update", - method: "put", - data - }) -} diff --git a/src/api/service/orderManage.js b/src/api/serviceManage/orderManage.js similarity index 100% rename from src/api/service/orderManage.js rename to src/api/serviceManage/orderManage.js diff --git a/src/api/service/serviceContract.js b/src/api/serviceManage/serviceContract.js similarity index 100% rename from src/api/service/serviceContract.js rename to src/api/serviceManage/serviceContract.js diff --git a/src/api/service/serviceFollowup.js b/src/api/serviceManage/serviceFollowup.js similarity index 100% rename from src/api/service/serviceFollowup.js rename to src/api/serviceManage/serviceFollowup.js diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index 8946328..fd225af 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -28,7 +28,11 @@ <template slot-scope="scope"> <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]) }}</span> + <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]) + }}</span> <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span> </template> </el-table-column> diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue index fbc806d..d586e99 100644 --- a/src/views/client/client/AddClientManageDialog.vue +++ b/src/views/client/client/AddClientManageDialog.vue @@ -617,7 +617,7 @@ country_id: 0, desc: "", email: data.contact_email || "", - is_first: false, + is_first: true, member_id: 0, name: data.contact_name || "", number: "", diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue index dc643b4..740fded 100644 --- a/src/views/client/client/index.vue +++ b/src/views/client/client/index.vue @@ -36,6 +36,7 @@ <el-button type="text" size="small">鍙樻洿鍏捣</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> </template> </el-table-column> </template> @@ -47,7 +48,7 @@ <script> import AddClientManageDialog from "@/views/client/client/AddClientManageDialog.vue" -import { getClientList } from "@/api/client/client" +import { getClientList, getDeleteClient } from "@/api/client/client" export default { name: "CustomManage", @@ -166,36 +167,7 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - name: "", - number: "", - client_status_id: "", - member_id: "", - client_type_id: "", - clientSource: "", - client_level_id: "", - service_member_id: "", - next_visit_time: "", - latest_service_time: "", - contact_name: "", - contact_phone: "", - contact_duties: "", - contact_wechat: "", - contact_email: "", - industry_id: "", - representative: "", - registration_time: "", - registered_capital_id: "", - enterprise_nature_id: "", - enterprise_scale_id: "", - business_scope: "", - country: "", - province: "", - city: "", - region: "", - detail_address: "", - remark: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { @@ -212,36 +184,33 @@ } console.log(contactObj) this.editConfig.infomation = { - id: row.id, - name: row.name, - number: row.number, - client_status_id: row.client_status_id, - member_id: row.member_id, - client_type_id: row.client_type_id, - clientSource: row.clientSource, - client_level_id: row.client_level_id, - service_member_id: row.service_member_id, - next_visit_time: row.next_visit_time, - latest_service_time: row.latest_service_time, - contact_name: row.contact_name, - contact_phone: row.contact_phone, - contact_duties: "", + ...row, contact_wechat: contactObj.length > 0 ? contactObj.wechat : "", - contact_email: contactObj.length > 0 ? contactObj.email : "", - industry_id: row.industry_id, - representative: row.representative, - registration_time: row.registration_time, - registered_capital_id: row.registered_capital_id, - enterprise_nature_id: row.enterprise_nature_id, - enterprise_scale_id: row.enterprise_scale_id, - business_scope: row.business_scope, - country: row.country, - province: row.province, - city: row.city, - region: row.region, - detail_address: row.detail_address, - remark: row.remark + contact_email: contactObj.length > 0 ? contactObj.email : "" } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDeleteClient({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue index bf3e1e8..e7f66a6 100644 --- a/src/views/client/contacts/index.vue +++ b/src/views/client/contacts/index.vue @@ -11,6 +11,7 @@ <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> </template> </el-table-column> </template> @@ -22,7 +23,7 @@ <script> import AddContactsDialog from "@/views/client/contacts/AddContactsDialog" -import { getContactList } from "@/api/client/contacts" +import { getContactList, getDeleteContact } from "@/api/client/contacts" export default { name: "ContactsView", props: {}, @@ -117,49 +118,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - name: "", - number: "", - client_id: "", - phone: "", - position: "", - member_id: "", - is_first: false, - wechat: "", - birthday: "", - email: "", - nextFollowupDate: "", - country_id: "", - province_id: "", - city_id: "", - region_id: "", - postalCode: "", - desc: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - id: row.id, - birthday: row.birthday, - city_id: row.city_id, - client_id: 0, - country_id: row.country_id, - desc: row.desc, - email: row.email, - is_first: row.is_first || false, - member_id: row.member_id, - name: row.name, - number: row.number, - phone: row.phone, - position: row.position, - province_id: row.province_id, - region_id: row.region_id, - wechat: row.wechat - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDeleteContact({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue index 6d2d7b0..5cf30ea 100644 --- a/src/views/client/followupRecords/index.vue +++ b/src/views/client/followupRecords/index.vue @@ -10,6 +10,7 @@ <el-table-column label="鎿嶄綔" width="120" 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> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddFollowupRecordsDialog from "@/views/client/followupRecords/AddFollowupRecordsDialog" -import { getFollowRecordList } from "@/api/client/followupRecords.js" +import { getFollowRecordList, getDeleteFollowRecord } from "@/api/client/followupRecords.js" export default { name: "FollowupRecords", @@ -72,15 +73,15 @@ this.tableList = { tableInfomation: [], tableColumn: [ - { label: "涓婚", prop: "topic", min: 190 }, // 涓婚 + { label: "涓婚", prop: "topic", min: 120 }, // 涓婚 { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 190 }, // 瀹㈡埛鍚嶇О { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100 }, // 鑱旂郴浜哄鍚� { label: "瀹㈡埛鐘舵��", prop: "client_status_id", min: 100 }, // 瀹㈡埛鐘舵�� { label: "鑱旂郴鏂瑰紡", prop: "phone", min: 100 }, // 鑱旂郴鏂瑰紡 - { label: "鑱旂郴浜烘棩鏈�", prop: "follow_time", min: 100 }, // 鑱旂郴浜烘棩鏈� - { label: "涓嬫鍥炶鏃ユ湡", prop: "next_follow_time", min: 130 }, // 涓嬫鍥炶鏃ユ湡 - { label: "璐熻矗浜�", prop: "member_id", min: 120 }, // 璐熻矗浜� - { label: "璺熻繘璁板綍", prop: "record", min: 120 } // 璺熻繘璁板綍 + { 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: "record", min: 130 } // 璺熻繘璁板綍 ] } this.searchOptions = [] @@ -126,46 +127,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - client_id: "", - number: "", - client_status_id: "", - contact_id: "", - member_id: "", - topic: "", - record: "", - phoneNumber: "", - sale_chance_id: "", - sales_leads_id: "", - follow_time: "", - next_follow_time: "", - purpose: "", - content: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - id: row.id, - client_name: row.client_name, - client_id: row.client_id, - number: row.number, - client_status_id: row.client_status_id, - contact_id: row.contact_id, - member_id: row.member_id, - topic: row.topic, - record: row.record, - phoneNumber: "", - sale_chance_id: row.sale_chance_id, - sales_leads_id: row.sales_leads_id, - follow_time: row.follow_time, - next_follow_time: row.next_follow_time, - purpose: row.purpose, - content: row.content - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDeleteFollowRecord({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/client/salesLead/index.vue b/src/views/client/salesLead/index.vue index 0063ba0..f9d6fce 100644 --- a/src/views/client/salesLead/index.vue +++ b/src/views/client/salesLead/index.vue @@ -7,11 +7,12 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="120"> + <el-table-column label="鎿嶄綔" width="160"> <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> </template> </el-table-column> </template> @@ -27,7 +28,7 @@ import AddSalesLeadDialog from "@/views/client/salesLead/AddSalesLeadDialog" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" import ImportFileDialog from "@/views/other/commonDialog/ImportFileDialog" -import { getSalesLeadsList } from "@/api/client/salesLead" +import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" export default { name: "SalesLead", @@ -80,13 +81,13 @@ tableInfomation: [], tableColumn: [ { label: "瀹㈡埛鍚嶇О", prop: "name", min: 190 }, // 瀹㈡埛鍚嶇О - { label: "閿�鍞嚎绱㈢紪鍙�", prop: "number", min: 190 }, // 閿�鍞嚎绱㈢紪鍙� - { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 190 }, // 鑱旂郴浜哄鍚� - { label: "鎵嬫満鍙风爜", prop: "contact_phone", min: 190 }, // 鎵嬫満鍙风爜 - { label: "鍟嗘満鏉ユ簮", prop: "sales_sources_id", min: 190 }, // 鍟嗘満鏉ユ簮 - { label: "鐪佷唤", prop: "province", min: 190 }, // 鐪佷唤 - { label: "鍩庡競", prop: "city", min: 190 }, // 鍩庡競 - { label: "璐熻矗浜�", prop: "member_id", min: 190 } // 璐熻矗浜� + { label: "閿�鍞嚎绱㈢紪鍙�", prop: "number", min: 130 }, // 閿�鍞嚎绱㈢紪鍙� + { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 130 }, // 鑱旂郴浜哄鍚� + { label: "鎵嬫満鍙风爜", prop: "contact_phone", min: 130 }, // 鎵嬫満鍙风爜 + { label: "鍟嗘満鏉ユ簮", prop: "sales_sources_id", min: 130 }, // 鍟嗘満鏉ユ簮 + { label: "鐪佷唤", prop: "province", min: 130 }, // 鐪佷唤 + { label: "鍩庡競", prop: "city", min: 130 }, // 鍩庡競 + { label: "璐熻矗浜�", prop: "member_id", min: 130 } // 璐熻矗浜� ] } this.searchOptions = [] @@ -101,15 +102,9 @@ .then((res) => { const list = res.data.list.map((item) => { return { - id: item.id, - name: item.name, - number: item.number, - contact_name: item.contact_name, - contact_phone: item.contact_phone, - sales_sources_id: item.sales_sources_id, + ...item, province: item.Province.name, - city: item.City.name, - member_id: item.member_id + city: item.City.name } }) this.tableList.tableInfomation = list || [] @@ -122,50 +117,42 @@ addBtnClick() { this.editSalesLeadConfig.visible = true this.editSalesLeadConfig.title = "鏂板缓" - this.editSalesLeadConfig.infomation = { - name: "", - number: "", - contact_name: "", - contact_position: "", - contact_phone: "", - businessStatus: "鏂板缓", - sales_sources_id: "", - member_id: "", - country: "", - province: "", - city: "", - region: "", - address: "", - desc: "" - } + this.editSalesLeadConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editSalesLeadConfig.visible = true this.editSalesLeadConfig.title = "缂栬緫" - this.editSalesLeadConfig.infomation = { - id: row.id, - name: row.name, - number: row.number, - contact_name: row.contact_name, - contact_position: row.contact_position, - contact_phone: row.contact_phone, - businessStatus: "缂栬緫", - sales_sources_id: row.sales_sources_id, - member_id: row.member_id, - country: "", - province: "", - city: "", - region: "", - address: "", - desc: row.desc - } + this.editSalesLeadConfig.infomation = { ...row } }, // 瀵煎叆 importClitk() { this.importConfig.visible = true this.importConfig.title = "閿�鍞嚎绱�" + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDeleteSalesLeads({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/contractManage/AddContractManageDialog.vue b/src/views/sales/contractManage/AddContractManageDialog.vue index a1e40fc..2e1baa7 100644 --- a/src/views/sales/contractManage/AddContractManageDialog.vue +++ b/src/views/sales/contractManage/AddContractManageDialog.vue @@ -42,7 +42,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -150,7 +150,7 @@ </el-form> <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="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> </div> </el-dialog> @@ -186,10 +186,10 @@ }, memberOptions: [], statusOptions: [ - { value: "1", label: "寰呭鎵�" }, - { value: "2", label: "瀹℃壒涓�" }, - { value: "3", label: "宸插鎵�" }, - { value: "4", label: "宸插綊妗�" } + { id: "1", name: "寰呭鎵�" }, + { id: "2", name: "瀹℃壒涓�" }, + { id: "3", name: "宸插鎵�" }, + { id: "4", name: "宸插綊妗�" } ], // 鍚堝悓鐘舵�� approvalWorkflowOptions: [], // 瀹℃壒娴佺▼ unflodCollapseStr: "鏀惰捣", @@ -259,8 +259,8 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - client_id: data.client_id || 0, - file: data.file || "", + client_id: parseInt(data.client_id) || 0, + file: "", member_id: data.member_id || 0, number: data.number || "", quotation_id: data.quotation_id || 0, diff --git a/src/views/sales/contractManage/index.vue b/src/views/sales/contractManage/index.vue index f3e7225..34d7b2d 100644 --- a/src/views/sales/contractManage/index.vue +++ b/src/views/sales/contractManage/index.vue @@ -20,6 +20,7 @@ <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> </template> </el-table-column> </template> @@ -31,7 +32,7 @@ <script> import AddContractManageDialog from "@/views/sales/contractManage/AddContractManageDialog" -import { getContractList } from "@/api/sales/contractManage" +import { getContractList, getDelContract } from "@/api/sales/contractManage" export default { name: "ContractManage", @@ -127,34 +128,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - documentNumber: "ZDYBD01-3", - owner: "", - contractStatus: "", - salesQuotation: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - customName: "", - documentNumber: "TKD20230521-12", - owner: "", - contractStatus: "", - salesQuotation: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelContract({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/generatePlan/AddGeneratePlanDialog.vue b/src/views/sales/generatePlan/AddGeneratePlanDialog.vue index 341b67c..92e275b 100644 --- a/src/views/sales/generatePlan/AddGeneratePlanDialog.vue +++ b/src/views/sales/generatePlan/AddGeneratePlanDialog.vue @@ -42,7 +42,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -130,7 +130,7 @@ </div> </el-form> <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> </div> </el-dialog> @@ -233,7 +233,7 @@ let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, plan: { - clientId: data.clientId || 0, + clientId: parseInt(data.clientId) || 0, content: data.content || "", endTime: data.endTime || "", file: data.file || "", diff --git a/src/views/sales/generatePlan/index.vue b/src/views/sales/generatePlan/index.vue index 9a4d88c..7f4e2f1 100644 --- a/src/views/sales/generatePlan/index.vue +++ b/src/views/sales/generatePlan/index.vue @@ -10,6 +10,7 @@ <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> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddGeneratePlanDialog from "@/views/sales/generatePlan/AddGeneratePlanDialog" -import { getPlanList } from "@/api/sales/generatePlan" +import { getPlanList, getDelPlan } from "@/api/sales/generatePlan" export default { name: "GeneratePlan", @@ -125,6 +126,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelPlan({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/masterOrder/AddMasterOrderDialog.vue b/src/views/sales/masterOrder/AddMasterOrderDialog.vue index cbb0e6a..df97052 100644 --- a/src/views/sales/masterOrder/AddMasterOrderDialog.vue +++ b/src/views/sales/masterOrder/AddMasterOrderDialog.vue @@ -42,7 +42,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :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> @@ -204,10 +204,10 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - client_id: data.client_id || 0, + client_id: parseInt(data.client_id) || 0, end_time: data.end_time || "", member_id: data.member_id || 0, - money: data.money || "", + money: parseFloat(data.money) || "0", number: data.number || "", start_time: data.start_time || "" } diff --git a/src/views/sales/masterOrder/index.vue b/src/views/sales/masterOrder/index.vue index 3a1e960..d01e15d 100644 --- a/src/views/sales/masterOrder/index.vue +++ b/src/views/sales/masterOrder/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :show-summary="showSummary" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddMasterOrderDialog from "@/views/sales/masterOrder/AddMasterOrderDialog" -import { getMasterOrderList } from "@/api/sales/masterOrder" +import { getMasterOrderList, getDelMasterOrder } from "@/api/sales/masterOrder" export default { name: "MasterOrder", @@ -75,8 +76,8 @@ tableColumn: [ { label: "鍗曟嵁缂栧彿", prop: "number", min: 100 }, // 鍗曟嵁缂栧彿 { label: "瀹㈡埛鍚嶇О", prop: "client_id", min: 120 }, // 瀹㈡埛鍚嶇О - { label: "鏈嶅姟寮�濮嬫椂闂�", prop: "start_time", min: 90 }, // 鏈嶅姟寮�濮嬫椂闂� - { label: "鏈嶅姟鎴鏃堕棿", prop: "end_time" }, // 鏈嶅姟鎴鏃堕棿 + { label: "鏈嶅姟寮�濮嬫椂闂�", prop: "start_time", isTime: true }, // 鏈嶅姟寮�濮嬫椂闂� + { label: "鏈嶅姟鎴鏃堕棿", prop: "end_time", isTime: true }, // 鏈嶅姟鎴鏃堕棿 { label: "鍚堝悓閲戦", prop: "money" }, // 鍚堝悓閲戦 { label: "璐熻矗浜�", prop: "member_id" } // 璐熻矗浜� // { label: "瀹℃壒鐘舵��", prop: "approvalStatus" } // 瀹℃壒鐘舵�� @@ -128,6 +129,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelMasterOrder({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue index 2316083..b02b5b5 100644 --- a/src/views/sales/quotation/AddQuotationDialog.vue +++ b/src/views/sales/quotation/AddQuotationDialog.vue @@ -80,7 +80,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :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> diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue index eb67ab2..0988c94 100644 --- a/src/views/sales/quotation/index.vue +++ b/src/views/sales/quotation/index.vue @@ -12,9 +12,10 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -26,7 +27,7 @@ <script> import AddQuotationDialog from "@/views/sales/quotation/AddQuotationDialog" -import { getQuotationList } from "@/api/sales/quotation" +import { getQuotationList, getDelQuotation } from "@/api/sales/quotation" export default { name: "QuotationView", @@ -79,7 +80,7 @@ { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120 }, // 瀹㈡埛鍚嶇О { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90 }, // 鑱旂郴浜哄鍚� { label: "閿�鍞礋璐d汉", prop: "member_id" }, // 閿�鍞礋璐d汉 - { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿 + { label: "鏈夋晥鏈�", prop: "validity_date", isTime: true, min: 100 }, // 淇敼鏃堕棿 { label: "灏忚", prop: "subTotal" }, // 灏忚 { label: "鍚堣", prop: "total" }, // 鍚堣 { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О @@ -135,6 +136,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelQuotation({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/refundForm/index.vue b/src/views/sales/refundForm/index.vue index 5cfefe7..f39cd4a 100644 --- a/src/views/sales/refundForm/index.vue +++ b/src/views/sales/refundForm/index.vue @@ -10,6 +10,7 @@ <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> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddRefundFormDialog from "@/views/sales/refundForm/AddRefundFormDialog" -import { getSalesRefundList } from "@/api/sales/refundForm" +import { getSalesRefundList, getDelSalesRefund } from "@/api/sales/refundForm" export default { name: "RefundForm", @@ -72,7 +73,7 @@ tableColumn: [ { label: "閫�娆惧崟缂栧彿", prop: "number" }, { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 120 }, - { label: "閫�娆炬棩鏈�", prop: "refundDate", min: 90 }, + { label: "閫�娆炬棩鏈�", prop: "refundDate", isTime: true, min: 130 }, { label: "璐︽埛", prop: "accountId" }, { label: "鏄惁寮�绁�", prop: "isInvoice", min: 100 }, { label: "浠樻鏂瑰紡", prop: "refundMethod" }, @@ -127,6 +128,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelSalesRefund({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue index 0a7f933..576f6ce 100644 --- a/src/views/sales/salesDetails/index.vue +++ b/src/views/sales/salesDetails/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :show-summary="showSummary" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddSalesDetailsDialog from "@/views/sales/salesDetails/AddSalesDetailsDialog" -import { getSalesDetailsList } from "@/api/sales/salesDetails" +import { getSalesDetailsList, getDelSalesDetails } from "@/api/sales/salesDetails" export default { name: "SalesDetails", @@ -87,7 +88,7 @@ tableColumn: [ { label: "璁㈠崟缂栧彿", prop: "number" }, { label: "瀹㈡埛鍚嶇О", prop: "clientId" }, - { label: "绛剧害鏃ユ湡", prop: "signTime" }, + { label: "绛剧害鏃ユ湡", prop: "signTime", isTime: true, width: 150 }, { label: "閿�鍞礋璐d汉", prop: "memberId" }, { label: "鍑哄簱鐘舵��", prop: "outboundStatus" }, { label: "宸叉敹鎬婚", prop: "receiveTotalAmount", price: true }, @@ -96,7 +97,7 @@ { label: "宸插紑绁ㄩ噾棰�", prop: "invoicedAmount", price: true }, { label: "鏈紑绁ㄩ噾棰�", prop: "uninvoicedAmount", price: true }, { label: "浜у搧鍚嶇О", prop: "productName" }, - { label: "鏁伴噺", prop: "number" }, + { label: "鏁伴噺", prop: "number1" }, { label: "鍚◣鍗曚环", prop: "taxUnitPrice", price: true }, { label: "鏈嚭搴撴暟閲�", prop: "unOutoundNo" }, { label: "浠风◣鍚堣", prop: "priceTax", price: true } @@ -148,6 +149,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelSalesDetails({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue index d12fe97..00061d0 100644 --- a/src/views/sales/salesOpportunity/index.vue +++ b/src/views/sales/salesOpportunity/index.vue @@ -12,10 +12,11 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="100"> + <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> </template> </el-table-column> </template> @@ -27,7 +28,7 @@ <script> import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog" -import { getSaleChanceList } from "@/api/sales/salesOpportunity" +import { getSaleChanceList, getDelSaleChance } from "@/api/sales/salesOpportunity" export default { name: "SalesOpportunity", @@ -91,7 +92,7 @@ { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100 }, // 鑱旂郴浜哄鍚� { label: "閿�鍞樁娈�", prop: "sale_stage_id" }, // 閿�鍞樁娈� { label: "鍙兘鎬�(%)", prop: "possibilities_id" }, // 鍙兘鎬� - { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time" }, // 棰勮鎴愪氦鏃ユ湡 + { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time", isTime: true, min: 130 }, // 棰勮鎴愪氦鏃ユ湡 { label: "棰勮鍚堝悓閲戦", prop: "projected_amount" }, // 棰勮鍚堝悓閲戦 { label: "棰勭畻缁濆鍊�", prop: "capital_budget" }, // 棰勭畻缁濆鍊� { label: "閿�鍞礋璐d汉", prop: "member_id" } // 閿�鍞礋璐d汉 @@ -145,6 +146,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelSaleChance({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue index ba7d780..028924b 100644 --- a/src/views/sales/salesReturn/index.vue +++ b/src/views/sales/salesReturn/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddSalesReturnDialog from "@/views/sales/salesReturn/AddSalesReturnDialog" -import { getSalesReturnList } from "@/api/sales/salesReturn" +import { getSalesReturnList, getDelSalesReturn } from "@/api/sales/salesReturn" export default { name: "SalesReturn", @@ -73,13 +74,13 @@ tableColumn: [ { label: "閿�鍞��璐у崟缂栧彿", prop: "number", min: 120 }, { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 90 }, - { label: "閫�璐ф棩鏈�", prop: "returnDate", min: 100 }, + { label: "閫�璐ф棩鏈�", prop: "returnDate", isTime: true, min: 130 }, { label: "鐘舵��", prop: "status" }, { label: "閫�鍏ヤ粨搴�", prop: "repository" }, { label: "搴旈��娆�", prop: "refundabe" }, { label: "宸查��娆�", prop: "refunded" }, - { label: "閿�鍞礋璐d汉", prop: "memberId" }, - { label: "淇敼鏃堕棿", prop: "modifyTime" } + { label: "閿�鍞礋璐d汉", prop: "memberId" } + // { label: "淇敼鏃堕棿", prop: "modifyTime", isTime: true, min: 130 } ] } this.searchOptions = [] @@ -128,6 +129,29 @@ this.editConfig.visible = true this.editConfig.title = "缂栬緫" this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelSalesReturn({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue index a9ad5d0..2dd9a08 100644 --- a/src/views/sales/subOrder/AddSubOrderDialog.vue +++ b/src/views/sales/subOrder/AddSubOrderDialog.vue @@ -51,7 +51,7 @@ size="mini" style="width: 63%" > - <el-option v-for="item in memberOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -166,7 +166,7 @@ </div> </el-form> <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> </div> </el-dialog> @@ -178,7 +178,7 @@ import { getAllData } from "@/api/client/client" import { getAddSubOrder, getUpdateSubOrder } from "@/api/sales/subOrder" export default { - name: "QuotationDialog", + name: "SubOrderDialog", components: { CommonFormTableView }, props: { editCommonConfig: { @@ -230,7 +230,10 @@ getCommonData() { getAllData() .then((res) => { - this.memberOptions = res.data.member + console.log(res) + if (res.code === 200) { + this.memberOptions = res.data.member + } }) .catch((err) => { console.log(err) @@ -286,8 +289,8 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - clientId: data.clientId || 0, - masterOrderId: data.masterOrderId || 0, + clientId: parseInt(data.client_id) || 0, + masterOrderId: parseInt(data.masterOrderId) || 0, memberId: data.memberId || 0, number: data.number || "", product: [ diff --git a/src/views/sales/subOrder/index.vue b/src/views/sales/subOrder/index.vue index ec9554f..3a03dcc 100644 --- a/src/views/sales/subOrder/index.vue +++ b/src/views/sales/subOrder/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :show-summary="showSummary" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddSubOrderDialog from "@/views/sales/subOrder/AddSubOrderDialog" -import { getSubOrderList } from "@/api/sales/subOrder" +import { getSubOrderList, getDelSubOrder } from "@/api/sales/subOrder" export default { name: "SubOrder", @@ -124,30 +125,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - documentNumber: "AC6521", - masterOrder: "", - owner: "", - currency: "", - discount: "", - total: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - customName: "", - documentNumber: "AC6521", - masterOrder: "", - owner: "", - currency: "", - discount: "", - total: "14.00" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelSubOrder({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/service/orderManage/AddOrderManageDialog.vue b/src/views/service/orderManage/AddOrderManageDialog.vue index e4afce2..35f5062 100644 --- a/src/views/service/orderManage/AddOrderManageDialog.vue +++ b/src/views/service/orderManage/AddOrderManageDialog.vue @@ -22,54 +22,70 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="customName"> + <el-form-item label="瀹㈡埛鍚嶇О" prop="clientId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.customName"></el-input> + <el-input v-model="editConfig.infomation.clientId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="宸ュ崟缂栧彿" prop="orderNumber"> - <el-input v-model="editConfig.infomation.orderNumber"></el-input> + <el-form-item label="宸ュ崟缂栧彿" prop="number"> + <el-input v-model="editConfig.infomation.number"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="宸ュ崟鍚嶇О" prop="orderName"> - <el-input v-model="editConfig.infomation.orderName"></el-input> + <el-form-item label="宸ュ崟鍚嶇О" prop="name"> + <el-input v-model="editConfig.infomation.name"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="宸ュ崟绫诲瀷" prop="orderType"> - <CommonSelectView - :common-value="editConfig.infomation.orderType" - :common-options="orderTypeOptions" - /> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.orderType" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in orderTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contactName"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contactId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.contactName"></el-input> + <el-input v-model="editConfig.infomation.contactId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鎶ヤ慨鏉ユ簮" prop="repairSource"> - <CommonSelectView - :common-value="editConfig.infomation.repairSource" - :common-options="repairSourceOptions" - /> + <el-form-item label="鎶ヤ慨鏉ユ簮" prop="reportSourceId"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.reportSourceId" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in reportSourceOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col :span="12"> - <el-form-item label="閫夋嫨婧愬崟" prop="selSourceOrder"> - <el-select v-model="editConfig.infomation.selSourceOrder" size="mini"> + <!-- <el-col :span="12"> + <el-form-item label="閫夋嫨婧愬崟" prop="sourceSheet"> + <el-select v-model="editConfig.infomation.sourceSheet" size="mini"> <el-option - v-for="item in selSourceOrderOptions" + v-for="item in sourceSheetOptions" :key="item.value" :label="item.label" :value="item.value" @@ -77,7 +93,7 @@ </el-option> </el-select> </el-form-item> - </el-col> + </el-col> --> </el-row> </div> <!-- 闂鎻忚堪 --> @@ -85,12 +101,12 @@ <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="闂鎻忚堪" prop="problemDesc"> + <el-form-item label="闂鎻忚堪" prop="problemDescription"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDesc" + v-model="editConfig.infomation.problemDescription" ></el-input> </el-form-item> </el-col> @@ -124,7 +140,7 @@ </el-row> </div> <!-- 閫夋嫨瀹℃壒娴佺▼ --> - <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> + <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> <div class="basic-info-view"> <el-row> <el-col :span="20"> @@ -162,13 +178,13 @@ </el-form-item> </el-col> </el-row> - </div> + </div> --> </div> </el-form> <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="editConfig.visible = false">淇濆瓨</el-button> + <!-- <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> </div> </el-dialog> @@ -176,9 +192,8 @@ </template> <script> -import CommonSelectView from "@/components/makepager/CommonSelectView" import { getAllData } from "@/api/client/client" -import { getAddSubOrder, getUpdateSubOrder } from "@/api/sales/subOrder" +import { getAddOrderManage, getUpdateOrderManage } from "@/api/serviceManage/orderManage" export default { name: "AddOrderManageDialog", props: { @@ -193,7 +208,7 @@ } } }, - components: { CommonSelectView }, + components: {}, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -204,14 +219,14 @@ dialogWidth: "80%", editConfig: this.editCommonConfig, rules: { - customName: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }], - orderNumber: [{ required: true, message: "璇疯緭鍏ュ伐鍗曠紪鍙�", trigger: "blur" }], + clientId: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }], + number: [{ required: true, message: "璇疯緭鍏ュ伐鍗曠紪鍙�", trigger: "blur" }], orderType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - problemDesc: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] + problemDescription: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] }, - orderTypeOptions: [], // 宸ュ崟绫诲瀷 - repairSourceOptions: [], // 鎶ヤ慨鏉ユ簮 - selSourceOrderOptions: [ + orderTypeOptions: [{ id: 1, name: "绫诲瀷1" }], // 宸ュ崟绫诲瀷 + reportSourceOptions: [], // 鎶ヤ慨鏉ユ簮 + sourceSheetOptions: [ { value: "1", label: "閿�鍞槑缁嗗崟" }, { value: "2", label: "鏈嶅姟鍚堝悓" } ], @@ -239,7 +254,7 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddSubOrder(params) + getAddOrderManage(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -255,7 +270,7 @@ console.log(err) }) } else { - getUpdateSubOrder(params) + getUpdateOrderManage(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -281,21 +296,15 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - clientId: data.clientId || 0, - masterOrderId: data.masterOrderId || 0, - memberId: data.memberId || 0, + clientId: parseInt(data.clientId) || 0, + contactId: data.contactId || 0, + file: data.file || "", + name: data.name || "", number: data.number || "", - product: [ - { - amount: 0, - desc: "", - id: 0, - name: "", - number: "", - price: 0, - total: 0 - } - ] + orderType: data.orderType || 0, + problemDescription: data.problemDescription || "", + reportSourceId: data.reportSourceId || 0, + sourceSheet: data.sourceSheet || 0 } return params }, @@ -333,6 +342,17 @@ font-size: 18px; } } + .common-select { + display: flex; + .common-select-sel { + width: 270px; + } + .common-select-btn { + margin-left: 5px; + font-size: 16px; + cursor: pointer; + } + } } .annex-view { display: flex; diff --git a/src/views/service/orderManage/index.vue b/src/views/service/orderManage/index.vue index d821a9d..a1ac0c6 100644 --- a/src/views/service/orderManage/index.vue +++ b/src/views/service/orderManage/index.vue @@ -16,9 +16,10 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="120"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -30,7 +31,7 @@ <script> import AddOrderManageDialog from "@/views/service/orderManage/AddOrderManageDialog" -import { getOrderManageList } from "@/api/serviceManage/orderManage" +import { getOrderManageList, getDelOrderManage } from "@/api/serviceManage/orderManage" export default { name: "SalesLead", @@ -132,39 +133,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - orderNumber: "CS21", - orderName: "", - orderType: "", - contactName: "", - repairSource: "", - selSourceOrder: "", - problemDesc: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - orderNumber: row.orderNumber, - orderName: row.orderName, - orderType: row.orderType, - contactName: row.contactName, - repairSource: row.repairSource, - selSourceOrder: row.selSourceOrder, - problemDesc: row.problemDesc, - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelOrderManage({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue index 7a3568e..232dcb4 100644 --- a/src/views/service/serviceContract/AddServiceContractDialog.vue +++ b/src/views/service/serviceContract/AddServiceContractDialog.vue @@ -22,86 +22,99 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="customName"> + <el-form-item label="瀹㈡埛鍚嶇О" prop="clientId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.customName"></el-input> + <el-input v-model="editConfig.infomation.clientId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鍚堝悓缂栧彿" prop="serviceContractNumber"> - <el-input v-model="editConfig.infomation.serviceContractNumber"></el-input> + <el-form-item label="鏈嶅姟鍚堝悓缂栧彿" prop="number"> + <el-input v-model="editConfig.infomation.number"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="璐熻矗浜�" prop="owner"> - <el-select v-model="editConfig.infomation.owner" placeholder="璇烽�夋嫨" size="mini" style="width: 63%"> - <el-option v-for="item in ownerOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="璐熻矗浜�" prop="memberId"> + <el-select + v-model="editConfig.infomation.memberId" + placeholder="璇烽�夋嫨" + size="mini" + style="width: 63%" + > + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contactName"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contactId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.contactName"></el-input> + <el-input v-model="editConfig.infomation.contactId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="閿�鍞満浼�" prop="salesOpportunity"> + <el-form-item label="閿�鍞満浼�" prop="saleChanceId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.salesOpportunity"></el-input> + <el-input v-model="editConfig.infomation.saleChanceId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍚堝悓璁㈠崟" prop="contractOrder"> + <el-form-item label="鍚堝悓璁㈠崟" prop="contractId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.contractOrder"></el-input> + <el-input v-model="editConfig.infomation.contractId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鎶ヤ环鍗�" prop="quotation"> + <el-form-item label="鎶ヤ环鍗�" prop="quotationId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.quotation"></el-input> + <el-input v-model="editConfig.infomation.quotationId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍚堝悓绫诲瀷" prop="contractType"> - <CommonSelectView - :common-value="editConfig.infomation.contractType" - :common-options="contractTypeOptions" - /> + <el-form-item label="鍚堝悓绫诲瀷" prop="typeId"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.typeId" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in contractTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="绛剧害鏃ユ湡" prop="signDate"> - <el-date-picker v-model="editConfig.infomation.signDate" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="绛剧害鏃ユ湡" prop="signTime"> + <el-date-picker v-model="editConfig.infomation.signTime" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟寮�濮嬫棩鏈�" prop="startDate"> - <el-date-picker v-model="editConfig.infomation.startDate" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="鏈嶅姟寮�濮嬫棩鏈�" prop="startTime"> + <el-date-picker v-model="editConfig.infomation.startTime" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鍒版湡鏃�" prop="endDate"> - <el-date-picker v-model="editConfig.infomation.endDate" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="鏈嶅姟鍒版湡鏃�" prop="endTime"> + <el-date-picker v-model="editConfig.infomation.endTime" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> </el-col> @@ -112,31 +125,44 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鍚堝悓鐘舵��" prop="contractStatus"> - <CommonSelectView - :common-value="editConfig.infomation.contractStatus" - :common-options="contractStatusOptions" - /> + <el-form-item label="鍚堝悓鐘舵��" prop="statusId"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.statusId" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option + v-for="item in contractStatusOptions" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="搴旀湇鍔℃鏁�" prop="serviceNumber"> - <el-input v-model="editConfig.infomation.serviceNumber"></el-input> + <el-form-item label="搴旀湇鍔℃鏁�" prop="serviceTimes"> + <el-input v-model="editConfig.infomation.serviceTimes"></el-input> </el-form-item> </el-col> </el-row> </div> <!-- 鏉℃涓庢潯浠� --> <div class="basic-info-title">鏉℃涓庢潯浠�</div> - <div class="address-view"> + <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="鏉℃鍜屾潯绾�" prop="termsTreaty"> + <el-form-item label="鏉℃鍜屾潯绾�" prop="terms"> <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.termsTreaty" + v-model="editConfig.infomation.terms" ></el-input> </el-form-item> </el-col> @@ -147,12 +173,12 @@ <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="澶囨敞" prop="notes"> + <el-form-item label="澶囨敞" prop="remark"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.notes" + v-model="editConfig.infomation.remark" ></el-input> </el-form-item> </el-col> @@ -200,7 +226,7 @@ <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" /> </div> <!-- 閫夋嫨瀹℃壒娴佺▼ --> - <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> + <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> <div class="basic-info-view"> <el-row> <el-col :span="20"> @@ -238,13 +264,13 @@ </el-form-item> </el-col> </el-row> - </div> + </div> --> </div> </el-form> <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="editConfig.visible = false">淇濆瓨</el-button> + <!-- <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> </div> </el-dialog> @@ -252,10 +278,9 @@ </template> <script> -import CommonSelectView from "@/components/makepager/CommonSelectView" import CommonFormTableView from "@/components/makepager/CommonFormTableView" import { getAllData } from "@/api/client/client" -import { getAddSubOrder, getUpdateSubOrder } from "@/api/sales/subOrder" +import { getAddServiceContract, getUpdateServiceContract } from "@/api/serviceManage/serviceContract" export default { name: "AddServiceContractDialog", props: { @@ -270,7 +295,7 @@ } } }, - components: { CommonSelectView, CommonFormTableView }, + components: { CommonFormTableView }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -281,20 +306,11 @@ dialogWidth: "80%", editConfig: this.editCommonConfig, rules: { - serviceContractNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″悎鍚岀紪鍙�", trigger: "blur" }], - signDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - owner: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }] + number: [{ required: true, message: "璇疯緭鍏ユ湇鍔″悎鍚岀紪鍙�", trigger: "blur" }], + signTime: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], + memberId: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }] }, - ownerOptions: [ - // 璐熻矗浜� - { value: "1", label: "BOSS" }, - { value: "2", label: "Mia" }, - { value: "3", label: "璐㈠姟" }, - { value: "4", label: "甯傚満" }, - { value: "5", label: "绯荤粺绠$悊鍛�" }, - { value: "6", label: "閿�鍞�" }, - { value: "7", label: "閿�鍞�荤洃" } - ], + memberOptions: [], contractTypeOptions: [], // 鍚堝悓绫诲瀷 contractStatusOptions: [], // 鍚堝悓鐘舵�� currencyOptions: [ @@ -320,7 +336,9 @@ getCommonData() { getAllData() .then((res) => { - this.memberOptions = res.data.member + if (res.code === 200) { + this.memberOptions = res.data.member + } }) .catch((err) => { console.log(err) @@ -334,7 +352,7 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddSubOrder(params) + getAddServiceContract(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -350,7 +368,7 @@ console.log(err) }) } else { - getUpdateSubOrder(params) + getUpdateServiceContract(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -376,11 +394,13 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - clientId: data.clientId || 0, - masterOrderId: data.masterOrderId || 0, + clientId: parseInt(data.clientId) || 0, + contactId: data.contactId || 0, + contractId: data.contractId || 0, + endTime: data.endTime || "", memberId: data.memberId || 0, number: data.number || "", - product: [ + products: [ { amount: 0, desc: "", @@ -390,7 +410,16 @@ price: 0, total: 0 } - ] + ], + quotationId: data.quotationId || 0, + remark: data.remark || "", + saleChanceId: data.saleChanceId || 0, + serviceTimes: data.serviceTimes || 0, + signTime: data.signTime || "", + startTime: data.startTime || "", + statusId: data.statusId || 0, + terms: data.terms || "", + typeId: data.typeId || 0 } return params }, @@ -461,10 +490,17 @@ font-size: 18px; } } - } - .address-view { - margin-top: 10px; - padding-right: 40px; + .common-select { + display: flex; + .common-select-sel { + width: 270px; + } + .common-select-btn { + margin-left: 5px; + font-size: 16px; + cursor: pointer; + } + } } .annex-view { display: flex; diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue index 51767b5..f7328da 100644 --- a/src/views/service/serviceContract/index.vue +++ b/src/views/service/serviceContract/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddServiceContractDialog from "@/views/service/serviceContract/AddServiceContractDialog" -import { getServiceContractList } from "@/api/serviceManage/serviceContract" +import { getServiceContractList, getDelServiceContract } from "@/api/serviceManage/serviceContract" export default { name: "ServiceContract", @@ -122,54 +123,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - serviceContractNumber: "AC6521", - owner: "5", - contactName: "", - salesOpportunity: "", - contractOrder: "", - quotation: "", - contractType: "", - signDate: "", - startDate: "", - endDate: "", - contractStatus: "", - serviceNumber: "", - termsTreaty: "", - notes: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) - this.editSalesLeadConfig.visible = true - this.editSalesLeadConfig.title = "缂栬緫" - this.editSalesLeadConfig.infomation = { - customName: "", - serviceContractNumber: "AC6521", - owner: "5", - contactName: "", - salesOpportunity: "", - contractOrder: "", - quotation: "", - contractType: "", - signDate: "", - startDate: "", - endDate: "", - contractStatus: "", - serviceNumber: "", - termsTreaty: "", - notes: "", - approvalWorkflow: "", - approvalSteps: "", - approvalPerson: "", - approvalOpinion: "" - } + this.editConfig.visible = true + this.editConfig.title = "缂栬緫" + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelServiceContract({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/service/serviceFeeManage/AddServiceFeeManageDialog.vue b/src/views/service/serviceFeeManage/AddServiceFeeManageDialog.vue index b67ce49..8d60e84 100644 --- a/src/views/service/serviceFeeManage/AddServiceFeeManageDialog.vue +++ b/src/views/service/serviceFeeManage/AddServiceFeeManageDialog.vue @@ -22,89 +22,133 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="customName"> + <el-form-item label="瀹㈡埛鍚嶇О" prop="name"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.customName"></el-input> + <el-input v-model="editConfig.infomation.name"></el-input> <div class="common-select-btn"><i class="el-icon-house" title="宸ュ晢鏌ヨ"></i></div> <div class="common-select-btn"><i class="el-icon-search" title="鏌ラ噸"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鏀惰垂浜�" prop="serviceCharger"> + <el-form-item label="鏈嶅姟鏀惰垂浜�" prop="member_id"> <el-select - v-model="editConfig.infomation.serviceCharger" + v-model="editConfig.infomation.member_id" placeholder="璇烽�夋嫨" size="mini" style="width: 63%" > <el-option - v-for="item in serviceChargerOptions" - :key="item.value" - :label="item.label" - :value="item.value" + v-for="item in memberOptions" + :key="item.id" + :label="item.username" + :value="item.id" ></el-option> </el-select> </el-form-item> </el-col> <el-col v-if="isUnflod" :span="12"> - <el-form-item label="瀹㈡埛缂栧彿" prop="customNumber"> - <el-input v-model="editConfig.infomation.customNumber"></el-input> - </el-form-item> - </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="瀹㈡埛瑙勬ā" prop="customerSize"> - <CommonSelectView - :common-value="editConfig.infomation.customerSize" - :common-options="customerSizeOptions" - /> + <el-form-item label="瀹㈡埛缂栧彿" prop="number"> + <el-input v-model="editConfig.infomation.number"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="瀹㈡埛鐘舵��" prop="customStatus"> - <CommonSelectView - :common-value="editConfig.infomation.customStatus" - :common-options="customStatusOptions" - /> - </el-form-item> - </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="閲嶈绾у埆" prop="importantLevel"> - <CommonSelectView - :common-value="editConfig.infomation.importantLevel" - :common-options="importantLevelOptions" - /> + <el-form-item label="瀹㈡埛瑙勬ā" prop="enterprise_scale_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.enterprise_scale_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option + v-for="item in enterpriseScaleOptions" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="瀹㈡埛鏉ユ簮" prop="customSource"> - <CommonSelectView - :common-value="editConfig.infomation.customSource" - :common-options="customSourceOptions" - /> + <el-form-item label="瀹㈡埛鐘舵��" prop="client_status_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.client_status_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in clientStatusOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="瀹㈡埛绫诲瀷" prop="customType"> - <CommonSelectView - :common-value="editConfig.infomation.customType" - :common-options="customTypeOptions" - /> - </el-form-item> - </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鏈嶅姟浠h〃" prop="serviceAgent"> + <el-col :span="12"> + <el-form-item label="閲嶈绾у埆" prop="client_level_id"> <el-select - v-model="editConfig.infomation.serviceAgent" + v-model="editConfig.infomation.client_level_id" + placeholder="璇烽�夋嫨" + size="mini" + style="width: 63%" + > + <el-option v-for="item in importantLevelOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="瀹㈡埛鏉ユ簮" prop="client_origin_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.client_origin_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in clientSourceOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"> + <i class="el-icon-setting"></i> + </div> + </div> + </el-form-item> + </el-col> + <el-col v-if="isUnflod" :span="12"> + <el-form-item label="瀹㈡埛绫诲瀷" prop="client_type_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.client_type_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in clientTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> + </el-form-item> + </el-col> + <el-col v-if="isUnflod" :span="12"> + <el-form-item label="鏈嶅姟浠h〃" prop="service_member_id"> + <el-select + v-model="editConfig.infomation.service_member_id" placeholder="璇烽�夋嫨" size="mini" style="width: 63%" > <el-option - v-for="item in serviceAgentOptions" - :key="item.value" - :label="item.label" - :value="item.value" + v-for="item in serviceMemberOptions" + :key="item.id" + :label="item.username" + :value="item.id" > </el-option> </el-select> @@ -117,8 +161,8 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鏈�鏅氭湇鍔″埌鏈熸棩" prop="latestServiceDate"> - <el-date-picker v-model="editConfig.infomation.latestServiceDate" type="date" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="鏈�鏅氭湇鍔″埌鏈熸棩" prop="latest_date"> + <el-date-picker v-model="editConfig.infomation.latest_date" type="date" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> </el-col> @@ -129,32 +173,32 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contactName"> - <el-input v-model="editConfig.infomation.contactName"></el-input> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_name"> + <el-input v-model="editConfig.infomation.contact_name"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜鸿亴鍔�" prop="duties"> - <el-input v-model="editConfig.infomation.duties"></el-input> + <el-form-item label="鑱旂郴浜鸿亴鍔�" prop="position"> + <el-input v-model="editConfig.infomation.position"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜烘墜鏈�" prop="phoneNumber"> - <el-input v-model="editConfig.infomation.phoneNumber"></el-input> + <el-form-item label="鑱旂郴浜烘墜鏈�" prop="contact_phone"> + <el-input v-model="editConfig.infomation.contact_phone"></el-input> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鑱旂郴浜篍mail" prop="contactsEmail"> - <el-input v-model="editConfig.infomation.contactsEmail"></el-input> + <el-col :span="12"> + <el-form-item label="鑱旂郴浜篍mail" prop="contact_email"> + <el-input v-model="editConfig.infomation.contact_email"></el-input> </el-form-item> </el-col> </el-row> </div> <!-- 鍦板潃淇℃伅 --> <div v-if="isUnflod" class="basic-info-title">鍦板潃淇℃伅</div> - <div class="address-view"> + <div class="basic-info-view"> <el-row> - <el-col v-if="isUnflod" :span="24"> + <!-- <el-col v-if="isUnflod" :span="24"> <el-form-item label="瀹氫綅" prop="position"> <el-input v-model="editConfig.infomation.position" @@ -166,34 +210,78 @@ <el-form-item label="鍦板浘" prop="map"> <div style="height: 100px"></div> </el-form-item> - </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鍥藉" prop="country"> - <CommonSelectView :common-value="editConfig.infomation.country" :common-options="countryOptions" /> + </el-col> --> + <el-col :span="12"> + <el-form-item label="鍥藉" prop="country_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.country_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in countryOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鐪佷唤" prop="province"> - <CommonSelectView :common-value="editConfig.infomation.province" :common-options="provinceOptions" /> + <el-col :span="12"> + <el-form-item label="鐪佷唤" prop="province_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.province_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in provinceOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鍩庡競" prop="city"> - <CommonSelectView :common-value="editConfig.infomation.city" :common-options="cityOptions" /> + <el-col :span="12"> + <el-form-item label="鍩庡競" prop="city_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.city_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in cityOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> - <el-form-item label="鍖哄煙" prop="region"> - <CommonSelectView :common-value="editConfig.infomation.region" :common-options="regionOptions" /> + <el-col :span="12"> + <el-form-item label="鍖哄煙" prop="region_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.region_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in regionOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="璇︾粏鍦板潃" prop="address"> + <el-form-item label="璇︾粏鍦板潃" prop="detail_address"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.address" + v-model="editConfig.infomation.detail_address" ></el-input> </el-form-item> </el-col> @@ -201,24 +289,58 @@ </div> <!-- 宸ュ晢淇℃伅 --> <div v-if="isUnflod" class="basic-info-title">宸ュ晢淇℃伅</div> - <div v-if="isUnflod" class="address-view"> + <div v-if="isUnflod" class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鎵�灞炶涓�" prop="industry"> - <CommonSelectView :common-value="editConfig.infomation.industry" :common-options="industryOptions" /> + <el-form-item label="鎵�灞炶涓�" prop="industry_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.industry_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in industryOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍏徃鎬ц川" prop="companyNature"> - <CommonSelectView - :common-value="editConfig.infomation.companyNature" - :common-options="companyNatureOptions" - /> + <el-form-item label="鍏徃鎬ц川" prop="enterprise_nature_id"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.enterprise_nature_id" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option + v-for="item in enterpriseNatureOptions" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> - <el-col :span="12"> + <!-- <el-col :span="12"> <el-form-item label="鍏徃缃戝潃" prop="companyWeb"> <el-input v-model="editConfig.infomation.companyWeb"></el-input> + </el-form-item> + </el-col> --> + <el-col :span="24"> + <el-form-item label="缁忚惀鑼冨洿" prop="business_scope"> + <el-input + type="textarea" + :autosize="{ minRows: 2, maxRows: 4 }" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="editConfig.infomation.business_scope" + ></el-input> </el-form-item> </el-col> </el-row> @@ -228,12 +350,12 @@ <div v-if="isUnflod" class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="澶囨敞" prop="notes"> + <el-form-item label="澶囨敞" prop="remark"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.notes" + v-model="editConfig.infomation.remark" ></el-input> </el-form-item> </el-col> @@ -275,7 +397,7 @@ </div> </el-form> <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> </div> </el-dialog> @@ -283,9 +405,8 @@ </template> <script> -import CommonSelectView from "@/components/makepager/CommonSelectView" import { getAllData } from "@/api/client/client" -import { getAddSubOrder, getUpdateSubOrder } from "@/api/sales/subOrder" +import { getAddServiceFeeManage, getUpdateServiceFeeManage } from "@/api/serviceManage/serviceFeeManage" export default { name: "AddServiceFeeManageDialog", props: { @@ -300,56 +421,32 @@ } } }, - components: { CommonSelectView }, + components: {}, computed: {}, data() { return { dialogWidth: "80%", editConfig: this.editCommonConfig, rules: { - customName: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }], - serviceCharger: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - customStatus: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] + name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }], + member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], + client_status_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] }, - serviceChargerOptions: [ - // 鏈嶅姟鏀惰垂浜� - { value: "1", label: "BOSS" }, - { value: "2", label: "Mia" }, - { value: "3", label: "璐㈠姟" }, - { value: "4", label: "甯傚満" }, - { value: "5", label: "绯荤粺绠$悊鍛�" }, - { value: "6", label: "閿�鍞�" }, - { value: "7", label: "閿�鍞�荤洃" } - ], - customerSizeOptions: [], // 瀹㈡埛瑙勬ā - customStatusOptions: [], // 瀹㈡埛鐘舵�� + memberOptions: [], + enterpriseScaleOptions: [], // 瀹㈡埛瑙勬ā + clientStatusOptions: [], // 瀹㈡埛鐘舵�� importantLevelOptions: [], // 閲嶈绾у埆 - customSourceOptions: [], // 瀹㈡埛鏉ユ簮 - customTypeOptions: [], // 瀹㈡埛绫诲瀷 - serviceAgentOptions: [], // 鏈嶅姟浠h〃 + clientSourceOptions: [], // 瀹㈡埛鏉ユ簮 + clientTypeOptions: [], // 瀹㈡埛绫诲瀷 + serviceMemberOptions: [], // 鏈嶅姟浠h〃 industryOptions: [], // 鎵�灞炶涓� - companyNatureOptions: [], // 鍏徃鎬ц川 + enterpriseNatureOptions: [], // 鍏徃鎬ц川 - countryOptions: [{ value: "1", label: "涓浗" }], // 鍥藉 - provinceOptions: [ - { value: "1", label: "鍖椾含甯�" }, - { value: "2", label: "涓婃捣甯�" }, - { value: "3", label: "鍚夋灄鐪�" }, - { value: "4", label: "闄曡タ鐪�" } - ], // 鐪佷唤 - cityOptions: [ - { value: "1", label: "鍖椾含甯�" }, - { value: "2", label: "涓婃捣甯�" }, - { value: "3", label: "鍚夋灄甯�" }, - { value: "4", label: "瑗垮畨甯�" } - ], // 鍩庡競 - regionOptions: [ - { value: "1", label: "鏈濋槼鍖�" }, - { value: "2", label: "娴锋穩鍖�" }, - { value: "3", label: "閫氬窞鍖�" }, - { value: "4", label: "瑗垮煄鍖�" } - ], // 鍖哄煙 + countryOptions: [], // 鍥藉 + provinceOptions: [], // 鐪佷唤 + cityOptions: [], // 鍩庡競 + regionOptions: [], // 鍖哄煙 unflodCollapseStr: "鏀惰捣", isUnflod: true } @@ -362,6 +459,17 @@ getAllData() .then((res) => { this.memberOptions = res.data.member + this.serviceMemberOptions = res.data.member + this.clientSourceOptions = res.data.client_origin + this.clientStatusOptions = res.data.client_status + this.importantLevelOptions = res.data.client_level + this.enterpriseScaleOptions = res.data.enterprise_scale + this.clientTypeOptions = res.data.client_type + this.enterpriseNatureOptions = res.data.enterprise_nature + this.countryOptions = res.data.country + this.provinceOptions = res.data.province + this.cityOptions = res.data.city + this.regionOptions = res.data.region }) .catch((err) => { console.log(err) @@ -374,8 +482,9 @@ console.log(this.editConfig.infomation) const params = this.saveParams() console.log(params) + console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddSubOrder(params) + getAddServiceFeeManage(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -391,7 +500,7 @@ console.log(err) }) } else { - getUpdateSubOrder(params) + getUpdateServiceFeeManage(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -417,21 +526,48 @@ let data = this.editConfig.infomation let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - clientId: data.clientId || 0, - masterOrderId: data.masterOrderId || 0, - memberId: data.memberId || 0, + business_scope: data.business_scope || "", + city_id: parseInt(data.city_id) || 0, + client_level_id: parseInt(data.client_level_id) || 0, + client_origin_id: parseInt(data.client_origin_id) || 0, + client_status_id: parseInt(data.client_status_id) || 0, + client_type_id: parseInt(data.client_type_id) || 0, + contact: { + birthday: "", + city_id: 0, + client_id: 0, + country_id: 0, + desc: "", + email: data.contact_email || "", + is_first: true, + member_id: 0, + name: data.contact_name || "", + number: "", + phone: data.contact_phone || "", + position: data.position || "", + province_id: 0, + region_id: 0, + wechat: "" + }, + country_id: 0, + detail_address: data.detail_address || "", + enterprise_nature_id: data.enterprise_nature_id || 0, + enterprise_scale_id: data.enterprise_scale_id || 0, + file: data.file || "", + industry_id: data.industry_id || 0, + latest_date: data.latest_date || "", + latest_service_time: data.latest_service_time || "", + member_id: parseInt(data.member_id) || 0, + name: data.name || "", + next_visit_time: data.next_visit_time || "", number: data.number || "", - product: [ - { - amount: 0, - desc: "", - id: 0, - name: "", - number: "", - price: 0, - total: 0 - } - ] + province_id: 0, + region_id: 0, + registered_capital_id: data.registered_capital_id || 0, + registration_time: data.registration_time || "", + remark: data.remark || "", + representative: data.representative || "", + service_member_id: data.service_member_id || 0 } return params }, @@ -479,10 +615,17 @@ font-size: 18px; } } - } - .address-view { - margin-top: 10px; - padding-right: 40px; + .common-select { + display: flex; + .common-select-sel { + width: 270px; + } + .common-select-btn { + margin-left: 5px; + font-size: 16px; + cursor: pointer; + } + } } .annex-view { display: flex; diff --git a/src/views/service/serviceFeeManage/index.vue b/src/views/service/serviceFeeManage/index.vue index e7c1a98..373db5b 100644 --- a/src/views/service/serviceFeeManage/index.vue +++ b/src/views/service/serviceFeeManage/index.vue @@ -11,12 +11,13 @@ /> <PagerView class="page" /> </div> - <TableCommonView ref="tableListRef" :table-list="tableList"> + <TableCommonView ref="tableListRef" :table-list="tableList" @getSelectArray="getSelectArray"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="100"> + <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> </template> </el-table-column> </template> @@ -28,7 +29,7 @@ <script> import AddServiceFeeManageDialog from "@/views/service/serviceFeeManage/AddServiceFeeManageDialog" -import { getServiceFeeManageList } from "@/api/serviceManage/serviceFeeManage" +import { getServiceFeeManageList, getDelServiceFeeManage } from "@/api/serviceManage/serviceFeeManage" export default { name: "ServiceFeeManage", @@ -80,17 +81,17 @@ this.tableList = { tableInfomation: [], tableColumn: [ - { label: "瀹㈡埛鍚嶇О", prop: "client", min: 120 }, // 瀹㈡埛鍚嶇О - { label: "瀹㈡埛绫诲瀷", prop: "customType", min: 90, status: true }, // 瀹㈡埛绫诲瀷 + { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 120 }, // 瀹㈡埛鍚嶇О + { label: "瀹㈡埛绫诲瀷", prop: "client_type", min: 90 }, // 瀹㈡埛绫诲瀷 { label: "閿�鍞礋璐d汉", prop: "member_id" }, // 閿�鍞礋璐d汉 - { label: "淇敼鏃堕棿", prop: "modifyTime", min: 100 }, // 淇敼鏃堕棿 - { label: "瀹㈡埛瑙勬ā", prop: "customerSize" }, // 瀹㈡埛瑙勬ā - { label: "閲嶈绾у埆", prop: "importantLevel" }, // 閲嶈绾у埆 + // { label: "淇敼鏃堕棿", prop: "modifyTime", min: 100 }, // 淇敼鏃堕棿 + { label: "瀹㈡埛瑙勬ā", prop: "enterprise_scale_id" }, // 瀹㈡埛瑙勬ā + { label: "閲嶈绾у埆", prop: "client_level_id" }, // 閲嶈绾у埆 { label: "瀹㈡埛缂栧彿", prop: "client_id" }, // 瀹㈡埛缂栧彿 - { label: "瀹㈡埛鐘舵��", prop: "customStatus" }, // 瀹㈡埛鐘舵�� + { label: "瀹㈡埛鐘舵��", prop: "client_status_id" }, // 瀹㈡埛鐘舵�� { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О - { label: "鏈嶅姟寮�濮嬫棩鏈�", prop: "startDate" }, // 鏈嶅姟寮�濮嬫棩鏈� - { label: "鏈嶅姟鍒版湡鏃�", prop: "latest_date" } // 鏈嶅姟鍒版湡鏃� + // { label: "鏈嶅姟寮�濮嬫棩鏈�", prop: "startDate", isTime: true, width: 150 }, // 鏈嶅姟寮�濮嬫棩鏈� + { label: "鏈嶅姟鍒版湡鏃�", prop: "latest_date", isTime: true, width: 160 } // 鏈嶅姟鍒版湡鏃� ] } this.searchOptions = [] @@ -109,7 +110,12 @@ if (res.data.list && res.data.list.length > 0) { const list = res.data.list.map((item) => { return { - ...item + ...item, + client_name: item.client ? item.client.name : item.client_id, + client_type: item.client ? item.client.client_type_id : "", // item.client.client_type.name : item.client_type_id + enterprise_scale_id: item.client ? item.client.enterprise_scale_id : "", + client_level_id: item.client ? item.client.client_level_id : "", + client_status_id: item.client ? item.client.client_status_id : "" } }) this.tableList.tableInfomation = list || [] @@ -131,68 +137,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - serviceCharger: "", - customNumber: "", - customerSize: "", - customStatus: "", - importantLevel: "", - customType: "", - customSource: "", - serviceAgent: "", - latestServiceDate: "", - contactName: "", - duties: "", - phoneNumber: "", - contactsEmail: "", - operateRange: "", - position: "", - map: "", - country: "1", - province: "1", - city: "1", - region: "1", - address: "", - industry: "", - companyNature: "", - companyWeb: "", - notes: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - customName: "", - serviceCharger: "", - customNumber: "", - customerSize: "", - customStatus: "", - importantLevel: "", - customType: "", - customSource: "", - serviceAgent: "", - latestServiceDate: "", - contactName: "", - duties: "", - phoneNumber: "", - contactsEmail: "", - operateRange: "", - position: "", - map: "", - country: "1", - province: "1", - city: "1", - region: "1", - address: "", - industry: "", - companyNature: "", - companyWeb: "", - notes: "" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelServiceFeeManage({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } diff --git a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue index 22cbcf8..352ffbf 100644 --- a/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue +++ b/src/views/service/serviceFollowup/AddServiceFollowupDialog.vue @@ -22,23 +22,23 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="customName"> + <el-form-item label="瀹㈡埛鍚嶇О" prop="clientId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.customName"></el-input> + <el-input v-model="editConfig.infomation.clientId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍥炶鍗曠紪鍙�" prop="followupNumber"> - <el-input v-model="editConfig.infomation.followupNumber"></el-input> + <el-form-item label="鍥炶鍗曠紪鍙�" prop="number"> + <el-input v-model="editConfig.infomation.number"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="contactName"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contactId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.contactName"></el-input> + <el-input v-model="editConfig.infomation.contactId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> @@ -54,17 +54,17 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍥炶浜�" prop="visitor"> - <el-select v-model="editConfig.infomation.visitor" size="mini"> - <el-option v-for="item in visitorOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="鍥炶浜�" prop="memberId"> + <el-select v-model="editConfig.infomation.memberId" size="mini"> + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="椤圭洰璁″垝" prop="projectPlan"> + <el-form-item label="椤圭洰璁″垝" prop="planId"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.projectPlan"></el-input> + <el-input v-model="editConfig.infomation.planId"></el-input> <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> </div> @@ -72,39 +72,74 @@ </el-col> <el-col :span="12"> <el-form-item label="婊℃剰搴�" prop="satisfaction"> - <CommonSelectView - :common-value="editConfig.infomation.satisfaction" - :common-options="satisfactionOptions" - /> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.satisfaction" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in satisfactionOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="鍙婃椂鐜�" prop="timelyRate"> - <CommonSelectView - :common-value="editConfig.infomation.timelyRate" - :common-options="satisfactionOptions" - /> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.timelyRate" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in timelyRateOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="瑙e喅鐜�" prop="resolveRate"> - <CommonSelectView - :common-value="editConfig.infomation.resolveRate" - :common-options="satisfactionOptions" - /> + <el-form-item label="瑙e喅鐜�" prop="solveRate"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.solveRate" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in solveRateOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍘熸湇鍔′汉鍛�" prop="originServicePerson"> - <el-select v-model="editConfig.infomation.originServicePerson" size="mini"> - <el-option v-for="item in visitorOptions" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="鍘熸湇鍔′汉鍛�" prop="oldMemberId"> + <el-select v-model="editConfig.infomation.oldMemberId" size="mini"> + <el-option v-for="item in oldMemberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="haveBeen"> - <CommonSelectView :common-value="editConfig.infomation.haveBeen" :common-options="haveBeenOptions" /> + <el-form-item label="鏈嶅姟浜哄憳鏄惁鏉ヨ繃" prop="isVisit"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.isVisit" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + > + <el-option v-for="item in isVisitOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> </el-row> @@ -114,12 +149,12 @@ <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="澶囨敞" prop="notes"> + <el-form-item label="澶囨敞" prop="remark"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.notes" + v-model="editConfig.infomation.remark" ></el-input> </el-form-item> </el-col> @@ -156,7 +191,7 @@ </el-form> <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> </div> </el-dialog> @@ -164,9 +199,8 @@ </template> <script> -import CommonSelectView from "@/components/makepager/CommonSelectView" import { getAllData } from "@/api/client/client" -import { getAddSubOrder, getUpdateSubOrder } from "@/api/sales/subOrder" +import { getAddServiceFollowup, getUpdateServiceFollowup } from "@/api/serviceManage/serviceFollowup" export default { name: "AddServiceFollowupDialog", props: { @@ -176,25 +210,12 @@ return { visible: false, title: "鏂板缓", - infomation: { - customName: "", - followupNumber: "HF21", - contactName: "", - customServiceForm: "", - visitor: "", - projectPlan: "", - satisfaction: "", - timelyRate: "", - resolveRate: "", - originServicePerson: "", - haveBeen: "", - notes: "" - } + infomation: {} } } } }, - components: { CommonSelectView }, + components: {}, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -205,16 +226,15 @@ dialogWidth: "80%", editConfig: this.editCommonConfig, rules: { - followupNumber: [{ required: true, message: "璇疯緭鍏ュ洖璁垮崟鍗曠紪鍙�", trigger: "blur" }], - visitor: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] + number: [{ required: true, message: "璇疯緭鍏ュ洖璁垮崟鍗曠紪鍙�", trigger: "blur" }], + memberId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] }, - satisfactionOptions: [], // 婊℃剰搴� 鍙婃椂鐜� 瑙e喅鐜� - haveBeenOptions: [], // 鏈嶅姟浜哄憳鏄惁鏉ヨ繃 - visitorOptions: [ - // 鍥炶浜� - { value: "1", label: "绯荤粺绠$悊鍛�" }, - { value: "2", label: "閿�鍞�荤洃" } - ] + satisfactionOptions: [], // 婊℃剰搴� + timelyRateOptions: [], // 鍙婃椂鐜� + solveRateOptions: [], // 瑙e喅鐜� + oldMemberOptions: [], // 鍘熸湇鍔′汉鍛� + isVisitOptions: [], // 鏈嶅姟浜哄憳鏄惁鏉ヨ繃 + memberOptions: [] } }, created() { @@ -238,7 +258,7 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddSubOrder(params) + getAddServiceFollowup(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -254,7 +274,7 @@ console.log(err) }) } else { - getUpdateSubOrder(params) + getUpdateServiceFollowup(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -281,20 +301,18 @@ let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, clientId: data.clientId || 0, - masterOrderId: data.masterOrderId || 0, + contactId: data.contactId || 0, + file: data.file || "", + isVisit: data.isVisit || 0, memberId: data.memberId || 0, number: data.number || "", - product: [ - { - amount: 0, - desc: "", - id: 0, - name: "", - number: "", - price: 0, - total: 0 - } - ] + oldMemberId: data.oldMemberId || 0, + planId: data.planId || 0, + remark: data.remark || "", + satisfaction: data.satisfaction || 0, + serviceId: data.serviceId || 0, + solveRate: data.solveRate || 0, + timelyRate: data.timelyRate || 0 } return params }, @@ -332,10 +350,17 @@ font-size: 18px; } } - } - .address-view { - margin-top: 10px; - padding-right: 40px; + .common-select { + display: flex; + .common-select-sel { + width: 270px; + } + .common-select-btn { + margin-left: 5px; + font-size: 16px; + cursor: pointer; + } + } } .annex-view { display: flex; diff --git a/src/views/service/serviceFollowup/index.vue b/src/views/service/serviceFollowup/index.vue index 2947b71..051176c 100644 --- a/src/views/service/serviceFollowup/index.vue +++ b/src/views/service/serviceFollowup/index.vue @@ -7,9 +7,10 @@ </div> <TableCommonView ref="tableListRef" :table-list="tableList"> <template slot="tableButton"> - <el-table-column label="鎿嶄綔" width="60"> + <el-table-column label="鎿嶄綔" width="90"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> </template> </el-table-column> </template> @@ -21,7 +22,7 @@ <script> import AddServiceFollowupDialog from "@/views/service/serviceFollowup/AddServiceFollowupDialog" -import { getServiceFollowupList } from "@/api/serviceManage/serviceFollowup" +import { getServiceFollowupList, getDelServiceFollowup } from "@/api/serviceManage/serviceFollowup" export default { name: "SalesLead", @@ -70,8 +71,8 @@ { label: "鑱旂郴浜哄鍚�", prop: "contactId" }, // 鑱旂郴浜哄鍚� { label: "瀹㈡埛鏈嶅姟鍗�", prop: "serviceId" }, // 瀹㈡埛鏈嶅姟鍗� { label: "鍥炶浜�", prop: "isVisit" }, // 鍥炶浜� - { label: "婊℃剰搴�", prop: "satisfaction" }, // 婊℃剰搴� - { label: "淇敼鏃堕棿", prop: "modifyTime" } // 淇敼鏃堕棿 + { label: "婊℃剰搴�", prop: "satisfaction" } // 婊℃剰搴� + // { label: "淇敼鏃堕棿", prop: "modifyTime" } // 淇敼鏃堕棿 ] } this.searchOptions = [] @@ -112,40 +113,37 @@ addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" - this.editConfig.infomation = { - customName: "", - followupNumber: "HF21", - contactName: "", - customServiceForm: "", - visitor: "", - projectPlan: "", - satisfaction: "", - timelyRate: "", - resolveRate: "", - originServicePerson: "", - haveBeen: "", - notes: "" - } + this.editConfig.infomation = {} }, // 缂栬緫 handleClick(row) { console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { - customName: "", - followupNumber: "HF21", - contactName: "", - customServiceForm: "", - visitor: "", - projectPlan: "", - satisfaction: "", - timelyRate: "", - resolveRate: "", - originServicePerson: "", - haveBeen: "", - notes: "" - } + this.editConfig.infomation = { ...row } + }, + // 鍒犻櫎 + delClick(id) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(function () { + return getDelServiceFollowup({ id: id }) + }) + .then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getUserList() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + .catch(function () {}) + }, + getSelectArray(val) { + console.log(val) } } } -- Gitblit v1.8.0