|
|
|
|
@ -107,6 +107,7 @@
|
|
|
|
|
<el-table-column label="调拨单号" align="center" prop="allocateCode"/>
|
|
|
|
|
<el-table-column label="物料" align="center" prop="materialName"/>
|
|
|
|
|
<el-table-column label="调拨数量" align="center" prop="allocateOrderQty"/>
|
|
|
|
|
<el-table-column label="出库数量" align="center" prop="outSum"/>
|
|
|
|
|
<el-table-column label="erp同步状态" align="center" prop="erpSynchronousStatus">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="erp_synchronous_status" :value="scope.row.erpSynchronousStatus"/>
|
|
|
|
|
@ -121,14 +122,10 @@
|
|
|
|
|
type="primary">
|
|
|
|
|
创建任务
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="small" @click="recreateTasks(scope.row)"
|
|
|
|
|
v-if="hasExistingTasks(scope.row)"
|
|
|
|
|
type="warning">
|
|
|
|
|
重新创建
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="small" @click="deleteAllTasks(scope.row)"
|
|
|
|
|
v-if="hasExistingTasks(scope.row)"
|
|
|
|
|
type="danger">
|
|
|
|
|
type="danger"
|
|
|
|
|
:disabled="!canDelete(scope.row)">
|
|
|
|
|
删除任务
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="small" @click="viewPrintTasks(scope.row)">
|
|
|
|
|
@ -546,13 +543,13 @@
|
|
|
|
|
<el-table-column label="批次码" align="center" prop="batchCode" />
|
|
|
|
|
<el-table-column label="每包数量" align="center" prop="materialQty" />
|
|
|
|
|
<el-table-column label="条码数量" align="center" prop="apportionQty" />
|
|
|
|
|
<el-table-column label="入库状态" align="center" prop="inboundStatus">
|
|
|
|
|
<!-- <el-table-column label="入库状态" align="center" prop="inboundStatus">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag :type="scope.row.inboundStatus === '0' ? 'warning' : scope.row.inboundStatus === '1' ? 'success' : 'info'">
|
|
|
|
|
{{ scope.row.inboundStatus === '0' ? '待入库' : scope.row.inboundStatus === '1' ? '已入库' : '入库中' }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table-column>-->
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
@ -636,7 +633,6 @@ import {listUser} from "@/api/system/user";
|
|
|
|
|
import { getBaseMaterialCategoryListInWMS } from '@/api/wms/baseMaterialCategory';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const {
|
|
|
|
|
approve_status,
|
|
|
|
|
@ -720,11 +716,6 @@ getBaseWarehouseList(null).then(e => {
|
|
|
|
|
baseStoreList.value = e.data
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listUser({pageNum: 1, pageSize: 100}).then(e => {
|
|
|
|
|
userList.value = e.rows;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//获取物料大类下拉框
|
|
|
|
|
let mategoryOptions = ref([]);
|
|
|
|
|
let material_mategoryId = ref([]); // 兼容原有的物料大类下拉框
|
|
|
|
|
@ -1173,30 +1164,47 @@ const loadAllTasks = async () => {
|
|
|
|
|
/** 打印按钮点击事件 */
|
|
|
|
|
const childrenTablePrint = async (row) => {
|
|
|
|
|
try {
|
|
|
|
|
// 检查是否已经打印过
|
|
|
|
|
const result = await validatePrintable({aoDId: row.aoDId});
|
|
|
|
|
if (!result.data) {
|
|
|
|
|
ElMessage.warning('该调拨明细已经打印过,不允许重复打印');
|
|
|
|
|
return;
|
|
|
|
|
// Web端覆盖模式:直接进行打印,如果有现有任务会自动覆盖
|
|
|
|
|
const hasExisting = hasExistingTasks(row);
|
|
|
|
|
|
|
|
|
|
if (hasExisting) {
|
|
|
|
|
// 检查是否满足重新打印条件:出库数量等于调拨数量
|
|
|
|
|
if (Number(row.outSum) !== Number(row.allocateOrderQty)) {
|
|
|
|
|
ElMessage.error(`只有出库数量等于调拨数量时才能重新打印,当前出库数量:${row.outSum},调拨数量:${row.allocateOrderQty}`);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 确认是否要覆盖现有任务
|
|
|
|
|
await ElMessageBox.confirm(
|
|
|
|
|
'该调拨明细已有打印任务,确定要重新打印并覆盖现有任务吗?',
|
|
|
|
|
'确认覆盖',
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: '确定覆盖',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化打印表单
|
|
|
|
|
printForm.value = {
|
|
|
|
|
aoDId: row.aoDId,
|
|
|
|
|
// 调用分包打印接口(后端会自动处理覆盖逻辑)
|
|
|
|
|
await allocatePackagePrint({
|
|
|
|
|
allocateCode: row.allocateCode,
|
|
|
|
|
materialCode: row.materialCode,
|
|
|
|
|
materialName: row.materialName || '',
|
|
|
|
|
allocateOrderQty: Number(row.allocateOrderQty),
|
|
|
|
|
printMode: 'single',
|
|
|
|
|
splitPackageCount: 2,
|
|
|
|
|
printCopies: 1,
|
|
|
|
|
packageQtyList: []
|
|
|
|
|
};
|
|
|
|
|
aoDId: row.aoDId,
|
|
|
|
|
splitPackageCount: 1,
|
|
|
|
|
printCopies: 1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
printDialogVisible.value = true;
|
|
|
|
|
ElMessage.success(hasExisting ? '重新打印成功' : '创建任务成功');
|
|
|
|
|
|
|
|
|
|
// 刷新任务列表和子表数据
|
|
|
|
|
await loadTasksForDetail(row.aoDId);
|
|
|
|
|
if (partntTableSelectCell.value?.allocateOrderCode) {
|
|
|
|
|
await getChildrenTable({allocateCode: partntTableSelectCell.value.allocateOrderCode});
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('打印验证错误:', error);
|
|
|
|
|
ElMessage.error('打印验证失败');
|
|
|
|
|
if (error !== 'cancel') {
|
|
|
|
|
console.error('打印任务错误:', error);
|
|
|
|
|
ElMessage.error('操作失败:' + ((error as any).response?.data?.msg || (error as any).message || '未知错误'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1397,6 +1405,15 @@ const handlePrintSubmit = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const canReprint = (row) => {
|
|
|
|
|
// outSum是double类型,allocateOrderQty是BigDecimal类型,需要进行数值比较
|
|
|
|
|
return Number(row.outSum) === Number(row.allocateOrderQty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const canDelete = (row) => {
|
|
|
|
|
// outSum是double类型,allocateOrderQty是BigDecimal类型,需要进行数值比较
|
|
|
|
|
return Number(row.outSum) === Number(row.allocateOrderQty);
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.demo-form-inline .el-input {
|
|
|
|
|
|