Przeglądaj źródła

Merge branch 'master' of http://119.23.210.103:3000/wy/lh_firm_former

cfort 3 lat temu
rodzic
commit
86e8c2d9e7

+ 143 - 47
src/views/system/jbdScan/goods/manualConfirmation.vue

@@ -93,10 +93,35 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
+                        <!--每种类型对应的留样数量和留样存放位置-->
                         <el-row>
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(一)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_yi"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(一)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_yi"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(一)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_yi"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+
+
+                        <el-row  v-if="item.flag2">
                           <el-col :span="6">
-                            <el-form-item label="样品类型(二)">
+                            <el-form-item label="样品类型(二)" >
                               <el-input v-model="item.yang_pin_lei_er_ || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
@@ -106,7 +131,7 @@
                             </el-form-item>
                           </el-col>
                           <el-col :span="6">
-                            <el-form-item label="样品数量(二)">
+                            <el-form-item label="样品数量(二)" >
                               <el-input v-model="item.shu_liang_er_ || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
@@ -116,8 +141,32 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row v-if="item.flag2">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(二)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_er"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(二)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_er"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(二)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_er"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
                           
-                        <el-row>
+                        <el-row v-if="item.flag3">
                           <el-col :span="6">
                             <el-form-item label="样品类型(三)">
                               <el-input v-model="item.yang_pin_lei_san_ || '/'" readonly="true"></el-input>
@@ -138,9 +187,33 @@
                               <el-input v-model="item.yang_pin_gui_ge_s || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
+                        </el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag3">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(三)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_san"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(三)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_san"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(三)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_san"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
                         </el-row>   
 
-                        <el-row>
+                        <el-row  v-if="item.flag4">
                           <el-col :span="6">
                             <el-form-item label="样品类型(四)">
                               <el-input v-model="item.yang_pin_lei_si_ || '/'" readonly="true" ></el-input>
@@ -162,53 +235,65 @@
                             </el-form-item>
                           </el-col>
                         </el-row> 
-                        
-                        <el-row>
-                          <el-col :span="6">
-                            <el-form-item label="是否留样">
-                              <template slot-scope="scope">
-                                 <el-select v-model="item.shi_fou_liu_yang_" placeholder="请选择">
-                                   <el-option
-                                     v-for="item in ifLY"
-                                     :key="item.value"
-                                     :label="item.label"
-                                     :value="item.value">
-                                   </el-option>
-                                 </el-select>
-                              </template>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag4">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(四)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_si"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(四)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_si"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(四)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_si"/>
+                               </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
+                        </el-row>   
+                        
+                        <el-row>
+                          
+                          <!-- <el-col :span="6">
                             <el-form-item label="样品存放位置" required>
                               <template slot-scope="scope">
                                 <weizhiData  v-model="item.shou_yang_wei_zhi"/>
                                </template>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
+                          </el-col> -->
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样存放位置" required>
                               <template slot-scope="scope">
                                 <liuyangData v-model="item.liu_yang_wei_zhi_"/>
                                </template>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="验收结果">
-                              <template slot-scope="scope">
-                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
-                                  <el-option
-                                    v-for="item in checkOptions"
-                                    :key="item.value"
-                                    :label="item.label"
-                                    :value="item.value">
-                                  </el-option>
-                                </el-select>
-                             </template>
-                            </el-form-item>
-                          </el-col>
+                          </el-col> -->
+                         
                         </el-row>  
                         
                         <el-row>
+                            <el-col :span="6">
+                                <el-form-item label="是否留样">
+                                <template slot-scope="scope">
+                                    <el-select v-model="item.shi_fou_liu_yang_" placeholder="请选择">
+                                    <el-option
+                                        v-for="item in ifLY"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                    </el-option>
+                                    </el-select>
+                                </template>
+                                </el-form-item>
+                            </el-col>
                           <el-col :span="6">
                             <el-form-item label="留样日期">
                               <template slot-scope="scope">
@@ -225,22 +310,16 @@
                             </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样数量" required>
                              <template slot-scope="scope">
                               <el-input 
                                 v-model="item.liu_yang_shu_lian"
                                 >
                               </el-input>
-                                <!-- <el-input-number
-                                 v-model="item.liu_yang_shu_lian"
-                                  controls-position="right"
-                                  @change="handleChange"
-                                  :min="1" :max="9999">
-                                 </el-input-number> -->
                              </template>
                             </el-form-item>
-                          </el-col>
+                          </el-col> -->
                           <el-col :span="6">
                             <el-form-item label="留样期限至">
                               <template slot-scope="scope">
@@ -308,6 +387,20 @@
                             <el-input v-model="item.chu_ju_bao_gao_ya" readonly="true" class="jiaji"></el-input>
                           </el-form-item>
                          </el-col>
+                         <el-col :span="6">
+                            <el-form-item label="验收结果">
+                              <template slot-scope="scope">
+                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
+                                  <el-option
+                                    v-for="item in checkOptions"
+                                    :key="item.value"
+                                    :label="item.label"
+                                    :value="item.value">
+                                  </el-option>
+                                </el-select>
+                             </template>
+                            </el-form-item>
+                          </el-col>
                           <!-- <el-col :span="6">
                             <el-form-item label="分装留样数量">
                               <template slot-scope="scope">
@@ -529,7 +622,7 @@ import * as dayjs from 'dayjs'
       // mjwtsqbAllResult:[],
       pageCount:1,
       item:'',
-      flag: true
+      flag: true,
     }
   },
   methods:{
@@ -572,13 +665,16 @@ import * as dayjs from 'dayjs'
       line-height: 40px;
       font-weight: bold;
     }
+    /deep/.zzj{
+        color: #4709cc; 
+    }
     /deep/.el-form-item__content{
     display: inline-block;
   }
   /deep/.el-form-item__label{
     padding: 0;
     margin-right: 5px;
-    width: 100px;
+    width: 120px;
   }
    /deep/.el-input__inner{
    border-top: none !important;

+ 77 - 23
src/views/system/jbdScan/goods/sampleConfirmation.vue

@@ -92,8 +92,25 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
+                        <!--每种类型对应的留样数量和留样存放位置-->
                         <el-row>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(一)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_yi"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(一)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_yi"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+                          
+                        <el-row v-if="item.flag2">
                           <el-col :span="6">
                             <el-form-item label="样品类型(二)">
                               <el-input v-model="item.yang_pin_lei_er_ || '/'" readonly="true"></el-input>
@@ -115,8 +132,25 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
-                        <el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row v-if="item.flag2">
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(二)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_er"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(二)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_er"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+
+                        <el-row v-if="item.flag3">
                           <el-col :span="6">
                             <el-form-item label="样品类型(三)">
                               <el-input v-model="item.yang_pin_lei_san_ || '/'" readonly="true"></el-input>
@@ -138,8 +172,26 @@
                             </el-form-item>
                           </el-col>
                         </el-row>   
+                         <!--每种类型对应的留样数量和留样存放位置-->
+                         <el-row  v-if="item.flag3">
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(三)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_san"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(三)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_san"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>   
 
-                        <el-row>
+
+                        <el-row v-if="item.flag4">
                           <el-col :span="6">
                             <el-form-item label="样品类型(四)">
                               <el-input v-model="item.yang_pin_lei_si_ || '/'" readonly="true" ></el-input>
@@ -161,7 +213,24 @@
                             </el-form-item>
                           </el-col>
                         </el-row> 
-                        
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag4">
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(四)" required>
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_si"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(四)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_si"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>   
+
                         <el-row>
                           <el-col :span="6">
                             <el-form-item label="是否留样">
@@ -184,13 +253,13 @@
                                </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样存放位置" required>
                               <template slot-scope="scope">
                                 <liuyangData v-model="item.liu_yang_wei_zhi_"/>
                                </template>
                             </el-form-item>
-                          </el-col>
+                          </el-col> -->
                           <el-col :span="6">
                             <el-form-item label="验收结果">
                               <template slot-scope="scope">
@@ -224,21 +293,6 @@
                             </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="留样数量"  required>
-                             <template slot-scope="scope">
-                              <el-input 
-                                v-model="item.liu_yang_shu_lian">
-                              </el-input>
-                                <!-- <el-input-number
-                                 v-model="item.liu_yang_shu_lian"
-                                  controls-position="right"
-                                  @change="handleChange"
-                                  :min="1" :max="9999">
-                                 </el-input-number> -->
-                             </template>
-                            </el-form-item>
-                          </el-col>
                           <el-col :span="6">
                             <el-form-item label="留样期限至">
                               <template slot-scope="scope">
@@ -566,7 +620,7 @@ import * as dayjs from 'dayjs'
   /deep/.el-form-item__label{
     padding: 0;
     margin-right: 5px;
-    width: 100px;
+    width: 120px;
   }
    /deep/.el-input__inner{
    border-top: none !important;

+ 364 - 437
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -1,6 +1,5 @@
 import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js'
 // import * as dayjs from 'dayjs'
-
 export default {
   props:{
     obj:{
@@ -22,19 +21,27 @@ export default {
       repostCurd('sql',sql).then(response=>{
         if (response.variables.data && response.variables.data.length > 0) {
           let temp = response.variables.data
-          this.listData = []
-          for (let i in temp) {
-            temp[i].jie_yang_shu_lian = temp[i].yang_pin_zong_shu
-            temp[i].jie_yang_zhuang_t = '已确认'
-            temp[i].biao_zhi_uuid_ = this.uuid()
-            temp[i].shi_fou_liu_yang_ = '是'
-            temp[i].yan_shou_jie_guo_ = '完好'
-            temp[i].liu_yang_shu_lian = ' ml/支×1支'
-            temp[i].liu_yang_ri_qi_ = this.dateFormat()
-            // temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            // temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-            this.listData.push(temp[i])
-          }
+          temp.forEach(item => {
+            item.jie_yang_shu_lian = item.yang_pin_zong_shu
+            item.jie_yang_zhuang_t = '已确认'
+            item.biao_zhi_uuid_1 = this.uuid()
+            item.biao_zhi_uuid_2 = this.uuid()
+            item.biao_zhi_uuid_3 = this.uuid()
+            item.biao_zhi_uuid_4 = this.uuid()
+            item.shi_fou_liu_yang_ = '是'
+            item.yan_shou_jie_guo_ = '完好'
+            item.liu_yang_shu_lian_yi = ' ml/支×1支'
+            item.liu_yang_shu_lian_er = ' ml/支×1支'
+            item.liu_yang_shu_lian_san = ' ml/支×1支'
+            item.liu_yang_shu_lian_si = ' ml/支×1支'
+            item.liu_yang_ri_qi_ = this.dateFormat()
+            item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+            item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+            item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+          })
+          this.listData = temp
+        // temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
+        // temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
         }else{
           this.handleEmptyData();
         }
@@ -42,26 +49,30 @@ export default {
     },
     loadDataBySQL(page) {
       // 扫码扫到新数据,查询 并分页 回填展示
-      let countSQL = `select count(*) as count from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1'`
-      let str = (page-1)*10
-      // let fysql = `select * from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1' limit ${str},10`
       let fysql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_  and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'`
-      Promise.all([repostCurd('sql', countSQL), repostCurd('sql', fysql)]).then(([res1, res]) => {
+      Promise.all([repostCurd('sql', fysql)]).then(([res]) => {
         this.listData = []
-        this.pageCount = res1.variables.data[0].count
-        if (res.variables.data && res.variables.data.length > 0) {
-          for (let i in res.variables.data) {
-            res.variables.data[i].jie_yang_shu_lian = res.variables.data[i].yang_pin_zong_shu
-            res.variables.data[i].jie_yang_zhuang_t = '已确认'
-            res.variables.data[i].biao_zhi_uuid_ = this.uuid()
-            res.variables.data[i].shi_fou_liu_yang_ = '是'
-            res.variables.data[i].yan_shou_jie_guo_ = '完好'
-            res.variables.data[i].liu_yang_shu_lian = ' ml/支×1支'
-            res.variables.data[i].liu_yang_ri_qi_ = this.dateFormat()
-            // res.variables.data[i].liu_yang_qi_xian = dayjs(res.variables.data[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            // res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-            this.listData.push(res.variables.data[i])
-          }
+        let temp = res.variables.data
+        if (temp) {
+            temp.forEach(item => {
+                item.jie_yang_shu_lian = item.yang_pin_zong_shu
+                item.jie_yang_zhuang_t = '已确认'
+                item.biao_zhi_uuid_1 = this.uuid()
+                item.biao_zhi_uuid_2 = this.uuid()
+                item.biao_zhi_uuid_3 = this.uuid()
+                item.biao_zhi_uuid_4 = this.uuid()
+                item.shi_fou_liu_yang_ = '是'
+                item.yan_shou_jie_guo_ = '完好'
+                item.liu_yang_shu_lian_yi = ' ml/支×1支'
+                item.liu_yang_shu_lian_er = ' ml/支×1支'
+                item.liu_yang_shu_lian_san = ' ml/支×1支'
+                item.liu_yang_shu_lian_si = ' ml/支×1支'
+                item.liu_yang_ri_qi_ = this.dateFormat()
+                item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+                item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+                item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+            })
+            this.listData = temp
         }else{
           this.handleEmptyList();
         }
@@ -114,7 +125,7 @@ export default {
 
           // 获取样品列表
           let ypInfoList = this_.listData
-          // console.log(ypInfoList, "样品信息")
+          console.log(ypInfoList, "样品信息")
 
           let dWhere = []
           let ypbh = []
@@ -140,9 +151,12 @@ export default {
           // 罗湖样品id格式列表
           let lhypIdNewList = []
           let uuidList = [] // 列表的UUID
-
+          // 样品所选择的位置ID字符串
+          let localStr = ''
+          let locationIds = new Set()
 
           for (let yp in ypInfoList) { //样品数据
+            let localArr = []
             let cfwzObj = []
             let cfwz = ''
             /*
@@ -170,74 +184,19 @@ export default {
               return;
             }
 
-          //  if (ypInfoList[yp].bao_gao_bian_zhi_ == undefined || ypInfoList[yp].bao_gao_bian_zhi_ == '') {
-          //     this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告编制员不能为空!')
-          //     return;
-          //   }
-          //   if (ypInfoList[yp].bao_gao_shen_he_y == undefined || ypInfoList[yp].bao_gao_shen_he_y == '') {
-          //     this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告审核员不能为空!')
-          //     return;
-          //   }
 
             cfwzObj.push(ypInfoList[yp].shou_yang_wei_zhi) //取位置信息
 
             if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
-              if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
-                this_.$message.error("你要留样的话,存放位置不能为空哦!")
-                return;
-              }
-              // if (ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != '') {
-              //   this_.$message.error("你要留样的话,就不要选收样存放位置!")
-              //   return;
-              // }
               if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
                 this_.$message.error("留样时必须填写留样日期!")
                 return;
               }
-              if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
-                this_.$message.error("留样时必须填写留样数量!")
-                return;
-              }
-              // if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
-              //   this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
-              //   return;
-              // }
-            //   if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
-            //     this_.$message.error("留样时必须填写留样期限!")
-            //     return;
-            //   }
-            //   if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
-            //     this_.$message.error("留样时必须填写销毁日期!")
-            //     return;
-            //   }
-                // cfwz = ypInfoList[yp].liu_yang_wei_zhi_
                 cfwzObj.push(ypInfoList[yp].liu_yang_wei_zhi_)
 
             } 
-            // else {
-            //   if (ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == '') {
-            //     this_.$message.error("你正常收样的话,样品存放位置不能为空哦!")
-            //     return;
-            //   }
-            //   if (ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != '') {
-            //     this_.$message.error("你正常收样的话,就不要选择留样存放位置!")
-            //     return;
-            //   }
-            //     cfwz = ypInfoList[yp].shou_yang_wei_zhi //取位置信息
-            // }
-
-            // uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
-            // ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-            // ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi) // 收样存放位置
-            // ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_) // 留样存放位置
-            // saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量
-            // jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态
             ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
-
-
             // 罗湖
-            // lhypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}')
-            // lhypbWJ.push('{"id_":"' + ypInfoList[yp].parent_id_ + '"}')
             dWhere.push('{"id_":"' + cfwz + '"}')
             cfwzIdList.push(cfwzObj)
             lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao )
@@ -247,11 +206,16 @@ export default {
             uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
             ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
             lhypmcList.push(ypInfoList[yp].yang_pin_ming_che)
+
+            localArr.push(
+                ypInfoList[yp].shou_yang_wei_zhi_yi,ypInfoList[yp].liu_yang_wei_zhi_yi,
+                ypInfoList[yp].shou_yang_wei_zhi_er,ypInfoList[yp].liu_yang_wei_zhi_er,
+                ypInfoList[yp].shou_yang_wei_zhi_san,ypInfoList[yp].liu_yang_wei_zhi_san,
+                ypInfoList[yp].shou_yang_wei_zhi_si,ypInfoList[yp].liu_yang_wei_zhi_si
+                )
+            localStr = localArr.filter(i => i).join(',')
           }
 
-        /*
-          封装好样品登记表对象,add 样品登记表
-        */
          let value = ''
          let lhypIdStr = ''
          for(let i =0;i<lhypbWJ.length; i++){
@@ -265,357 +229,231 @@ export default {
          lhypIdStr = lhypIdStr.substring(0,lhypIdStr.length-1)
          lhypIdStr = lhypIdStr.replace(/,/g,"','")
 
-         // console.log('lhypIdStr :',lhypIdStr)
-         let wtdAndYpb = []
-        // a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,
+         let currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
          let allSQL = `select a.id_ as wtID,a.chu_ju_bao_gao_ya,a.zhan_shi_biao_id_,a.wei_tuo_lei_xing_,a.he_tong_id_,a.bao_gao_lei_xing_,a.wei_tuo_bian_hao_, a.wei_tuo_dan_wei_ as wtdh, a.wei_tuo_fang_lian, a.wei_tuo_lian,a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,b.* from t_lhwtsqb a inner join t_lhypb b on a.id_ = b.parent_id_ where b.parent_id_ in ('${value}')and b.id_ in ('${lhypIdStr}')`
-          // console.log(allSQL)
-          repostCurd('sql', allSQL).then(res1 => {
-              /* 封装样品登记表对象  */
-              let ypdjb = []
-              let res = res1.variables.data
-              wtdAndYpb = res
-
-              for(let i = 0; i<res.length; i++){
-              lhwtbID.push('{"id_":"' + res[i].wtID + '"}')
-              lhwtbOnlyId.push(res[i].wtID)
-              lhwtzsbID.push('{"shen_qing_id_":"' + res[i].zhan_shi_biao_id_ + '"}')
-                  let count = 0;
-                  if(res[i].yang_pin_lei_xing != ''  && res[i].yang_pin_lei_xing != undefined){
-                    count = 1;
-                    if(res[i].yang_pin_lei_er_ != ''  && res[i].yang_pin_lei_er_ != undefined){
-                       count = 2;
-                       if(res[i].yang_pin_lei_san_ != ''  && res[i].yang_pin_lei_san_ != undefined){
-                         count = 3;
-                         if(res[i].yang_pin_lei_si_ != ''  && res[i].yang_pin_lei_si_ != undefined){
-                           count = 4;
-                         }
-                       }
-                    }
-                  }
-                  for(let x = 0; x<count;x++){
-                    let obj = {}
-                    obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
-                    obj["wei_tuo_dan_wei_"] = res[i].wtdh
-                    obj["lian_xi_ren_"]     = res[i].wei_tuo_fang_lian
-                    obj["lian_xi_dian_hua_"] = res[i].wei_tuo_lian
-
-                    obj["yang_ben_ming_che"]  = res[i].yang_pin_ming_che
-                    obj["yang_ben_bian_hao"]  = res[i].yang_pin_bian_hao
-                    obj["pi_hao_bian_hao_"]   = res[i].song_jian_pi_hao_
-                    obj["song_jian_dan_wei"]   = res[i].song_jian_dan_wei
-                    obj["xing_ming_"]         = res[i].xing_ming_
-                    obj["xing_bie_"]          = res[i].xing_bie_
-                    obj["nian_ling_"]         = res[i].nian_ling_
-                    obj["yang_ben_zhuang_t"]  = res[i].yang_pin_zhuang_t
-                    obj["shou_yang_ri_qi_"]   = this_.dateFormat()
-                    obj["bei_zhu_"]           = ypInfoList[i].bei_zhu_
-
-                    obj["yang_ben_lei_xing"] =    x==0? res[i].yang_pin_lei_xing : x==1? res[i].yang_pin_lei_er_ : x==2? res[i].yang_pin_lei_san_ : x==3? res[i].yang_pin_lei_si_ :''
-                    obj["yun_shu_tiao_jian"] =    x==0? res[i].yang_ben_yun_shu_ : x==1? res[i].yang_pin_yun_shu_ : x==2? res[i].yang_pin_yun_san : x==3? res[i].yang_pin_yun_si_ :''
-                    obj["yang_pin_shu_lian"] =    x==0? res[i].shu_liang_ : x==1? res[i].shu_liang_er_ : x==2? res[i].shu_liang_san_ : x==3? res[i].shu_liang_si_ :''
-                    obj["yang_ben_gui_ge_s"] =    x==0? res[i].yang_pin_gui_ge_ : x==1? res[i].yang_pin_gui_ge_e : x==2? res[i].yang_pin_gui_ge_s : x==3? res[i].yang_pin_gui_si_ :''
-                    obj["yan_shou_jie_guo_"] =      ypInfoList[i].yan_shou_jie_guo_
-                    obj["cun_fang_wei_zhi_"] =       ypInfoList[i].shou_yang_wei_zhi
-                    obj["liu_zhuan_zhuang_"] =       '待检'
-                    obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
-                    obj["liu_yang_ri_qi_"]    =       ypInfoList[i].liu_yang_ri_qi_
-                    obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_wei_zhi_
-                    obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
-                    obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
-                    obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
-                    obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
-                    obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
-                    obj["biao_zhi_uuid_"]     =       ypInfoList[i].biao_zhi_uuid_
-                    obj["song_yang_yao_qiu"]  =    ypInfoList[i].song_yang_yao_qiu
-                    // obj["fen_zhuang_liu_ya"]  =    ypInfoList[i].fen_zhuang_liu_ya
-                    changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
-                    changesyWeiZhi = ypInfoList[i].liu_yang_wei_zhi_ ==''?'':ypInfoList[i].liu_yang_wei_zhi_
-                    ypdjb.push(obj)
-                  }
-              }
-              let fbbIdStr = ''
-              for(let i =0;i<lhwtbOnlyId.length; i++){
-                fbbIdStr += lhwtbOnlyId[i] + ','
-              }
-              fbbIdStr = fbbIdStr.substring(0,fbbIdStr.length-1)
-              // fbbIdStr = fbbIdStr.replace(/,/g,"','")
-              // console.log('fbbIdStr :',fbbIdStr)
-              // console.log('进入样品登记表...',ypdjb)
-              repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
-              repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
-              
-              /*
-                更新委托单 如果本来没值,就更新 报告编制人和 报告审核员 否则更新
-                委托单数组 和 样品数组 数量相同,遍历两者 判断委托单是否有编制人,审核员?
-                如果没有,则记录下委托单ID,以及同索引下的样品表的编制人和审核员
-              */
-              // let finalWtdIdList = []
-
-/**
- * 1.11胡老师说不要
- 
-              for(var index = 0; index < ypInfoList.length; index++){
-                if(res[index].bao_gao_bian_zhi_  == '' || res[index].bao_gao_fu_he_yua  == ''){
-                 repostCurd('update','{"tableName":"t_lhwtsqb","paramWhere":' + '{"id_":"' + res[index].wtID + '"}' + ',"paramCond":' + '{"bao_gao_bian_zhi_":"'+ypInfoList[index].bao_gao_bian_zhi_+'","bao_gao_fu_he_yua":"' +  ypInfoList[index].bao_gao_shen_he_y + '"}}')
-              }
-            }
-*/
-
-              /*
-              let wtdSQL = "select id_,bao_gao_bian_zhi_,bao_gao_fu_he_yua from t_lhwtsqb where id_ in('" + value + "')"
-
-               repostCurd('sql', wtdSQL).then(response => {
-                   let result = response.variables.data
-                   console.log(result)
-                   for(var i in result){
-                      if(result[i].bao_gao_bian_zhi_ == '' || result[i].bao_gao_bian_zhi_ == undefined){
-                        finalWtdIdList.push(result[i])
-                      }
-                   }
-                   console.log('finalWtdIdList',finalWtdIdList)
-               })
-               */
-
-              /*
-                 3、任务分配     【2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 胡老师又要】
-                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                 3-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
-                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待任务分配"
-              */
-               // console.log('委托单及样品信息',wtdAndYpb)
-               // console.log('委托单id列表 ',lhwtbID)
-               // console.log('展示表id列表 ',lhwtzsbID)
-
-               repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-
-               let rws = []
-              if(wtdAndYpb.length>0){
-                 for(var i in wtdAndYpb){
-                  //  let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
-                      //  for(var l in strs){
-                        let rw = {}
-                        //  rw["ren_wu_ming_cheng"] = strs[l] //检测项目
-                         rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称
-                         rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号
-                         rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型
-                         let yplxList = []
-                         let ypggList = []
-                         yplxList.push(
-                            wtdAndYpb[i].yang_pin_lei_xing,wtdAndYpb[i].yang_pin_lei_er_,wtdAndYpb[i].yang_pin_lei_san_,wtdAndYpb[i].yang_pin_lei_si_);
-                         ypggList.push(
-                            wtdAndYpb[i].yang_pin_gui_ge_,wtdAndYpb[i].yang_pin_gui_ge_e,wtdAndYpb[i].yang_pin_gui_ge_s,wtdAndYpb[i].yang_pin_gui_si_
-                         );
-                         let yplxz = yplxList.filter(i => i).join(',');
-                         let ypggStr = ypggList.filter(i => i).join(',');
-                         rw["yang_pin_lei_xing"] = yplxz        //  样品类型
-                         rw["yang_pin_gui_ge_"] = ypggStr       // 样品规格
-                         rw["wei_tuo_id_"] = wtdAndYpb[i].wtID  //  委托id
-                         rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ //  合同id
-                         rw["zhuang_tai_"] = '待任务分配'       //  状态
-                         rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia   // 送检日期
-                        //  rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  // 报告编制人
-                        //  rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y  // 报告审核人
-                         rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_   // 报告类型
-                         rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   // 项目名称
-                         rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_   // 展示表id
-                         rw["fen_zhuang_liu_ya"] = ypInfoList[i].liu_yang_shu_lian  // 留样数量
-                         rw["shi_fou_jia_ji_"] = wtdAndYpb[i].chu_ju_bao_gao_ya // 是否加急【2023/2/23王嘎嘎提出】
-                         rw["yang_pin_shu_lian"] = ypInfoList[i].jie_yang_shu_lian  // 样品确认总数【2023/3/7王嘎嘎提出】
-                         rws.push(rw)
-                        // }
-                  }
-                //    console.log("任务分配",rws)
-                 repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
-                }
-                // 更新委托单 检测开始时间   问吴懿是否需要 不需要
-                // repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
-
-                //更新展示表
-                if(lhwtzsbID.length > 0){
-                  repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
-                }
-                
-
-
-
-
-
-               /*
-                3、【任务分配2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 取消】
-                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                 3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开检测子流程,一个样品可能对应多个检测
-                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待环境监控"
-                 
-                 repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-                 */
-
-          // console.log('dwhere:',dWhere)
-          // console.log('cfwzIdList:',cfwzIdList)
-          /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID 
-                判断是否是留样位置,如果是留样位置 位置表shi_fou_liu_yang_字段值为`是` 否则 值为`否`
-          */
-          for (let num in dWhere) {
-            let firstIfEmpty = true
-            let secondIfEmpty = true
-              for(let index = 0; index<cfwzIdList[num].length; index++){
-                let sql = "select * from t_ypcfwz where id_ = '" + cfwzIdList[num][index] + "'"
-                let isLiuYang = index == 1 ? "是" : "否"
-                // console.log(sql)
-                  repostCurd('sql', sql).then(response => {
-                    let resArr = response.variables.data
-                    // console.log(resArr)
-                    if (resArr.length == 1) {
-                      if (resArr[0].wei_zhi_zhuang_ta == "空余") {
-                        if(index == 0){
-                          firstIfEmpty = false
-                        }else{
-                          secondIfEmpty = false
+        // 搜集所有选择的位置信息
+        //  console.log('当前选择的位置ids:',locationIds)
+         var allLocal = `select * from t_ypcfwz where find_in_set(id_,'${localStr}')`
+         Promise.all([repostCurd("sql",allSQL),repostCurd("sql",allLocal)]).then((res)=>{
+            let result = res[0].variables.data
+            let localInfo = res[1].variables.data
+            console.log(localInfo)
+            /* 1、更新货架位置信息 */
+            this.emptyLocal = []
+            this.fullLocal  = []
+            let allUUID = []
+            ypInfoList.forEach(item=>{
+                allUUID.push(item.biao_zhi_uuid_1,item.biao_zhi_uuid_2,item.biao_zhi_uuid_3,item.biao_zhi_uuid_4)
+                this.handleLocationInfo(item.shou_yang_wei_zhi_yi,'否',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime,1)
+                // this.handleLocationInfo(item.shou_yang_wei_zhi_er,'否',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime)
+                // console.log('第二次',localInfo)
+                // // this.handleLocationInfo(item.shou_yang_wei_zhi_san,'否',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime)
+                // // this.handleLocationInfo(item.shou_yang_wei_zhi_si,'否',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime)
+                // this.handleLocationInfo(item.liu_yang_wei_zhi_yi,'是',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime)
+                // console.log('第三次',localInfo)
+                // this.handleLocationInfo(item.liu_yang_wei_zhi_er,'是',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime)
+                // console.log('第四次',localInfo)
+                // this.handleLocationInfo(item.liu_yang_wei_zhi_san,'是',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime)
+                // this.handleLocationInfo(item.liu_yang_wei_zhi_si,'是',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime)
+            })
+            let allUUIDStr = allUUID.filter(i => i).join(',')
+            console.log(allUUIDStr)
+            // 更新样品位置list
+            console.log('emptyLocal:',this.emptyLocal)
+            this.emptyLocal.forEach(it=>{
+                repostCurd('update', JSON.stringify(it))
+            })
+            // 插入样品位置list
+            console.log('fullLocal:',this.fullLocal)
+            repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(this.fullLocal) + '}').then(res=>{
+                // 再次查询位置表,对比当前样品列表 替换初始值为占用的样品位置id
+                let findLocationAgain = `select id_,shi_fou_liu_yang_,biao_zhi_uuid_ from t_ypcfwz where find_in_set(biao_zhi_uuid_,'${allUUIDStr}')`
+                // console.log(findLocationAgain)
+                repostCurd('sql',findLocationAgain).then(res=>{
+                    let  data  = res.variables.data
+                    data.forEach(item=>{
+                            let temp = ypInfoList.find(i => i.biao_zhi_uuid_1 === item.biao_zhi_uuid_)
+                            if(temp){
+                                if(item.shi_fou_liu_yang_ === '否'){
+                                    ypInfoList.find(i => i.biao_zhi_uuid_1 === item.biao_zhi_uuid_).shou_yang_wei_zhi_yi = item.id_
+                                    console.log('1否')
+                                }else{
+                                    ypInfoList.find(i => i.biao_zhi_uuid_1 === item.biao_zhi_uuid_).liu_yang_wei_zhi_yi = item.id_
+                                    console.log('1是')
+                                }
+                            }
+                            let temp2 = ypInfoList.find(i => i.biao_zhi_uuid_2 === item.biao_zhi_uuid_)
+                            if(temp2){
+                                if(item.shi_fou_liu_yang_ === '否'){
+                                    ypInfoList.find(i => i.biao_zhi_uuid_2 === item.biao_zhi_uuid_).shou_yang_wei_zhi_er = item.id_
+                                    console.log('2否')
+                                }else{
+                                    ypInfoList.find(i => i.biao_zhi_uuid_2 === item.biao_zhi_uuid_).liu_yang_wei_zhi_er = item.id_
+                                    console.log('2是')
+                                }
+                            }
+                            let temp3 = ypInfoList.find(i => i.biao_zhi_uuid_3 === item.biao_zhi_uuid_)
+                            if(temp3){
+                                if(item.shi_fou_liu_yang_ === '否'){
+                                    ypInfoList.find(i => i.biao_zhi_uuid_3 === item.biao_zhi_uuid_).shou_yang_wei_zhi_san = item.id_
+                                }else{
+                                    ypInfoList.find(i => i.biao_zhi_uuid_3 === item.biao_zhi_uuid_).liu_yang_wei_zhi_san = item.id_
+                                }
+                            }
+                            let temp4 = ypInfoList.find(i => i.biao_zhi_uuid_4 === item.biao_zhi_uuid_)
+                            if(temp4){
+                                if(item.shi_fou_liu_yang_ === '否'){
+                                    ypInfoList.find(i => i.biao_zhi_uuid_4 === item.biao_zhi_uuid_).shou_yang_wei_zhi_si = item.id_
+                                }else{
+                                    ypInfoList.find(i => i.biao_zhi_uuid_4 === item.biao_zhi_uuid_).liu_yang_wei_zhi_si = item.id_
+                                }
+                            }
+                            
+                    })
+
+                    repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+
+                    /* 2、封装样品登记表对象,插入样品登记表 顺便封装任务分配表  */
+                    let ypdjb = []
+                    let rws = []
+                    result.forEach((item,index)=>{
+                        // 2-1:统计每个样品有多少类型[数量]
+                        let lxList = []
+                        let ypggList = []
+                        let liuYangList = []
+                        lxList.push(item.yang_pin_lei_xing,item.yang_pin_lei_er_,item.yang_pin_lei_san_,item.yang_pin_lei_si_)
+                        ypggList.push(item.yang_pin_gui_ge_,item.yang_pin_gui_ge_e,item.yang_pin_gui_ge_s,item.yang_pin_gui_si_)
+                        // todo 待优化
+                        if(ypInfoList[index].liu_yang_shu_lian_yi != ' ml/支×1支'){
+                            liuYangList.push(ypInfoList[index].liu_yang_shu_lian_yi)
                         }
-                        let content = {
-                          id_ : cfwzIdList[num][index]
+                        if(ypInfoList[index].liu_yang_shu_lian_er != ' ml/支×1支'){
+                            liuYangList.push(ypInfoList[index].liu_yang_shu_lian_er)
                         }
-                        let params = {
-                          wei_zhi_zhuang_ta : "占用",
-                          ru_ku_shi_jian_ : this_.dateFormat(),
-                          yang_pin_bian_hao : ypbh[num],
-                          yang_pin_ming_che : lhypmcList[num],
-                          shi_fou_liu_yang_ : isLiuYang
+                        if(ypInfoList[index].liu_yang_shu_lian_san != ' ml/支×1支'){
+                            liuYangList.push(ypInfoList[index].liu_yang_shu_lian_san)
                         }
-                        let o = {
-                          tableName:'t_ypcfwz',
-                          paramWhere:content,
-                          paramCond : params
+                        if(ypInfoList[index].liu_yang_shu_lian_si != ' ml/支×1支'){
+                            liuYangList.push(ypInfoList[index].liu_yang_shu_lian_si)
                         }
-                        repostCurd('update',JSON.stringify(o)).then(res=>{
-                          console.log("空余位置修改")
-                        })
-                      
-                      } else if (resArr[0].wei_zhi_zhuang_ta == "占用") {
-                        // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
-                        let cfNewList = []
-                        let cfNew = {}
-                        cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
-                        cfNew["wei_zhi_"] = resArr[0].wei_zhi_
-                        cfNew["qu_yu_"] = resArr[0].qu_yu_
-                        cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
-                        cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
-                        cfNew["ceng_hao_"] = resArr[0].ceng_hao_
-                        cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_
-                        cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
-                        cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
-                        cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
-                        cfNew["yang_pin_bian_hao"] = ypbh[num]
-                        cfNew["shi_fou_guo_shen_"] = '启用'
-                        // cfNew["yang_pin_bian_hao"] = lhypIdList[num]
-                        cfNew["yang_pin_ming_che"] = lhypmcList[num]
-                        cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
-                        cfNew["shi_fou_liu_yang_"] = isLiuYang
-                        cfNew["biao_zhi_uuid_"] = uuidList[num]
-                        cfNewList.push(cfNew)
-                        let uuid = cfNew["biao_zhi_uuid_"];
-                        // console.log('货位:',cfNewList)
-
-
-                        repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
-                          let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'";
-                          repostCurd('sql', selectsql).then(res => {
-                            // let dataid = res.variables.data[0].id_;
-                            let data = res.variables.data;
-                            // console.log('data:',data)
-                            let suchAs = '{"biao_zhi_uuid_":"' + uuid + '"}'
-                            // console.log(data.length,changeWeiZhi,changesyWeiZhi,firstIfEmpty,secondIfEmpty)
-                            if(data.length == 1 && changeWeiZhi && firstIfEmpty){
-                              repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'"}}').then(res=>{
-                                console.log('One 存放位置',res)
-                              })
-                            }else if(data.length == 1 && changesyWeiZhi && secondIfEmpty){
-                              repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"liu_yang_cun_fang":"'+data[0].id_+'"}}').then(res=>{
-                                console.log('One 留样位置',res)
-                              })
-                            }else if(data.length == 2 && changeWeiZhi && changesyWeiZhi){
-                              let whereL = []
-                              whereL.push(suchAs)
-                              repostCurd('updates', '{"tableName":"t_lhypdjb","paramWhere":['+whereL+'],"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'","liu_yang_cun_fang":"'+data[1].id_+'"}}').then(res=>{
-                                console.log('Two 收样留样位置',res)
-                              })
+                        // liuYangList.push(ypInfoList[index].liu_yang_shu_lian_yi,ypInfoList[index].liu_yang_shu_lian_er,ypInfoList[index].liu_yang_shu_lian_san,ypInfoList[index].liu_yang_shu_lian_si)
+                        let yplxz = lxList.filter(i => i).join(',')
+                        let ypggStr = ypggList.filter(i => i).join(',')
+                        let liuyangStr = liuYangList.filter(i => i).join(',')
+                        let count = lxList.filter(i => i).join(',').match(/,/g).length + 1
+                        for(let c = 0; c < count; c++){
+                            let xmmc = []
+                            xmmc.push(item.chang_gui_xiang_m,item.tao_can_ming_chen)
+                            let xiangMuZh = xmmc.filter(i => i).join(',')
+
+                            let yblx = c==0? item.yang_pin_lei_xing : c==1? item.yang_pin_lei_er_ : c==2? item.yang_pin_lei_san_ : c==3? item.yang_pin_lei_si_ :''
+                            let ystj = c==0? item.yang_ben_yun_shu_ : c==1? item.yang_pin_yun_shu_ : c==2? item.yang_pin_yun_san : c==3? item.yang_pin_yun_si_ :''
+                            let ypsl = c==0? item.shu_liang_ : c==1? item.shu_liang_er_ : c==2? item.shu_liang_san_ : c==3? item.shu_liang_si_ :''
+                            let ybgg = c==0? item.yang_pin_gui_ge_ : c==1? item.yang_pin_gui_ge_e : c==2? item.yang_pin_gui_ge_s : c==3? item.yang_pin_gui_si_ :''
+                            let sywz = c==0? ypInfoList[index].shou_yang_wei_zhi_yi : c==1? ypInfoList[index].shou_yang_wei_zhi_er : c==2? ypInfoList[index].shou_yang_wei_zhi_san : c==3? ypInfoList[index].shou_yang_wei_zhi_si :''
+                            let lycf = c==0? ypInfoList[index].liu_yang_wei_zhi_yi : c==1? ypInfoList[index].liu_yang_wei_zhi_er : c==2? ypInfoList[index].liu_yang_wei_zhi_san : c==3? ypInfoList[index].liu_yang_wei_zhi_si :''
+                            let lysl =  c==0? ypInfoList[index].liu_yang_shu_lian_yi : c==1? ypInfoList[index].liu_yang_shu_lian_er : c==2? ypInfoList[index].liu_yang_shu_lian_san : c==3? ypInfoList[index].liu_yang_shu_lian_si :''  
+                            let currentUUID = c==0? ypInfoList[index].biao_zhi_uuid_1 : c==1? ypInfoList[index].biao_zhi_uuid_2 : c==2? ypInfoList[index].biao_zhi_uuid_3 : c==3? ypInfoList[index].biao_zhi_uuid_4 :''
+                            let obj = {
+                                wei_tuo_dan_hao_ : item.wei_tuo_bian_hao_,
+                                wei_tuo_dan_wei_ : item.wtdh,
+                                lian_xi_ren_     : item.wei_tuo_fang_lian,
+                                lian_xi_dian_hua_: item.wei_tuo_lian,
+                                yang_ben_ming_che: item.yang_pin_ming_che,
+                                yang_ben_bian_hao: item.yang_pin_bian_hao,
+                                pi_hao_bian_hao_ : item.song_jian_pi_hao_,
+                                song_jian_dan_wei: item.song_jian_dan_wei,
+                                xing_ming_       : ypInfoList[index].xing_ming_,
+                                xing_bie_        : ypInfoList[index].xing_bie_,
+                                nian_ling_       : ypInfoList[index].nian_ling_,
+                                yang_ben_zhuang_t: item.yang_pin_zhuang_t,
+                                shou_yang_ri_qi_ : currentTime,
+                                bei_zhu_         : ypInfoList[index].bei_zhu_,
+                                yang_ben_lei_xing: yblx,
+                                yun_shu_tiao_jian: ystj,
+                                yang_pin_shu_lian: ypsl,
+                                yang_ben_gui_ge_s: ybgg,
+                                yan_shou_jie_guo_: ypInfoList[index].yan_shou_jie_guo_,
+                                cun_fang_wei_zhi_: sywz,
+                                liu_zhuan_zhuang_: '待检',
+                                shi_fou_liu_yang_: ypInfoList[index].shi_fou_liu_yang_,
+                                liu_yang_ri_qi_  : ypInfoList[index].liu_yang_ri_qi_,
+                                liu_yang_cun_fang: lycf,
+                                liu_yang_shu_lian: lysl,
+                                liu_yang_qi_xian : ypInfoList[index].liu_yang_qi_xian,
+                                xiao_hui_ri_qi_  : ypInfoList[index].xiao_hui_ri_qi_,
+                                fan_yang_ri_qi_  : ypInfoList[index].fan_yang_ri_qi_,
+                                fan_yang_jyr     : ypInfoList[index].fan_yang_jyr,
+                                biao_zhi_uuid_   : currentUUID,
+                                song_yang_yao_qiu: ypInfoList[index].song_yang_yao_qiu,
+                                jian_ce_xiang_mu_: xiangMuZh
                             }
-                          })
-                        })
-                      }
+                            ypdjb.push(obj)
+
+                            
+
+                        }
+                        // 2-2:封装任务分配表
+                        let rw = {
+                            yang_pin_ming_che : item.yang_pin_ming_che,
+                            yang_pin_bian_hao : item.yang_pin_bian_hao,
+                            wei_tuo_lei_xing_ : item.wei_tuo_lei_xing_,
+                            yang_pin_lei_xing : yplxz,
+                            yang_pin_gui_ge_  : ypggStr,
+                            wei_tuo_id_       : item.wtID,
+                            he_tong_id_       : item.he_tong_id_,
+                            zhuang_tai_       : '待任务分配',
+                            wan_cheng_shi_jia : item.song_jian_shi_jia,
+                            bao_gao_lei_xing_ : item.bao_gao_lei_xing_,
+                            xin_xiang_mu_ming : item.xiang_mu_ming_che,
+                            zhan_shi_biao_id_ : item.zhan_shi_biao_id_,
+                            fen_zhuang_liu_ya : liuyangStr, // todo 有问题
+                            shi_fou_jia_ji_   : item.chu_ju_bao_gao_ya,             // 是否加急【2023/2/23王嘎嘎提出】
+                            yang_pin_shu_lian : ypInfoList[index].jie_yang_shu_lian // 样品确认总数【2023/3/7王嘎嘎提出】
+                        }
+                        rws.push(rw)
+
+                        
+                        lhwtzsbID.push('{"shen_qing_id_":"' + item.zhan_shi_biao_id_ + '"}')
+                        lhwtbID.push('{"id_":"' + item.wtID + '"}')
+
+                    })
+                    // console.log('样品登记表...',ypdjb)
+                    repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
+                    
+                    
+                    /* 3、更新样品表  */
+                    // console.log('3、更新样品表',lhypIdNewList)
+                    repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+                    
+                    
+
+                    /* 4、任务分配 
+                        4-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                        4-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
+                        4-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"任务分配进行中"
+                    */
+                    // console.log('4、更改委托表的 委托状态',lhwtbID)
+                    repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
+                    // console.log("4、任务分配",rws)
+                    repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
+
+                    /* 5、更新展示表  */
+                    if(lhwtzsbID.length > 0){
+                        // console.log('5、更新展示表',lhwtzsbID)
+                        repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
                     }
-                  })
-              }
-          }
-           
-          /*
-               let ffbSql = "select * from t_lhfbb where FIND_IN_SET( parent_id_,'"+ fbbIdStr +"')"
-               repostCurd('sql',ffbSql).then(response => {
-                 let ffbList = response.variables.data
-                 if(wtdAndYpb.length>0){
-                   let jcxmArr = []
-                   wtdAndYpb.forEach(item=>{
-                     item.jian_ce_xiang_mu_.split(',').reverse().forEach(temp=>{
-                       jcxmArr.push(temp)
-                     })
-                   })
-                   let allProject = []
-                   let finalJCTask = []
-                   let processDefKeyParam = []
-                   let processFormKeyParam = []
-                   let sql111 = `select id_, defkey_, formkey_ from t_mjjcnlfw where defkey_ != '' and find_in_set(id_, '${jcxmArr.join(',')}')`
-                   repostCurd('sql', sql111).then(res => {
-                        allProject = res.variables.data
-                        wtdAndYpb.forEach(item => {
-                          let yblxArr = []
-                          let yblxStr = ''
-                          yblxArr.push(item.yang_pin_lei_xing, item.yang_pin_lei_er_, item.yang_pin_lei_san_, item.yang_pin_lei_si_)
-                          yblxStr = yblxArr.filter(s => s).join(',')
-                          let t = item.jian_ce_xiang_mu_.split(',')
-                          let ypList = ypInfoList.find(k => k.id_ === item.id_)
-                          t.forEach(i => {
-                             let fbbItem = ffbList.find(j => j.jian_ce_xiang_mu_ === i)
-                             let jcxmItem = allProject.find(k => k.id_ === i)
-                             let obj = {
-                                 jian_ce_yuan_: fbbItem.jian_ce_yuan_,
-                                 fu_he_yuan_  : fbbItem.fu_he_yuan_,
-                                 yang_pin_ming_che: item.yang_pin_ming_che,
-                                 yang_pin_bian_hao: item.yang_pin_bian_hao,
-                                 jian_ce_xiang_mu_:jcxmItem.id_,
-                                 wei_tuo_id_:item.wtID,
-                                 he_tong_id_:item.he_tong_id_,
-                                 bao_gao_bian_zhi_:ypList.bao_gao_bian_zhi_,
-                                 bao_gao_fu_he_yua:ypList.bao_gao_shen_he_y,
-                                 wei_tuo_lei_xing_:item.wei_tuo_lei_xing_,
-                                 yang_pin_lei_xing: yblxStr,
-                                 xin_xiang_mu_ming:item.xiang_mu_ming_che,
-                                 wan_cheng_shi_jia:item.song_jian_shi_jia,
-                                 zhuang_tai_:'待环境监控',
-                                 zhan_shi_biao_id_:item.zhan_shi_biao_id_
-                             }
-                             finalJCTask.push(obj)
-                             processDefKeyParam.push(jcxmItem.defkey_)
-                             processFormKeyParam.push(jcxmItem.formkey_)
-                          })
-                        })
-                       finalJCTask.forEach((item,index )=>{
-                         let obj = {
-                           tableName:"t_lhjczb",
-                           paramWhere:[item],
-                           defKey:processDefKeyParam[index],
-                           formKey:processFormKeyParam[index]
-                         }
-                       repostCurd('add', JSON.stringify(obj))
-                       })
-                   })
-                   }
-               })
-              //更新展示表
-              if(lhwtzsbID.length > 0){
-                repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"检测进行中"}}')
-              }
-              */
-          })
+                })
+            })
+
+            
+
+            
+         })
+
+
+
+
 
 
           this.$emit('callback', true)
@@ -670,7 +508,96 @@ export default {
       var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
       return year + "-" + month + "-" + day;
     },
-
+    // 根据旧位置数据生成新位置数据
+    generateNewLocation(oldLocation,sampleInfo){
+        let temp = {
+            fang_jian_lei_xin : oldLocation.fang_jian_lei_xin,
+            wei_zhi_          : oldLocation.wei_zhi_,
+            qu_yu_            : oldLocation.qu_yu_,
+            huo_jia_lei_xing_ : oldLocation.huo_jia_lei_xing_,
+            huo_jia_hao_      : oldLocation.huo_jia_hao_,
+            ceng_hao_         : oldLocation.ceng_hao_,
+            shui_ping_fen_qu_ : oldLocation.shui_ping_fen_qu_,
+            wei_zhi_bian_hao_ : oldLocation.wei_zhi_bian_hao_,
+            wei_zhi_zhuang_ta : oldLocation.wei_zhi_zhuang_ta,
+            cun_chu_tiao_jian : oldLocation.cun_chu_tiao_jian,
+            shi_fou_guo_shen_ : '启用',
+            yang_pin_bian_hao : sampleInfo.yang_pin_bian_hao,
+            yang_pin_ming_che : sampleInfo.yang_pin_ming_che,
+            ru_ku_shi_jian_   : sampleInfo.currentTime,
+            shi_fou_liu_yang_ : sampleInfo.shi_fou_liu_yang_,
+            biao_zhi_uuid_    : sampleInfo.biao_zhi_uuid_
+        }
+        return temp 
+    },
+    handleLocationInfo(currentLocation,isLiuYang,localInfo,locationIds,item,UUID,currentTime,num){
+        console.log(num,localInfo)
+        if(num > 8 || currentLocation === undefined || currentLocation === null){
+            return
+        }
+        num ++
+        if(!locationIds.has(currentLocation)){
+            locationIds.add(currentLocation)
+            // console.log(currentLocation,'不在set中')
+        }else{
+            localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ='占用'
+            // console.log('修改',currentLocation,'为占用')
+        }
+        if(localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ==='空余'){
+            let content = {
+                id_ : currentLocation
+            }
+            let params = {
+                wei_zhi_zhuang_ta : "占用",
+                ru_ku_shi_jian_ : currentTime,
+                yang_pin_bian_hao : item.yang_pin_bian_hao,
+                yang_pin_ming_che : item.yang_pin_ming_che,
+                shi_fou_liu_yang_ : isLiuYang
+            }
+            let obj = {
+                tableName:'t_ypcfwz',
+                paramWhere:content,
+                paramCond : params
+            }
+            this.emptyLocal.push(obj)
+        }else{ // 新增一条位置信息(修改它的样品编号,样品名称,入库时间,标识UUID),insert后更新样品此位置id
+            let sampleInfo = {
+                yang_pin_bian_hao : item.yang_pin_bian_hao,
+                yang_pin_ming_che : item.yang_pin_ming_che,
+                ru_ku_shi_jian_   : currentTime,
+                biao_zhi_uuid_    : UUID,
+                shi_fou_liu_yang_ : isLiuYang
+            }
+            let newLocation = this.generateNewLocation(localInfo.find(i => i.id_ === currentLocation),sampleInfo)
+            this.fullLocal.push(newLocation)
+        }
+        if(num === 2){
+            this.handleLocationInfo(item.shou_yang_wei_zhi_er,'否',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime,num)
+        }
+        if(num === 3){
+            this.handleLocationInfo(item.shou_yang_wei_zhi_san,'否',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime,num)
+        }
+        if(num === 4){
+            this.handleLocationInfo(item.shou_yang_wei_zhi_si,'否',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime,num)
+        }
+        if(num === 5){
+            this.handleLocationInfo(item.liu_yang_wei_zhi_yi,'是',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime,num)
+        }
+        if(num === 6){
+            this.handleLocationInfo(item.liu_yang_wei_zhi_er,'是',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime,num)
+        }
+        if(num === 7){
+            this.handleLocationInfo(item.liu_yang_wei_zhi_san,'是',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime,num)
+        }
+        if(num === 8){
+            this.handleLocationInfo(item.liu_yang_wei_zhi_si,'是',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime,num)
+        }
+        
+        
+        
+        
+        
+    },
 
     /* 关闭*/
     remRedar() {

+ 34 - 34
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -31,19 +31,24 @@ export default {
       if(flag){
         let sql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_  and find_in_set(ypb.yang_pin_bian_hao,'${id}') and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'`
          repostCurd('sql',sql).then(res => {
-          if (res.variables.data && res.variables.data.length > 0) {
-            for (let i in res.variables.data) {
-              res.variables.data[i].jie_yang_shu_lian = res.variables.data[i].yang_pin_zong_shu
-              res.variables.data[i].jie_yang_zhuang_t = '已确认'
-              res.variables.data[i].biao_zhi_uuid_ = this.uuid()
-              res.variables.data[i].shi_fou_liu_yang_ = '是'
-              res.variables.data[i].yan_shou_jie_guo_ = '完好'
-              res.variables.data[i].liu_yang_shu_lian = ' ml/支×1支'
-              res.variables.data[i].liu_yang_ri_qi_ = this.dateFormat()
-            //   res.variables.data[i].liu_yang_qi_xian = dayjs(res.variables.data[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            //   res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-              this.listData.push(res.variables.data[i])
-            }
+            let temp = res.variables.data
+            if(temp){
+                temp.forEach(item => {
+                    item.jie_yang_shu_lian = item.yang_pin_zong_shu
+                    item.jie_yang_zhuang_t = '已确认'
+                    item.biao_zhi_uuid_ = this.uuid()
+                    item.shi_fou_liu_yang_ = '是'
+                    item.yan_shou_jie_guo_ = '完好'
+                    item.liu_yang_shu_lian_yi = ' ml/支×1支'
+                    item.liu_yang_shu_lian_er = ' ml/支×1支'
+                    item.liu_yang_shu_lian_san = ' ml/支×1支'
+                    item.liu_yang_shu_lian_si = ' ml/支×1支'
+                    item.liu_yang_ri_qi_ = this.dateFormat()
+                    item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+                    item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+                    item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+                })
+                this.listData = temp
             }
         })
       }
@@ -142,28 +147,16 @@ export default {
               cfwzObj.push(ypInfoList[yp].shou_yang_wei_zhi) //取位置信息
   
               if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
-                if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
-                  this_.$message.error("你要留样的话,存放位置不能为空哦!")
-                  return;
-                }
+                // if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
+                //   this_.$message.error("你要留样的话,存放位置不能为空哦!")
+                //   return;
+                // }
                 if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
                   this_.$message.error("留样时必须填写留样日期!")
                   return;
                 }
-                if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
-                  this_.$message.error("留样时必须填写留样数量!")
-                  return;
-                }
-                // if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
-                //   this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
-                //   return;
-                // }
-                // if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
-                //   this_.$message.error("留样时必须填写留样期限!")
-                //   return;
-                // }
-                // if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
-                //   this_.$message.error("留样时必须填写销毁日期!")
+                // if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
+                //   this_.$message.error("留样时必须填写留样数量!")
                 //   return;
                 // }
                   cfwzObj.push(ypInfoList[yp].liu_yang_wei_zhi_)
@@ -227,6 +220,9 @@ export default {
                       }
                     }
                     for(let x = 0; x<count;x++){
+                      let xmmc = []
+                      xmmc.push(res[i].chang_gui_xiang_m,res[i].tao_can_ming_chen)
+                      let xiangMuZh = xmmc.filter(i => i).join(',')
                       let obj = {}
                       obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
                       obj["wei_tuo_dan_wei_"] = res[i].wtdh
@@ -253,14 +249,18 @@ export default {
                       obj["liu_zhuan_zhuang_"] =       '待检'
                       obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
                       obj["liu_yang_ri_qi_"]    =       ypInfoList[i].liu_yang_ri_qi_
-                      obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_wei_zhi_
-                      obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
+
+                      obj["liu_yang_cun_fang"]  =   x==0? ypInfoList[i].liu_yang_wei_zhi_yi : x==1? ypInfoList[i].liu_yang_wei_zhi_er : x==2? ypInfoList[i].liu_yang_wei_zhi_san : x==3? ypInfoList[i].liu_yang_wei_zhi_si :''
+                      obj["liu_yang_shu_lian"]  =   x==0? ypInfoList[i].liu_yang_shu_lian_yi : x==1? ypInfoList[i].liu_yang_shu_lian_er : x==2? ypInfoList[i].liu_yang_shu_lian_san : x==3? ypInfoList[i].liu_yang_shu_lian_si :''  
+
+
                       obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
                       obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
                       obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
                       obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
                       obj["biao_zhi_uuid_"]     =       ypInfoList[i].biao_zhi_uuid_
-                      obj["song_yang_yao_qiu"]  =    ypInfoList[i].song_yang_yao_qiu
+                      obj["song_yang_yao_qiu"]  =       ypInfoList[i].song_yang_yao_qiu
+                      obj["jian_ce_xiang_mu_"]  =      xiangMuZh
                       // obj["fen_zhuang_liu_ya"]  =    ypInfoList[i].fen_zhuang_liu_ya
                       changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
                       changesyWeiZhi = ypInfoList[i].liu_yang_wei_zhi_ ==''?'':ypInfoList[i].liu_yang_wei_zhi_