diff --git a/src/views/agvTask/AgvTask.api.ts b/src/views/agvTask/AgvTask.api.ts
index 79dcbd8..b9d0ff3 100644
--- a/src/views/agvTask/AgvTask.api.ts
+++ b/src/views/agvTask/AgvTask.api.ts
@@ -1,18 +1,20 @@
import { defHttp } from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
+import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/agvTask/list',
- save='/agvTask/add',
- edit='/agvTask/edit',
+ save = '/agvTask/add',
+ edit = '/agvTask/edit',
deleteOne = '/agvTask/delete',
deleteBatch = '/agvTask/deleteBatch',
importExcel = '/agvTask/importExcel',
exportXls = '/agvTask/exportXls',
taskReporter = '/api/robot/reporter/task',
- callBackTask='/tes/apiv2/callBackTask',
+ callBackTask = '/tes/apiv2/callBackTask',
+ cancelTask = '/tes/apiv2/cancelTask',
+ resendTesTask = '/tes/apiv2/resendTesTask',
}
/**
@@ -37,11 +39,11 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
* @param params
* @param handleSuccess
*/
-export const deleteOne = (params,handleSuccess) => {
- return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
+export const deleteOne = (params, handleSuccess) => {
+ return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
-}
+};
/**
* 批量删除
@@ -56,12 +58,20 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
+ return defHttp
+ .delete(
+ {
+ url: Api.deleteBatch,
+ data: params,
+ },
+ { joinParamsToUrl: true }
+ )
+ .then(() => {
+ handleSuccess();
+ });
+ },
});
-}
+};
/**
* 保存或者更新
@@ -71,26 +81,53 @@ export const batchDelete = (params, handleSuccess) => {
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
-}
+};
/**
* AGV任务上报
* @param params
*/
export const taskReporter = (params) => {
- return defHttp.post({url: Api.taskReporter, params}, {
- joinParamsToUrl: false,
- isTransformResponse: false
- });
-}
+ return defHttp.post(
+ { url: Api.taskReporter, params },
+ {
+ isTransformResponse: false,
+ }
+ );
+};
/**
* TES任务上报
* @param params
*/
export const callBackTask = (params) => {
- return defHttp.post({url: Api.callBackTask, params}, {
- joinParamsToUrl: false,
- isTransformResponse: false
+ return defHttp.post(
+ { url: Api.callBackTask, params },
+ {
+ isTransformResponse: false,
+ }
+ );
+};
+
+/**
+ * 任务取消
+ * @param params
+ */
+export const cancelTask = (params) => {
+ return defHttp.post(
+ { url: Api.cancelTask, params },
+ {
+ isTransformResponse: false,
+ }
+ );
+};
+
+/**
+ * 任务重送
+ * @param params
+ */
+export const resendTesTask = (params) => {
+ return defHttp.post({ url: Api.resendTesTask, params },{
+ isTransformResponse: false,
});
-}
+};
diff --git a/src/views/agvTask/TesAgvList.vue b/src/views/agvTask/TesAgvList.vue
index 9648949..c04ae57 100644
--- a/src/views/agvTask/TesAgvList.vue
+++ b/src/views/agvTask/TesAgvList.vue
@@ -45,6 +45,7 @@
+
@@ -53,9 +54,9 @@
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './TesAgv.data';
- import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, callBackTask } from './AgvTask.api';
+ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, callBackTask, cancelTask } from './AgvTask.api';
import TesAgvModal from './components/TesAgvModal.vue';
- import { useUserStore } from '/@/store/modules/user';
+ import ResendTesAgvModal from './components/ResendTesAgvModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
@@ -65,12 +66,11 @@
const queryParam = reactive({
agvVendor: 'TES',
});
- const toggleSearchStatus = ref(false);
const registerModal = ref();
- const userStore = useUserStore();
+ const registerResendModal = ref();
const { createMessage } = useMessage();
//注册table数据
- const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
+ const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'TES任务表',
api: list,
@@ -100,8 +100,7 @@
success: handleSuccess,
},
});
- const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
- tableContext;
+ const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
@@ -168,15 +167,45 @@
const res = await callBackTask(params);
if (res && res.returnCode === 0) {
createMessage.success('操作成功');
- handleSuccess();
} else {
- createMessage.error(res.message || '任务处理失败');
+ createMessage.error(res.returnMsg || '任务处理失败');
}
} catch (error) {
createMessage.error('请求异常: ' + error.message);
+ } finally {
+ handleSuccess();
}
}
+ /**
+ * 任务取消事件
+ */
+ async function hanndleCancel(record) {
+ const params = {
+ taskID: record.id,
+ };
+ try {
+ const res = await cancelTask(params);
+ if (res && res.returnCode === 0) {
+ createMessage.success('操作成功');
+ } else {
+ createMessage.error(res.returnMsg || '任务处理失败');
+ }
+ } catch (error) {
+ createMessage.error('请求异常: ' + error.message);
+ } finally {
+ handleSuccess();
+ }
+ }
+
+ /**
+ * 任务重发
+ */
+ function hanndleResend(record) {
+ registerResendModal.value.disableSubmit = false;
+ registerResendModal.value.resend(record);
+ }
+
/**
* 成功回调
*/
@@ -214,10 +243,26 @@
placement: 'topLeft',
},
auth: 'agvTask:data_agv_task:edit',
- disabled: record.status === 4 || record.status === 1,
+ disabled: record.status === 4 || record.status === 1 || record.status === 5,
},
{
- label: '删除任务',
+ label: '任务取消',
+ popConfirm: {
+ title: '是否确认取消?',
+ confirm: hanndleCancel.bind(null, record),
+ placement: 'topLeft',
+ },
+ auth: 'agvTask:data_agv_task:edit',
+ disabled: record.status != 2,
+ },
+ {
+ label: '任务重送',
+ onClick: hanndleResend.bind(null, record),
+ auth: 'agvTask:data_agv_task:edit',
+ disabled: record.status != 5,
+ },
+ {
+ label: '任务删除',
popConfirm: {
title: '是否确认删除?',
confirm: handleDelete.bind(null, record),
diff --git a/src/views/agvTask/components/ResendTesAgvForm.vue b/src/views/agvTask/components/ResendTesAgvForm.vue
new file mode 100644
index 0000000..cb33aad
--- /dev/null
+++ b/src/views/agvTask/components/ResendTesAgvForm.vue
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/agvTask/components/ResendTesAgvModal.vue b/src/views/agvTask/components/ResendTesAgvModal.vue
new file mode 100644
index 0000000..bc402ba
--- /dev/null
+++ b/src/views/agvTask/components/ResendTesAgvModal.vue
@@ -0,0 +1,76 @@
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
+
+
+
diff --git a/src/views/agvTask/components/TesAgvForm.vue b/src/views/agvTask/components/TesAgvForm.vue
index 94f769b..53608ff 100644
--- a/src/views/agvTask/components/TesAgvForm.vue
+++ b/src/views/agvTask/components/TesAgvForm.vue
@@ -26,7 +26,7 @@
-
+
diff --git a/src/views/agvTask/components/TesAgvModal.vue b/src/views/agvTask/components/TesAgvModal.vue
index c7dd636..01e9576 100644
--- a/src/views/agvTask/components/TesAgvModal.vue
+++ b/src/views/agvTask/components/TesAgvModal.vue
@@ -21,11 +21,8 @@
import { ref, nextTick, defineExpose } from 'vue';
import TesAgvForm from './TesAgvForm.vue';
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
- import { useMessage } from '/@/hooks/web/useMessage';
- const { createMessage } = useMessage();
const title = ref('');
- const width = ref(800);
const visible = ref(false);
const disableSubmit = ref(false);
const registerForm = ref();
diff --git a/src/views/conveyorLine/ConveyorLine.api.ts b/src/views/conveyorLine/ConveyorLine.api.ts
new file mode 100644
index 0000000..c785667
--- /dev/null
+++ b/src/views/conveyorLine/ConveyorLine.api.ts
@@ -0,0 +1,15 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+ showConveyorLine = '/api/conveyorLine/showConveyorLine',
+}
+
+export const showConveyorLine = (conveyorLine) => {
+ return defHttp.get(
+ {
+ url: Api.showConveyorLine,
+ params: { conveyorLine },
+ },
+ { joinParamsToUrl: true }
+ );
+};
diff --git a/src/views/conveyorLine/WcsMonitor.vue b/src/views/conveyorLine/WcsMonitor.vue
new file mode 100644
index 0000000..58ffc70
--- /dev/null
+++ b/src/views/conveyorLine/WcsMonitor.vue
@@ -0,0 +1,438 @@
+
+
+
+
+
+
+
+
+
{{ scanData.stockCode }}
+
+
+
+
+
+
+
+
+
任务类型 TASK TYPE
+
+
{{ scanData.taskType }}
+
+
+
+
+
+
目的站 DESTINATION
+
+
{{ scanData.endCode }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/inventoryLog/InventoryLogList.vue b/src/views/inventoryLog/InventoryLogList.vue
index 7df5163..6f837fc 100644
--- a/src/views/inventoryLog/InventoryLogList.vue
+++ b/src/views/inventoryLog/InventoryLogList.vue
@@ -137,6 +137,10 @@
width: 120,
fixed: 'right',
},
+ defSort: {
+ column: 'id',
+ order: 'desc',
+ },
showActionColumn: false,
beforeFetch: async (params) => {
for (let key in fieldPickers) {
diff --git a/src/views/shipping/Pick.api.ts b/src/views/shipping/Pick.api.ts
index fc29602..2abd9d7 100644
--- a/src/views/shipping/Pick.api.ts
+++ b/src/views/shipping/Pick.api.ts
@@ -1,19 +1,22 @@
-import {defHttp} from '/@/utils/http/axios';
-import { useMessage } from "/@/hooks/web/useMessage";
+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',
+ 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',
+ allocatePick = '/shipping/pick/allocatePick',
+ cancelAllocate = '/shipping/pick/cancelAllocate',
}
+
/**
* 导出api
* @param params
@@ -29,23 +32,26 @@ export const getImportUrl = Api.importExcel;
* 查询子表数据
* @param params
*/
-export const queryPickDetailListByMainId = (id) => defHttp.get({url: Api.pickDetailList, params:{ id }});
+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 list = (params) => defHttp.get({ url: Api.list, params });
/**
* 删除单个
*/
-export const deleteOne = (params,handleSuccess) => {
- return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
+export const deleteOne = (params, handleSuccess) => {
+ return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
-}
+};
/**
* 批量删除
* @param params
@@ -58,24 +64,51 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
+ 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});
-}
+ return defHttp.post({ url: url, params });
+};
/**
-* 根据id查询数据
-* @param params
-*/
-export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
+ * 根据id查询数据
+ * @param params
+ */
+export const queryDataById = (id) => defHttp.get({ url: Api.queryDataById, params: { id } });
+/**
+ * 分配出库单
+ * @param params
+ */
+export const allocatePick = (ids,handleSuccess) => {
+ return defHttp.get({ url: Api.allocatePick, params: { ids } }, { joinParamsToUrl: true }).then(() => {
+ handleSuccess();
+ });
+};
+
+/**
+ * 取消分配
+ * @param params
+ */
+export const cancelAllocate = (ids,handleSuccess) => {
+ return defHttp.get({ url: Api.cancelAllocate, params: { ids } }, { joinParamsToUrl: true }).then(() => {
+ handleSuccess();
+ });
+};
diff --git a/src/views/shipping/Pick.data.ts b/src/views/shipping/Pick.data.ts
index 090d551..569236f 100644
--- a/src/views/shipping/Pick.data.ts
+++ b/src/views/shipping/Pick.data.ts
@@ -7,21 +7,25 @@ export const columns: BasicColumn[] = [
title: '系统单号',
align: 'center',
dataIndex: 'orderNo',
+ width: '130px',
},
{
title: '外部单号',
align: 'center',
dataIndex: 'thirdOrderNo',
+ width: '130px',
},
{
title: '任务号',
align: 'center',
dataIndex: 'no',
+ width: '130px',
},
{
title: '订单状态',
align: 'center',
dataIndex: 'status_dictText',
+ width: '100px',
customRender: ({ text }) => {
//出库状态:1.已创建;2.部分分配;3.已分配;4.拣货中;5.拣货完成;6.已关闭;7.已取消。
const statusColorMap = {
@@ -41,38 +45,38 @@ export const columns: BasicColumn[] = [
title: '单据类型',
align: 'center',
dataIndex: 'orderType_dictText',
+ width: '100px',
},
{
title: '需求数量',
align: 'center',
dataIndex: 'orderQty',
+ width: '80px',
},
{
title: '分配数量',
align: 'center',
dataIndex: 'allocatedQty',
+ width: '80px',
},
{
title: '拣货数量',
align: 'center',
dataIndex: 'pickedQty',
+ width: '80px',
},
{
title: '外部仓库',
align: 'center',
dataIndex: 'whCode',
+ width: '80px',
},
{
- title: '客户代码',
+ title: '客户',
align: 'center',
dataIndex: 'customerCode',
},
- {
- title: '外部仓库',
- align: 'center',
- dataIndex: 'whCode',
- },
{
title: '订单日期',
align: 'center',
@@ -108,7 +112,7 @@ export const pickDetailColumns: JVxeColumn[] = [
key: 'unit',
type: JVxeTypes.select,
dictCode: 'package_unit',
- width: '130px',
+ width: '80px',
placeholder: '请选择${title}',
defaultValue: '托',
},
@@ -116,7 +120,7 @@ export const pickDetailColumns: JVxeColumn[] = [
title: '需求数量',
key: 'orderQty',
type: JVxeTypes.inputNumber,
- width: '130px',
+ width: '110px',
validateRules: [
{
required: true, // 必填
@@ -128,7 +132,7 @@ export const pickDetailColumns: JVxeColumn[] = [
title: '分配数量',
key: 'allocatedQty',
type: JVxeTypes.normal,
- width: '130px',
+ width: '80px',
defaultValue: '0',
disabled: true,
},
@@ -136,7 +140,7 @@ export const pickDetailColumns: JVxeColumn[] = [
title: '拣货数量',
key: 'pickedQty',
type: JVxeTypes.normal,
- width: '130px',
+ width: '80px',
placeholder: '请输入${title}',
defaultValue: '0',
disabled: true,
@@ -145,7 +149,7 @@ export const pickDetailColumns: JVxeColumn[] = [
title: '明细状态',
key: 'status',
type: JVxeTypes.normal,
- width: '120px',
+ width: '80px',
defaultValue: '1',
formatter: ({ cellValue }) => {
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
@@ -205,4 +209,10 @@ export const pickDetailColumns: JVxeColumn[] = [
placeholder: '请输入${title}',
defaultValue: null,
},
+ {
+ title: '返回报文',
+ key: 'resMessage',
+ type: JVxeTypes.normal,
+ width: '200px',
+ },
];
diff --git a/src/views/shipping/PickList.vue b/src/views/shipping/PickList.vue
index bf84c9a..eabb80a 100644
--- a/src/views/shipping/PickList.vue
+++ b/src/views/shipping/PickList.vue
@@ -56,6 +56,25 @@
新增
+
+ 分配
+
+
+ 取消分配
+
导出
导入
@@ -94,7 +113,7 @@
import { useModal } from '/@/components/Modal';
import PickModal from './components/PickModal.vue';
import { columns } from './Pick.data';
- import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Pick.api';
+ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, allocatePick, cancelAllocate } from './Pick.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
import { useUserStore } from '/@/store/modules/user';
@@ -102,6 +121,8 @@
import { JInput, JDictSelectTag } from '@/components/Form';
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
+ const allocate_loading = ref(false);
+ const cancel_loading = ref(false);
const fieldPickers = reactive({});
const formRef = ref();
const queryParam = reactive({});
@@ -156,7 +177,7 @@
},
});
- const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
+ const [registerTable, { reload }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
/**
* 新增事件
@@ -168,6 +189,67 @@
});
}
+ /**
+ * 分配事件
+ */
+ async function handleAllocatePick() {
+ if (selectedRowKeys.value.length === 0) {
+ return createMessage.error('请选择出库单');
+ }
+
+ // 选中的数据中状态有1、2、4 返回true,否则返回false
+ const validStatuses = [1, 2, 4];
+ const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
+ if (!allValidStatus) {
+ return createMessage.error('【已创建、 部分分配、部分拣货】状态的出库单才允许分配');
+ }
+ if (allocate_loading.value) {
+ return;
+ }
+ // 设置加载状态,防止重复提交
+ allocate_loading.value = true;
+ try {
+ await allocatePick(selectedRowKeys.value, handleSuccess);
+ } catch (e) {
+ console.error('分配失败:', e);
+ handleSuccess()
+ } finally {
+ // 重置加载状态
+ allocate_loading.value = false;
+
+ }
+ }
+
+ /**
+ * 取消分配
+ */
+ async function handleCancelAllocate() {
+ if (selectedRowKeys.value.length === 0) {
+ return createMessage.error('请选择出库单');
+ }
+
+ // 选中的数据中状态有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 (cancel_loading.value) {
+ return;
+ }
+ // 设置加载状态,防止重复提交
+ cancel_loading.value = true;
+ try {
+ await cancelAllocate(selectedRowKeys.value, handleSuccess);
+ } catch (e) {
+ console.error('取消失败:', e);
+ handleSuccess()
+ } finally {
+ // 重置加载状态
+ cancel_loading.value = false;
+ }
+ }
+
/**
* 编辑事件
*/