From d4f4c52402b91cb8e17c1845da71c5e39662fde0 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 03 一月 2024 15:28:06 +0800 Subject: [PATCH] 销售报价单列表页增加统计内容及接口联调、添加报价单天天客户名称及对应限制功能 --- src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue | 199 +++++++++++++++++++++++++++++++++++-------------- 1 files changed, 141 insertions(+), 58 deletions(-) diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue index 3f433a3..2d04051 100644 --- a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue +++ b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue @@ -13,7 +13,7 @@ :model="editConfig.infomation" :rules="rules" label-position="right" - label-width="308px" + label-width="168px" size="mini" style="height: 60vh; overflow-x: hidden" > @@ -23,6 +23,37 @@ <div class="basic-info-title">鍩烘湰淇℃伅</div> <div class="basic-info-view"> <el-row> + <el-col :span="12"> + <el-form-item label="鏈嶅姟鍗曠紪鍙�" prop="serviceNumber"> + <el-input + v-if=" + editConfig.title == '缂栬緫' || + (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled)) + " + :disabled="editConfig.title == '缂栬緫'" + v-model="editConfig.infomation.serviceNumber" + placeholder="璇疯緭鍏ョ紪鐮�" + > + </el-input> + <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > + <!-- <WordInput + v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" + :codenumer="codenumer" + :sum="sum" + :disabled="editConfig.title !== '鏂板缓' || isIdDisabled" + :inputValue="inputValue" + @codeList="codeList" + /> + <span v-else-if="method == 0" style="color: #f56c6c" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > + <span v-else>{{ + editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.serviceNumber + }}</span> --> + </el-form-item> + </el-col> <el-col :span="12"> <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name"> <div class="custom-name"> @@ -35,6 +66,7 @@ " value-key="name" @select="handleSelectClient('client', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('client')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> @@ -44,16 +76,12 @@ class="common-select-btn" @click="clearupClient('client')" > - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <i class="el-icon-remove-outline" title="娓呴櫎"></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> - </el-col> + <el-col :span="12"> <el-form-item label="鏈嶅姟鍚堝悓"> <div class="custom-name"> @@ -66,6 +94,7 @@ " value-key="number" @select="handleSelectClient('serviceContract', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('serviceContract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> @@ -78,7 +107,7 @@ class="common-select-btn" @click="clearupClient('serviceContract')" > - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> @@ -91,6 +120,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <!-- @focus="getFaultTypeList" --> <el-option v-for="item in faultTypeOptions" :key="item.id" :label="item.name" :value="item.id"> @@ -102,7 +132,7 @@ </el-col> <el-col :span="12"> <el-form-item label="涓婚" prop="subject"> - <el-input v-model="editConfig.infomation.subject"></el-input> + <el-input v-model="editConfig.infomation.subject" style="width: 100%"></el-input> </el-form-item> </el-col> <el-col :span="12"> @@ -117,6 +147,7 @@ " value-key="number" @select="handleSelectClient('contract', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('contract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> @@ -126,7 +157,7 @@ class="common-select-btn" @click="clearupClient('contract')" > - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> @@ -153,27 +184,28 @@ </el-form-item> </el-col> --> <el-col :span="12"> - <el-form-item label="浜у搧鍚嶇О" prop="product_name"> + <el-form-item label="浜у搧鍚嶇О" prop="productName"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.product_name" + v-model="editConfig.infomation.productName" :fetch-suggestions=" (queryString, callback) => { querySearchAsync(queryString, callback, 'productName') } " - value-key="Name" + value-key="name" @select="handleSelectClient('productName', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('productName')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> <div - v-if="editConfig.infomation.product_name && editConfig.infomation.product_name.length > 0" + v-if="editConfig.infomation.productName && editConfig.infomation.productName.length > 0" class="common-select-btn" @click="clearupClient('productName')" > - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> @@ -186,6 +218,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in serviceTypeOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -202,6 +235,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in serviceManOptions" @@ -226,6 +260,7 @@ " value-key="name" @select="handleSelectClient('contact', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('contact')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> @@ -235,35 +270,26 @@ class="common-select-btn" @click="clearupClient('contact')" > - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="涓ラ噸绋嬪害" prop="severity"> + <el-form-item label="涓ラ噸绋嬪害" prop="severityId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.severity" + v-model="editConfig.infomation.severityId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <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> --> </div> - </el-form-item> - </el-col> - <el-col :span="24"> - <el-form-item label="涓婇棬鍦板潃" prop="address"> - <el-input - type="textarea" - :autosize="{ minRows: 2, maxRows: 4 }" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.address" - ></el-input> </el-form-item> </el-col> <el-col :span="12"> @@ -274,6 +300,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in priorityLevelOptions" @@ -293,6 +320,7 @@ v-model="editConfig.infomation.appointmentTime" type="datetime" placeholder="閫夋嫨鏃ユ湡" + style="width: 100%" > </el-date-picker> </el-form-item> @@ -309,6 +337,7 @@ " value-key="name" @select="handleSelectClient('chance', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('chance')"> <i class="el-icon-circle-plus-outline"></i> @@ -318,9 +347,19 @@ class="common-select-btn" @click="clearupClient('chance')" > - <i class="el-icon-edit-outline"></i> + <i class="el-icon-remove-outline"></i> </div> </div> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="涓婇棬鍦板潃" prop="address"> + <el-input + type="textarea" + :autosize="{ minRows: 2, maxRows: 4 }" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="editConfig.infomation.address" + ></el-input> </el-form-item> </el-col> </el-row> @@ -337,6 +376,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -358,6 +398,7 @@ value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="閫夋嫨鏃堕棿" + style="width: 100%" > </el-date-picker> </el-form-item> @@ -369,6 +410,7 @@ value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="閫夋嫨鏃堕棿" + style="width: 100%" > </el-date-picker> </el-form-item> @@ -380,7 +422,7 @@ placeholder="璇疯緭鍏�" :min="0" :controls="false" - style="width: 100%; margin-right: 5px" + style="width: 100%" ></el-input-number> </el-form-item> </el-col> @@ -391,7 +433,7 @@ placeholder="璇疯緭鍏�" :min="0" :controls="false" - style="width: 100%; margin-right: 5px" + style="width: 100%" ></el-input-number> </el-form-item> </el-col> @@ -403,6 +445,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in timeSpentOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -441,6 +484,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in faqOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -614,10 +658,11 @@ getTimeSpentList } from "@/api/common/other" import Status from "@/common/const/commonStatus" +import codeMixin from "./mixin/codeMixin" export default { name: "AddClientServiceOrderDialog", - mixins: [pageMixin], + mixins: [pageMixin, codeMixin], props: { editCommonConfig: { type: Object, @@ -653,14 +698,14 @@ }, data() { return { - dialogWidth: "80%", + dialogWidth: "50%", editConfig: this.editCommonConfig, rules: { - serviceNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″崟缂栧彿", trigger: "blur" }], - // faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], + serviceNumber: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], + client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }], subject: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }], // productCategory: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], - serviceManId: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], + serviceManId: [{ required: true, validator: this.validateMemberId, trigger: "change" }], serviceOrderStatusId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], problemDesc: [{ required: true, message: "璇疯緭鍏ラ棶棰樻弿杩�", trigger: "blur" }] }, @@ -734,8 +779,23 @@ this.getSeverityList() this.getPriorityLevelList() this.getTimeSpentList() + this.formInfo() + }, + watch: { + "editCommonConfig.visible"(val) { + if (val) { + this.formInfo() + } + } }, methods: { + formInfo() { + this.objCode.codeStandID = "" + if (this.editConfig.infomation.codeStandID) { + this.objCode.codeStandID = this.editConfig.infomation.codeStandID + } + this.getRCodeStandardList() + }, setTable() { this.recordTableList = { tableInfomation: [], @@ -752,8 +812,15 @@ }, getCommonData() { getAllData().then((res) => { - this.memberOptions = res.data.member this.serviceManOptions = res.data.member + if (this.editConfig.title === "鏂板缓") { + let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") + this.serviceManOptions.map((item) => { + if (item.username == username) { + this.$set(this.editConfig.infomation, "serviceManId", item.id) + } + }) + } this.reportSourceOptions = res.data.reportSource }) this.getServiceTypeList() @@ -825,12 +892,13 @@ serviceManId: data.serviceManId || 0, serviceNumber: data.serviceNumber || "", serviceTypeId: data.serviceTypeId || 0, - severity: data.severity || 0, + severityId: data.severityId || 0, solution: data.solution || "", solutionRemark: data.solutionRemark || "", serviceOrderStatusId: data.serviceOrderStatusId || 0, subject: data.subject || "", - timeSpentId: data.timeSpentId || 0 + timeSpentId: data.timeSpentId || 0, + codeStandID: data.ID } return params }, @@ -861,7 +929,7 @@ if (value === "serviceContract" || value === "contract") { return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } else if (value === "productName") { - return state.Name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } else { return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } @@ -875,7 +943,7 @@ } else if (value === "contract") { this.SalesDetailsId = item.id } else if (value === "productName") { - this.productName = item.Name + this.productName = item.name } else if (value === "contact") { this.contactId = item.id } else if (value === "chance") { @@ -916,7 +984,7 @@ this.editConfig.infomation.number = row.number this.SalesDetailsId = row.id } else if (value === "productName") { - this.editConfig.infomation.product_name = row.Name + this.editConfig.infomation.productName = row.name this.productName = row.Name } else if (value === "chance") { this.editConfig.infomation.sale_chance_name = row.name @@ -935,7 +1003,7 @@ this.editConfig.infomation.number = "" this.SalesDetailsId = 0 } else if (value === "productName") { - this.editConfig.infomation.product_name = "" + this.editConfig.infomation.productName = "" this.productName = "" } else if (value === "contact") { this.editConfig.infomation.contact_name = "" @@ -959,34 +1027,49 @@ } }, // 鏁呴殰绫诲埆 - async getFaultTypeList() { - await getFaultTypeList().then((res) => { - this.faultTypeOptions = res.data.data + getFaultTypeList() { + getFaultTypeList().then((res) => { + this.faultTypeOptions = res.data.data ? res.data.data : [] + this.$set(this.editConfig.infomation, "faultTypeId", this.editConfig.infomation.faultTypeId) }) }, // 鏈嶅姟鏂瑰紡 - async getServiceTypeList() { - await getServiceTypeList().then((res) => { - this.serviceTypeOptions = res.data.data + getServiceTypeList() { + getServiceTypeList().then((res) => { + this.serviceTypeOptions = res.data.data ? res.data.data : [] + this.$set(this.editConfig.infomation, "serviceTypeId", this.editConfig.infomation.serviceTypeId) }) }, // 涓ラ噸绋嬪害 - async getSeverityList() { - await getSeverityList().then((res) => { - this.severityOptions = res.data.data + getSeverityList() { + getSeverityList().then((res) => { + this.severityOptions = res.data.data ? res.data.data : [] + + this.$set(this.editConfig.infomation, "severityId", this.editConfig.infomation.severityId) }) }, // 浼樺厛绾у埆 - async getPriorityLevelList() { - await getPriorityLevelList().then((res) => { - this.priorityLevelOptions = res.data.data + getPriorityLevelList() { + getPriorityLevelList().then((res) => { + this.priorityLevelOptions = res.data.data ? res.data.data : [] + + this.$set(this.editConfig.infomation, "priorityLevelId", this.editConfig.infomation.priorityLevelId) }) }, // 鑺辫垂鏃堕棿 - async getTimeSpentList() { - await getTimeSpentList().then((res) => { - this.timeSpentOptions = res.data.data + getTimeSpentList() { + getTimeSpentList().then((res) => { + this.timeSpentOptions = res.data.data ? res.data.data : [] + this.$set(this.editConfig.infomation, "timeSpentId", this.editConfig.infomation.timeSpentId) }) + }, + // 鏈嶅姟浜哄憳鑷畾涔夋牎楠岃鍒� + validateMemberId(rule, value, callback) { + if (this.editConfig.infomation?.serviceManId > 0) { + callback() + } else { + callback(new Error("璇烽�夋嫨鏈嶅姟浜哄憳")) + } } } } -- Gitblit v1.8.0