| | |
| | | </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> |
| | | |
| | |
| | | fetchListById, |
| | | updatePackageInsProduct, |
| | | updatePackageInspectById, |
| | | getCustomer, |
| | | } from '@/api/quality/packageInspect' |
| | | export default { |
| | | computed:{}, |
| | |
| | | }, |
| | | data(){ |
| | | return{ |
| | | submitData: { |
| | | id:null, |
| | | result: null, |
| | | lineNo: null, |
| | | }, |
| | | dialogVisible: false, |
| | | loading: false, |
| | | resultVal: null, |
| | | dataForm:{ |
| | |
| | | this.init() |
| | | }, |
| | | watch:{ |
| | | dialogVisible(newVal){ |
| | | if(!newVal){ |
| | | this.$refs.form.resetFields(); |
| | | } |
| | | } |
| | | }, |
| | | methods:{ |
| | | changeResult(){ |
| | |
| | | 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); |
| | | } |
| | | }) |
| | | _than.submitData.id = _than.dataForm.id, |
| | | _than.submitData.result = _than.conclusionTable[0].result, |
| | | getCustomer(_than.dataForm.id).then(res=>{ |
| | | if(res.status===200){ |
| | | _than.confirmSubmit(_than.submitData,true) |
| | | } |
| | | }).catch(error=>{ |
| | | 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); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 添加行 |
| | | clickAddLine() { |
| | | this.list.push({ |