更新胶料信息处理逻辑,优化字段描述及数据验证,增强系统稳定性和用户体验。

This commit is contained in:
geht
2026-05-20 19:06:58 +08:00
parent 9f37292eea
commit a10aae420a
17 changed files with 1731 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
/** 复用密炼PS编制接口仅查询已批准approve记录 */
export { list, getExportUrl } from '../mesXslMixerPsCompile/MesXslMixerPsCompile.api';

View File

@@ -0,0 +1,89 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
/** PS审批历史专用状态字典键值与原状态一致批准显示为正式发布 */
export const PS_HISTORY_STATUS_DICT = 'xslmes_mixer_ps_history_status';
const historyStatusTextMap: Record<string, string> = {
compile: '编制',
proofread: '校对',
audit: '审核',
approve: '正式发布',
};
export function renderHistoryStatus(text?: string) {
if (!text) {
return '';
}
return historyStatusTextMap[text] || text;
}
export const columns: BasicColumn[] = [
{ title: 'PS编码', align: 'center', dataIndex: 'psCode', width: 140 },
{ title: '类型', align: 'center', dataIndex: 'psType_dictText', width: 110 },
{ title: '发放日期', align: 'center', dataIndex: 'issueDate', width: 110 },
{ title: '发送部门', align: 'center', dataIndex: 'sendDeptId_dictText', width: 120 },
{ title: '收信部门', align: 'center', dataIndex: 'receiveDeptId_dictText', width: 160 },
{ title: '参照部门', align: 'center', dataIndex: 'referenceDeptId_dictText', width: 160 },
{ title: '标题', align: 'center', dataIndex: 'title', width: 180 },
{ title: '担当', align: 'center', dataIndex: 'responsiblePerson', width: 90 },
{
title: '状态',
align: 'center',
dataIndex: 'status',
width: 100,
customRender: ({ text }) => renderHistoryStatus(text),
},
{
title: '编制人',
align: 'center',
dataIndex: 'compileBy',
width: 100,
customRender: ({ record }) => record?.createBy_dictText || record?.createBy || '',
},
{ title: '校对人', align: 'center', dataIndex: 'proofreadBy', width: 100 },
{ title: '校对时间', align: 'center', dataIndex: 'proofreadTime', width: 165 },
{ title: '审核人', align: 'center', dataIndex: 'auditBy', width: 100 },
{ title: '审核时间', align: 'center', dataIndex: 'auditTime', width: 165 },
{ title: '发布人', align: 'center', dataIndex: 'approveBy', width: 100 },
{ title: '发布时间', align: 'center', dataIndex: 'approveTime', width: 165 },
{ title: '所属工厂', align: 'center', dataIndex: 'factoryName', width: 120, defaultHidden: true },
{ title: '施工代号', align: 'center', dataIndex: 'constructionCode_dictText', width: 110, defaultHidden: true },
{ title: '目的', align: 'center', dataIndex: 'purpose', width: 160, defaultHidden: true },
{ title: '依据', align: 'center', dataIndex: 'basis', width: 160, defaultHidden: true },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 165, defaultHidden: true },
];
export const searchFormSchema: FormSchema[] = [
{
label: '开始日期',
field: 'issueDate_begin',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期起' },
colProps: { span: 6 },
},
{
label: '结束日期',
field: 'issueDate_end',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', placeholder: '发放日期止' },
colProps: { span: 6 },
},
{ label: 'PS编码', field: 'psCode', component: 'JInput', colProps: { span: 6 } },
{ label: '标题', field: 'title', component: 'JInput', colProps: { span: 6 } },
{
label: '类型',
field: 'psType',
component: 'JDictSelectTag',
componentProps: { dictCode: 'xslmes_ps_belong' },
colProps: { span: 6 },
},
];
export const superQuerySchema = {
psCode: { title: 'PS编码', order: 0, view: 'text' },
psType: { title: '类型', order: 1, view: 'list', dictCode: 'xslmes_ps_belong' },
constructionCode: { title: '施工代号', order: 2, view: 'list', dictCode: 'xslmes_construction_code' },
issueDate: { title: '发放日期', order: 3, view: 'date' },
title: { title: '标题', order: 4, view: 'text' },
responsiblePerson: { title: '担当', order: 5, view: 'text' },
};

View File

@@ -0,0 +1,95 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_mixer_ps_history:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
]"
/>
</template>
</BasicTable>
<MesXslMixerPsCompileModal @register="registerModal" />
</div>
</template>
<script lang="ts" name="xslmes-mesXslMixerPsHistory" setup>
import { reactive } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslMixerPsCompileModal from '../mesXslMixerPsCompile/components/MesXslMixerPsCompileModal.vue';
import { PS_HISTORY_STATUS_DICT, columns, searchFormSchema, superQuerySchema } from './MesXslMixerPsHistory.data';
import { list, getExportUrl } from './MesXslMixerPsHistory.api';
const APPROVED_STATUS = 'approve';
const queryParam = reactive<any>({ status: APPROVED_STATUS });
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: 'PS审批历史',
api: list,
columns,
canResize: true,
tableSetting: { cacheKey: 'mesXslMixerPsHistory_v20260520' },
formConfig: {
schemas: searchFormSchema,
labelWidth: 90,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
actionColumn: {
title: '操作',
dataIndex: 'action',
width: 100,
fixed: 'right',
slots: { customRender: 'action' },
},
beforeFetch: (params) => {
params.status = APPROVED_STATUS;
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'PS审批历史',
url: getExportUrl,
params: queryParam,
},
});
const [registerTable, { reload }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
function handleSuperQuery(params) {
Object.keys(params).forEach((k) => {
queryParam[k] = params[k];
});
queryParam.status = APPROVED_STATUS;
reload();
}
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
modalTitle: 'PS审批历史详情',
statusDictCode: PS_HISTORY_STATUS_DICT,
});
}
</script>