From b576044b95ffb06de503bbd649f7f3e075a2203a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Tue, 10 Mar 2026 11:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ship/MeaPurInt/index.ts | 3 +- src/components/common/OpsPurIntListModal.vue | 136 +++++++ .../common/shipScheduleListModal.vue | 4 +- src/router/routes/basic.ts | 8 + src/views/ship/MeaPurInt/components/config.ts | 181 +++------ .../ship/MeaPurInt/components/createForm.vue | 353 ++++++++++++++++++ src/views/ship/MeaPurInt/index.vue | 95 ++--- .../ship/OpsPurInt/components/createForm.vue | 2 +- .../OpsSalesInt/components/createForm.vue | 2 +- 9 files changed, 594 insertions(+), 190 deletions(-) create mode 100644 src/components/common/OpsPurIntListModal.vue create mode 100644 src/views/ship/MeaPurInt/components/createForm.vue diff --git a/src/api/ship/MeaPurInt/index.ts b/src/api/ship/MeaPurInt/index.ts index 60295b8..279fdb2 100644 --- a/src/api/ship/MeaPurInt/index.ts +++ b/src/api/ship/MeaPurInt/index.ts @@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/ship/meaPurInt/page', + // Page = '/ship/meaPurInt/page', + Page = '/magic-api/ship/meaPurIntPageList', List = '/ship/meaPurInt/list', Info = '/ship/meaPurInt/info', LngMeaPurInt = '/ship/meaPurInt', diff --git a/src/components/common/OpsPurIntListModal.vue b/src/components/common/OpsPurIntListModal.vue new file mode 100644 index 0000000..f3db0e6 --- /dev/null +++ b/src/components/common/OpsPurIntListModal.vue @@ -0,0 +1,136 @@ + + + + diff --git a/src/components/common/shipScheduleListModal.vue b/src/components/common/shipScheduleListModal.vue index 86f50ae..2b6f106 100644 --- a/src/components/common/shipScheduleListModal.vue +++ b/src/components/common/shipScheduleListModal.vue @@ -49,7 +49,7 @@ const selectedKeys = ref([]); const selectedValues = ref([]); const props = defineProps({ - selectType: { type: String, default: 'checkbox' }, + selectType: { type: String, default: 'radio' }, }); const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { @@ -93,7 +93,7 @@ selectedKeys.value = rowKeys; selectedValues.value = e } - const getTitle = computed(() => (!unref(isUpdate) ? t('船期计划列表列表') : t(''))); + const getTitle = computed(() => (!unref(isUpdate) ? t('船期计划列表') : t(''))); async function handleSubmit() { if (!selectedValues.value.length) { diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index e32005e..a248ab2 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -334,6 +334,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{ title: (route) => route.query.formName } }, + { + path: '/ship/MeaPurInt/createForm', + name: 'MeaPurInt', + component: () => import('/@/views/ship/MeaPurInt/components/createForm.vue'), + meta: { + title: (route) => route.query.formName + } + }, ] diff --git a/src/views/ship/MeaPurInt/components/config.ts b/src/views/ship/MeaPurInt/components/config.ts index 52a151b..26cda34 100644 --- a/src/views/ship/MeaPurInt/components/config.ts +++ b/src/views/ship/MeaPurInt/components/config.ts @@ -10,108 +10,65 @@ export const searchFormSchema: FormSchema[] = [ field: 'dateMea', label: '计量时间', component: 'Input', - }, - { - field: 'typeCode', - label: '计量类型', - component: 'Input', - }, - { - field: 'inspName', - label: '商检公司', - component: 'Input', - }, - { - field: 'id', - label: 'id', - component: 'Input', - }, - { - field: 'qtyMmbtu', - label: '热值(MMBtu)', - component: 'Input', - }, - { - field: 'qtyGj', - label: '热值(GJ)', - component: 'Input', - }, - { - field: 'qtyTon', - label: '重量(吨)', - component: 'Input', - }, - { - field: 'qtyM3L', - label: '液态体积(方)', - component: 'Input', - }, - { - field: 'qtyM3', - label: '气态体积(方)', - component: 'Input', - }, - { - field: 'rateTonM3L', - label: '密度(吨/液态方)', - component: 'Input', - }, - { - field: 'rateTonGj', - label: '热值比(吨/GJ)', - component: 'Input', - }, - { - field: 'rateM3Gj', - label: '热值比(气态方/GJ)', - component: 'Input', - }, - { - field: 'rateTonM3', - label: '气化率(吨/气态方)', - component: 'Input', - }, - { - field: 'note', - label: '备注', - component: 'Input', - }, + } ]; export const columns: BasicColumn[] = [ { - dataIndex: 'id', - title: 'id', + dataIndex: 'ssNo', + title: '船期计划编号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, + { + dataIndex: 'kName', + title: '合同', + componentType: 'input', + align: 'left', + width: 150, + sorter: true, + }, + { + dataIndex: 'suName', + title: '供应商', + componentType: 'input', + align: 'left', + width: 150, + sorter: true, + }, + { + dataIndex: 'staName', + title: '接收站', + componentType: 'input', + align: 'left', + width: 120, + sorter: true, + }, + { + dataIndex: 'typeName', + title: '计量类型', + componentType: 'input', + align: 'left', + width: 100, + sorter: true, + }, { dataIndex: 'dateMea', title: '计量时间', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, - - { - dataIndex: 'typeCode', - title: '计量类型', - componentType: 'input', - align: 'left', - - sorter: true, - }, - { dataIndex: 'qtyMmbtu', title: '热值(MMBtu)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -120,7 +77,7 @@ export const columns: BasicColumn[] = [ title: '热值(GJ)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -129,34 +86,7 @@ export const columns: BasicColumn[] = [ title: '重量(吨)', componentType: 'input', align: 'left', - - sorter: true, - }, - - { - dataIndex: 'qtyM3L', - title: '液态体积(方)', - componentType: 'input', - align: 'left', - - sorter: true, - }, - - { - dataIndex: 'qtyM3', - title: '气态体积(方)', - componentType: 'input', - align: 'left', - - sorter: true, - }, - - { - dataIndex: 'rateTonM3L', - title: '密度(吨/液态方)', - componentType: 'input', - align: 'left', - + width: 120, sorter: true, }, @@ -165,45 +95,20 @@ export const columns: BasicColumn[] = [ title: '热值比(吨/GJ)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, { dataIndex: 'rateM3Gj', - title: '热值比(气态方/GJ)', + title: '热值比(方/GJ)', componentType: 'input', align: 'left', - sorter: true, + width: 120, }, - { - dataIndex: 'rateTonM3', - title: '气化率(吨/气态方)', - componentType: 'input', - align: 'left', - sorter: true, - }, - - { - dataIndex: 'inspName', - title: '商检公司', - componentType: 'input', - align: 'left', - - sorter: true, - }, - - { - dataIndex: 'note', - title: '备注', - componentType: 'input', - align: 'left', - - sorter: true, - }, ]; //表单事件 export const formEventConfigs = { diff --git a/src/views/ship/MeaPurInt/components/createForm.vue b/src/views/ship/MeaPurInt/components/createForm.vue new file mode 100644 index 0000000..cb0d791 --- /dev/null +++ b/src/views/ship/MeaPurInt/components/createForm.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/src/views/ship/MeaPurInt/index.vue b/src/views/ship/MeaPurInt/index.vue index 74d250e..6c245d9 100644 --- a/src/views/ship/MeaPurInt/index.vue +++ b/src/views/ship/MeaPurInt/index.vue @@ -29,7 +29,7 @@ const logId = ref('') const logPath = ref('/ship/meaPurInt/datalog'); import { DataLog } from '/@/components/pcitc'; - import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue'; + import { ref, computed, onMounted, onUnmounted, createVNode, watch} from 'vue'; import { Modal } from 'ant-design-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; @@ -50,7 +50,7 @@ import useEventBus from '/@/hooks/event/useEventBus'; import { cloneDeep } from 'lodash-es'; import dayjs from 'dayjs'; - + import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat'; const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { notification } = useMessage(); @@ -65,7 +65,7 @@ const tableRef = ref(); //所有按钮 - const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]); + const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true}]); //展示在列表内的按钮 const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']); const buttonConfigs = computed(()=>{ @@ -80,8 +80,8 @@ return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); }); - const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,delete : handleDelete,} - + const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,delete : handleDelete,datalog : handleDatalog} + const tableData = ref([]) const { currentRoute } = useRouter(); const router = useRouter(); const formIdComputedRef = ref(); @@ -90,8 +90,8 @@ schemaIdComputedRef.value = currentRoute.value.meta.schemaId const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]); const [registerModal, { openModal }] = useModal(); - const formName='国际采购计量'; - const [registerTable, { reload, }] = useTable({ + const formName=currentRoute.value.meta?.title + const [registerTable, { reload, setTableData }] = useTable({ title: '' || (formName + '列表'), api: getLngMeaPurIntPage, rowKey: 'id', @@ -102,7 +102,7 @@ }, schemas: [ { - field: 'dateEta', + field: 'dateMea', label: '计量日期', component: 'RangePicker', defaultValue: defaultDate.value, @@ -124,14 +124,15 @@ }, ], - fieldMapToTime: [['dateEta', ['startDate', 'endDate'], 'YYYY-MM-DD']], + fieldMapToTime: [['dateMea', ['startDate', 'endDate'], 'YYYY-MM-DD']], showResetButton: true, }, immediate: false, beforeFetch: (params) => { - return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; + return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit }; }, afterFetch: (res) => { + tableData.value = res || [] tableRef.value.setToolBarWidth(); }, @@ -140,7 +141,7 @@ striped: false, actionColumn: { - width: 160, + width: 140, title: '操作', dataIndex: 'action', slots: { customRender: 'action' }, @@ -151,41 +152,39 @@ }, }); - - function dbClickRow(record) { - if (!actionButtonConfig?.value.some(element => element.code == 'view')) { - return; + watch( + () => tableData.value, + (val) => { + if (val) { + let arr = DataFormat.format(val, [ + FormatOption.createQty('qtyMmbtu'), + FormatOption.createQty('qtyGj'), + FormatOption.createQty('qtyTon'), + FormatOption.createQty('rateTonGj'), + FormatOption.createQty('rateM3Gj'), + + ]); + if (arr.length) { + setTableData(arr) + } + } + }, + { + immediate: true, + deep: true, } - 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/MeaPurInt/' + record.id + '/viewForm', - query: { + ); + function dbClickRow(record) { + router.push({ + path: '/ship/MeaPurInt/createForm', + query: { formPath: 'ship/MeaPurInt', formName: formName, - formId:currentRoute.value.meta.formId - } - }); - } + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'view' + } + }); } function buttonClick(code) { @@ -204,7 +203,7 @@ }); } else { router.push({ - path: '/form/MeaPurInt/0/createForm', + path: '/ship/MeaPurInt/createForm', query: { formPath: 'ship/MeaPurInt', formName: formName, @@ -217,11 +216,13 @@ function handleEdit(record: Recordable) { router.push({ - path: '/form/MeaPurInt/' + record.id + '/updateForm', + path: '/ship/MeaPurInt/createForm', query: { formPath: 'ship/MeaPurInt', formName: formName, - formId:currentRoute.value.meta.formId + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'edit' } }); } @@ -239,7 +240,7 @@ deleteLngMeaPurInt(ids).then((_) => { handleSuccess(); notification.success({ - message: 'Tip', + message: '提示', description: t('删除成功!'), }); }); diff --git a/src/views/ship/OpsPurInt/components/createForm.vue b/src/views/ship/OpsPurInt/components/createForm.vue index f11a328..be731e8 100644 --- a/src/views/ship/OpsPurInt/components/createForm.vue +++ b/src/views/ship/OpsPurInt/components/createForm.vue @@ -17,7 +17,7 @@ - + diff --git a/src/views/ship/OpsSalesInt/components/createForm.vue b/src/views/ship/OpsSalesInt/components/createForm.vue index 4347456..35236d9 100644 --- a/src/views/ship/OpsSalesInt/components/createForm.vue +++ b/src/views/ship/OpsSalesInt/components/createForm.vue @@ -17,7 +17,7 @@ - +