Commit dd79ea15 by 张珈源

feat(kcpd): 添加盘点功能按钮和优化表单配置

- 新增开始盘点、确认盘点、取消盘点三个操作按钮
- 配置网格布局组件用于按钮排列
- 移除系统数量和差额字段定义
- 更新工作流权限配置添加按钮权限控制
- 重构模态框底部按钮逻辑并移除默认确定取消按钮
- 优化表单按钮显示逻辑和事件处理机制
- 调整明细表格新增按钮显示状态为隐藏
- 移除字段默认选择和最大长度限制配置
parent 81a645d7
...@@ -133,12 +133,8 @@ export interface MesWarehouseInventoryRelaModel { ...@@ -133,12 +133,8 @@ export interface MesWarehouseInventoryRelaModel {
pch: string; pch: string;
xtsl: string;
pdsl: string; pdsl: string;
ce: string;
p1: string; p1: string;
p2: string; p2: string;
......
...@@ -7,21 +7,38 @@ ...@@ -7,21 +7,38 @@
v-bind="$attrs" @register="registerModal" :title="getTitle" v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" > @ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" /> <ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
<a-button
:type="item.style"
v-else
:style="{ marginLeft: index > 0 ? '10px' : 0 }"
@click="customClick(item)"
>
{{ t(item.name) }}
</a-button>
</template>
</template>
</template>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue'; import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal'; import { BasicModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
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 { formProps } from './config'; import { formProps ,formButtons } from './config';
import ModalForm from './Form.vue'; import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
...@@ -52,8 +69,8 @@ ...@@ -52,8 +69,8 @@
setModalProps({ setModalProps({
destroyOnClose: true, destroyOnClose: true,
maskClosable: false, maskClosable: false,
showCancelBtn: !state.isView, showCancelBtn: false,
showOkBtn: !state.isView, showOkBtn: false,
canFullscreen: true, canFullscreen: true,
width: 1980, width: 1980,
footer: state.isView ? null : undefined,defaultFullscreen:true, footer: state.isView ? null : undefined,defaultFullscreen:true,
...@@ -128,7 +145,18 @@ ...@@ -128,7 +145,18 @@
} }
} }
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
handleClose();
closeModal();
} else if (item.key == 'reset') {
formRef.value.resetFields();
} else {
executeCurFormEvent(item.event, state.formModel, true);
}
}
function handleClose() { function handleClose() {
formRef.value.resetFields(); formRef.value.resetFields();
} }
......
...@@ -198,6 +198,160 @@ export const formProps: FormProps = { ...@@ -198,6 +198,160 @@ export const formProps: FormProps = {
size: 'default', size: 'default',
schemas: [ schemas: [
{ {
key: '44f1b3495b854c708ce9f13c0e6afc94',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 2,
list: [
{
key: '3498b1519f97476e87627a4b7de4b268',
label: '开始盘点',
type: 'button',
component: 'Button',
colProps: { span: 24 },
componentProps: {
name: '开始盘点',
buttonStyleType: 'primary',
buttonWidth: '',
buttonHeight: '',
datasourceType: 'api',
prefix: '',
suffix: '',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/assoc-selection',
method: 'GET',
apiId: 'ac61f579074c465aaf017d64284a44a3',
outputParams: [
{ name: 'label', tableTitle: 'label' },
{ name: 'value', tableTitle: 'value' },
],
},
dicOptions: [],
disabled: false,
isShow: true,
margin: '10px',
events: { click: "formActionType.showMessage('开始盘点')" },
modal: null,
type: 1,
event: [],
tooltipConfig: { visible: false, title: '提示文本' },
span: 7,
width: '',
height: '',
},
},
],
},
{
span: 2,
list: [
{
key: 'b0b8fc72994d4f34a985bbf6880799f1',
label: '确认盘点',
type: 'button',
component: 'Button',
colProps: { span: 24 },
componentProps: {
name: '确认盘点',
buttonStyleType: 'primary',
buttonWidth: '',
buttonHeight: '',
datasourceType: 'api',
prefix: '',
suffix: '',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/assoc-selection',
method: 'GET',
apiId: 'ac61f579074c465aaf017d64284a44a3',
outputParams: [
{ name: 'label', tableTitle: 'label' },
{ name: 'value', tableTitle: 'value' },
],
},
dicOptions: [],
disabled: false,
isShow: true,
margin: '10px',
events: { click: "formActionType.showMessage('确认盘点')" },
modal: null,
type: 1,
event: [],
tooltipConfig: { visible: false, title: '提示文本' },
span: 7,
width: '',
height: '',
},
},
],
},
{
span: 2,
list: [
{
key: 'a2539c9a104248ab9cb0dedea1641b39',
label: '取消盘点',
type: 'button',
component: 'Button',
colProps: { span: 24 },
componentProps: {
name: '取消盘点',
buttonStyleType: 'primary',
buttonWidth: '',
buttonHeight: '',
datasourceType: 'api',
prefix: '',
suffix: '',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/assoc-selection',
method: 'GET',
apiId: 'ac61f579074c465aaf017d64284a44a3',
outputParams: [
{ name: 'label', tableTitle: 'label' },
{ name: 'value', tableTitle: 'value' },
],
},
dicOptions: [],
disabled: false,
isShow: true,
margin: '10px',
events: { click: "formActionType.showMessage('取消盘点')" },
modal: null,
type: 1,
event: [],
tooltipConfig: { visible: false, title: '提示文本' },
span: 7,
width: '',
height: '',
},
},
],
},
],
componentProps: {
gutter: 0,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
{
key: 'bd276037af164568843b957a4de98cb2', key: 'bd276037af164568843b957a4de98cb2',
field: '', field: '',
label: '', label: '',
...@@ -229,7 +383,6 @@ export const formProps: FormProps = { ...@@ -229,7 +383,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2010539474382962690' }, params: { itemId: '2010539474382962690' },
labelField: 'name', labelField: 'name',
...@@ -275,7 +428,6 @@ export const formProps: FormProps = { ...@@ -275,7 +428,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2003761375221407745' }, params: { itemId: '2003761375221407745' },
labelField: 'name', labelField: 'name',
...@@ -321,9 +473,7 @@ export const formProps: FormProps = { ...@@ -321,9 +473,7 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'api', datasourceType: 'api',
params: null,
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
...@@ -398,7 +548,6 @@ export const formProps: FormProps = { ...@@ -398,7 +548,6 @@ export const formProps: FormProps = {
span: 2, span: 2,
defaultValue: '', defaultValue: '',
placeholder: '请输入备注', placeholder: '请输入备注',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -484,9 +633,7 @@ export const formProps: FormProps = { ...@@ -484,9 +633,7 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'api', datasourceType: 'api',
params: null,
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
...@@ -529,7 +676,6 @@ export const formProps: FormProps = { ...@@ -529,7 +676,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2003761375221407745' }, params: { itemId: '2003761375221407745' },
labelField: 'name', labelField: 'name',
...@@ -568,7 +714,6 @@ export const formProps: FormProps = { ...@@ -568,7 +714,6 @@ export const formProps: FormProps = {
{ key: 2, label: 'Option 2', value: 'Option 2' }, { key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' }, { key: 3, label: 'Option 3', value: 'Option 3' },
], ],
defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2010539474382962690' }, params: { itemId: '2010539474382962690' },
labelField: 'name', labelField: 'name',
...@@ -599,7 +744,6 @@ export const formProps: FormProps = { ...@@ -599,7 +744,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入单件\\批次号', placeholder: '请输入单件\\批次号',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -620,32 +764,6 @@ export const formProps: FormProps = { ...@@ -620,32 +764,6 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'ec3ea4fd15ae4cae803fe45b18c0e4b1',
title: '系统数量',
dataIndex: 'xtsl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: null,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'a2b46aaba5264ee79e83eeeda69990d0', key: 'a2b46aaba5264ee79e83eeeda69990d0',
title: '盘点数量', title: '盘点数量',
dataIndex: 'pdsl', dataIndex: 'pdsl',
...@@ -656,35 +774,7 @@ export const formProps: FormProps = { ...@@ -656,35 +774,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: 0, defaultValue: 0,
min: 0, min: 0,
max: null,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '312fc725ea894778851d52c25a20eba4',
title: '差额',
dataIndex: 'ce',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: null,
step: 1, step: 1,
maxlength: null,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -722,7 +812,7 @@ export const formProps: FormProps = { ...@@ -722,7 +812,7 @@ export const formProps: FormProps = {
isDeleteSelected: false, isDeleteSelected: false,
isListView: false, isListView: false,
viewList: [], viewList: [],
isShowAdd: true, isShowAdd: false,
isShowDelete: true, isShowDelete: true,
hasCheckedCol: false, hasCheckedCol: false,
events: {}, events: {},
...@@ -742,3 +832,39 @@ export const formProps: FormProps = { ...@@ -742,3 +832,39 @@ export const formProps: FormProps = {
showSubmitButton: false, showSubmitButton: false,
hiddenComponent: [], hiddenComponent: [],
}; };
export const formButtons = [
{
key: 'confirm',
code: 'confirm',
name: '确定',
style: 'primary',
event: [],
isShow: true,
index: 2,
type: 1,
modal: null,
},
{
key: 'cancel',
code: 'cancel',
name: '取消',
style: 'default',
event: [],
isShow: true,
index: 1,
type: 1,
modal: null,
},
{
key: 'reset',
code: 'reset',
name: '重置',
style: 'default',
event: [],
isShow: true,
index: 0,
type: 1,
modal: null,
},
];
export const permissionList = [ export const permissionList = [
{ {
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '开始盘点',
isSubTable: false,
showChildren: true,
type: 'button',
key: '3498b1519f97476e87627a4b7de4b268',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '确认盘点',
isSubTable: false,
showChildren: true,
type: 'button',
key: 'b0b8fc72994d4f34a985bbf6880799f1',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '取消盘点',
isSubTable: false,
showChildren: true,
type: 'button',
key: 'a2539c9a104248ab9cb0dedea1641b39',
children: [],
options: {},
},
{
required: true, required: true,
view: true, view: true,
edit: true, edit: true,
...@@ -163,42 +208,12 @@ export const permissionList = [ ...@@ -163,42 +208,12 @@ export const permissionList = [
isSaveTable: false, isSaveTable: false,
showChildren: false, showChildren: false,
tableName: 'mesWarehouseInventoryRelaList', tableName: 'mesWarehouseInventoryRelaList',
fieldName: '系统数量',
fieldId: 'xtsl',
type: 'InputNumber',
key: 'ec3ea4fd15ae4cae803fe45b18c0e4b1',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '盘点数量', fieldName: '盘点数量',
fieldId: 'pdsl', fieldId: 'pdsl',
type: 'InputNumber', type: 'InputNumber',
key: 'a2b46aaba5264ee79e83eeeda69990d0', key: 'a2b46aaba5264ee79e83eeeda69990d0',
children: [], children: [],
}, },
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseInventoryRelaList',
fieldName: '差额',
fieldId: 'ce',
type: 'InputNumber',
key: '312fc725ea894778851d52c25a20eba4',
children: [],
},
], ],
}, },
]; ];
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]); const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
const list = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}] const list = [{"buttonId":"2010901323197190144","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2010901323201384448","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2010901323201384449","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2010901323201384450","name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true,"isUse":true},{"buttonId":"2010901323201384451","name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true,"isUse":true},{"buttonId":"2010901323201384452","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list); return filterButtonAuth(list);
}) })
......
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