Fixiaobai
2023-12-12 908328b13be01bdedba01d528bbd8ae4078bc0c7
Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
已修改1个文件
87 ■■■■■ 文件已修改
src/views/quality/packageinspect/packageInspect-form.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/packageinspect/packageInspect-form.vue
@@ -160,6 +160,20 @@
        </el-row>
      </div>
    </div>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%">
      <el-form :model="submitData" ref="form" label-width="100px" >
        <el-form-item label="请输入行号" prop="lineNo" :rules="{required:true,message:'行号不能为空',trigger:'blur'}">
          <el-input v-model="submitData.lineNo" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="confirmSubmit(submitData,false)">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -176,6 +190,12 @@
    },
    data(){
        return{
            submitData: {
              id:null,
              result: null,
              lineNo: null,
            },
            dialogVisible: false,
            loading: false,
            resultVal: null,
            dataForm:{
@@ -223,6 +243,11 @@
      this.init()
    },
    watch:{
      dialogVisible(newVal){
        if(!newVal){
          this.$refs.form.resetFields();
        }
      }
    },
    methods:{
      changeResult(){
@@ -250,39 +275,41 @@
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.checkCustomer(_than.dataForm.id)
        }).catch(() => {})
      },
      checkCustomer(id){
        const _than = this
        if(id){
          getCustomer(id).then(res=>{
          _than.submitData.id = _than.dataForm.id,
          _than.submitData.result = _than.conclusionTable[0].result,
          getCustomer(_than.dataForm.id).then(res=>{
            if(res.status===200){
              console.log(res.data);
              _than.confirmSubmit(_than.submitData,true)
            }
          }).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(() => {
            })
            console.log("输入行号");
            _than.dialogVisible = true
          })
        }).catch(() => {})
      },
      confirmSubmit(data,isOtc){
        const _than = this
        let isSubmit = false
        if(isOtc){
          isSubmit = true
        }else{
          _than.$refs.form.validate(valid=>{
            if(valid){
              isSubmit = true
              _than.dialogVisible = false
            }
          })
        }
        if(isSubmit){
          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);
            }
          })
        }
      },