ZZJ 3 лет назад
Родитель
Сommit
96929fd66c
1 измененных файлов с 40 добавлено и 8 удалено
  1. 40 8
      src/views/system/jbdScan/js/manualConfirmationJS.js

+ 40 - 8
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -2,20 +2,40 @@ import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js'
 import * as dayjs from 'dayjs'
 
 export default {
+  props:{
+    obj:{
+      default: [],
+      type:Array
+    }
+  },
   methods: {
     facilityData(page) {
-      // this.loadData()
-      this.loadDataBySQL(page)
+      if(this.obj.length > 0){
+        this.loadData(this.obj)
+      }else{
+        this.loadDataBySQL(page)
+      }
     },
     /* 获取数据 ,开始查阅记录 */
-    loadData() {
-      repostCurd('select', '{"tableName": "t_lhypb","paramWhere":{"jie_yang_zhuang_t":"待接收","shi_fou_guo_shen_":"1"}}').then(response => {
+    loadData(obj) {
+      let sql = `select * from t_lhypb where find_in_set(id_,'${obj}') and jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1'`
+      repostCurd('sql',sql).then(response=>{
         if (response.variables.data && response.variables.data.length > 0) {
-          for (let i in response.variables.data) {
-            response.variables.data[i].jie_yang_shu_lian = 1
-            this.listData.push(response.variables.data[i])
-            // this.OriginalPosition.push(response.variables.data[i].shi_fou_liu_yang_ == "是" ? response.variables.data[i].liu_yang_wei_zhi_ : response.variables.data[i].shou_yang_wei_zhi)
+          let temp = response.variables.data
+          this.listData = []
+          for (let i in temp) {
+            temp[i].jie_yang_shu_lian = temp[i].yang_pin_zong_shu
+            temp[i].jie_yang_zhuang_t = '已确认'
+            temp[i].biao_zhi_uuid_ = this.uuid()
+            temp[i].shi_fou_liu_yang_ = '是'
+            temp[i].yan_shou_jie_guo_ = '完好'
+            temp[i].liu_yang_ri_qi_ = this.dateFormat()
+            temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
+            temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
+            this.listData.push(temp[i])
           }
+        }else{
+          this.handleEmptyData();
         }
       })
     },
@@ -39,9 +59,21 @@ export default {
             res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
             this.listData.push(res.variables.data[i])
           }
+        }else{
+          this.handleEmptyList();
         }
       })
     },
+    handleEmptyData(){
+      this.$confirm('您所选择的样品还未到实验室现场,无法接样!').then(_ => {
+        this.closeDialog();
+      }).catch(_ => {});
+    },
+    handleEmptyList(){
+      this.$confirm('目前暂无样品需要接样!').then(_ => {
+        this.closeDialog();
+      }).catch(_ => {});
+    },
     /* 列表失去焦点*/
     handleChange() {
       this.$refs.redarInput.focus(); //聚焦input