From acdff03246ce648082192dfb069c3a006a7fbee6 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 09 八月 2023 18:46:06 +0800 Subject: [PATCH] 客户管理模块 批量删除、推进、跟进接口联调 --- src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue | 590 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 433 insertions(+), 157 deletions(-) diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue index 3247a53..d1571bf 100644 --- a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue +++ b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue @@ -28,52 +28,60 @@ <div class="custom-name"> <el-autocomplete v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'client') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('client', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div class="common-select-btn" @click="selClientClick('client')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient"> + <div class="common-select-btn" @click="clearupClient('client')"> <i class="el-icon-edit-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鍗曠紪鍙�" prop="number"> - <el-input v-model="editConfig.infomation.number"></el-input> + <el-form-item label="鏈嶅姟鍗曠紪鍙�" prop="serviceNumber"> + <el-input v-model="editConfig.infomation.serviceNumber"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鍚堝悓" prop="name"> + <el-form-item label="鏈嶅姟鍚堝悓"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" - value-key="name" - @select="handleSelectClient" + v-model="editConfig.infomation.service_number" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'serviceContract') + } + " + value-key="number" + @select="handleSelectClient('serviceContract', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div class="common-select-btn" @click="selClientClick('serviceContract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient"> + <div class="common-select-btn" @click="clearupClient('serviceContract')"> <i class="el-icon-edit-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏁呴殰绫诲埆" prop="orderType"> + <el-form-item label="鏁呴殰绫诲埆" prop="faultTypeId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.orderType" + v-model="editConfig.infomation.faultTypeId" 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 v-for="item in faultTypeOptions" :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> @@ -81,38 +89,47 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="涓婚" prop="contactId"> - <el-input v-model="editConfig.infomation.contactId"></el-input> + <el-form-item label="涓婚" prop="subject"> + <el-input v-model="editConfig.infomation.subject"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鍚堝悓璁㈠崟" prop="name"> + <el-form-item label="鍚堝悓璁㈠崟"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" - value-key="name" - @select="handleSelectClient" + v-model="editConfig.infomation.number" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'contract') + } + " + value-key="number" + @select="handleSelectClient('contract', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div class="common-select-btn" @click="selClientClick('contract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient"> + <div class="common-select-btn" @click="clearupClient('contract')"> <i class="el-icon-edit-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="浜у搧绫诲埆" prop="orderType"> + <el-form-item label="浜у搧绫诲埆" prop="productCategory"> <div class="common-select"> <el-select - v-model="editConfig.infomation.orderType" + v-model="editConfig.infomation.productCategory" 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 + v-for="item in productCategoryOptions" + :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> @@ -120,33 +137,38 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="浜у搧鍚嶇О" prop="name"> + <el-form-item label="浜у搧鍚嶇О" prop="product_name"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + v-model="editConfig.infomation.product_name" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'productName') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('productName', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div class="common-select-btn" @click="selClientClick('productName')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient"> + <div class="common-select-btn" @click="clearupClient('productName')"> <i class="el-icon-edit-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟鏂瑰紡" prop="orderType"> + <el-form-item label="鏈嶅姟鏂瑰紡" prop="serviceTypeId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.orderType" + v-model="editConfig.infomation.serviceTypeId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + @focus="getServiceTypeList" > - <el-option v-for="item in orderTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option v-for="item in serviceTypeOptions" :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> @@ -154,15 +176,20 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鏈嶅姟浜哄憳" prop="orderType"> + <el-form-item label="鏈嶅姟浜哄憳" prop="serviceManId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.orderType" + v-model="editConfig.infomation.serviceManId" 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 + v-for="item in serviceManOptions" + :key="item.id" + :label="item.username" + :value="item.id" + > </el-option> </el-select> </div> @@ -172,30 +199,35 @@ <el-form-item label="鑱旂郴浜哄鍚�" prop="client_name"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + v-model="editConfig.infomation.contact_name" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'contact') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('contact', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div class="common-select-btn" @click="selClientClick('contact')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient"> + <div class="common-select-btn" @click="clearupClient('contact')"> <i class="el-icon-edit-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="涓ラ噸绋嬪害" prop="reportSourceId"> + <el-form-item label="涓ラ噸绋嬪害" prop="severity"> <div class="common-select"> <el-select - v-model="editConfig.infomation.reportSourceId" + v-model="editConfig.infomation.severity" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + @focus="getSeverityList" > - <el-option v-for="item in reportSourceOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option v-for="item in severityOptions" :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> @@ -203,25 +235,31 @@ </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="涓婇棬鍦板潃" prop="problemDescription"> + <el-form-item label="涓婇棬鍦板潃" prop="address"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" + v-model="editConfig.infomation.address" ></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="浼樺厛绾у埆" prop="reportSourceId"> + <el-form-item label="浼樺厛绾у埆" prop="priorityLevelId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.reportSourceId" + v-model="editConfig.infomation.priorityLevelId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + @focus="getPriorityLevelList" > - <el-option v-for="item in reportSourceOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option + v-for="item in priorityLevelOptions" + :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> @@ -229,8 +267,12 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="棰勭害涓婇棬鏃堕棿" prop="startTime"> - <el-date-picker v-model="editConfig.infomation.startTime" type="datetime" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="棰勭害涓婇棬鏃堕棿" prop="appointmentTime"> + <el-date-picker + v-model="editConfig.infomation.appointmentTime" + type="datetime" + placeholder="閫夋嫨鏃ユ湡" + > </el-date-picker> </el-form-item> </el-col> @@ -238,16 +280,20 @@ <el-form-item label="閿�鍞満浼�" prop="client_name"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + v-model="editConfig.infomation.sale_chance_name" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'chance') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('chance', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> - <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> + <div class="common-select-btn" @click="selClientClick('chance')"> + <i class="el-icon-circle-plus-outline"></i> </div> - <div class="common-select-btn" @click="clearupClient"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div class="common-select-btn" @click="clearupClient('chance')"> + <i class="el-icon-edit-outline"></i> </div> </div> </el-form-item> @@ -259,37 +305,15 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="甯屾湜澶勭悊鏃堕棿" prop="startTime"> - <el-date-picker v-model="editConfig.infomation.startTime" type="datetime" placeholder="閫夋嫨鏃ユ湡"> - </el-date-picker> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="瀹為檯澶勭悊鏃堕棿" prop="startTime"> - <el-date-picker v-model="editConfig.infomation.startTime" type="datetime" placeholder="閫夋嫨鏃ユ湡"> - </el-date-picker> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="浜ら�氳垂" prop="reportSourceId"> - <el-input v-model="editConfig.infomation.problemDescription"></el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="鏀惰垂閲戦" prop="reportSourceId"> - <el-input v-model="editConfig.infomation.problemDescription"></el-input> - </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="鑺辫垂鏃堕棿" prop="reportSourceId"> + <el-form-item label="澶勭悊鐘舵��" prop="status"> <div class="common-select"> <el-select - v-model="editConfig.infomation.reportSourceId" + v-model="editConfig.infomation.status" 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 v-for="item in statusOptions" :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> @@ -303,24 +327,48 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="甯歌闂" prop="problemDescription"> - <el-input v-model="editConfig.infomation.problemDescription"></el-input> + <el-form-item label="甯屾湜澶勭悊鏃堕棿" prop="expectTime"> + <el-date-picker v-model="editConfig.infomation.expectTime" type="datetime" placeholder="閫夋嫨鏃堕棿"> + </el-date-picker> </el-form-item> </el-col> - <el-col :span="24"> - <el-form-item label="闂鎻忚堪" prop="problemDescription"> - <el-input - type="textarea" - :autosize="{ minRows: 2, maxRows: 4 }" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" - ></el-input> + <el-col :span="12"> + <el-form-item label="瀹為檯澶勭悊鏃堕棿" prop="realTime"> + <el-date-picker v-model="editConfig.infomation.startTime" type="realTime" placeholder="閫夋嫨鏃堕棿"> + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="浜ら�氳垂" prop="carFare"> + <el-input v-model="editConfig.infomation.carFare"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏀惰垂閲戦" prop="chargeAmount"> + <el-input v-model="editConfig.infomation.chargeAmount"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鑺辫垂鏃堕棿" prop="timeSpentId"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.timeSpentId" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + @focus="getTimeSpentList" + > + <el-option v-for="item in timeSpentOptions" :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + <div class="common-select-btn"><i class="el-icon-setting"></i></div> + </div> </el-form-item> </el-col> </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="24"> @@ -334,23 +382,23 @@ </el-form-item> </el-col> </el-row> - </div> + </div> --> <!-- 闂鎻忚堪 --> <div class="basic-info-title">闂鎻忚堪</div> <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="甯歌闂" prop="problemDescription"> - <el-input v-model="editConfig.infomation.problemDescription"></el-input> + <el-form-item label="甯歌闂" prop="faqId"> + <el-input v-model="editConfig.infomation.faqId"></el-input> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="闂鎻忚堪" prop="problemDescription"> + <el-form-item label="闂鎻忚堪" prop="problemDesc"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" + v-model="editConfig.infomation.problemDesc" ></el-input> </el-form-item> </el-col> @@ -361,22 +409,22 @@ <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="瑙e喅鏂规硶" prop="problemDescription"> + <el-form-item label="瑙e喅鏂规硶" prop="solution"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" + v-model="editConfig.infomation.solution" ></el-input> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="鍐呴儴澶囨敞" prop="problemDescription"> + <el-form-item label="鍐呴儴澶囨敞" prop="solutionRemark"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" + v-model="editConfig.infomation.solutionRemark" ></el-input> </el-form-item> </el-col> @@ -387,19 +435,19 @@ <div class="basic-info-view"> <el-row> <el-col :span="24"> - <el-form-item label="澶囨敞" prop="problemDescription"> + <el-form-item label="澶囨敞" prop="remark"> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.problemDescription" + v-model="editConfig.infomation.remark" ></el-input> </el-form-item> </el-col> </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="12"> @@ -424,7 +472,7 @@ </el-form-item> </el-col> </el-row> - </div> + </div> --> <!-- 瀹㈡埛鏈嶅姟鍗曞巻鍙茶褰� --> <div v-if="editConfig.title === '缂栬緫'" class="basic-info"> <div class="basic-info-label" @click="expandClick('record')"> @@ -472,15 +520,45 @@ :edit-common-config="editSelectClientConfig" @selClient="selClient" /> + <!-- 閫夋嫨鏈嶅姟鍚堝悓 --> + <SelectCommonDialog + v-if="editSelCommonConfig.editVisible" + :edit-common-config="editSelCommonConfig" + @selClient="selClient" + /> + <!-- 閫夋嫨鑱旂郴浜� --> + <SelectContactDialog + v-if="editSelectContactConfig.editVisible" + :edit-common-config="editSelectContactConfig" + @selClient="selClient" + /> + <!-- 閫夋嫨閿�鍞満浼� --> + <SelectChanceDialog + v-if="editSelectChanceConfig.editVisible" + :edit-common-config="editSelectChanceConfig" + @selClient="selClient" + /> </el-dialog> </div> </template> <script> import { getAllData } from "@/api/client/client" -import { getAddOrderManage, getUpdateOrderManage } from "@/api/serviceManage/orderManage" +import { getAddServiceOrder, getUpdateServiceOrder } from "@/api/serviceManage/clientServiceOrder" import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" import pageMixin from "@/components/makepager/pager/mixin/pageMixin" +import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" +import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog" +import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog" +import { + getFaultTypeList, + getServiceTypeList, + getSeverityList, + getPriorityLevelList, + getTimeSpentList +} from "@/api/common/other" +import Status from "@/common/const/commonStatus" + export default { name: "AddClientServiceOrderDialog", mixins: [pageMixin], @@ -496,13 +574,22 @@ } } }, - components: { SelectClientDialog }, + components: { SelectClientDialog, SelectCommonDialog, SelectContactDialog, SelectChanceDialog }, computed: { clientList() { return this.$store.state.getClientName.clientList }, - searchCommonHeight() { - return this.$refs.searchCommonView.offsetHeight + serviceContractList() { + return this.$store.state.getClientName.serviceContractList + }, + salesDetailsList() { + return this.$store.state.getClientName.salesDetailsList + }, + contactNamelist() { + return this.$store.state.getClientName.contactNamelist + }, + saleChancelist() { + return this.$store.state.getClientName.saleChancelist } }, data() { @@ -510,18 +597,26 @@ dialogWidth: "80%", editConfig: this.editCommonConfig, rules: { - clientId: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }], - number: [{ required: true, message: "璇疯緭鍏ュ伐鍗曠紪鍙�", trigger: "blur" }], - orderType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - problemDescription: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] + serviceNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″崟缂栧彿", trigger: "blur" }], + faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], + subject: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }], + productCategory: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], + serviceManId: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], + status: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], + problemDesc: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] }, - orderTypeOptions: [{ id: 1, name: "绫诲瀷1" }], // 宸ュ崟绫诲瀷 - reportSourceOptions: [], // 鎶ヤ慨鏉ユ簮 - // sourceSheetOptions: [ - // { value: "1", label: "閿�鍞槑缁嗗崟" }, - // { value: "2", label: "鏈嶅姟鍚堝悓" } - // ], - approvalWorkflowOptions: [], // 瀹℃壒娴佺▼ + faultTypeOptions: [{ id: 1, name: "鏈嶅姟鍥炶" }], // 鏁呴殰绫诲埆 + productCategoryOptions: [ + { id: 1, name: "ERP杩蜂綘鐗�" }, + { id: 2, name: "ERP涓撲笟鐗�-璐㈠姟妯″潡" } + ], // 浜у搧绫诲埆 + productNameList: [], // 浜у搧鍚嶇О + serviceTypeOptions: [], // 鏈嶅姟鏂瑰紡 + serviceManOptions: [], // 鏈嶅姟浜哄憳 + severityOptions: [], // 涓ラ噸绋嬪害 + priorityLevelOptions: [], // 浼樺厛绾у埆 + statusOptions: Status.processStatus, // 澶勭悊鐘舵�� + timeSpentOptions: [], // 鑺辫垂鏃堕棿 editSelectClientConfig: { editVisible: false, title: "", @@ -540,7 +635,28 @@ currPage: 1, pageSize: 5, totalCount: 0 - } + }, + editSelCommonConfig: { + editVisible: false, + title: "", + infomation: {} + }, + editSelectContactConfig: { + editVisible: false, + title: "", + infomation: {} + }, + editSelectChanceConfig: { + editVisible: false, + title: "", + infomation: {} + }, + clientId: this.editCommonConfig.infomation.clientId, + contactId: this.editCommonConfig.infomation.contactId, + serviceContractId: this.editCommonConfig.infomation.contractId, + contractId: this.editCommonConfig.infomation.orderId, + productNameId: this.editCommonConfig.infomation.productId, + saleChanceId: this.editCommonConfig.infomation.saleChanceId } }, created() { @@ -567,7 +683,7 @@ getAllData() .then((res) => { this.memberOptions = res.data.member - this.orderTypeOptions = res.data.orderType + this.serviceManOptions = res.data.member this.reportSourceOptions = res.data.reportSource }) .catch((err) => { @@ -582,7 +698,7 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddOrderManage(params) + getAddServiceOrder(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -598,7 +714,7 @@ console.log(err) }) } else { - getUpdateOrderManage(params) + getUpdateServiceOrder(params) .then((res) => { console.log(res) this.editConfig.visible = false @@ -623,48 +739,151 @@ saveParams() { let data = this.editConfig.infomation let params = { - id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - clientId: parseInt(data.clientId) || 0, - contactId: data.contactId || 0, - file: data.file || "", - name: data.name || "", - number: data.number || "", - orderType: data.orderType || 0, - problemDescription: data.problemDescription || "", - reportSourceId: data.reportSourceId || 0, - sourceSheet: data.sourceSheet || 0 + address: data.address || "", + appointmentTime: data.appointmentTime || "", + carFare: data.carFare || 0, + chargeAmount: data.chargeAmount || 0, + clientId: this.clientId, + contactId: this.contactId, + contractId: this.serviceContractId, + expectTime: data.expectTime || "", + faqId: data.faqId || 0, + faultTypeId: data.faultTypeId || 0, + id: data.id || 0, + orderId: this.contractId, + priorityLevelId: data.priorityLevelId || 0, + problemDesc: data.problemDesc || "", + productId: this.productNameId, + realTime: data.realTime || "", + remark: data.remark || "", + saleChanceId: this.saleChanceId, + serviceManId: data.serviceManId || 0, + serviceNumber: data.serviceNumber || "", + serviceTypeId: data.serviceTypeId || 0, + severity: data.severity || 0, + solution: data.solution || "", + solutionRemark: data.solutionRemark || "", + status: data.status || 0, + subject: data.subject || "", + timeSpentId: data.timeSpentId || 0 } return params }, handleClose() { this.editConfig.visible = false }, - // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶 - querySearchAsync(queryString, cb) { - var restaurants = this.clientList - var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants + // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶 + querySearchAsync(queryString, cb, value) { + this.$store.dispatch("geServiceContract") + this.$store.dispatch("geSalesDetails") + this.$store.dispatch("geContact") + this.$store.dispatch("geChance") + var restaurants = [] + if (value === "client") { + restaurants = this.clientList + } else if (value === "serviceContract") { + restaurants = this.serviceContractList + } else if (value === "contract") { + restaurants = this.salesDetailsList + } else if (value === "productName") { + restaurants = this.productNameList + } else if (value === "contact") { + restaurants = this.contactNamelist + } else if (value === "chance") { + restaurants = this.saleChancelist + } + var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants cb(results) }, - createStateFilter(queryString) { + createStateFilter(queryString, value) { return (state) => { - return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + if (value === "serviceContract" || value === "contract") { + return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } else { + return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } } }, - handleSelectClient(item) { - this.editConfig.infomation.client_id = item.id + handleSelectClient(value, item) { + if (value === "client") { + this.clientId = item.id + } else if (value === "serviceContract") { + this.serviceContractId = item.id + } else if (value === "contract") { + this.contractId = item.id + } else if (value === "productName") { + this.productCategoryId = item.id + } else if (value === "contact") { + this.contactId = item.id + } else if (value === "chance") { + this.saleChanceId = item.id + } }, - selClientClick() { - this.editSelectClientConfig.editVisible = true + selClientClick(value) { + console.log(value) + if (value === "client") { + this.editSelectClientConfig.editVisible = true + } else if (value === "serviceContract") { + this.editSelCommonConfig.title = "鏈嶅姟鍚堝悓" + this.editSelCommonConfig.editVisible = true + this.editSelCommonConfig.tableInfomation = [...this.serviceContractList] + } else if (value === "contract") { + this.editSelCommonConfig.title = "閿�鍞槑缁嗗崟" + this.editSelCommonConfig.editVisible = true + this.editSelCommonConfig.tableInfomation = [...this.salesDetailsList] + } else if (value === "productName") { + this.editSelCommonConfig.title = "浜у搧鍚嶇О" + this.editSelCommonConfig.editVisible = true + this.editSelCommonConfig.tableInfomation = [...this.productNameList] + } else if (value === "contact") { + this.editSelectContactConfig.editVisible = true + } else if (value === "chance") { + this.editSelectChanceConfig.editVisible = true + } }, - selClient(row) { - console.log(row) - this.editConfig.infomation.client_name = row.name - this.editConfig.infomation.client_id = row.id + selClient(row, value) { + console.log(row, value) + if (value === "contact") { + this.editConfig.infomation.contact_name = row.name + this.contactId = row.id + } else if (value === "client") { + this.editConfig.infomation.client_name = row.name + this.clientId = row.id + } else if (value === "serviceContract") { + this.editConfig.infomation.service_number = row.number + this.serviceContractId = row.id + } else if (value === "contract") { + this.editConfig.infomation.number = row.number + this.contractId = row.id + } else if (value === "productName") { + this.editConfig.infomation.product_name = row.name + this.productNameId = row.id + } else if (value === "chance") { + this.editConfig.infomation.sale_chance_name = row.name + this.saleChanceId = row.id + } }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 - clearupClient() { - this.editConfig.infomation.client_name = "" - this.editConfig.infomation.client_id = 0 + clearupClient(value) { + if (value === "client") { + this.editConfig.infomation.client_name = "" + this.clientId = 0 + } else if (value === "serviceContract") { + this.editConfig.infomation.service_number = "" + this.serviceContractId = 0 + } else if (value === "contract") { + this.editConfig.infomation.number = "" + this.contractId = 0 + } else if (value === "productName") { + this.editConfig.infomation.product_name = "" + this.productNameId = 0 + } else if (value === "contact") { + this.editConfig.infomation.contact_name = "" + this.contactId = 0 + } else if (value === "chance") { + this.editConfig.infomation.sale_chance_name = "" + this.saleChanceId = 0 + } }, // 娣诲姞闄勪欢 addAnnexClick() {}, @@ -678,6 +897,63 @@ } else if (value === "contract") { this.isConttractExpand = !this.isConttractExpand } + }, + // 鏁呴殰绫诲埆 + async getFaultTypeList(e) { + if (e) { + await getFaultTypeList() + .then((res) => { + console.log(res) + this.faultTypeOptions = res.data.data + }) + .catch((err) => { + console.log(err) + }) + } + }, + // 鏈嶅姟鏂瑰紡 + async getServiceTypeList() { + await getServiceTypeList() + .then((res) => { + console.log(res) + this.serviceTypeOptions = res.data.data + }) + .catch((err) => { + console.log(err) + }) + }, + // 涓ラ噸绋嬪害 + async getSeverityList() { + await getSeverityList() + .then((res) => { + console.log(res) + this.severityOptions = res.data.data + }) + .catch((err) => { + console.log(err) + }) + }, + // 浼樺厛绾у埆 + async getPriorityLevelList() { + await getPriorityLevelList() + .then((res) => { + console.log(res) + this.priorityLevelOptions = res.data.data + }) + .catch((err) => { + console.log(err) + }) + }, + // 鑺辫垂鏃堕棿 + async getTimeSpentList() { + await getTimeSpentList() + .then((res) => { + console.log(res) + this.timeSpentOptions = res.data.data + }) + .catch((err) => { + console.log(err) + }) } } } -- Gitblit v1.8.0