This commit is contained in:
‘huanghaiixia’
2026-03-04 16:31:44 +08:00
parent 90fd1c6f98
commit 03dc292d57
20 changed files with 971 additions and 97 deletions

View File

@ -1,5 +1,5 @@
<template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="ShipSchedule">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar>
@ -18,6 +18,12 @@
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
<template v-if="column.dataIndex === 'opsPurName'">
{{ record.opsPurId ? '已执行' : '未执行' }}
</template>
<template v-if="column.dataIndex === 'opsSalesName'">
{{ record.opsSalesId ? '已执行' : '未执行' }}
</template>
</template>
</BasicTable>
<ShipScheduleModal @register="registerModal" @success="handleSuccess" />
@ -51,7 +57,8 @@
import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import dayjs from 'dayjs';
import { getAllCom } from '/@/api/contract/ContractPurInt';
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
const { notification } = useMessage();
@ -81,17 +88,20 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,send: handleSend, opssales: handleOpssales, opspur: handleOpspur}
const { currentRoute } = useRouter();
const selectedKeys = ref<string[]>([]);
const router = useRouter();
const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal();
const formName='船期计划排布';
const [registerTable, { reload, }] = useTable({
const formName=currentRoute.value.meta?.title;
const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().add(1, 'year').endOf('year').format('YYYY-MM-DD')]);
const comIdList = ref([])
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
title: '' || (formName + '列表'),
api: getLngShipSchedulePage,
rowKey: 'id',
@ -100,12 +110,64 @@
rowProps: {
gutter: 16,
},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false,
schemas: [
{
field: 'dateEta',
label: '卸港ETA',
component: 'RangePicker',
defaultValue: defaultDate.value,
componentProps: {
format: 'YYYY-MM-DD',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
{
field: 'ssNo',
label: '船期编号',
component: 'Input',
},
{
field: 'staName',
label: '接收站',
component: 'Input',
},
{
field: 'comId',
label: '交易主体',
component: 'Select',
componentProps: {
showSearch: true,
optionFilterProp: 'label',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
options: comIdList,
placeholder: '请选择',
allowClear: true,
getPopupContainer: () => document.body,
},
}
],
fieldMapToTime: [['dateEta', ['startDate', 'endDate'], 'YYYY-MM-DD']],
showResetButton: true,
submitButtonOptions: {
text: '搜索',
onClick: () => {
clearSelectedRowKeys()
},
},
resetButtonOptions: {
text: '重置',
onClick: () => {
clearSelectedRowKeys()
},
},
},
immediate: false,
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
@ -116,10 +178,14 @@
striped: false,
actionColumn: {
width: 160,
width: 200,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: {
size: false,
@ -127,41 +193,20 @@
},
});
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
}
function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return;
}
const { processId, taskIds, schemaId } = record.workflowData || {};
if (taskIds && taskIds.length) {
router.push({
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
query: {
taskId: taskIds[0],
formName: formName,
formId:currentRoute.value.meta.formId
}
});
} else if (schemaId && !taskIds && processId) {
router.push({
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
query: {
readonly: 1,
taskId: '',
formName: formName,
formId:currentRoute.value.meta.formId
}
});
} else {
router.push({
path: '/form/ShipSchedule/' + record.id + '/viewForm',
query: {
router.push({
path: '/ship/ShipSchedule/createForm',
query: {
formPath: 'ship/ShipSchedule',
formName: formName,
formId:currentRoute.value.meta.formId
}
});
}
formName: '查看'+ formName,
formId:currentRoute.value.meta.formId,
id: record.id,
type: 'view'
}
});
}
function buttonClick(code) {
@ -180,10 +225,10 @@
});
} else {
router.push({
path: '/form/ShipSchedule/0/createForm',
path: '/ship/ShipSchedule/createForm',
query: {
formPath: 'ship/ShipSchedule',
formName: formName,
formName: '新建'+formName,
formId:currentRoute.value.meta.formId
}
});
@ -193,14 +238,31 @@
function handleEdit(record: Recordable) {
router.push({
path: '/form/ShipSchedule/' + record.id + '/updateForm',
path: '/ship/ShipSchedule/createForm',
query: {
formPath: 'ship/ShipSchedule',
formName: formName,
formId:currentRoute.value.meta.formId
formName: '编辑'+ formName,
formId:currentRoute.value.meta.formId,
id: record.id,
type: 'edit'
}
});
}
function handleOpspur () {
}
function handleOpssales () {
}
function handleSend () {
// if (!selectedKeys.value.length) {
// notification.warning({
// message: '提示',
// description: t('请选择需要发送的数据'),
// });
// return;
// }
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
@ -215,7 +277,7 @@
deleteLngShipSchedule(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
message: '提示',
description: t('删除成功!'),
});
});
@ -236,8 +298,15 @@
dbClickRow(record);
}
onMounted(() => {
onMounted(async() => {
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
let res = await getAllCom() || []
comIdList.value = res.map(v=> {
return {
label: v.shortName,
value: v.id
}
})
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
@ -295,6 +364,11 @@
}
};
</script>
<style lang="less">
.ShipSchedule .cusSearchForm .advanceRow> div:nth-of-type(3){
display: none;
}
</style>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
@ -305,4 +379,18 @@
.hide{
display: none !important;
}
:deep( .ant-col-8:nth-child(1)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
width: 80px !important;
}
:deep( .ant-col-8:nth-child(4)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(4) .ant-form-item-label) {
width: 80px !important;
}
</style>