重新生成币种和价格

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', 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分页参数 模型 * @description: LngBCurrency分页参数 模型
*/ */
export interface LngBCurrencyPageParams extends BasicPageParams { export interface LngBCurrencyPageParams extends BasicPageParams {
code: string;
fullName: string; fullName: string;
currSymbol: string; valid: string;
code: string;
localSign: string; localSign: string;
sort: string;
valid: string;
note: string; note: string;
} }
@ -29,12 +25,8 @@ export interface LngBCurrencyPageModel {
fullName: string; fullName: string;
currSymbol: string;
localSign: string; localSign: string;
sort: string;
valid: string; valid: string;
note: string; note: string;

View File

@ -9,6 +9,11 @@ enum Api {
LngBPriceTerm = '/mdm/priceTerms', 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分页参数 模型 * @description: LngBPriceTerm分页参数 模型
*/ */
export interface LngBPriceTermPageParams extends BasicPageParams { export interface LngBPriceTermPageParams extends BasicPageParams {
code: string;
fullName: string; fullName: string;
freightSign: string;
insuranceSign: string;
sort: string;
valid: string; valid: string;
note: string;
} }
/** /**
@ -33,49 +23,12 @@ export interface LngBPriceTermPageModel {
insuranceSign: string; insuranceSign: string;
sort: string;
valid: string; valid: string;
note: string; note: string;
} }
/** 0;
* @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;
}
/** /**
* @description: LngBPriceTerm分页返回值结构 * @description: LngBPriceTerm分页返回值结构

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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