Просмотр исходного кода

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

cfort 3 лет назад
Родитель
Сommit
0959b12226

+ 11 - 8
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
@@ -793,9 +793,11 @@ export default {
      */
     formatterOptions(value, options, valueKey = 'value', labelKey = 'label') {
       const optionObj = {}
-      options.map(option => {
-        optionObj[option[valueKey]] = option[labelKey]
-      })
+      if(options){
+        options.map(option => {
+          optionObj[option[valueKey]] = option[labelKey]
+        })
+      }
       const aryValue = value.split(',')
       const res = aryValue.map((v) => {
         return optionObj[v] || v
@@ -969,7 +971,7 @@ export default {
       return true
     },
     // 前置脚本
-    beforeScript(button, index, callback) {
+    beforeScript(button, index,tableIndex, callback) {
       if (!this.hasScript()) {
         if (callback) {
           const flag = true
@@ -979,7 +981,8 @@ export default {
       }
       const params = {
         button: button,
-        index: index
+        index: index,
+        tableIndex: tableIndex
       }
       if (!callback) {
         callback = () => { }

+ 163 - 0
src/views/component/taocans.vue

@@ -0,0 +1,163 @@
+<template>
+    <div> 
+   <el-button type="success" @click="firstLoadQuyu()">查询</el-button> 
+  <el-table
+      :data="datase"
+      style="width: 100%,height:100%"
+      size="max"
+      
+      :span-method="objectSpanMethod"
+    >     <el-table-column
+          prop="tao_can_ming_chen"
+          label="套餐名称"
+          key="tao_can_ming_chen"
+          align="center"
+          :width=" 120 "
+        >
+      </el-table-column>
+      <el-table-column
+          prop="xiang_mu_ming_che"
+          label="检测项目"
+          key="xiang_mu_ming_che"
+          align="center"
+          :width=" 120 "
+        > </el-table-column>
+       <el-table-column
+          prop="jian_ce_fang_fa_"
+          label="检测方法"
+          key="jian_ce_fang_fa_"
+          align="center"
+          :width=" 120 "
+        > </el-table-column>
+        <el-table-column
+          prop="xiang_mu_dan_jia_"
+          label="项目单价(元)"
+          key="xiang_mu_dan_jia_"
+          align="center"
+          :width=" 120 "
+        > </el-table-column>
+        <el-table-column
+          prop="zhe_hou_jia_ge_"
+          label="折后价格(元)"
+          key="zhe_hou_jia_ge_"
+          align="center"
+          :width=" 120 "
+        > </el-table-column>
+    </el-table> 
+  </div>
+</template>
+
+<script>
+  import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+  export default {
+    data() {
+      return {
+        tableData: [{ 
+          id: '12987122',
+          name: '王小虎',
+          amount1: '234',
+          amount2: '3.2',
+          amount3: 10
+        }, {
+          id: '12987123',
+          name: '王小虎',
+          amount1: '165',
+          amount2: '4.43',
+          amount3: 12
+        }, {
+          id: '12987124',
+          name: '王小虎',
+          amount1: '324',
+          amount2: '1.9',
+          amount3: 9
+        }, {
+          id: '12987125',
+          name: '王小虎',
+          amount1: '621',
+          amount2: '2.2',
+          amount3: 17
+        }, {
+          id: '12987126',
+          name: '王小虎',
+          amount1: '539',
+          amount2: '4.1',
+          amount3: 15
+        }],
+        datase:[],
+        tableheader:[],
+        rowNumArr: [],
+        inde: 0,
+        spanArr:[],
+          pos:0,
+      };
+    },
+    props: {
+  field: Object,
+  formData: {
+    type: Object,
+    default() {
+      return {}
+    }
+  },
+  readonly: {
+    type: Boolean,
+    default: false,
+  }
+},
+mounted(){   
+  let this_= this;
+  setTimeout(()=>{
+      this_.load();
+  },2000)
+      // let sqlString = `select * from t_bjd where id_='${this.formData.id}' order by create_time_ asc`;
+     // let sqlString =`select  tc.tao_can_ming_chen,zb.xiang_mu_ming_che,jian_ce_fang_fa_,xiang_mu_dan_jia_,zhe_hou_jia_ge_  from  t_jctc   tc join t_tczb  zb on  tc.id_=zb.parent_id_  where  he_tong_bian_hao_='C2023608'`
+      // this.tableheader = Object.keys(Object.assign({},...this.datase))
+
+},
+    methods: {  
+      firstLoadQuyu(){
+          this.load();
+      },      
+      load(){
+          let this_ = this;
+          let sqlString =`select  tc.tao_can_ming_chen,zb.xiang_mu_ming_che,jian_ce_fang_fa_,xiang_mu_dan_jia_,zhe_hou_jia_ge_  from  t_jctc   tc join t_tczb  zb on  tc.id_=zb.parent_id_  where  he_tong_bian_hao_='${this_.formData.heTongBianHao}'`
+      curdPost("sql", sqlString).then((response) => {
+          this_.datase = response.variables.data;
+          this_.getSpanArr(this_.datase)
+      })
+      },
+      getSpanArr(data) {
+          this.spanArr =[];
+          for (var i = 0; i < data.length; i++) {
+              console.log(i)
+              if (i === 0) {
+                  this.spanArr.push(1);
+                  this.pos = 0;
+              } else {
+              // 判断当前元素与上一个元素是否相同
+              //这里的groupName是第一列的属性,我用来判断是否相同。
+              if (data[i].tao_can_ming_chen === data[i - 1].tao_can_ming_chen) {
+                  this.spanArr[this.pos] += 1;
+                  this.spanArr.push(0);
+              } else {
+                  this.spanArr.push(1);
+                  this.pos = i;
+              }
+              }
+          }
+      },
+  objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0) {
+          const _row = this.spanArr[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+          // _row = 0,_col = 0 表示这一次不合并,不显示,
+          // _row = 2,_col = 1 表示这一次合并第一列的两行
+          rowspan: _row,
+          colspan: _col,
+          };
+      }
+  },
+  }
+}
+</script>

+ 89 - 166
src/views/component/weiZhiChangGui.vue

@@ -1,14 +1,13 @@
 <template>
   <div class="sample-content">
-    <!-- 表格組件 -->
-    <!-- <div @dblclick="clickBtn">{{ showValue }}</div> -->
     <div @click="clickBtn" style="cursor: pointer;" >
       <div >点击视图选择位置</div>
-      <!-- <input placeholder="请输入内容" :value="showValue"  id="valueDom" @click="onChange"> -->
     </div>
-    <!-- <el-input></el-input> -->
     <div class="selectArea" v-if="ifshow">
-      <div @click="close" class="close-content"> <i class="el-icon-close"></i><el-button class="closeBtn">关闭视图</el-button></div>
+      <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>
         <div class="query-content">
@@ -58,18 +57,16 @@
           <ul class="list-items">
             <li
               class="list-item quyu-item"
-              :style="{
-                background: quyuShow == item.qu_yu_ ? '#FF9900' : '#e5baba',
-              }"
+              :style="{background: quyuShow == item.qu_yu_ ? '#FF9900' : '#e5baba'}"
               @click="qu_yu_Event"
               v-for="item in quyu_arr"
               :key="item.qu_yu_"
             >
-              <div v-if="item.qu_yu_.includes('冰箱')">
+              <div v-show="item.qu_yu_.includes('冰箱')">
                 {{ item.qu_yu_ | freezerFilters }}({{ item.cun_chu_tiao_jian }})
               </div>
 
-              <div v-if="!item.qu_yu_.includes('冰箱')">
+              <div v-show="!item.qu_yu_.includes('冰箱')">
                 {{ item.qu_yu_ | freezerFilters }}
               </div>
             </li>
@@ -87,7 +84,6 @@
               <div>
                 <div class="goods-level">
                   <div class="level-dsc">
-                    <!-- 第{{ index | indexfilter(listData) }}层 -->
                     第{{ index }}层
                   </div>
                   <div class="goods-list">
@@ -95,18 +91,21 @@
                       v-for="(it, index) in listData[index]"
                       :key="index"
                       class="goods-dsc"
-                      :style="{
-                        background:
-                          it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a',
-                      }"
+                      :style="{ background:(it.wu_liao_ming_chen) ? '#67c23a':'#e6a23c'}"
                       @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>
+                          <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>
@@ -114,18 +113,14 @@
                           <p>有效期:{{ it.you_xiao_qi_ || "空" }}</p>
                           <p>库存量:{{ it.ku_cun_liang_ || "空" }}</p>
                         </div>
-                        <!-- <div class="condition">{{ it.cun_chu_tiao_jian }}</div> -->
-                      </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>
@@ -162,12 +157,11 @@ export default {
       selectActive: "",
       cenghao: [],
       warehouse: [],
-      loading: false,
       pagination: {},
       secondshow: false,
       ifshow: false,
       showValue: "",
-      value:"111"
+      value:"",
     };
   },
   props: {
@@ -182,13 +176,6 @@ export default {
       type:Boolean,
       default: false
     },
-    component_12u7eoo:{
-      type:String,
-      default(){
-        return 111
-      }
-    }
-    
   },
   filters: {
     indexfilter: function (value, data) {
@@ -225,76 +212,63 @@ 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);
-      this.ifshow = !this.ifshow;
+      this.ifshow = false;
     },
     close() {
-      this.ifshow = !this.ifshow;
+      this.ifshow = false;
     },
-    firstLoadQuyu(cang_ku) {
+    async firstLoadQuyu(cang_ku) {
       let sqlString = `select distinct qu_yu_,cun_chu_tiao_jian from t_ck where cang_ku_ming_chen = '${cang_ku}' order by qu_yu_ asc`;
       var this_ = this;
-      curdPost("sql", sqlString).then((response) => {
+      await curdPost("sql", sqlString).then((response) => {
         this_.quyu_arr = response.variables.data;
         if (!this.firstLoadActive) {
           this_.formInline.qu_yu_value = "";
@@ -308,11 +282,7 @@ export default {
       this.selectActive = 1;
       this.firstLoadActive = true;
       this.quyuShow = "1号试剂柜";
-      var sqlString =
-        "select * from t_mjwlgl where cang_ku_ming_chen = '试剂库1'  and cun_fang_wei_zhi_ like" +
-        "'%" +
-        "SJG1" +
-        "%'";
+      var sqlString ="select * from t_mjwlgl where cang_ku_ming_chen = '试剂库1'  and cun_fang_wei_zhi_ like" +"'%" +"SJG1" +"%'";
       this.queryLoad(sqlString, "SJG1");
     },
     sqlSlice(value) {
@@ -323,15 +293,17 @@ export default {
           return "SJG";
         case "冰箱":
           return "BX";
+        case "危化品柜":
+           return "WHPG";
         default:
           "";
       }
     },
-    loadQueryData() {
+    async loadQueryData() {
       //查询选择仓库数据查询
       var sqlString = "select distinct cang_ku_ming_chen from t_ck ";
       var this_ = this;
-      curdPost("sql", sqlString).then((response) => {
+      await curdPost("sql", sqlString).then((response) => {
         this_.cangkuOption = response.variables.data;
         this_.cangkuOption.forEach((item, index) => {
           if (!item) {
@@ -344,49 +316,29 @@ export default {
       this.desShow = false;
       //头部按钮查询事
       // var sqlString = `select * from t_mjwlgl where cang_ku_ming_chen = '${this.formInline.cang_ku_ming_chen_value}' and qu_yu_ = '${this.formInline.qu_yu_value}'`;
-      let py = this.formInline.qu_yu_value.split("号")[1].replace(/^\s*/g, "");
-      let num = this.formInline.qu_yu_value.split("号")[0];
+      let qu_yu_value = this.formInline.qu_yu_value
+      let py = qu_yu_value.split("号")[1].replace(/^\s*/g, "");
+      let num = qu_yu_value.split("号")[0];
       let quyu = this.sqlSlice(py);
       let type = (quyu + num).replace(/^\s*/g, "");
-      var sqlString =
-        "select * from t_mjwlgl where cang_ku_ming_chen = '" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' and cun_fang_wei_zhi_ like " +
-        "'%" +
-        type +
-        "%'";
+      var sqlString ="select * from t_mjwlgl where cang_ku_ming_chen = '" +this.formInline.cang_ku_ming_chen_value +"' and cun_fang_wei_zhi_ like " +"'%" +type +"%'";
       this.queryLoad(sqlString, type);
     },
-    queryLoad(sql, py) {
-      //数据加载
+    async queryLoad(sql, py) {//数据加载   
       let this_ = this;
       var datas = [];
       this.cenghao = [];
       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 ";
-      curdPost("sql", sqltype).then((res) => {
+      this_.listData = [];
+      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 ";
+      await  curdPost("sql", sqltype).then((res) => {
         typeData = res.variables.data; //查询具体仓库某个货架的所有位置
-        // console.log(typeData, "位置");
-        curdPost("sql", sql).then((res) => {
+      });
+      await curdPost("sql", sql).then((res) => {
           datas = res.variables.data; //具体仓库某个货架的所有物料数据
-          // console.log(datas, "数据");
           typeData.forEach((item) => {
             typeArr[item.wei_zhi_] = [];
             if (datas.length == 0) {
@@ -404,8 +356,8 @@ export default {
               });
             }
           });
-          // console.log(typeArr, "22222222222222");
-          curdPost("sql", classSql).then((res2) => {
+        });
+      await curdPost("sql", classSql).then((res2) => {
             let resData = res2.variables.data;
             resData.forEach((item) => {
               let layer = item.wei_zhi_;
@@ -413,23 +365,18 @@ 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)
           });
-        });
-      });
     },
     qu_yu_Event(e) {
-      //点击区域事件,加载可视化视\
-      console.log(this.formData, "formData");
+      //点击区域事件,加载可视化视
       let value = e.target.innerText;
       if (value.includes("(")) {
         let index = value.indexOf("(");
@@ -439,15 +386,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 +
-        "'";
-      // console.log(sqlString, type);
+      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 +"'";
       this.queryLoad(sqlString, type);
       this.formInline.qu_yu_value = value;
       this.quyuShow = value;
@@ -456,12 +395,15 @@ export default {
       this.desShow = true;
     },
     clickBtn() {
-      this.ifshow = !this.ifshow;
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.firstLoadQuyu("试剂库1");
+      this.ifshow = true;
     },
   },
   watch: {
     //监控仓库名称变化 触发第一次加载数据
-    "formInline.cang_ku_ming_chen_value": async function (newdata) {
+    "formInline.cang_ku_ming_chen_value": function (newdata) {
       this.firstLoadQuyu(newdata);
     },
     "formInline.qu_yu_value": function (newdata) {
@@ -469,9 +411,6 @@ export default {
       this.quyuShow = newdata;
       this.firstLoadActive = false;
     },
-    // formData(val) {
-    //   // console.log(val, "watching");
-    // },
   },
 };
 </script>
@@ -489,7 +428,7 @@ p {
   right: 100px;
   top: 50px;
   //
-   background: #f56c6c;
+  background: #f56c6c;
   font-size: 16px;
   padding:0px 4px;
   border-radius: 5px;
@@ -552,24 +491,9 @@ p {
         line-height: 30px;
         margin-left: 20px;
         margin-bottom: 6px;
-        /* margin-top: 6px; */
         border-radius: 10px;
         position: relative;
         .tiaojian {
-          // position: absolute;
-          // right: 0px;
-          // top: 0px;
-          // background-color: #f56c6c;
-          // border-radius: 10px;
-          // color: #fff;
-          // display: inline-block;
-          // font-size: 12px;
-          // height: 18px;
-          // line-height: 18px;
-          // padding: 0 6px;
-          // text-align: center;
-          // white-space: nowrap;
-          // border: 1px solid #fff;
           font-size: 12px;
         }
       }
@@ -585,8 +509,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;
@@ -609,7 +533,7 @@ p {
       width: 100%;
       .goods-items {
         width: 100%;
-        overflow-x: hidden;
+        overflow: hidden;
         border: solid 2px rgb(202, 236, 247);
         display: flex;
         flex-direction: column-reverse;
@@ -618,7 +542,6 @@ p {
           border-bottom: 1px solid bisque;
           margin: 0 auto;
           text-align: center;
-          // overflow-y: scroll;
           .goods-level {
             display: flex;
             position: relative;
@@ -652,14 +575,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;
                 }

+ 27 - 89
src/views/component/wuliaoPosition.vue

@@ -1,7 +1,5 @@
 <template>
   <div class="sample-content">
-    <!-- 表格組件 -->
-    <!-- <div @dblclick="clickBtn">{{ showValue }}</div> -->
     <div @click="clickBtn" style="cursor: pointer">
       <el-input
         placeholder="请输入内容"
@@ -9,7 +7,6 @@
         id="valueDom"
       ></el-input>
     </div>
-    <!-- <el-input></el-input> -->
     <div class="selectArea" v-if="ifshow">
       <div @click="close" class="close-content">
         <i class="el-icon-close"></i><el-button class="closeBtn">关闭视图</el-button>
@@ -100,22 +97,25 @@
                       v-for="(it, index) in listData[index]"
                       :key="index"
                       class="goods-dsc"
-                      :style="{
-                        background:
-                          it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a',
-                      }"
+                      :style="{ background:(it.wu_liao_ming_chen) ? '#67c23a':'#e6a23c'}"
                       @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>
+                          <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>
@@ -223,50 +223,13 @@ export default {
       }
     },
   },
-  mounted() {
-    this.loadQueryData();
-    this.firstLoadViewData();
-    this.firstLoadQuyu("试剂库1");
-    console.log(this.formData, "formData");
-  },
-  updated() {
-    console.log(this.formData, "formData1");
-  },
-  // 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);
-  //   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");
   // },
-  methods: {
+   methods: {
     closeView(value) {
-      // let values = value[0];
-      // console.log(value);
-      //  this.showValue = value[0].wei_zhi_?value[0].wei_zhi_:value[0].cun_fang_wei_zhi_;
       if (value.wei_zhi_) {
         this.showValue = value.wei_zhi_;
       } else if (value.cun_fang_wei_zhi_) {
@@ -301,11 +264,7 @@ export default {
       this.selectActive = 1;
       this.firstLoadActive = true;
       this.quyuShow = "1号试剂柜";
-      var sqlString =
-        "select * from t_mjwlgl where cang_ku_ming_chen = '试剂库1'  and cun_fang_wei_zhi_ like" +
-        "'%" +
-        "SJG1" +
-        "%'";
+      var sqlString = "select * from t_mjwlgl where cang_ku_ming_chen = '试剂库1'  and cun_fang_wei_zhi_ like" + "'%" +"SJG1" +"%'";
       this.queryLoad(sqlString, "SJG1");
     },
     sqlSlice(value) {
@@ -336,18 +295,11 @@ export default {
     onSubmits() {
       this.desShow = false;
       //头部按钮查询事
-      // var sqlString = `select * from t_mjwlgl where cang_ku_ming_chen = '${this.formInline.cang_ku_ming_chen_value}' and qu_yu_ = '${this.formInline.qu_yu_value}'`;
       let py = this.formInline.qu_yu_value.split("号")[1].replace(/^\s*/g, "");
       let num = this.formInline.qu_yu_value.split("号")[0];
       let quyu = this.sqlSlice(py);
       let type = (quyu + num).replace(/^\s*/g, "");
-      var sqlString =
-        "select * from t_mjwlgl where cang_ku_ming_chen = '" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' and cun_fang_wei_zhi_ like " +
-        "'%" +
-        type +
-        "%'";
+      var sqlString = "select * from t_mjwlgl where cang_ku_ming_chen = '" + this.formInline.cang_ku_ming_chen_value + "' and cun_fang_wei_zhi_ like " + "'%" +type + "%'";
       this.queryLoad(sqlString, type);
     },
     queryLoad(sql, py) {
@@ -358,28 +310,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) {
@@ -397,7 +333,6 @@ export default {
               });
             }
           });
-          // console.log(typeArr, "22222222222222");
           curdPost("sql", classSql).then((res2) => {
             let resData = res2.variables.data;
             resData.forEach((item) => {
@@ -449,6 +384,9 @@ export default {
       this.desShow = true;
     },
     clickBtn() {
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.firstLoadQuyu("试剂库1");
       this.ifshow = !this.ifshow;
     },
   },
@@ -588,8 +526,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;
@@ -612,7 +550,7 @@ p {
       width: 100%;
       .goods-items {
         width: 100%;
-        overflow-x: hidden;
+        overflow: hidden;
         border: solid 2px rgb(202, 236, 247);
         display: flex;
         flex-direction: column-reverse;
@@ -644,9 +582,9 @@ p {
               cursor: pointer;
               // width: 170px;
               // height: 80px;
-              padding: 6px 12px;
+              padding: 6px 6px;
               border-radius: 5px;
-              background: #e6a23c;
+              // background: #e6a23c;
               margin-left: 12px;
               margin-top: 6px;
               //   background-color: aliceblue;
@@ -662,7 +600,7 @@ p {
                   // color: #fbe8ff;
                 }
                 .right-content > p {
-                  margin-left: 15px;
+                  margin-left: 1px;
                   // color: #fbe8ff;
                   text-align: left;
                 }

+ 64 - 46
src/views/component/yangpinchuzhijianbi.vue

@@ -81,7 +81,7 @@
           </div>
         </div>
       </div>
-      <div class="body-content" v-if="viewShow" v-loading="loading">
+      <div class="body-content" v-if="viewShow" >
         <div class="right-view">
           <div class="goods-items">
             <div class="show-demo" v-for="(item, index) in listData" :key="index">
@@ -89,10 +89,7 @@
                 <div class="goods-level">
                   <div class="level-dsc">第{{ index }}层</div>
                   <div class="goods-list">
-                    <div class="goods-dsc" v-for="(it, ind) in listData[index]" :key="ind" :style="{
-                      background:
-                        it.yang_pin_bian_hao ? '#67c23a' : '',
-                    }">
+                    <div class="goods-dsc" v-for="(it, ind) in listData[index]" :key="ind" :style="{background: it.yang_pin_bian_hao ?  '#ff9900':'#67c23a' }">
                       <div class="top-dsc">
                         <div class="position">
                           <p v-if="it.wei_zhi_zhuang_ta == '空余'">位置状态:{{it.wei_zhi_zhuang_ta }}</p>
@@ -100,7 +97,7 @@
                           <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
                           <p>存放位置:{{ it.wei_zhi_bian_hao_ }}</p>
                           <p>存储条件:{{ it.cun_chu_tiao_jian || it.cun_chu_yao_qiu_}}</p>
-                          <p>留样期限:{{ it.liu_yang_qi_xian_ }}</p>
+                          <p>入库时间:{{ it.ru_ku_shi_jian_}}</p>
                         </div>
                       </div>
                     </div>
@@ -145,12 +142,10 @@ export default {
       leixingcare: true,
       cenghao: [],
       warehouse: [],
-      loading: false,
       desString: "",
       placeValue: "点击选择位置",
       value:'',
       viewShow: false,
-      loading: true,
     };
   },
   filters: {
@@ -212,52 +207,75 @@ export default {
       }
       this.queryLoad(sql);
     },
-    queryLoad(sql) {
+    async queryLoad(sql) {
       //根据样品信息货位查询相对应的样品登记表
       var datas = [];
       var labelsMap = {}; // map存储
       var this_ = this;
       this_.listData = [];
-      curdPost("sql", sql).then((res) => {
-        datas = res.variables.data;
-        datas.forEach((item) => {
-          if (!labelsMap[item.ceng_hao_]) {
-            //没有就创建
+      await curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;   
+      });
+      datas.forEach(item=>{
+          if (!labelsMap[item.ceng_hao_]) { 
             labelsMap[item.ceng_hao_] = [];
           }
-          // 通过样品货位配置的id外键 查询样品登记表
-          console.log(this_.formInline.fang_jian_hao_value);
-          let yangpingSql = "";
-          if (this_.formInline.fang_jian_hao_value == "样品间") {
-            yangpingSql =
-              "select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +
-              item.id_ +
-              "'";
-          } else {
-            yangpingSql =
-              "select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +
-              item.id_ +
-              "'";
+      })
+      for(let i=0;i<datas.length;i++){
+        for(let k in labelsMap){
+          if(k == datas[i].ceng_hao_){
+            labelsMap[k].push(datas[i]);
           }
-
-          curdPost("sql", yangpingSql).then((res) => {
-            var resData = res.variables.data;
-            if (resData.length > 0) {
-              resData.forEach((it) => {
-                it.wei_zhi_bian_hao_ = item.wei_zhi_bian_hao_;
-                labelsMap[item.ceng_hao_].push(it);
-              });
-            } else {
-              labelsMap[item.ceng_hao_].push(item);
-            }
-          });
-        });
-        this_.listData = labelsMap;
-        this.$nextTick(() => {
-          this.loading = false;
-        });
-      });
+        }
+      }
+      this_.listData = labelsMap;
     },
+    // queryLoad(sql) {
+    //   //根据样品信息货位查询相对应的样品登记表
+    //   var datas = [];
+    //   var labelsMap = {}; // map存储
+    //   var this_ = this;
+    //   this_.listData = [];
+    //   curdPost("sql", sql).then((res) => {
+    //     datas = res.variables.data;
+    //     datas.forEach((item) => {
+    //       if (!labelsMap[item.ceng_hao_]) {
+    //         //没有就创建
+    //         labelsMap[item.ceng_hao_] = [];
+    //       }
+    //       // 通过样品货位配置的id外键 查询样品登记表
+    //       console.log(this_.formInline.fang_jian_hao_value);
+    //       let yangpingSql = "";
+    //       if (this_.formInline.fang_jian_hao_value == "样品间") {
+    //         yangpingSql =
+    //           "select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +
+    //           item.id_ +
+    //           "'";
+    //       } else {
+    //         yangpingSql =
+    //           "select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +
+    //           item.id_ +
+    //           "'";
+    //       }
+
+    //       curdPost("sql", yangpingSql).then((res) => {
+    //         var resData = res.variables.data;
+    //         if (resData.length > 0) {
+    //           resData.forEach((it) => {
+    //             it.wei_zhi_bian_hao_ = item.wei_zhi_bian_hao_;
+    //             labelsMap[item.ceng_hao_].push(it);
+    //           });
+    //         } else {
+    //           labelsMap[item.ceng_hao_].push(item);
+    //         }
+    //       });
+    //     });
+    //     this_.listData = labelsMap;
+    //     this.$nextTick(() => {
+    //       this.loading = false;
+    //     });
+    //   });
+    // },
     qu_yu_Event(e) {
       //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_
       this.huo_jia_arrEvent(e.target.innerText);
@@ -513,7 +531,7 @@ p {
               cursor: pointer;
               padding: 2px 6px;
               border-radius: 5px;
-              background: #e6a23c;
+              // background: #e6a23c;
               margin-left: 12px;
               margin-top: 6px;
               // box-sizing: border-box;

+ 70 - 46
src/views/component/yangpinchuzhiliuyang.vue

@@ -72,7 +72,7 @@
                           <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
                           <p>存放位置:{{ it.wei_zhi_bian_hao_ }}</p>
                           <p>存储条件:{{ it.cun_chu_tiao_jian || it.cun_chu_yao_qiu_}}</p>
-                          <p>留样期限:{{ it.liu_yang_qi_xian_ }}</p>
+                          <p>入库时间:{{ it.ru_ku_shi_jian_}}</p>
                         </div>
                       </div>
                     </div>
@@ -185,58 +185,81 @@ export default {
       }
       this.queryLoad(sql);
     },
-    queryLoad(sql) {
+    async queryLoad(sql) {
       //根据样品信息货位查询相对应的样品登记表
       var datas = [];
       var labelsMap = {}; // map存储
       var this_ = this;
       this_.listData = [];
-      curdPost("sql", sql).then((res) => {
-        datas = res.variables.data;
-        datas.forEach((item) => {
-          let yangpingSql;
-          if (this_.formInline.fang_jian_hao_value == "样品间") {
-            yangpingSql =
-              "select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +
-              item.id_ +
-              "'";
-          } else {
-            yangpingSql =
-              "select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +
-              item.id_ +
-              "'";
-          }
-          yangpingSql =
-            "select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +
-            item.yang_pin_bian_hao +
-            "'";
-          if (!labelsMap[item.ceng_hao_]) {
-            //没有就创建
+      await curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;   
+      });
+      datas.forEach(item=>{
+          if (!labelsMap[item.ceng_hao_]) { 
             labelsMap[item.ceng_hao_] = [];
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              } else {
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
-          } else {
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              } else {
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
           }
-        });
-        this_.listData = labelsMap;
-      });
+      })
+      for(let i=0;i<datas.length;i++){
+        for(let k in labelsMap){
+          if(k == datas[i].ceng_hao_){
+            labelsMap[k].push(datas[i]);
+          }
+        }
+      }
+      this_.listData = labelsMap;
     },
+    // queryLoad(sql) {
+    //   //根据样品信息货位查询相对应的样品登记表
+    //   var datas = [];
+    //   var labelsMap = {}; // map存储
+    //   var this_ = this;
+    //   this_.listData = [];
+    //   curdPost("sql", sql).then((res) => {
+    //     datas = res.variables.data;
+    //     datas.forEach((item) => {
+    //       let yangpingSql;
+    //       if (this_.formInline.fang_jian_hao_value == "样品间") {
+    //         yangpingSql =
+    //           "select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +
+    //           item.id_ +
+    //           "'";
+    //       } else {
+    //         yangpingSql =
+    //           "select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +
+    //           item.id_ +
+    //           "'";
+    //       }
+    //       yangpingSql =
+    //         "select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +
+    //         item.yang_pin_bian_hao +
+    //         "'";
+    //       if (!labelsMap[item.ceng_hao_]) {
+    //         //没有就创建
+    //         labelsMap[item.ceng_hao_] = [];
+    //         curdPost("sql", yangpingSql).then((res) => {
+    //           if (res.variables.data.length > 0) {
+    //             let data = res.variables.data;
+    //             item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
+    //             labelsMap[item.ceng_hao_].push(item);
+    //           } else {
+    //             labelsMap[item.ceng_hao_].push(item);
+    //           }
+    //         });
+    //       } else {
+    //         curdPost("sql", yangpingSql).then((res) => {
+    //           if (res.variables.data.length > 0) {
+    //             let data = res.variables.data;
+    //             item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
+    //             labelsMap[item.ceng_hao_].push(item);
+    //           } else {
+    //             labelsMap[item.ceng_hao_].push(item);
+    //           }
+    //         });
+    //       }
+    //     });
+    //     this_.listData = labelsMap;
+    //   });
+    // },
     qu_yu_Event(e) {
       //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_
       this.huo_jia_arrEvent(e.target.innerText);
@@ -331,7 +354,8 @@ export default {
       this.viewShow = !this.viewShow;
       this.placeValue = values[0].wei_zhi_bian_hao_;
       let this_ = this;
-      this_.$emit("input", values[0].id_); //传导
+      // this_.$emit("input", values[0].id_); //传导
+      this.$emit("change-data", "liuYangWeiZhi", values[0].id_);
     },
   },
   watch: {

+ 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()

+ 1 - 1
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -154,7 +154,7 @@ export default {
     let roleArr = this.$store.getters.userInfo.role
     // console.log(roleArr)
     for (let i = 0; i < roleArr.length; i++) {
-      if (roleArr[i].name == "系统管理角色") {
+      if (roleArr[i].name == "质量负责人") {
         this.listConfig.toolbars.push({ key: 'remove' })
         this.selection = true
         return;

+ 647 - 0
src/views/platform/bpmn/bpmInstHis/listType/CMAOjiancedangan.vue

@@ -0,0 +1,647 @@
+ <template>
+  <div>
+    <div class="heads">CMA检测档案</div>
+    <div class="top-box">
+      <span class="t-span">年份</span
+      ><el-input
+        class="inp"
+        v-model="nianfen"
+        placeholder="请输入内容"
+        clearable
+      ></el-input>
+      <span class="t-span">报告编号</span
+      ><el-input
+        class="inp"
+        v-model="bianhao"
+        placeholder="请输入内容"
+        clearable
+      >
+      </el-input>
+      <el-button class="btn" type="primary" @click="search">
+        <i class="ibps-icon-search"></i>查询
+      </el-button>
+    </div>
+    <el-table
+      :data="tableData"
+      border
+      :stripe="true"
+      style="width: 100%"
+      height="75vh"
+      :header-cell-style="{
+        color: '#000',
+        'font-size': '14px',
+        padding: '6px 6px',
+        background: '#a7d6f8 !important',
+      }"
+    >
+      <el-table-column prop="chu_ju_bao_gao_sh" label="年份" width="80">
+        <template slot-scope="scope">
+          {{ scope.row.chu_ju_bao_gao_sh | yeare("年") }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="he_tong_bian_hao_" label="合同编号" width="100">
+        <template slot-scope="scope">
+          {{ scope.row.he_tong_bian_hao_ | returnHetong(hetong) }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="150">
+      </el-table-column>
+      <el-table-column prop="jian_ce_kai_shi_s" label="检测时间" width="100">
+      </el-table-column>
+      <el-table-column
+        prop="wei_tuo_zhan_shi_"
+        label="检测委托单号"
+        width="180"
+      >
+        <template slot-scope="scope">
+          {{ scope.row.wei_tuo_zhan_shi_ | returnweituobianhao(wTBH) }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="wei_tuo_ri_qi_" label="委托日期" width="100">
+      </el-table-column>
+      <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="150">
+      </el-table-column>
+      <el-table-column prop="yang_pin_ming_che" label="样品名称" width="">
+      </el-table-column>
+      <el-table-column label="操作" align="left" width="100">
+        <template slot-scope="scope">
+          <el-popover placement="left" width="200" trigger="click">
+            <div slot="reference" class="more">
+              <i class="el-icon-caret-bottom"></i>查阅
+            </div>
+            <div
+              class="item"
+              style="color: #85ce61"
+              @click="
+                alertReport(
+                  reports.jianceshenqingdan,
+                  scope.row.jian_ce_shen_qing
+                )
+              "
+            >
+              <i class="el-icon-s-order"></i> 检测委托单
+            </div>
+            <div
+              class="item"
+              style="color: #85ce61"
+              @click="
+                alertReport(reports.hetongpingshen, scope.row.jian_ce_shen_qing)
+              "
+            >
+              <i class="el-icon-s-order"></i> 合同评审
+            </div>
+            <div>
+              <el-popover placement="left" width="200" trigger="click">
+                <div
+                  class="div_test item"
+                  style="color: #85ce61"
+                  slot="reference"
+                  @click="juTiItem(scope.row)"
+                >
+                  <i class="el-icon-s-order"></i> 检测记录
+                </div>
+                <div class="three-item">
+                  <div
+                    style="color: #85ce61; cursor: pointer"
+                    v-for="it in itemInfo"
+                    :key="it.id_"
+                    @click="formEvent(it.id_,it.shujuid)"
+                  >
+                    {{ it.jian_ce_xiang_mu_ }}记录
+                  </div>
+                </div>
+              </el-popover>
+            </div>
+            <div
+              class="item"
+              style="color: #85ce61"
+              @click="alertReport(reports.baogaoshenpibiao, scope.row.id_)"
+            >
+              <i class="el-icon-s-order"></i> 检测报告审批表
+            </div>
+            <div v-if="false">
+              <el-popover placement="left" width="200" trigger="triggerType">
+                <div
+                  class="div_test item"
+                  style="color: #85ce61"
+                  slot="reference"
+                  @click="YubaogaoItem(scope.row)"
+                >
+                  <i class="el-icon-s-order"></i> 预报告
+                </div>
+                <div class="three-item">
+                  <div
+                    style="color: #85ce61; cursor: pointer"
+                    v-for="it in yubaogaoitem"
+                    :key="it.id_"
+                    @click="yuReports(reports.yubaogao, it.id)"
+                  >
+                    {{ it.jian_ce_xiang_mu_ }}预报告记录
+                  </div>
+                </div>
+              </el-popover>
+            </div>
+            <!-- <div
+              class="item"
+              style="color: #85ce61"
+              @click="alertReport(reports.jiancebaogao, scope.row.id_)"
+            >
+            <i class="el-icon-s-order"></i> 检测报告
+            </div> -->
+              <div v-if="scope.row && scope.row.shou_quan_qian_z">
+                <el-popover placement="left" width="200" trigger="click">
+                  <div
+                    class="div_test item"
+                    style="color: #85ce61"
+                    slot="reference"
+                    @click="getFile(scope.row.shou_quan_qian_z)"
+                  >
+                    <i class="el-icon-s-order"></i> 已盖章报告
+                  </div>
+                  <div class="three-item">
+                    <div
+                      style="color: #85ce61; cursor: pointer"
+                      v-for="i in fileList"
+                      :key="i.id_"
+                      @click="preview(i)"
+                    >
+                      {{ i.fileName }}.{{ i.ext }}
+                    </div>
+                  </div>
+                </el-popover>
+            </div>
+          </el-popover>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :top="'3vh'"
+      :width="'90%'"
+      class="js-custom-dialog"
+      append-to-body
+      :fullscreen="false"
+      :visible.sync="visible"
+    >
+      <iframe
+        :src="srcUrl"
+        :height="'100%'"
+        :width="'100%'"
+        frameborder="0"
+        scrolling="no"
+      />
+    </el-dialog>
+    <div class="block">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page.sync="currentPage4"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="20"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+import GetReport from "../corresponding/getReport.js";
+import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
+export default {
+  mixins: [GetReport],
+  data() {
+    return {
+      runqianId: "",
+      total: 200,
+      currentPage4: 1,
+      visible: false,
+      reports: {
+        hetong: "",
+        hetongpingshen: "42明鉴/吴/MJT-QP-7.1-01-R02合同评审表.rpx",
+        jianceshenqingdan: "42明鉴/MJT-QP-7-01-R03 检测委托单.rpx",
+        jianceyuanshijilu: "",
+        baogaoshenpibiao: "42明鉴/吴/检测报告审批表.rpx",
+        yubaogao: "42明鉴/吴/明鉴细胞专业技术检测M预报告.rpx",
+        jiancebaogao: "42明鉴/吴/明鉴细胞专业技术检测M报告.rpx",
+      },
+      shenqingdanid: "",
+      nianfen: "",
+      danwei: "",
+      bianhao: "",
+      tableData: [],
+      itemInfo: [], // 列表内容
+      yubaogaoitem: [],
+      hetong: [],
+      triggerType: "click",
+      wTBH:[],
+      tongyonglujin: '',// 检测项目通用路径
+      srcUrl: '',
+      fileList: [],
+      fileType: '',
+      fileOption: {
+        user: {}
+      }
+    };
+  },
+  filters: {
+    returnHetong(value, arr) {
+      for (var i = 0; i < arr.length; i++) {
+        if (arr[i].id_ == value) {
+          return arr[i].he_tong_bian_hao_;
+        }
+      }
+    },
+       returnweituobianhao(value, arr) {
+      for (var i = 0; i < arr.length; i++) {
+        if (arr[i] != null && arr[i] != undefined) {
+          // console.log(arr[i].shen_qing_id_==value)
+          if (arr[i].shen_qing_id_ == value) {
+            // console.log(arr,arr[i].wei_tuo_bian_hao_ );
+            return arr[i].wei_tuo_bian_hao_;
+          }
+        }
+        
+      }
+    },
+    yeare(value, dedal) {
+      if (value == undefined || value == null || value == "") {
+        return "";
+      }
+      if (dedal == "年") {
+        return value.split("-")[0];
+      } else if (dedal == "月") {
+        return value.split("-")[0] + value.split("-")[1];
+      } else {
+        value;
+      }
+    },
+  },
+  created() {
+    let sql ="select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cma'OR lei_bie_qu_fen_yu ='CMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成')  ORDER BY create_time_ DESC limit 0,20";
+    this.loadData(sql);
+    let sumsql ="select COUNT(*) AS sum  FROM t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='CMA'OR lei_bie_qu_fen_yu ='cma')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
+    curdPost("sql", sumsql).then((response) => {
+      this.total = response.variables.data[0].sum;
+    });
+    let sql2 ="select id_,yuan_shi_ji_lu_ba FROM t_mjjcnlfw WHERE id_ ='f5a95b425d444b549d5a217d4c031855'";
+    curdPost("sql", sql2).then((response) => {
+      this.tongyonglujin = response.variables.data[0].yuan_shi_ji_lu_ba;
+    });
+  },
+  methods: {
+   async loadData(sql) {
+      // 请求表格数据函数
+      let this_ = this;
+      this.listData = [];
+     await curdPost("sql", sql).then((res) => {
+        this_.tableData = res.variables.data;
+        if (this_.tableData.length > 0) {
+          this.hetongidFn(this_.tableData);
+        } else {
+          this_.tableData = [];
+        }
+      });
+            for (let i = 0; i < this.tableData.length; i++) {
+        let sql =
+          "select wei_tuo_bian_hao_,shen_qing_id_ FROM t_mjwtzsb WHERE shen_qing_id_ ='" +
+          this.tableData[i].wei_tuo_zhan_shi_ +
+          "'";
+        await curdPost("sql", sql).then((res) => {
+          let data = res.variables.data;
+          this_.wTBH.push(data[0]);
+        });
+      }
+    },
+    hetongidFn(bianhaoArr) {
+      var sqlStr = "";
+      var this_ = this;
+      bianhaoArr.forEach((item) => {
+        sqlStr += "'" + item.he_tong_bian_hao_ + "',";
+      });
+      sqlStr = sqlStr.substring(0, sqlStr.length - 1);
+      sqlStr = "(" + sqlStr + ")";
+      let sql =
+        "select he_tong_bian_hao_,id_ from t_bjd WHERE id_ in " + sqlStr;
+      curdPost("sql", sql).then((res) => {
+        this_.hetong = res.variables.data;
+      });
+    },
+    juTiItem(info) {
+      let itemId;
+      let this_ = this;
+      this.runqianId = "";
+      this_.itemInfo =[];
+      var sql =`select jian_ce_xiang_mu2,jian_ce_xiang_si_ ,jian_ce_xiang_me_ ,jian_ce_xiang_ms_  FROM t_mjypb  WHERE  wai_jian_= (SELECT jian_ce_shen_qing  FROM t_mjjcbg  WHERE id_= '${info.id_}') AND yang_pin_bian_hao = '${info.yang_pin_bian_hao}'`;
+      curdPost("sql", sql).then((res) => {
+        itemId = res.variables.data;
+        this_.runqianId = itemId[0].jian_ce_xiang_mu2+','+itemId[0].jian_ce_xiang_si_+','+itemId[0].jian_ce_xiang_me_+','+itemId[0].jian_ce_xiang_ms_;
+        console.log(this_.runqianId)
+        var itemSql =`select a.id_,a.jian_ce_xiang_mu_ ,b.id_ as shujuid FROM t_mjjcnlfw AS a JOIN t_jchzb AS b  ON a.id_ = b.jian_ce_xiang_mu_ WHERE b.yang_pin_bian_hao = '${info.yang_pin_bian_hao}'`;
+        curdPost("sql", itemSql).then((res) => {
+          this_.itemInfo = res.variables.data;
+        });
+
+      });
+    },
+    YubaogaoItem(info) {
+      let itemId;
+      let this_ = this;
+      var sql =
+        "select b.id_ ,c.jian_ce_xiang_mu2 FROM t_mjjcbg a JOIN t_jchzb b ON a.jian_ce_shen_qing = b.shen_qing_dan_id_ JOIN t_mjypb c ON a.jian_ce_shen_qing = c.wai_jian_ WHERE a.id_ = '" +
+        info.id_ +
+        "'";
+      curdPost("sql", sql).then((res) => {
+        itemId = res.variables.data;
+        this_.runqianId = itemId[0].id_;
+        var itemSql =
+          "select * FROM t_mjjcnlfw WHERE id_ IN(" +
+          itemId[0].jian_ce_xiang_mu2 +
+          ")";
+        curdPost("sql", itemSql).then((res) => {
+          this_.itemInfo = res.variables.data;
+          for (var i = 0; i++; i < this_itemInfo) {
+            if (this_itemInfo[i].shi_fou_yu_bao_ga == "是") {
+              this_.yubaogaoitem.push(it);
+            }
+          }
+          if (this_.yubaogaoitem.length == 0) {
+            this_.triggerType = "";
+            alert("此条报告没有预报告记录");
+            return;
+          }
+        });
+      });
+    },
+    yuReports(url, id) {
+      debugger;
+      console.log(id, "检测委托单id");
+      this.alertReport(url, id);
+    },
+    formEvent(itemId,shujuid) {
+      console.log(itemId,shujuid)
+      var itemSql =`select id_,jian_ce_xiang_mu_,yuan_shi_ji_lu_ba FROM t_mjjcnlfw`;
+        curdPost("sql", itemSql).then((res) => {
+          let data = res.variables.data;
+          data.forEach(item=>{
+            if(item.id_ ==itemId){
+              this.alertReport(item.yuan_shi_ji_lu_ba?item.yuan_shi_ji_lu_ba:this.tongyonglujin,shujuid);
+            }
+          })
+        });
+      // if (itemName.includes("pH检测")) {
+      //   this.alertReport(
+      //     "42明鉴/郑/MJT-SJ-103-R01 A1 pH检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("渗透压摩尔浓度检测")) {
+      //   this.alertReport(
+      //     "42明鉴/郑/MJT-SJ-105-R01 A2 渗透压摩尔浓度检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("最低装量")) {
+      //   this.alertReport("42明鉴/张/最低装载量.rpx", shujuid);
+      // } else if (itemName.includes("无菌检测(薄膜过滤法)")) {
+      //   this.alertReport(
+      //     "42明鉴/林/MJT-SJ-102-R01 A2 无菌检测薄膜过滤法记录表.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("无菌检测(全自动微生物培养)")) {
+      //   this.alertReport(
+      //     "42明鉴/柯/无菌检测(全自动微生物培养).rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("内毒素检测(凝胶法)")) {
+      //   this.alertReport(
+      //     "42明鉴/卢/MJT-SJ-117-R01 A1 细菌内毒素(凝胶法)检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("动态显色法")) {
+      //   this.alertReport(
+      //     "42明鉴/张/动态显色法检测内毒素记录表.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("手动细胞计数")) {
+      //   this.alertReport(
+      //     "42明鉴/林/MJT-SJ-106-R01 A1 细胞计数检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("手动细胞活率")) {
+      //   this.alertReport(
+      //     "42明鉴/张/MJT-SJ-107-R01 A1 细胞活率检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("自动细胞计数和活率(台盼蓝染色法)")) {
+      //   this.alertReport(
+      //     "42明鉴/郑/MJT-SJ-118-R01  A0细胞计数和细胞活率(台盼蓝仪器法)检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("自动细胞计数和活率(双荧光染色法)")) {
+      //   this.alertReport(
+      //     "42明鉴/郑/MJT-SJ-119-R01  A0细胞计数和细胞活率(双荧光染色法)检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("牛血清白蛋白残留检测")) {
+      //   this.alertReport(
+      //     "42明鉴/张/MJT-SJ-111-R01 A1 牛血清白蛋白残留量检测.rpx",
+      //     '0c5c64b2083f43daa73d47bc1928d3ee'
+      //   );
+      // } else if (itemName.includes("青霉素残留检测")) {
+      //   this.alertReport(
+      //     "42明鉴/张/青霉素残留量检测记录表.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("支原体检测(培养法)")) {
+      //   this.alertReport(
+      //     "42明鉴/卢/MJT-SJ-104-R01 A1 支原体检测培养法记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("支原体检测(荧光PCR法)")) {
+      //   this.alertReport(
+      //     "42明鉴/卢/MJT-SJ-113-R01 A1支原体检测(荧光PCR法) 副本.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("间充质干细胞表型检测3项")) {
+      //   this.alertReport(
+      //     "42明鉴/柯/间充质干细胞表型检测3项.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("间充质干细胞表型检测5项")) {
+      //   this.alertReport(
+      //     "42明鉴/柯/间充质干细胞表型检测5项.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("间充质干细胞表型检测8项")) {
+      //   this.alertReport(
+      //     "42明鉴/柯/间充质干细胞表型检测8项.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("CIK细胞表型检测")) {
+      //   this.alertReport(
+      //     "42明鉴/林/MJT-SJ-123-R01 A0 CIK细胞表面标志物检测记录表.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("NK细胞表型检测")) {
+      //   this.alertReport(
+      //     "42明鉴/恰/MJT-SJ-124-R01  A0 NK细胞表面标志物检测记录.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("淋巴细胞表型检测")) {
+      //   this.alertReport(
+      //     "42明鉴/张/MJT-SJ-125-R01 A0 淋巴细胞表面标志物检测记录表.rpx",
+      //     shujuid
+      //   );
+      // } else if (itemName.includes("支原体检测(化学发光法)记录表")) {
+      //   this.alertReport(
+      //     "42明鉴/林/MJT-SJ-114-R01 A1 支原体检测(化学发光法)记录表.rpx",
+      //     shujuid
+      //   );
+      // }
+    },
+    selectSplit() {
+      // pin凑sql
+      var q1, q2, q3;
+      if (this.nianfen) {
+        q1 = "chu_ju_bao_gao_sh like'" + "%" + this.nianfen + "%" + "' ";
+      }
+      if (this.danwei) {
+        q2 = "wei_tuo_dan_wei_  = '" + this.danwei + "' ";
+      }
+      if (this.bianhao) {
+        q3 = "bao_gao_bian_hao_ = '" + this.bianhao + "'";
+      }
+      if (this.nianfen && this.danwei && this.bianhao) {
+        return "where " + '"+q1+"' + " and " + q2 + " and " + q3 + " and ";
+      } else if (this.nianfen && this.danwei && !this.bianhao) {
+        return "where " + q1 + " and " + q2 + " and ";
+      } else if (!this.nianfen && this.danwei && this.bianhao) {
+        return "where " + q2 + " and " + q3 + " and ";
+      } else if (this.nianfen && !this.danwei && this.bianhao) {
+        return "where " + q1 + " and " + q3 + " and ";
+      } else if (this.nianfen && !this.danwei && !this.bianhao) {
+        return "where " + q1 + " and ";
+      } else if (!this.nianfen && this.danwei && !this.bianhao) {
+        return "where " + q2 + " and ";
+      } else if (!this.nianfen && !this.danwei && this.bianhao) {
+        return "where " + q3 + " and ";
+      } else if (!this.nianfen && !this.danwei && !this.bianhao) {
+        return "where";
+      }
+    },
+    search() {
+      let moreSql = this.selectSplit();
+      var sql =
+        "select * from t_mjjcbg " +
+        moreSql +
+        " shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='CMA'OR lei_bie_qu_fen_yu ='cma')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0,20";
+      this.loadData(sql);
+    },
+    handleSizeChange(value) {
+      this.currentPage4 = 1;
+      let sql =
+        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='CMA'OR lei_bie_qu_fen_yu ='cma')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0," +
+        value;
+      this.loadData(sql);
+    },
+    handleCurrentChange(value) {
+      let sql =
+        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='CMA'OR lei_bie_qu_fen_yu ='cma')   and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit " +
+        value +
+        ", 20";
+      this.loadData(sql);
+    },
+    // 获取附件信息
+    getFile (data) {
+        this.fileList = []
+        let sql = `select id_ as id, file_name_ as fileName, ext_ as ext from ibps_file_attachment where find_in_set(id_, '${data}')`
+        curdPost('sql', sql).then(res => {
+            this.fileList = res.variables && res.variables.data
+        })
+    },
+    // 文件预览
+    preview (file) {
+        this.getOption(file)
+        this.openWindow()
+        this.fileType = ''
+    },
+    getOption (file) {
+        this.fileOption.user.id = this.$store.getters.userId
+        this.fileOption.user.name = this.$store.getters.name
+        this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${file.id}`
+        this.fileOption.editUrl = BASE_API() + SYSTEM_URL() + `/file/editCallback?fileName=${file.fileName}&fileType=${file.ext}&id=${file.id}`
+        this.fileOption.title = file.fileName
+        this.fileOption.fileType = file.ext
+        console.log(this.fileOption)
+    },
+    openWindow () {
+        let routeData = this.$router.resolve({
+            path: '/fileView',
+            query: this.fileOption
+        })
+        window.open(routeData.href);
+    }
+  },
+};
+</script>
+
+<style lang="scss">
+.heads {
+  margin-top: 5px;
+  width: 100%;
+  text-align: center;
+  font-weight: 700;
+  background-color: #f9ffff;
+  width: 100%;
+  font-size: 18px;
+}
+.tableRowClassName {
+  backface-visibility: #d9eefd;
+}
+.el-table .warning-row {
+  background: #d9eefd;
+}
+.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
+  background: #d9eefd;
+}
+.more,
+.item {
+  cursor: pointer;
+}
+.more {
+  color: #409eff;
+}
+.el-dropdown-link {
+  cursor: pointer;
+  color: #409eff;
+}
+.el-icon-arrow-down {
+  font-size: 12px;
+}
+
+.top-box {
+  margin-bottom: 20px;
+  .t-span {
+    margin: 0 6px 0 6px;
+    color: #916266;
+    font-size: 12px;
+  }
+  .btn {
+    margin-left: 10px;
+    background-color: #409eff;
+    border-color: #409eff;
+    font-size: 12px;
+    border-radius: 3px;
+    padding: 7px 15px;
+  }
+  .inp {
+    width: 150px;
+    font-size: 12px;
+    height: 28px !important;
+    line-height: 28px;
+    color: #606266;
+  }
+}
+</style>

+ 7 - 7
src/views/platform/bpmn/bpmInstHis/listType/CMAjiancedangan.vue

@@ -1,6 +1,6 @@
  <template>
   <div>
-    <div class="heads">CNASCMA检测档案</div>
+    <div class="heads">CNAS&CMA检测档案</div>
     <div class="top-box">
       <span class="t-span">年份</span
       ><el-input
@@ -264,7 +264,7 @@ export default {
             return arr[i].wei_tuo_bian_hao_;
           }
         }
-        
+
       }
     },
     yeare(value, dedal) {
@@ -281,9 +281,9 @@ export default {
     },
   },
   created() {
-    let sql ="select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNASCMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成')  ORDER BY create_time_ DESC limit 0,20";
+    let sql ="select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNAS&CMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成')  ORDER BY create_time_ DESC limit 0,20";
     this.loadData(sql);
-    let sumsql ="select COUNT(*) AS sum  FROM t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNASCMA')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
+    let sumsql ="select COUNT(*) AS sum  FROM t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNAS&CMA')  and (zhuang_tai_ ='报告待发放' or  zhuang_tai_ = '完成')";
     curdPost("sql", sumsql).then((response) => {
       this.total = response.variables.data[0].sum;
     });
@@ -536,19 +536,19 @@ export default {
       var sql =
         "select * from t_mjjcbg " +
         moreSql +
-        " shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNASCMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0,20";
+        " shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNAS&CMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0,20";
       this.loadData(sql);
     },
     handleSizeChange(value) {
       this.currentPage4 = 1;
       let sql =
-        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNASCMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0," +
+        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNAS&CMA')  and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit 0," +
         value;
       this.loadData(sql);
     },
     handleCurrentChange(value) {
       let sql =
-        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNASCMA')   and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit " +
+        "select * from t_mjjcbg WHERE shi_fou_yu_bao_ga='否' and (lei_bie_qu_fen_yu ='cnas/CMA'OR lei_bie_qu_fen_yu ='CNAS&CMA')   and (zhuang_tai_ = '报告待发放' or  zhuang_tai_ = '完成') ORDER BY create_time_ DESC limit " +
         value +
         ", 20";
       this.loadData(sql);

+ 54 - 51
src/views/sample/reservedSample.vue

@@ -106,12 +106,7 @@
             <li
               class="list-item huojia-item"
               :style="{
-                background:
-                  huojiashow ==
-                  item.huo_jia_hao_ + '号' + item.huo_jia_lei_xing_
-                    ? '#ff9900'
-                    : '#0099cc',
-              }"
+                background:huojiashow ==item.huo_jia_hao_ + '号' + item.huo_jia_lei_xing_? '#ff9900': '#0099cc',}"
               @click="huo_jia_hao_Event"
               v-for="(item, index) in huo_jia_arr"
               :key="index"
@@ -155,10 +150,7 @@
                     class="goods-dsc"
                     v-for="(it, ind) in listData[index]"
                     :key="ind"
-                    :style="{
-                      background:
-                        it.yang_pin_bian_hao ? '#67c23a' : '',
-                    }"
+                    :style="{background: it.wei_zhi_zhuang_ta == '空余' ? '#67c23a' : '#ff9900',}"
                   >
                     <div class="top-dsc">
                       <div class="position">
@@ -167,20 +159,8 @@
                         <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
                         <p>存放位置:{{ it.wei_zhi_bian_hao_ }}</p>
                         <p>存储条件:{{ it.cun_chu_tiao_jian || it.cun_chu_yao_qiu_}}</p>
-                        <p>留样期限:{{ it.liu_yang_qi_xian_ }}</p>
+                        <p>入库时间:{{ it.ru_ku_shi_jian_}}</p>
                       </div>
-                      <!-- <div class="right-content" v-if="false">
-                        <p v-if="false">编号:{{ it.liu_yang_qi_xian_ }}</p>
-                        <p>
-                          {{ it.wei_zhi_zhuang_ta || it.yang_pin_ming_che }}
-                        </p>
-                        <p>{{ it.yang_pin_ming_che|| it.wei_zhi_zhuang_ta  }}</p>
-                      </div> -->
-                      <!-- <div class="right-content">
-                        <p>
-                          {{ it.yang_pin_ming_che|| it.wei_zhi_zhuang_ta  }}
-                        </p>
-                      </div> -->
                     </div>
                   </div>
                 </div>
@@ -286,42 +266,65 @@ export default {
       }
       this.queryLoad(sql);
     },
-    queryLoad(sql) {
+    async queryLoad(sql) {
       //根据样品信息货位查询相对应的样品登记表
       var datas = [];
       var labelsMap = {}; // map存储
       var this_ = this;
       this_.listData = [];
-      curdPost("sql", sql).then((res) => {
-        datas = res.variables.data;
-        datas.forEach((item) => {
-          if (!labelsMap[item.ceng_hao_]) { //没有就创建           
+      await curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;   
+      });
+      datas.forEach(item=>{
+          if (!labelsMap[item.ceng_hao_]) { 
             labelsMap[item.ceng_hao_] = [];
           }
-          // 通过样品货位配置的id外键 查询样品登记表
-          console.log(this_.formInline.fang_jian_hao_value)
-          let yangpingSql ="";
-          if(this_.formInline.fang_jian_hao_value == "样品间"){
-            yangpingSql ="select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +item.id_ +"'";
-          }else{
-            yangpingSql ="select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +item.id_ +"'";
+      })
+      for(let i=0;i<datas.length;i++){
+        for(let k in labelsMap){
+          if(k == datas[i].ceng_hao_){
+            labelsMap[k].push(datas[i]);
           }
-          curdPost("sql", yangpingSql).then((res) => {
-            var resData = res.variables.data;
-            if (resData.length > 0) {
-              resData.forEach((it) => {
-                it.wei_zhi_bian_hao_ = item.wei_zhi_bian_hao_;
-                labelsMap[item.ceng_hao_].push(it);
-              });
-            } else {
-              labelsMap[item.ceng_hao_].push(item);
-            }
-          });
-        });
-        this_.listData = labelsMap;
-        console.log(this_.listData)
-      });
+        }
+      }
+      this_.listData = labelsMap;
     },
+    // queryLoad(sql) {
+    //   //根据样品信息货位查询相对应的样品登记表
+    //   var datas = [];
+    //   var labelsMap = {}; // map存储
+    //   var this_ = this;
+    //   this_.listData = [];
+    //   curdPost("sql", sql).then((res) => {
+    //     datas = res.variables.data;
+    //     datas.forEach((item) => {
+    //       if (!labelsMap[item.ceng_hao_]) { //没有就创建           
+    //         labelsMap[item.ceng_hao_] = [];
+    //       }
+    //       // 通过样品货位配置的id外键 查询样品登记表
+    //       console.log(this_.formInline.fang_jian_hao_value)
+    //       let yangpingSql ="";
+    //       if(this_.formInline.fang_jian_hao_value == "样品间"){
+    //         yangpingSql ="select * from t_mjypdjb WHERE shou_yang_wei_zhi = '" +item.id_ +"'";
+    //       }else{
+    //         yangpingSql ="select * from t_mjypdjb WHERE liu_yang_wei_zhi_ = '" +item.id_ +"'";
+    //       }
+    //       curdPost("sql", yangpingSql).then((res) => {
+    //         var resData = res.variables.data;
+    //         if (resData.length > 0) {
+    //           resData.forEach((it) => {
+    //             it.wei_zhi_bian_hao_ = item.wei_zhi_bian_hao_;
+    //             labelsMap[item.ceng_hao_].push(it);
+    //           });
+    //         } else {
+    //           labelsMap[item.ceng_hao_].push(item);
+    //         }
+    //       });
+    //     });
+    //     this_.listData = labelsMap;
+    //     console.log(this_.listData)
+    //   });
+    // },
     qu_yu_Event(e) {
       //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_
       this.huo_jia_arrEvent(e.target.innerText);
@@ -523,7 +526,7 @@ p {
               cursor: pointer;
               padding: 2px 6px;
               border-radius: 5px;
-              background: #67c23a;
+              // background: #67c23a;
               margin-left: 12px;
               margin-top: 6px;
               box-sizing: border-box;

+ 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_) {

+ 18 - 43
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" >
           <div class="goods-items">
             <div
               class="show-demo"
@@ -87,22 +87,14 @@
                       class="goods-dsc"
                       v-for="(it, ind) in listData[index]"
                       :key="ind"
-                      :style="{
-                        background:
-                          it.wei_zhi_zhuang_ta == '空余' ? '#67c23a' : '',
-                      }"
+                      :style="{background: it.wei_zhi_zhuang_ta == '空余' ? '#67c23a' : '',}"
                     >
                       <div class="top-dsc">
                         <div class="position">
-                          <!-- <p>位置id:{{ it.shou_yang_wei_zhi }}</p>
-                          <p>货位id:{{ it.id_ }}</p> -->
                           <p>样品名称:{{ it.yang_pin_ming_che }}</p>
-
                           <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
                           <p>位置编号:{{ it.wei_zhi_bian_hao_ }}</p>
-
-                          <p>留样期限:{{ it.liu_yang_qi_xian_ }}</p>
-
+                          <!-- <p>入库时间:{{ it.ru_ku_shi_jian_}}</p> -->
                           <p>位置状态:{{ it.wei_zhi_zhuang_ta }}</p>
                           <p>存储条件:{{ it.cun_chu_tiao_jian }}</p>
                         </div>
@@ -224,45 +216,28 @@ export default {
       // this.desString = fang_jian_ + qu_yu + huo_jia_hao_;
       this.queryLoad(sql);
     },
-    queryLoad(sql) {
+    async queryLoad(sql) {
       //根据样品信息货位查询相对应的样品登记表
       var datas = [];
       var labelsMap = {}; // map存储
       var this_ = this;
       this_.listData = [];
-      curdPost("sql", sql).then((res) => {
-        datas = res.variables.data;
-        datas.forEach((item) => {
-          let yangpingSql =
-            "select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +
-            item.yang_pin_bian_hao +
-            "'";
-          if (!labelsMap[item.ceng_hao_]) {
-            //没有就创建
+      await curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;   
+      });
+      datas.forEach(item=>{
+          if (!labelsMap[item.ceng_hao_]) { 
             labelsMap[item.ceng_hao_] = [];
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              } else {
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
-          } else {
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              } else {
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
           }
-        });
-        this_.listData = labelsMap;
-      });
+      })
+      for(let i=0;i<datas.length;i++){
+        for(let k in labelsMap){
+          if(k == datas[i].ceng_hao_){
+            labelsMap[k].push(datas[i]);
+          }
+        }
+      }
+      this_.listData = labelsMap;
     },
     qu_yu_Event(e) {
       //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_

+ 159 - 35
src/views/system/jbdScan/goods/sampleTag.vue

@@ -5,15 +5,15 @@
       height="10cm" 
        :modal-append-to-body='true' :append-to-body="true" title="样品标签" :visible.sync="scanVisible">
       <!-- 表单是否显示 -->
-      <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="(item1, index1) in list" :key="index1"   >
+              <!-- <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,7 +307,7 @@ export default {
           })
           this.list = list
       })
-    }
+    },
   }
 }
 </script>
@@ -206,7 +326,8 @@ export default {
   display: inline-block;
   // justify-content: space-around;
   // flex-direction: column;
-  margin: 10px 5px;
+  // margin: 10px 5px;
+  margin: 10px 300px;
   border-radius: 4px;
   background-color: #fff;
 }
@@ -240,5 +361,8 @@ export default {
   display: flex;
   align-items: center;
 
+}
+.All{
+  
 }
 </style>

+ 43 - 40
src/views/system/jbdScan/goods/weizhiData.vue

@@ -68,13 +68,13 @@
           </div>
         </div>
       </div>
-      <div class="body-content" v-if="viewShow" v-loading="loading">
+      <div class="body-content" v-if="viewShow">
         <div class="right-view">
           <div class="goods-items">
             <div
               class="show-demo"
               v-for="(item, index) in listData"
-              :key="item"
+              :key="item.id_"
             >
               <div @click="positionClick(listData[index])">
                 <div class="goods-level">
@@ -91,8 +91,6 @@
                     >
                       <div class="top-dsc">
                         <div class="position">
-                          <!-- <p>位置id:{{ it.shou_yang_wei_zhi }}</p>
-                          <p>货位id:{{ it.id_ }}</p>                          -->
                           <p>样品名称:{{ it.yang_pin_ming_che}}</p>
                           <p>位置编号:{{ it.wei_zhi_bian_hao_ }}</p>
                           <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
@@ -158,8 +156,6 @@ export default {
       cenghao: [],
       warehouse: [],
       loading: false,
-      // pagination: {},
-      // secondshow: false,
       desString: "",
       viewShow: false,
       placeValue: "选择位置",
@@ -202,7 +198,6 @@ export default {
       //查询选择数据查询
       var sqlString =
         "select distinct fang_jian_lei_xin from t_mjypcfwz WHERE fang_jian_lei_xin !=''";
-      // var sqlString = "select * from t_mjypcfwz";
       var this_ = this;
       curdPost("sql", sqlString).then((response) => {
         this_.sampleOption = response.variables.data;
@@ -230,46 +225,54 @@ export default {
       }
       this.queryLoad(sql);
     },
-    queryLoad(sql) {
+   async queryLoad(sql) {
       //根据样品信息货位查询相对应的样品登记表
       var datas = [];
       var labelsMap = {}; // map存储
       var this_ = this;
       this_.listData = [];
-      curdPost("sql", sql).then((res) => {
+     await curdPost("sql", sql).then((res) => {
+      console.log(sql)
         datas = res.variables.data;
-        datas.forEach((item) => {
-          let yangpingSql ="select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +item.yang_pin_bian_hao +"'";  // 通过样品货位配置的id外键 查询样品登记表
-          if (!labelsMap[item.ceng_hao_]) {           
-            labelsMap[item.ceng_hao_] = [];//没有就创建
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              }else{
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
-          } else {
-            curdPost("sql", yangpingSql).then((res) => {
-              if (res.variables.data.length > 0) {
-                let data = res.variables.data;
-                item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
-                labelsMap[item.ceng_hao_].push(item);
-              }else{
-                labelsMap[item.ceng_hao_].push(item);
-              }
-            });
-          }
-        });
-        this_.listData = labelsMap;
-        this.$nextTick(() => {
-          this.loading = false;
-        });
-
-        // this.loading = true;
+        // datas.forEach((item) => {
+        //   let yangpingSql ="select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +item.yang_pin_bian_hao +"'";  // 通过样品货位配置的id外键 查询样品登记表
+        //   if (!labelsMap[item.ceng_hao_]) {           
+        //     labelsMap[item.ceng_hao_] = [];//没有就创建
+        //     curdPost("sql", yangpingSql).then((res) => {
+        //       if (res.variables.data.length > 0) {
+        //         let data = res.variables.data;
+        //         item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
+        //         labelsMap[item.ceng_hao_].push(item);
+        //       }else{
+        //         labelsMap[item.ceng_hao_].push(item);
+        //       }
+        //     });
+        //   } else {
+        //     curdPost("sql", yangpingSql).then((res) => {
+        //       if (res.variables.data.length > 0) {
+        //         let data = res.variables.data;
+        //         item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
+        //         labelsMap[item.ceng_hao_].push(item);
+        //       }else{
+        //         labelsMap[item.ceng_hao_].push(item);
+        //       }
+        //     });
+        //   }
+        // });        
       });
+      datas.forEach(item=>{
+          if (!labelsMap[item.ceng_hao_]) { 
+            labelsMap[item.ceng_hao_] = [];
+          }
+      })
+      for(let i=0;i<datas.length;i++){
+        for(let k in labelsMap){
+          if(k == datas[i].ceng_hao_){
+            labelsMap[k].push(datas[i]);
+          }
+        }
+      }
+      this_.listData = labelsMap;
     },
     qu_yu_Event(e) {
       //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_