licp
2024-07-22 06e5e9e9c7aabcb5c155b25f84e5de2c935b2137
新增数采检验功能
已修改3个文件
62 ■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -686,6 +686,7 @@
  import ValueTable from '../../tool/value-table.vue'
  import file from '../../../util/file'
  import excelFunction from '../../../util/excelFountion'
import { number } from 'echarts'
  export default {
    props: ['sonLaboratory', 'orderId', 'state'],
    components: {
@@ -1005,7 +1006,6 @@
    },
    methods: {
      getDataAcquisitionDevice(){
        this.dataAcquisitionLoading = true
        this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode + '&id=' + this.currentSample.id).then(res=>{
          this.dataAcquisitionLoading = false
@@ -1013,7 +1013,7 @@
            return
          }
          this.dataAcquisitionInfo = res.data
          let list = this.currentSample.insProduct[0].arr
          let list = this.tableList[0].arr
          list.forEach((item,index)=>{
            item.forEach(m=>{
              if(m.v.ps&&(m.v.ps.value=='检验子项'||m.v.ps.value=='检验项')){
@@ -1024,19 +1024,21 @@
                      num++
                    }
                  })
                  list[index].forEach(n=>{
                  list[index].forEach((n,i)=>{
                    if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('检验值')){
                      if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)){
                      if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)&&!n.v.ps.value.includes(this.dataAcquisitionInfo.frequency+'0')){
                        setTimeout(()=>{
                          n.v.v = this.dataAcquisitionInfo[m.v.m]
                          this.$delete(n.v,'v')
                          this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m])
                          this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
                        },1000)
                      }else if(this.dataAcquisitionInfo.frequency>num){
                      }else if(Number(this.dataAcquisitionInfo.frequency)>num){
                        if(n.v.ps.value.includes(num)){
                          setTimeout(()=>{
                            n.v.v = this.dataAcquisitionInfo[m.v.m]
                            this.$delete(n.v,'v')
                            this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m])
                            this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
                          },200)
                          },1000)
                        }
                      }
                    }
@@ -1254,7 +1256,6 @@
            }
            arr2.push(obj)
          })
          console.log(arr2)
          this.wareTableData = arr2
        })
        this.getEquipOptions(true,this.currentSample.insProduct[0].id)
@@ -1794,18 +1795,19 @@
                if(equipValue[i].v){
                  let isItADataAcquisitionDevice = await this.determineWhetherToCollectData(equipValue[i].v)
                  this.param[a.id].equipValue[i].isItADataAcquisitionDevice = isItADataAcquisitionDevice
                  this.dataAcquisitionEidt = 0
                  if(this.param){
                    for (let key in this.param) {
                      this.param[key].equipValue.forEach(m=>{
                        if(m.isItADataAcquisitionDevice){
                          this.dataAcquisitionEidt++
                        }
                      })
                    }
                  }
                }else{
                  this.param[a.id].equipValue[i].isItADataAcquisitionDevice = false
                }
                this.dataAcquisitionEidt = 0
                if(this.param){
                  for (let key in this.param) {
                    this.param[key].equipValue.forEach(m=>{
                      if(m.isItADataAcquisitionDevice){
                        this.dataAcquisitionEidt++
                      }
                    })
                  }
                }
              }
            }
@@ -1829,7 +1831,6 @@
        this.handleExcelMethod()
      },
      changeInput(m, code, n) {
        console.log(m, code)
        if (n) {
          // if (this.PROJECT === '装备电缆') {
          //   let num2 = new this.$Big(n.v.v)
@@ -1862,7 +1863,8 @@
          switch (this.result.method){
            case 'saveInsContext':
              this.$nextTick(()=>{
                this.tableList = this.result.value.tableList
                this.$delete(this.tableList[0],'arr')
                this.$set(this.tableList[0],'arr',this.result.value.tableList[0].arr)
                this.param = this.result.value.param
                for (var i in this.param){
                  if(this.param[i].insResult&&this.param[i].insResult.v&&this.param[i].insResult.v.v){
@@ -1878,16 +1880,14 @@
              break;
            case 'tableList':
              this.$nextTick(()=>{
                this.tableList = this.result.value
                this.$delete(this.tableList[0],'arr')
                this.$set(this.tableList[0],'arr',this.result.value[0].arr)
              })
              break;
            case 'getCurrentInsProduct':
              this.getCurrentInsProduct(this.result.value)
              break;
          }
          // if(this.result.method=='saveInsContext'){
          //   this.stopWorker(); // 处理完成后停止 Worker
          // }
        };
      },
      async determineWhetherToCollectData(managementNumber){
@@ -2231,7 +2231,7 @@
        return
      },
      saveInsContext() {
        console.log(1111,this.param)
        // console.log(1111,this.param)
        if(this.param){
          this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
            param: JSON.stringify(this.param)
src/main.js
@@ -20,7 +20,8 @@
//本地
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
const javaApi = 'http://192.168.45.249:8001';
// 张:192.168.45.249
const javaApi = 'http://172.20.10.4:8001';
//云
// Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
static/js/worker.js
@@ -38,7 +38,6 @@
  let isToExponential = ''
  let list2 = []
  let isPoint = ''
  excelMethodList.forEach(item => {
    if (item.valueList&&item.valueList.length>0&&item.valueList.find(m => m.r == r && m.c == c)) {
      var comValue = {}
@@ -254,6 +253,7 @@
            }
            // console.log(tableList)
          }
          // console.log('1234567789', tableList,getParam())
          result = {
            method:'saveInsContext',
            value:{
@@ -433,7 +433,7 @@
  }
  tableList[0].arr.forEach(a => {
    a.forEach(b=>{
      if (b.v.ps != undefined && b.v.ps.value === '检验值') {
      if (b.v.ps != undefined &&typeof b.v.ps.value =='string'&& b.v.ps.value.includes('检验值')) {
        b.i &&b.v.v&& param[b.i].insValue.push(b)
      }
      if (b.v.ps != undefined && b.v.ps.value === '计算值') {
@@ -529,7 +529,7 @@
    let num = null;
    let arr = [];
    if(val&&val.length>0){
      arr = val.filter(item=>item!=null&&item!=='')
      arr = val.filter(item=>item!=null&&item!=''&&item!=undefined)
      arr.forEach(item=>{
        num+=item;
      })
@@ -825,6 +825,7 @@
    } else if (isPoint) {
      return str.replace('ABS', '').replace(/\(|\)/g, '')
    }else {
      console.log('str', str,eval(str))
      return eval(str)
    }
  } catch (error) {