diff --git a/src/views/receive/asn/Asn.data.ts b/src/views/receive/asn/Asn.data.ts index 368be8d..fb4c732 100644 --- a/src/views/receive/asn/Asn.data.ts +++ b/src/views/receive/asn/Asn.data.ts @@ -11,7 +11,7 @@ export const columns: BasicColumn[] = [ { title: '外部单号', align: 'center', - dataIndex: 'thirdPartyOrderNo', + dataIndex: 'thirdOrderNo', }, { title: '任务号', @@ -72,7 +72,6 @@ export const asnDetailColumns: JVxeColumn[] = [ title: '入库单ID', key: 'asnId', type: JVxeTypes.hidden, - width: '130px', }, { title: '物料', @@ -183,6 +182,7 @@ export const asnDetailColumns: JVxeColumn[] = [ type: JVxeTypes.input, width: '130px', placeholder: '请输入${title}', + defaultValue: null, }, { title: '任务号', @@ -190,6 +190,7 @@ export const asnDetailColumns: JVxeColumn[] = [ type: JVxeTypes.input, width: '130px', placeholder: '请输入${title}', + defaultValue: null, }, { title: '批次号', @@ -197,12 +198,14 @@ export const asnDetailColumns: JVxeColumn[] = [ type: JVxeTypes.input, width: '130px', placeholder: '请输入${title}', + defaultValue: null, }, { - title: '库存状态', + title: '外部库存状态', key: 'propC3', type: JVxeTypes.input, width: '130px', placeholder: '请输入${title}', + defaultValue: null, }, ]; diff --git a/src/views/receive/asn/components/AsnForm.vue b/src/views/receive/asn/components/AsnForm.vue index a80f51f..9fe8f18 100644 --- a/src/views/receive/asn/components/AsnForm.vue +++ b/src/views/receive/asn/components/AsnForm.vue @@ -5,8 +5,8 @@ - - + + @@ -138,9 +138,9 @@ let tenantId = getTenantId(); const formData = reactive>({ id: '', - thirdPartyOrderNo: '', + thirdOrderNo: '', no: '', - status: 'CREATED', + status: 1, orderType: '', supplierCode: '', whCode: '', @@ -151,9 +151,10 @@ //表单验证 const validatorRules = reactive({ - thirdPartyOrderNo: [{ required: true, message: '请输入外部单号!' }], + thirdOrderNo: [{ required: true, message: '请输入外部单号!' }], no: [{ required: true, message: '请输入任务号!' }], orderType: [{ required: true, message: '请选择单据类型!' }], + whCode: [{ required: true, message: '请输入外部仓库代码' }], }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false }); @@ -242,9 +243,9 @@ await saveOrUpdate(values, isUpdate); //关闭弹窗 emit('success'); - }catch (error){ + } catch (error) { console.error('提交失败:', error); - }finally { + } finally { // 重置加载状态 loading.value = false; } diff --git a/src/views/shipping/Pick.api.ts b/src/views/shipping/Pick.api.ts new file mode 100644 index 0000000..fc29602 --- /dev/null +++ b/src/views/shipping/Pick.api.ts @@ -0,0 +1,81 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/shipping/pick/list', + save='/shipping/pick/add', + edit='/shipping/pick/edit', + deleteOne = '/shipping/pick/delete', + deleteBatch = '/shipping/pick/deleteBatch', + importExcel = '/shipping/pick/importExcel', + exportXls = '/shipping/pick/exportXls', + queryDataById = '/shipping/pick/queryById', + pickDetailList = '/shipping/pick/queryPickDetailByMainId', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 查询子表数据 + * @param params + */ +export const queryPickDetailListByMainId = (id) => defHttp.get({url: Api.pickDetailList, params:{ id }}); + +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} + +/** +* 根据id查询数据 +* @param params +*/ +export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }}); + diff --git a/src/views/shipping/Pick.data.ts b/src/views/shipping/Pick.data.ts new file mode 100644 index 0000000..1cf86b3 --- /dev/null +++ b/src/views/shipping/Pick.data.ts @@ -0,0 +1,202 @@ +import { BasicColumn } from '/@/components/Table'; +import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'; +import { render } from '@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '系统单号', + align: 'center', + dataIndex: 'orderNo', + }, + { + title: '外部单号', + align: 'center', + dataIndex: 'thirdOrderNo', + }, + { + title: '任务号', + align: 'center', + dataIndex: 'no', + }, + { + title: '订单状态', + align: 'center', + dataIndex: 'status_dictText', + customRender: ({ text }) => { + //入库状态:1.已创建;2.部分分配;3.已分配;4.拣货中;5.拣货完成;6.已关闭;7.已取消。 + const statusColorMap = { + 已创建: 'orange', + 部分分配: 'cyan', + 已分配: 'cyan', + 拣货中: 'blue', + 拣货完成: 'green', + 已关闭: 'green', + 已取消: 'red', + }; + const color = statusColorMap[text] || 'red'; + return render.renderTag(text, color); + }, + }, + { + title: '单据类型', + align: 'center', + dataIndex: 'orderType_dictText', + }, + + { + title: '需求数量', + align: 'center', + dataIndex: 'orderQty', + }, + { + title: '分配数量', + align: 'center', + dataIndex: 'allocatedQty', + }, + { + title: '拣货数量', + align: 'center', + dataIndex: 'pickedQty', + }, + { + title: '外部仓库', + align: 'center', + dataIndex: 'whCode', + }, + { + title: '客户代码', + align: 'center', + dataIndex: 'customerCode', + }, + { + title: '外部仓库', + align: 'center', + dataIndex: 'whCode', + }, + { + title: '订单日期', + align: 'center', + dataIndex: 'orderDate', + }, +]; + +//子表表格配置 +export const pickDetailColumns: JVxeColumn[] = [ + { + title: '出库单ID', + key: 'pickId', + type: JVxeTypes.hidden, + }, + { + title: '物料', + key: 'itemId', + type: JVxeTypes.selectSearch, + width: 150, + async: true, // 异步搜索,默认为 true + //查询状态启用、未删除的物料 + dictCode: 'base_item where iz_active=1 and del_flag=0,item_code,id', + tipsContent: '请搜索物料', + validateRules: [ + { + required: true, // 必填 + message: '请选择${title}', // 显示的文本 + }, + ], + }, + { + title: '单位', + key: 'unit', + type: JVxeTypes.select, + dictCode: 'package_unit', + width: '130px', + placeholder: '请选择${title}', + defaultValue: '托', + }, + { + title: '需求数量', + key: 'orderQty', + type: JVxeTypes.inputNumber, + width: '130px', + validateRules: [ + { + required: true, // 必填 + message: '请输入${title}', // 显示的文本 + }, + ], + }, + { + title: '分配数量', + key: 'allocatedQty', + type: JVxeTypes.normal, + width: '130px', + defaultValue: '0', + disabled: true, + }, + { + title: '拣货数量', + key: 'pickedQty', + type: JVxeTypes.normal, + width: '130px', + placeholder: '请输入${title}', + defaultValue: '0', + disabled: true, + }, + { + title: '明细状态', + key: 'status', + type: JVxeTypes.normal, + width: '120px', + defaultValue: '1', + formatter: ({ cellValue }) => { + //入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。 + const statusMap = { + 1: '已创建', + 2: '部分收货', + 3: '收货完成', + 4: '已取消', + }; + // 状态颜色映射 + const statusColorMap = { + 已创建: 'orange', + 部分收货: 'blue', + 收货完成: 'green', + 已取消: 'red', + }; + const text = statusMap[cellValue] || '未知状态'; + const color = statusColorMap[text] || 'red'; + return render.renderTag(text, color); + }, + }, + { + title: '项目号', + key: 'project', + type: JVxeTypes.input, + width: '130px', + placeholder: '请输入${title}', + defaultValue: null, + }, + { + title: '任务号', + key: 'taskNo', + type: JVxeTypes.input, + width: '130px', + placeholder: '请输入${title}', + defaultValue: null, + }, + { + title: '批次号', + key: 'propC1', + type: JVxeTypes.input, + width: '130px', + placeholder: '请输入${title}', + defaultValue: null, + }, + { + title: '外部库存状态', + key: 'propC3', + type: JVxeTypes.input, + width: '130px', + placeholder: '请输入${title}', + defaultValue: null, + }, +]; diff --git a/src/views/shipping/PickList.vue b/src/views/shipping/PickList.vue new file mode 100644 index 0000000..924893c --- /dev/null +++ b/src/views/shipping/PickList.vue @@ -0,0 +1,239 @@ + + + + diff --git a/src/views/shipping/V20251114_1__menu_insert_Pick.sql b/src/views/shipping/V20251114_1__menu_insert_Pick.sql new file mode 100644 index 0000000..df47ff9 --- /dev/null +++ b/src/views/shipping/V20251114_1__menu_insert_Pick.sql @@ -0,0 +1,40 @@ +-- 注意:该页面对应的前台目录为views/shipping文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +-- 主菜单 +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('176310372519801', NULL, '出库单', '/shipping/pickList', 'shipping/PickList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0); + +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519802', '176310372519801', '添加出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519803', '176310372519801', '编辑出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519804', '176310372519801', '删除出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519805', '176310372519801', '批量删除出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519806', '176310372519801', '导出excel_出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('176310372519807', '176310372519801', '导入excel_出库单', NULL, NULL, 0, NULL, NULL, 2, 'shipping:data_pick:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-14 15:02:05', NULL, NULL, 0, 0, '1', 0); + +-- 角色授权(以 admin 角色为例,role_id 可替换) +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519808', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519801', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519809', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519802', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519810', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519803', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519811', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519804', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519812', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519805', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519813', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519806', NULL, '2025-11-14 15:02:05', '127.0.0.1'); +INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176310372519814', 'f6817f48af4fb3af11b9e8bf182f618b', '176310372519807', NULL, '2025-11-14 15:02:05', '127.0.0.1'); \ No newline at end of file diff --git a/src/views/shipping/components/PickForm.vue b/src/views/shipping/components/PickForm.vue new file mode 100644 index 0000000..d284567 --- /dev/null +++ b/src/views/shipping/components/PickForm.vue @@ -0,0 +1,315 @@ + + + + diff --git a/src/views/shipping/components/PickModal.vue b/src/views/shipping/components/PickModal.vue new file mode 100644 index 0000000..f3868e3 --- /dev/null +++ b/src/views/shipping/components/PickModal.vue @@ -0,0 +1,67 @@ + + + +