From 61883fcf237024ceb7622daf5b23434e3eb1be74 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 16 十月 2023 10:38:50 +0800
Subject: [PATCH] 产品获取值修改

---
 src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue |  114 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 83 insertions(+), 31 deletions(-)

diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue
index 60a616d..05298a4 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,24 @@
           <div class="basic-info-title">鍩烘湰淇℃伅</div>
           <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">
@@ -35,6 +53,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>
@@ -49,11 +68,7 @@
                   </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 +81,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>
@@ -91,6 +107,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 +119,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 +134,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>
@@ -153,23 +171,24 @@
                 </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')"
                     >
@@ -186,6 +205,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 +222,7 @@
                       placeholder="璇烽�夋嫨"
                       class="common-select-sel"
                       size="mini"
+                      style="width: 100%"
                     >
                       <el-option
                         v-for="item in serviceManOptions"
@@ -226,6 +247,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>
@@ -248,22 +270,13 @@
                       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 +287,7 @@
                       placeholder="璇烽�夋嫨"
                       class="common-select-sel"
                       size="mini"
+                      style="width: 100%"
                     >
                       <el-option
                         v-for="item in priorityLevelOptions"
@@ -293,6 +307,7 @@
                     v-model="editConfig.infomation.appointmentTime"
                     type="datetime"
                     placeholder="閫夋嫨鏃ユ湡"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -309,6 +324,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>
@@ -321,6 +337,16 @@
                       <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 +363,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 +385,7 @@
                     value-format="yyyy-MM-dd HH:mm:ss"
                     type="datetime"
                     placeholder="閫夋嫨鏃堕棿"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -369,6 +397,7 @@
                     value-format="yyyy-MM-dd HH:mm:ss"
                     type="datetime"
                     placeholder="閫夋嫨鏃堕棿"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -380,7 +409,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 +420,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 +432,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 +471,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 +645,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,11 +685,11 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         serviceNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″崟缂栧彿", trigger: "blur" }],
-        // faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "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" }],
@@ -734,8 +766,26 @@
     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: [],
@@ -830,7 +880,9 @@
         solutionRemark: data.solutionRemark || "",
         serviceOrderStatusId: data.serviceOrderStatusId || 0,
         subject: data.subject || "",
-        timeSpentId: data.timeSpentId || 0
+        timeSpentId: data.timeSpentId || 0,
+        codeStandID: data.ID,
+        codeRule: this.codeRule
       }
       return params
     },
@@ -861,7 +913,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 +927,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 +968,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 +987,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 = ""

--
Gitblit v1.8.0