From f56fc3c44f12024265abb7260143d25de3f49bb5 Mon Sep 17 00:00:00 2001
From: 晏有为 <13214124+yan-youwei@user.noreply.gitee.com>
Date: 星期一, 27 五月 2024 16:23:18 +0800
Subject: [PATCH] 客户管理添加,字段优化

---
 src/components/do/b1-ins-order/add.vue |   62 +++++++++++++++++++++++--------
 1 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 6aa10a5..c06c537 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -81,11 +81,11 @@
     color: #bababa;
   }
 
-  .el-select .is-disabled {
+  .ins_order_add .el-select .is-disabled {
     background: transparent !important;
   }
 
-  .el-select .is-disabled .el-input__inner {
+  .ins_order_add .el-select .is-disabled .el-input__inner {
     background: transparent !important;
   }
 </style>
@@ -107,6 +107,7 @@
           <el-button size="medium" @click="templateDia=true" v-show="active==1">
             <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
           </el-button>
+          <el-button size="medium" type="primary" @click="$parent.playOrder(4)">鍏夌氦閰嶇疆</el-button>
           <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active==1">鎻愪氦</el-button>
           <!-- 瀹℃牳 -->
           <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3"
@@ -197,7 +198,9 @@
         <el-col class="search_thing" :span="6">
           <div class="search_label"><span class="required-span">* </span>鏉ユ牱鏂瑰紡锛�</div>
           <div class="search_input">
-            <el-input size="small" clearable v-model="addObj.formType" :readonly="active>1"></el-input>
+            <el-select v-model="addObj.formType" size="small" :disabled="active>1" style="width: 100%;">
+              <el-option v-for="(a,ai) in formType" :key="ai" :label="a.label" :value="a.value"></el-option>
+            </el-select>
           </div>
         </el-col>
         <el-col class="search_thing" :span="6">
@@ -270,17 +273,24 @@
         <el-table-column prop="model" label="鏍峰搧鍨嬪彿" align="center" min-width="100">
           <template slot-scope="scope">
             <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="鏍峰搧鍨嬪彿"
-              size="small" @change="handleChangeModel" :disabled="active>1">
+              size="small" @change="handleChangeModel" :disabled="active>1" style="width: 100%;">
               <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
             </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" width="130" align="center" v-if="!(active>1)">
+          <template slot-scope="scope">
+            <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="闈炲繀濉�"
+              @keyup.enter.native="methodChange(scope.row.standardMethodListId, scope.row)"
+              @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input>
           </template>
         </el-table-column>
         <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" min-width="100">
           <template slot-scope="scope">
             <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1"
               placeholder="妫�楠屾爣鍑�" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)"
-              @focus="methodFocus" :readonly="active>1">
+              @focus="methodFocus" :readonly="active>1" style="width: 100%;">
               <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
               </el-option>
             </el-select>
@@ -334,12 +344,12 @@
         <el-table-column prop="unit" label="璁¢噺鍗曚綅" width="100" show-overflow-tooltip></el-table-column>
         <el-table-column prop="price" label="鍗曚环" width="100" show-overflow-tooltip></el-table-column>
         <el-table-column prop="manDay" label="棰勮鏃堕棿(澶�)" width="120" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="manHourGroup" label="宸ユ椂鍒嗙粍" width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="manHour" label="宸ユ椂绯绘暟" width="100" show-overflow-tooltip></el-table-column>
         <!-- <el-table-column prop="deviceGroup" label="璁惧缁�" width="120" show-overflow-tooltip></el-table-column> -->
         <el-table-column prop="section" label="鍖洪棿" width="120" show-overflow-tooltip></el-table-column>
         <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px">
           <template slot-scope="scope">
-            <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea"
+            <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea" readonly
               :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)" :readonly="active>1"></el-input>
           </template>
         </el-table-column>
@@ -370,7 +380,7 @@
             <el-row>
               <el-col :span="24">
                 <span><i
-                    :class="`node_i ${data.children != undefined ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
+                    :class="`node_i ${data.children != undefined ? (data.code==='[1]'?'el-icon-folder-opened':'el-icon-folder') : 'el-icon-tickets'}`"></i>
                   {{ data.code }} {{ data.label }}</span>
               </el-col>
             </el-row>
@@ -562,6 +572,7 @@
           sampleType: null,
           sample: null,
           model: null,
+          modelNum: null,
           sampleNum: 1,
           isLeave: 0,
           unit: null
@@ -626,7 +637,8 @@
         tell: '',
         noLoading: false,
         orderType: [],
-        filters: []
+        filters: [],
+        formType: []
       }
     },
     watch: {
@@ -645,6 +657,7 @@
       this.selectStandardMethods()
       this.selectEnumByCategoryForOrderType()
       this.selectEnumByCategoryForSonLaboratory()
+      this.selectEnumByCategoryForSampleForm()
       if (this.active != 1) {
         // 鏌ョ湅/瀹℃牳娴佺▼
         // 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
@@ -659,6 +672,10 @@
           this.addObj.sampleNum = this.sampleList.length
           this.$nextTick(() => {
             this.$refs.sampleTable.doLayout()
+            if(this.addObj.sampleNum>0){
+              this.$refs.sampleTable.setCurrentRow(this.sampleList[0],true)
+              this.rowClick(this.sampleList[0])
+            }
           })
         })
       }
@@ -722,7 +739,10 @@
           this.saveLoad = true
           this.$axios.post(this.$api.insOrder.addInsOrder, {
             insOrder: this.addObj,
-            list: JSON.stringify(this.sampleList)
+            list: JSON.stringify(this.sampleList.map(a=>{
+              a.model = a.model + ((a.modelNum==null||a.modelNum==''||a.modelNum=='null')?'':('-'+a.modelNum))
+              return a
+            }))
           }, {
             headers: {
               'Content-Type': 'application/json'
@@ -847,9 +867,7 @@
         this.$axios.get(this.$api.standardTree.selectStandardTreeList).then(res => {
           this.list = res.data
           this.list.forEach(a => {
-            a.children.forEach(b => {
-              this.expandedKeys.push(b.label)
-            })
+            this.expandedKeys.push(a.label)
           })
         })
       },
@@ -860,7 +878,7 @@
       activeStandardTree() {
         let trees = this.selectTree.split(" - ")
         if (trees.length < 4) {
-          this.$message.error('鏈�夋嫨鏍峰搧')
+          this.$message.error('鏈�夋嫨浜у搧')
           return
         }
         this.addObj.factory = trees[0]
@@ -1113,11 +1131,23 @@
           }
         })
       },
+      selectEnumByCategoryForSampleForm() {
+        this.$axios.post(this.$api.enums.selectEnumByCategory, {
+          category: "鏉ユ牱鏂瑰紡"
+        }).then(res => {
+          this.formType = res.data
+          if(this.formType.length > 0){
+            this.addObj.formType = this.formType[0].value
+          }
+        })
+      },
       methodChange(val, row) {
+        if(val===null||val==='')return
         this.getProductLoad = true
         this.$axios.post(this.$api.standardTree.selectStandardProductList, {
-          model: this.addObj.model,
-          standardMethodListId: val
+          model: row.model + '-' + row.modelNum,
+          standardMethodListId: val,
+          factory: this.selectTree,
         }, {
           headers: {
             'Content-Type': 'application/json'

--
Gitblit v1.9.3