From a63d71177a2899b01da37e5bfc2d498bec5f80be Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期二, 17 十月 2023 15:10:13 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into zhengwenfeng/modify-style --- src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue | 831 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 598 insertions(+), 233 deletions(-) diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue index 3247a53..ba82d6f 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" > @@ -24,232 +24,329 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> + <el-form-item label="鏈嶅姟鍗曠紪鍙�" prop="serviceNumber"> + <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"> <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)" + style="width: 100%" ></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"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" + class="common-select-btn" + @click="clearupClient('client')" + > + <i class="el-icon-remove-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> - </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.serviceContract_Number" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'serviceContract') + } + " + value-key="number" + @select="handleSelectClient('serviceContract', $event)" + style="width: 100%" ></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"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if=" + editConfig.infomation.serviceContract_Number && + editConfig.infomation.serviceContract_Number.length > 0 + " + class="common-select-btn" + @click="clearupClient('serviceContract')" + > + <i class="el-icon-remove-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" + style="width: 100%" > - <el-option v-for="item in orderTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + <!-- @focus="getFaultTypeList" --> + <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> + <!-- <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="contactId"> - <el-input v-model="editConfig.infomation.contactId"></el-input> + <el-form-item label="涓婚" prop="subject"> + <el-input v-model="editConfig.infomation.subject" style="width: 100%"></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)" + style="width: 100%" ></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"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.number && editConfig.infomation.number.length > 0" + class="common-select-btn" + @click="clearupClient('contract')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> - <el-col :span="12"> - <el-form-item label="浜у搧绫诲埆" prop="orderType"> + <!-- <el-col :span="12"> + <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> </div> </el-form-item> - </el-col> + </el-col> --> <el-col :span="12"> - <el-form-item label="浜у搧鍚嶇О" prop="name"> + <el-form-item label="浜у搧鍚嶇О" prop="productName"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + v-model="editConfig.infomation.productName" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'productName') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('productName', $event)" + style="width: 100%" ></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"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.productName && editConfig.infomation.productName.length > 0" + class="common-select-btn" + @click="clearupClient('productName')" + > + <i class="el-icon-remove-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" + style="width: 100%" > - <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> + <!-- <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="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" + style="width: 100%" > - <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> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜哄鍚�" prop="client_name"> + <el-form-item label="鑱旂郴浜哄鍚�" prop="contact_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)" + style="width: 100%" ></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"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.contact_name && editConfig.infomation.contact_name.length > 0" + class="common-select-btn" + @click="clearupClient('contact')" + > + <i class="el-icon-remove-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" + style="width: 100%" > - <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> - </div> - </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-form-item> - </el-col> - <el-col :span="12"> - <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 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="startTime"> - <el-date-picker v-model="editConfig.infomation.startTime" type="datetime" placeholder="閫夋嫨鏃ユ湡"> + <el-form-item label="浼樺厛绾у埆" prop="priorityLevelId"> + <div class="common-select"> + <el-select + v-model="editConfig.infomation.priorityLevelId" + placeholder="璇烽�夋嫨" + class="common-select-sel" + size="mini" + style="width: 100%" + > + <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> --> + </div> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="棰勭害涓婇棬鏃堕棿" prop="appointmentTime"> + <el-date-picker + v-model="editConfig.infomation.appointmentTime" + type="datetime" + placeholder="閫夋嫨鏃ユ湡" + style="width: 100%" + > </el-date-picker> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="閿�鍞満浼�" prop="client_name"> + <el-form-item label="閿�鍞満浼�" prop="sale_chance_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)" + style="width: 100%" ></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 + v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0" + class="common-select-btn" + @click="clearupClient('chance')" + > + <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> @@ -259,40 +356,19 @@ <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="serviceOrderStatusId"> <div class="common-select"> <el-select - v-model="editConfig.infomation.reportSourceId" + v-model="editConfig.infomation.serviceOrderStatusId" placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > - <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> + <!-- <div class="common-select-btn"><i class="el-icon-setting"></i></div> --> </div> </el-form-item> </el-col> @@ -303,24 +379,72 @@ <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" + value-format="yyyy-MM-dd HH:mm:ss" + type="datetime" + placeholder="閫夋嫨鏃堕棿" + style="width: 100%" + > + </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.realTime" + value-format="yyyy-MM-dd HH:mm:ss" + type="datetime" + placeholder="閫夋嫨鏃堕棿" + style="width: 100%" + > + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="浜ら�氳垂" prop="carFare"> + <el-input-number + v-model="editConfig.infomation.carFare" + placeholder="璇疯緭鍏�" + :min="0" + :controls="false" + style="width: 100%" + ></el-input-number> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏀惰垂閲戦" prop="chargeAmount"> + <el-input-number + v-model="editConfig.infomation.chargeAmount" + placeholder="璇疯緭鍏�" + :min="0" + :controls="false" + style="width: 100%" + ></el-input-number> + </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" + style="width: 100%" + > + <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 +458,33 @@ </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-select + v-model="editConfig.infomation.faqId" + 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> + </el-select> </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 +495,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 +521,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 +558,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,18 +606,50 @@ :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 { getFaqList } from "@/api/common/other" +import { + getFaultTypeList, + getServiceTypeList, + getSeverityList, + getPriorityLevelList, + 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, @@ -496,32 +662,53 @@ } } }, - 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 + }, + productList() { + return this.$store.state.getClientName.productList } }, data() { return { - dialogWidth: "80%", + dialogWidth: "50%", 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" }], + 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" }], + serviceOrderStatusId: [{ 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: [], // 鑺辫垂鏃堕棿 + faqOptions: [], // 甯歌闂 editSelectClientConfig: { editVisible: false, title: "", @@ -540,7 +727,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.serviceContractId, + SalesDetailsId: this.editCommonConfig.infomation.SalesDetailsId, + productName: this.editCommonConfig.infomation.productName, + saleChanceId: this.editCommonConfig.infomation.saleChanceId } }, created() { @@ -548,7 +756,36 @@ this.getCommonData() this.setTable() }, + mounted() { + this.$store.dispatch("geServiceContract") + this.$store.dispatch("geSalesDetails") + this.$store.dispatch("geContact") + this.$store.dispatch("geChance") + this.$store.dispatch("geProductList") + this.getFaultTypeList() + this.getSeverityList() + this.getPriorityLevelList() + this.getTimeSpentList() + this.formInfo() + }, + watch: { + "editCommonConfig.visible"(val) { + if (val) { + this.formInfo() + } + }, + "editCommonConfig.infomation.codeStandID"() { + 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: [], @@ -564,55 +801,49 @@ } }, getCommonData() { - getAllData() - .then((res) => { - this.memberOptions = res.data.member - this.orderTypeOptions = res.data.orderType - this.reportSourceOptions = res.data.reportSource - }) - .catch((err) => { - console.log(err) - }) + getAllData().then((res) => { + this.memberOptions = res.data.member + this.serviceManOptions = res.data.member + this.reportSourceOptions = res.data.reportSource + }) + this.getServiceTypeList() + this.getFaqList() + }, + // 鑾峰彇甯歌闂鍒楄〃 + async getFaqList() { + await getFaqList().then((res) => { + console.log(res) + if (res.data.code === 200) { + this.faqOptions = res.data.data.data + } + }) }, // 淇濆瓨 saveClick(formName) { this.$refs[formName].validate((valid) => { + this.validateFormNumber() if (valid) { console.log(this.editConfig.infomation) const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddOrderManage(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getAddServiceOrder(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("娣诲姞鎴愬姛") + this.$parent.getData() + } + }) } else { - getUpdateOrderManage(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + getUpdateServiceOrder(params).then((res) => { + console.log(res) + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } + }) } } else { console.log("error submit") @@ -623,48 +854,149 @@ 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 || 0, + contactId: this.contactId || 0, + serviceContractId: this.serviceContractId || 0, + expectTime: data.expectTime || "", + faqId: data.faqId || 0, + faultTypeId: data.faultTypeId || 0, + id: data.id || 0, + SalesDetailsId: this.SalesDetailsId || 0, + priorityLevelId: data.priorityLevelId || 0, + problemDesc: data.problemDesc || "", + productName: this.productName, + productTypeName: "", + realTime: data.realTime || "", + remark: data.remark || "", + saleChanceId: this.saleChanceId || 0, + serviceManId: data.serviceManId || 0, + serviceNumber: data.serviceNumber || "", + serviceTypeId: data.serviceTypeId || 0, + severity: data.severity || 0, + solution: data.solution || "", + solutionRemark: data.solutionRemark || "", + serviceOrderStatusId: data.serviceOrderStatusId || 0, + subject: data.subject || "", + timeSpentId: data.timeSpentId || 0, + codeStandID: data.ID, + codeRule: this.codeRule } 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) { + 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.productList + } 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 if (value === "productName") { + return state.name.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.SalesDetailsId = item.id + } else if (value === "productName") { + this.productName = item.name + } 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 + } else if (value === "contract") { + this.editSelCommonConfig.title = "閿�鍞槑缁嗗崟" + this.editSelCommonConfig.editVisible = true + } else if (value === "productName") { + this.editSelCommonConfig.title = "浜у搧鍚嶇О" + this.editSelCommonConfig.editVisible = true + } 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.serviceContract_Number = row.number + this.serviceContractId = row.id + } else if (value === "contract") { + this.editConfig.infomation.number = row.number + this.SalesDetailsId = row.id + } else if (value === "productName") { + this.editConfig.infomation.productName = row.name + this.productName = row.Name + } 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.serviceContract_Number = "" + this.serviceContractId = 0 + } else if (value === "contract") { + this.editConfig.infomation.number = "" + this.SalesDetailsId = 0 + } else if (value === "productName") { + this.editConfig.infomation.productName = "" + this.productName = "" + } 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 +1010,36 @@ } else if (value === "contract") { this.isConttractExpand = !this.isConttractExpand } + }, + // 鏁呴殰绫诲埆 + async getFaultTypeList() { + await getFaultTypeList().then((res) => { + this.faultTypeOptions = res.data.data + }) + }, + // 鏈嶅姟鏂瑰紡 + async getServiceTypeList() { + await getServiceTypeList().then((res) => { + this.serviceTypeOptions = res.data.data + }) + }, + // 涓ラ噸绋嬪害 + async getSeverityList() { + await getSeverityList().then((res) => { + this.severityOptions = res.data.data + }) + }, + // 浼樺厛绾у埆 + async getPriorityLevelList() { + await getPriorityLevelList().then((res) => { + this.priorityLevelOptions = res.data.data + }) + }, + // 鑺辫垂鏃堕棿 + async getTimeSpentList() { + await getTimeSpentList().then((res) => { + this.timeSpentOptions = res.data.data + }) } } } @@ -749,6 +1111,9 @@ height: 55px; line-height: 55px; } + .el-input__inner { + text-align: left; + } } } </style> -- Gitblit v1.8.0