Commit 64b77a7b by 张恒

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

- 添加计划编号搜索字段并启用客户选择功能
- 集成客户API数据源支持多选和搜索功能
- 调整表格列配置显示计划编号、客户和交付日期
- 修正占位符文本错误并调整字段必填验证规则
- 将子表单重构为标签页结构提升用户体验
- 优化产品列表组件的编辑和删除功能
- 更新工作流权限配置以匹配新的字段结构
parent a4d70719
......@@ -6,9 +6,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesProductionPlanPageParams extends BasicPageParams {
jhbh: string;
ddbh: string;
kh: string;
ssgs: string;
ywzz: string;
zt: string;
}
......@@ -19,13 +19,15 @@ export interface MesProductionPlanPageParams extends BasicPageParams {
export interface MesProductionPlanPageModel {
id: string;
ddbh: string;
jhbh: string;
ddbh: string;
kh: string;
ssgs: string;
jhjhrq: string;
ywzz: string;
zt: string;
}
......@@ -107,6 +109,8 @@ export interface MesProductionPlanProductModel {
cpbh: string;
cpmc: string;
nbdm: string;
hjzt: string;
......
......@@ -222,3 +222,4 @@
});
</script>
\ No newline at end of file
......@@ -3,19 +3,39 @@ import { BasicColumn } from '/@/components/Table';
import { uploadApi } from '/@/api/sys/upload';
export const searchFormSchema: FormSchema[] = [
// {
// field: 'jhbh',
// label: '计划编号',
// defaultValue: undefined,
// component: 'Input',
// },
{
field: 'ddbh',
label: '订单编号',
field: 'jhbh',
label: '计划编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'kh',
label: '客户',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/jcxx/getKhList',
method: 'GET',
apiId: '7bc8db3faba24b19a997856f6ef0b27e',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_partner where delete_mark = 0 and customer = \'1\'";\r\nreturn db.select(sql);',
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'ywzz',
label: '业务组织',
defaultValue: undefined,
......@@ -50,6 +70,19 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'jhbh',
title: '计划编号',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'ddbh',
title: '订单编号',
componentType: 'input',
......@@ -63,9 +96,9 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'jhbh',
title: '计划编号',
componentType: 'auto-code',
dataIndex: 'kh',
title: '客户',
componentType: 'select',
fixed: false,
sorter: true,
......@@ -76,9 +109,9 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'kh',
title: '客户',
componentType: 'select',
dataIndex: 'jhjhrq',
title: '计划交付日期',
componentType: 'date',
fixed: false,
sorter: true,
......@@ -236,7 +269,7 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入客户项目号',
placeholder: '请输入客户项目号项目号',
prefix: '',
suffix: '',
addonBefore: '',
......@@ -283,7 +316,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: true,
required: false,
rules: [],
events: {},
isShow: true,
......@@ -396,9 +429,9 @@ export const formProps: FormProps = {
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择客户',
placeholder: '',
showLabel: true,
showSearch: false,
showSearch: true,
isMultiple: false,
clearable: false,
disabled: false,
......@@ -442,7 +475,7 @@ export const formProps: FormProps = {
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择业务组织',
placeholder: '',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -496,301 +529,420 @@ export const formProps: FormProps = {
},
},
{
key: '24ea4c6631d047a1a8e7c3fe86ab080c',
key: '4b60581139c047959bf0ed8f0d5dd55f',
field: '',
label: '',
field: 'mesProductionPlanProductList',
type: 'form',
component: 'SubForm',
required: true,
type: 'tab',
colProps: { span: 24 },
componentProps: {
mainKey: 'mesProductionPlanProductList',
columns: [
{
key: 'd762849da7e741a7b004c1c81b91593a',
title: '产品ID',
dataIndex: 'cpid',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入产品ID产品ID',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'id',
},
},
{
key: 'cd0038f42bc64c189b3821f0e2061321',
title: '物料编号',
dataIndex: 'cpbh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入物料编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpbh',
},
},
{
key: '6ce71ecb0b6e4d14ae65be4029b179fd',
title: '内部代码',
dataIndex: 'nbdm',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入内部代码',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'nbdm',
},
},
{
key: '0c075736898c431ea3f5bca58ec65af6',
title: '型号',
dataIndex: 'xh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入型号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'xh',
},
},
{
key: '697829b6aed54b8cbaa853c62619831a',
title: '合金状态',
dataIndex: 'hjzt',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入合金状态',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'hjzt',
},
},
{
key: '2f56d9297a9c49d59d3b43f62e2946f2',
title: '规格(尺寸)',
dataIndex: 'gg',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入规格(尺寸)',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'gg',
},
},
{
key: '6a93c6d77ce1428c9fbba62a02afd6d0',
title: '数量',
dataIndex: 'sl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
listStyle: "return 'width:100%'",
},
},
{
key: '3b80cb19086e49e1a746cf9ace3f938e',
title: '质量/KG',
dataIndex: 'zl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 0.1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
component: 'Tab',
children: [
{
span: 24,
name: '物料',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '24ea4c6631d047a1a8e7c3fe86ab080c',
label: '',
field: 'mesProductionPlanProductList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesProductionPlanProductList',
columns: [
{
key: 'd762849da7e741a7b004c1c81b91593a',
title: '产品ID',
dataIndex: 'cpid',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'id',
},
},
{
key: 'cd0038f42bc64c189b3821f0e2061321',
title: '编号',
dataIndex: 'cpbh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpbh',
},
},
{
key: 'c8f88cafd17f4655bfbe4643ffe58c9c',
title: '名称',
dataIndex: 'cpmc',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpmc',
},
},
{
key: '6ce71ecb0b6e4d14ae65be4029b179fd',
title: '内部代码',
dataIndex: 'nbdm',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入内部代码',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'nbdm',
},
},
{
key: '0c075736898c431ea3f5bca58ec65af6',
title: '型号',
dataIndex: 'xh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入型号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'xh',
},
},
{
key: '697829b6aed54b8cbaa853c62619831a',
title: '合金状态',
dataIndex: 'hjzt',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入合金状态',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'hjzt',
},
},
{
key: '2f56d9297a9c49d59d3b43f62e2946f2',
title: '规格(尺寸)',
dataIndex: 'gg',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入规格(尺寸)',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'gg',
},
},
{
key: '6a93c6d77ce1428c9fbba62a02afd6d0',
title: '数量',
dataIndex: 'sl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
listStyle: "return 'width:100%'",
},
},
{
key: '3b80cb19086e49e1a746cf9ace3f938e',
title: '质量/KG',
dataIndex: 'zl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 0.1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: '24',
preloadType: 'api',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{ tableTitle: '产品编号', name: 'cpbh' },
{ tableTitle: '产品名称', name: 'cpmc' },
{ name: 'nbdm', tableTitle: '内部代码' },
{ name: 'gg', tableTitle: '规格' },
{ tableTitle: '型号', name: 'xh' },
],
},
itemId: '',
dicOptions: [],
useSelectButton: true,
buttonName: '选择',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
widths: [
{
key: 'd762849da7e741a7b004c1c81b91593a',
name: '产品ID',
bindField: 'cpid',
resizable: false,
isEdit: false,
},
{
key: 'cd0038f42bc64c189b3821f0e2061321',
name: '编号',
bindField: 'cpbh',
resizable: false,
isEdit: true,
},
{
key: 'c8f88cafd17f4655bfbe4643ffe58c9c',
name: '名称',
bindField: 'cpmc',
resizable: false,
isEdit: true,
},
{
key: '6ce71ecb0b6e4d14ae65be4029b179fd',
name: '内部代码',
bindField: 'nbdm',
resizable: false,
isEdit: false,
},
{
key: '0c075736898c431ea3f5bca58ec65af6',
name: '型号',
bindField: 'xh',
resizable: false,
isEdit: false,
},
{
key: '697829b6aed54b8cbaa853c62619831a',
name: '合金状态',
bindField: 'hjzt',
resizable: false,
isEdit: false,
},
{
key: '2f56d9297a9c49d59d3b43f62e2946f2',
name: '规格(尺寸)',
bindField: 'gg',
resizable: false,
isEdit: false,
},
{
key: '6a93c6d77ce1428c9fbba62a02afd6d0',
name: '数量',
bindField: 'sl',
resizable: false,
isEdit: false,
},
{
key: '3b80cb19086e49e1a746cf9ace3f938e',
name: '质量/KG',
bindField: 'zl',
resizable: false,
isEdit: false,
},
],
},
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: '24',
preloadType: 'api',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
{ tableTitle: '产品编号', name: 'cpbh' },
{ tableTitle: '产品名称', name: 'cpmc' },
{ name: 'nbdm', tableTitle: '内部代码' },
{ name: 'gg', tableTitle: '规格' },
{ tableTitle: '型号', name: 'xh' },
],
},
itemId: '',
dicOptions: [],
useSelectButton: true,
buttonName: '选择产品',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
{
key: 'f7ae7fe08ec74cf6b91cd3cd35cfeaaf',
......
......@@ -33,7 +33,7 @@ export const permissionList = [
defaultValue: '',
},
{
required: true,
required: false,
view: true,
edit: true,
disabled: false,
......@@ -169,7 +169,7 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '物料编号',
fieldName: '编号',
fieldId: 'cpbh',
type: 'Input',
key: 'cd0038f42bc64c189b3821f0e2061321',
......@@ -184,6 +184,21 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
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: '内部代码',
fieldId: 'nbdm',
type: 'Input',
......
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
......@@ -26,28 +27,45 @@
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value')
}}</span>
</template>
</template>
</BasicTable>
</template>
</template>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</ResizePageWrapper>
</template>
<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 { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
......@@ -60,20 +78,46 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle'; //列表样式配置
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import ScjhModal from './components/ScjhModal.vue';
import { searchFormSchema, columns } from './components/config';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({});
......@@ -91,7 +135,12 @@
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => {
......@@ -161,13 +210,19 @@
};
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload }] = useTable({
......@@ -184,18 +239,25 @@
fieldMapToTime: [],
showResetButton: false,
},
bordered: false,
beforeFetch: (params) => {
pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' };
bordered:false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value;
},
afterFetch: (res) => {
selectedKeys.value = [];
selectedRowsData.value = [];
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 195,
......@@ -207,44 +269,53 @@
size: false,
},
customRow,
isAdvancedQuery: false,
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
openModal(true, { isUpdate: false });
}
async function handleEdit(record: Recordable) {
let field = 'id';
try {
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) {
let res = await handleOpenFormEnableLockeData(record[field], formIdComputedRef.value);
if (res !== null) {
return;
}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
......@@ -264,14 +335,19 @@
onCancel() {},
});
}
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
......@@ -289,14 +365,18 @@
},
};
}
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
function handleFormSuccess() {
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
......@@ -304,13 +384,14 @@
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info = {
let info={
isView: true,
id: record.id,
};
openModal(true, info);
openModal(true, info);
}
function handleXiafa(record: Recordable) {
......@@ -348,16 +429,16 @@
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable): ActionItem[] {
function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `scjh:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
......@@ -370,22 +451,29 @@
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show {
.show{
display: flex;
}
.hide {
.hide{
display: none !important;
}
</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