From 9bce6d06fc72b109ebfe1fa779c57e1d62a43b57 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 13 九月 2024 16:58:56 +0800
Subject: [PATCH] 来样方式改成订单类型

---
 src/components/do/b1-ins-order/add.vue |  361 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 245 insertions(+), 116 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index ceb28b6..6c2d005 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -207,6 +207,14 @@
               <el-input size="small" placeholder="閫夋嫨濮旀墭瀹㈡埛" clearable :readonly="active>1" v-model="addObj.phone"></el-input>
             </div>
           </el-col>
+          <el-col class="search_thing" :span="6" v-if="addObj.orderType=='C'">
+            <div class="search_label"><span class="required-span">* </span>涓嬪崟鑷筹細</div>
+            <div class="search_input">
+              <el-select size="small" style="width: 100%;" clearable v-model="addObj.departmentLimsId" :disabled="active>1" placeholder="閮ㄩ棬">
+                <el-option v-for="(a, ai) in deaprtEnum" :key="ai" :value="a.id" :label="a.name"></el-option>
+              </el-select>
+            </div>
+          </el-col>
           <el-col class="search_thing" :span="6">
             <div class="search_label"><span class="required-span">* </span>绱ф�ョ▼搴︼細</div>
             <div class="search_input">
@@ -246,7 +254,7 @@
             </div>
           </el-col> -->
           <el-col class="search_thing" :span="6">
-            <div class="search_label"><span class="required-span">* </span>鏉ユ牱鏂瑰紡锛�</div>
+            <div class="search_label"><span class="required-span">* </span>璁㈠崟绫诲瀷锛�</div>
             <div class="search_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>
@@ -359,8 +367,8 @@
           <div class="search_thing">
             <div class="search_label">妫�楠屾爣鍑嗭細</div>
             <div class="search_input">
-              <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭鍏�'" size="small" @focus="methodFocus"
-                :loading="methodLoad" @change="changeStandardMethodListId">
+              <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭閫夋嫨'" size="small" @focus="methodFocus"
+                :loading="methodLoad" multiple @change="changeStandardMethodListId">
                 <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
                 </el-option>
               </el-select>
@@ -376,7 +384,7 @@
               <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1"></el-input>
             </template>
           </el-table-column>
-          <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="140" align="center">
+          <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="100" align="center">
             <template slot-scope="scope">
               <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚"
                 :readonly="active>1"></el-input>
@@ -391,7 +399,7 @@
               </el-select>
             </template>
           </el-table-column>
-          <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" width="130" align="center" v-if="!(active>1)">
+          <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" min-width="100" 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)"
@@ -402,8 +410,17 @@
             <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" style="width: 100%;" clearable @clear="productList = []">
+                @focus="methodFocus" :readonly="active>1" style="width: 100%;" clearable @clear="productList = []" multiple>
                 <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column prop="testRequirements" label="璇曢獙鏍囧噯" align="center" min-width="100">
+            <template slot-scope="scope">
+              <el-select v-model="scope.row.testRequirements" :disabled="scope.row.model==null||active>1"
+                placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable>
+                <el-option v-for="item in standard" :key="item.id" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </template>
@@ -465,17 +482,17 @@
             <template slot-scope="scope">
               <el-input size="small" placeholder="瑕佹眰鎻忚堪" v-model="scope.row.tell" clearable type="textarea"
                 :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'tell')"
-                v-if="active==1&&isAskOnlyRead"></el-input>
+                v-if="active==1"></el-input>
               <span v-else>
                 <template >{{ scope.row.tell }}</template>
               </span>
             </template>
           </el-table-column>
-          <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px" v-if="isAskOnlyRead">
+          <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"
                 :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'ask')"
-                v-if="active==1&&isAskOnlyRead&&scope.row.inspectionValueType!='5'"></el-input>
+                v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input>
               <span v-else>
                 <!-- <template v-if="(scope.row.ask.indexOf('D')>-1
                 ||scope.row.ask.indexOf('W')>-1
@@ -523,7 +540,7 @@
         <el-button type="primary" @click="selectUser">纭� 瀹�</el-button>
       </span>
     </el-dialog>
-    <el-dialog title="閫夋嫨鏍峰搧" :visible.sync="selectStandardTree" width="400px">
+    <el-dialog title="閫夋嫨鏍峰搧" :visible.sync="selectStandardTree" width="500px">
       <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree">
         <el-row>
           <el-col :span="24">
@@ -620,8 +637,8 @@
         </el-row>
       </span>
     </el-dialog>
-    <fiberOpticConfig :currentId="currentId" @saveFiberopticConfig="getTotal()" v-if="configShow && examine == 0" :active="active" />
-    <fiberOpticConfigTwo :currentId="currentId" @saveFiberopticConfig="getTotal()" v-if="configShow && examine == 1" :active="active" />
+    <fiberOpticConfig :currentId="currentId" @saveFiberopticConfig="getTotal()" v-if="configShow && examine==0" :active="active" :inspectionItemST='inspectionItemST' />
+    <fiberOpticConfigTwo :currentId="currentId"  v-if="configShow && examine==1" :active="active" />
     <equipConfig :currentId="currentId" v-if="equipConfigShow" :active="active" />
     <cableConfig v-if="cableConfigShow" :active="active" />
 <!--    鍗曢�夌壒娈婂�煎鐞嗘-->
@@ -760,7 +777,7 @@
                width="800px" :show-close="false">
       <el-table
       :data="editTable"
-      style="width: 100%">
+      style="width: 100%" height="80vh">
       <!-- inspectionItemList -->
       <el-table-column
           prop="inspectionItemList"
@@ -882,6 +899,15 @@
         <el-button type="primary" @click="spliceData">淇濆瓨</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="鍗曟牴鍨傜洿鐕冪儳妫�娴嬫鏁板~鍐�" :visible.sync="singleVerticalCombustionShow" width="900px"
+               :close-on-click-modal="false" :close-on-press-escape="false"
+               :before-close="beforeCirculateShowClose" :show-close="false">
+      <div>111</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cleanSpliceData">鍙栨秷</el-button>
+        <el-button type="primary" @click="spliceData">淇濆瓨</el-button>
+      </span>
+    </el-dialog>
     <!-- 鐢靛姏璇曢獙瀹�---娓╁崌璇曢獙/鐑惊鐜� -->
     <el-dialog :title="temperatureTitle" :visible.sync="temperatureShow"
                :close-on-click-modal="false" :close-on-press-escape="false"
@@ -911,7 +937,6 @@
 import equipConfig from './equip-config.vue'
 import cableConfig from './cable-config.vue'
 import Vue from 'vue'
-import {iuCharts} from "../../../util/echarts";
 
 export default {
     components: {
@@ -937,6 +962,7 @@
     },
     data() {
       return {
+        inspectionItemST: null,
         sampleSelectionList: [],//鏍峰搧琛ㄦ牸閫変腑鏁版嵁
         editTable:[],
         template: null,
@@ -971,7 +997,9 @@
           production: null,
           productionEn: null,
           companyId: null,
-          prepareUser:null
+          prepareUser:null,
+          departmentLimsId:null,
+          departmentLims:null
         },
         sample: {
           sampleCode: null,
@@ -1074,7 +1102,7 @@
         RTS: '',
         totalArr: [],
         model: null,
-        standardMethodListId: null,
+        standardMethodListId: [],
         symbolList:[
         'RTS','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
         inspectionItem:null,
@@ -1086,6 +1114,7 @@
           entrustNum: '',
           entrustPoint: ''
         },
+        singleVerticalCombustionShow: false,
         isBsm2Val2:false,
         opticalProject: [], // 娓╁害寰幆寮规鍏夌氦椤圭洰鍒楄〃
         opticalProjectList: [], // 娓╁害寰幆寮规鍏夌氦椤圭洰閫変腑鐨勬暟缁�
@@ -1107,6 +1136,8 @@
         temId: '',
         sonLaboratoryList:[],
         selectiveEcho: [], // 妫�楠屼笅鍗曠殑鏃跺�欏嬀閫夋楠岄」鐩�,濡傛灉浣跨敤绛涢�夋彁浜ゆ樉绀烘楠岄」鐩负绌� 鍥炴樉鍒楄〃
+        deaprtEnum:[],
+        standard:[]
       }
     },
     watch: {
@@ -1131,6 +1162,25 @@
           }
         }
       },
+      productListSelected: {
+        deep: true,
+        handler(val) {
+          if(val.length>0){
+            for(let i =0 ; i< val.length; i++){
+              if(val[i].inspectionItem.includes('鏉惧绠�')){
+                this.inspectionItemST = 1
+                break;
+              }else{
+                this.inspectionItemST = 0
+              }
+            }
+          }else{
+            this.inspectionItemST = 0
+          }
+
+          console.log('0000',this.inspectionItemST);
+        }
+      },
       sampleList: {
         deep: true,
         handler(val) {
@@ -1139,11 +1189,11 @@
       },
       'addObj.sample'(val) {
         this.model = null
-        this.standardMethodListId = null
+        this.standardMethodListId = []
       },
       'addObj.sampleNum'(val) {
         this.model = null
-        this.standardMethodListId = null
+        this.standardMethodListId = []
       }
     },
     mounted() {
@@ -1153,8 +1203,10 @@
       // this.selectInsOrderTemplate()
       this.getAuthorizedPerson();
       this.selectEnumByCategoryForUnit()
+      this.selectEnumByCategoryForStandard()
       this.selectStandardMethods()
       this.selectEnumByCategoryForOrderType()
+      this.selectDepartmentEnum()
       // this.selectEnumByCategoryForSonLaboratory()
       this.selectEnumByCategoryForSampleForm()
       if (this.active != 1) {
@@ -1167,7 +1219,10 @@
             ...res.data.insOrder
           };
           this.addObj.type = String(this.addObj.type)
-          this.sampleList = this.HaveJson(res.data.sampleProduct);
+          this.sampleList = this.HaveJson(res.data.sampleProduct)
+          this.sampleList.forEach(m=>{
+            m.standardMethodListId = JSON.parse(m.standardMethodListId)
+          });
           this.getProNum()
           this.addObj.sampleNum = this.sampleList.length
           this.$nextTick(() => {
@@ -1185,12 +1240,11 @@
       inputValueHandler(row,index){
         if(row){
           const nextIndex = index+1
+          console.log(nextIndex, this.editTable)
           for (let i = nextIndex; i < this.editTable.length; i++) {
             const element = this.editTable[i];
-            if(element.model==row.model){
+            if(element.model==row.model&&row.symbolItem==element.symbolItem){
               this.editTable[i].value = row.value
-            }else{
-              break;
             }
           }
         }
@@ -1549,75 +1603,58 @@
         return str.replace(find, value);
       },
       save() {
+        if(this.addObj.orderType=='C'&&this.addObj.departmentLimsId){
+          this.addObj.departmentLims = this.deaprtEnum.find(m=>m.id==this.addObj.departmentLimsId).name
+        }else if(this.addObj.orderType&&this.addObj.orderType!='C'&&!this.addObj.departmentLimsId){
+          this.addObj.departmentLims = '妫�娴嬩腑蹇�'
+          this.addObj.departmentLimsId = this.deaprtEnum.find(m=>m.name=='妫�娴嬩腑蹇�').id
+        }
+        // else{
+        //   this.$message.error('璇烽�夋嫨妫�楠岀被鍒�')
+        //   return
+        // }
         if (!this.addObj.companyId) {
           this.$message.error('鏈�夋嫨瀹㈡埛鍗曚綅')
+          return
+        }
+        let noLaboratory = this.totalArr.filter(a => a.state == 1&&!a.sonLaboratory)
+        if(noLaboratory.length>0){
+          let str = ''
+          noLaboratory.forEach((m,j)=>{
+            str += j==noLaboratory.length-1?m.inspectionItem+'-'+m.inspectionItemSubclass:m.inspectionItem+'-'+m.inspectionItemSubclass+','
+          })
+          this.$message.error(str+'娌℃湁鍏宠仈瀹為獙瀹ゅ锛岃鑱旂郴绠$悊鍛�')
           return
         }
         if (!this.addObj.type) {
           this.$message.error('鏈�夋嫨绱ф�ョ▼搴�')
         } else if (!this.addObj.formType) {
-          this.$message.error('璇疯緭鍏ユ潵鏍锋柟寮�')
+          this.$message.error('璇疯緭鍏ヨ鍗曠被鍨�')
         } else if (!this.addObj.orderType) {
           this.$message.error('璇烽�夋嫨妫�楠岀被鍒�')
         } else if (!this.addObj.production) {
           this.$message.error('璇疯緭鍏ョ敓浜у崟浣�')
         } else if (!this.addObj.productionEn) {
           this.$message.error('璇疯緭鍏ョ敓浜у崟浣岴N')
+        }else if (!this.addObj.departmentLimsId) {
+          this.$message.error('閫夋嫨涓嬪崟鍒板摢涓儴闂�')
         } else if (this.sampleList.length < 1) {
           this.$message.error('璇锋坊鍔犱竴涓牱鍝�')
         } else if (!this.sampleList.every(m => m.sample)) {
           this.$message.error('璇疯緭鍏ユ牱鍝佸悕绉�')
         } else if (!this.sampleList.every(m => m.model)) {
           this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�')
-        } else if (!this.sampleList.every(m => m.standardMethodListId)) {
+        } else if (!this.sampleList.every(m => m.standardMethodListId&&m.standardMethodListId.length>0)) {
           this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�')
         } else {
-          const select = this.selectTree.split(' - ')
-          const productListSelected = this.productListSelected.some(item => item.inspectionItem === '娓╁害寰幆')
-          let isHaveBushing = ''
-          this.sampleList.forEach(item => {
-            if (!item.bushing || item.bushing.length === 0) {
-              isHaveBushing = false
-            }
-          })
-          //杩囨护妫�娴嬮」锛氬幓闄ょ壒娈婇」
-          let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{
-              if(select[1].indexOf('閫氫俊')>=0 && ['鍏夌紗','鍏夌氦'].includes(select[2])){
-                return !['娓╁害寰幆','鍏夌氦鎺ュご鎹熻��'].includes(ele.inspectionItem)
-              }
-              return true
-          }).filter(ele=>{
-              if(select[1].indexOf('鐢靛姏')>=0){
-                return !['娓╁崌璇曢獙','鐑惊鐜�'].includes(ele.inspectionItem)
-              }
-              return true
-          })
           //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹�
-          if(this.active==1&&this.isAskOnlyRead){
-            const isTrue = this.checkRequiredValueAndRemark(filterProductList)
-            if(!isTrue){
-              this.$message.error('妫�楠岄」鐨勮姹傚�间笌瑕佹眰鎻忚堪涓嶅尮閰嶏紝 璇锋鏌�')
-              return
-            }
-          }
-
-          // console.log('isHaveBushing===', this.totalArr)
-          let spcialItem = this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('鏉惧绠�'))
-          if (productListSelected && select[2] === '鍏夌紗' && isHaveBushing === false) {
-            this.$message.error('鍏夌紗娓╁害寰幆椤圭洰蹇呴』杩涜鍏夌氦閰嶇疆')
-            this.$refs.sampleTable.setCurrentRow(this.currentMethod, true)
-            this.rowClick(this.currentMethod)
-            this.sampleIds = [this.currentMethod.id]
-            this.openConfig()
-            return
-          }else if(spcialItem&& isHaveBushing === false){
-            this.$message.error('鏉惧绠¢」鐩繀椤昏繘琛屽厜绾ら厤缃�')
-            this.$refs.sampleTable.setCurrentRow(this.currentMethod, true)
-            this.rowClick(this.currentMethod)
-            this.sampleIds = [this.currentMethod.id]
-            this.openConfig()
-            return
-          }
+          // if(this.active==1&&this.isAskOnlyRead){
+          //   const isTrue = this.checkRequiredValueAndRemark(filterProductList)
+          //   if(!isTrue){
+          //     this.$message.error('妫�楠岄」鐨勮姹傚�间笌瑕佹眰鎻忚堪涓嶅尮閰嶏紝 璇锋鏌�')
+          //     return
+          //   }
+          // }
           let sampleList = this.HaveJson(this.sampleList)
           let projectNum = this.totalArr.filter(a => a.state == 1).length
           if(projectNum==0){
@@ -1655,6 +1692,7 @@
             if(['鈮�','鈮�','>','<','='].includes(ele.ask[0])){
               const askVal = ele.ask.substring(1,ele.ask.length)
               if(isNaN(askVal) || ele.tell.indexOf(askVal)<0){
+                console.log(1111);
                 isTrue = false
               }
             }
@@ -1662,8 +1700,10 @@
             if(ele.ask.indexOf('-')>0 && ele.ask.length>1){
               //瑕佹眰鎻忚堪鐨剘鍜岃姹傚�肩殑-锛岀瓑鏁�
               let tell = ele.tell
-              if(ele.tell.indexOf('~')>0){
-                tell = ele.tell.replace('~','-')
+              if(ele.tell.indexOf('~')>0 || ele.tell.indexOf('锛�') || ele.tell.indexOf('锛�')){
+                tell = tell.replace('~','-')
+                tell = tell.replace('锛�','(')
+                tell = tell.replace('锛�',')')
               }
               const splits = ele.ask.split('-')
               //婊¤冻鏍煎紡瑕佹眰锛屽苟涓斾袱涓兘鏄暟瀛�
@@ -1679,35 +1719,65 @@
                  let min = Math.min(...splits)
                  let max = Math.max(...splits)
                  if(min==max){
+                  console.log(2222);
                   isTrue = false
                  }
                 //瑕佹眰鎻忚堪涓笉鍖呭惈卤浠ュ強鍖洪棿鐨勬暟瀛楋紝鍒欒繑鍥瀎alse
-                if((tell.indexOf('卤')<0&&tell.indexOf('-')<0)){
+                if(tell.indexOf('卤')<0&&tell.indexOf('-')<0){
+                  console.log(3333,ele);
+                  console.log(3333333,tell,tell.indexOf('卤')<0,tell.indexOf('-')<0);
                   isTrue = false
                 }else if(ele.tell.indexOf('-')==0){
+                  console.log(4444);
                   isTrue = false
                 }else if(tell.indexOf('-')>0){
-                  const splitTells = tell.split('-')
-                  if(splitTells[0].indexOf(min)<0 || splitTells[1].indexOf(max)<0){
-                    isTrue = false
-                  }
-                }else if(tell.indexOf('卤')>0&&tell!=ele.ask){
-                  //鏍¢獙瑕佹眰鎻忚堪涓�10卤5杩欑鍐欐硶鐨勬儏鍐�
-                  let splitNums = ele.tell.split('卤')
-                  if(splitNums.length<2){
-                    isTrue = false
+                  if(tell.indexOf('卤')>0){
+                    ////鏍¢獙瑕佹眰鎻忚堪涓�(10-15)卤5杩欑鍐欐硶鐨勬儏鍐�
+                    const num = tell.split('卤')[1]
+                    const startIndex = tell.indexOf('(')
+                    const endIndex = tell.indexOf(')')
+                    if(startIndex>-1 && endIndex>0 ){
+                      const str = tell.substring(startIndex,endIndex)
+                      if(str && str.indexOf('-')>0){
+                        let strList = str.split('-')
+                        const minNum = Number(strList[0]-num)
+                        const maxNum = Number(strList[1]+num)
+                        if(minNum>min || maxNum<max){
+                          console.log(555555);
+                          isTrue = false
+                        }
+                      }
+                    }else{
+                      //鏍¢獙瑕佹眰鎻忚堪涓�10卤5杩欑鍐欐硶鐨勬儏鍐�
+                      let splitNums = ele.tell.split('卤')
+                      if(splitNums.length<2){
+                        console.log(66666);
+                        isTrue = false
+                      }else{
+                        let minTell = Number(splitNums[0])-Number(splitNums[1])
+                        let maxTell = Number(splitNums[0])+Number(splitNums[1])
+                        if(minTell!=min || maxTell!=max){
+                          console.log(7777777);
+                          isTrue = false
+                        }
+                      }
+                    }
                   }else{
-                    let minTell = Number(splitNums[0])-Number(splitNums[1])
-                    let maxTell = Number(splitNums[0])+Number(splitNums[1])
-                    if(minTell!=min || maxTell!=max){
+                    const splitTells = tell.split('-')
+                    if(splitTells[0].indexOf(min)<0 || splitTells[1].indexOf(max)<0){
+                      console.log(88888888);
                       isTrue = false
                     }
                   }
                 }
               }else{
+                console.log(89999999);
                 isTrue = false
               }
             }
+            // else if(ele.ask.indexOf('&')>0 && ele.ask.length>1){
+            //   //鍒ゆ柇
+            // }
           })
         }catch(error){
           console.log(error);
@@ -1757,7 +1827,7 @@
                         }
                       }
                     }else{
-                      this.$message.error('瑕佹眰鍊间负绌猴紝闇�瑕佸幓鏍囧噯搴撶淮鎶わ紒')
+                      // this.$message.error('瑕佹眰鍊间负绌猴紝闇�瑕佸幓鏍囧噯搴撶淮鎶わ紒')
                     }
                   }
                   // arr.forEach(f => {
@@ -1929,6 +1999,22 @@
         }
       },
       saveMethod(sampleList){
+        let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1)
+        if (isHaveAsk.length > 0) {
+          this.$message({
+            type: 'error',
+            message: '璇峰~鍐欒姹傚�煎悗鍐嶆彁浜�'
+          })
+          return false;
+        }
+        let isHaveTell = this.totalArr.filter(a => (a.tell == null||a.tell=='')&&a.state==1)
+        if (isHaveTell.length > 0) {
+          this.$message({
+            type: 'error',
+            message: '璇峰~鍐欒姹傛弿杩板悗鍐嶆彁浜�'
+          })
+          return false;
+        }
         this.saveLoad = true
         this.$axios.post(this.$api.insOrder.addInsOrder, {
           str: JSON.stringify({
@@ -2003,7 +2089,10 @@
               this.distributeData.appointed = ress.data
             })
             setTimeout(() => {
-              this.issuedDialogVisible = true;
+              // this.issuedDialogVisible = true;
+              // this.$message.success('鎻愪氦鎴愬姛')
+              this.upLoad = false
+              this.$parent.playOrder(0)
             }, 1000)
           })
         } else {
@@ -2063,9 +2152,15 @@
         })
       },
       getProNum() {
-        this.sampleSelectionList.forEach((m, i) => {
-          Vue.set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
-        })
+        if (this.active != 1) {
+          this.sampleList.forEach((m, i) => {
+            Vue.set(this.sampleList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
+          })
+        }else{
+          this.sampleSelectionList.forEach((m, i) => {
+            Vue.set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
+          })
+        }
         this.$refs.sampleTable.doLayout()
       },
       searchFilter() {
@@ -2081,7 +2176,23 @@
         this.selectTree = ''
         this.models = val.children
         this.getNodeParent(node)
+
+        let flag = false
+        if (node.level == 3) {
+          if(node.data.children.length>0){
+            node.data.children.forEach(a => {
+              let key = Object.keys(a)
+              if(!key.includes('level')) {
+                flag = true
+              }
+            })
+
+          }
+        }
         this.selectTree = this.selectTree.replace(' - ', '')
+        if(flag) {
+          this.selectTree =  '-  - ' + this.selectTree
+        }
         let data = this.selectTree.split(' - ')
         let data2 = ''
         for (let index = data.length - 1; index >= 0; index--) {
@@ -2120,7 +2231,7 @@
         this.addObj.factory = trees[0]
         this.addObj.laboratory = trees[1]
         this.addObj.sampleType = trees[2]
-        if (trees[3] === undefined || trees[3] === '') {
+        if (trees[3] === undefined || trees[3] === '' || trees[3] === '- ') {
           this.addObj.sample = trees[2]
         } else {
           this.addObj.sample = trees[3]
@@ -2135,7 +2246,7 @@
           this.sample.sample = this.addObj.sample
           this.sample.model = this.addObj.model
           this.sample.unit = this.addObj.unit
-          this.sample.standardMethodListId = null
+          this.sample.standardMethodListId = []
           this.sample.insProduct = []
           this.sample.id = this.count
           this.sample.childSampleList = []
@@ -2180,14 +2291,14 @@
           this.sample.sample = this.addObj.sample
           this.sample.model = this.addObj.model
           this.sample.unit = this.addObj.unit
-          this.sample.standardMethodListId = null
+          this.sample.standardMethodListId = []
           this.sample.insProduct = []
-          this.sample.id = this.count
+          this.sample.id = parseInt(i+1)
           this.sample.childSampleList = []
           this.sample.insulating = null
           this.sample.sheath = null
           this.sampleList.push(this.HaveJson(this.sample))
-          this.count++
+          // this.count++
         }
         this.computationalPairing(this.sampleList.length)
         this.bsm2Val2 = this.HaveJson(this.bsm2Val3)
@@ -2220,12 +2331,6 @@
       },
       rowClick(row, column, event) {
         this.currentMethod = row
-        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
-        if (obj && obj.code == '濮旀墭瑕佹眰') {
-          this.isAskOnlyRead = true
-        } else {
-          this.isAskOnlyRead = false
-        }
         this.sampleId = row.id
         if (this.active !== 1) {
           this.sampleIds = []
@@ -2336,6 +2441,13 @@
         } else if ((row.inspectionItem === '娓╁崌璇曢獙' || row.inspectionItem === '鐑惊鐜�') && row.state === 0) {
           this.temperatureShow = false;
         }
+        // if (row.inspectionItem === '鍗曟牴鍨傜洿鐕冪儳' && select[2] === '鍏夌紗' && row.state === 1) {
+        //   this.singleVerticalCombustionShow = true;
+        //   return
+        // } else if (row.inspectionItem === '鍗曟牴鍨傜洿鐕冪儳' && select[2] === '鍏夌紗' && row.state === 0) {
+        //   this.singleVerticalCombustionShow = false;
+        // }
+
         this.changeProductList0()
         this.currentMethod.insProduct = this.productList0
         this.getProNum()
@@ -2462,6 +2574,13 @@
           this.units = res.data
         })
       },
+      selectEnumByCategoryForStandard() {
+        this.$axios.post(this.$api.enums.selectEnumByCategory, {
+          category: "璇曢獙鏍囧噯"
+        }).then(res => {
+          this.standard = res.data
+        })
+      },
       selectEnumByCategoryForOrderType() {
         this.$axios.post(this.$api.enums.selectEnumByCategory, {
           category: "妫�楠岀被鍒�"
@@ -2474,7 +2593,7 @@
       },
       selectEnumByCategoryForSampleForm() {
         this.$axios.post(this.$api.enums.selectEnumByCategory, {
-          category: "鏉ユ牱鏂瑰紡"
+          category: "璁㈠崟绫诲瀷"
         }).then(res => {
           this.formType = res.data
           if (this.formType.length > 0) {
@@ -2485,18 +2604,13 @@
       methodChange(val, row) {
         if (val === null || val === '') return
         this.currentMethod = row
-        let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId)
-        if (obj && obj.code == '濮旀墭瑕佹眰') {
-          this.isAskOnlyRead = true
-        } else {
-          this.isAskOnlyRead = false
-        }
         this.getProductLoad = true
         let selectTreeList = this.selectTree.split(" - ")
         this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model)
+
         this.$axios.post(this.$api.standardTree.selectStandardProductList, {
           model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum,
-          standardMethodListId: val,
+          standardMethodListId: val.join(','),
           factory: selectTreeList.join(" - "),
         }, {
           headers: {
@@ -2566,17 +2680,27 @@
       },
       // 瑕佹眰鍊煎彉鍖栨椂
       requestChange(e, row,type) {
-        this.sampleList.map(item => {
-          if (this.sampleIds.indexOf(item.id) > -1) {
-            item.insProduct.map(m => {
-              if (m.id == row.id) {
-                m[type] = e;
+        //this.currentMethod 褰撳墠鏍峰搧id
+        this.sampleList.forEach(item=>{
+          if(item.id == this.currentMethod.id){
+            item.insProduct.forEach(i=>{
+              if(i.id == row.id){
+                i[type] = e
               }
-              return m;
             })
           }
-          return item
         })
+        // this.sampleList.map(item => {
+        //   if (this.sampleIds.indexOf(item.id) > -1) {
+        //     item.insProduct.map(m => {
+        //       if (m.id == row.id) {
+        //         m[type] = e;
+        //       }
+        //       return m;
+        //     })
+        //   }
+        //   return item
+        // })
       },
       selectStandardMethods() {
         this.$axios.get(this.$api.standardTree.selectStandardMethodEnum).then(res => {
@@ -3002,7 +3126,7 @@
         this.totalArr = []
         this.total = 0;
         this.sampleList.forEach(item => {
-          if (item.insProduct  && item.insProduct.length > 0) {
+          if (item.insProduct && item.insProduct.length > 0) {
             item.insProduct.forEach(a => {
               this.totalArr.push(a)
             })
@@ -3093,6 +3217,11 @@
         if(this.sonLaboratoryList.length>0){
           this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
         }
+      },
+      selectDepartmentEnum(){
+        this.$axios.get(this.$api.department.selectDepartmentLimsEnum).then(res=>{
+          this.deaprtEnum = res.data
+        })
       }
     }
   }

--
Gitblit v1.9.3