|
|
|
@ -393,6 +393,7 @@ |
|
|
|
validateShiftChangeDataCount,/*校验数据条数*/ |
|
|
|
saveAbnormalRollData,/*保存异常截卷数据*/ |
|
|
|
} from '@/api/yieldReport/com_separate_roll.js'; |
|
|
|
import { checkDefectCode } from '@/api/yieldReport/com_defect_roll.js'; |
|
|
|
import { fixedCarrierSave } from '@/api/fixedCarrier/fixedCarrier.js'; |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist'; |
|
|
|
|
|
|
|
@ -956,15 +957,51 @@ export default { |
|
|
|
return Number(num.toFixed(6)).toString() |
|
|
|
}, |
|
|
|
|
|
|
|
getCurrentWorkCenterNo() { |
|
|
|
return (this.scheduleData.workCenterNo || '').trim() |
|
|
|
}, |
|
|
|
|
|
|
|
buildDefectCheckParams(defectCode, workCenterNo) { |
|
|
|
return { |
|
|
|
site: this.pageData.site, |
|
|
|
orderNo: this.pageData.orderNo, |
|
|
|
itemNo: this.pageData.itemNo, |
|
|
|
seqNo: this.pageData.seqNo, |
|
|
|
rollNo: this.pageData.rollNo, |
|
|
|
defectCode: defectCode, |
|
|
|
workCenterNo: workCenterNo |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async addRollDefectItem() { |
|
|
|
if (!this.currentRollDefectList) { |
|
|
|
return |
|
|
|
} |
|
|
|
const workCenterNo = this.getCurrentWorkCenterNo() |
|
|
|
if (!workCenterNo) { |
|
|
|
this.$message.error('当前派工单未维护加工中心,不能选择不良原因') |
|
|
|
return |
|
|
|
} |
|
|
|
this.rollDefectForm.defectCode = (this.rollDefectForm.defectCode || '').trim().toUpperCase() |
|
|
|
if (!this.rollDefectForm.defectCode) { |
|
|
|
this.$message.error('请先选择不良代码') |
|
|
|
return |
|
|
|
} |
|
|
|
let checkResultMap = {} |
|
|
|
try { |
|
|
|
const { data } = await checkDefectCode(this.buildDefectCheckParams(this.rollDefectForm.defectCode, workCenterNo)) |
|
|
|
if (data.code == 500) { |
|
|
|
this.$message.error(data.msg || '不良代码不属于当前加工中心') |
|
|
|
return |
|
|
|
} |
|
|
|
checkResultMap = data.resultMap || {} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('不良代码校验失败,请稍后重试') |
|
|
|
return |
|
|
|
} |
|
|
|
if (checkResultMap.defectDesc) { |
|
|
|
this.rollDefectForm.defectDesc = checkResultMap.defectDesc |
|
|
|
} |
|
|
|
if (!this.rollDefectForm.defectDesc) { |
|
|
|
this.$message.error('请选择有效的不良代码') |
|
|
|
return |
|
|
|
@ -1009,8 +1046,13 @@ export default { |
|
|
|
let strVal = '' |
|
|
|
let conSql = '' |
|
|
|
if (val === 89) { |
|
|
|
const workCenterNo = this.getCurrentWorkCenterNo() |
|
|
|
if (!workCenterNo) { |
|
|
|
this.$message.error('当前派工单未维护加工中心,无法选择不良代码') |
|
|
|
return |
|
|
|
} |
|
|
|
strVal = this.rollDefectForm.defectCode || '' |
|
|
|
conSql = " and A.workCenter_no = '" + this.scheduleData.workCenterNo + "'" |
|
|
|
conSql = " and isnull(A.workCenter_no,'') = '" + workCenterNo + "'" |
|
|
|
} |
|
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
|
}) |
|
|
|
|