|
|
|
@ -356,7 +356,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 批量编辑物料缺陷跟踪 --> |
|
|
|
<el-dialog title="批量编辑物料缺陷跟踪" :close-on-click-modal="false" v-drag :visible.sync="batchDefectEditFlag" width="1100px" class="part-edit-dialog"> |
|
|
|
<el-dialog title="批量编辑物料缺陷跟踪" :close-on-click-modal="false" v-drag :visible.sync="batchDefectEditFlag" width="1280px" class="part-edit-dialog"> |
|
|
|
<div class="dialog-content"> |
|
|
|
<div class="form-section"> |
|
|
|
<div class="section-title">缺陷跟踪</div> |
|
|
|
@ -367,8 +367,9 @@ |
|
|
|
class="batch-defect-edit-table" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="partNo" label="物料编码" header-align="center" align="left" min-width="130" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="partDesc" label="物料名称" header-align="center" align="left" min-width="180" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="buDesc" label="BU" header-align="center" align="center" width="80" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="partDesc" label="物料名称" header-align="center" align="left" min-width="160" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="supplierId" label="供应商编码" header-align="center" align="left" min-width="110" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="supplierName" label="供应商名称" header-align="center" align="left" min-width="160" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column label="不合格阈值" header-align="center" align="right" min-width="110"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input-number class="num-right" :controls="false" :step="0" :min="0" v-model="scope.row.defectThreshold" style="width: 100%"></el-input-number> |
|
|
|
@ -1560,7 +1561,6 @@ |
|
|
|
import { |
|
|
|
qcPartAttributeSearch, // 查询物料属性 |
|
|
|
qcPartAttributeEdit, // 修改物料属性 |
|
|
|
batchQcPartDefectTrackingEdit, // 批量编辑物料缺陷跟踪 |
|
|
|
searchPartAttributeDetails, // 查询物料属性模板 |
|
|
|
savePartAttributeDetails, // 新增物料属性模板 |
|
|
|
deletePartAttributeDetails, // 删除物料属性模板 |
|
|
|
@ -1573,6 +1573,7 @@ |
|
|
|
getSiteAndBuByUserName, |
|
|
|
searchPartInfo, // 查询物料信息 |
|
|
|
getPartDefectTracking, // 查询跟踪缺陷 |
|
|
|
getPartDefectTrackingByParts, // 按勾选物料查询缺陷跟踪 |
|
|
|
saveDefectTracking, // 新增跟踪缺陷 |
|
|
|
deleteDefectTracking, // 删除跟踪缺陷 |
|
|
|
updateDefectTracking, // 编辑跟踪缺陷 |
|
|
|
@ -2941,19 +2942,38 @@ |
|
|
|
this.$message.warning('请先勾选要批量编辑的物料!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.batchDefectEditList = this.partSelections.map(row => ({ |
|
|
|
const partList = this.partSelections.map(row => ({ |
|
|
|
site: row.site, |
|
|
|
buNo: row.buNo, |
|
|
|
buDesc: row.buDesc, |
|
|
|
partNo: row.partNo, |
|
|
|
partDesc: row.partDesc, |
|
|
|
defectThreshold: row.defectThreshold == null ? 0 : Number(row.defectThreshold), |
|
|
|
recoveryBatchCount: row.recoveryBatchCount == null ? 0 : Number(row.recoveryBatchCount), |
|
|
|
currentDefectCount: row.currentDefectCount == null ? 0 : Number(row.currentDefectCount), |
|
|
|
remainingTrackingBatches: row.remainingTrackingBatches == null ? 0 : Number(row.remainingTrackingBatches), |
|
|
|
lastUpdateBy: this.$store.state.user.name |
|
|
|
partNo: row.partNo |
|
|
|
})) |
|
|
|
this.batchDefectEditFlag = true |
|
|
|
getPartDefectTrackingByParts(partList).then(({data}) => { |
|
|
|
const rows = (data && data.rows) || [] |
|
|
|
if (!data || data.code !== 0) { |
|
|
|
this.$message.error((data && data.msg) || '查询缺陷跟踪失败') |
|
|
|
return |
|
|
|
} |
|
|
|
if (rows.length === 0) { |
|
|
|
this.$message.warning('所选物料没有缺陷跟踪数据!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.batchDefectEditList = rows.map(row => ({ |
|
|
|
site: row.site, |
|
|
|
buNo: row.buNo, |
|
|
|
partNo: row.partNo, |
|
|
|
partDesc: row.partDesc, |
|
|
|
buDesc: row.buDesc, |
|
|
|
supplierId: row.supplierId, |
|
|
|
supplierName: row.supplierName, |
|
|
|
defectThreshold: row.defectThreshold == null ? 0 : Number(row.defectThreshold), |
|
|
|
recoveryBatchCount: row.recoveryBatchCount == null ? 0 : Number(row.recoveryBatchCount), |
|
|
|
currentDefectCount: row.currentDefectCount == null ? 0 : Number(row.currentDefectCount), |
|
|
|
remainingTrackingBatches: row.remainingTrackingBatches == null ? 0 : Number(row.remainingTrackingBatches) |
|
|
|
})) |
|
|
|
this.batchDefectEditFlag = true |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error((error && error.message) || '查询缺陷跟踪失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
saveBatchDefectEdit () { |
|
|
|
@ -2966,12 +2986,13 @@ |
|
|
|
const remaining = Number(row.remainingTrackingBatches || 0) |
|
|
|
const recovery = Number(row.recoveryBatchCount || 0) |
|
|
|
if (remaining > recovery) { |
|
|
|
this.$message.warning(`物料【${row.partNo}】剩余跟踪批次不能大于连续跟踪批次`) |
|
|
|
const supplier = row.supplierName || row.supplierId || '' |
|
|
|
this.$message.warning(`物料【${row.partNo}】供应商【${supplier}】剩余跟踪批次不能大于连续跟踪批次`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.batchDefectEditLoading = true |
|
|
|
batchQcPartDefectTrackingEdit(this.batchDefectEditList).then(({data}) => { |
|
|
|
updateDefectTracking(this.batchDefectEditList).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('操作成功') |
|
|
|
this.batchDefectEditFlag = false |
|
|
|
@ -2979,7 +3000,9 @@ |
|
|
|
this.$refs.partTable.clearSelection() |
|
|
|
} |
|
|
|
this.partSelections = [] |
|
|
|
this.getDataList() |
|
|
|
if (this.activeTable === 'defectTracking' && this.partCurrentRow && this.partCurrentRow.partNo) { |
|
|
|
this.getPartDefectTracking() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '批量保存失败') |
|
|
|
} |
|
|
|
@ -4506,10 +4529,11 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.part-edit-dialog .batch-defect-edit-table /deep/ .el-table__cell .cell { |
|
|
|
height: auto !important; |
|
|
|
line-height: 28px !important; |
|
|
|
overflow: visible !important; |
|
|
|
white-space: normal !important; |
|
|
|
height: 20px !important; |
|
|
|
line-height: 20px !important; |
|
|
|
overflow: hidden !important; |
|
|
|
white-space: nowrap !important; |
|
|
|
text-overflow: ellipsis !important; |
|
|
|
} |
|
|
|
|
|
|
|
.part-edit-dialog .batch-defect-edit-table /deep/ .el-input-number { |
|
|
|
|