zouyu
2023-12-12 a41cd450e4b6afe11f9d1c6f09f19f1fbf86edca
src/views/quality/packageinspect/packageInspect-form.vue
@@ -168,6 +168,7 @@
  fetchListById,
  updatePackageInsProduct,
  updatePackageInspectById,
  getCustomer,
} from '@/api/quality/packageInspect'
export default {
    computed:{},
@@ -249,21 +250,42 @@
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let data = {
          id: _than.dataForm.id,
          result: _than.conclusionTable[0].result,
        }
        updatePackageInspectById(data).then(res => {
          if(res.data.code === 0){
            _than.resultVal = res.data.data
            sessionStorage.setItem("packIns-resultVal-"+_than.dataForm.id,res.data.data)
            _than.$message.success("上报成功");
          }else{
            _than.$message.error("上报失败",res.data.data);
          }
        })
          this.checkCustomer(_than.dataForm.id)
        }).catch(() => {})
      },
      checkCustomer(id){
        const _than = this
        if(id){
          getCustomer(id).then(res=>{
            if(res.status===200){
              console.log(res.data);
            }
          }).catch(error=>{
            this.$prompt('请输入行号', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              inputPattern: /\S/,
              inputErrorMessage: '行号不能为空'
            }).then(({ value }) => {
              let data = {
                id: _than.dataForm.id,
                result: _than.conclusionTable[0].result,
                lineNo: value
              }
              updatePackageInspectById(data).then(res => {
                if(res.data.code === 0){
                  _than.resultVal = res.data.data
                  sessionStorage.setItem("packIns-resultVal-"+_than.dataForm.id,res.data.data)
                  _than.$message.success("上报成功");
                }else{
                  _than.$message.error("上报失败",res.data.data);
                }
              })
            }).catch(() => {
            })
          })
        }
      },
      // 添加行
      clickAddLine() {
          this.list.push({