Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-05-21 11:04:54 +08:00
10 changed files with 745 additions and 141 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

@@ -302,6 +302,7 @@ body {
padding: 4px 8px !important;
font-size: 12px;
height: $--btn-height;
&.is-circle {
padding: 4px !important;
}
@@ -343,9 +344,28 @@ body {
}
}
.el-table ::-webkit-scrollbar {
width: 8px !important;
height: 12px !important;
}
.el-table ::-webkit-scrollbar-track {
background-color: transparent !important;
}
.el-table ::-webkit-scrollbar-thumb {
background-color: #c0c4cc !important;
border-radius: 0 !important;
}
.el-table ::-webkit-scrollbar-thumb:hover {
background-color: #909399 !important;
}
.el-table__fixed,
.el-table__fixed-right,
.el-table__fixed-left {
// 表头(深灰黑 + 纯白文字)
.el-table__fixed-header-wrapper {
th.el-table__cell {
@@ -1639,4 +1659,4 @@ div.pagination-container {
color: $--color-primary;
}
}
}
}

View File

@@ -0,0 +1,578 @@
<template>
<div class="app-container" v-loading="loading">
<div style="display: flex; align-items: center; justify-content: flex-start; gap: 10px;">
<el-radio-group v-model="activeTab" @change="handleRefresh">
<!-- <el-radio-button label="missing">类型缺失</el-radio-button>
<el-radio-button label="rawMaterialMissing">原料类型缺失</el-radio-button>
<el-radio-button label="mismatch">匹配异常</el-radio-button> -->
<el-radio-button label="splitlock">分条锁定</el-radio-button>
<el-radio-button label="anneallock">退火锁定</el-radio-button>
</el-radio-group>
<el-button type="success" plain size="mini" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
</div>
<KLPTable :data="materialCoilList" @selection-change="handleSelectionChange" height="calc(100vh - 220px)"
:floatLayer="true" :floatLayerConfig="floatLayerConfig">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope">
<current-coil-no :current-coil-no="scope.row.currentCoilNo"></current-coil-no>
</template>
</el-table-column>
<!-- <el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
<el-table-column label="产品类型" align="center" width="180">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
</template>
</el-table-column>
<!-- <el-table-column label="异常数量" align="center" prop="abnormalCount"></el-table-column> -->
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="更新时间" align="center" prop="updateTime" />
<el-table-column label="更新人" align="center" prop="updateBy" />
<el-table-column label="操作" align="center" prop="action" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)">修正</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
预览标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-printer" @click="handlePrintLabel(scope.row)">
打印标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
<el-button :loading="buttonLoading" v-if="activeTab === 'mismatch'" size="mini" type="text" icon="el-icon-close"
@click="handleFixType(scope.row)">一键修复类型</el-button>
<el-button :loading="buttonLoading" v-if="activeTab === 'splitlock' || activeTab === 'anneallock'" size="mini" type="text" icon="el-icon-close"
@click="handleExcludeLock(scope.row)">解除锁定</el-button>
</template>
</el-table-column>
</KLPTable>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getListMismatched" />
<!-- 标签预览弹窗 -->
<el-dialog title="标签预览" :visible.sync="labelRender.visible" append-to-body>
<label-render :forceSpecialTag="forceSpecialTag" :content="labelRender.data" :labelType="labelRender.type" />
</el-dialog>
<label-render :forceSpecialTag="forceSpecialTag" ref="labelRender" v-show="false" :content="labelRender.data"
:labelType="labelRender.type" />
<!-- 钢卷追溯对话框使用封装的组件 -->
<el-dialog title="钢卷追溯" :visible.sync="traceOpen" width="90%" append-to-body>
<coil-trace-result v-loading="traceLoading" :trace-result="traceResult"></coil-trace-result>
</el-dialog>
<!-- 添加或修改钢卷物料对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input v-model="form.enterCoilNo" placeholder="请输入入场钢卷号" :disabled="form.coilId" />
</el-form-item>
<el-form-item label="当前钢卷号" prop="currentCoilNo">
<el-input v-model="form.currentCoilNo" placeholder="请输入当前钢卷号" />
</el-form-item>
<el-form-item label="厂家原料卷号" prop="supplierCoilNo">
<el-input v-model="form.supplierCoilNo" placeholder="请输入厂家原料卷号" />
</el-form-item>
<el-form-item label="所在库位" prop="warehouseId">
<warehouse-select v-model="form.warehouseId" placeholder="请选择仓库/库区/库位" style="width: 100%;" clearable />
</el-form-item>
<el-form-item label="实际库区" prop="actualWarehouseId">
<actual-warehouse-select v-model="form.actualWarehouseId" :clearInput="form.coilId != null"
placeholder="请选择实际库区" style="width: 100%;" clearable />
</el-form-item>
<el-form-item label="班组" prop="team">
<el-select v-model="form.team" placeholder="请选择班组" style="width: 100%">
<el-option key="甲" label="甲" value="甲" />
<el-option key="乙" label="乙" value="乙" />
</el-select>
</el-form-item>
<el-form-item label="材料类型" prop="materialType">
<el-select v-model="form.materialType" placeholder="请选择材料类型" @change="handleMaterialTypeChange">
<el-option label="成品" value="成品" />
<el-option label="原料" value="原料" />
</el-select>
</el-form-item>
<el-form-item :label="getItemLabel" prop="itemId">
<product-select v-if="form.itemType == 'product'" v-model="form.itemId" placeholder="请选择成品"
style="width: 100%;" clearable />
<raw-material-select v-else-if="form.itemType == 'raw_material'" v-model="form.itemId" placeholder="请选择原料"
style="width: 100%;" clearable />
<div v-else>请先选择材料类型</div>
</el-form-item>
<el-form-item label="切边要求" prop="trimmingRequirement">
<el-select v-model="form.trimmingRequirement" placeholder="请选择切边要求" style="width: 100%">
<el-option label="净边料" value="净边料" />
<el-option label="毛边料" value="毛边料" />
</el-select>
</el-form-item>
<el-form-item label="原料材质" prop="packingStatus">
<el-input v-model="form.packingStatus" placeholder="请输入原料材质">
</el-input>
</el-form-item>
<el-form-item label="包装要求" prop="packagingRequirement">
<el-select v-model="form.packagingRequirement" placeholder="请选择包装要求" style="width: 100%">
<el-option label="裸包" value="裸包" />
<el-option label="普包" value="普包" />
<el-option label="简包" value="简包" />
</el-select>
</el-form-item>
<el-form-item label="毛重" prop="grossWeight">
<el-input v-model="form.grossWeight" placeholder="请输入毛重" />
</el-form-item>
<el-form-item label="净重" prop="netWeight">
<el-input v-model="form.netWeight" placeholder="请输入净重" />
</el-form-item>
<el-form-item label="实测长度(m)" prop="actualLength">
<el-input-number :controls="false" v-model="form.actualLength" placeholder="请输入实测长度" type="number"
:step="0.01" />
</el-form-item>
<el-form-item label="实测厚度(mm)" prop="actualThickness" class="form-item-half">
<el-input-number :controls="false" v-model="form.actualThickness" placeholder="请输入实测厚度" type="number"
:step="0.01" />
</el-form-item>
<el-form-item label="实测宽度(mm)" prop="actualWidth">
<el-input-number :controls="false" v-model="form.actualWidth" placeholder="请输入实测宽度" type="number"
:step="0.01" />
</el-form-item>
<el-form-item label="调制度" prop="temperGrade">
<el-input v-model="form.temperGrade" placeholder="请输入调制度" />
</el-form-item>
<el-form-item label="镀层种类" prop="coatingType">
<el-input v-model="form.coatingType" placeholder="请输入镀层种类" />
</el-form-item>
<el-form-item label="钢卷表面处理" prop="coilSurfaceTreatment">
<el-input v-model="form.coilSurfaceTreatment" placeholder="请输入钢卷表面处理" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTypeErrorCoil, getMaterialCoilTrace, getMaterialCoil, updateMaterialCoilSimple, listMismatchedItemCoil, fixMismatchedItemCoil, listMaterialCoil, excludeLock } from "@/api/wms/coil";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
import CoilTraceResult from "../panels/CoilTraceResult.vue";
import LabelRender from '../panels/LabelRender/index.vue';
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue";
import RightToolbar from "@/components/RightToolbar";
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint';
export default {
name: "TypeErrorCoil",
components: {
WarehouseSelect,
ProductSelect,
RawMaterialSelect,
ProductInfo,
RawMaterialInfo,
CoilTraceResult,
LabelRender,
CoilNo,
CurrentCoilNo,
RightToolbar,
ActualWarehouseSelect,
},
data() {
return {
// 遮罩层
loading: true,
// 追溯加载中
traceLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 钢卷物料表格数据
materialCoilList: [],
// 追溯对话框显示
traceOpen: false,
// 追溯结果数据(传递给组件)
traceResult: null,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
enterCoilNo: undefined,
currentCoilNo: undefined,
},
labelRender: {
visible: false,
data: {},
type: '2'
},
forceSpecialTag: '',
floatLayerConfig: {
columns: [
{ label: '入场钢卷号', prop: 'enterCoilNo' },
{ label: '当前钢卷号', prop: 'currentCoilNo' },
{ label: '厂家卷号', prop: 'supplierCoilNo' },
{ label: '逻辑库位', prop: 'warehouseName' },
{ label: '实际库位', prop: 'actualWarehouseName' },
{ label: '物料类型', prop: 'materialType' },
{ label: '班组', prop: 'team' },
{ label: '净重', prop: 'netWeight' },
{ label: '毛重', prop: 'grossWeight' },
{ label: '备注', prop: 'remark' },
{ label: '质量状态', prop: 'qualityStatus' },
{ label: '原料材质', prop: 'packingStatus' },
{ label: '切边要求', prop: 'edgeRequirement' },
{ label: '包装要求', prop: 'packagingRequirement' },
{ label: '厂家', prop: 'itemManufacturer' },
{ label: '调制度', prop: 'temperGrade' },
{ label: '镀层种类', prop: 'coatingType' },
{ label: '实测长度(m)', prop: 'actualLength' },
{ label: '实测宽度(mm)', prop: 'actualWidth' },
{ label: '实测厚度(mm)', prop: 'actualThickness' },
{ label: '钢卷表面处理', prop: 'coilSurfaceTreatment' },
],
title: '详细信息'
},
// 按钮loading
buttonLoading: false,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单校验
rules: {
enterCoilNo: [
{ required: true, message: "入场钢卷号不能为空", trigger: "blur" },
],
currentCoilNo: [
{ required: true, message: "当前钢卷号不能为空", trigger: "blur" },
],
itemId: [
{ required: true, message: "物品ID不能为空", trigger: "blur" }
],
itemType: [
{ required: true, message: "物品类型不能为空", trigger: "change" }
],
netWeight: [
{ required: true, message: "净重不能为空", trigger: "blur" }
],
grossWeight: [
{ required: true, message: "毛重不能为空", trigger: "blur" }
],
},
activeTab: 'splitlock',
};
},
computed: {
// 动态显示标签
getItemLabel() {
if (this.form.materialType === '成品') {
return '产品类型';
} else if (this.form.materialType === '原料') {
return '原料类型';
}
return '物品类型';
},
totalCoil() {
return this.materialCoilList.length;
}
},
created() {
this.handleRefresh();
},
methods: {
handleRefresh() {
if (this.activeTab === 'missing') {
this.getList();
} else if (this.activeTab === 'mismatch') {
this.getListMismatched();
} else if (this.activeTab === 'rawMaterialMissing') {
// this.getListRawMaterialMissing();
this.getListRawMaterialMissing();
} else if (this.activeTab === 'splitlock') {
this.getListSplitlock();
} else if (this.activeTab === 'anneallock') {
this.getListAnneallock();
}
},
/** 查询类型不匹配的钢卷列表 */
getList() {
this.loading = true;
listTypeErrorCoil().then(response => {
this.materialCoilList = response.data || [];
this.total = response.total || 0;
this.loading = false;
});
},
/** 查询原料材质与钢卷类型不匹配的钢卷列表 */
getListMismatched() {
this.loading = true;
listMismatchedItemCoil(this.queryParams).then(response => {
this.materialCoilList = response.rows || [];
this.total = response.total || 0;
this.loading = false;
});
},
// 查询原料类型缺失的钢卷列表
getListRawMaterialMissing() {
this.loading = true;
listMaterialCoil({ ...this.queryParams, dataType: 1, status: 0, onlyEmptyPackingStatus: true }).then(response => {
this.materialCoilList = response.rows || [];
this.total = response.total || 0;
this.loading = false;
});
},
// 查询分条锁定的钢卷列表
getListSplitlock() {
this.loading = true;
listMaterialCoil({ ...this.queryParams, exclusiveStatus: 1 }).then(response => {
this.materialCoilList = response.rows || [];
this.total = response.total || 0;
this.loading = false;
});
},
// 查询退火锁定的钢卷列表
getListAnneallock() {
this.loading = true;
listMaterialCoil({ ...this.queryParams, exclusiveStatus: 2 }).then(response => {
this.materialCoilList = response.rows || [];
this.total = response.total || 0;
this.loading = false;
});
},
/** 修复原料材质与钢卷类型不匹配的钢卷 */
handleFixType(row) {
this.buttonLoading = true;
this.$confirm('确认一键修复选中钢卷及其相关钢卷的原料材质吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
fixMismatchedItemCoil(row.coilId).then(response => {
if (response.code === 200) {
this.$message.success('修复成功');
this.getListMismatched();
} else {
this.$message.error(response.msg || '修复失败');
}
this.buttonLoading = false;
}).catch(err => {
console.error('修复失败:', err);
this.$message.error('修复失败,请重试');
this.buttonLoading = false;
});
})
},
/** 追溯按钮操作 */
handleTrace(row) {
this.traceOpen = true;
this.traceLoading = true;
this.traceResult = null; // 清空历史数据
getMaterialCoilTrace({
coilId: row.coilId,
currentCoilNo: row.currentCoilNo,
}).then(res => {
this.traceResult = res.data; // 将结果传递给组件
}).catch(err => {
console.error('溯源查询失败:', err);
this.$message.error('溯源查询失败,请重试');
}).finally(() => {
this.traceLoading = false;
});
},
/** 预览标签 */
handlePreviewLabel(row) {
this.labelRender.visible = true;
const itemName = row.itemName || '';
this.labelRender.type = row.itemType === 'product' ? '3' : '2';
this.labelRender.data = {
...row,
itemName: itemName,
updateTime: row.updateTime?.split(' ')[0] || '',
};
},
/** 打印标签 */
handlePrintLabel(row) {
const type = getCoilTagPrintType(row);
this.labelRender.type = type;
this.labelRender.data = {
...row,
updateTime: row.updateTime?.split(' ')[0] || '',
};
this.$nextTick(() => {
this.$refs.labelRender.printLabel();
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 重置表单 */
resetForm(formName) {
this.$refs[formName]?.resetFields();
},
/** 导出按钮操作 */
handleExportAll() {
// 导出逻辑
const coilIds = this.materialCoilList.map(item => item.coilId).join(',')
this.download('wms/materialCoil/export', {
coilIds
}, `materialCoil_${new Date().getTime()}.xlsx`)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.coilId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 处理材料类型变化 */
handleMaterialTypeChange(value) {
// 清空物品选择
this.form.itemId = null;
// 根据材料类型设置物品类型
if (value === '成品') {
this.form.itemType = 'product';
} else if (value === '原料') {
this.form.itemType = 'raw_material';
}
},
/** 修正按钮操作 */
handleCheck(row) {
this.reset();
const coilId = row.coilId || this.ids
getMaterialCoil(coilId).then(response => {
this.form = response.data;
// 设置 materialType优先级后端返回 > itemType推断
if (!this.form.materialType) {
if (this.form.itemType) {
// 根据 itemType 推断
if (this.form.itemType === 'product') {
this.form.materialType = '成品';
} else if (this.form.itemType === 'raw_material') {
this.form.materialType = '原料';
}
}
}
this.open = true;
this.title = "修正钢卷物料";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
coilId: undefined,
enterCoilNo: undefined,
currentCoilNo: undefined,
supplierCoilNo: undefined,
dataType: 1,
warehouseId: undefined,
nextWarehouseId: undefined,
qrcodeRecordId: undefined,
actualWarehouseId: undefined,
team: undefined,
hasMergeSplit: undefined,
parentCoilNos: undefined,
itemId: undefined,
itemType: undefined,
status: undefined,
remark: undefined,
delFlag: undefined,
createTime: undefined,
createBy: undefined,
updateTime: undefined,
updateBy: undefined,
materialType: '原料',
temperGrade: undefined,
coatingType: undefined,
};
this.resetForm("form");
},
// 解除钢卷的锁定状态
handleExcludeLock(row) {
this.$confirm('确认解除该钢卷的锁定状态吗?请先检查该钢卷是否有其他操作在进行中,否则可能会导致系统数据异常', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.buttonLoading = true;
excludeLock(row.coilId).then(res => {
this.buttonLoading = false;
this.$message({
message: '解除锁定成功',
type: 'success',
});
this.handleRefresh();
})
}).catch(() => {
// 取消操作
});
},
/** 提交表单 */
submitForm() {
this.$refs.form.validate((valid) => {
if (valid) {
this.buttonLoading = true;
updateMaterialCoilSimple(this.form).then(res => {
this.buttonLoading = false;
this.$message({
message: '更新成功',
type: 'success',
});
this.open = false;
this.getList();
}).catch(() => {
// 取消操作
this.buttonLoading = false;
});
} else {
return false;
}
})
},
}
};
</script>

View File

@@ -5,8 +5,8 @@
<el-radio-button label="missing">类型缺失</el-radio-button>
<el-radio-button label="rawMaterialMissing">原料类型缺失</el-radio-button>
<el-radio-button label="mismatch">匹配异常</el-radio-button>
<el-radio-button label="splitlock">分条锁定</el-radio-button>
<el-radio-button label="anneallock">退火锁定</el-radio-button>
<!-- <el-radio-button label="splitlock">分条锁定</el-radio-button>
<el-radio-button label="anneallock">退火锁定</el-radio-button> -->
</el-radio-group>
<el-button type="success" plain size="mini" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>

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({