Commit 7d34be9f by 董晓奇

添加报废车入库登记表页面,用以导入excel表格储存

parent d6f13c45
import { RokeVehicleInboundPageModel, RokeVehicleInboundPageParams, RokeVehicleInboundPageResult } from './model/BfcrkdjbModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/ckgl/bfcrkdjb/page',
List = '/ckgl/bfcrkdjb/list',
Info = '/ckgl/bfcrkdjb/info',
RokeVehicleInbound = '/ckgl/bfcrkdjb',
Export = '/ckgl/bfcrkdjb/export',
}
/**
* @description: 查询RokeVehicleInbound分页列表
*/
export async function getRokeVehicleInboundPage(params: RokeVehicleInboundPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeVehicleInboundPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取RokeVehicleInbound信息
*/
export async function getRokeVehicleInbound(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeVehicleInboundPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增RokeVehicleInbound
*/
export async function addRokeVehicleInbound(rokeVehicleInbound: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.RokeVehicleInbound,
params: rokeVehicleInbound,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新RokeVehicleInbound
*/
export async function updateRokeVehicleInbound(rokeVehicleInbound: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.RokeVehicleInbound,
params: rokeVehicleInbound,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除RokeVehicleInbound(批量删除)
*/
export async function deleteRokeVehicleInbound(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.RokeVehicleInbound,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 导出RokeVehicleInbound
*/
export async function exportRokeVehicleInbound(
params?: object,
mode: ErrorMessageMode = 'modal'
) {
return defHttp.download(
{
url: Api.Export,
method: 'GET',
params,
responseType: 'blob',
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: RokeVehicleInbound分页参数 模型
*/
export interface RokeVehicleInboundPageParams extends BasicPageParams {
id: string;
batchNo: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
serialNumber: string;
expiryDate: string;
arrivalDate: string;
sender: string;
plateNumber: string;
vehicleType: string;
brandModel: string;
weightKg: string;
mainLine: string;
aluminumWheel: string;
battery: string;
radiator: string;
generator: string;
starter: string;
compressor: string;
relay: string;
batteryCable: string;
catalyticConverter: string;
vin: string;
fiveMajorAssemblies: string;
plateCount: string;
archiveResult: string;
archiveDate: string;
inspector: string;
remarks: string;
}
/**
* @description: RokeVehicleInbound分页返回值模型
*/
export interface RokeVehicleInboundPageModel {
id: string;
serialNumber: string;
expiryDate: string;
arrivalDate: string;
sender: string;
plateNumber: string;
vehicleType: string;
brandModel: string;
weightKg: string;
mainLine: string;
aluminumWheel: string;
battery: string;
radiator: string;
generator: string;
starter: string;
compressor: string;
relay: string;
batteryCable: string;
catalyticConverter: string;
vin: string;
fiveMajorAssemblies: string;
plateCount: string;
archiveResult: string;
archiveDate: string;
inspector: string;
remarks: string;
createDate: string;
batchNo: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: RokeVehicleInbound表类型
*/
export interface RokeVehicleInboundModel {
id: string;
batchNo: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
serialNumber: string;
expiryDate: string;
arrivalDate: string;
sender: string;
plateNumber: string;
vehicleType: string;
brandModel: string;
weightKg: string;
mainLine: string;
aluminumWheel: string;
battery: string;
radiator: string;
generator: string;
starter: string;
compressor: string;
relay: string;
batteryCable: string;
catalyticConverter: string;
vin: string;
fiveMajorAssemblies: string;
plateCount: string;
archiveResult: string;
archiveDate: string;
inspector: string;
remarks: string;
}
/**
* @description: RokeVehicleInbound分页返回值结构
*/
export type RokeVehicleInboundPageResult = BasicFetchResult<RokeVehicleInboundPageModel>;
<template>
<BasicModal
:bodyStyle="{ minHeight: '400px !important' }"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
<a-button
:type="item.style"
v-else
:style="{ marginLeft: index > 0 ? '10px' : 0 }"
@click="customClick(item)"
>
{{ t(item.name) }}
</a-button>
</template>
</template>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
rowId: '',
});
provide<Ref<boolean>>('isCopy', isCopy);
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
async function handleInner(data){
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: false,
showOkBtn: false,
canFullscreen: true,
width: 900,
footer: state.isView ? null : undefined,defaultFullscreen:true,
});
if (state.isUpdate || state.isView || isCopy.value) {
state.rowId = data.id;
if (state.isView) {
await formRef.value.setDisabledForm();
}
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
const values = await formRef.value?.validate();
//添加隐藏组件
if (formProps.hiddenComponent?.length) {
formProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
if (values !== false) {
try {
if (!state.isUpdate || isCopy.value) {
saveSuccess = await formRef.value.add(values);
} else {
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
}
return saveSuccess;
} catch (error) {}
}
} catch (error) {
return saveSuccess;
}
}
async function handleSubmit() {
try {
const saveSuccess = await saveModal();
setModalProps({ confirmLoading: true });
if (saveSuccess) {
if (!state.isUpdate || isCopy.value) {
//false 新增
notification.success({
message: 'Tip',
description: isCopy.value ? '复制成功' : t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!'),
}); //提示消息
}
closeModal();
formRef.value.resetFields();
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
handleClose();
closeModal();
} else if (item.key == 'reset') {
formRef.value.resetFields();
} else {
executeCurFormEvent(item.event, state.formModel, true);
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
<template>
<div class="pt-4">
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
:isCamelCase="true"
@model-change="handleChange"
/>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addRokeVehicleInbound, getRokeVehicleInbound, updateRokeVehicleInbound } from '/@/api/ckgl/bfcrkdjb';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum';
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';
const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
});
const { currentRoute } = useRouter();
watch(
() => state.formModel,
(val) => {
emits('update:value', val);
},
{
deep: true,
},
);
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
if(currentRoute.value.meta){
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await nextTick();
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
} else if (props.fromPage == FromPageType.PREVIEW) {
// 预览 无需权限,表单事件也无需执行
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
}
// 校验form 通过返回表单数据
async function validate() {
let values = [];
try {
values = await systemFormRef.value?.validate();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getRokeVehicleInbound(rowId);
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
} catch (error) {
}
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
try {
values = await systemFormRef.value?.getFieldsValue();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateRokeVehicleInbound(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addRokeVehicleInbound(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName;
let flowData = await changeWorkFlowForm(cloneDeep(formProps), obj);
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
data.formDataProps = buildOptionJson;
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
if (isViewProcess) {
setDisabledForm(); //查看
}
state.formModel = formModels;
setFieldsValue(formModels);
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe();
}
} catch (error) {}
}
defineExpose({
setFieldsValue,
resetFields,
validate,
add,
update,
setFormDataFromId,
setDisabledForm,
setMenuPermission,
setWorkFlowForm,
getRowKey,
getFieldsValue,
sendMessageForAllIframe
});
</script>
\ No newline at end of file
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'batchNo',
label: '批次号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'createDate',
label: '创建时间',
defaultValue: undefined,
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm:ss',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
{
field: 'expiryDate',
label: '过期日期',
defaultValue: undefined,
component: 'Input',
},
{
field: 'arrivalDate',
label: '到厂日期',
defaultValue: undefined,
component: 'Input',
},
{
field: 'sender',
label: '送车单位/个人',
defaultValue: undefined,
component: 'Input',
},
{
field: 'plateNumber',
label: '车牌号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'vehicleType',
label: '车型',
defaultValue: undefined,
component: 'Input',
},
{
field: 'brandModel',
label: '品牌型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'weightKg',
label: '车重(kg)',
defaultValue: undefined,
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'archiveResult',
label: '核档结果',
defaultValue: undefined,
component: 'Input',
},
{
field: 'archiveDate',
label: '核档日期',
defaultValue: undefined,
component: 'Input',
},
{
field: 'inspector',
label: '查验员',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
title: '创建时间',
resizable: true,
dataIndex: 'createDate',
componentType: 'date',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '批次号',
resizable: true,
dataIndex: 'batchNo',
componentType: 'auto-code',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '序号',
resizable: true,
dataIndex: 'serialNumber',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '过期日期',
resizable: true,
dataIndex: 'expiryDate',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '到厂日期',
resizable: true,
dataIndex: 'arrivalDate',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '送车单位/个人',
resizable: true,
dataIndex: 'sender',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '车牌号',
resizable: true,
dataIndex: 'plateNumber',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '车型',
resizable: true,
dataIndex: 'vehicleType',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '品牌型号',
resizable: true,
dataIndex: 'brandModel',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '车重(kg)',
resizable: true,
dataIndex: 'weightKg',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '主线',
resizable: true,
dataIndex: 'mainLine',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '铝轮毂',
resizable: true,
dataIndex: 'aluminumWheel',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '电瓶',
resizable: true,
dataIndex: 'battery',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '水箱',
resizable: true,
dataIndex: 'radiator',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '发电机',
resizable: true,
dataIndex: 'generator',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '起动机',
resizable: true,
dataIndex: 'starter',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '压缩机',
resizable: true,
dataIndex: 'compressor',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '继电器',
resizable: true,
dataIndex: 'relay',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '电瓶接引线',
resizable: true,
dataIndex: 'batteryCable',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '三元催化',
resizable: true,
dataIndex: 'catalyticConverter',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '车架号',
resizable: true,
dataIndex: 'vin',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '五大总成',
resizable: true,
dataIndex: 'fiveMajorAssemblies',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '车牌数量',
resizable: true,
dataIndex: 'plateCount',
componentType: 'computational',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
title: '核档结果',
resizable: true,
dataIndex: 'archiveResult',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '核档日期',
resizable: true,
dataIndex: 'archiveDate',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '查验员',
resizable: true,
dataIndex: 'inspector',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
title: '备注',
resizable: true,
dataIndex: 'remarks',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
];
// 需要转换的字段列表(根据实际 dataIndex 补充)
const booleanFields = [
'mainLine', // 主线
'aluminumWheel', // 铝轮毂
'battery', // 电瓶
'radiator', // 水箱
'generator', // 发电机
'starter', // 起动机
'compressor', // 压缩机
'relay', // 继电器
'batteryCable', // 电瓶接引线
'catalyticConverter', // 三元催化
'vin', // 车架号
'fiveMajorAssemblies', // 五大总成
];
columns.forEach((col) => {
if (typeof col.dataIndex === 'string' && booleanFields.includes(col.dataIndex)) {
col.customRender = ({ text }) => {
// 处理数字或字符串类型的 1/0
if (text === 1 || text === '1') return '√';
if (text === 0 || text === '0') return '×';
return text; // 保留其他值
};
}
});
//表头合并配置
export const headerMergingData = [];
//表单事件
export const formEventConfigs = {
0: [
{
type: 'circle',
color: '#2774ff',
text: '开始节点',
icon: '#icon-kaishi',
bgcColor: '#D8E5FF',
isUserDefined: false,
},
{
color: '#F6AB01',
icon: '#icon-chushihua',
text: '初始化表单',
bgcColor: '#f9f5ea',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
1: [
{
color: '#B36EDB',
icon: '#icon-shujufenxi',
text: '获取表单数据',
detail: '(新增无此操作)',
bgcColor: '#F8F2FC',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
2: [
{
color: '#F8625C',
icon: '#icon-jiazai',
text: '加载表单',
bgcColor: '#FFF1F1',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
3: [
{
color: '#6C6AE0',
icon: '#icon-jsontijiao',
text: '提交表单',
bgcColor: '#F5F4FF',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
4: [
{
type: 'circle',
color: '#F8625C',
text: '结束节点',
icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6',
isLast: true,
isUserDefined: false,
},
],
};
export const formProps: FormProps = {
labelCol: { span: 6, offset: 0 },
labelAlign: 'right',
layout: 'vertical',
size: 'default',
schemas: [
{
key: 'cedc0f0f12f04615bc900247348c6536',
field: 'id',
label: 'id',
type: 'input',
component: 'Input',
colProps: { span: 0 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入id',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '3f07319b71f04dbcb370fd945d3a80ce',
field: 'createDate',
label: '创建时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 0 },
defaultValue: '',
componentProps: {
span: '',
defaultValue: '',
width: '100%',
placeholder: '请选择创建时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: false,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '32e9d3f811404c18bf0aba9a92fa5c92',
field: 'createUserId',
label: '创建人',
type: 'input',
component: 'Input',
colProps: { span: 0 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入创建人',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'ba386bc0280c401b8c186beaed32eea7',
field: 'modifyDate',
label: '最后修改时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 0 },
defaultValue: '',
componentProps: {
span: '',
defaultValue: '',
width: '100%',
placeholder: '请选择最后修改时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: false,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '797715b598224431a15350587b9bf7b9',
field: 'modifyUserId',
label: '最后修改人',
type: 'input',
component: 'Input',
colProps: { span: 0 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入最后修改人',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '836618ba200a4cf4b79c614a3ebecd1d',
field: 'batchNo',
label: '批次号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 6 },
componentProps: {
width: '100%',
span: '',
placeholder: '请输入批次号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
showLabel: true,
autoCodeRule: 'bfcrkpch',
required: false,
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '5fba1de769354e10b1f21938d2f2c72c',
field: 'serialNumber',
label: '序号',
type: 'computational',
component: 'Computation',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
span: '',
width: '100%',
defaultValue: 0,
placeholder: '请输入序号',
addonBefore: '',
addonAfter: '',
prefix: '',
showLabel: true,
disabled: false,
subTotal: false,
computationalConfig: [],
computationalConfigValue: '== 请填写计算式配置 ==',
beAdoptedComponent: [],
decimals: 0,
required: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '28342be3ce2444c4a6adea99ab35c360',
field: 'expiryDate',
label: '过期日期',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入过期日期',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '4ebdec5505c242658bcc95916512c8f4',
field: 'arrivalDate',
label: '到厂日期',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入到厂日期',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'ddbe4729591845ac974d8b10f34b1e34',
field: 'sender',
label: '送车单位/个人',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入送车单位/个人',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '91d46bc97ab340a1879cbfcf3d7a4664',
field: 'plateNumber',
label: '车牌号',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入车牌号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '07e3959f2d5447bd80f521019f3df49e',
field: 'vehicleType',
label: '车型',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入车型',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'cb30020cbb644f64a7d531198eb42caa',
field: 'brandModel',
label: '品牌型号',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入品牌型号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'b6c5cda8c7e5494eae6b77dbeca33d9a',
field: 'weightKg',
label: '车重(kg)',
type: 'computational',
component: 'Computation',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
span: '',
width: '100%',
defaultValue: 0,
placeholder: '请输入车重(kg)',
addonBefore: '',
addonAfter: '',
prefix: '',
showLabel: true,
disabled: false,
subTotal: false,
computationalConfig: [],
computationalConfigValue: '== 请填写计算式配置 ==',
beAdoptedComponent: [],
decimals: 0,
required: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '2b9fd584fa0f430b9f4a75afaad02d1e',
field: 'mainLine',
label: '主线',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: 'f37e54d3589d43128bc03976d1e419cc',
field: 'aluminumWheel',
label: '铝轮毂',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '60a54b170d5a45e2bd2d6d646cf61993',
field: 'battery',
label: '电瓶',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '9ea1014d00ab476895ba0c5b14b31178',
field: 'radiator',
label: '水箱',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '47967672c734459f984cd055bc794618',
field: 'generator',
label: '发电机',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: 'e1fb609e9cbd4572a63399f4119c5056',
field: 'starter',
label: '起动机',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '84f901d31c9f4060968a6bf3d63a8fa8',
field: 'compressor',
label: '压缩机',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '7e05f9dbaac748d1a543153e79f0c3bd',
field: 'relay',
label: '继电器',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '9a57ed42c501447082549a404b169cde',
field: 'batteryCable',
label: '电瓶接引线',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: 'f1f6a8561a1a4cca8d7aad4e97461449',
field: 'catalyticConverter',
label: '三元催化',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: 'dd0673c15f994371aaa55359eda4052c',
field: 'vin',
label: '车架号',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: 'e64f4cc1de08458fba950a876f35a727',
field: 'fiveMajorAssemblies',
label: '五大总成',
type: 'Select',
component: 'Select',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
defaultValue: 0,
showLabel: true,
disabled: false,
required: false,
isShow: true,
options: [
{ label: '√', value: 1 },
{ label: '×', value: 0 },
],
getPopupContainer: () => document.body,
},
},
{
key: '571af4a6d985413d9885742320684167',
field: 'plateCount',
label: '车牌数量',
type: 'computational',
component: 'Computation',
colProps: { span: 6 },
defaultValue: 0,
componentProps: {
span: '',
width: '100%',
defaultValue: 0,
placeholder: '请输入车牌数量',
addonBefore: '',
addonAfter: '',
prefix: '',
showLabel: true,
disabled: false,
subTotal: false,
computationalConfig: [],
computationalConfigValue: '== 请填写计算式配置 ==',
beAdoptedComponent: [],
decimals: 0,
required: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '7136fcc2c455488baa5dd6f9deac2cd0',
field: 'archiveResult',
label: '核档结果',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入核档结果',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'f6a297e076aa477b93234e4634a33905',
field: 'archiveDate',
label: '核档日期',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入核档日期',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '38fc21bc5cb840b38780d2f0b0877337',
field: 'inspector',
label: '查验员',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入查验员',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'd025d08a14494e1c9faad8eedf9eb6a1',
field: 'remarks',
label: '备注',
type: 'input',
component: 'Input',
colProps: { span: 6 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入备注',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};
export const formButtons = [
{
key: 'confirm',
code: 'confirm',
name: '确定',
style: 'primary',
event: [],
isShow: true,
index: 2,
type: 1,
},
{
key: 'cancel',
code: 'cancel',
name: '取消',
style: 'default',
event: [],
isShow: true,
index: 1,
type: 1,
},
{
key: 'reset',
code: 'reset',
name: '重置',
style: 'default',
event: [],
isShow: true,
index: 0,
type: 1,
},
];
export const permissionList = [
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: 'id',
fieldId: 'id',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'cedc0f0f12f04615bc900247348c6536',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '批次号',
fieldId: 'batchNo',
isSubTable: false,
showChildren: true,
type: 'auto-code',
key: '836618ba200a4cf4b79c614a3ebecd1d',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '创建时间',
fieldId: 'createDate',
isSubTable: false,
showChildren: true,
type: 'date',
key: '3f07319b71f04dbcb370fd945d3a80ce',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '创建人',
fieldId: 'createUserId',
isSubTable: false,
showChildren: true,
type: 'input',
key: '32e9d3f811404c18bf0aba9a92fa5c92',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '最后修改时间',
fieldId: 'modifyDate',
isSubTable: false,
showChildren: true,
type: 'date',
key: 'ba386bc0280c401b8c186beaed32eea7',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '最后修改人',
fieldId: 'modifyUserId',
isSubTable: false,
showChildren: true,
type: 'input',
key: '797715b598224431a15350587b9bf7b9',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '序号',
fieldId: 'serialNumber',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '5fba1de769354e10b1f21938d2f2c72c',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '过期日期',
fieldId: 'expiryDate',
isSubTable: false,
showChildren: true,
type: 'input',
key: '28342be3ce2444c4a6adea99ab35c360',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '到厂日期',
fieldId: 'arrivalDate',
isSubTable: false,
showChildren: true,
type: 'input',
key: '4ebdec5505c242658bcc95916512c8f4',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '送车单位/个人',
fieldId: 'sender',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'ddbe4729591845ac974d8b10f34b1e34',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车牌号',
fieldId: 'plateNumber',
isSubTable: false,
showChildren: true,
type: 'input',
key: '91d46bc97ab340a1879cbfcf3d7a4664',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车型',
fieldId: 'vehicleType',
isSubTable: false,
showChildren: true,
type: 'input',
key: '07e3959f2d5447bd80f521019f3df49e',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '品牌型号',
fieldId: 'brandModel',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'cb30020cbb644f64a7d531198eb42caa',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车重(kg)',
fieldId: 'weightKg',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'b6c5cda8c7e5494eae6b77dbeca33d9a',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '主线',
fieldId: 'mainLine',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '2b9fd584fa0f430b9f4a75afaad02d1e',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '铝轮毂',
fieldId: 'aluminumWheel',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'f37e54d3589d43128bc03976d1e419cc',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '电瓶',
fieldId: 'battery',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '60a54b170d5a45e2bd2d6d646cf61993',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '水箱',
fieldId: 'radiator',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '9ea1014d00ab476895ba0c5b14b31178',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '发电机',
fieldId: 'generator',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '47967672c734459f984cd055bc794618',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '起动机',
fieldId: 'starter',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'e1fb609e9cbd4572a63399f4119c5056',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '压缩机',
fieldId: 'compressor',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '84f901d31c9f4060968a6bf3d63a8fa8',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '继电器',
fieldId: 'relay',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '7e05f9dbaac748d1a543153e79f0c3bd',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '电瓶接引线',
fieldId: 'batteryCable',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '9a57ed42c501447082549a404b169cde',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '三元催化',
fieldId: 'catalyticConverter',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'f1f6a8561a1a4cca8d7aad4e97461449',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车架号',
fieldId: 'vin',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'dd0673c15f994371aaa55359eda4052c',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '五大总成',
fieldId: 'fiveMajorAssemblies',
isSubTable: false,
showChildren: true,
type: 'computational',
key: 'e64f4cc1de08458fba950a876f35a727',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车牌数量',
fieldId: 'plateCount',
isSubTable: false,
showChildren: true,
type: 'computational',
key: '571af4a6d985413d9885742320684167',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '核档结果',
fieldId: 'archiveResult',
isSubTable: false,
showChildren: true,
type: 'input',
key: '7136fcc2c455488baa5dd6f9deac2cd0',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '核档日期',
fieldId: 'archiveDate',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'f6a297e076aa477b93234e4634a33905',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '查验员',
fieldId: 'inspector',
isSubTable: false,
showChildren: true,
type: 'input',
key: '38fc21bc5cb840b38780d2f0b0877337',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'remarks',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'd025d08a14494e1c9faad8eedf9eb6a1',
children: [],
options: {},
defaultValue: '',
},
];
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef">
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(button.code)">
<template #icon>
<Icon :icon="button.icon" />
</template>
{{ button.name }}
</a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
<a-button
v-else
:type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger="button.buttonType === 'danger'"
>
<template #icon>
<Icon :icon="button.icon" />
</template>
{{ button.name }}
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value')
}}</span>
</template>
</template>
</BasicTable>
</template>
<BfcrkdjbModal
@register="registerModal"
@success="handleFormSuccess"
@cancel="handleFormCancel"
/>
<ImportModal
@register="registerImportModal"
importUrl="/ckgl/bfcrkdjb/import"
@success="handleImportSuccess"
/>
<ExportModal
v-if="visibleExport"
@close="visibleExport = false"
:columns="columns"
@success="handleExportSuccess"
/>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed, provide, Ref, createVNode } from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import {
getRokeVehicleInboundPage,
deleteRokeVehicleInbound,
exportRokeVehicleInbound,
} from '/@/api/ckgl/bfcrkdjb';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle'; //列表样式配置
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import BfcrkdjbModal from './components/BfcrkdjbModal.vue';
import { ImportModal } from '/@/components/Import';
import { downloadByData } from '/@/utils/file/download';
import ExportModal from '/@/views/form/template/components/ExportModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({});
const {
enableLockeData,
handleOpenFormEnableLockeData,
handleCloseFormEnableLocke,
handleHasEnableLocke,
} = useConcurrentLock();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
const visibleExport = ref(false);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => {
const list = [
{
buttonId: '2032683995409362944',
name: '查看',
code: 'view',
icon: 'ant-design:eye-outlined',
isDefault: true,
isUse: true,
},
{
buttonId: '2032683995409362945',
name: '新增',
code: 'add',
icon: 'ant-design:plus-outlined',
isDefault: true,
isUse: true,
},
{
buttonId: '2032683995409362946',
name: '编辑',
code: 'edit',
icon: 'ant-design:form-outlined',
isDefault: true,
isUse: true,
isEnableLock: true,
},
{
buttonId: '2032683995409362947',
name: '快速导入',
code: 'import',
icon: 'ant-design:import-outlined',
isDefault: true,
isUse: true,
},
{
buttonId: '2032683995409362948',
name: '快速导出',
code: 'export',
icon: 'ant-design:export-outlined',
isDefault: true,
isUse: true,
},
{
buttonId: '2032683995409362949',
name: '删除',
code: 'delete',
icon: 'ant-design:delete-outlined',
isDefault: true,
isUse: true,
},
];
return filterButtonAuth(list);
});
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {
view: handleView,
add: handleAdd,
edit: handleEdit,
import: handleImport,
export: handleExport,
delete: handleDelete,
};
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const [registerModal, { openModal }] = useModal();
const [registerImportModal, { openModal: openImportModal }] = useModal();
const [registerTable, { reload }] = useTable({
title: 'Bfcrkdjb列表',
api: getRokeVehicleInboundPage,
rowKey: 'id',
columns: filterColumns,
pagination: {
pageSize: 10,
},
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [
['createDate', ['createDateStart', 'createDateEnd'], 'YYYY-MM-DD HH:mm:ss ', true],
['modifyDate', ['modifyDateStart', 'modifyDateEnd'], 'YYYY-MM-DD HH:mm:ss ', true],
],
showResetButton: false,
},
bordered: false,
beforeFetch: (params) => {
pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return pageParamsInfo.value;
},
afterFetch: (res) => {},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 195,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
},
customRow,
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
openModal(true, { isUpdate: false });
}
async function handleEdit(record: Recordable) {
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) {
let res = await handleOpenFormEnableLockeData(record[field], formIdComputedRef.value);
if (res !== null) {
return;
}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteRokeVehicleInbound(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission('bfcrkdjb:edit')) {
handleEdit(record);
}
},
};
}
function handleSuccess() {
reload();
}
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info = {
isView: true,
id: record.id,
};
openModal(true, info);
}
async function handleExport() {
visibleExport.value = true;
}
async function handleExportSuccess(cols) {
const res = await exportRokeVehicleInbound({
isTemplate: false,
columns: cols.toString(),
...pageParamsInfo.value,
});
visibleExport.value = false;
downloadByData(
res.data,
'Bfcrkdjb.xlsx',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
);
reload();
}
function handleImport() {
openImportModal(true, {
title: '快速导入',
downLoadUrl: '/ckgl/bfcrkdjb/export',
});
}
function handleImportSuccess() {
reload();
}
function getLessActions(record: Recordable) {
let list = getActions(record);
return list.slice(0, listSpliceNum.value);
}
function getMoreActions(record: Recordable) {
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable): ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `bfcrkdjb:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record),
});
} else {
if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({
auth: `bfcrkdjb:${button.code}`,
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show {
display: flex;
}
.hide {
display: none !important;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment