no message

main
HUOJIN\92525 2025-12-23 15:04:41 +08:00
parent bf33b23154
commit 514d840de7
6 changed files with 205 additions and 39 deletions

View File

@ -89,10 +89,8 @@
import { columns } from './Inventory.data'; import { columns } from './Inventory.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Inventory.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Inventory.api';
import InventoryModal from './components/InventoryModal.vue'; import InventoryModal from './components/InventoryModal.vue';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils'; import { getDateByPicker } from '/@/utils';
import { JDictSelectTag, JSearchSelect } from '@/components/Form'; import { JDictSelectTag } from '@/components/Form';
import ItemSelect from '@/views/base/item/components/ItemSelect.vue'; import ItemSelect from '@/views/base/item/components/ItemSelect.vue';
import PointSelect from '@/views/base/point/components/PointSelect.vue'; import PointSelect from '@/views/base/point/components/PointSelect.vue';
import StockSelect from '@/views/base/stock/components/StockSelect.vue'; import StockSelect from '@/views/base/stock/components/StockSelect.vue';
@ -103,10 +101,8 @@
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const userStore = useUserStore();
const { createMessage } = useMessage();
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
title: '库存表', title: '库存表',
api: list, api: list,
@ -117,6 +113,10 @@
width: 120, width: 120,
fixed: 'right', fixed: 'right',
}, },
defSort: {
column: 'stockId',
order: 'asc',
},
beforeFetch: async (params) => { beforeFetch: async (params) => {
for (let key in fieldPickers) { for (let key in fieldPickers) {
if (queryParam[key] && fieldPickers[key]) { if (queryParam[key] && fieldPickers[key]) {

View File

@ -13,6 +13,8 @@ enum Api {
exportXls = '/receive/asn/exportXls', exportXls = '/receive/asn/exportXls',
queryDataById = '/receive/asn/queryById', queryDataById = '/receive/asn/queryById',
asnDetailList = '/receive/asn/queryAsnDetailByMainId', asnDetailList = '/receive/asn/queryAsnDetailByMainId',
receiveAsn = '/receive/asn/receiveAsn',
receiveBack = '/receive/asn/receiveBack',
} }
/** /**
* api * api
@ -69,7 +71,7 @@ export const batchDelete = (params, handleSuccess) => {
* @param params * @param params
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; const url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params}); return defHttp.post({url: url, params});
} }
@ -79,3 +81,22 @@ export const saveOrUpdate = (params, isUpdate) => {
*/ */
export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }}); export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
/**
*
* @param params
*/
export const receiveAsn = (id,handleSuccess) => {
return defHttp.get({ url: Api.receiveAsn, params: { id } }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};
/**
*
* @param params
*/
export const receiveBack = (id,handleSuccess) => {
return defHttp.get({ url: Api.receiveBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};

View File

@ -44,7 +44,7 @@ export const columns: BasicColumn[] = [
title: '单据类型', title: '单据类型',
align: 'center', align: 'center',
dataIndex: 'orderType_dictText', dataIndex: 'orderType_dictText',
width: '80px', width: '110px',
}, },
{ {
title: '需求数量', title: '需求数量',

View File

@ -36,13 +36,12 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<!-- <a-col :lg="6"> <!-- <a-col :lg="6">
<a-form-item name="status"> <a-form-item name="status">
<template #label><span title="状态">状态</span></template> <template #label><span title="状态">状态</span></template>
<JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="asn_status" allowClear /> <JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="asn_status" allowClear />
</a-form-item> </a-form-item>
</a-col>--> </a-col>-->
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -51,7 +50,29 @@
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" v-auth="'receive:data_asn:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> </a-button> <a-button type="primary" v-auth="'receive:data_asn:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> </a-button>
<a-button type="primary" @click="scanTray" preIcon="ant-design:barcode-outlined"> 托盘扫描 </a-button> <a-button type="success" v-auth="'conveyorLine:data_asn:scanTray'" @click="scanTray" preIcon="ant-design:barcode-outlined">
托盘扫描
</a-button>
<a-button
type="warning"
v-auth="'receive:data_asn:receiveAsn'"
:loading="receive_loading"
:disabled="selectedRowKeys.length != 1"
@click="handleReceive"
preIcon="ant-design:edit-outlined"
>
整单入库
</a-button>
<a-button
type="error"
v-auth="'receive:data_asn:receiveBack'"
:loading="receiveBack_loading"
:disabled="selectedRowKeys.length != 1"
@click="handleReceiveBack"
preIcon="ant-design:send-outlined"
>
入库回传
</a-button>
<a-button type="primary" v-auth="'receive:data_asn:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> </a-button> <a-button type="primary" v-auth="'receive:data_asn:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> </a-button>
<j-upload-button <j-upload-button
@ -97,18 +118,18 @@
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import AsnModal from './components/AsnModal.vue'; import AsnModal from './components/AsnModal.vue';
import { columns } from './Asn.data'; import { columns } from './Asn.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Asn.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, receiveAsn, receiveBack } from './Asn.api';
import { getDateByPicker } from '/@/utils'; import { getDateByPicker } from '/@/utils';
import { JInputTypeEnum } from '@/enums/cpteEnum'; import { JInputTypeEnum } from '@/enums/cpteEnum';
import { JInput, JDictSelectTag } from '@/components/Form'; import { JInput, JDictSelectTag } from '@/components/Form';
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue'; import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
import ScanTrayModal from '@/views/receive/asn/components/scanTray/ScanTrayModal.vue'; import ScanTrayModal from '@/views/receive/asn/components/scanTray/ScanTrayModal.vue';
import ItemModal from '@/views/base/item/components/ItemModal.vue'; import { useMessage } from '@/hooks/web/useMessage';
const fieldPickers = reactive({}); const fieldPickers = reactive({});
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const { createMessage } = useMessage();
//model //model
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
//table //table
@ -157,7 +178,7 @@
}, },
}); });
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext; const [registerTable, { reload }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
/** /**
* 新增事件 * 新增事件
@ -219,6 +240,62 @@
registerScanTrayModal.value.add(); registerScanTrayModal.value.add();
} }
/**
* 收货事件
*/
const receive_loading = ref(false);
async function handleReceive() {
// 6 true,false
const validStatuses = [6];
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
if (!allValidStatus) {
return createMessage.error('【已扫描】状态的入库单才允许收货');
}
if (receive_loading.value) {
return;
}
//
receive_loading.value = true;
try {
await receiveAsn(selectedRowKeys.value, handleSuccess);
} catch (e) {
console.error('收货失败:', e);
handleSuccess();
} finally {
//
receive_loading.value = false;
}
}
/**
* 回传事件
*/
const receiveBack_loading = ref(false);
async function handleReceiveBack() {
// 23 true,false
const validStatuses = [2, 3];
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
if (!allValidStatus) {
return createMessage.error('【部分收货、收货完成】状态的入库单才允许回传');
}
if (receiveBack_loading.value) {
return;
}
//
receiveBack_loading.value = true;
try {
await receiveBack(selectedRowKeys.value, handleSuccess);
} catch (e) {
console.error('回传失败:', e);
handleSuccess();
} finally {
//
receiveBack_loading.value = false;
}
}
/** /**
* 成功回调 * 成功回调
*/ */

View File

@ -17,6 +17,7 @@ enum Api {
allocatePick = '/shipping/pick/allocatePick', allocatePick = '/shipping/pick/allocatePick',
cancelAllocate = '/shipping/pick/cancelAllocate', cancelAllocate = '/shipping/pick/cancelAllocate',
pickTask = '/shipping/pick/pickTask', pickTask = '/shipping/pick/pickTask',
pickBack = '/shipping/pick/pickBack',
} }
/** /**
@ -85,7 +86,7 @@ export const batchDelete = (params, handleSuccess) => {
* @param params * @param params
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; const url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }); return defHttp.post({ url: url, params });
}; };
@ -109,28 +110,54 @@ export const queryTaskByMainId = (id) =>
* *
* @param params * @param params
*/ */
export const allocatePick = (ids,handleSuccess) => { export const allocatePick = (ids, handleSuccess) => {
return defHttp.get({ url: Api.allocatePick, params: { ids } }, { joinParamsToUrl: true }).then(() => { return defHttp
handleSuccess(); .get(
}); {
url: Api.allocatePick,
params: { ids },
},
{ joinParamsToUrl: true }
)
.then(() => {
handleSuccess();
});
}; };
/** /**
* *
* @param params * @param params
*/ */
export const cancelAllocate = (ids,handleSuccess) => { export const cancelAllocate = (ids, handleSuccess) => {
return defHttp.get({ url: Api.cancelAllocate, params: { ids } }, { joinParamsToUrl: true }).then(() => { return defHttp
handleSuccess(); .get(
}); {
url: Api.cancelAllocate,
params: { ids },
},
{ joinParamsToUrl: true }
)
.then(() => {
handleSuccess();
});
}; };
/** /**
* *
* @param params * @param params
*/ */
export const pickTask = (ids,handleSuccess) => { export const pickTask = (ids, handleSuccess) => {
return defHttp.get({ url: Api.pickTask, params: { ids } }, { joinParamsToUrl: true }).then(() => { return defHttp.get({ url: Api.pickTask, params: { ids } }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};
/**
*
* @param params
*/
export const pickBack = (id, handleSuccess) => {
return defHttp.get({ url: Api.pickBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
}; };

View File

@ -37,7 +37,7 @@
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :lg="6"> <a-col :lg="6">
<a-form-item name="status_MultiString"> <a-form-item v-if="toggleSearchStatus" name="status_MultiString">
<template #label><span title="状态">状态</span></template> <template #label><span title="状态">状态</span></template>
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="pick_status" /> <JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="pick_status" />
</a-form-item> </a-form-item>
@ -51,7 +51,7 @@
<template #tableTitle> <template #tableTitle>
<a-button type="primary" v-auth="'shipping:data_pick:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> </a-button> <a-button type="primary" v-auth="'shipping:data_pick:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> </a-button>
<a-button <a-button
type="primary" type="success"
:loading="allocate_loading" :loading="allocate_loading"
:disabled="selectedRowKeys.length === 0" :disabled="selectedRowKeys.length === 0"
v-auth="'shipping:data_pick:allocatePick'" v-auth="'shipping:data_pick:allocatePick'"
@ -61,7 +61,7 @@
批量分配 批量分配
</a-button> </a-button>
<a-button <a-button
type="primary" type="error"
danger danger
:loading="cancel_loading" :loading="cancel_loading"
:disabled="selectedRowKeys.length === 0" :disabled="selectedRowKeys.length === 0"
@ -72,7 +72,7 @@
取消分配 取消分配
</a-button> </a-button>
<a-button <a-button
type="primary" type="warning"
:loading="pick_loading" :loading="pick_loading"
:disabled="selectedRowKeys.length === 0" :disabled="selectedRowKeys.length === 0"
v-auth="'shipping:data_pick:pickTask'" v-auth="'shipping:data_pick:pickTask'"
@ -81,6 +81,16 @@
> >
批量拣货 批量拣货
</a-button> </a-button>
<a-button
type="error"
v-auth="'shipping:data_pick:pickBack'"
:loading="pickBack_loading"
:disabled="selectedRowKeys.length != 1"
@click="handlePickBack"
preIcon="ant-design:send-outlined"
>
出库回传
</a-button>
<a-button type="primary" v-auth="'shipping:data_pick:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> </a-button> <a-button type="primary" v-auth="'shipping:data_pick:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> </a-button>
<j-upload-button type="primary" v-auth="'shipping:data_pick:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls" <j-upload-button type="primary" v-auth="'shipping:data_pick:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
>导入 >导入
@ -119,7 +129,7 @@
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import PickModal from './components/PickModal.vue'; import PickModal from './components/PickModal.vue';
import { columns } from './Pick.data'; import { columns } from './Pick.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, allocatePick, cancelAllocate, pickTask } from './Pick.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, allocatePick, cancelAllocate, pickTask, pickBack } from './Pick.api';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils'; import { getDateByPicker } from '/@/utils';
import { JInputTypeEnum } from '@/enums/cpteEnum'; import { JInputTypeEnum } from '@/enums/cpteEnum';
@ -127,9 +137,6 @@
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue'; import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue'; import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
const allocate_loading = ref(false);
const cancel_loading = ref(false);
const pick_loading = ref(false);
const fieldPickers = reactive({}); const fieldPickers = reactive({});
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
@ -197,6 +204,8 @@
/** /**
* 分配事件 * 分配事件
*/ */
const allocate_loading = ref(false);
async function handleAllocatePick() { async function handleAllocatePick() {
// 124 true,false // 124 true,false
const validStatuses = [1, 2, 4]; const validStatuses = [1, 2, 4];
@ -223,6 +232,8 @@
/** /**
* 取消分配 * 取消分配
*/ */
const cancel_loading = ref(false);
async function handleCancelAllocate() { async function handleCancelAllocate() {
// 23 true,false // 23 true,false
const validStatuses = [2, 3]; const validStatuses = [2, 3];
@ -249,6 +260,8 @@
/** /**
* 拣货事件 * 拣货事件
*/ */
const pick_loading = ref(false);
async function handlePick() { async function handlePick() {
// 124 true,false // 124 true,false
const validStatuses = [2, 3, 4]; const validStatuses = [2, 3, 4];
@ -272,6 +285,34 @@
} }
} }
/**
* 回传事件
*/
const pickBack_loading = ref(false);
async function handlePickBack() {
// 45 true,false
const validStatuses = [4, 5];
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
if (!allValidStatus) {
return createMessage.error('【部分拣货、拣货完成】状态的入库单才允许回传');
}
if (pickBack_loading.value) {
return;
}
//
pickBack_loading.value = true;
try {
await pickBack(selectedRowKeys.value, handleSuccess);
} catch (e) {
console.error('回传失败:', e);
handleSuccess();
} finally {
//
pickBack_loading.value = false;
}
}
/** /**
* 编辑事件 * 编辑事件
*/ */