licp
2024-12-10 81150f2c6e86f747a7e7539e91f7b75e9fa87075
电路试验退出保存优化
已修改5个文件
105 ■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -198,6 +198,7 @@
  doInsOrder: "/insOrderPlan/doInsOrder", //执行检验操作
  saveInsContext: "/insOrderPlan/saveInsContext", //保存检验内容
  saveInsContext2: "/insOrderPlan/saveInsContext2", //保存检验内容--电路试验
  saveInsContext2s: "/insOrderPlan/saveInsContext2s", //保存检验内容--电路试验--一次性保存
  saveInsContext3: "/insOrderPlan/saveInsContext3", //保存检验内容--温湿度检验
  deleteInsContext: "/insOrderPlan/deleteInsContext", //删除频段
  deleteInsContext2: "/insOrderPlan/deleteInsContext2", //删除频点
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -802,7 +802,7 @@
    </el-drawer>
    <el-dialog title="检验复核" :visible.sync="reviewDia" width="500px">
      <div class="body" style="display: flex;padding: 10px;" v-if="reviewDia">
        <div class="search_label" style="width: 150px;"><span class="required-span">* </span>不通过的理由:</div>
        <div class="search_label" style="width: 150px;"><span class="required-span">* </span>再次试验的理由:</div>
        <div class="search_input" style="width: 100%;">
          <el-input size="small" clearable v-model="noReason" type="textarea" :autosize="{ minRows: 4}"></el-input>
        </div>
@@ -3319,7 +3319,7 @@
          this.addVerifyDia = true
        }
      },
      handleSubmit(){
      async handleSubmit(){
        if(!this.otherForm.temperature){
          this.$message.error('请输入温度')
          return
@@ -3328,7 +3328,7 @@
          this.$message.error('请输入湿度')
          return
        }
        if(this.sonLaboratory === '电路试验'&&!this.$refs.CircuitParameters.saveAll()){
        if(this.sonLaboratory === '电路试验'&&!(await this.$refs.CircuitParameters.saveAll())){
          return
        }
        this.experimentDia = true
@@ -3734,12 +3734,12 @@
          }
                }
            },
      beforeUpload(file) {
      async beforeUpload(file) {
        if(this.sonLaboratory === '电路试验'&&!this.$refs.CircuitParameters.allBandList.find(m=>m.band)){
          this.$message.error('上传附件前请先填写并保存频段');
          return false
        }else{
          this.$refs.CircuitParameters.saveAll()
          await this.$refs.CircuitParameters.saveAll()
          if (file.size > 1024 * 1024 * 10) {
            this.$message.error('上传文件不超过10M');
            this.$refs.upload.clearFiles()
@@ -3846,8 +3846,8 @@
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            if(this.$refs.CircuitParameters.saveAll()){
          }).then(async () => {
            if(await this.$refs.CircuitParameters.saveAll()){
              this.$emit('goback')
            }
          })
src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -798,15 +798,52 @@
        console.log(err)
      })
    },
    saveAll(){
    async saveAll(){
      if(this.allBandList.find(m=>!m.band)){
        this.$message.error('请先填写频段')
        return false
      }else{
        let arr0 = []
        this.allBandList.forEach((h,j)=>{
          this.save(h,j)
          // this.save(h,j)
          let arr = h.projectList.map(item=>{
            if(item.portList&&item.portList.length>0){
              item.value.forEach(m=>{
                m = m.splice(item.portList.length)
              })
            }
            let obj = {
              insProductId:item.id,
              equipValue:this.insProductNew.find(m=>m.id==item.id).equipValue,
              equipName:this.insProductNew.find(m=>m.id==item.id).equipName,
              port:item.portList.map(m=>m.value).join(','),
              angle:item.angleList.map(m=>m.value).join(','),
              value:JSON.stringify(item.value),
              often:item.often
            }
            return obj
          })
          let obj0 = {
            sampleId:this.orderId,
            sonLaboratory:h.projectList[0].sonLaboratory,
            frequency:h.band,
            insProductResult2s:arr
          }
          arr0.push(obj0)
        })
        return true
        let res = await this.$axios.post(this.$api.insOrderPlan.saveInsContext2s, {insProductResultDtos:arr0
        }, {
        headers: {
          'Content-Type': 'application/json'
        },
        noQs:true})
        if(res.code===201){
          this.$message.error('保存失败')
          return false
        }else{
          this.$message.success('已保存')
          return true
        }
      }
    },
    // 更新模板
src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
@@ -674,15 +674,52 @@
        console.log(err)
      })
    },
    saveAll(){
    async saveAll(){
      if(this.allBandList.find(m=>!m.band)){
        this.$message.error('请先填写频段')
        return false
      }else{
        let arr0 = []
        this.allBandList.forEach((h,j)=>{
          this.save(h,j)
          // this.save(h,j)
          let arr = h.projectList.map(item=>{
            if(item.portList&&item.portList.length>0){
              item.value.forEach(m=>{
                m = m.splice(item.portList.length)
              })
            }
            let obj = {
              insProductId:item.id,
              equipValue:this.insProductNew.find(m=>m.id==item.id).equipValue,
              equipName:this.insProductNew.find(m=>m.id==item.id).equipName,
              port:item.portList.map(m=>m.value).join(','),
              angle:item.angleList.map(m=>m.value).join(','),
              value:JSON.stringify(item.value),
              often:item.often
            }
            return obj
          })
          let obj0 = {
            sampleId:this.orderId,
            sonLaboratory:h.projectList[0].sonLaboratory,
            frequency:h.band,
            insProductResult2s:arr
          }
          arr0.push(obj0)
        })
        return true
        let res = await this.$axios.post(this.$api.insOrderPlan.saveInsContext2s, {insProductResultDtos:arr0
        }, {
        headers: {
          'Content-Type': 'application/json'
        },
        noQs:true})
        if(res.code===201){
          this.$message.error('保存失败')
          return false
        }else{
          this.$message.success('已保存')
          return true
        }
      }
    },
    // 更新模板
src/view/index.vue
@@ -518,8 +518,8 @@
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            if(obj.$refs.Inspection.$refs.CircuitParameters.saveAll()){
          }).then( async () => {
            if(await obj.$refs.Inspection.$refs.CircuitParameters.saveAll()){
              this.tabs.splice(index, 1);
              let data = this.tabs[this.tabs.length - 1]
              this.upTabActive(data.k)