licp
2024-10-17 bb1edca3bf351497495e270014b229605e4460dc
修改下单、电路试验多样品时的bug
已修改7个文件
169 ■■■■■ 文件已修改
src/components/do/b1-ins-order/add.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspect-order-plan.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspection-order.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-sample.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue
@@ -1906,6 +1906,22 @@
          //   }
          // }
          let sampleList = this.HaveJson(this.sampleList)
          for (let i = 0; i < sampleList.length; i++) {
            if (sampleList[i].insProduct.length > 0) {
              let set = new Set()
              for (let j = 0; j < sampleList[i].insProduct.length; j++) {
                if(sampleList[i].insProduct[j].state == 1){
                  let num0 = set.size
                  set.add(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass)
                  let num1 = set.size
                  if(num0==num1){
                    this.$message.error(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass+'重复')
                    return
                  }
                }
              }
            }
          }
          let projectNum = this.totalArr.filter(a => a.state == 1).length
          if(projectNum==0){
            this.$confirm('检验项目为空,是否确认提交?', "提示", {
@@ -1916,7 +1932,7 @@
              this.saveMethod(sampleList)
            }).catch(() => {})
          }else{
            let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1)
            let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask&&a.ask.includes(b)) && a.state == 1)
            if (isRTS&&this.PROJECT=='检测中心') {
              this.editTable = this.handleData(sampleList,this.containsValue, 0)
              this.editTable.forEach(item => {
@@ -2075,7 +2091,7 @@
                  let arr = this.editTable.filter(b => b.sampleId == item.id)
                  for (var i=0;i<arr.length;i++){
                    if(a.ask){
                      if(a.ask.includes(arr[i].symbolItem)){
                      if(a.ask&&a.ask.includes(arr[i].symbolItem)){
                        let ask = calBack(a.ask, arr[i].symbolItem,arr[i].value)
                        if (ask) {
                          a.ask = ask
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -863,41 +863,43 @@
      </span>
    </el-dialog>
    <el-dialog title="试验信息" :visible.sync="experimentDia" width="50%">
      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验阶段</div>
        <div class="search_input" style="width: 100%;">
          <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input>
      <div style="height: 80vh;overflow-y: auto;">
        <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
          <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验阶段</div>
          <div class="search_input" style="width: 100%;">
            <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input>
          </div>
        </div>
      </div>
      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验操作</div>
        <div class="search_input" style="width: 100%;">
          <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea"
          :rows="2"></el-input>
        <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
          <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验操作</div>
          <div class="search_input" style="width: 100%;">
            <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea"
            :rows="2"></el-input>
          </div>
        </div>
        <table border="1" cellpadding="10" class="thermal-table">
          <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
            <td>样品</td>
            <td>样品编号</td>
            <td>型号</td>
            <td>检验项</td>
            <td>检验子项</td>
            <td>工时</td>
          </tr>
          <template v-for="(item,index) in sampleProduct">
            <tr>
              <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
              <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
              <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
            </tr>
            <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
              <td>{{ m.inspectionItem }}</td>
              <td>{{ m.inspectionItemSubclass }}</td>
              <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="工时" size="small"></el-input-number></td>
            </tr>
          </template>
        </table>
      </div>
      <table border="1" cellpadding="10" class="thermal-table">
        <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
          <td>样品</td>
          <td>样品编号</td>
          <td>型号</td>
          <td>检验项</td>
          <td>检验子项</td>
          <td>工时</td>
        </tr>
        <template v-for="(item,index) in sampleProduct">
          <tr>
            <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
            <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
            <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
          </tr>
          <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
            <td>{{ m.inspectionItem }}</td>
            <td>{{ m.inspectionItemSubclass }}</td>
            <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="工时" size="small"></el-input-number></td>
          </tr>
        </template>
      </table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="experimentDia = false">取 消</el-button>
        <el-button type="primary" @click="submit0">确 定</el-button>
@@ -3743,7 +3745,8 @@
        this.lookFileVisible = true
      },
      handleBack(){
        if(this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('电路试验')){
        try {
          if(!this.isLook&&this.state==1&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('电路试验')){
          this.$confirm('请确认当前数据是否全部保存,是否返回?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
@@ -3754,6 +3757,9 @@
        }else{
          this.$emit('goback')
        }
        } catch (error) {
          this.$emit('goback')
        }
      }
    }
  }
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -116,7 +116,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':(n.result===3?'不判定':'待定'))) }}
              </div>
            </el-col>
          </el-row>
@@ -167,7 +167,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':(n.result===3?'不判定':'待定'))) }}
              </div>
            </el-col>
          </el-row>
@@ -210,7 +210,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':'待定')) }}
              </div>
            </el-col>
          </el-row>
@@ -248,7 +248,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':'待定')) }}
              </div>
            </el-col>
          </el-row>
@@ -394,7 +394,8 @@
    },
    insProduct:{
      deep:true,
      handler:()=>{
      handler:function(val){
        // console.log('更新页面啦')
        this.initData()
      }
    }
@@ -414,6 +415,7 @@
    },
    // 初始化数据
    initData(){
      this.allBandList = []
      // 处理项目
      this.insProductNew = JSON.parse(JSON.stringify(this.insProduct)).filter(m=>m.inspectionItem.includes('电路试验'))
      this.insProductNew.forEach(async item => {
@@ -421,7 +423,7 @@
            this.intermodulationNum++
          }
        // 获取设备列表
        item.equipOptions = await this.getEquipOptions(item)
        item.equipOptions = []
      })
      if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
        // 已经存在值时,赋值
@@ -494,12 +496,32 @@
          })
        }
      }else{
        console.log(2222)
        // 没有值时,初始化页面
        this.insProductNew.forEach(async item => {
          // 赋值设备
          item.equipName = ''
          item.equipValue = ''
          // 赋值端口和角度
          this.portList = [
            {
              value:'1',
            },
            {
              value:'2',
            },
            {
              value:'3',
            },
            {
              value:'4',
            },
          ]
          this.angleList = [
            {
              value:''
            }
          ]
          item.portList = JSON.parse(JSON.stringify(this.portList))
          item.angleList = JSON.parse(JSON.stringify(this.angleList))
          // 赋值结论
@@ -526,6 +548,7 @@
            projectList: JSON.parse(JSON.stringify(this.insProductNew))
          }
        )
        console.log(this.allBandList)
      }
    },
    // 删除数组
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
@@ -116,7 +116,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':'待定')) }}
              </div>
            </el-col>
          </el-row>
@@ -167,7 +167,7 @@
              </div>
            </el-col>
            <el-col :span="2">
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':'待定') }}
              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'不合格':(n.result===1?'合格':(n.result===3?'不判定':'待定')) }}
              </div>
            </el-col>
          </el-row>
@@ -275,7 +275,7 @@
    },
    insProduct:{
      deep:true,
      handler:()=>{
      handler:function(val){
        this.initData()
      }
    }
@@ -283,7 +283,6 @@
  mounted() {
    this.getTypeDicts()
    this.initData()
    console.log(2222,this.currentNum)
  },
  methods: {
    // 字典获取数据
@@ -296,11 +295,12 @@
    },
    // 初始化数据
    initData(){
      this.allBandList = []
      // 处理项目
      this.insProductNew = JSON.parse(JSON.stringify(this.insProduct)).filter(m=>m.inspectionItem.includes('电路试验'))
      this.insProductNew.forEach(async item => {
        // 获取设备列表
        item.equipOptions = await this.getEquipOptions(item)
        item.equipOptions = []
      })
      if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
        // 已经存在值时,赋值
@@ -384,6 +384,25 @@
          // 赋值设备
          item.equipName = ''
          item.equipValue = ''
          this.portList = [
            {
              value:'1',
            },
            {
              value:'2',
            },
            {
              value:'3',
            },
            {
              value:'4',
            },
          ]
          this.angleList = [
            {
              value:''
            }
          ]
          // 赋值端口和角度
          item.portList = JSON.parse(JSON.stringify(this.portList))
          item.angleList = JSON.parse(JSON.stringify(this.angleList))
src/components/view/b1-inspect-order-plan.vue
@@ -373,7 +373,7 @@
        <el-col class="search_thing" :span="24">
          <div class="search_label" style="width: 90px"><span class="required-span">* </span>样品编号:</div>
          <div class="search_input">
            <el-input v-model="sampleCode" size="small"></el-input>
            <el-input v-model="sampleCode" size="small" clearable></el-input>
          </div>
        </el-col>
      </el-row>
@@ -803,7 +803,8 @@
      keyup(e){
        var code = ''
        try{
          code = JSON.parse(this.codeInfo)
          // console.log(2222,this.codeInfo)
          code = this.codeInfo.substring()
          if(code==null||code==undefined||code==''){
            this.$message.error('该二维码有误')
          }else{
@@ -811,6 +812,7 @@
          }
        }catch(e){
          this.$message.error('请调至英文键盘')
          console.log(e)
        }
        this.codeInfo = null
      },
src/components/view/b1-inspection-order.vue
@@ -429,7 +429,7 @@
        </el-row>
      </span>
    </el-dialog>
    <div class="el-dialog__body" style="overflow-y: auto;position: fixed;top:0;right: 20px;z-index: 9999;">
    <div class="el-dialog__body" style="overflow-y: auto;position: fixed;top:60px;right: 20px;z-index: 9999;">
        <div id="printMOrder" class="printMOrder" ref="printMOrder">
          <el-card class="box-card" v-for="(item, i) in checkDataList" :key="i+'uuuuu'" style="font-size: 16px !important;page-break-after: always;color: #000;box-shadow: none;margin: 0 !important;padding: 0 !important;">
            <div>
@@ -908,6 +908,7 @@
            a.item = [...new Set(arr1)].join(',')
          })
          this.qrData = arr
          // console.log(this.qrData)
                })
      },
      //选择要打印的二维码
src/components/view/b1-sample.vue
@@ -287,7 +287,7 @@
        <el-col class="search_thing" :span="24">
          <div class="search_label"><span class="required-span">* </span>样品编号:</div>
          <div class="search_input">
            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange"></el-input>
            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" clearable></el-input>
          </div>
        </el-col>
      </el-row>
@@ -447,7 +447,7 @@
      keyup(e){
        var code = ''
        try{
            code = JSON.parse(this.codeInfo)
            code = this.codeInfo.substring()
            if(code==null||code==undefined||code==''){
                this.$message.error('该二维码有误')
            }else{