Browse Source

2025-12-15

过站采集-》车间工作平台->异常截卷增加打印
master
fengyuan_yang 4 weeks ago
parent
commit
91eff371b5
  1. 8
      src/views/modules/yieldReport/com_abnormal_continue_roll.vue
  2. 47
      src/views/modules/yieldReport/com_separate_roll.vue

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

@ -15,9 +15,9 @@
max-height="150"
@row-dblclick="selectRollNo"
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 prop="newRollNo" label="卷号" align="center" min-width="200">
<el-table-column prop="newRollNo" label="分卷卷号" align="center" min-width="200">
</el-table-column>
</el-table>
</div>
@ -27,12 +27,12 @@
<!-- 卷信息行 -->
<el-row>
<el-col :span="12">
<el-form-item label="当前卷号">
<el-form-item label="卷号">
<el-input v-model="selectedRollNo.currentRollNo" readonly style="width: 200px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="卷号">
<el-form-item label="分卷卷号">
<el-input v-model="selectedRollNo.newRollNo" readonly style="width: 200px;"></el-input>
</el-form-item>
</el-col>

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

@ -456,7 +456,7 @@ export default {
async init(scheduleData, operatorData) {
// handleRowCountChange
this.isLoadingCachedData = true;
//
this.scheduleData = scheduleData;
//
@ -490,15 +490,15 @@ export default {
this.$refs.rollQty && this.$refs.rollQty.focus();
});
this.titleCon = this.labels.componentTitle;//
//
await this.loadCachedShiftChangeData();
//
if (!this.hasCachedData) {
this.initRowDataList();
}
//
this.isLoadingCachedData = false;
},
@ -511,29 +511,29 @@ export default {
orderNo: this.scheduleData.orderNo,
seqNo: parseInt(this.scheduleData.seqNo) || 0
};
console.log('查询缓存数据参数:', params);
const {data} = await getUnprocessedShiftChangeData(params);
console.log('查询缓存数据结果:', data);
if (data && data.code === 0 && data.data && data.data.length > 0) {
//
this.hasCachedData = true;
this.cachedDataCount = data.count;
const cachedList = data.data;
console.log('缓存数据列表:', cachedList);
//
if (cachedList.length > 0) {
this.pageData.rowCount = cachedList[0].rowCount || 0;
this.pageData.rollCount = cachedList[0].rollCount || 0;
this.pageData.fixture = cachedList[0].fixtureNo || '';
}
//
this.rowDataList = cachedList.map(item => ({
rowNumber: item.rowBumber,
@ -545,12 +545,12 @@ export default {
totalQty: (Number(item.goodQty) || 0) + (Number(item.defectQty) || 0),
remark: item.remark || ''
}));
//
this.cachedRowDataList = JSON.parse(JSON.stringify(this.rowDataList));
console.log('恢复后的行数据:', this.rowDataList);
this.$message.info(`已加载上次换班结转的缓存数据(${this.cachedDataCount}条)`);
}
// init
@ -559,7 +559,7 @@ export default {
// init
}
},
//
calculateYieldRate(goodQty, defectQty) {
const totalQty = goodQty + defectQty;
@ -751,7 +751,7 @@ export default {
//
try {
await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告(不打印)并保存缓存数据。', '提示', {
await this.$confirm('确定执行异常截卷操作吗?该操作将执行产量报告。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -761,13 +761,14 @@ export default {
}
try {
// ========== ==========
// ========== ==========
//
const rowsPerRoll = Math.floor(this.pageData.rowCount / this.pageData.rollCount);
const remainingRows = this.pageData.rowCount % this.pageData.rollCount;
let currentRowIndex = 0;
let newRollNo = ''; //
const allPrintList = []; //
//
for (let rollIndex = 0; rollIndex < this.pageData.rollCount; rollIndex++) {
@ -821,6 +822,8 @@ export default {
//
if (data.printList && data.printList.length > 0) {
newRollNo = data.printList[0].rollNo || '';
//
allPrintList.push(...data.printList);
}
this.$message.success(`${rollIndex + 1}/${this.pageData.rollCount}卷创建成功`);
@ -873,6 +876,12 @@ export default {
if (abnormalData && abnormalData.code === 0) {
this.$message.success('异常截卷操作完成!数据已保存。');
// ========== ==========
if (allPrintList.length > 0) {
await this.printLabelsWithTemplate(allPrintList);
}
//
setTimeout(() => {
this.closeDialog();
@ -1176,7 +1185,7 @@ export default {
for (let i = 0; i < this.cachedRowDataList.length; i++) {
const cachedRow = this.cachedRowDataList[i];
const currentRow = this.rowDataList[i];
if (currentRow) {
//
if ((currentRow.goodQty || 0) < (cachedRow.goodQty || 0)) {

Loading…
Cancel
Save