Commit 28e0e265 by 张恒

feat(scgl): 添加报工记录管理功能

- 创建报工记录模态框组件,支持新增、编辑、查看和复制功能
- 定义报工记录相关数据模型,包括报告、数据采集、物料投料、质量检验等表类型
- 配置报工记录表单字段,包含产品信息、车间产线、工序时间等完整业务字段
- 实现报工记录表格列配置,支持按编号和执行标准搜索筛选
- 集成用户选择器和关联下拉框等表单组件,完善数据录入交互体验
parent 0c7e68dc
import { MesGongdanReportPageModel, MesGongdanReportPageParams, MesGongdanReportPageResult } from './model/BgjlModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/scgl/bgjl/page',
List = '/scgl/bgjl/list',
Info = '/scgl/bgjl/info',
MesGongdanReport = '/scgl/bgjl',
}
/**
* @description: 查询MesGongdanReport分页列表
*/
export async function getMesGongdanReportPage(params: MesGongdanReportPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesGongdanReportPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesGongdanReport信息
*/
export async function getMesGongdanReport(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesGongdanReportPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增MesGongdanReport
*/
export async function addMesGongdanReport(mesGongdanReport: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.MesGongdanReport,
params: mesGongdanReport,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新MesGongdanReport
*/
export async function updateMesGongdanReport(mesGongdanReport: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.MesGongdanReport,
params: mesGongdanReport,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除MesGongdanReport(批量删除)
*/
export async function deleteMesGongdanReport(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.MesGongdanReport,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: MesGongdanReport分页参数 模型
*/
export interface MesGongdanReportPageParams extends BasicPageParams {
bh: string;
zxbz: string;
}
/**
* @description: MesGongdanReport分页返回值模型
*/
export interface MesGongdanReportPageModel {
id: string;
bh: string;
cpbh: string;
zxbz: string;
cpid: string;
bgr: string;
zyr: string;
kssj: string;
jssj: string;
}
/**
* @description: MesGongdanReport表类型
*/
export interface MesGongdanReportModel {
id: string;
gdId: string;
deleteMark: string;
bh: string;
bgbh: string;
gdbh: string;
rch: string;
zch: string;
cpbh: string;
hj: string;
cplb: string;
rzl: string;
zxbz: string;
gx: string;
wgs: string;
gs: string;
bgsj: string;
bgr: string;
bgzz: string;
zyr: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
sccx: string;
sccj: string;
gzzx: string;
gxId: string;
kssj: string;
jssj: string;
hgs: string;
mesGongdanDataCollectionList?: MesGongdanDataCollectionModel;
mesGongdanMaterialFeedingList?: MesGongdanMaterialFeedingModel;
mesGongdanQualityInspectionList?: MesGongdanQualityInspectionModel;
mesGongdanScCollectionList?: MesGongdanScCollectionModel;
}
/**
* @description: MesGongdanDataCollection表类型
*/
export interface MesGongdanDataCollectionModel {
id: string;
deleteMark: string;
gdId: string;
cjx: string;
cjz: string;
bzz: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: MesGongdanMaterialFeeding表类型
*/
export interface MesGongdanMaterialFeedingModel {
id: string;
deleteMark: string;
gdId: string;
wlbh: string;
wlmc: string;
tlsl: string;
tlr: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: MesGongdanQualityInspection表类型
*/
export interface MesGongdanQualityInspectionModel {
id: string;
deleteMark: string;
gdId: string;
zjdh: string;
zjjg: string;
jyy: string;
zjsj: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: MesGongdanScCollection表类型
*/
export interface MesGongdanScCollectionModel {
id: string;
deleteMark: string;
gdId: string;
cjx: string;
cjz: string;
bzz: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
p7: string;
p8: string;
p9: string;
p10: string;
p11: string;
p12: string;
p13: string;
p14: string;
p15: string;
p16: string;
p17: string;
p18: string;
p19: string;
p20: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
/**
* @description: MesGongdanReport分页返回值结构
*/
export type MesGongdanReportPageResult = BasicFetchResult<MesGongdanReportPageModel>;
<template>
<BasicModal
:height="800"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
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: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 1500,
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 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 { addMesGongdanReport, getMesGongdanReport, updateMesGongdanReport } from '/@/api/scgl/bgjl';
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 getMesGongdanReport(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 updateMesGongdanReport(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 addMesGongdanReport(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: 'bh',
label: '记录编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'zxbz',
label: '执行标准',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bh',
title: '记录编号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpbh',
title: '产品编号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'zxbz',
title: '执行标准',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'cpid',
title: '产品名称',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bgr',
title: '报工人',
componentType: 'user',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'zyr',
title: '作业人',
componentType: 'user',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'kssj',
title: '计划开始时间',
componentType: 'date',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'jssj',
title: '计划结束时间',
componentType: 'date',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
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: 3, offset: 0 },
labelAlign: 'right',
layout: 'horizontal',
size: 'default',
schemas: [
{
key: 'f1c029ad704b4054b1e91d6a2f423b03',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: 'df5c1685093f448bb7314bd319a76c22',
field: 'bh',
label: '记录编号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
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: '543f2a341e2e47c5b7728aa9f64e5b61',
field: 'zxbz',
label: '执行标准',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
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: '07145a88be434a6b94850f07a17ff369',
field: 'cpbh',
label: '产品编号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
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: 'edcec677be334cd98a30ffb49501d2e1',
field: 'cpid',
label: '产品名称',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProduct',
method: 'GET',
apiId: 'copy1767517099244d66500',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select *,id as value,cpmc as label from mes_base_product_info where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2003761375221407745',
style: { width: '100%' },
},
},
{
key: 'd0c90eff4a8d4484afcfd4d8501c8e4b',
field: 'hj',
label: '合金标准',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '标准1', value: '标准1' }],
defaultSelect: '',
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scrw/getAllChejian',
method: 'GET',
apiId: '59730efb7b4a4439a013cac04926e00e',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql='select *,id as value,cjmc as label from mes_base_chejian where delete_mark=0'\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '0b571887e8864132b5287306f1b4c5a8',
field: 'cplb',
label: '产品类型',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'dic',
params: { itemId: '2003761375221407745' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2003761375221407745',
style: { width: '100%' },
},
},
{
key: 'd08395996c654ea88ff28ca32ba63cc1',
field: 'bgr',
label: '报工人',
type: 'user',
component: 'User',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
width: '100%',
defaultValue: '',
placeholder: '',
userType: 0,
prefix: '',
suffix: 'ant-design:user-outlined',
showLabel: true,
disabled: false,
required: false,
multiple: false,
isShow: true,
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '241eb88734074a9fa8a8ad1a52250b2c',
field: 'zyr',
label: '作业人',
type: 'user',
component: 'User',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
width: '100%',
defaultValue: '',
placeholder: '',
userType: 0,
prefix: '',
suffix: 'ant-design:user-outlined',
showLabel: true,
disabled: false,
required: false,
multiple: false,
isShow: true,
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '067a782909fe43aca1f96fe9bf0e9f31',
field: 'bgzz',
label: '报工班组',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '1组', value: '1组' }],
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2003761375221407745',
defaultSelect: '',
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'e439465000834adeb3e48c8cacb93715',
field: 'gdbh',
label: '工单编号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
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: '129f257640b143578df327739109cd98',
field: 'sccj',
label: '生产车间',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '',
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scrw/getAllChejian',
method: 'GET',
apiId: '59730efb7b4a4439a013cac04926e00e',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql='select *,id as value,cjmc as label from mes_base_chejian where delete_mark=0'\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'a8a4a06e96964f2a9d7ea44f1ecc0feb',
field: 'sccx',
label: '生产产线',
type: 'associate-select',
component: 'AssociateSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scrw/getCxByCjbh',
method: 'GET',
apiId: 'ecbc0291292c49fca50468561b9770e8',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'cjid',
value:
'{"bindField":"sccj","fieldKey":"129f257640b143578df327739109cd98"}',
required: true,
dataType: 'String',
defaultValue: '0',
bindType: 'data',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql='select cx.*,cx.id as value,cx.cxmc as label from mes_base_chanxian cx join mes_base_cj_cx rela on cx.id=rela.cxid where rela.delete_mark=0 and cx.delete_mark=0 and rela.cjid=#{cjid}'\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '9c0fa9d61565467b99cdc62892bda01a',
field: 'gzzx',
label: '工作中心',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx//cjcx/getAllGzzx',
method: 'GET',
apiId: 'cf582f4ea9814b769291c318c35cbb96',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,gzzxmc as label from mes_base_gzzx where delete_mark=0';\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'e8cd7b3390074ec5b4367e1ceb30d78d',
field: 'gxId',
label: '工序',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/gxlb',
method: 'GET',
apiId: '8a735bb14d5f4a709efb65b34691acd3',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select *,id as value,name as label from roke_process where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2003761375221407745',
style: { width: '100%' },
},
},
{
key: '545181bca5f94cdcac9051a9ed30c368',
field: 'bgsj',
label: '报工时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '请选择报工时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '097b043cc4e54622b3023e5344508276',
field: 'gs',
label: '工时',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 0.01,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '2ffb3db0cb0d42df9e7ff6f5dc63fbc6',
field: 'hgs',
label: '合格数',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 0.01,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'fada4c1222a94076a8e811c6489ce593',
field: 'zch',
label: '铸次号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
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: 'ea69ce78a15d42099050b621186fd831',
field: 'rzl',
label: '铸造量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 0.01,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'dca82bcd3e7b44dfa96df1bc5a8d3ff3',
field: 'rch',
label: '熔次号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
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: 'dc5d1cdc42b34094a3d6af5ee787e0df',
field: 'kssj',
label: '计划开始时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '请选择计划开始时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: '18a845043f1a44e4952c7255fb352aa5',
field: 'jssj',
label: '计划结束时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '请选择计划结束时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
{
key: 'd01e9984dad44089b367e932f00cbd7f',
field: 'bz',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入备注',
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 16,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
{
key: '5ddb609cd16c4f06a850181c1174b0d5',
field: '',
label: '',
type: 'tab',
colProps: { span: 24 },
component: 'Tab',
children: [
{
span: 24,
name: '数据采集详情',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '6858fe13441243c790a63bf5b974435b',
label: '',
field: 'mesGongdanDataCollectionList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesGongdanDataCollectionList',
columns: [
{
key: '89af383317a948508759eadd9d48adb6',
title: '采集项',
dataIndex: 'cjx',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'b17eaa6f85024c26b22c9551354e3c5a',
title: '采集值',
dataIndex: 'cjz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '63ab9a80ee1945399e73dd9310e91aa8',
title: '标准值',
dataIndex: 'bzz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '553e79c992b74ecb91c3bf3ccd2af87c',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
span: '24',
preloadType: 'api',
apiConfig: {},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: false,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 24,
name: '质检信息',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '24408a8dcca1423789dcdeff031e4d9f',
label: '',
field: 'mesGongdanQualityInspectionList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesGongdanQualityInspectionList',
columns: [
{
key: '62f5f554a68244f5b721f73d4c68988e',
title: '质检单号',
dataIndex: 'zjdh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '19ec9fc3d6394fcab8b472d857a4f31b',
title: '质检结果',
dataIndex: 'zjjg',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'e6d92e00e9da4bb59ca4e664119ae183',
title: '质检员',
dataIndex: 'jyy',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'c6d641ee7dfc4336ae157553c1a4e4e9',
title: '质检信息',
dataIndex: 'zjsj',
componentType: 'DatePicker',
defaultValue: '',
componentProps: {
span: '',
defaultValue: '',
width: '100%',
placeholder: '',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
},
},
{
key: '3b9215b704c74d9bad707adf6c04f50f',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
span: '24',
preloadType: 'api',
apiConfig: {},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: false,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 0,
name: '投料信息',
list: [
{
key: '3de87256379c41d18252370cb451630f',
label: '',
field: 'mesGongdanMaterialFeedingList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesGongdanMaterialFeedingList',
columns: [
{
key: 'd9196faf398347cd958ec21de698e780',
title: '物料编号',
dataIndex: 'wlbh',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'f255a9b82d6646d6ac6750c9fbf87329',
title: '物料名称',
dataIndex: 'wlmc',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '43490105227045229f2f1816f6ff8474',
title: '数量',
dataIndex: 'tlsl',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 0.01,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'c9f4ec8bb7a944d19f1e6ce4582c3509',
title: '投料人',
dataIndex: 'tlr',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '57d915aeb50f490cbe2970a29921989b',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
span: '24',
preloadType: 'api',
apiConfig: {},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: false,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 0,
name: '生产采集信息',
list: [
{
key: 'c9e3e41674b841a285aca529b7ef8a64',
label: '',
field: 'mesGongdanScCollectionList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesGongdanScCollectionList',
columns: [
{
key: '5e21bdbe50864ceba2f6e4a54f497427',
title: '采集项',
dataIndex: 'cjx',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'ee243d18029947e19f527e1b38417d3b',
title: '采集值',
dataIndex: 'cjz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '4d07e4bfe0224ba2ac17464973bc42dc',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
span: '24',
preloadType: 'api',
apiConfig: {},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: false,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};
export const permissionList = [
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '记录编号',
fieldId: 'bh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'df5c1685093f448bb7314bd319a76c22',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '执行标准',
fieldId: 'zxbz',
isSubTable: false,
showChildren: true,
type: 'input',
key: '543f2a341e2e47c5b7728aa9f64e5b61',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品编号',
fieldId: 'cpbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: '07145a88be434a6b94850f07a17ff369',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品名称',
fieldId: 'cpid',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'edcec677be334cd98a30ffb49501d2e1',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合金标准',
fieldId: 'hj',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'd0c90eff4a8d4484afcfd4d8501c8e4b',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品类型',
fieldId: 'cplb',
isSubTable: false,
showChildren: true,
type: 'select',
key: '0b571887e8864132b5287306f1b4c5a8',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '报工人',
fieldId: 'bgr',
isSubTable: false,
showChildren: true,
type: 'user',
key: 'd08395996c654ea88ff28ca32ba63cc1',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '作业人',
fieldId: 'zyr',
isSubTable: false,
showChildren: true,
type: 'user',
key: '241eb88734074a9fa8a8ad1a52250b2c',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '报工班组',
fieldId: 'bgzz',
isSubTable: false,
showChildren: true,
type: 'select',
key: '067a782909fe43aca1f96fe9bf0e9f31',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工单编号',
fieldId: 'gdbh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'e439465000834adeb3e48c8cacb93715',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '生产车间',
fieldId: 'sccj',
isSubTable: false,
showChildren: true,
type: 'select',
key: '129f257640b143578df327739109cd98',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '生产产线',
fieldId: 'sccx',
isSubTable: false,
showChildren: true,
type: 'associate-select',
key: 'a8a4a06e96964f2a9d7ea44f1ecc0feb',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工作中心',
fieldId: 'gzzx',
isSubTable: false,
showChildren: true,
type: 'select',
key: '9c0fa9d61565467b99cdc62892bda01a',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工序',
fieldId: 'gxId',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'e8cd7b3390074ec5b4367e1ceb30d78d',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '报工时间',
fieldId: 'bgsj',
isSubTable: false,
showChildren: true,
type: 'date',
key: '545181bca5f94cdcac9051a9ed30c368',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工时',
fieldId: 'gs',
isSubTable: false,
showChildren: true,
type: 'number',
key: '097b043cc4e54622b3023e5344508276',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '合格数',
fieldId: 'hgs',
isSubTable: false,
showChildren: true,
type: 'number',
key: '2ffb3db0cb0d42df9e7ff6f5dc63fbc6',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '铸次号',
fieldId: 'zch',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'fada4c1222a94076a8e811c6489ce593',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '铸造量',
fieldId: 'rzl',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'ea69ce78a15d42099050b621186fd831',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '熔次号',
fieldId: 'rch',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'dca82bcd3e7b44dfa96df1bc5a8d3ff3',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '计划开始时间',
fieldId: 'kssj',
isSubTable: false,
showChildren: true,
type: 'date',
key: 'dc5d1cdc42b34094a3d6af5ee787e0df',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '计划结束时间',
fieldId: 'jssj',
isSubTable: false,
showChildren: true,
type: 'date',
key: '18a845043f1a44e4952c7255fb352aa5',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: 'd01e9984dad44089b367e932f00cbd7f',
children: [],
options: {},
defaultValue: '',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesGongdanDataCollectionList',
fieldName: '',
fieldId: 'mesGongdanDataCollectionList',
type: 'form',
key: '6858fe13441243c790a63bf5b974435b',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanDataCollectionList',
fieldName: '采集项',
fieldId: 'cjx',
type: 'Input',
key: '89af383317a948508759eadd9d48adb6',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanDataCollectionList',
fieldName: '采集值',
fieldId: 'cjz',
type: 'Input',
key: 'b17eaa6f85024c26b22c9551354e3c5a',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanDataCollectionList',
fieldName: '标准值',
fieldId: 'bzz',
type: 'Input',
key: '63ab9a80ee1945399e73dd9310e91aa8',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanDataCollectionList',
fieldName: '备注',
fieldId: 'bz',
type: 'Input',
key: '553e79c992b74ecb91c3bf3ccd2af87c',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '',
fieldId: 'mesGongdanQualityInspectionList',
type: 'form',
key: '24408a8dcca1423789dcdeff031e4d9f',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检单号',
fieldId: 'zjdh',
type: 'Input',
key: '62f5f554a68244f5b721f73d4c68988e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检结果',
fieldId: 'zjjg',
type: 'Input',
key: '19ec9fc3d6394fcab8b472d857a4f31b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检员',
fieldId: 'jyy',
type: 'Input',
key: 'e6d92e00e9da4bb59ca4e664119ae183',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '质检信息',
fieldId: 'zjsj',
type: 'DatePicker',
key: 'c6d641ee7dfc4336ae157553c1a4e4e9',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanQualityInspectionList',
fieldName: '备注',
fieldId: 'bz',
type: 'Input',
key: '3b9215b704c74d9bad707adf6c04f50f',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '',
fieldId: 'mesGongdanMaterialFeedingList',
type: 'form',
key: '3de87256379c41d18252370cb451630f',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '物料编号',
fieldId: 'wlbh',
type: 'Input',
key: 'd9196faf398347cd958ec21de698e780',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '物料名称',
fieldId: 'wlmc',
type: 'Input',
key: 'f255a9b82d6646d6ac6750c9fbf87329',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '数量',
fieldId: 'tlsl',
type: 'InputNumber',
key: '43490105227045229f2f1816f6ff8474',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '投料人',
fieldId: 'tlr',
type: 'Input',
key: 'c9f4ec8bb7a944d19f1e6ce4582c3509',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanMaterialFeedingList',
fieldName: '备注',
fieldId: 'bz',
type: 'Input',
key: '57d915aeb50f490cbe2970a29921989b',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesGongdanScCollectionList',
fieldName: '',
fieldId: 'mesGongdanScCollectionList',
type: 'form',
key: 'c9e3e41674b841a285aca529b7ef8a64',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanScCollectionList',
fieldName: '采集项',
fieldId: 'cjx',
type: 'Input',
key: '5e21bdbe50864ceba2f6e4a54f497427',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanScCollectionList',
fieldName: '采集值',
fieldId: 'cjz',
type: 'Input',
key: 'ee243d18029947e19f527e1b38417d3b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesGongdanScCollectionList',
fieldName: '备注',
fieldId: 'bz',
type: 'Input',
key: '4d07e4bfe0224ba2ac17464973bc42dc',
children: [],
},
],
},
];
<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>
<BgjlModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</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 { getMesGongdanReportPage, deleteMesGongdanReport} from '/@/api/scgl/bgjl';
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 BgjlModal from './components/BgjlModal.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 actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2009529581437476864","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2009529581437476865","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2009529581437476866","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2009529581437476867","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,delete : handleDelete,}
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, }] = useTable({
title: 'Bgjl列表',
api: getMesGongdanReportPage,
rowKey: 'id',
columns: filterColumns,
pagination: {
pageSize: 10,
},
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [],
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() {
deleteMesGongdanReport(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("bgjl: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);
}
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: `bgjl:${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: `bgjl:${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>
\ No newline at end of file
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