王震
2023-11-02 fabecc63d5a9bd53489505ce383d48fb56776f61
Merge remote-tracking branch 'origin/master'
已修改3个文件
125 ■■■■■ 文件已修改
src/views/quality/finishedProductInspection/finishedProduct-form.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/processInspect-form.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -111,7 +111,7 @@
                                <span v-if="resultVal!=null && processInspectVo.id!=null" v-text="scope.row.ename"></span>
                                <div v-else>
                                    <el-select style="width:100%" v-model="scope.row.eId" 
                                    v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row)">
                                    v-if="scope.row.iname != null" 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>
@@ -214,7 +214,7 @@
        this.processInspectVo.id = this.$route.query.id
        this.resultVal = this.$route.query.resultVal
        if(this.resultVal == null){
            let val = sessionStorage.getItem("finished-resultVal");
            let val = sessionStorage.getItem("finished-resultVal-"+this.processInspectVo.id);
            val == undefined ? this.resultVal=null : this.resultVal = val
        }
        this.init()
@@ -227,7 +227,6 @@
                    let arr = item.children.filter(obj=>{
                            return obj.iresult == 0;
                    })
                    console.log("aaa--",arr,arr.length)
                    pro+=arr.length
                }
            })
@@ -276,7 +275,7 @@
            })
            this.resultVal = resultVal
            this.inspectionResultForm[0].result = resultVal
            sessionStorage.setItem("finished-resultVal",resultVal)
            sessionStorage.setItem("finished-resultVal-"+this.processInspectVo.id,resultVal)
        },
        init(){
            let id = this.processInspectVo.id
@@ -327,8 +326,15 @@
                this.deviceList = res.data.data
            })
        },
        updateDevice(row){
        updateDevice(row,index){
            updateDeviceById({equiomentId:row.eId,fpid:row.iId}).then(res=>{
                this.inspectionItems.forEach(obj=>{
                    if(obj.children){
                        obj.children[index-1].inspectionValue = ''
                        obj.children[index-1].iresult = null
                        obj.children[index-1].empiricalValueAddss = []
                    }
                })
            }).catch(error=>{
                console.log(error)
            })
src/views/quality/processInspect/processInspect-form.vue
@@ -111,7 +111,7 @@
                                    <span v-if="resultVal != null && scope.row.iname != null" v-text="scope.row.ename"></span>
                                    <div v-else>
                                        <el-select style="width:100%" v-model="scope.row.eId" 
                                        v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row)">
                                        v-if="scope.row.iname != null" 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>
@@ -212,7 +212,7 @@
            this.processInspectVo.id = this.$route.query.id
            this.resultVal = this.$route.query.resultVal
            if(this.resultVal == null){
                let val = sessionStorage.getItem("process-resultVal");
                let val = sessionStorage.getItem("process-resultVal-"+this.processInspectVo.id);
                val == undefined ? this.resultVal=null : this.resultVal = val
            }
            this.init()
@@ -282,7 +282,7 @@
                })
                this.resultVal = resultVal
                this.inspectionResultForm[0].result = resultVal
                sessionStorage.setItem("process-resultVal",resultVal)
                sessionStorage.setItem("process-resultVal-"+this.processInspectVo.id,resultVal)
            },
            init(){
                let id = this.processInspectVo.id
@@ -332,8 +332,15 @@
                    this.deviceList = res.data.data
                })
            },
            updateDevice(row){
            updateDevice(row,index){
                updateDeviceBypppId({equiomentId:row.eId,ppid:row.iId}).then(res=>{
                    this.inspectionItems.forEach(obj=>{
                        if(obj.children){
                            obj.children[index-1].inspectionValue = ''
                            obj.children[index-1].iresult = null
                            obj.children[index-1].empiricalValueAddss = []
                        }
                    })
                }).catch(error=>{
                    console.log(error)
                })
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>
@@ -176,8 +177,8 @@
                <el-table-column prop="userName" label="检验员"></el-table-column>
                <el-table-column prop="judgeState" label="检验结论">
                  <template slot-scope="scope">
                    <el-tag type="success" v-if="scope.row.judgeState == 1">合格</el-tag>
                    <el-tag type="danger" v-else-if="scope.row.judgeState == 0">不合格</el-tag>
                    <el-tag type="success" v-if="scope.row.testState == '1'">合格</el-tag>
                    <el-tag type="danger" v-else-if="scope.row.testState == '0'">不合格</el-tag>
                  </template>
                </el-table-column>
                <el-table-column  label="操作">
@@ -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,42 +328,55 @@
        }
        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
      checkTestState(){
          let resultVal = '1'
          this.list.forEach(item=>{
              if(item.children){
                if(obj.testState == 0){
                    resultVal = '0'
                }
              }
          })
          this.resultVal = resultVal
          this.conclusionTable[0].testState = resultVal
          sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,resultVal)
      },
      submitSave(){
      showDialog(){
        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()
        }
        this.init()
      },
      //上报
      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.checkTestState()
      },
      addTeatValueColumn(){
        this.empiricalValueAdd = this.empiricalValueAdd + 1;
@@ -389,8 +408,8 @@
          }
        }
      },
      updateTestValue(row){
        if(row.rpId == null){
      updateTestValue(row,index){
        if(row.rpId == null || row.testValueList[index]==null){
          return
        }
        let obj = {
@@ -430,9 +449,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 +469,7 @@
              code: data.code,
              name: data.name,
              userName: Array.from(new Set(userNameList)).join(','),
              judgeState: data.judgeState
              testState: this.resultVal==null?null:this.resultVal
            }]
          }).catch(error=>{
            this.$message.error("获取失败",error)
@@ -468,6 +487,7 @@
        })
        addRawInspects(data).then(res=>{
            this.$message.success("保存成功")
            this.$router.go(-1)
        }).catch(error=>{
          this.$message.error(error)
        })