feat(wms): 多模块优化调整

1. 新增镀锌待打包仓库选项
2. 注释发货单为空打印校验逻辑
3. 优化钢卷查询API参数处理
4. 调整报表接口调用与数据解析
5. 移除发货单模板中的原料厂家列
This commit is contained in:
2026-05-21 08:59:44 +08:00
parent 2c9cc6241f
commit 7b75940258
7 changed files with 144 additions and 138 deletions

View File

@@ -188,10 +188,16 @@ export function exportCoilData(coilIds) {
// 报表查询使用的post类型的查询查询所有符合条件的钢卷
export function listCoilWithIds(data) {
// 如果存在pageSize, 或者pageNum 将其放入params中
const { pageSize, pageNum, ...rest } = data
return request({
url: '/wms/materialCoil/listByPost',
method: 'post',
data,
data: rest,
params: {
pageSize,
pageNum,
},
timeout: 600000
})
}
@@ -478,8 +484,8 @@ export function excludeLock(coilId) {
export function listLightCoil(data) {
return request({
url: '/wms/materialCoil/listForReport',
method: 'get',
method: 'post',
timeout: 600000,
params: data
data: data
})
}

View File

@@ -56,7 +56,7 @@
<th>包装</th>
<th>仓库位置</th>
<th>结算</th>
<th>原料厂家</th>
<!-- <th>原料厂家</th> -->
<th>卷号</th>
<th>规格</th>
<th>材质</th>
@@ -68,13 +68,13 @@
</thead>
<tbody>
<!-- 无明细提示 -->
<tr v-if="localWaybillDetails.length === 0">
<!-- <tr v-if="localWaybillDetails.length === 0">
<td colspan="12" class="no-data">
<div class="no-data-content">
<el-empty description="暂无发货单明细" />
</div>
</td>
</tr>
</tr> -->
<!-- 明细数据 -->
<tr v-for="(item, index) in displayWaybillDetails" :key="index">
<td>
@@ -92,9 +92,9 @@
<td>
<div class="table-input transparent-input" contenteditable>{{ item.settlementType }}</div>
</td>
<td>
<!-- <td>
<div class="table-input transparent-input" contenteditable>{{ item.rawMaterialFactory }}</div>
</td>
</td> -->
<td>
<div class="table-input transparent-input" contenteditable>{{ item.coilNumber }}</div>
</td>
@@ -120,7 +120,7 @@
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<!-- <td style="height: 0;"></td> -->
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
@@ -508,7 +508,7 @@ export default {
undefined, undefined,
`车牌:${this.localWaybill.licensePlate || ''}`
], // 负责人/订单号/合同号/车牌行r=2
["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '单价', '备注'], // 表格表头r=3
["品名", '切边', '包装', '仓库位置', '结算', '卷号', '规格', '材质', '重量(t)', '单价', '备注'], // 表格表头r=3
];
// 表格明细行替换原有E1/F1等占位符使用真实明细
@@ -518,7 +518,7 @@ export default {
item.packageType || '',
item.actualWarehouseName || '',
item.settlementType || '',
item.rawMaterialFactory || '',
// item.rawMaterialFactory || '',
item.coilNumber || '',
item.specification || '',
item.material || '',
@@ -578,7 +578,7 @@ export default {
{ wpx: 50 }, // 包装
{ wpx: 90 }, // 仓库位置
{ wpx: 60 }, // 结算
{ wpx: 70 }, // 原料厂家
// { wpx: 70 }, // 原料厂家
{ wpx: 110 }, // 卷号
{ wpx: 90 }, // 规格
{ wpx: 80 }, // 材质
@@ -756,14 +756,14 @@ export default {
contract: `合同号:${this.localWaybill.contractCode || ''}`,
license: `车牌:${this.localWaybill.licensePlate || ''}`
};
const tableHeader = ["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '单价', '备注']; // 表格表头
const tableHeader = ["品名", '切边', '包装', '仓库位置', '结算', '卷号', '规格', '材质', '重量(t)', '单价', '备注']; // 表格表头
const tableData = this.displayWaybillDetails.map(item => [ // 表格明细
item.productName || '',
item.edgeType || '',
item.packageType || '',
item.actualWarehouseName || '',
item.settlementType || '',
item.rawMaterialFactory || '',
// item.rawMaterialFactory || '',
item.coilNumber || '',
item.specification || '',
item.material || '',
@@ -784,25 +784,25 @@ export default {
// 3.1 标题行第1行
const titleCell = worksheet.getCell(`A${rowIdx}`);
titleCell.value = title;
worksheet.mergeCells(`A${rowIdx}:L${rowIdx}`); // 合并A1-L1
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A1-K1
// 3.2 收货单位行第2行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = header1.consignee;
worksheet.getCell(`E${rowIdx}`).value = header1.date;
worksheet.getCell(`I${rowIdx}`).value = header1.sender;
worksheet.getCell(`H${rowIdx}`).value = header1.sender;
worksheet.mergeCells(`A${rowIdx}:D${rowIdx}`); // 收货单位A2-D2
worksheet.mergeCells(`E${rowIdx}:H${rowIdx}`); // 日期E2-H2
worksheet.mergeCells(`I${rowIdx}:L${rowIdx}`); // 发货单位:I2-L2
worksheet.mergeCells(`E${rowIdx}:G${rowIdx}`); // 日期E2-G2
worksheet.mergeCells(`H${rowIdx}:K${rowIdx}`); // 发货单位:H2-K2
// 3.3 负责人行第3行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = header2.principal;
worksheet.getCell(`D${rowIdx}`).value = header2.phone;
worksheet.getCell(`G${rowIdx}`).value = header2.contract;
worksheet.getCell(`J${rowIdx}`).value = header2.license;
worksheet.getCell(`I${rowIdx}`).value = header2.license;
worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3
worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 订单号D3-F3
worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3
worksheet.mergeCells(`J${rowIdx}:L${rowIdx}`); // 车牌:J3-L3
worksheet.mergeCells(`G${rowIdx}:H${rowIdx}`); // 合同号G3-H3
worksheet.mergeCells(`I${rowIdx}:K${rowIdx}`); // 车牌:I3-K3
// 3.4 表格表头第4行
rowIdx++;
tableHeader.forEach((text, colIdx) => {
@@ -821,12 +821,12 @@ export default {
rowIdx++;
const remarkCell = worksheet.getCell(`A${rowIdx}`);
remarkCell.value = remark;
worksheet.mergeCells(`A${rowIdx}:L${rowIdx}`); // 合并A*_L*
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A*_L*
// 3.7 取货地点行
rowIdx++;
const pickupCell = worksheet.getCell(`A${rowIdx}`);
pickupCell.value = pickupLocation;
worksheet.mergeCells(`A${rowIdx}:L${rowIdx}`); // 合并A*_L*
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A*_L*
// 3.8 签名栏行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = footer.deliveryman;
@@ -834,10 +834,10 @@ export default {
worksheet.getCell(`I${rowIdx}`).value = footer.weightRoom;
worksheet.mergeCells(`A${rowIdx}:D${rowIdx}`); // 发货A*_D*
worksheet.mergeCells(`E${rowIdx}:H${rowIdx}`); // 司机E*_H*
worksheet.mergeCells(`I${rowIdx}:L${rowIdx}`); // 磅房I*_L*
worksheet.mergeCells(`I${rowIdx}:K${rowIdx}`); // 磅房I*_L*
// 4. 配置列宽完全匹配Web端
const columnWidths = [70, 60, 50, 90, 70, 70, 110, 90, 80, 70, 50, 60];
const columnWidths = [70, 60, 50, 90, 70, 110, 90, 80, 70, 50, 60];
worksheet.columns = columnWidths.map((width, idx) => ({
key: `col${idx + 1}`,
width: width / 5 // exceljs的width单位是字符宽度转换为px约1px=0.072字符)
@@ -881,13 +881,13 @@ export default {
setCellStyle(worksheet.getCell(`G3`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`J3`), { size: 18, border: false });
// 5.3 表格表头样式16px、宋体、加粗、居中、带边框
for (let col = 0; col < 12; col++) {
for (let col = 0; col < 11; col++) {
const colLetter = String.fromCharCode(65 + col);
setCellStyle(worksheet.getCell(`${colLetter}4`), { size: 16, border: true, horizontal: 'center' });
}
// 5.4 表格明细样式16px、宋体、加粗、居中、带边框
for (let r = 5; r < rowIdx - 2; r++) { // 明细行范围第5行到备注行前一行
for (let col = 0; col < 12; col++) {
for (let col = 0; col < 11; col++) {
const colLetter = String.fromCharCode(65 + col);
setCellStyle(worksheet.getCell(`${colLetter}${r}`), { size: 16, border: true, horizontal: 'center' });
}
@@ -1108,26 +1108,26 @@ export default {
/* 结算 */
}
.waybill-table th:nth-child(6),
/* 原料厂家 */
/* .waybill-table th:nth-child(6),
.waybill-table td:nth-child(6) {
width: 70px;
/* 原料厂家 */
}
} */
.waybill-table th:nth-child(7),
.waybill-table td:nth-child(7) {
.waybill-table th:nth-child(6),
.waybill-table td:nth-child(6) {
width: 110px;
/* 卷号 */
}
.waybill-table th:nth-child(8),
.waybill-table td:nth-child(8) {
.waybill-table th:nth-child(7),
.waybill-table td:nth-child(7) {
width: 90px;
/* 规格 */
}
.waybill-table th:nth-child(9),
.waybill-table td:nth-child(9) {
.waybill-table th:nth-child(8),
.waybill-table td:nth-child(8) {
width: 80px;
/* 材质 */
}
@@ -1140,21 +1140,21 @@ export default {
} */
/* 重量kg */
.waybill-table th:nth-child(10),
.waybill-table td:nth-child(10) {
.waybill-table th:nth-child(9),
.waybill-table td:nth-child(9) {
width: 70px;
}
/* 单价 */
.waybill-table th:nth-child(11),
.waybill-table td:nth-child(11) {
.waybill-table th:nth-child(10),
.waybill-table td:nth-child(10) {
width: 50px;
}
/* 备注 */
.waybill-table th:nth-child(12),
.waybill-table td:nth-child(12) {
.waybill-table th:nth-child(11),
.waybill-table td:nth-child(11) {
/* width: 40px; */
}

View File

@@ -56,7 +56,7 @@
<th>包装</th>
<th>仓库位置</th>
<th>结算</th>
<th>原料厂家</th>
<!-- <th>原料厂家</th> -->
<th>卷号</th>
<th>规格</th>
<th>材质</th>
@@ -68,13 +68,13 @@
</thead>
<tbody>
<!-- 无明细提示 -->
<tr v-if="localWaybillDetails.length === 0">
<!-- <tr v-if="localWaybillDetails.length === 0">
<td colspan="12" class="no-data">
<div class="no-data-content">
<el-empty description="暂无发货单明细" />
</div>
</td>
</tr>
</tr> -->
<!-- 明细数据 -->
<tr v-for="(item, index) in displayWaybillDetails" :key="index">
<td>
@@ -92,9 +92,9 @@
<td>
<div class="table-input transparent-input" contenteditable>{{ item.settlementType }}</div>
</td>
<td>
<!-- <td>
<div class="table-input transparent-input" contenteditable>{{ item.rawMaterialFactory }}</div>
</td>
</td> -->
<td>
<div class="table-input transparent-input" contenteditable>{{ item.coilNumber }}</div>
</td>
@@ -120,7 +120,7 @@
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<!-- <td style="height: 0;"></td> -->
<td style="height: 0;"></td>
<td style="height: 0;"></td>
<td style="height: 0;"></td>
@@ -128,7 +128,6 @@
<td style="height: 0;"></td>
<!-- <td><input type="number" class="table-input transparent-input" v-model.number="item.quantity"
placeholder="0" /></td> -->
<!-- <td style="height: 0;"></td> -->
<td style="height: 0;"></td>
<td style="height: 0;"></td>
</tr>
@@ -508,22 +507,22 @@ export default {
undefined,
`车牌:${this.localWaybill.licensePlate || ''}`
], // 负责人/订单号/合同号/车牌行r=2
["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '备注'], // 表格表头r=311列)
["品名", '切边', '包装', '仓库位置', '结算', '卷号', '规格', '材质', '重量(t)', '备注'], // 表格表头r=310列)
];
// 表格明细行确保11列)
// 表格明细行确保10列)
const detailRows = this.displayWaybillDetails.map(item => [
item.productName || '',
item.edgeType || '',
item.packageType || '',
item.actualWarehouseName || '',
item.settlementType || '',
item.rawMaterialFactory || '',
// item.rawMaterialFactory || '',
item.coilNumber || '',
item.specification || '',
item.material || '',
item.weight || '',
item.remark || '' // 第11列:备注,无多余列
item.remark || '' // 第10列:备注,无多余列
]);
// 底部备注/取货地点/签名栏(确保列数匹配)
@@ -555,34 +554,34 @@ export default {
const ws = XLSX.utils.aoa_to_sheet(data);
ws["!cellStyles"] = true;
ws["!merges"] = [
{ s: { c: 0, r: titleRowIdx }, e: { c: 10, r: titleRowIdx } }, // 标题合并0-10列(无多余)
{ s: { c: 0, r: titleRowIdx }, e: { c: 9, r: titleRowIdx } }, // 标题合并0-9列(无多余)
{ s: { c: 0, r: headerRow1Idx }, e: { c: 3, r: headerRow1Idx } }, // 收货单位0-3
{ s: { c: 4, r: headerRow1Idx }, e: { c: 6, r: headerRow1Idx } }, // 日期4-7
{ s: { c: 8, r: headerRow1Idx }, e: { c: 10, r: headerRow1Idx } }, // 发货单位(8-10,无多余)
{ s: { c: 4, r: headerRow1Idx }, e: { c: 6, r: headerRow1Idx } }, // 日期4-6
{ s: { c: 7, r: headerRow1Idx }, e: { c: 9, r: headerRow1Idx } }, // 发货单位(7-9,无多余)
{ s: { c: 0, r: headerRow2Idx }, e: { c: 2, r: headerRow2Idx } }, // 负责人0-2
{ s: { c: 3, r: headerRow2Idx }, e: { c: 5, r: headerRow2Idx } }, // 订单号3-5
{ s: { c: 6, r: headerRow2Idx }, e: { c: 7, r: headerRow2Idx } }, // 合同号6-8
{ s: { c: 9, r: headerRow2Idx }, e: { c: 10, r: headerRow2Idx } }, // 车牌(9-10,无多余)
{ s: { c: 0, r: remarkRowIdx }, e: { c: 10, r: remarkRowIdx } }, // 备注合并0-10
{ s: { c: 0, r: pickupRowIdx }, e: { c: 10, r: pickupRowIdx } }, // 取货地点合并0-10
{ s: { c: 6, r: headerRow2Idx }, e: { c: 7, r: headerRow2Idx } }, // 合同号6-7
{ s: { c: 8, r: headerRow2Idx }, e: { c: 9, r: headerRow2Idx } }, // 车牌(8-9,无多余)
{ s: { c: 0, r: remarkRowIdx }, e: { c: 9, r: remarkRowIdx } }, // 备注合并0-9
{ s: { c: 0, r: pickupRowIdx }, e: { c: 9, r: pickupRowIdx } }, // 取货地点合并0-9
{ s: { c: 0, r: footerRowIdx }, e: { c: 3, r: footerRowIdx } }, // 发货0-3
{ s: { c: 4, r: footerRowIdx }, e: { c: 6, r: footerRowIdx } }, // 司机4-7
{ s: { c: 8, r: footerRowIdx }, e: { c: 10, r: footerRowIdx } }, // 磅房(8-10,无多余)
{ s: { c: 4, r: footerRowIdx }, e: { c: 6, r: footerRowIdx } }, // 司机4-6
{ s: { c: 7, r: footerRowIdx }, e: { c: 9, r: footerRowIdx } }, // 磅房(7-9,无多余)
];
// ===== 3. 配置列宽仅11对应0-10索引)=====
// ===== 3. 配置列宽仅10对应0-9索引)=====
ws['!cols'] = [
{ wpx: 70 }, // 品名0
{ wpx: 40 }, // 切边1
{ wpx: 50 }, // 包装2
{ wpx: 90 }, // 仓库位置3
{ wpx: 60 }, // 结算4
{ wpx: 70 }, // 原料厂家5
{ wpx: 150 }, // 卷号(6
{ wpx: 90 }, // 规格(7
{ wpx: 80 }, // 材质(8
{ wpx: 70 }, // 重量(t)9
{ wpx: 130 }, // 备注(10)→ 最后一列,无多余
// { wpx: 70 }, // 原料厂家5
{ wpx: 150 }, // 卷号(5
{ wpx: 90 }, // 规格(6
{ wpx: 80 }, // 材质(7
{ wpx: 70 }, // 重量(t)8
{ wpx: 130 }, // 备注(9)→ 最后一列,无多余
];
// ===== 4. 单元格样式配置(无修改)=====
@@ -621,11 +620,11 @@ export default {
const headerCells = [
XLSX.utils.encode_cell({ r: headerRow1Idx, c: 0 }),
XLSX.utils.encode_cell({ r: headerRow1Idx, c: 4 }),
XLSX.utils.encode_cell({ r: headerRow1Idx, c: 8 }),
XLSX.utils.encode_cell({ r: headerRow1Idx, c: 7 }),
XLSX.utils.encode_cell({ r: headerRow2Idx, c: 0 }),
XLSX.utils.encode_cell({ r: headerRow2Idx, c: 3 }),
XLSX.utils.encode_cell({ r: headerRow2Idx, c: 6 }),
XLSX.utils.encode_cell({ r: headerRow2Idx, c: 9 }),
XLSX.utils.encode_cell({ r: headerRow2Idx, c: 8 }),
];
headerCells.forEach(cellAddr => {
if (ws[cellAddr]) {
@@ -639,7 +638,7 @@ export default {
});
// 表格表头
for (let c = 0; c < 11; c++) { // 仅循环0-10
for (let c = 0; c < 10; c++) { // 仅循环0-9
const cellAddr = XLSX.utils.encode_cell({ r: tableHeaderIdx, c });
if (ws[cellAddr]) {
ws[cellAddr].s = createCellStyle({ sz: 16 });
@@ -648,7 +647,7 @@ export default {
// 表格明细行
for (let r = tableHeaderIdx + 1; r < remarkRowIdx; r++) {
for (let c = 0; c < 11; c++) { // 仅循环0-10
for (let c = 0; c < 10; c++) { // 仅循环0-9
const cellAddr = XLSX.utils.encode_cell({ r, c });
if (ws[cellAddr]) {
ws[cellAddr].s = createCellStyle({ sz: 16 });
@@ -683,7 +682,7 @@ export default {
const footerCells = [
XLSX.utils.encode_cell({ r: footerRowIdx, c: 0 }),
XLSX.utils.encode_cell({ r: footerRowIdx, c: 4 }),
XLSX.utils.encode_cell({ r: footerRowIdx, c: 8 }),
XLSX.utils.encode_cell({ r: footerRowIdx, c: 7 }),
];
footerCells.forEach(cellAddr => {
if (ws[cellAddr]) {
@@ -747,14 +746,14 @@ export default {
contract: `合同号:${this.localWaybill.contractCode || ''}`,
license: `车牌:${this.localWaybill.licensePlate || ''}`
};
const tableHeader = ["品名", '切边', '包装', '仓库位置', '结算', '原料厂家', '卷号', '规格', '材质', '重量(t)', '备注']; // 表格表头
const tableData = this.displayWaybillDetails.map(item => [ // 表格明细
const tableHeader = ["品名", '切边', '包装', '仓库位置', '结算', '卷号', '规格', '材质', '重量(t)', '备注']; // 表格表头10列
const tableData = this.displayWaybillDetails.map(item => [ // 表格明细10列
item.productName || '',
item.edgeType || '',
item.packageType || '',
item.actualWarehouseName || '',
item.settlementType || '',
item.rawMaterialFactory || '',
// item.rawMaterialFactory || '',
item.coilNumber || '',
item.specification || '',
item.material || '',
@@ -775,25 +774,25 @@ export default {
// 3.1 标题行第1行
const titleCell = worksheet.getCell(`A${rowIdx}`);
titleCell.value = title;
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A1-K1
worksheet.mergeCells(`A${rowIdx}:J${rowIdx}`); // 合并A1-J110列
// 3.2 收货单位行第2行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = header1.consignee;
worksheet.getCell(`E${rowIdx}`).value = header1.date;
worksheet.getCell(`I${rowIdx}`).value = header1.sender;
worksheet.getCell(`H${rowIdx}`).value = header1.sender;
worksheet.mergeCells(`A${rowIdx}:D${rowIdx}`); // 收货单位A2-D2
worksheet.mergeCells(`E${rowIdx}:H${rowIdx}`); // 日期E2-H2
worksheet.mergeCells(`I${rowIdx}:K${rowIdx}`); // 发货单位:I2-L2
worksheet.mergeCells(`E${rowIdx}:G${rowIdx}`); // 日期E2-G2
worksheet.mergeCells(`H${rowIdx}:J${rowIdx}`); // 发货单位:H2-J210列
// 3.3 负责人行第3行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = header2.principal;
worksheet.getCell(`D${rowIdx}`).value = header2.phone;
worksheet.getCell(`G${rowIdx}`).value = header2.contract;
worksheet.getCell(`J${rowIdx}`).value = header2.license;
worksheet.getCell(`I${rowIdx}`).value = header2.license;
worksheet.mergeCells(`A${rowIdx}:C${rowIdx}`); // 负责人A3-C3
worksheet.mergeCells(`D${rowIdx}:F${rowIdx}`); // 订单号D3-F3
worksheet.mergeCells(`G${rowIdx}:I${rowIdx}`); // 合同号G3-I3
worksheet.mergeCells(`J${rowIdx}:K${rowIdx}`); // 车牌:J3-L3
worksheet.mergeCells(`G${rowIdx}:H${rowIdx}`); // 合同号G3-H3
worksheet.mergeCells(`I${rowIdx}:J${rowIdx}`); // 车牌:I3-J310列
// 3.4 表格表头第4行
rowIdx++;
tableHeader.forEach((text, colIdx) => {
@@ -812,23 +811,23 @@ export default {
rowIdx++;
const remarkCell = worksheet.getCell(`A${rowIdx}`);
remarkCell.value = remark;
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A*_L*
worksheet.mergeCells(`A${rowIdx}:J${rowIdx}`); // 合并A*_J*10列
// 3.7 取货地点行
rowIdx++;
const pickupCell = worksheet.getCell(`A${rowIdx}`);
pickupCell.value = pickupLocation;
worksheet.mergeCells(`A${rowIdx}:K${rowIdx}`); // 合并A*_L*
worksheet.mergeCells(`A${rowIdx}:J${rowIdx}`); // 合并A*_J*10列
// 3.8 签名栏行
rowIdx++;
worksheet.getCell(`A${rowIdx}`).value = footer.deliveryman;
worksheet.getCell(`E${rowIdx}`).value = footer.driver;
worksheet.getCell(`I${rowIdx}`).value = footer.weightRoom;
worksheet.getCell(`H${rowIdx}`).value = footer.weightRoom;
worksheet.mergeCells(`A${rowIdx}:D${rowIdx}`); // 发货A*_D*
worksheet.mergeCells(`E${rowIdx}:H${rowIdx}`); // 司机E*_H*
worksheet.mergeCells(`I${rowIdx}:K${rowIdx}`); // 磅房:I*_L*
worksheet.mergeCells(`E${rowIdx}:G${rowIdx}`); // 司机E*_G*
worksheet.mergeCells(`H${rowIdx}:J${rowIdx}`); // 磅房:H*_J*10列
// 4. 配置列宽完全匹配Web端
const columnWidths = [70, 60, 50, 90, 70, 70, 150, 90, 80, 70, 60];
// 4. 配置列宽完全匹配Web端10列
const columnWidths = [70, 60, 50, 90, 70, 150, 90, 80, 70, 60]; // 去掉原料厂家列
worksheet.columns = columnWidths.map((width, idx) => ({
key: `col${idx + 1}`,
width: width / 5 // exceljs的width单位是字符宽度转换为px约1px=0.072字符)
@@ -866,19 +865,19 @@ export default {
// 5.2 头部信息样式18px、宋体、加粗、居中、无边框
setCellStyle(worksheet.getCell(`A2`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`E2`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`I2`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`H2`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`A3`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`D3`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`G3`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`J3`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`I3`), { size: 18, border: false });
// 5.3 表格表头样式16px、宋体、加粗、居中、带边框
for (let col = 0; col < 11; col++) {
for (let col = 0; col < 10; col++) { // 10列
const colLetter = String.fromCharCode(65 + col);
setCellStyle(worksheet.getCell(`${colLetter}4`), { size: 16, border: true, horizontal: 'center' });
}
// 5.4 表格明细样式16px、宋体、加粗、居中、带边框
for (let r = 5; r < rowIdx - 2; r++) { // 明细行范围第5行到备注行前一行
for (let col = 0; col < 11; col++) {
for (let col = 0; col < 10; col++) { // 10列
const colLetter = String.fromCharCode(65 + col);
setCellStyle(worksheet.getCell(`${colLetter}${r}`), { size: 16, border: true, horizontal: 'center' });
}
@@ -890,7 +889,7 @@ export default {
// 5.7 签名栏样式18px、宋体、加粗、居中、无边框
setCellStyle(worksheet.getCell(`A${rowIdx}`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`E${rowIdx}`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`I${rowIdx}`), { size: 18, border: false });
setCellStyle(worksheet.getCell(`H${rowIdx}`), { size: 18, border: false });
// 第一行的行高
const row1 = worksheet.getRow(1);
@@ -1099,26 +1098,26 @@ export default {
/* 结算 */
}
.waybill-table th:nth-child(6),
/* 原料厂家已移除 */
/* .waybill-table th:nth-child(6),
.waybill-table td:nth-child(6) {
width: 70px;
/* 原料厂家 */
}
} */
.waybill-table th:nth-child(7),
.waybill-table td:nth-child(7) {
.waybill-table th:nth-child(6),
.waybill-table td:nth-child(6) {
width: 150px;
/* 卷号 */
}
.waybill-table th:nth-child(8),
.waybill-table td:nth-child(8) {
.waybill-table th:nth-child(7),
.waybill-table td:nth-child(7) {
width: 90px;
/* 规格 */
}
.waybill-table th:nth-child(9),
.waybill-table td:nth-child(9) {
.waybill-table th:nth-child(8),
.waybill-table td:nth-child(8) {
width: 80px;
/* 材质 */
}
@@ -1131,21 +1130,21 @@ export default {
} */
/* 重量kg */
.waybill-table th:nth-child(10),
.waybill-table td:nth-child(10) {
.waybill-table th:nth-child(9),
.waybill-table td:nth-child(9) {
width: 70px;
}
/* 单价 */
/* .waybill-table th:nth-child(11),
.waybill-table td:nth-child(11) {
/* .waybill-table th:nth-child(10),
.waybill-table td:nth-child(10) {
width: 50px;
} */
/* 备注 */
.waybill-table th:nth-child(11),
.waybill-table td:nth-child(11) {
.waybill-table th:nth-child(10),
.waybill-table td:nth-child(10) {
/* width: 40px; */
}

View File

@@ -653,11 +653,11 @@ export default {
pageSize: 1000 // 获取所有明细
}).then(response => {
// 该发货单不能是空的
if (response.rows.length === 0) {
this.$modal.msgError("发货单为空不能打印");
this.loading = false;
return;
}
// if (response.rows.length === 0) {
// this.$modal.msgError("发货单为空不能打印");
// this.loading = false;
// return;
// }
updateDeliveryWaybill({
waybillId: row.waybillId,
status: 2

View File

@@ -104,6 +104,7 @@ export const zincConfig = {
warehouseOptions: [
{ value: '1988150323162836993', label: '镀锌成品库' },
{ value: '1988150487185289217', label: '镀锌纵剪分条原料库' },
{ value: '2056545127927787522', label: '镀锌待打包' },
{ value: '2019583656787259393', label: '技术部' },
{ value: '2019583325311414274', label: '小钢卷库' },
{ value: '2019583429955104769', label: '废品库' },

View File

@@ -1,8 +1,12 @@
import { listCoilWithIds } from "@/api/wms/coil";
import {
listPendingAction,
listCoilWithIds, listLightCoil
} from "@/api/wms/coil";
import {
listLightPendingAction,
} from '@/api/wms/pendingAction';
import { Message } from 'element-ui'
import {
Message
} from 'element-ui'
export async function fetchOutputList(queryParams) {
const resList = await Promise.all([
@@ -38,18 +42,14 @@ export async function fetchOutputList(queryParams) {
}
export async function fetchLossList(actionTypes, queryParams, callback) {
const resultList = await Promise.all(actionTypes.map(actionType => {
return listPendingAction({
actionStatus: 2,
actionType,
createBys: queryParams.createBys,
startTime: queryParams.byCreateTimeStart,
endTime: queryParams.byCreateTimeEnd,
pageSize: 99999,
pageNum: 1,
})
}))
const actions = resultList.flatMap(item => item.rows)
const resultList = await listLightPendingAction({
actionStatus: 2,
actionTypes: actionTypes.join(','),
createBys: queryParams.createBys,
startTime: queryParams.byCreateTimeStart,
endTime: queryParams.byCreateTimeEnd,
})
const actions = resultList.data
const actionIds = actions.map(item => item.actionId).join(',')
console.log(actionIds)
if (!actionIds) {
@@ -80,4 +80,4 @@ export async function fetchLossList(actionTypes, queryParams, callback) {
})
callback(actionIds)
return lossList
}
}

View File

@@ -207,7 +207,7 @@
<script>
import { listCoilWithIds } from "@/api/wms/coil";
import {
listPendingAction,
listLightPendingAction,
} from '@/api/wms/pendingAction';
import MemoInput from "@/components/MemoInput";
import MutiSelect from "@/components/MutiSelect";
@@ -472,14 +472,14 @@ export default {
async getList() {
this.loading = true;
// 所有报表类型都使用原始的 listPendingAction 方式获取数据
const res = await listPendingAction({ ...this.queryParams, actionTypes: this.actionType, actionStatus: 2 });
// 所有报表类型都使用原始的 listLightPendingAction 方式获取数据
const res = await listLightPendingAction({ ...this.queryParams, actionTypes: this.actionType, actionStatus: 2 });
// 获取两层数据
const lossIds = res.rows.filter(item => item.coilId).map(item => item.coilId);
const lossActionIds = res.rows.filter(item => item.actionId).map(item => item.actionId);
const lossIds = res.data.filter(item => item.coilId).map(item => item.coilId);
const lossActionIds = res.data.filter(item => item.actionId).map(item => item.actionId);
this.actionIds = lossActionIds.join(',')
// 使用new Set去重
const outIds = [...new Set(res.rows.filter(item => item.processedCoilIds).map(item => item.processedCoilIds))];
const outIds = [...new Set(res.data.filter(item => item.processedCoilIds).map(item => item.processedCoilIds))];
if (lossIds.length === 0 || outIds.length === 0) {
this.$message({