重新生成币种和价格

This commit is contained in:
2025-10-22 13:38:25 +08:00
parent f84002c861
commit aac1d599de
14 changed files with 1471 additions and 1477 deletions

View File

@ -9,6 +9,11 @@ enum Api {
LngBCurrency = '/mdm/currency',
Enable = '/mdm/currency/enable',
Disable= '/mdm/currency/disable',
DataLog = '/mdm/currency/datalog',
}
/**
@ -85,3 +90,50 @@ export async function deleteLngBCurrency(ids: string[], mode: ErrorMessageMode =
},
);
}
/**
* @description: 启用数据LngBCurrency
*/
export async function enableLngBCurrency(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Enable,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 作废数据LngBCurrency
*/
export async function disableLngBCurrency(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Disable,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取数据日志LngBCurrency
*/
export async function getDataLogLngBCurrency(id: string, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Datalog,
data: id,
},
{
errorMessageMode: mode,
},
);
}

View File

@ -4,18 +4,14 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: LngBCurrency分页参数 模型
*/
export interface LngBCurrencyPageParams extends BasicPageParams {
code: string;
fullName: string;
currSymbol: string;
valid: string;
code: string;
localSign: string;
sort: string;
valid: string;
note: string;
}
@ -29,12 +25,8 @@ export interface LngBCurrencyPageModel {
fullName: string;
currSymbol: string;
localSign: string;
sort: string;
valid: string;
note: string;

View File

@ -9,6 +9,11 @@ enum Api {
LngBPriceTerm = '/mdm/priceTerms',
Enable = '/mdm/priceTerms/enable',
Disable= '/mdm/priceTerms/disable',
DataLog = '/mdm/priceTerms/datalog',
}
/**
@ -85,3 +90,50 @@ export async function deleteLngBPriceTerm(ids: string[], mode: ErrorMessageMode
},
);
}
/**
* @description: 启用数据LngBPriceTerm
*/
export async function enableLngBPriceTerm(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Enable,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 作废数据LngBPriceTerm
*/
export async function disableLngBPriceTerm(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Disable,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取数据日志LngBPriceTerm
*/
export async function getDataLogLngBPriceTerm(id: string, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Datalog,
data: id,
},
{
errorMessageMode: mode,
},
);
}

View File

@ -4,19 +4,9 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
* @description: LngBPriceTerm分页参数 模型
*/
export interface LngBPriceTermPageParams extends BasicPageParams {
code: string;
fullName: string;
freightSign: string;
insuranceSign: string;
sort: string;
valid: string;
note: string;
}
/**
@ -33,49 +23,12 @@ export interface LngBPriceTermPageModel {
insuranceSign: string;
sort: string;
valid: string;
note: string;
}
/**
* @description: LngBPriceTerm表类型
*/
export interface LngBPriceTermModel {
id: number;
code: string;
fullName: string;
freightSign: string;
insuranceSign: string;
sort: number;
valid: string;
note: string;
createUserId: number;
createDate: string;
modifyUserId: number;
modifyDate: string;
deleteMark: number;
tenantId: number;
deptId: number;
ruleUserId: number;
}
0;
/**
* @description: LngBPriceTerm分页返回值结构

View File

@ -1,7 +1,9 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive } from 'vue';
@ -21,7 +23,7 @@
isUpdate: true,
isView: false,
isCopy: false,
rowId: ''
rowId: '',
});
const { t } = useI18n();
@ -36,7 +38,7 @@
showCancelBtn: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 900
width: 900,
});
if (state.isUpdate || state.isView || state.isCopy) {
state.rowId = data.id;
@ -85,12 +87,12 @@
//false 新增
notification.success({
message: 'Tip',
description: t('新增成功!')
description: t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!')
description: t('修改成功!'),
}); //提示消息
}
closeModal();

View File

@ -1,5 +1,10 @@
<template>
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="{}"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
/>
</template>
<script lang="ts" setup>
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
@ -11,7 +16,7 @@
import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
@ -25,15 +30,15 @@
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU
}
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: { schemas: [] } as FormDataProps
formDataProps: {schemas:[]} as FormDataProps,
});
const state = reactive({
formModel: {}
formModel: {},
});
let customFormEventConfigs=[];
@ -45,8 +50,12 @@
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
@ -55,13 +64,20 @@
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
}
emits('form-mounted', formProps);
} catch (error) {}
} catch (error) {
}
});
async function mergeCustomFormRenderConfig() {
let cloneProps=cloneDeep(formProps);
let fEventConfigs=cloneDeep(formEventConfigs);
@ -109,7 +125,9 @@
state.formModel = record;
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record;
} catch (error) {}
} catch (error) {
}
}
// 辅助设置表单数据
function setFieldsValue(record) {
@ -133,7 +151,9 @@
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateLngBCurrency(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
@ -142,7 +162,9 @@
try {
state.formModel = values;
let saveVal = await addLngBCurrency(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
@ -167,16 +189,20 @@
}
state.formModel = formModels;
if(formModels[RowKey]) {
setFormDataFromId(formModels[RowKey], false);
setFormDataFromId(formModels[RowKey], false)
} else {
setFieldsValue(formModels);
setFieldsValue(formModels)
}
} catch (error) {}
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
}
function getFormModel() {
return systemFormRef.value.formModel;
return systemFormRef.value.formModel
}
async function handleDelete(id) {
return await deleteLngBCurrency([id]);

View File

@ -6,39 +6,11 @@ export const formConfig = {
};
export const searchFormSchema: FormSchema[] = [
{
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'fullName',
label: '名称',
component: 'Input',
},
{
field: 'currSymbol',
label: '符号',
component: 'Input',
},
{
field: 'localSign',
label: '是否本币',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1978056598125330433' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'sort',
label: '显示顺序',
component: 'Input',
},
{
field: 'valid',
label: '有效标志',
@ -52,6 +24,24 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'localSign',
label: '是否本币',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1978056598125330433' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
@ -78,15 +68,6 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'currSymbol',
title: '符号',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'localSign',
title: '是否本币',
@ -96,15 +77,6 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'sort',
title: '显示顺序',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'valid',
title: '有效标志',
@ -117,7 +89,7 @@ export const columns: BasicColumn[] = [
{
dataIndex: 'note',
title: '备注',
componentType: 'input',
componentType: 'textarea',
align: 'left',
sorter: true,
@ -193,7 +165,7 @@ export const formProps: FormProps = {
size: 'default',
schemas: [
{
key: '8bdc5b8468004f54904d30bf03e445cc',
key: '216e1018f11a4d4aa5ad0879dd4d8209',
field: 'code',
label: '编码',
type: 'input',
@ -209,15 +181,14 @@ export const formProps: FormProps = {
responsive: false,
respNewRow: false,
placeholder: '请输入编码',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
allowClear: true,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -227,7 +198,7 @@ export const formProps: FormProps = {
},
},
{
key: '866d9f66d886441990702205e50214ae',
key: '6074c6c1ac8b4f528fa421f8464e6e73',
field: 'fullName',
label: '名称',
type: 'input',
@ -243,15 +214,14 @@ export const formProps: FormProps = {
responsive: false,
respNewRow: false,
placeholder: '请输入名称',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
allowClear: true,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -261,41 +231,7 @@ export const formProps: FormProps = {
},
},
{
key: 'afe4e7d3e0f34542baa38a7201d987f0',
field: 'currSymbol',
label: '符号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入符号',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: '1270794f304d4a2dbc0f4b9428979900',
key: '477dc52fa33b402f94146203c9ffcdc7',
field: 'localSign',
label: '是否本币',
type: 'select',
@ -314,13 +250,12 @@ export const formProps: FormProps = {
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
mode: '',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '1978056598125330433' },
labelField: 'name',
@ -331,7 +266,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
@ -340,41 +275,7 @@ export const formProps: FormProps = {
},
},
{
key: 'eaa4d5c8eda64cd897bd7fd99bc7c583',
field: 'sort',
label: '显示顺序',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入显示顺序',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: '601920889e184a83b2838b9959afd477',
key: '7940a5fbdf024f44b18d063c2023ee46',
field: 'valid',
label: '有效标志',
type: 'select',
@ -392,14 +293,13 @@ export const formProps: FormProps = {
showLabel: true,
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
disabled: true,
mode: '',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '1978057078528327681' },
labelField: 'name',
@ -419,11 +319,11 @@ export const formProps: FormProps = {
},
},
{
key: '3c877465ed7c43239afbf22889098695',
key: '45d20cfa03a747b2a1e1ebb0cb8198c5',
field: 'note',
label: '备注',
type: 'input',
component: 'Input',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
@ -433,22 +333,19 @@ export const formProps: FormProps = {
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
respNewRow: true,
placeholder: '请输入备注',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
maxlength: 400,
rows: 4,
autoSize: false,
showCount: true,
disabled: false,
allowClear: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},

View File

@ -11,7 +11,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '8bdc5b8468004f54904d30bf03e445cc',
key: '216e1018f11a4d4aa5ad0879dd4d8209',
children: [],
},
{
@ -26,22 +26,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: '866d9f66d886441990702205e50214ae',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '符号',
fieldId: 'currSymbol',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'afe4e7d3e0f34542baa38a7201d987f0',
key: '6074c6c1ac8b4f528fa421f8464e6e73',
children: [],
},
{
@ -56,22 +41,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'select',
key: '1270794f304d4a2dbc0f4b9428979900',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '显示顺序',
fieldId: 'sort',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'eaa4d5c8eda64cd897bd7fd99bc7c583',
key: '477dc52fa33b402f94146203c9ffcdc7',
children: [],
},
{
@ -86,7 +56,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'select',
key: '601920889e184a83b2838b9959afd477',
key: '7940a5fbdf024f44b18d063c2023ee46',
children: [],
},
{
@ -100,8 +70,8 @@ export const permissionList = [
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'input',
key: '3c877465ed7c43239afbf22889098695',
type: 'textarea',
key: '45d20cfa03a747b2a1e1ebb0cb8198c5',
children: [],
},
];

View File

@ -1,6 +1,7 @@
<template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
@ -23,7 +24,9 @@
</PageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
import { ref, computed, onMounted, onUnmounted, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
@ -35,7 +38,7 @@
import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index';
import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngBCurrency } from '/@/api/mdm/Currency';
import { useModal } from '/@/components/Modal';
import CurrencyModal from './components/CurrencyModal.vue';
@ -58,18 +61,12 @@
const tableRef = ref();
//所有按钮
const buttons = ref([
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
{ isUse: true, 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 }
]);
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"作废","code":"disable","icon":"ant-design:stop-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":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']);
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value);
});
})
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -79,34 +76,35 @@
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,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
const { currentRoute } = useRouter();
const router = useRouter();
const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId;
formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal();
const formName='币种管理';
const [registerTable, { reload }] = useTable({
title: '' || formName + '列表',
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
api: getLngBCurrencyPage,
rowKey: 'id',
columns: customConfigColums,
formConfig: {
rowProps: {
gutter: 16
gutter: 16,
},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false
showResetButton: false,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
},
useSearchForm: true,
showTableSetting: true,
@ -116,16 +114,17 @@
width: 160,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' }
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
setting: false
}
setting: false,
},
});
function dbClickRow(record) {
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return;
}
const { processId, taskIds, schemaId } = record.workflowData || {};
@ -161,6 +160,7 @@
}
function buttonClick(code) {
btnEvent[code]();
}
@ -182,6 +182,7 @@
}
function handleEdit(record: Recordable) {
router.push({
path: '/form/Currency/' + record.id + '/updateForm',
query: {
@ -195,6 +196,62 @@
deleteList([record.id]);
}
function handleEnable() {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要启用的数据'),
});
return;
}
let ids = selectedKeys.value;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认启用?',
okText: '确认',
cancelText: '取消',
onOk() {
enableLngBCurrency(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('启用成功!'),
});
});
},
onCancel() {},
});
}
function handleDisable() {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要禁用的数据'),
});
return;
}
let ids = selectedKeys.value;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认禁用?',
okText: '确认',
cancelText: '取消',
onOk() {
disableLngBCurrency(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('禁用成功!'),
});
});
},
onCancel() {},
});
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
@ -207,24 +264,28 @@
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!')
description: t('删除成功!'),
});
});
},
onCancel() {}
onCancel() {},
});
}
function handleRefresh() {
reload();
}
function handleSuccess() {
reload();
}
function handleView(record: Recordable) {
dbClickRow(record);
}
onMounted(() => {
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
@ -244,20 +305,21 @@
}
});
function getActions(record: Recordable):ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) {
return {
icon: button?.icon,
tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record)
onClick: btnEvent[button.code].bind(null, record),
};
} else {
if (button.code === 'view') {
return {
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record)
onClick: btnEvent[button.code].bind(null, record),
};
} else {
return {};
@ -279,7 +341,7 @@
let btns= await mergeButtons(buttons.value,formId);
buttons.value=btns;
}
}
};
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {

View File

@ -1,5 +1,10 @@
<template>
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="{}"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
/>
</template>
<script lang="ts" setup>
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
@ -11,7 +16,7 @@
import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
@ -25,15 +30,15 @@
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU
}
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: { schemas: [] } as FormDataProps
formDataProps: {schemas:[]} as FormDataProps,
});
const state = reactive({
formModel: {}
formModel: {},
});
let customFormEventConfigs=[];
@ -45,8 +50,12 @@
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
@ -55,13 +64,20 @@
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
}
emits('form-mounted', formProps);
} catch (error) {}
} catch (error) {
}
});
async function mergeCustomFormRenderConfig() {
let cloneProps=cloneDeep(formProps);
let fEventConfigs=cloneDeep(formEventConfigs);
@ -109,7 +125,9 @@
state.formModel = record;
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record;
} catch (error) {}
} catch (error) {
}
}
// 辅助设置表单数据
function setFieldsValue(record) {
@ -133,7 +151,9 @@
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateLngBPriceTerm(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
@ -142,7 +162,9 @@
try {
state.formModel = values;
let saveVal = await addLngBPriceTerm(values);
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
await submitFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
@ -167,16 +189,20 @@
}
state.formModel = formModels;
if(formModels[RowKey]) {
setFormDataFromId(formModels[RowKey], false);
setFormDataFromId(formModels[RowKey], false)
} else {
setFieldsValue(formModels);
setFieldsValue(formModels)
}
} catch (error) {}
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
await createFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
}
function getFormModel() {
return systemFormRef.value.formModel;
return systemFormRef.value.formModel
}
async function handleDelete(id) {
return await deleteLngBPriceTerm([id]);

View File

@ -1,7 +1,9 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive } from 'vue';
@ -21,7 +23,7 @@
isUpdate: true,
isView: false,
isCopy: false,
rowId: ''
rowId: '',
});
const { t } = useI18n();
@ -36,7 +38,7 @@
showCancelBtn: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 900
width: 900,
});
if (state.isUpdate || state.isView || state.isCopy) {
state.rowId = data.id;
@ -85,12 +87,12 @@
//false 新增
notification.success({
message: 'Tip',
description: t('新增成功!')
description: t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!')
description: t('修改成功!'),
}); //提示消息
}
closeModal();

View File

@ -6,47 +6,11 @@ export const formConfig = {
};
export const searchFormSchema: FormSchema[] = [
{
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'fullName',
label: '名称',
component: 'Input',
},
{
field: 'freightSign',
label: '是否承担运费',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1978056598125330433' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'insuranceSign',
label: '是否承担保险',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1978056598125330433' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
field: 'sort',
label: '显示顺序',
component: 'Input',
},
{
field: 'valid',
label: '有效标志',
@ -60,11 +24,6 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
component: 'Input',
},
];
export const columns: BasicColumn[] = [
@ -104,15 +63,6 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'sort',
title: '显示顺序',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'valid',
title: '有效标志',
@ -125,7 +75,7 @@ export const columns: BasicColumn[] = [
{
dataIndex: 'note',
title: '备注',
componentType: 'input',
componentType: 'textarea',
align: 'left',
sorter: true,
@ -201,7 +151,7 @@ export const formProps: FormProps = {
size: 'default',
schemas: [
{
key: 'd35dce42c1e44fb0a865ce284729b071',
key: 'e5b395b24d214214a16951d8df4e2004',
field: 'code',
label: '编码',
type: 'input',
@ -225,7 +175,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -235,7 +185,7 @@ export const formProps: FormProps = {
},
},
{
key: 'a5fcbf1205f3405f9a377cdacbfe2360',
key: '86536f9d2e8c473b8821c9216c765c9c',
field: 'fullName',
label: '名称',
type: 'input',
@ -259,7 +209,7 @@ export const formProps: FormProps = {
disabled: false,
allowClear: false,
showLabel: true,
required: false,
required: true,
rules: [],
events: {},
isSave: false,
@ -269,7 +219,7 @@ export const formProps: FormProps = {
},
},
{
key: 'fe4977ec486f4e949e13656d0614af30',
key: '38c7f7488fe24254a1a939fa9b445657',
field: 'freightSign',
label: '是否承担运费',
type: 'select',
@ -288,7 +238,7 @@ export const formProps: FormProps = {
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
mode: '',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
@ -305,7 +255,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
@ -314,7 +264,7 @@ export const formProps: FormProps = {
},
},
{
key: 'fb97e7c3e4a64c8aacdbc2e12f6b31c4',
key: '10bfa57236b74a5f9a680e9bc5861d55',
field: 'insuranceSign',
label: '是否承担保险',
type: 'select',
@ -333,7 +283,7 @@ export const formProps: FormProps = {
showSearch: false,
clearable: false,
disabled: false,
mode: 'multiple',
mode: '',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
@ -350,7 +300,7 @@ export const formProps: FormProps = {
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
required: true,
rules: [],
events: {},
isShow: true,
@ -359,41 +309,7 @@ export const formProps: FormProps = {
},
},
{
key: 'edf99f70403b49399daf3df6e956e0e9',
field: 'sort',
label: '显示顺序',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请输入显示顺序',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: '34054c282479487ba146136da7b81ceb',
key: 'd1feff0a3b454fa4a29c53355ab6c9cd',
field: 'valid',
label: '有效标志',
type: 'select',
@ -411,7 +327,7 @@ export const formProps: FormProps = {
showLabel: true,
showSearch: false,
clearable: false,
disabled: false,
disabled: true,
mode: 'multiple',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
@ -438,11 +354,11 @@ export const formProps: FormProps = {
},
},
{
key: '8c025f7b82754e5e84204a316e305ba8',
key: '297be674c3e84930a81ec6d92600e896',
field: 'note',
label: '备注',
type: 'input',
component: 'Input',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
@ -452,22 +368,19 @@ export const formProps: FormProps = {
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
respNewRow: false,
respNewRow: true,
placeholder: '请输入备注',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
maxlength: 400,
rows: 4,
autoSize: false,
showCount: true,
disabled: false,
allowClear: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},

View File

@ -11,7 +11,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: 'd35dce42c1e44fb0a865ce284729b071',
key: 'e5b395b24d214214a16951d8df4e2004',
children: [],
},
{
@ -26,7 +26,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'input',
key: 'a5fcbf1205f3405f9a377cdacbfe2360',
key: '86536f9d2e8c473b8821c9216c765c9c',
children: [],
},
{
@ -41,7 +41,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'select',
key: 'fe4977ec486f4e949e13656d0614af30',
key: '38c7f7488fe24254a1a939fa9b445657',
children: [],
},
{
@ -56,22 +56,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'select',
key: 'fb97e7c3e4a64c8aacdbc2e12f6b31c4',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '显示顺序',
fieldId: 'sort',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'edf99f70403b49399daf3df6e956e0e9',
key: '10bfa57236b74a5f9a680e9bc5861d55',
children: [],
},
{
@ -86,7 +71,7 @@ export const permissionList = [
isSubTable: false,
showChildren: true,
type: 'select',
key: '34054c282479487ba146136da7b81ceb',
key: 'd1feff0a3b454fa4a29c53355ab6c9cd',
children: [],
},
{
@ -100,8 +85,8 @@ export const permissionList = [
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8c025f7b82754e5e84204a316e305ba8',
type: 'textarea',
key: '297be674c3e84930a81ec6d92600e896',
children: [],
},
];

View File

@ -1,6 +1,7 @@
<template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
@ -23,7 +24,9 @@
</PageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
import { ref, computed, onMounted, onUnmounted, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
@ -35,7 +38,7 @@
import { usePermission } from '/@/hooks/web/usePermission';
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index';
import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngBPriceTerm } from '/@/api/mdm/PriceTerms';
import { useModal } from '/@/components/Modal';
import PriceTermsModal from './components/PriceTermsModal.vue';
@ -58,18 +61,12 @@
const tableRef = ref();
//所有按钮
const buttons = ref([
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
{ isUse: true, 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 }
]);
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"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":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'copyData', 'delete', 'startwork', 'flowRecord']);
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value);
});
})
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -79,34 +76,35 @@
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,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
const { currentRoute } = useRouter();
const router = useRouter();
const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId;
formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const [registerModal, { openModal }] = useModal();
const formName='价格条款管理';
const [registerTable, { reload }] = useTable({
title: '' || formName + '列表',
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
api: getLngBPriceTermPage,
rowKey: 'id',
columns: customConfigColums,
formConfig: {
rowProps: {
gutter: 16
gutter: 16,
},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false
showResetButton: false,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
},
useSearchForm: true,
showTableSetting: true,
@ -116,16 +114,17 @@
width: 160,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' }
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
setting: false
}
setting: false,
},
});
function dbClickRow(record) {
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return;
}
const { processId, taskIds, schemaId } = record.workflowData || {};
@ -161,6 +160,7 @@
}
function buttonClick(code) {
btnEvent[code]();
}
@ -182,6 +182,7 @@
}
function handleEdit(record: Recordable) {
router.push({
path: '/form/PriceTerms/' + record.id + '/updateForm',
query: {
@ -195,6 +196,62 @@
deleteList([record.id]);
}
function handleEnable() {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要启用的数据'),
});
return;
}
let ids = selectedKeys.value;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认启用?',
okText: '确认',
cancelText: '取消',
onOk() {
enableLngBPriceTerm(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('启用成功!'),
});
});
},
onCancel() {},
});
}
function handleDisable() {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要禁用的数据'),
});
return;
}
let ids = selectedKeys.value;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认禁用?',
okText: '确认',
cancelText: '取消',
onOk() {
disableLngBPriceTerm(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('禁用成功!'),
});
});
},
onCancel() {},
});
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
@ -207,24 +264,28 @@
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!')
description: t('删除成功!'),
});
});
},
onCancel() {}
onCancel() {},
});
}
function handleRefresh() {
reload();
}
function handleSuccess() {
reload();
}
function handleView(record: Recordable) {
dbClickRow(record);
}
onMounted(() => {
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
@ -244,20 +305,21 @@
}
});
function getActions(record: Recordable):ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) {
return {
icon: button?.icon,
tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record)
onClick: btnEvent[button.code].bind(null, record),
};
} else {
if (button.code === 'view') {
return {
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record)
onClick: btnEvent[button.code].bind(null, record),
};
} else {
return {};
@ -279,7 +341,7 @@
let btns= await mergeButtons(buttons.value,formId);
buttons.value=btns;
}
}
};
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {