Răsfoiți Sursa

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

lwx 3 ani în urmă
părinte
comite
350d315fd8

+ 6 - 5
src/business/platform/form/formrender/dynamic-form/dynamic-form-table.vue

@@ -106,7 +106,7 @@
                     <template v-for="(button, b) in toolbarButtons ">
                       <template v-if="!(button.key === 'remove' && dataModel.length === 1)">
                         <el-button :key="b" :type="button.type" :icon="button.icon"
-                          @click="handleActionEvent(button, b)">
+                          @click="handleActionEvent(button, b, index)">
                           {{ button.label }}
                         </el-button>
                       </template>
@@ -521,13 +521,13 @@ export default {
       })
       return bs
     },
-    handleActionEvent(button, buttonIndex) {
+    handleActionEvent(button, buttonIndex, tableIndex) {
       // 起始下标
       let index = this.currentPage * 10 - 10 + buttonIndex
       this.actionCode = button.key === 'custom' ? (button.code || button.key + index) : button.key
       this.actionPosition = button.position || 'toolbar'
       // 前置事件
-      this.beforeScript(button, index, (result) => {
+      this.beforeScript(button, index,tableIndex, (result) => {
         this.editFromType = button.key
         if (!result) {
           return
@@ -969,7 +969,7 @@ export default {
       return true
     },
     // 前置脚本
-    beforeScript(button, index, callback) {
+    beforeScript(button, index,tableIndex, callback) {
       if (!this.hasScript()) {
         if (callback) {
           const flag = true
@@ -979,7 +979,8 @@ export default {
       }
       const params = {
         button: button,
-        index: index
+        index: index,
+        tableIndex: tableIndex
       }
       if (!callback) {
         callback = () => { }

+ 71 - 104
src/views/component/weiZhiChangGui.vue

@@ -7,7 +7,7 @@
       <!-- <input placeholder="请输入内容" :value="showValue"  id="valueDom" @click="onChange"> -->
     </div>
     <!-- <el-input></el-input> -->
-    <div class="selectArea" v-if="ifshow">
+    <div class="selectArea" v-show="ifshow">
       <div @click="close" class="close-content"> <i class="el-icon-close"></i><el-button class="closeBtn">关闭视图</el-button></div>
       <div class="top-content">
         <div class="top-title">库存可视化</div>
@@ -84,10 +84,9 @@
               v-for="(item, index) in listData"
               :key="index"
             >
-              <div>
+              <div v-loading="loading">
                 <div class="goods-level">
                   <div class="level-dsc">
-                    <!-- 第{{ index | indexfilter(listData) }}层 -->
                     第{{ index }}层
                   </div>
                   <div class="goods-list">
@@ -95,18 +94,17 @@
                       v-for="(it, index) in listData[index]"
                       :key="index"
                       class="goods-dsc"
-                      :style="{
-                        background:
-                          it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a',
-                      }"
+                      :style="{ background: it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a'}"
                       @click="closeView(it)"
                     >
                       <div class="top-dsc">
                         <div class="position">
-                          <p>名称:{{ it.wu_liao_ming_chen || 空 }}</p>
+                          <div style="text-align: left;"><div style="width:38px;display: inline-block;vertical-align: top;">名称:</div><span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.wu_liao_ming_chen || '' }} </span></div>
                           <p>编码:{{ it.wu_liao_bian_ma_ || it.wu_liao_bian_ma_ }}</p>
                           <p>位置:{{ it.wei_zhi_ || it.cun_fang_wei_zhi_ }}</p>
-                          <p>货号:{{ it.huo_hao_ || "空" }}</p>
+                          <!-- <p >货号:{{ it.huo_hao_ || "空" }}</p> -->
+                          <div style="text-align: left;"><div style="width:38px;display: inline-block;vertical-align: top;">货号:</div><span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.huo_hao_ || "空" }} </span></div>
+
                         </div>
                         <div class="right-content">
                           <p>入库批号:{{ it.ru_ku_pi_hao_ || "空" }}</p>
@@ -116,16 +114,16 @@
                         </div>
                         <!-- <div class="condition">{{ it.cun_chu_tiao_jian }}</div> -->
                       </div>
-                      <div class="bottom-dsc">
-                        <!-- {{ it.wu_pin_ming_cheng | specimenFilters }} -->
-                      </div>
+                      <!-- <div class="bottom-dsc">
+                        {{ it.wu_pin_ming_cheng | specimenFilters }} 
+                      </div> -->
                     </div>
                   </div>
                 </div>
               </div>
-              <div class="goodshelf-name" v-if="index == 1">
+              <!-- <div class="goodshelf-name" v-if="index == 1">
                 {{ desString }}
-              </div>
+              </div> -->
             </div>
           </div>
         </div>
@@ -167,7 +165,8 @@ export default {
       secondshow: false,
       ifshow: false,
       showValue: "",
-      value:"111"
+      value:"",
+      loading:true
     };
   },
   props: {
@@ -182,12 +181,12 @@ export default {
       type:Boolean,
       default: false
     },
-    component_12u7eoo:{
-      type:String,
-      default(){
-        return 111
-      }
-    }
+    // component_12u7eoo:{
+    //   type:String,
+    //   default(){
+    //     return 111
+    //   }
+    // }
     
   },
   filters: {
@@ -225,64 +224,51 @@ export default {
       }
     },
   },
-  mounted() {
-    this.loadQueryData();
-    this.firstLoadViewData();
-    this.firstLoadQuyu("试剂库1");
-  },
-  beforeDestroy() {
-    console.log(this.formData, "formData");
-    let id = this.formData.id;
-    let Status = this.formData.anNiugTai;
-    let ming_chen = this.formInline.cang_ku_ming_chen_value;
-    let weizhi = this.showValue;
-    console.log(weizhi, ming_chen);
-    return
-    if (weizhi !="" &&Status =="已入库") {
-      // 数据库更新
-      curdPost(
-        "update",
-        '{"tableName":"t_mjwlgl","paramWhere":{"wai_jian_":"' +
-          id +
-          '",},"paramCond":{"cang_ku_ming_chen":"' +
-          ming_chen +
-          '","cun_fang_wei_zhi_":"' +
-          weizhi +
-          '"}}'
-      )
-        .then((res) => {
-          this.$message({
-            message: "当前物料位置更新状态更新成功",
-            type: "success",
-          });
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    }
-  },
+  // mounted() {
+  //   this.loadQueryData();
+  //   this.firstLoadViewData();
+  //   this.firstLoadQuyu("试剂库1");
+  // },
+  // beforeDestroy() {
+  //   let id = this.formData.id;
+  //   let Status = this.formData.anNiugTai;
+  //   let ming_chen = this.formInline.cang_ku_ming_chen_value;
+  //   let weizhi = this.showValue;
+  //   // return
+  //   // if (weizhi !="" &&Status =="已入库") {
+  //   //   // 数据库更新
+  //   //   curdPost(
+  //   //     "update",
+  //   //     '{"tableName":"t_mjwlgl","paramWhere":{"wai_jian_":"' +
+  //   //       id +
+  //   //       '",},"paramCond":{"cang_ku_ming_chen":"' +
+  //   //       ming_chen +
+  //   //       '","cun_fang_wei_zhi_":"' +
+  //   //       weizhi +
+  //   //       '"}}'
+  //   //   )
+  //   //     .then((res) => {
+  //   //       this.$message({
+  //   //         message: "当前物料位置更新状态更新成功",
+  //   //         type: "success",
+  //   //       });
+  //   //     })
+  //   //     .catch((err) => {
+  //   //       console.log(err);
+  //   //     });
+  //   // }
+  // },
   methods: {
 
-    onChange(e){
-      console.log("onChange")
-
-    },
     closeView(value1) {
-      // let values = value[0];
-      // console.log(this.formData, "formData");
-      // console.log(value1);
-      //  this.showValue = value[0].wei_zhi_?value[0].wei_zhi_:value[0].cun_fang_wei_zhi_;
       if (value1.wei_zhi_) {
         this.showValue = value1.wei_zhi_;
       } else if (value1.cun_fang_wei_zhi_) {
         this.showValue = value1.cun_fang_wei_zhi_;
       }
-      //  values.cun_fang_wei_zhi_;
-      // console.log(this.showValue)
       const name = "cunFangWeiZhi"; //其他字段属性
       const value= this.showValue; //字段的值
       this.$emit("change-data", name, value);
-
       const name2 = "biaoZhunZhi"; //其他字段属性
       const value2= this.formInline.cang_ku_ming_chen_value; //字段的值
       this.$emit("change-data", name2, value2);
@@ -323,6 +309,8 @@ export default {
           return "SJG";
         case "冰箱":
           return "BX";
+        case "危化品柜":
+           return "WHPG";
         default:
           "";
       }
@@ -365,28 +353,12 @@ export default {
       const labelsMap = {}; // map存储
       let typeData = [];
       let typeArr = [];
-      var sqltype =
-        `select DISTINCT wei_zhi_ from t_ck where wei_zhi_ like ` +
-        "'%" +
-        py +
-        "%'" +
-        " and cang_ku_ming_chen ='" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' ORDER BY wei_zhi_ ASC ";
-      let classSql =
-        `select DISTINCT SUBSTR(wei_zhi_,1,6) AS wei_zhi_  from t_ck where wei_zhi_ like ` +
-        "'%" +
-        py +
-        "%'" +
-        " and cang_ku_ming_chen ='" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' ORDER BY wei_zhi_ ASC ";
+      var sqltype =`select DISTINCT wei_zhi_ from t_ck where wei_zhi_ like ` + "'%" + py + "%'" + " and cang_ku_ming_chen ='" +this.formInline.cang_ku_ming_chen_value + "' ORDER BY wei_zhi_ ASC ";
+      let classSql = `select DISTINCT SUBSTR(wei_zhi_,1,6) AS wei_zhi_  from t_ck where wei_zhi_ like ` +"'%" +  py +"%'" + " and cang_ku_ming_chen ='" +this.formInline.cang_ku_ming_chen_value + "' ORDER BY wei_zhi_ ASC ";
       curdPost("sql", sqltype).then((res) => {
         typeData = res.variables.data; //查询具体仓库某个货架的所有位置
-        // console.log(typeData, "位置");
         curdPost("sql", sql).then((res) => {
           datas = res.variables.data; //具体仓库某个货架的所有物料数据
-          // console.log(datas, "数据");
           typeData.forEach((item) => {
             typeArr[item.wei_zhi_] = [];
             if (datas.length == 0) {
@@ -404,7 +376,6 @@ export default {
               });
             }
           });
-          // console.log(typeArr, "22222222222222");
           curdPost("sql", classSql).then((res2) => {
             let resData = res2.variables.data;
             resData.forEach((item) => {
@@ -413,23 +384,23 @@ export default {
               labelsMap[layer] = [];
               for (var prop in typeArr) {
                 if (typeArr.hasOwnProperty(prop)) {
-                  // console.log(prop,item.wei_zhi_);
                   if (prop.includes(item.wei_zhi_)) {
                     labelsMap[layer].push(...typeArr[prop]);
-                    //  console.log(labelsMap)
                   }
                 }
               }
             });
-            // console.log(labelsMap, "数据");
             this_.listData = labelsMap;
+            console.log(this.listData)
+            if(this_.listData[1].length >0){
+              this_.loading = false;
+            }
           });
         });
       });
     },
     qu_yu_Event(e) {
-      //点击区域事件,加载可视化视\
-      console.log(this.formData, "formData");
+      //点击区域事件,加载可视化视
       let value = e.target.innerText;
       if (value.includes("(")) {
         let index = value.indexOf("(");
@@ -439,14 +410,7 @@ export default {
       let py = value.split("号")[1].replace(/^\s*/g, "");
       let quyu = this.sqlSlice(py);
       let type = (quyu + num).replace(/^\s*/g, "");
-      var sqlString =
-        `select * from t_mjwlgl where cun_fang_wei_zhi_ like  ` +
-        "'%" +
-        type +
-        "%'" +
-        "  and cang_ku_ming_chen = '" +
-        this.formInline.cang_ku_ming_chen_value +
-        "'";
+      var sqlString =`select * from t_mjwlgl where cun_fang_wei_zhi_ like  ` +"'%" +type +"%'" + "  and cang_ku_ming_chen = '" + this.formInline.cang_ku_ming_chen_value +"'";
       // console.log(sqlString, type);
       this.queryLoad(sqlString, type);
       this.formInline.qu_yu_value = value;
@@ -456,6 +420,9 @@ export default {
       this.desShow = true;
     },
     clickBtn() {
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.firstLoadQuyu("试剂库1");
       this.ifshow = !this.ifshow;
     },
   },
@@ -585,8 +552,8 @@ p {
     display: flex;
     box-sizing: border-box;
     height: calc(100vh - 240px);
-    overflow-x: hidden;
-    overflow-y: scroll;
+    // overflow-x: hidden;
+    // overflow-y: scroll;
     .black {
       position: fixed;
       top: 300px;
@@ -652,14 +619,14 @@ p {
                 display: flex;
                 justify-content: space-between;
                 font-size: 12px;
-                height: 18px;
+                // height: 18px;
                 line-height: 18px;
                 .position > p {
                   text-align: left;
                   // color: #fbe8ff;
                 }
                 .right-content > p {
-                  margin-left: 15px;
+                  // margin-left: 15px;
                   // color: #fbe8ff;
                   text-align: left;
                 }

+ 2 - 1
src/views/peopleManages/taskStatistics/index.vue

@@ -202,7 +202,7 @@ export default {
                     { prop: 'jian_ce_zhuang_ta', label: '检测状态' }
                 ]
             },
-            startDate: '2022-1-1',
+            startDate: '',
             endDate: '',
             chartData: [],
             pagination: { limit: 20, page: 1 },
@@ -383,6 +383,7 @@ export default {
     },
     created() {
         const initendDate = new Date();
+        this.startDate = initendDate.getFullYear() + '-' + (initendDate.getMonth() + 1) + '-01'
         this.endDate = initendDate.getFullYear() + '-' + (initendDate.getMonth() + 1) + '-' + initendDate.getDate()
         this.monthValues = [new Date(this.startDate), new Date(initendDate.getFullYear() + '-' + (initendDate.getMonth() + 1) + '-' + initendDate.getDate())]
         this.chartLoading()

+ 12 - 22
src/views/system/jbdScan/goods/caigourukudan.vue

@@ -29,31 +29,18 @@
                     </div>
                     <div style="font-size: 10px">
                       供应商:<span style="margin-left: 10px">{{
-                        item1[0].gong_ying_shang_
-                          | gongyingshang(gongyingshangList)
+                        item1[0].gong_ying_shang_| gongyingshang(gongyingshangList)
                       }}</span>
                     </div>
                   </div>
                   <div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
+                    <div style="margin-left: 20px;margin-right: 5px;font-size: 10px;">
                       采购订单编号:<span style="margin-left: 10px">
                         {{ item1[0].cai_gou_ding_dan_ }}</span
                       >
                     </div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
-                      日期   :<span style="margin-left: 10px">{{
+                    <div style=" margin-left: 20px; margin-right: 5px; font-size: 10px;">
+                      日期:<span style="margin-left: 10px">{{
                         item1[0].dao_ku_ri_qi_
                       }}</span>
                     </div>
@@ -61,7 +48,7 @@
                 </div>
 
                 <div>
-                  <table border="1">
+                  <table :border="1">
                     <thead>
                       <tr>
                         <th style="width: 40px">序号</th>
@@ -93,7 +80,7 @@
                         <td style="width: 60px">{{ item1[0].huo_hao_ }}</td>
                         <td style="width: 60px">{{ item1[0].pi_hao_ }}</td>
                         <td style="width: 80px">{{ item1[0].gui_ge_ }}</td>
-                        <td style="width: 120px">{{ item1[0].chang_jia_ }}</td>
+                        <td style="width: 120px">{{ item1[0].chang_jia_| gongyingshang(gongyingshangList) }}</td>
                         <td style="width: 45px">
                           {{ item1[0].dao_huo_shu_liang }}
                         </td>
@@ -102,11 +89,11 @@
                           {{ item1[0].dan_jia_han_shui_ }}
                         </td>
                         <td style="width: 45px">{{ item1[0].shui_lv_ }}</td>
-                        <td style="width: 45px">{{ item1[0].dan_jia_ }}</td>
+                        <td style="width: 45px">{{ item1[0].dan_jia_|numToFixed(item1[0].dan_jia_)}}</td>
                         <td style="width: 45px">{{ item1[0].shui_e_ }}</td>
-                        <td style="width: 45px">{{ item1[0].jin_e_ }}</td>
+                        <td style="width: 45px">{{ item1[0].jin_e_ |numToFixed(item1[0].jin_e_)}}</td>
                         <td style="width: 60px">
-                          {{ item1[0].han_shui_he_ji_ }}
+                          {{ item1[0].han_shui_he_ji_|numToFixed(item1[0].han_shui_he_ji_) }}
                         </td>
                       </tr>
                       <tr>
@@ -217,6 +204,9 @@ export default {
         }
       }
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
     bumenfilters: function (value, list) {
       for (let i = 0; i < list.length; i++) {
         if (value == list[i].ID_) {

+ 51 - 31
src/views/system/jbdScan/goods/chnangguirukudan.vue

@@ -35,24 +35,10 @@
                     </div>
                   </div>
                   <div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
-                      采购订单编号:<span style="margin-left: 10px">{{
-                        item1.cai_gou_ding_dan_
-                      }}</span>
+                    <div style="margin-left: 20px;margin-right: 5px;font-size: 10px; ">
+                      采购订单编号:<span style="margin-left: 10px;">{{item1.cai_gou_ding_dan_}}</span>
                     </div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
+                    <div style="margin-left: 20px; margin-right: 5px; font-size: 10px; ">
                       日期 :<span style="margin-left: 10px">{{
                         item1.dao_huo_ri_qi_
                       }}</span>
@@ -60,7 +46,7 @@
                   </div>
                 </div>
                 <div>
-                  <table border="1">
+                  <table :border="1">
                     <thead>
                       <tr>
                         <th style="width: 40px">序号</th>
@@ -90,19 +76,15 @@
                         <td style="width: 60px">{{ item.huo_hao_ }}</td>
                         <td style="width: 60px">{{ item.pi_hao_ }}</td>
                         <td style="width: 80px">{{ item.gui_ge_xing_hao_ }}</td>
-                        <td style="width: 120px">
-                          {{ item.gong_ying_shang_ }}
-                        </td>
+                        <td style="width: 120px"> {{ item.gong_ying_shang_| gongyingshang(gongyingshangList) }} </td>
                         <td style="width: 45px">{{ item.shu_liang_ }}</td>
                         <td style="width: 45px">{{ item.dan_wei_ }}</td>
-                        <td style="width: 60px">
-                          {{ item.dan_jia_han_shui_ }}
-                        </td>
+                        <td style="width: 60px">{{ item.dan_jia_han_shui_ }}</td>
                         <td style="width: 45px">{{ item.shui_lv_ }}</td>
-                        <td style="width: 45px">{{ item.dan_jia_ }}</td>
-                        <td style="width: 45px">{{ item.shui_e_ }}</td>
-                        <td style="width: 45px">{{ item.jin_e_ }}</td>
-                        <td style="width: 60px">{{ item.han_shui_he_ji_ }}</td>
+                        <td style="width: 45px">{{ item.dan_jia_|numToFixed}}</td>
+                        <td style="width: 45px"> {{ item.dan_jia_han_shui_|shuieToFixed(item.shu_liang_,item.dan_jia_) }}</td>
+                        <td style="width: 45px">{{ item.dan_jia_|jineToFixed(item.shu_liang_)}}</td>
+                        <td style="width: 60px">{{ item.dan_jia_han_shui_|jineToFixed(item.shu_liang_) }}</td>
                       </tr>
                       <tr>
                         <td style="width: 30px"></td>
@@ -117,9 +99,9 @@
                         <td style="width: 60px"></td>
                         <td style="width: 45px"></td>
                         <td style="width: 45px">合计:</td>
-                        <td style="width: 45px">{{ item1.addshuie }}</td>
-                        <td style="width: 45px">{{ item1.addjine }}</td>
-                        <td style="width: 60px">{{ item1.addhanshuiheji }}</td>
+                        <td style="width: 45px">{{ item1|addshuieToFixed}}</td>
+                        <td style="width: 45px">{{ item1|addjineToFixed}}</td>
+                        <td style="width: 60px">{{ item1|addhshjToFixed }}</td>
                       </tr>
                     </tbody>
                   </table>
@@ -212,6 +194,44 @@ export default {
         }
       }
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
+    jineToFixed:function(a,b){
+     let value = (a * 1) * (b * 1);
+     
+     return value.toFixed(2)
+    },
+    shuieToFixed:function(a,b,c){
+      let jine = b*1*(c*1);
+      let hshj = b*1*(a*1);
+      let value = hshj - jine;
+      console.log(a,b,c)
+      return value.toFixed(2);
+    },
+    addshuieToFixed:function(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        adds =adds+(((item.shu_liang_*1) * (item.dan_jia_han_shui_*1)) - ((item.shu_liang_*1) * (item.dan_jia_*1)) );
+      })
+      return adds.toFixed(2);
+    },
+    addjineToFixed(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        debugger
+        adds =adds+((item.shu_liang_*1) * (item.dan_jia_*1));
+      })
+      return adds.toFixed(2);
+    },
+    addhshjToFixed(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        debugger
+        adds =adds+((item.shu_liang_*1) * (item.dan_jia_han_shui_*1));
+      })
+      return adds.toFixed(2);
+    },
     bumenfilters: function (value, list) {
       // debugger
       for (let i = 0; i < list.length; i++) {

+ 9 - 2
src/views/system/jbdScan/goods/lingliaodan.vue

@@ -73,8 +73,8 @@
                         </td>
                         <td style="width: 60px">{{ item.shu_liang_ }}</td>
                         <td style="width: 60px">{{ item.dan_wei_ }}</td>
-                        <td style="width: 60px">{{ item.dan_jia_ }}</td>
-                        <td style="width: 60px">{{ item.jin_e_ }}</td>
+                        <td style="width: 60px">{{ item.dan_jia_ |numToFixed(item.dan_jia_) }}</td>
+                        <td style="width: 60px">{{ item.dan_jia_|jineToFixed(item.shu_liang_ ) }}</td>
                         <td style="width: 80px">{{ item.yong_tu_ }}</td>
                         <td style="width: 120px">{{ item.bei_zhu_ }}</td>
                       </tr>
@@ -174,6 +174,13 @@ export default {
         return res.variables.data[0].NAME_;
       });
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
+    jineToFixed:function(a,b){
+     let value = (a * 1) * (b * 1)
+     return value.toFixed(2)
+    },
     bumenfilters: function (value, list) {
       for (let i = 0; i < list.length; i++) {
         if (value == list[i].ID_) {

+ 1 - 1
src/views/system/jbdScan/goods/liuyangData.vue

@@ -72,7 +72,7 @@
         </div>
       </div>
       <div class="body-content" v-if="viewShow">
-        <div class="right-view">
+        <div class="right-view" v-if="listData.length >0">
           <div class="goods-items">
             <div
               class="show-demo"

+ 156 - 33
src/views/system/jbdScan/goods/sampleTag.vue

@@ -3,17 +3,17 @@
     <el-dialog 
       width="21cm"
       height="10cm" 
-       :modal-append-to-body='true' :append-to-body="true" title="样品标签" :visible.sync="scanVisible">
+       :modal-append-to-body='true' :append-to-body="true" title="样品标签" :visible.sync="scanVisible" @close="sacnClose">
       <!-- 表单是否显示 -->
-      <div style="height:500px">
+      <div style="height:500px" v-if="scanVisible">
           <div ref="qrcode" id="box">
           <vue-easy-print tableShow ref="easyPrint"
             :onePageRow="onePageRow"
           >
             <div v-for="(item1, index1) in list" :key="index1"  style="display: inline-block" >
-              <div v-for="(item2, index2) in parseInt(item1.num)" :key="index2" 
-              style="display: inline-block"
-              ><!-- style="page-break-after:always" -->
+              <!-- <div v-for="(item2, index2) in parseInt(item1.num)" :key="index2" 
+              style="display: inline-block" > -->
+              <!-- style="page-break-after:always" -->
                <div class="All">
                 <div class="tagBox">
                   <div class="lh">
@@ -25,31 +25,32 @@
                       <div>样本编号:</div>
                       <div>{{ item1.serial }}</div>
                     </div>
-                    <div class="lh" style="margin-left: 4px">
+                    <!-- <div class="lh" style="margin-left: 4px">
                          <div>样品数量:</div>
                          <div>{{ index2 + 1 }}/{{ item1.num }}支</div>
-                    </div>
-                    <!-- <div class="lh" style="margin-left: 5px">
-                      <div>收样时间:</div>
-                      <div>{{ item1.num }}</div>
+                    </div> -->
+                    <!-- <div class="lh" style="margin-left: 4px">
+                      <div>送检日期:</div>
+                      <div>{{ item1.type }}</div>
                     </div> -->
                   </div>
-                  <!-- <div class="lh">
+                  <div class="lh">
                     <div>检测项目:</div>
-                    <div>{{ item1.type }}</div>
-                  </div> -->
-                  <!-- <div class="lh">
-                    <div>存储条件:</div>
                     <div>{{ item1.condition }}</div>
-                  </div> -->
+                  </div>
+                  <div class="lh">
+                    <div>送检日期:</div>
+                    <div>{{ item1.type }}</div>
+                  </div>
+                 
 
                   <div class="lh">
                     <div>流转状态:</div>
-                    <div>▢待检,▢已检,▢留样</div>
+                    <div>▢待检,▢在检,▢已检,▢留样</div>
                   </div>
                  
                   <div class="ewm">
-                    <vue-barcode :value="item1.serial" :width=1.5 :height=25 :fontSize=15 :margin=3 ></vue-barcode>
+                    <vue-barcode :value="item1.serial" :width=1.5 :height=25 :fontSize=15 :margin=3 :displayValue="false" ></vue-barcode>
                   </div>
 
                   <!-- <div
@@ -57,7 +58,7 @@
                   ></div> -->
 
 
-                </div>
+                <!-- </div> -->
                </div>
               </div>
             </div>
@@ -78,6 +79,7 @@
 import VueBarcode from 'vue-barcode';
 import vueEasyPrint from "vue-easy-print";
 import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js';
+import { resolve } from 'path';
 
 export default {
   components: {
@@ -109,9 +111,9 @@ export default {
       list: [{
         name: 5,
         serial: 5,
-        // type: 5,
-        num: 5
-        // condition: 5
+        type: 5,
+        // num: 5,
+        condition: 5
       }],
       visible: true,
       sampleShuLiangList:[]
@@ -130,21 +132,139 @@ export default {
     printDemo() {
       this.$refs.easyPrint.print()
     },
-    getInit() {
-      console.log('getInit:',this.obj)
-      this.sampleShuLiangList = []
+    async getInit() {
+      let this_ = this;
+      // console.log('getInit:',this.obj)
+      this.jcxmList = []
       var idStr = '';
-      this.obj.forEach(item=>{
+      var wjStr = '';
+      if(this.obj.length > 0 && this.obj[0].indexOf(" ") != -1){
+        this.obj.forEach(item=>{
         idStr += item.split(" ")[0] + ','
-        this.sampleShuLiangList.push(parseInt(item.split(" ")[1]))
-      })
-      idStr = idStr.substring(0,idStr.length-1);
-      if(!isNaN(this.sampleShuLiangList[0])){
-        this.getLooks(idStr,this.sampleShuLiangList)
+        wjStr += item.split(" ")[1] + ','
+        this.jcxmList.push(item.split(" ")[2].split(','))
+        })
+        idStr = idStr.substring(0,idStr.length-1);
+        wjStr = wjStr.substring(0,wjStr.length-1);
+        this.getLookJCXM(idStr,wjStr,this.jcxmList) 
       }else{
-        this.getLook(idStr)
-      }
+        let ypInfo = []
+        for(let item of this.obj){
+          let sql1 = `select yang_pin_ming_che,yang_pin_bian_hao,jian_ce_xiang_mu_ from t_mjypdjb where find_in_set(id_,'${item}')`
+          let sql2 = `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,(select group_concat(jian_ce_xiang_mu_) from t_mjypdjb where find_in_set(id_,'${item}')))`
+          let sql3 =`select wei_tuo_ri_qi_ from t_mjwtsqb where FIND_IN_SET(id_,	(select group_concat(wai_jian_) from t_mjypb where find_in_set(yang_pin_bian_hao,(select group_concat(yang_pin_bian_hao) from t_mjypdjb where find_in_set(id_,'${item}')))))`
+          await Promise.all([repostCurd('sql',sql1),repostCurd('sql',sql2),repostCurd('sql',sql3)]).then((res)=>{
+            let yp = res[0].variables.data
+            let jcxm = res[1].variables.data
+            let wtrq = res[2].variables.data
+            let xmbhIndex = 0;
+            while(xmbhIndex <jcxm.length){
+              yp.forEach((item,index)=>{
+                let count = item.jian_ce_xiang_mu_.split(',').length + xmbhIndex
+                for(;xmbhIndex<count;xmbhIndex++){
+                    let x = {
+                    yang_pin_ming_che : item.yang_pin_ming_che,
+                    yang_pin_bian_hao : item.yang_pin_bian_hao,
+                    xiang_mu_bian_hao : jcxm[xmbhIndex].xiang_mu_bian_hao,
+                    wei_tuo_ri_qi_    : wtrq[index].wei_tuo_ri_qi_
+                    }
+                    ypInfo.push(x)
+                }
+              })
+            }
+            
+          })
+        }
+          this_.getLook2(ypInfo)
+       
+        /*
+        let ypInfo = []
+        let promiseArr = [];
+        let p = new Promise((resolve,reject) =>{
+              let sql1 = `select yang_pin_ming_che,yang_pin_bian_hao,jian_ce_xiang_mu_ from t_mjypdjb where find_in_set(id_,'${this.obj}')`
+              repostCurd('sql',sql1).then(res=>{
+                const data =  res.variables.data 
+                data.forEach((item,index)=>{
+                  let sql2 =  `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${item.jian_ce_xiang_mu_}')`
+                  repostCurd('sql',sql2).then(r=>{
+                    let result = r.variables.data
+                    data[index].xiang_mu_bian_hao = result
+                  })
+                })
+                this_.ypInfo = data
+                // console.log(this_.ypInfo)
+              })
+        })
+        promiseArr.push(p)
+        Promise.all([p]).then(([res]) =>{
+          console.log(res)
+          this_.getLook2(this_.ypInfo);
+        })
+        */
 
+      }
+    },
+    getLook2(data){
+      let list = []
+      data.forEach(item=>{
+        let o = {
+          name: item.yang_pin_ming_che,
+          serial: item.yang_pin_bian_hao,
+          type: item.wei_tuo_ri_qi_,
+          condition: item.xiang_mu_bian_hao
+        }
+        list.push(o)
+      })
+      this.list = list;
+    },
+    getLookJCXM(id,wjStr,jcxmList){
+      // console.log(id,wjStr,jcxmList)
+      let jcxmSQL = `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${jcxmList}')`
+      let sql = `select yang_pin_ming_che,yang_pin_bian_hao from t_mjypb where find_in_set(id_,'${id}')`
+      let wtsql = `select wei_tuo_ri_qi_ from t_mjwtsqb where find_in_set(id_,'${wjStr}')`
+      Promise.all([repostCurd("sql", jcxmSQL),repostCurd("sql", sql),repostCurd('sql',wtsql)]).then((res1,res2,res3)=>{
+          // console.log(res1[0].variables.data)
+          // console.log(res1[1].variables.data)
+          // console.log(res1[2].variables.data)
+          let jcxmInfo = res1[0].variables.data
+          let ypInfo = res1[1].variables.data
+          let rq = res1[2].variables.data
+          let list = []
+          ypInfo.forEach((item,index) => {
+            rq.forEach((a,b)=>{
+              jcxmInfo.forEach((it,ind)=>{
+              let o = {
+                  name: item.yang_pin_ming_che,
+                  serial: item.yang_pin_bian_hao,
+                  type: a.wei_tuo_ri_qi_,
+                  condition: it.xiang_mu_bian_hao
+                }
+                list.push(o)
+            })
+            })
+          })
+          this.list = list
+      })
+      /*
+      let sql = `select * from t_mjypb where find_in_set(id_,'${id}')`
+      repostCurd("sql", sql).then(res => {
+          const data = res.variables.data
+          let list = []
+          data.forEach((item,index) => {
+            let num = ShuLiangList[index]
+            if(typeof(num) == 'number'){
+                let o = {
+                  name: item.yang_pin_ming_che,
+                  serial: item.yang_pin_bian_hao,
+                  // type: item.jian_ce_xiang_mu_,
+                  num: num,
+                  // condition: item.yang_ben_yun_shu_
+                }
+                list.push(o)
+            }
+          })
+          this.list = list
+      })*/
     },
     getLooks(id,ShuLiangList) {
       let sql = `select * from t_mjypb where find_in_set(id_,'${id}')`
@@ -187,6 +307,9 @@ export default {
           })
           this.list = list
       })
+    },
+    sacnClose(){
+      this.list = []
     }
   }
 }