2025-11-06 17:55:06 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="p-2">
|
|
|
|
|
<!--查询区域-->
|
|
|
|
|
<div class="jeecg-basic-table-form-container">
|
2026-01-06 20:15:43 +08:00
|
|
|
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
|
|
|
<a-row :gutter="24">
|
|
|
|
|
<a-col :lg="6">
|
|
|
|
|
<a-form-item name="id">
|
|
|
|
|
<template #label><span title="任务ID">任务ID</span></template>
|
|
|
|
|
<a-input v-model:value="queryParam.id" :placeholder="'请输入任务ID'" allow-clear />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :lg="6">
|
|
|
|
|
<a-form-item name="carrierCode">
|
|
|
|
|
<template #label><span title="容器">容器</span></template>
|
|
|
|
|
<StockSelect v-model:value="queryParam.carrierCode" :return-value="'carrierCode'" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :lg="6">
|
|
|
|
|
<a-form-item name="createTime">
|
|
|
|
|
<template #label><span title="创建日期">创建日期</span></template>
|
|
|
|
|
<JRangeDate v-model:value="queryParam.createTime" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
|
|
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
|
|
|
|
<a-col :lg="6">
|
|
|
|
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
|
|
|
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
|
|
|
|
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
|
|
|
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
|
|
|
|
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
|
|
|
|
</a>
|
|
|
|
|
</a-col>
|
|
|
|
|
</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row :gutter="24">
|
|
|
|
|
<a-col :lg="6">
|
|
|
|
|
<a-form-item v-if="toggleSearchStatus" name="status_MultiString">
|
|
|
|
|
<template #label><span title="状态">状态</span></template>
|
|
|
|
|
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="asn_status" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
2025-11-06 17:55:06 +08:00
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
<!--引用表格-->
|
|
|
|
|
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
|
|
|
<!--插槽:table标题-->
|
|
|
|
|
<template #tableTitle>
|
2025-11-09 19:36:23 +08:00
|
|
|
<a-button type="primary" v-auth="'agvTask:data_agv_task:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增 </a-button>
|
|
|
|
|
<a-button type="primary" v-auth="'agvTask:data_agv_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
|
|
|
|
导出
|
|
|
|
|
</a-button>
|
|
|
|
|
<j-upload-button
|
|
|
|
|
type="primary"
|
|
|
|
|
v-auth="'agvTask:data_agv_task:importExcel'"
|
|
|
|
|
v-show="false"
|
|
|
|
|
preIcon="ant-design:import-outlined"
|
|
|
|
|
@click="onImportXls"
|
|
|
|
|
>导入
|
|
|
|
|
</j-upload-button>
|
2025-11-06 17:55:06 +08:00
|
|
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
|
|
<template #overlay>
|
|
|
|
|
<a-menu>
|
|
|
|
|
<a-menu-item key="1" @click="batchHandleDelete">
|
|
|
|
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
|
|
|
删除
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
</a-menu>
|
|
|
|
|
</template>
|
2025-11-09 19:36:23 +08:00
|
|
|
<a-button v-auth="'agvTask:data_agv_task:deleteBatch'"
|
|
|
|
|
>批量操作
|
2025-11-06 17:55:06 +08:00
|
|
|
<Icon icon="mdi:chevron-down"></Icon>
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
<!--操作栏-->
|
|
|
|
|
<template #action="{ record }">
|
2025-11-09 19:36:23 +08:00
|
|
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
2025-11-06 17:55:06 +08:00
|
|
|
</template>
|
2025-11-09 19:36:23 +08:00
|
|
|
<template v-slot:bodyCell="{ column, record, index, text }"></template>
|
2025-11-06 17:55:06 +08:00
|
|
|
</BasicTable>
|
|
|
|
|
<!-- 表单区域 -->
|
2025-11-09 19:36:23 +08:00
|
|
|
<TesAgvModal ref="registerModal" @success="handleSuccess"></TesAgvModal>
|
2025-12-05 18:02:05 +08:00
|
|
|
<ResendAgvModal ref="registerResendModal" @success="handleSuccess"></ResendAgvModal>
|
2025-11-06 17:55:06 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2025-11-09 19:36:23 +08:00
|
|
|
<script lang="ts" name="agvTask" setup>
|
2025-11-06 17:55:06 +08:00
|
|
|
import { ref, reactive } from 'vue';
|
2025-11-09 19:36:23 +08:00
|
|
|
import { BasicTable, TableAction } from '/@/components/Table';
|
2025-11-06 17:55:06 +08:00
|
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
2025-11-09 19:36:23 +08:00
|
|
|
import { columns } from './TesAgv.data';
|
2025-12-05 18:02:05 +08:00
|
|
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, callBackTask, cancelTes } from './AgvTask.api';
|
2025-11-09 19:36:23 +08:00
|
|
|
import TesAgvModal from './components/TesAgvModal.vue';
|
2025-12-05 18:02:05 +08:00
|
|
|
import ResendAgvModal from './components/ResendAgvModal.vue';
|
2025-11-06 17:55:06 +08:00
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
import { getDateByPicker } from '/@/utils';
|
2026-01-06 20:15:43 +08:00
|
|
|
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
|
|
|
|
|
import JSelectMultiple from '../../components/Form/src/jeecg/components/JSelectMultiple.vue';
|
|
|
|
|
import StockSelect from '@/views/base/stock/components/StockSelect.vue';
|
|
|
|
|
import { JInput } from '@/components/Form';
|
2025-11-06 17:55:06 +08:00
|
|
|
|
2025-11-09 19:36:23 +08:00
|
|
|
const fieldPickers = reactive({});
|
2025-11-06 17:55:06 +08:00
|
|
|
|
|
|
|
|
const formRef = ref();
|
2025-11-09 19:36:23 +08:00
|
|
|
const queryParam = reactive<any>({
|
|
|
|
|
agvVendor: 'TES',
|
|
|
|
|
});
|
2025-11-06 17:55:06 +08:00
|
|
|
const registerModal = ref();
|
2025-11-28 16:34:24 +08:00
|
|
|
const registerResendModal = ref();
|
2025-11-06 17:55:06 +08:00
|
|
|
const { createMessage } = useMessage();
|
|
|
|
|
//注册table数据
|
2025-11-28 16:34:24 +08:00
|
|
|
const { tableContext, onExportXls, onImportXls } = useListPage({
|
2025-11-06 17:55:06 +08:00
|
|
|
tableProps: {
|
2025-11-09 19:36:23 +08:00
|
|
|
title: 'TES任务表',
|
2025-11-06 17:55:06 +08:00
|
|
|
api: list,
|
|
|
|
|
columns,
|
2025-11-09 19:36:23 +08:00
|
|
|
canResize: true,
|
2025-11-06 17:55:06 +08:00
|
|
|
useSearchForm: false,
|
|
|
|
|
actionColumn: {
|
|
|
|
|
width: 120,
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
},
|
|
|
|
|
beforeFetch: async (params) => {
|
2026-01-06 20:15:43 +08:00
|
|
|
// 创建新的查询参数对象,避免修改原始对象
|
|
|
|
|
const newQueryParam = { ...queryParam };
|
|
|
|
|
|
|
|
|
|
// 处理日期范围
|
|
|
|
|
if (newQueryParam.createTime) {
|
|
|
|
|
try {
|
|
|
|
|
const [begin, end] = newQueryParam.createTime.split(',');
|
|
|
|
|
if (begin !== undefined) newQueryParam.createTime_begin = begin;
|
|
|
|
|
if (end !== undefined) newQueryParam.createTime_end = end;
|
|
|
|
|
delete newQueryParam.createTime;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('日期范围处理错误:', error);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-06 17:55:06 +08:00
|
|
|
for (let key in fieldPickers) {
|
2026-01-06 20:15:43 +08:00
|
|
|
if (newQueryParam[key] && fieldPickers[key]) {
|
|
|
|
|
newQueryParam[key] = getDateByPicker(newQueryParam[key], fieldPickers[key]);
|
2025-11-06 17:55:06 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-01-06 20:15:43 +08:00
|
|
|
return Object.assign(params, newQueryParam);
|
2025-11-06 17:55:06 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
exportConfig: {
|
2025-11-09 19:36:23 +08:00
|
|
|
name: 'AGV任务表',
|
2025-11-06 17:55:06 +08:00
|
|
|
url: getExportUrl,
|
|
|
|
|
params: queryParam,
|
|
|
|
|
},
|
2025-11-09 19:36:23 +08:00
|
|
|
importConfig: {
|
|
|
|
|
url: getImportUrl,
|
|
|
|
|
success: handleSuccess,
|
|
|
|
|
},
|
2025-11-06 17:55:06 +08:00
|
|
|
});
|
2025-11-28 16:34:24 +08:00
|
|
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
2025-11-06 17:55:06 +08:00
|
|
|
const labelCol = reactive({
|
2025-11-09 19:36:23 +08:00
|
|
|
xs: 24,
|
|
|
|
|
sm: 4,
|
|
|
|
|
xl: 6,
|
|
|
|
|
xxl: 4,
|
2025-11-06 17:55:06 +08:00
|
|
|
});
|
|
|
|
|
const wrapperCol = reactive({
|
|
|
|
|
xs: 24,
|
|
|
|
|
sm: 20,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增事件
|
|
|
|
|
*/
|
|
|
|
|
function handleAdd() {
|
|
|
|
|
registerModal.value.disableSubmit = false;
|
|
|
|
|
registerModal.value.add();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 编辑事件
|
|
|
|
|
*/
|
|
|
|
|
function handleEdit(record: Recordable) {
|
|
|
|
|
registerModal.value.disableSubmit = false;
|
|
|
|
|
registerModal.value.edit(record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 详情
|
|
|
|
|
*/
|
2025-12-05 18:02:05 +08:00
|
|
|
/* function handleDetail(record: Recordable) {
|
2025-11-06 17:55:06 +08:00
|
|
|
registerModal.value.disableSubmit = true;
|
|
|
|
|
registerModal.value.edit(record);
|
2025-12-05 18:02:05 +08:00
|
|
|
}*/
|
2025-11-06 17:55:06 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除事件
|
|
|
|
|
*/
|
|
|
|
|
async function handleDelete(record) {
|
|
|
|
|
await deleteOne({ id: record.id }, handleSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除事件
|
|
|
|
|
*/
|
|
|
|
|
async function batchHandleDelete() {
|
|
|
|
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-13 16:58:05 +08:00
|
|
|
/**
|
|
|
|
|
* 任务完成事件
|
|
|
|
|
*/
|
|
|
|
|
async function hanndleComplete(record) {
|
|
|
|
|
const params = {
|
|
|
|
|
messageType: 10,
|
|
|
|
|
content: {
|
|
|
|
|
bizID: record.id,
|
|
|
|
|
status: 4,
|
|
|
|
|
podID: record.carrierCode,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const res = await callBackTask(params);
|
|
|
|
|
if (res && res.returnCode === 0) {
|
|
|
|
|
createMessage.success('操作成功');
|
2025-12-05 18:02:05 +08:00
|
|
|
handleSuccess();
|
2025-11-13 16:58:05 +08:00
|
|
|
} else {
|
2025-11-28 16:34:24 +08:00
|
|
|
createMessage.error(res.returnMsg || '任务处理失败');
|
2025-11-13 16:58:05 +08:00
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
createMessage.error('请求异常: ' + error.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-28 16:34:24 +08:00
|
|
|
/**
|
|
|
|
|
* 任务取消事件
|
|
|
|
|
*/
|
|
|
|
|
async function hanndleCancel(record) {
|
|
|
|
|
const params = {
|
|
|
|
|
taskID: record.id,
|
|
|
|
|
};
|
|
|
|
|
try {
|
2025-12-05 18:02:05 +08:00
|
|
|
const res = await cancelTes(params);
|
2025-11-28 16:34:24 +08:00
|
|
|
if (res && res.returnCode === 0) {
|
|
|
|
|
createMessage.success('操作成功');
|
2025-12-05 18:02:05 +08:00
|
|
|
handleSuccess();
|
2025-11-28 16:34:24 +08:00
|
|
|
} else {
|
|
|
|
|
createMessage.error(res.returnMsg || '任务处理失败');
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
createMessage.error('请求异常: ' + error.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 任务重发
|
|
|
|
|
*/
|
|
|
|
|
function hanndleResend(record) {
|
|
|
|
|
registerResendModal.value.disableSubmit = false;
|
|
|
|
|
registerResendModal.value.resend(record);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-06 17:55:06 +08:00
|
|
|
/**
|
|
|
|
|
* 成功回调
|
|
|
|
|
*/
|
|
|
|
|
function handleSuccess() {
|
|
|
|
|
(selectedRowKeys.value = []) && reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 操作栏
|
|
|
|
|
*/
|
|
|
|
|
function getTableAction(record) {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
label: '编辑',
|
|
|
|
|
onClick: handleEdit.bind(null, record),
|
2025-11-09 19:36:23 +08:00
|
|
|
auth: 'agvTask:data_agv_task:edit',
|
2025-11-06 17:55:06 +08:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下拉操作栏
|
|
|
|
|
*/
|
|
|
|
|
function getDropDownAction(record) {
|
|
|
|
|
return [
|
2025-12-05 18:02:05 +08:00
|
|
|
/* {
|
2025-11-13 16:58:05 +08:00
|
|
|
label: '任务详情',
|
2025-11-06 17:55:06 +08:00
|
|
|
onClick: handleDetail.bind(null, record),
|
2025-12-05 18:02:05 +08:00
|
|
|
},*/
|
2025-11-09 19:36:23 +08:00
|
|
|
{
|
2025-11-13 16:58:05 +08:00
|
|
|
label: '任务完成',
|
|
|
|
|
popConfirm: {
|
|
|
|
|
title: '是否确认完成?',
|
|
|
|
|
confirm: hanndleComplete.bind(null, record),
|
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
},
|
|
|
|
|
auth: 'agvTask:data_agv_task:edit',
|
2025-11-28 16:34:24 +08:00
|
|
|
disabled: record.status === 4 || record.status === 1 || record.status === 5,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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,
|
2025-11-13 16:58:05 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-11-28 16:34:24 +08:00
|
|
|
label: '任务删除',
|
2025-11-06 17:55:06 +08:00
|
|
|
popConfirm: {
|
2025-11-13 16:58:05 +08:00
|
|
|
title: '是否确认删除?',
|
2025-11-06 17:55:06 +08:00
|
|
|
confirm: handleDelete.bind(null, record),
|
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
},
|
2025-11-09 19:36:23 +08:00
|
|
|
auth: 'agvTask:data_agv_task:delete',
|
2025-11-13 16:58:05 +08:00
|
|
|
disabled: record.status != 1,
|
2025-11-09 19:36:23 +08:00
|
|
|
},
|
|
|
|
|
];
|
2025-11-06 17:55:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询
|
|
|
|
|
*/
|
|
|
|
|
function searchQuery() {
|
|
|
|
|
reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重置
|
|
|
|
|
*/
|
|
|
|
|
function searchReset() {
|
|
|
|
|
formRef.value.resetFields();
|
|
|
|
|
selectedRowKeys.value = [];
|
|
|
|
|
//刷新数据
|
|
|
|
|
reload();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.jeecg-basic-table-form-container {
|
|
|
|
|
padding: 0;
|
2025-11-09 19:36:23 +08:00
|
|
|
|
2025-11-06 17:55:06 +08:00
|
|
|
.table-page-search-submitButtons {
|
|
|
|
|
display: block;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
2025-11-09 19:36:23 +08:00
|
|
|
|
|
|
|
|
.query-group-cust {
|
2025-11-06 17:55:06 +08:00
|
|
|
min-width: 100px !important;
|
|
|
|
|
}
|
2025-11-09 19:36:23 +08:00
|
|
|
|
|
|
|
|
.query-group-split-cust {
|
2025-11-06 17:55:06 +08:00
|
|
|
width: 30px;
|
|
|
|
|
display: inline-block;
|
2025-11-09 19:36:23 +08:00
|
|
|
text-align: center;
|
2025-11-06 17:55:06 +08:00
|
|
|
}
|
2025-11-09 19:36:23 +08:00
|
|
|
|
|
|
|
|
.ant-form-item:not(.ant-form-item-with-help) {
|
2025-11-06 17:55:06 +08:00
|
|
|
margin-bottom: 16px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
}
|
2025-11-09 19:36:23 +08:00
|
|
|
|
|
|
|
|
:deep(.ant-picker),
|
|
|
|
|
:deep(.ant-input-number) {
|
2025-11-06 17:55:06 +08:00
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|