no message
parent
bf33b23154
commit
514d840de7
|
|
@ -89,10 +89,8 @@
|
|||
import { columns } from './Inventory.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Inventory.api';
|
||||
import InventoryModal from './components/InventoryModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
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 PointSelect from '@/views/base/point/components/PointSelect.vue';
|
||||
import StockSelect from '@/views/base/stock/components/StockSelect.vue';
|
||||
|
|
@ -103,10 +101,8 @@
|
|||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '库存表',
|
||||
api: list,
|
||||
|
|
@ -117,6 +113,10 @@
|
|||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
defSort: {
|
||||
column: 'stockId',
|
||||
order: 'asc',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
for (let key in fieldPickers) {
|
||||
if (queryParam[key] && fieldPickers[key]) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ enum Api {
|
|||
exportXls = '/receive/asn/exportXls',
|
||||
queryDataById = '/receive/asn/queryById',
|
||||
asnDetailList = '/receive/asn/queryAsnDetailByMainId',
|
||||
receiveAsn = '/receive/asn/receiveAsn',
|
||||
receiveBack = '/receive/asn/receiveBack',
|
||||
}
|
||||
/**
|
||||
* 导出api
|
||||
|
|
@ -69,7 +71,7 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
* @param params
|
||||
*/
|
||||
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});
|
||||
}
|
||||
|
||||
|
|
@ -79,3 +81,22 @@ export const saveOrUpdate = (params, isUpdate) => {
|
|||
*/
|
||||
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();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export const columns: BasicColumn[] = [
|
|||
title: '单据类型',
|
||||
align: 'center',
|
||||
dataIndex: 'orderType_dictText',
|
||||
width: '80px',
|
||||
width: '110px',
|
||||
},
|
||||
{
|
||||
title: '需求数量',
|
||||
|
|
|
|||
|
|
@ -36,13 +36,12 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<!-- <a-col :lg="6">
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="asn_status" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>-->
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
|
@ -51,7 +50,29 @@
|
|||
<!--插槽:table标题-->
|
||||
<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" @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>
|
||||
<j-upload-button
|
||||
|
|
@ -97,18 +118,18 @@
|
|||
import { useModal } from '/@/components/Modal';
|
||||
import AsnModal from './components/AsnModal.vue';
|
||||
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 { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
import { JInput, JDictSelectTag } from '@/components/Form';
|
||||
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.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 formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 收货事件
|
||||
*/
|
||||
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() {
|
||||
// 选中的数据中状态有2、3 返回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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ enum Api {
|
|||
allocatePick = '/shipping/pick/allocatePick',
|
||||
cancelAllocate = '/shipping/pick/cancelAllocate',
|
||||
pickTask = '/shipping/pick/pickTask',
|
||||
pickBack = '/shipping/pick/pickBack',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -85,7 +86,7 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
* @param params
|
||||
*/
|
||||
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 });
|
||||
};
|
||||
|
||||
|
|
@ -109,8 +110,16 @@ export const queryTaskByMainId = (id) =>
|
|||
* 分配出库单
|
||||
* @param params
|
||||
*/
|
||||
export const allocatePick = (ids,handleSuccess) => {
|
||||
return defHttp.get({ url: Api.allocatePick, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||
export const allocatePick = (ids, handleSuccess) => {
|
||||
return defHttp
|
||||
.get(
|
||||
{
|
||||
url: Api.allocatePick,
|
||||
params: { ids },
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
@ -119,8 +128,16 @@ export const allocatePick = (ids,handleSuccess) => {
|
|||
* 取消分配
|
||||
* @param params
|
||||
*/
|
||||
export const cancelAllocate = (ids,handleSuccess) => {
|
||||
return defHttp.get({ url: Api.cancelAllocate, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||
export const cancelAllocate = (ids, handleSuccess) => {
|
||||
return defHttp
|
||||
.get(
|
||||
{
|
||||
url: Api.cancelAllocate,
|
||||
params: { ids },
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
@ -129,8 +146,18 @@ export const cancelAllocate = (ids,handleSuccess) => {
|
|||
* 出库单拣货
|
||||
* @param params
|
||||
*/
|
||||
export const pickTask = (ids,handleSuccess) => {
|
||||
export const pickTask = (ids, handleSuccess) => {
|
||||
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();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<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>
|
||||
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="pick_status" />
|
||||
</a-form-item>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<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"
|
||||
type="success"
|
||||
:loading="allocate_loading"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
v-auth="'shipping:data_pick:allocatePick'"
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
批量分配
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
type="error"
|
||||
danger
|
||||
:loading="cancel_loading"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
取消分配
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
type="warning"
|
||||
:loading="pick_loading"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
v-auth="'shipping:data_pick:pickTask'"
|
||||
|
|
@ -81,6 +81,16 @@
|
|||
>
|
||||
批量拣货
|
||||
</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>
|
||||
<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 PickModal from './components/PickModal.vue';
|
||||
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 { getDateByPicker } from '/@/utils';
|
||||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
|
|
@ -127,9 +137,6 @@
|
|||
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.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 formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
|
|
@ -197,6 +204,8 @@
|
|||
/**
|
||||
* 分配事件
|
||||
*/
|
||||
const allocate_loading = ref(false);
|
||||
|
||||
async function handleAllocatePick() {
|
||||
// 选中的数据中状态有1、2、4 返回true,否则返回false
|
||||
const validStatuses = [1, 2, 4];
|
||||
|
|
@ -223,6 +232,8 @@
|
|||
/**
|
||||
* 取消分配
|
||||
*/
|
||||
const cancel_loading = ref(false);
|
||||
|
||||
async function handleCancelAllocate() {
|
||||
// 选中的数据中状态有2、3 返回true,否则返回false
|
||||
const validStatuses = [2, 3];
|
||||
|
|
@ -249,6 +260,8 @@
|
|||
/**
|
||||
* 拣货事件
|
||||
*/
|
||||
const pick_loading = ref(false);
|
||||
|
||||
async function handlePick() {
|
||||
// 选中的数据中状态有1、2、4 返回true,否则返回false
|
||||
const validStatuses = [2, 3, 4];
|
||||
|
|
@ -272,6 +285,34 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回传事件
|
||||
*/
|
||||
const pickBack_loading = ref(false);
|
||||
|
||||
async function handlePickBack() {
|
||||
// 选中的数据中状态有4、5 返回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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue