Browse Source

2025-12-16

异常续卷优化
master
fengyuan_yang 4 weeks ago
parent
commit
36a7a42700
  1. 2
      src/views/modules/yieldReport/com_abnormal_continue_roll.vue
  2. 92
      src/views/modules/yieldReport/com_separate_roll.vue

2
src/views/modules/yieldReport/com_abnormal_continue_roll.vue

@ -13,7 +13,7 @@
border border
style="width: 100%; margin-top: 10px;" style="width: 100%; margin-top: 10px;"
max-height="150" max-height="150"
@row-dblclick="selectRollNo"
@row-click="selectRollNo"
highlight-current-row> highlight-current-row>
<el-table-column prop="currentRollNo" label="主卷号" align="center" min-width="200"> <el-table-column prop="currentRollNo" label="主卷号" align="center" min-width="200">
</el-table-column> </el-table-column>

92
src/views/modules/yieldReport/com_separate_roll.vue

@ -761,13 +761,12 @@ export default {
} }
try { try {
// ========== ==========
// ========== + ==========
// //
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount); const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount);
const remainingRows = this.pageData.rowCount % this.pageData.rollCount; const remainingRows = this.pageData.rowCount % this.pageData.rollCount;
let currentRowIndex = 0; let currentRowIndex = 0;
let newRollNo = ''; //
const allPrintList = []; // const allPrintList = []; //
// //
@ -782,6 +781,9 @@ export default {
// //
let rollRemark = ''; let rollRemark = '';
//
const currentRollRowDataList = [];
for (let i = 0; i < currentRollRows; i++) { for (let i = 0; i < currentRollRows; i++) {
const row = this.rowDataList[currentRowIndex + i]; const row = this.rowDataList[currentRowIndex + i];
totalGoodQty += row.goodQty || 0; totalGoodQty += row.goodQty || 0;
@ -800,6 +802,16 @@ export default {
totalQty: row.totalQty || 0, totalQty: row.totalQty || 0,
remark: row.remark || '' remark: row.remark || ''
}); });
//
currentRollRowDataList.push({
rowNumber: row.rowNumber,
goodQty: row.goodQty || 0,
surfaceLossQty: row.surfaceLossQty || 0,
poorPerformanceQty: row.poorPerformanceQty || 0,
defectQty: row.defectQty || 0,
remark: row.remark || ''
});
} }
// //
@ -819,13 +831,36 @@ export default {
throw new Error(data.msg); throw new Error(data.msg);
} }
//
//
let currentNewRollNo = '';
if (data.printList && data.printList.length > 0) { if (data.printList && data.printList.length > 0) {
newRollNo = data.printList[0].rollNo || '';
currentNewRollNo = data.printList[0].rollNo || '';
// //
allPrintList.push(...data.printList); allPrintList.push(...data.printList);
} }
const abnormalRollData = {
site: this.scheduleData.site,
buNo: this.scheduleData.buNo,
orderNo: this.scheduleData.orderNo,
seqNo: parseInt(this.scheduleData.seqNo) || 0,
fixtureNo: this.pageData.fixture,
shiftFrom: this.scheduleData.shiftNo || '',
rowCount: currentRollRows,
rollCount: 1,
createdBy: this.pageData.operatorId,
currentRollNo: this.scheduleData.rollNo || '',
newRollNo: currentNewRollNo,
operatorId: this.pageData.operatorId,
rowDataList: currentRollRowDataList
};
const {data: abnormalData} = await saveAbnormalRollData(abnormalRollData);
if (!abnormalData || abnormalData.code !== 0) {
console.error(`${rollIndex + 1}卷缓存数据保存失败:`, abnormalData && abnormalData.msg);
}
this.$message.success(`${rollIndex + 1}/${this.pageData.rollCount}卷创建成功`); this.$message.success(`${rollIndex + 1}/${this.pageData.rollCount}卷创建成功`);
currentRowIndex += currentRollRows; currentRowIndex += currentRollRows;
@ -847,49 +882,18 @@ export default {
} }
} }
// ========== ==========
const abnormalRollData = {
site: this.scheduleData.site,
buNo: this.scheduleData.buNo,
orderNo: this.scheduleData.orderNo,
seqNo: parseInt(this.scheduleData.seqNo) || 0,
fixtureNo: this.pageData.fixture,
shiftFrom: this.scheduleData.shiftNo || '',
rowCount: this.pageData.rowCount,
rollCount: this.pageData.rollCount,
createdBy: this.pageData.operatorId,
//
currentRollNo: this.scheduleData.rollNo || '', //
newRollNo: newRollNo, //
operatorId: this.pageData.operatorId, //
rowDataList: this.rowDataList.map(row => ({
rowNumber: row.rowNumber,
goodQty: row.goodQty || 0,
surfaceLossQty: row.surfaceLossQty || 0,
poorPerformanceQty: row.poorPerformanceQty || 0,
defectQty: row.defectQty || 0,
remark: row.remark || ''
}))
};
this.$message.success('异常截卷操作完成!数据已保存。');
const {data: abnormalData} = await saveAbnormalRollData(abnormalRollData);
if (abnormalData && abnormalData.code === 0) {
this.$message.success('异常截卷操作完成!数据已保存。');
// ========== ==========
if (allPrintList.length > 0) {
await this.printLabelsWithTemplate(allPrintList);
}
//
setTimeout(() => {
this.closeDialog();
}, 1000);
} else {
this.$message.error(abnormalData.msg || '异常截卷缓存数据保存失败');
// ========== ==========
if (allPrintList.length > 0) {
await this.printLabelsWithTemplate(allPrintList);
} }
//
setTimeout(() => {
this.closeDialog();
}, 1000);
} catch (error) { } catch (error) {
console.error('异常截卷操作失败:', error); console.error('异常截卷操作失败:', error);
this.$message.error('异常截卷操作失败:' + error.message); this.$message.error('异常截卷操作失败:' + error.message);

Loading…
Cancel
Save