zouyu
2023-12-14 8818f234b5e4563aac5e629c04e37d81c932e4f9
	modified:   src/api/quality/finishedProduct.js
modified: src/api/quality/processInspect.js
modified: src/api/quality/rawMaterial.js
modified: src/views/product/workbench/taskinfo-pane.vue
modified: src/views/quality/Packaging_ledger/pack-from.vue
modified: src/views/quality/finishedProductInspection/finishedProduct-form.vue
modified: src/views/quality/packageinspect/packageInspect-form.vue
modified: src/views/quality/processInspect/index.vue
modified: src/views/quality/processInspect/processInspect-form.vue
modified: src/views/quality/rawMaterial/rawMaterial-form.vue
已修改10个文件
220 ■■■■ 文件已修改
src/api/quality/finishedProduct.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/processInspect.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/rawMaterial.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/taskinfo-pane.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/Packaging_ledger/pack-from.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProduct-form.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/packageinspect/packageInspect-form.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/processInspect-form.vue 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/finishedProduct.js
@@ -64,7 +64,7 @@
export function updateFinishedInspectById(obj) {
  return request({
    url: '/mes/qualityFinishedInspect/updateFinishedInspectById',
    url: '/mes/qualityFinishedInspect/updateFinishedInspectById2',
    method: 'post',
    params: obj
  })
src/api/quality/processInspect.js
@@ -27,7 +27,7 @@
export function updateProcessInspectsById(query) {
  return request({
    url: '/mes/qualityProcessInspect/updateProcessInspectsById',
    url: '/mes/qualityProcessInspect/updateProcessInspectsById2',
    method: 'post',
    params: query
  })
src/api/quality/rawMaterial.js
@@ -56,7 +56,7 @@
export function updateRawInspectsById(data) {
  return request({
    url: '/mes/rawInspect/updateRawInspectsById/'+data.id,
    url: '/mes/rawInspect/updateRawInspectsById2/'+data.id,
    method: 'post',
    params: data
  })
src/views/product/workbench/taskinfo-pane.vue
@@ -1891,10 +1891,6 @@
    currOperateTask: {
      handler(newValue, oldValue) {
        if (newValue.id) {
          console.log(
            'currOperateTask',
            this.currOperateTask.routingOperationRemark
          )
          this.opTask.statusDesc = newValue.statusDesc
          // 查询paramDatas
          this.getTechnologyRoutingParam(newValue)
src/views/quality/Packaging_ledger/pack-from.vue
@@ -140,7 +140,7 @@
    //   ...mapGetters(['permissions'])
    },
    created() {
      this.getParamType()
      // this.getParamType()
    },
    methods: {
         // 获取数据列表
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -341,6 +341,11 @@
                    pro+=arr.length
                }
            })
            let obj = {
                id: this.processInspectVo.id,
                number: 0,
                result: this.inspectionResultForm[0].result
            }
            if (pro > 0) {
                this.$prompt('请输入不合格数量', '不合格数量', {
                    confirmButtonText: '确定',
@@ -348,11 +353,8 @@
                    inputPattern: /^\d+$/,
                    inputErrorMessage: '请输入正确数字格式'
                }).then(({ value }) => {
                    let data = {
                    id: this.processInspectVo.id,
                    number: value
                    }
                    updateFinishedInspectById(data).then(res => {
                    obj.number = value
                    updateFinishedInspectById(obj).then(res => {
                        if(res.data.data.indexOf("成功") > 0){
                            this.$message.success("上报成功");
                            this.checkTestState()
@@ -362,7 +364,7 @@
                    });
                }).catch(() => {});
            }else{
                updateFinishedInspectById({id:this.processInspectVo.id,number:0}).then(res => {
                updateFinishedInspectById(obj).then(res => {
                    if(res.data.data.indexOf("成功") > 0){
                            this.$message.success("上报成功");
                            this.checkTestState()
@@ -558,12 +560,38 @@
                }
            })
        },
        changeRowResult(){
            if(this.inspectionItems){
                this.inspectionItems.forEach(e=>{
                    if(e.children){
                        e.children.forEach(i=>{
                            if(i.empiricalValueAddss.length>1){
                                let arr = i.inspectionValue.split(",")
                                arr.splice((arr.length-1),1)
                                let obj = {
                                    devideId: i.eId,
                                    fpid: row.iid,
                                    inspectionValue: arr.join(","),
                                    note : i.inote
                                }
                                updateFinishedInsProduct(obj).then(res => {
                                    if (res.data.code == 0) {
                                        this.init()
                                    }
                                })
                            }
                        })
                    }
                })
            }
        },
        // 删除检验值列
        clickDeleteInspectionColumn() {
            if (this.empiricalValueAdd - 1 === 0) {
            } else {
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    this.changeRowResult()
                    this.inspectionItems.forEach(i => {
                        i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                    });
src/views/quality/packageinspect/packageInspect-form.vue
@@ -282,7 +282,6 @@
              _than.confirmSubmit(_than.submitData,true)
            }
          }).catch(error=>{
            console.log("输入行号");
            _than.dialogVisible = true
          })
@@ -353,6 +352,7 @@
          })
          this.list[i].children.splice(childrenIndex,1)
        }
        this.changeResult()
      },
      //保存检查项
      savePackIns(){
@@ -379,6 +379,7 @@
          updatePackageInsProduct(dataList).then(res=>{
            if(res.status===200){
              this.$message.success("保存成功")
              this.init()
            }
          }).catch(error=>{
            console.log(error);
src/views/quality/processInspect/index.vue
@@ -217,8 +217,9 @@
            addOrUpdateHandle(row) {
                this.$router.push({
                    name: 'processInspectForm',
                    query: { id: row == null ? null : row.id,resultVal : row == null ? null : row.result },
                })
                    query: { id: row == null ? null : row.id },
                    params: { resultVal : row == null ? null : row.result }
                })
            },
            formatResult(row, column, cellValue){
                if(cellValue != undefined || cellValue != null){
src/views/quality/processInspect/processInspect-form.vue
@@ -264,11 +264,12 @@
    mounted() {
        this.getDeviceList()
        this.processInspectVo.id = this.$route.query.id
        this.resultVal = this.$route.query.resultVal
        this.resultVal = this.$route.params.resultVal
        if (this.resultVal == null) {
            let val = sessionStorage.getItem("process-resultVal-" + this.processInspectVo.id);
            val == undefined ? this.resultVal = null : this.resultVal = val
        }
        console.log(this.resultVal);
        this.init()
    },
    methods: {
@@ -282,6 +283,11 @@
                    pro += arr.length
                }
            })
            let obj = {
                id: this.processInspectVo.id,
                number: 0,
                result: this.inspectionResultForm[0].result
            }
            if (pro > 0) {
                this.$prompt('请输入不合格数量', '不合格数量', {
                    confirmButtonText: '确定',
@@ -289,11 +295,8 @@
                    inputPattern: /^\d+$/,
                    inputErrorMessage: '请输入正确数字格式'
                }).then(({ value }) => {
                    let data = {
                        id: this.processInspectVo.id,
                        number: value
                    }
                    updateProcessInspectsById(data).then(res => {
                    obj.number = value
                    updateProcessInspectsById(obj).then(res => {
                        let data = res.data.data
                        if (data) {
                            if (data.indexOf("成功") > 0) {
@@ -307,7 +310,7 @@
                    });
                }).catch(() => { });
            } else {
                updateProcessInspectsById({ id: this.processInspectVo.id, number: 0 }).then(res => {
                updateProcessInspectsById(obj).then(res => {
                    let data = res.data.data
                    if (data) {
                        if (data.indexOf("成功") > 0) {
@@ -373,11 +376,21 @@
                        }
                    })
                    this.inspectionItems = result.children
                    let rVal = '1'
                    this.inspectionItems.forEach(item => {
                        if (item.children) {
                            item.children.forEach(obj => {
                                if (obj.iresult == 0) {
                                    rVal = '0'
                                }
                            })
                        }
                    })
                    this.inspectionResultForm = [{
                        materialCode: result.materialCode,
                        material: result.material,
                        userName: Array.from(new Set(userList)).join(","),
                        result: this.resultVal == null ? '' : this.resultVal,
                        result: this.resultVal == null ? rVal : this.resultVal,
                    }]
                }).catch(error => {
                    console.log(error)
@@ -418,7 +431,6 @@
            this.technologyList = sample.children
        },
        changeState(row,isChecked) {
            console.log(row);
            const _than = this
            if(isChecked){
                let isNumber = true
@@ -443,7 +455,6 @@
                if (str === undefined || str === '' || str === null) {
                    return
                }
                let obj = {
                    devideId: row.eId,
                    ppid: row.iid,
@@ -510,14 +521,45 @@
                }
            })
        },
        changeRowResult(){
            if(this.inspectionItems){
                this.inspectionItems.forEach(e=>{
                    if(e.children){
                        e.children.forEach(i=>{
                            if(i.empiricalValueAddss.length>1){
                                let arr = i.inspectionValue.split(",")
                                arr.splice((arr.length-1),1)
                                let obj = {
                                    devideId: i.eId,
                                    ppid: i.iid,
                                    inspectionValue: arr.join(","),
                                    note : i.inote
                                }
                                updateProcessInsProduct(obj).then(res => {
                                    if (res.data.code == 0) {
                                        this.init()
                                    }
                                })
                            }
                        })
                    }
                })
            }
        },
        // 删除检验值列
        clickDeleteInspectionColumn() {
            if (this.empiricalValueAdd - 1 === 0) {
            const _than = this
            if (_than.empiricalValueAdd - 1 === 0) {
            } else {
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    this.inspectionItems.forEach(i => {
                        i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                if (_than.empiricalValueAddMaxNumber != _than.empiricalValueAdd - 1) {
                    _than.empiricalValueAdd = _than.empiricalValueAdd - 1;
                    _than.changeRowResult()
                    _than.inspectionItems.forEach(i => {
                        if(i.children){
                            i.children.forEach(ele=>{
                                ele.empiricalValueAddss.splice(_than.empiricalValueAdd, 1);
                            })
                        }
                    });
                }
            }
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -170,10 +170,11 @@
                    <template slot-scope="scope">
                      <div v-if="!scope.row.children">
                      <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="请先选择设备!" placement="top-start">
                          <el-select @blur="changeState(scope.row, index)" style="width:100%" allow-create filterable default-first-option
                          <el-select style="width:100%" allow-create filterable default-first-option
                          :disabled="scope.row.deviceId == null ||  (dataForm.id!=null&&resultVal!=null)"
                          v-model="scope.row.testValueList[index]"
                          placeholder="请输入或选择检测值" @change="updateTestValue(scope.row,scope.$index)">
                          placeholder="请输入或选择检测值"
                          @change="changeState(scope.row,scope.$index)">
                            <el-option label="是" value="是"/>
                            <el-option label="否" value="否"/>
                          </el-select>
@@ -501,6 +502,7 @@
        let data = {
          id: this.dataForm.id,
          number: this.unqualifiedNum,
          result: this.conclusionTable[0].testState
        }
        updateRawInspectsById(data).then(res => {
          if(res.data.code == 0 && (res.data.data=='1'|| res.data.data=='0')){
@@ -567,37 +569,45 @@
        }
      },
      changeRowResult(){
          if(this.list){
              this.list.forEach(e=>{
                  if(e.children){
                      e.children.forEach(i=>{
                          if(i.testValueList.length>1){
                              let arr = i.testValue.split(",")
                              arr.splice((arr.length-1),1)
                              let obj = {
                                deviceId: i.deviceId,
                                rpId: i.rpId,
                                testValue: arr.join(","),
                                note: i.note
                              }
                              updateRawInsProduct(obj).then(res=>{
                                if(res.data.code === 0){
                                  this.init()
                                }
                              })
                          }
                      })
                  }
              })
          }
      },
      delTeatValueColumn(){
        if (this.empiricalValueAdd - 1 > 0) {
          if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
            this.empiricalValueAdd = this.empiricalValueAdd - 1;
            this.changeRowResult()
            this.list.forEach(i => {
              i.testValueList.splice(this.empiricalValueAdd, 1);
              if(i.children){
                i.children.forEach(ele=>{
                  ele.testValueList.splice(this.empiricalValueAdd, 1);
                })
              }
            });
          }
        }
      },
      updateTestValue(row,index){
        if(row.rpId == null){
          return
        }
        let val = row.testValueList.join(",");
        let obj = {
          deviceId: row.deviceId,
          rpId: row.rpId,
          testValue: val,
          note: row.note
        }
        updateRawInsProduct(obj).then(res=>{
          if(res.data.code === 0){
            this.$message.success("更新成功")
            this.init()
          }else{
            this.$message.success("更新失败")
          }
        }).catch(error=>{
          this.$message.error(error)
        })
      },
      init(){
        if(this.dataForm.id){
@@ -656,11 +666,21 @@
                    this.list.push(ele)
                }}
            })
            let rVal = '1'
            this.list.forEach(item=>{
                if(item.children){
                  item.children.forEach(ele=>{
                    if(ele.testState == 0){
                      rVal = '0'
                    }
                  })
                }
            })
            this.conclusionTable = [{
              code: data.code,
              name: data.name,
              userName: Array.from(new Set(userNameList)).join(','),
              testState: this.resultVal==null?null:this.resultVal
              testState: this.resultVal==null?rVal:this.resultVal
            }]
          }).catch(error=>{
            this.$message.error("获取失败",error)
@@ -670,6 +690,22 @@
        }
      },
      changeState(row, index) {
          if(row){
            let isTrue = true
            for(var i=0;i<row.testValueList.length;i++){
              let val = row.testValueList[i]
              let reg = /^[0-9]*[1-9][0-9]*$/
              console.log(['是','否'].includes(val));
              if(!reg.test(val) && !['是','否'].includes(val)){
                this.$message.error("请输入数字或选择是否")
                row.testValueList[i] = null
                isTrue = false
              }
            }
            if(!isTrue){
              return
            }
          }
          if (row.rpId != null && row.rpId != '') {
            let val = row.testValueList.join(",")
            if (val === undefined || val === '' || val === null) {