licp
2024-07-30 152a8201c7611c785070f6093e72e5aed6142613
pk8000前端对接
已修改3个文件
195 ■■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a6-device/files.vue 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -155,6 +155,7 @@
  determineWhetherToCollectData: "/deviceScope/determineWhetherToCollectData", // 判断该设备是否可以数采
  dataCollection: "/deviceScope/dataCollection", // 数采-数据采集
  treeDevice: "/deviceScope/treeDevice", // 设备树形
  temDataAcquisition: "/deviceScope/temDataAcquisition", // PK8000数采
}
const insOrder = {
src/components/do/a6-device/files.vue
@@ -16,75 +16,117 @@
          </div>
        </el-image>
      </el-col>
      <el-col :span="9">
      <el-col :span="8">
        <div class="form-item">
          <label>设备名称</label>
          <p>扫描电镜(带能谱)</p>
          <p>{{ handleData('扫描电镜(带能谱)') }}</p>
        </div>
        <div class="form-item">
          <label>大类</label>
          <p>分析仪器</p>
          <p>{{ handleData('分析仪器') }}</p>
        </div>
        <div class="form-item">
          <label>内部编号</label>
          <p>扫描电镜(带能谱)</p>
          <p>{{ handleData('扫描电镜(带能谱)') }}</p>
        </div>
        <div class="form-item">
          <label>生产厂家</label>
          <p>-</p>
          <p>{{ handleData('扫描电镜(带能谱)') }}</p>
        </div>
        <div class="form-item">
          <label>资产编码</label>
          <p>-</p>
          <p>{{ handleData('扫描电镜(带能谱)') }}</p>
        </div>
        <div class="form-item">
          <label>出厂日期</label>
          <p>2024-7-20</p>
          <p>{{ handleData('2024-7-20') }}</p>
        </div>
        <div class="form-item">
          <label>启用日期</label>
          <p>2024-7-20</p>
          <p>{{ handleData('2024-7-20') }}</p>
        </div>
        <div class="form-item">
          <label>核准周期(月)</label>
          <p>12</p>
          <p>{{ handleData('12') }}</p>
        </div>
        <div class="form-item">
          <label>检测类型</label>
          <p>12</p>
          <p>{{ handleData('12') }}</p>
        </div>
        <div class="form-item">
          <label>报废时间</label>
          <p>2024-7-20</p>
          <p>{{ handleData('12') }}</p>
        </div>
        <div class="form-item">
          <label>准确度量值</label>
          <p>-</p>
          <p>{{ handleData('12') }}</p>
        </div>
        <div class="form-item">
          <label>被授权人</label>
          <p>-</p>
          <p>{{ handleData('12') }}</p>
        </div>
        <div class="form-item">
          <label>维修记录</label>
          <p>-</p>
          <p>{{ handleData('12') }}</p>
        </div>
      </el-col>
      <el-col :span="9">
      <el-col :span="10">
        <div class="form-item">
          <label>规格型号</label>
          <p>JSM-6010LA</p>
          <p>{{ handleData('JSM-6010LA') }}</p>
        </div>
        <div class="form-item">
          <label>细类</label>
          <p>分析仪器</p>
          <p>{{ handleData('分析仪器') }}</p>
        </div>
        <div class="form-item">
          <label>设备状态</label>
          <el-radio-group v-model="form.value1" disabled>
            <el-radio :label="0">合格</el-radio>
            <el-radio :label="1">维修</el-radio>
            <el-radio :label="0" style="width: 40px;">合格</el-radio>
            <el-radio :label="1" style="width: 40px;">维修</el-radio>
            <el-radio :label="2" style="width: 40px;">停用</el-radio>
            <el-radio :label="3" style="width: 40px;">报废</el-radio>
          </el-radio-group>
        </div>
        <div class="form-item">
          <label>出厂编号</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>存放点</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>购置日期</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>产地</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>最近溯源日期</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>采购费用(元)</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>停用时间</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>设备负责人</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>验收记录</label>
          <p>{{ handleData() }}</p>
        </div>
        <div class="form-item">
          <label>核准证书</label>
          <p>{{ handleData() }}</p>
        </div>
      </el-col>
    </el-row>
@@ -197,10 +239,21 @@
        requiredAdd: [],
        requiredUp: []
            },
      upIndex:0
      upIndex:0,
      form: {
        value1:''
    }
  }
  },
  methods: {
    handleData(m){
      if(m){
        return m
      }else{
        return '-'
      }
    }
  }
}
</script>
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -317,8 +317,8 @@
              <span style="margin-left: 4px;">%</span>
            </el-form-item>
          </el-form>
          <el-button type="primary" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='检测中心'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">数据采集</el-button>
          <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='检测中心'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'关闭编辑':'编辑数采'}}</el-button>
          <el-button type="primary" size="small" v-if="(dataAcquisitionEidt>0||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'&&temDataAcquisition)&&PROJECT=='检测中心'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">数据采集</el-button>
          <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(dataAcquisitionEidt>0)&&PROJECT=='检测中心'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'关闭编辑':'编辑数采'}}</el-button>
        </div>
      </div>
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('热循环')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温升试验'))">
@@ -504,20 +504,20 @@
          <el-table-column
            label="序号"
            type="index"
            width="60"
            width="59"
            align="center"
            >
          </el-table-column>
          <el-table-column
            prop="bushColor"
            label="管色标"
            width="80"
            width="75"
            align="center">
          </el-table-column>
          <el-table-column
            prop="code"
            label="光纤带编号"
            width="110"
            width="105"
            align="center">
          </el-table-column>
          <el-table-column
@@ -531,7 +531,7 @@
              prop="value0"
              label="外端"
              align="center"
              width="80" :key="(new Date().getTime())+'1234567'">
              width="100" :key="(new Date().getTime())+'1234567'">
              <template slot="header">
                {{ '外端'+(index+1) }}
              </template>
@@ -543,7 +543,7 @@
              prop="value1"
              label="内端"
              align="center"
              width="80" :key="(new Date().getTime())+'23333333'">
              width="100" :key="(new Date().getTime())+'23333333'">
              <template slot="header">
                {{ '内端'+(index+1) }}
              </template>
@@ -959,6 +959,7 @@
          inspectionItemClass:null,
        },
        thermalCyclingLoading:false,
        temDataAcquisition:false,
      }
    },
    computed: {
@@ -1121,6 +1122,36 @@
    methods: {
      // 数据采集
      getDataAcquisitionDevice(){
        if(this.tableLists.find(m=>m.templateId==this.currentTable)&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'){
          // 温度循环检验原始记录----数采----PK8000
          let temperature = this.wareForm.inspectionItemSubclass;
          if(typeof temperature == 'string'&&temperature.includes('(常温)')){
            temperature = `20℃(常温)`
          }else{
            temperature = temperature + '℃'
          }
          this.dataAcquisitionLoading = true
          this.$axios.post(this.$api.deviceScope.temDataAcquisition,{
            entrustCode:this.insOrder.entrustCode,
            sampleCode:this.currentSample.sampleCode,
            model:this.wareForm0.model,
            cycles:this.wareForm.inspectionItem,
            temperature:temperature,
          }, {
          headers: {
            'Content-Type': 'application/json'
          },
          noQs:true
        }).then(res=>{
            this.dataAcquisitionLoading = false
            if(res.code!=200){
              return
            }
            // console.log(res.data)
            this.wareFormChange()
          })
        }else{
          // 一般的数据采集
        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
@@ -1146,55 +1177,8 @@
              this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
            }
          };
          // let list = this.tableList[0].arr
          // list.forEach((item,index)=>{
          //   let num = 0;
          //   let str = ''
          //   item.forEach(m=>{
          //     if(m.v.ps&&(m.v.ps.value=='检验子项'||m.v.ps.value=='检验项')){
          //       if(m.v.ps&&m.v.ps.value=='检验项'){
          //         if(num==0){
          //           str = m.v.v+','
          //           num++
          //         }
          //       }
          //       if(m.v.ps&&m.v.ps.value=='检验子项'){
          //         if(num==1){
          //           str = str+m.v.v
          //         }
          //       }
          //       if(this.dataAcquisitionInfo[str]){
          //         let num = 0;
          //         list[index].forEach(n=>{
          //           if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('检验值')){
          //             num++
          //           }
          //         })
          //         list[index].forEach((n,i)=>{
          //           if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('检验值')){
          //             let arr = n.v.ps.value.split('值')
          //             if(arr[1] ==this.dataAcquisitionInfo.frequency){
          //               setTimeout(()=>{
          //                 this.$delete(n.v,'v')
          //                 this.$set(n.v,'v',this.dataAcquisitionInfo[str])
          //                 this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
          //               },1000)
          //             }else if(Number(this.dataAcquisitionInfo.frequency)>num){
          //               if(n.v.ps.value.includes(num)){
          //                 setTimeout(()=>{
          //                   this.$delete(n.v,'v')
          //                   this.$set(n.v,'v',this.dataAcquisitionInfo[str])
          //                   this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
          //                 },1000)
          //               }
          //             }
          //           }
          //         })
          //       }
          //     }
          //   })
          // })
        })
        }
      },
      // 多线程
      startWorker() {
@@ -1705,6 +1689,7 @@
        let fileDel = false
        let fileAdd = false
        let collected = false
        let temDataAcquisition = false
        for (var i = 0; i < power.length; i++) {
                    if (power[i].menuMethod == 'uploadFile') {
                        fileAdd = true
@@ -1715,12 +1700,16 @@
          if (power[i].menuMethod == 'isItAllowedToModifyTheCollectedValues') {
                        collected = true
                    }
          if (power[i].menuMethod == 'temDataAcquisition') {
                        temDataAcquisition = true
                    }
                }
        if (!fileDel) {
                    this.componentData0.do.splice(1, 1)
                }
        this.fileAdd = fileAdd
        this.collected = collected
        this.temDataAcquisition = temDataAcquisition
      },
      async getCurrentProduct(id,type){
        this.tableLoading = true;