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

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

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

Loading…
Cancel
Save