zouyu
2023-11-02 13f3799fc43eae5f670c72a675b1fb9326f5a102
	modified:   src/views/quality/finishedProductInspection/finishedProduct-form.vue
modified: src/views/quality/rawMaterial/rawMaterial-form.vue
已修改2个文件
77 ■■■■ 文件已修改
src/views/quality/finishedProductInspection/finishedProduct-form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -227,7 +227,6 @@
                    let arr = item.children.filter(obj=>{
                            return obj.iresult == 0;
                    })
                    console.log("aaa--",arr,arr.length)
                    pro+=arr.length
                }
            })
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -71,7 +71,7 @@
                </el-col>
                <el-col :span="6">
                  <el-form-item label="数量" prop="number">
                      <el-input v-model="dataForm.number" />
                      <el-input v-model="dataForm.number" :disabled="resultVal!=null" />
                  </el-form-item>
                </el-col>
                <el-col :span="6">
@@ -133,14 +133,15 @@
                    <template slot-scope="scope">
                      <el-tooltip :disabled="scope.row.equipmentId != null" class="item" effect="dark" content="请先选择设备!"
                        placement="top-start">
                        <el-input :disabled="scope.row.equipmentId == null ||  dataForm.id!=null" v-model="scope.row.testValueList[index]"
                          @blur="updateTestValue(scope.row)" placeholder="请输入检测值"></el-input>
                        <el-input :disabled="scope.row.equipmentId == null ||  (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]"
                          @blur="updateTestValue(scope.row,index)" placeholder="请输入检测值"></el-input>
                      </el-tooltip>
                    </template>
                  </el-table-column>
                  <el-table-column prop="deviceName" label="试验设备" min-width="260">
                    <template slot-scope="scope">
                        <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%" v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row)">
                        <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%"
                        v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row,scope.$index)">
                            <el-option v-for="(item,index) in deviceList" 
                            :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option>
                        </el-select>
@@ -194,7 +195,7 @@
    <el-dialog
      title="上报"
      :visible.sync="dialogVisible"
      width="30%">
      width="30%" class="l-mes">
      <el-row>
        <el-col>
          <span>不合格数量:</span>
@@ -284,14 +285,19 @@
      this.dataForm.id = this.$route.query.id
      this.resultVal = this.$route.query.resultVal
      if(this.resultVal == null){
        let val = sessionStorage.getItem("raw-resultVal")
        let val = sessionStorage.getItem("raw-resultVal-"+this.dataForm.id)
        val == undefined ? null : this.resultVal=val
      }
      this.init()
      this.getDeviceList()
    },
    watch:{
      dialogVisible(newVal){
        if(newVal){
          this.unqualifiedNum = null
          this.fiedNum = null
        }
      }
    },
    methods:{
      changeName(index,row){
@@ -322,41 +328,41 @@
        }
        this.showPart = true
      },
      updateDevice(row){
      updateDevice(row,index){
        if(this.dataForm.id != null){
          updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
            this.list[index].testValue = ''
            this.list[index].testState = null
            this.list[index].testValueList = []
          }).catch(error=>{
            console.log(error)
          })
        }
      },
      showDialog(){
        this.dialogVisible = true
      },
      submitSave(){
        let pro = this.list.filter(item => {
          return item.testState == 0;
        })
        if (pro.length > 0) {
          let data = {
              id: this.dataForm.id,
              number: this.unqualifiedNum,
              toLocationNo: this.fiedNum
            }
            updateRawInspectsById(data).then(res => {
              if(res.data.code == 0){
                sessionStorage.setItem("raw-resultVal",data.judgeState)
                this.$message.success("上报成功");
              }
            });
          this.dialogVisible = true
        }else{
          updateRawInspectsById({id:this.dataForm.id,number:0}).then(res => {
            if(res.data.code == 0){
              sessionStorage.setItem("raw-resultVal",res)
              this.$message.success("上报成功");
            }
        });
          this.submitSave()
        }
      },
      //上报
      submitSave(){
        let data = {
          id: this.dataForm.id,
          number: this.unqualifiedNum,
          toLocationNo: this.fiedNum
        }
        updateRawInspectsById(data).then(res => {
          if(res.data.code == 0){
            sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,res.data.data)
            this.$message.success("上报成功");
            this.dialogVisible = false
          }
        });
        this.init()
      },
      addTeatValueColumn(){
@@ -389,8 +395,9 @@
          }
        }
      },
      updateTestValue(row){
        if(row.rpId == null){
      updateTestValue(row,index){
        console.log(row,index)
        if(row.rpId == null || row.testValueList[index]==null){
          return
        }
        let obj = {
@@ -430,9 +437,9 @@
              let arr = []
              if(item.testValue != undefined ){
                arr = item.testValue.split(",")
                this.empiricalValueAdd = arr.length
              }else{
                this.empiricalValueAdd = 1
                if(arr.length > this.empiricalValueAdd){
                  this.empiricalValueAdd = arr.length
                }
              }
              this.list.push({
                equipmentId: item.equiomentId,
@@ -450,7 +457,7 @@
              code: data.code,
              name: data.name,
              userName: Array.from(new Set(userNameList)).join(','),
              judgeState: data.judgeState
              judgeState: this.resultVal==null?null:this.resultVal
            }]
          }).catch(error=>{
            this.$message.error("获取失败",error)
@@ -468,6 +475,7 @@
        })
        addRawInspects(data).then(res=>{
            this.$message.success("保存成功")
            this.$router.go(-1)
        }).catch(error=>{
          this.$message.error(error)
        })