Commit 64b77a7b by 张恒

feat(scjh): 更新生产计划模块的搜索表单和表格配置

- 添加计划编号搜索字段并启用客户选择功能
- 集成客户API数据源支持多选和搜索功能
- 调整表格列配置显示计划编号、客户和交付日期
- 修正占位符文本错误并调整字段必填验证规则
- 将子表单重构为标签页结构提升用户体验
- 优化产品列表组件的编辑和删除功能
- 更新工作流权限配置以匹配新的字段结构
parent a4d70719
...@@ -6,9 +6,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; ...@@ -6,9 +6,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesProductionPlanPageParams extends BasicPageParams { export interface MesProductionPlanPageParams extends BasicPageParams {
jhbh: string; jhbh: string;
ddbh: string; kh: string;
ssgs: string; ywzz: string;
zt: string; zt: string;
} }
...@@ -19,13 +19,15 @@ export interface MesProductionPlanPageParams extends BasicPageParams { ...@@ -19,13 +19,15 @@ export interface MesProductionPlanPageParams extends BasicPageParams {
export interface MesProductionPlanPageModel { export interface MesProductionPlanPageModel {
id: string; id: string;
ddbh: string;
jhbh: string; jhbh: string;
ddbh: string;
kh: string; kh: string;
ssgs: string; jhjhrq: string;
ywzz: string;
zt: string; zt: string;
} }
...@@ -107,6 +109,8 @@ export interface MesProductionPlanProductModel { ...@@ -107,6 +109,8 @@ export interface MesProductionPlanProductModel {
cpbh: string; cpbh: string;
cpmc: string;
nbdm: string; nbdm: string;
hjzt: string; hjzt: string;
......
...@@ -222,3 +222,4 @@ ...@@ -222,3 +222,4 @@
}); });
</script> </script>
\ No newline at end of file
...@@ -33,7 +33,7 @@ export const permissionList = [ ...@@ -33,7 +33,7 @@ export const permissionList = [
defaultValue: '', defaultValue: '',
}, },
{ {
required: true, required: false,
view: true, view: true,
edit: true, edit: true,
disabled: false, disabled: false,
...@@ -169,7 +169,7 @@ export const permissionList = [ ...@@ -169,7 +169,7 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProductionPlanProductList', tableName: 'mesProductionPlanProductList',
fieldName: '物料编号', fieldName: '编号',
fieldId: 'cpbh', fieldId: 'cpbh',
type: 'Input', type: 'Input',
key: 'cd0038f42bc64c189b3821f0e2061321', key: 'cd0038f42bc64c189b3821f0e2061321',
...@@ -184,6 +184,21 @@ export const permissionList = [ ...@@ -184,6 +184,21 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesProductionPlanProductList', tableName: 'mesProductionPlanProductList',
fieldName: '名称',
fieldId: 'cpmc',
type: 'Input',
key: 'c8f88cafd17f4655bfbe4643ffe58c9c',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '内部代码', fieldName: '内部代码',
fieldId: 'nbdm', fieldId: 'nbdm',
type: 'Input', type: 'Input',
......
<template> <template>
<ResizePageWrapper :hasLeft="false"> <ResizePageWrapper :hasLeft="false">
<template #resizeRight> <template #resizeRight>
...@@ -26,28 +27,45 @@ ...@@ -26,28 +27,45 @@
</template> </template>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<TableAction
<TableAction
:actions="getLessActions(record)" :actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)" :dropDownActions="getMoreActions(record)"
/> />
</template> </template>
<template v-else-if="column.dataIndex && column?.listStyle"> <template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{ <span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value') getValue(record, column, 'value')
}}</span> }}</span>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
</template> </template>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</ResizePageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, provide, Ref, createVNode } from 'vue'; import { ref, computed,provide,Ref, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
...@@ -60,20 +78,46 @@ ...@@ -60,20 +78,46 @@
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle'; //列表样式配置 import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import ScjhModal from './components/ScjhModal.vue'; import ScjhModal from './components/ScjhModal.vue';
import { searchFormSchema, columns } from './components/config';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock'; import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({}); const pageParamsInfo = ref<any>({});
...@@ -91,7 +135,12 @@ ...@@ -91,7 +135,12 @@
const filterColumns = filterColumnAuth(columns); const filterColumns = filterColumnAuth(columns);
const tableRef = ref(); const tableRef = ref();
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']); const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => { const buttonConfigs = computed(() => {
...@@ -161,13 +210,19 @@ ...@@ -161,13 +210,19 @@
}; };
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string); const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef); provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectedKeys = ref<string[]>([]); const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]); const selectedRowsData = ref<any[]>([]);
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
...@@ -184,18 +239,25 @@ ...@@ -184,18 +239,25 @@
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false, showResetButton: false,
}, },
bordered: false, bordered:false,
beforeFetch: (params) => { beforeFetch: (params) => {
pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' }; pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value; return pageParamsInfo.value;
}, },
afterFetch: (res) => { afterFetch: (res) => {
selectedKeys.value = []; selectedKeys.value = [];
selectedRowsData.value = []; selectedRowsData.value = [];
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 195, width: 195,
...@@ -207,44 +269,53 @@ ...@@ -207,44 +269,53 @@
size: false, size: false,
}, },
customRow, customRow,
isAdvancedQuery: false, isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema), querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值 objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
}); });
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
function handleAdd() { function handleAdd() {
openModal(true, { isUpdate: false }); openModal(true, { isUpdate: false });
} }
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
let field = 'id'; let field = 'id';
try { try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit'); let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) { if (hasIn) {
let res = await handleOpenFormEnableLockeData(record[field], formIdComputedRef.value); let res = await handleOpenFormEnableLockeData(record[field], formIdComputedRef.value);
if (res !== null) { if (res !== null) {
return; return;
} }
} }
let info = { let info = {
id: record[field], id: record[field],
isUpdate: true, isUpdate: true,
};
};
openModal(true, info);
} catch (error) {} openModal(true, info);
} catch (error) {}
} }
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
} }
function deleteList(ids) { function deleteList(ids) {
Modal.confirm({ Modal.confirm({
title: '提示信息', title: '提示信息',
...@@ -264,14 +335,19 @@ ...@@ -264,14 +335,19 @@
onCancel() {}, onCancel() {},
}); });
} }
function onSelectChange(selectedRowKeys: [], selectedRows) { function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys; selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows; selectedRowsData.value = selectedRows;
} }
function customRow(record: Recordable) { function customRow(record: Recordable) {
return { return {
onClick: () => { onClick: () => {
let selectedRowKeys = [...selectedKeys.value]; let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) { if (selectedRowKeys.indexOf(record.id) >= 0) {
...@@ -289,14 +365,18 @@ ...@@ -289,14 +365,18 @@
}, },
}; };
} }
function handleSuccess() { function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
selectedKeys.value = [];
selectedRowsData.value = [];
reload(); reload();
} }
function handleFormSuccess() {
function handleFormSuccess() {
handleSuccess(); handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit'); handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
} }
...@@ -304,13 +384,14 @@ ...@@ -304,13 +384,14 @@
handleCloseFormEnableLocke(buttonConfigs.value, 'edit'); handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
let info = { let info={
isView: true, isView: true,
id: record.id, id: record.id,
}; };
openModal(true, info); openModal(true, info);
} }
function handleXiafa(record: Recordable) { function handleXiafa(record: Recordable) {
...@@ -348,16 +429,16 @@ ...@@ -348,16 +429,16 @@
let list = getActions(record); let list = getActions(record);
return list.slice(listSpliceNum.value); return list.slice(listSpliceNum.value);
} }
function getActions(record: Recordable): ActionItem[] { function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false; record.isCanEdit = false;
let actionsList: ActionItem[] = []; let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => { actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) { if (!record?.workflowData?.processId) {
record.isCanEdit = true; record.isCanEdit = true;
actionsList.push({ actionsList.push({
...button, ...button,
auth: `scjh:${button.code}`, auth: `scjh:${button.code}`,
label: button?.name, label: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
...@@ -370,22 +451,29 @@ ...@@ -370,22 +451,29 @@
label: button?.name, label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record), onClick: btnEvent[button.code]?.bind(null, record),
}); });
} }
} }
}); });
return actionsList; return actionsList;
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {
width: 50px; width: 50px;
} }
.show { .show{
display: flex; display: flex;
} }
.hide { .hide{
display: none !important; display: none !important;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment