Commit 9fda1878 by 张恒

feat(jcsj): 添加工艺路线配置和表单组件

- 新增 .idea/.gitignore 文件配置默认忽略规则
- 添加供应商类型配置文件 config.ts 包含搜索表单、表格列定义和表单属性配置
- 实现工艺管理表单组件 Form.vue 使用 SimpleForm 进行动态表单渲染
- 配置工艺明细子表单包含工序、质检设置和自动扣料功能模块
- 集成单件/批次号规则和工序数据的API接口配置
- 添加工艺路线的增删改查和数据验证功能
- 实现表单事件配置包括开始节点、数据获取、表单加载和提交等流程
- 配置工艺明细的额定工时、采集方案和作业规范等字段验证
- 添加自动扣料功能包括分车间扣料、自动确认和扣料节点设置
- 实现质检方式配置和子工序管理功能模块
parent 149074ae
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# 依赖于环境的 Maven 主目录路径
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/weiqiao-vue.iml" filepath="$PROJECT_DIR$/.idea/weiqiao-vue.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
{
"name": "weiqiao-vue",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}
import { RokeProcessPageModel, RokeProcessPageParams, RokeProcessPageResult } from './model/GxglModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/jcsj/gxgl/page',
List = '/jcsj/gxgl/list',
Info = '/jcsj/gxgl/info',
RokeProcess = '/jcsj/gxgl',
}
/**
* @description: 查询RokeProcess分页列表
*/
export async function getRokeProcessPage(params: RokeProcessPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeProcessPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取RokeProcess信息
*/
export async function getRokeProcess(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeProcessPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增RokeProcess
*/
export async function addRokeProcess(rokeProcess: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.RokeProcess,
params: rokeProcess,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新RokeProcess
*/
export async function updateRokeProcess(rokeProcess: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.RokeProcess,
params: rokeProcess,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除RokeProcess(批量删除)
*/
export async function deleteRokeProcess(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.RokeProcess,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: RokeProcess分页参数 模型
*/
export interface RokeProcessPageParams extends BasicPageParams {
name: string;
categoryId: string;
processType: string;
collectionItem: string;
note: string;
}
/**
* @description: RokeProcess分页返回值模型
*/
export interface RokeProcessPageModel {
id: string;
name: string;
categoryId: string;
processType: string;
collectionSchemeId: string;
note: string;
}
0;
/**
* @description: RokeProcess分页返回值结构
*/
export type RokeProcessPageResult = BasicFetchResult<RokeProcessPageModel>;
import { RokeRoutingPageModel, RokeRoutingPageParams, RokeRoutingPageResult } from './model/GylxModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/jcsj/gylx/page',
List = '/jcsj/gylx/list',
Info = '/jcsj/gylx/info',
RokeRouting = '/jcsj/gylx',
}
/**
* @description: 查询RokeRouting分页列表
*/
export async function getRokeRoutingPage(params: RokeRoutingPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeRoutingPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取RokeRouting信息
*/
export async function getRokeRouting(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<RokeRoutingPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增RokeRouting
*/
export async function addRokeRouting(rokeRouting: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.RokeRouting,
params: rokeRouting,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新RokeRouting
*/
export async function updateRokeRouting(rokeRouting: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.RokeRouting,
params: rokeRouting,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除RokeRouting(批量删除)
*/
export async function deleteRokeRouting(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.RokeRouting,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: RokeRouting分页参数 模型
*/
export interface RokeRoutingPageParams extends BasicPageParams {
name: string;
lotRuleId: string;
internalCode: string;
deductionBasis: string;
note: string;
}
/**
* @description: RokeRouting分页返回值模型
*/
export interface RokeRoutingPageModel {
id: string;
name: string;
lotRuleId: string;
deductionBasis: string;
note: string;
}
0;
/**
* @description: RokeRouting分页返回值结构
*/
export type RokeRoutingPageResult = BasicFetchResult<RokeRoutingPageModel>;
<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 { addRokeProcess, getRokeProcess, updateRokeProcess } from '/@/api/jcsj/gxgl';
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 getRokeProcess(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 updateRokeProcess(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 addRokeProcess(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
<template>
<BasicModal
:height="600"
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: 1200,
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
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'categoryId',
label: '工序类别',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/gxlb/getTypeList',
method: 'GET',
apiId: 'c1695a5b0fbe48e1817740557a3c5d4e',
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_category";\r\nreturn db.select(sql);',
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'processType',
label: '分类',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2001198355203006466' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'collectionItem',
label: '采集项',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2001194974510096385' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'name',
title: '名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'categoryId',
title: '工序类别',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'processType',
title: '分类',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'collectionSchemeId',
title: '采集方案',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [{ key: 1, label: '无', value: '无' }];
return staticOptions.filter((x) => x.value == record.collectionSchemeId)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
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: 'left',
layout: 'horizontal',
size: 'small',
schemas: [
{
key: '04fbf175bf2a4661a06e44126776617b',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: '60af544637c442bcb20cdbf2cd71a2c2',
field: 'name',
label: '名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'aa72d19636d540078e40a0dae8b90e3c',
field: 'defaultReporter',
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: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getEmployeeList',
method: 'GET',
apiId: 'copy1765432049337d61208',
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_employee where active = 1 and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'aabb539eede446daa35c754416cc50ae',
field: 'prepareWorkHours',
label: '是否委外',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 7,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#303030',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
{
key: '9b11a988a0cf4332876bf2c525fab878',
field: 'isPress',
label: '是否扣除工装生命周期',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 11,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#303030',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 8,
list: [
{
key: '16def0c2f9d8422da5d403e11b8c38e0',
field: 'categoryId',
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: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/gxlb/getTypeList',
method: 'GET',
apiId: 'c1695a5b0fbe48e1817740557a3c5d4e',
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_category";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'b228a5dee6274901924bd0b9eb675ec7',
field: 'processType',
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: null,
datasourceType: 'dic',
params: { itemId: '2001198355203006466' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"\nlet value = formModel.process_type;\n\nvar fieldConfigs = [\n {field: 'b02f8a3e28b24689bb5a311945bb2519,roke_process_childList'},\n //{field: 'name'},\n \n];\nfieldConfigs.forEach(function(config) {\n var isHidden = false;\n\n if (value == 2) {\n isHidden = true;\n }\n formActionType.updateSchema({\n field: config.field,\n componentProps: {\n hidden : isHidden\n }\n });\n});",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001198355203006466',
style: { width: '100%' },
},
},
{
key: 'fd9c2957fb694bffaa33fa125bc0e140',
field: 'withoutWoProduce',
label: '无工单报工记录产出物',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 12,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#303030',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 8,
list: [
{
key: '55d03e0607bc4ea281a248fdcfc571bb',
field: 'collectionSchemeId',
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: '无', value: '无' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'ca8257a46070472e9639110b11f7f3bd',
field: 'ratedWorkingHours',
label: '额定工时',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '54078d1dd17c465983be38829aaa9969',
field: 'collectionItem',
label: '采集项',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '',
showLabel: true,
showSearch: false,
isMultiple: true,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '环境温度', value: '环境温度' }],
defaultSelect: '',
datasourceType: 'dic',
params: { itemId: '2001194974510096385' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001194974510096385',
style: { width: '100%' },
},
},
{
key: 'e2c431530e954e53852f9a6026987e0d',
field: 'active',
label: '有效的',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 5,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#303030',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
],
componentProps: {
gutter: 2,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '',
margin: '10px',
},
},
{
key: '55f159dd3d1e42e8af2af341bd543c2a',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: 'a0cfa452347845d696cb160c3bf86691',
field: '',
label: '文本',
type: 'text',
component: 'Text',
colProps: { span: 24 },
defaultValue: '工单质检',
componentProps: {
defaultValue: '工单质检',
color: '',
align: 'left',
fontSize: 20,
fontWeight: 'bold',
fontFamily: 'Arial',
fontStyle: 'normal',
isShow: true,
padding: '',
margin: '10px',
span: 7,
style: {},
},
},
{
key: 'a8ad71f3a5334f79adcfd8c22d013598',
field: 'qualityMode',
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: 'dic',
params: { itemId: '2001225699288457217' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"let value = formModel.quality_mode;\nvar fieldConfigs = [\n {field: 'qc_salary_type'},\n {field: 'qc_salary_basis'},\n {field: 'qc_base_qty'},\n {field: 'qc_salary_unit'},\n {field: 'qc_salary'},\n {field: 'inspection_scheme'},\n {field: 'inspection_department'},\n {field: 'inspection_staff'},\n {field: 'defect_processing'},\n {field: 'zhi_jian_ji_xin_dan_wei9236'}\n \n];\nfieldConfigs.forEach(function(config) {\n var isHidden = false;\n\n if (value == 1) {\n isHidden = true;\n }\n formActionType.updateSchema({\n field: config.field,\n componentProps: {\n hidden: isHidden\n }\n });\n});",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001225699288457217',
style: { width: '100%' },
},
},
{
key: '9a8bade44b6a494ba761114ced745bcd',
field: 'qcSchemeId',
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: '无', value: '无' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'a1733daa77c64e4aa995a4a95cb37fdf',
field: 'inspectionCollectionItem',
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: '无', value: '无' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '90b68d6c9492410a9a564ea5d0684e64',
field: '',
label: '文本',
type: 'text',
component: 'Text',
colProps: { span: 24 },
defaultValue: '质检计薪',
componentProps: {
defaultValue: '质检计薪',
color: '',
align: 'left',
fontSize: 20,
fontWeight: 'bold',
fontFamily: 'Arial',
fontStyle: 'normal',
isShow: true,
padding: '',
margin: '10px',
span: 7,
style: {},
},
},
{
key: '1ae19160a0ac425e8e7923444ac67a5f',
field: 'qcSalaryType',
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: 'dic',
params: { itemId: '2001201026722996226' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: true,
rules: [],
events: {
change:
"// 获取计薪类型\nlet value = formModel.qc_salary_type;\n\n// 更新计薪单位字段\nfunction updateSalaryUnit() {\n var unitValue = '';\n \n if (value == 1) {\n unitValue = '产品单位';\n } else if (value == 2) {\n unitValue = '小时';\n } else if (value == 3) {\n unitValue = '次';\n }\n \n // 更新计薪单位字段\n formModel.qc_salary_unit = unitValue;\n console.log('计薪单位已更新为:', unitValue);\n}\n\n// 更新计薪规则字段(拼接字段)\nfunction updateSalaryRule() {\n // 获取相关字段值\n var baseQty = formModel.qc_base_qty || '0';\n var salaryUnit = formModel.qc_salary_unit || '';\n var salary = formModel.qc_salary || '0';\n \n // 拼接规则:基数 + 单位 + 薪酬\n var rule = '每 ' + baseQty + ' ' + salaryUnit + ' ' + salary + ' 元';\n \n // 更新计薪规则字段\n formModel.zhi_jian_ji_xin_dan_wei9236 = rule;\n console.log('计薪规则已更新为:', rule);\n}\n\n// 主要逻辑\nif (value == 1) {\n // 类型为1时:启用计薪基础字段\n formActionType.updateSchema({\n field: 'qc_salary_basis',\n componentProps: {\n disabled: false,\n required: true\n }\n });\n \n // 更新计薪单位\n updateSalaryUnit();\n \n} else {\n // 其他类型时:禁用计薪基础字段\n formActionType.updateSchema({\n field: 'qc_salary_basis',\n componentProps: {\n disabled: true,\n required: false\n }\n });\n \n // 更新计薪单位\n updateSalaryUnit();\n}\n\n// 更新计薪规则\nupdateSalaryRule();",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001201026722996226',
style: { width: '100%' },
},
},
{
key: '50e39cab7a8040df9c965cc9fd15684d',
field: 'qcSalaryBasis',
label: '质检工资依据',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: true,
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: 'dic',
params: { itemId: '2001226224419512321' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001226224419512321',
style: { width: '100%' },
},
},
{
key: '68fb0de7702a41af97590b2c5b2905d8',
field: 'qcBaseQty',
label: '质检计薪基数',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
width: '100%',
span: 7,
defaultValue: 1,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {
change:
"// 获取相关字段值\nvar baseQty = Number(formModel.qc_base_qty) || 0;\n\nvar salaryUnit = formModel.qc_salary_type || ''; \n\n\n// 薪酬\nvar salary = Number(formModel.qc_salary) || 0;\n\n\nvar salaryUnitText = '产品单位'; // 默认值\n\n\nif (salaryUnit === '1') {\n salaryUnitText = '产品单位';\n} else if (salaryUnit === '2' ) {\n salaryUnitText = '小时';\n} else if (salaryUnit === '3' ) {\n salaryUnitText = '次';\n} \n\n\nvar rule = '';\n\n// 拼接规则\nrule = `每 ${baseQty} ${salaryUnitText} ${salary} 元`;\n\nformModel.zhi_jian_ji_xin_dan_wei9236 = rule;\nconsole.log('拼接结果:', rule);\n\nreturn rule;",
},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '6a8b88a2b5564944b94a646f6ee7c893',
field: 'qcSalaryUnit',
label: '质检计薪单位',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
maxlength: null,
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: '66c726149fb6468089c3863ecc624d76',
field: 'qcSalary',
label: '质检薪酬',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {
change:
"// 获取相关字段值\nvar baseQty = Number(formModel.qc_base_qty) || 0;\n\nvar salaryUnit = formModel.qc_salary_type || ''; \n\n\n// 薪酬\nvar salary = Number(formModel.qc_salary) || 0;\n\n\nvar salaryUnitText = '产品单位'; // 默认值\n\n\nif (salaryUnit === '1') {\n salaryUnitText = '产品单位';\n} else if (salaryUnit === '2' ) {\n salaryUnitText = '小时';\n} else if (salaryUnit === '3' ) {\n salaryUnitText = '次';\n} \n\n\nvar rule = '';\n\n// 拼接规则\nrule = `每 ${baseQty} ${salaryUnitText} ${salary} 元`;\n\nformModel.zhi_jian_ji_xin_dan_wei9236 = rule;\nconsole.log('拼接结果:', rule);\n\nreturn rule;",
},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '07857cbe5b6d4d0582e9ecee53a4b0fb',
field: 'zhiJianJiXinDanWei9236',
label: '质检计薪规则',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '自动生成',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '94a5a7a3ad974df0b8d9083ef3fd72a2',
field: '',
label: '文本',
type: 'text',
component: 'Text',
colProps: { span: 24 },
defaultValue: '计薪规则',
componentProps: {
defaultValue: '计薪规则',
color: '',
align: 'left',
fontSize: 20,
fontWeight: 'bold',
fontFamily: 'Arial',
fontStyle: 'normal',
isShow: true,
padding: '',
margin: '10px',
span: 7,
style: {},
},
},
{
key: 'a5bd776284ac4a87aa9be46eaf0398a4',
field: 'salaryType',
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: 'dic',
params: { itemId: '2001201026722996226' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"// 获取计薪类型\nlet value = formModel.salary_type;\n\nfunction updateSalaryUnit1() {\n var unitValue = '';\n \n if (value == 1) {\n unitValue = '产品单位';\n } else if (value == 2) {\n unitValue = '小时';\n } else if (value == 3) {\n unitValue = '次';\n }\n formModel.salary_unit = unitValue;\n}\n\nfunction updateSalaryRule1() {\n var baseQty = formModel.base_qty || '0';\n var salaryUnit = formModel.salary_unit || '';\n var salary = formModel.salary || '0';\n \n // 拼接规则:基数 + 单位 + 薪酬\n var rule = '每 ' + baseQty + ' ' + salaryUnit + ' ' + salary + ' 元';\n formModel.ji_xin_gui_ze8609 = rule;\n}\nif (value == 1) {\n formActionType.updateSchema({\n field: 'salary_basis',\n componentProps: {\n disabled: false,\n required: true\n }\n });\n updateSalaryUnit1();\n} else {\n formActionType.updateSchema({\n field: 'salary_basis',\n componentProps: {\n disabled: true,\n required: false\n }\n });\n updateSalaryUnit1();\n}\nupdateSalaryRule1();",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001201026722996226',
style: { width: '100%' },
},
},
{
key: 'bc6833c275f4422eb5041773aee38770',
field: 'baseQty',
label: '计薪基数',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
width: '100%',
span: 7,
defaultValue: 1,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {
change:
"var baseQty = Number(formModel.base_qty) || 0;\nvar salaryUnit = formModel.salary_type || ''; \nvar salary = Number(formModel.salary) || 0;\nvar salaryUnitText = '产品单位'; \nif (salaryUnit === '1') {\n salaryUnitText = '产品单位';\n} else if (salaryUnit === '2' ) {\n salaryUnitText = '小时';\n} else if (salaryUnit === '3' ) {\n salaryUnitText = '次';\n} \nvar rule = '';\nrule = `每 ${baseQty} ${salaryUnitText} ${salary} 元`;\nformModel.ji_xin_gui_ze8609 = rule;\n",
},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'dac1c00dd9744d95a7c16989202f5f54',
field: 'salaryUnit',
label: '计薪单位',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
maxlength: null,
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: 'f92292be8eec47cd94d5055e0ea5c9db',
field: 'salary',
label: '薪酬',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {
change:
"var baseQty = Number(formModel.base_qty) || 0;\nvar salaryUnit = formModel.salary_type || ''; \nvar salary = Number(formModel.salary) || 0;\nvar salaryUnitText = '产品单位'; \nif (salaryUnit === '1') {\n salaryUnitText = '产品单位';\n} else if (salaryUnit === '2' ) {\n salaryUnitText = '小时';\n} else if (salaryUnit === '3' ) {\n salaryUnitText = '次';\n} \nvar rule = '';\nrule = `每 ${baseQty} ${salaryUnitText} ${salary} 元`;\nformModel.ji_xin_gui_ze8609 = rule;\n",
},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '56db3f9fdea846c18f922aae91cd3fab',
field: 'jiXinGuiZe8609',
label: '计薪规则',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '自动生成',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: true,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 2,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '',
margin: '10px',
},
},
{
key: '58a450e4729f4fdeb68390c172411808',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: 'd542a6a28b79466e94cfb1c723aee4c1',
field: '',
label: '文本',
type: 'text',
component: 'Text',
colProps: { span: 24 },
defaultValue: '质检单',
componentProps: {
defaultValue: '质检单',
color: '',
align: 'left',
fontSize: 20,
fontWeight: 'bold',
fontFamily: 'Arial',
fontStyle: 'normal',
isShow: true,
padding: '10px',
margin: '10px',
span: 7,
style: {},
},
},
{
key: '2f4a0d9bd5324225b8785cc2f3eb9085',
field: 'inspectionScheme',
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: '', value: '无' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '9cdf176c0d554e358413156117e228cf',
field: 'inspectionDepartment',
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',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getList',
method: 'GET',
apiId: '484584e786864e0f90ec8e4eb84fa93a',
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_department";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '3d977bcdee6c41c8a5e27b42bb2ee674',
field: 'inspectionStaff',
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: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/bmxx/getEmployeeList',
method: 'GET',
apiId: 'copy1765432049337d61208',
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_employee where active = 1 and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '93d054800285479f9e805c270fffdb8a',
field: 'defectProcessing',
label: '不良品处理',
type: 'checkbox',
component: 'ApiCheckboxGroup',
colProps: { span: 24 },
componentProps: {
span: 9,
showLabel: true,
disabled: false,
staticOptions: [{ key: 1, label: '', value: '1' }],
datasourceType: 'staticData',
defaultSelect: '',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
params: null,
style: {},
},
},
],
},
{ span: 6, list: [] },
{ span: 6, list: [] },
],
componentProps: {
gutter: 2,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '',
margin: '10px',
},
},
{
key: '24f0714c9f3a4242b1bcefff04bb7314',
field: '',
label: '',
type: 'tab',
colProps: { span: 24 },
component: 'Tab',
children: [
{
span: 24,
name: '作业规范',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '5a5e71d4a88f45668eea7d27390cfc5f',
label: '',
field: 'rokeProcessSpecList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'rokeProcessSpecList',
columns: [
{
key: 'bc410dc718a64431b1e475036a2c7e19',
title: '内容',
dataIndex: 'content',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'e3a097a002004e8dab41baed0ab02728',
title: '标题',
dataIndex: 'title',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '7dc949cc551d42969d98921847ca4178',
title: '附件数量',
dataIndex: 'attachmentCount',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
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: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 24,
name: '作业指导图片',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: 'f0db1f4ee6254dd58b8f6e5f66ab7030',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 12,
list: [
{
key: 'e504b345eb8e4336b233abeb7f76cdb5',
field: 'document',
label: '作业指导',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入作业指导',
maxlength: null,
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: 'd35972c7c2884f2481e4432f32ce8276',
field: 'attachmentCount',
label: '作业指导数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{ span: 12, list: [] },
],
componentProps: {
gutter: 16,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
],
},
{
span: 24,
name: '子工序',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: 'b02f8a3e28b24689bb5a311945bb2519',
label: '',
field: 'rokeProcessChildList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'rokeProcessChildList',
columns: [
{
key: 'fd222a1216344ebda66dd2cdd586e8ac',
title: '子工序',
dataIndex: 'childProcessId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择子工序',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '工序1', value: '工序1' }],
defaultSelect: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProcessList',
method: 'GET',
apiId: 'copy1766022481900d48902',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'processType',
value: '2',
description: null,
required: true,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'value',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_process where process_type = #{processType} and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"const row = formModel.roke_process_childList?.[index];\n\nif (!row || !row.child_process_id) {\n console.warn('行数据或 child_process_id 不存在', row);\n return;\n}\n\nformActionType.httpRequest({\n requestType: 'get',\n requestUrl: '/magic-api/jcxx/getProcess',\n params: {\n id: row.child_process_id\n },\n errorMessageMode: 'none'\n}).then(res => {\n\n const list = res?.data || res;\n\n if (Array.isArray(list) && list.length > 0) {\n row.child_rated_wh = list[0].rated_working_hours;\n row.note = list[0].note;\n } else {\n formActionType.showMessage('未查询到工序信息');\n }\n\n}).catch(err => {\n console.error('接口请求异常:', err);\n formActionType.showMessage('接口请求异常');\n});\n",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: 'ef75818985694e619da0aefc865353ce',
title: '额定工时',
dataIndex: 'childRatedWh',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '72fed4a008e74833aa9d0e11337e1794',
title: '编号',
dataIndex: 'sequence',
componentType: 'InputNumber',
defaultValue: null,
componentProps: {
width: '100%',
span: '',
defaultValue: null,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '1fce07a52dc64ab6ad34ebce76b7b05c',
title: '描述',
dataIndex: 'note',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
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: '提示文本' },
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
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: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 0,
name: '关键物料',
prefix: null,
suffix: null,
activeColor: null,
folderId: null,
imageUrl: null,
conFolderId: null,
conImageUrl: null,
list: [
{
key: '27fb7435f48c42da8a639e1cc5396945',
label: '表格组件',
field: 'rokeMaterialDetailsList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'rokeMaterialDetailsList',
columns: [
{
key: '031cc7cac3f74e85b3549c71853aaae7',
title: '物料',
dataIndex: 'productId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
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',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProductList',
method: 'GET',
apiId: 'copy1766041321701d99854',
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_product where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: '0b36ff88c28140c696c70f25a232a146',
title: '数量',
dataIndex: 'quantity',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '3c191da8c5674b12bd8ab54c175bd57b',
title: '损耗率%',
dataIndex: 'attritionRate',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: null,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'ca1890169d984eea96483944efba3da2',
title: '必投',
dataIndex: 'mustInvest',
componentType: 'Switch',
defaultValue: 1,
componentProps: {
span: '',
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '9483ab03c72146e9b2c06c21ac33fdad',
title: '物料工艺路线',
dataIndex: 'routingId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
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',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getRoutingList',
method: 'GET',
apiId: 'copy1766114285962d24088',
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_routing where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: 'dc2cf962abc940b181c90207fc569cc3',
title: '领料位置',
dataIndex: 'materialRequisitionLocation',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入领料位置',
maxlength: null,
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: '174c1b2cbfb44890aa2a997cda66eb93',
title: '备注',
dataIndex: 'remark',
componentType: 'InputTextArea',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入备注',
maxlength: null,
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
isShowAi: false,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
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: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
{
key: '03c19c5ac95b4d139d8380ede64f14ff',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 24,
list: [
{
key: '04ae7a540acd4c46949c6fd53e652a45',
field: 'note',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 0,
defaultValue: '',
placeholder: '请输入备注',
maxlength: null,
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: 1,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
],
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,
modal: null,
},
{
key: 'cancel',
code: 'cancel',
name: '取消',
style: 'default',
event: [],
isShow: true,
index: 1,
type: 1,
modal: null,
},
{
key: 'reset',
code: 'reset',
name: '重置',
style: 'default',
event: [],
isShow: true,
index: 0,
type: 1,
modal: null,
},
];
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '名称',
fieldId: 'name',
isSubTable: false,
showChildren: true,
type: 'input',
key: '60af544637c442bcb20cdbf2cd71a2c2',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '默认报工人员',
fieldId: 'defaultReporter',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'aa72d19636d540078e40a0dae8b90e3c',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否委外',
fieldId: 'prepareWorkHours',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'aabb539eede446daa35c754416cc50ae',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否扣除工装生命周期',
fieldId: 'isPress',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '9b11a988a0cf4332876bf2c525fab878',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '工序类别',
fieldId: 'categoryId',
isSubTable: false,
showChildren: true,
type: 'select',
key: '16def0c2f9d8422da5d403e11b8c38e0',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '分类',
fieldId: 'processType',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'b228a5dee6274901924bd0b9eb675ec7',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '无工单报工记录产出物',
fieldId: 'withoutWoProduce',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'fd9c2957fb694bffaa33fa125bc0e140',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '采集方案',
fieldId: 'collectionSchemeId',
isSubTable: false,
showChildren: true,
type: 'select',
key: '55d03e0607bc4ea281a248fdcfc571bb',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '额定工时',
fieldId: 'ratedWorkingHours',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'ca8257a46070472e9639110b11f7f3bd',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '采集项',
fieldId: 'collectionItem',
isSubTable: false,
showChildren: true,
type: 'select',
key: '54078d1dd17c465983be38829aaa9969',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '有效的',
fieldId: 'active',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'e2c431530e954e53852f9a6026987e0d',
children: [],
options: {},
defaultValue: 0,
},
{
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '文本',
fieldId: '',
isSubTable: false,
showChildren: true,
type: 'text',
key: 'a0cfa452347845d696cb160c3bf86691',
children: [],
options: {},
defaultValue: '工单质检',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检方式',
fieldId: 'qualityMode',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'a8ad71f3a5334f79adcfd8c22d013598',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检采集方案',
fieldId: 'qcSchemeId',
isSubTable: false,
showChildren: true,
type: 'select',
key: '9a8bade44b6a494ba761114ced745bcd',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检采集项',
fieldId: 'inspectionCollectionItem',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'a1733daa77c64e4aa995a4a95cb37fdf',
children: [],
options: {},
},
{
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '文本',
fieldId: '',
isSubTable: false,
showChildren: true,
type: 'text',
key: '90b68d6c9492410a9a564ea5d0684e64',
children: [],
options: {},
defaultValue: '质检计薪',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检计薪方式',
fieldId: 'qcSalaryType',
isSubTable: false,
showChildren: true,
type: 'select',
key: '1ae19160a0ac425e8e7923444ac67a5f',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检工资依据',
fieldId: 'qcSalaryBasis',
isSubTable: false,
showChildren: true,
type: 'select',
key: '50e39cab7a8040df9c965cc9fd15684d',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检计薪基数',
fieldId: 'qcBaseQty',
isSubTable: false,
showChildren: true,
type: 'number',
key: '68fb0de7702a41af97590b2c5b2905d8',
children: [],
options: {},
defaultValue: 1,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检计薪单位',
fieldId: 'qcSalaryUnit',
isSubTable: false,
showChildren: true,
type: 'input',
key: '6a8b88a2b5564944b94a646f6ee7c893',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检薪酬',
fieldId: 'qcSalary',
isSubTable: false,
showChildren: true,
type: 'number',
key: '66c726149fb6468089c3863ecc624d76',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: true,
tableName: '',
fieldName: '质检计薪规则',
fieldId: 'zhiJianJiXinDanWei9236',
isSubTable: false,
showChildren: true,
type: 'input',
key: '07857cbe5b6d4d0582e9ecee53a4b0fb',
children: [],
options: {},
defaultValue: '',
},
{
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '文本',
fieldId: '',
isSubTable: false,
showChildren: true,
type: 'text',
key: '94a5a7a3ad974df0b8d9083ef3fd72a2',
children: [],
options: {},
defaultValue: '计薪规则',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '计薪方式',
fieldId: 'salaryType',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'a5bd776284ac4a87aa9be46eaf0398a4',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '计薪基数',
fieldId: 'baseQty',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'bc6833c275f4422eb5041773aee38770',
children: [],
options: {},
defaultValue: 1,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '计薪单位',
fieldId: 'salaryUnit',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'dac1c00dd9744d95a7c16989202f5f54',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '薪酬',
fieldId: 'salary',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'f92292be8eec47cd94d5055e0ea5c9db',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: true,
tableName: '',
fieldName: '计薪规则',
fieldId: 'jiXinGuiZe8609',
isSubTable: false,
showChildren: true,
type: 'input',
key: '56db3f9fdea846c18f922aae91cd3fab',
children: [],
options: {},
defaultValue: '',
},
{
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '文本',
fieldId: '',
isSubTable: false,
showChildren: true,
type: 'text',
key: 'd542a6a28b79466e94cfb1c723aee4c1',
children: [],
options: {},
defaultValue: '质检单',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检方案',
fieldId: 'inspectionScheme',
isSubTable: false,
showChildren: true,
type: 'select',
key: '2f4a0d9bd5324225b8785cc2f3eb9085',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检部门',
fieldId: 'inspectionDepartment',
isSubTable: false,
showChildren: true,
type: 'select',
key: '9cdf176c0d554e358413156117e228cf',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检人员',
fieldId: 'inspectionStaff',
isSubTable: false,
showChildren: true,
type: 'select',
key: '3d977bcdee6c41c8a5e27b42bb2ee674',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '不良品处理',
fieldId: 'defectProcessing',
isSubTable: false,
showChildren: true,
type: 'checkbox',
key: '93d054800285479f9e805c270fffdb8a',
children: [],
options: {},
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeProcessSpecList',
fieldName: '',
fieldId: 'rokeProcessSpecList',
type: 'form',
key: '5a5e71d4a88f45668eea7d27390cfc5f',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessSpecList',
fieldName: '内容',
fieldId: 'content',
type: 'Input',
key: 'bc410dc718a64431b1e475036a2c7e19',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessSpecList',
fieldName: '标题',
fieldId: 'title',
type: 'Input',
key: 'e3a097a002004e8dab41baed0ab02728',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessSpecList',
fieldName: '附件数量',
fieldId: 'attachmentCount',
type: 'InputNumber',
key: '7dc949cc551d42969d98921847ca4178',
children: [],
},
],
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '作业指导',
fieldId: 'document',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'e504b345eb8e4336b233abeb7f76cdb5',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '作业指导数量',
fieldId: 'attachmentCount',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'd35972c7c2884f2481e4432f32ce8276',
children: [],
options: {},
defaultValue: 0,
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeProcessChildList',
fieldName: '',
fieldId: 'rokeProcessChildList',
type: 'form',
key: 'b02f8a3e28b24689bb5a311945bb2519',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessChildList',
fieldName: '子工序',
fieldId: 'childProcessId',
type: 'XjrSelect',
key: 'fd222a1216344ebda66dd2cdd586e8ac',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessChildList',
fieldName: '额定工时',
fieldId: 'childRatedWh',
type: 'InputNumber',
key: 'ef75818985694e619da0aefc865353ce',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessChildList',
fieldName: '编号',
fieldId: 'sequence',
type: 'InputNumber',
key: '72fed4a008e74833aa9d0e11337e1794',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeProcessChildList',
fieldName: '描述',
fieldId: 'note',
type: 'Input',
key: '1fce07a52dc64ab6ad34ebce76b7b05c',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '表格组件',
fieldId: 'rokeMaterialDetailsList',
type: 'form',
key: '27fb7435f48c42da8a639e1cc5396945',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '物料',
fieldId: 'productId',
type: 'XjrSelect',
key: '031cc7cac3f74e85b3549c71853aaae7',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '数量',
fieldId: 'quantity',
type: 'InputNumber',
key: '0b36ff88c28140c696c70f25a232a146',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '损耗率%',
fieldId: 'attritionRate',
type: 'InputNumber',
key: '3c191da8c5674b12bd8ab54c175bd57b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '必投',
fieldId: 'mustInvest',
type: 'Switch',
key: 'ca1890169d984eea96483944efba3da2',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '物料工艺路线',
fieldId: 'routingId',
type: 'XjrSelect',
key: '9483ab03c72146e9b2c06c21ac33fdad',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '领料位置',
fieldId: 'materialRequisitionLocation',
type: 'Input',
key: 'dc2cf962abc940b181c90207fc569cc3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeMaterialDetailsList',
fieldName: '备注',
fieldId: 'remark',
type: 'InputTextArea',
key: '174c1b2cbfb44890aa2a997cda66eb93',
children: [],
},
],
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: '04ae7a540acd4c46949c6fd53e652a45',
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>
<GxglModal @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 { getRokeProcessPage, deleteRokeProcess} from '/@/api/jcsj/gxgl';
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 GxglModal from './components/GxglModal.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 = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":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: 'Gxgl列表',
api: getRokeProcessPage,
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() {
deleteRokeProcess(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("gxgl: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: `gxgl:${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: `gxgl:${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
<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 { addRokeRouting, getRokeRouting, updateRokeRouting } from '/@/api/jcsj/gylx';
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 getRokeRouting(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 updateRokeRouting(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 addRokeRouting(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
<template>
<BasicModal
:height="600"
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: 1200,
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
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'lotRuleId',
label: '单件/批次号规则',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/jcxx/getLot',
method: 'GET',
apiId: 'c2c9e271bd684ba3bf4e57ff94f82e54',
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_lot_rule where delete_mark = 0";\r\nreturn db.select(sql);',
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'internalCode',
label: '内部标识',
defaultValue: undefined,
component: 'Input',
},
{
field: 'deductionBasis',
label: '扣料依据',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'note',
label: '备注',
defaultValue: undefined,
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'name',
title: '名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'lotRuleId',
title: '单件/批次号规则',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'deductionBasis',
title: '扣料依据',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
];
return staticOptions.filter((x) => x.value == record.deductionBasis)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
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: 'vertical',
size: 'default',
schemas: [
{
key: '1a2696deffa44bc08208686bb5e77715',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 6,
list: [
{
key: '8d9ef135306242729fb4673b9e2dd918',
field: 'name',
label: '名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入名称',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: '097aabe7380a49f5a691ed3b0613ab26',
field: 'lotRuleId',
label: '单件/批次号规则',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 16,
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: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getLot',
method: 'GET',
apiId: 'c2c9e271bd684ba3bf4e57ff94f82e54',
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_lot_rule where delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: '8a507b277c4d46fb9c3dacc18f98a41b',
field: 'internalCode',
label: '内部标识',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 11,
defaultValue: '',
placeholder: '请输入内部标识',
maxlength: null,
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%' },
},
},
],
},
{
span: 6,
list: [
{
key: '6636f959cd3a4c239aeb3ab43505a27b',
field: 'active',
label: '有效的',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
span: 7,
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#433653',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
],
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: 'e64fff4326284f16aa6d86acb8678b89',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 24,
list: [
{
key: '4646ad154e7d404e9dae94f1022a5788',
field: '',
label: '',
type: 'tab',
colProps: { span: 24 },
component: 'Tab',
children: [
{
span: 24,
name: '工艺明细',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '3c2b6278f4114cbc86780eec1f980f0c',
label: '',
field: 'rokeRoutingLineList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'rokeRoutingLineList',
columns: [
{
key: '9432fa26a1e44a25b1d68d28eed7372a',
title: '工序',
dataIndex: 'processId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择工序',
showLabel: true,
showSearch: true,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '毛胚原料', value: '毛胚原料' },
{ key: 2, label: '车床', value: '车床' },
],
defaultSelect: '',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProcessList',
method: 'GET',
apiId: 'copy1766022481900d48902',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'processType',
value: '1',
description: null,
required: true,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'value',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_process where process_type = #{processType} and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {
change:
"// 取第一行,统一引用,避免多处硬编码 [0]\nconst row = formModel.roke_routing_lineList?.[0];\n\nif (!row || !row.process_id) {\n console.warn('工序行或 process_id 不存在', row);\n return;\n}\n\nformActionType.httpRequest({\n requestType: 'get',\n requestUrl: '/magic-api/jcxx/getProcess',\n params: {\n id: row.process_id\n },\n errorMessageMode: 'none'\n}).then(res => {\n\n // 兼容 magic-api 常见返回结构\n const list = res?.data || res;\n\n if (Array.isArray(list) && list.length > 0) {\n row.rated_working_hours = list[0].rated_working_hours;\n } else {\n formActionType.showMessage('未查询到工序信息');\n }\n\n}).catch(err => {\n console.error('接口请求异常:', err);\n formActionType.showMessage('接口请求异常');\n});\n",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: 'c8785464a8a24157abeb102aa6637d0e',
title: '工序提前/预产期',
dataIndex: 'inAdvTime',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: 6,
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'dbafb88382df488696722e143ff1b9b3',
title: '计薪规则',
dataIndex: 'salaryRule',
componentType: 'Input',
defaultValue: '每 1.0 产品单位 0.0 元',
componentProps: {
width: '100%',
span: '',
defaultValue: '每 1.0 产品单位 0.0 元',
placeholder: '请输入计薪规则计薪规则',
maxlength: null,
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: '63b9efd0597a4b73b381e31b2b0ec874',
title: '工序报工数',
dataIndex: 'workQty',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'd7a9c539183d43a29ff1689e2cbe87e2',
title: '最终成品数',
dataIndex: 'finishedQty',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'e20b853140d143e7a90cf447ce0df137',
title: '消耗工序',
dataIndex: 'consumeProcessId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '毛胚原料', value: '毛胚原料' },
{ key: 2, label: '车床', value: '车床' },
],
defaultSelect: '1',
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/jcxx/getProcessList',
method: 'GET',
apiId: 'copy1766022481900d48902',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'processType',
value: '1',
description: null,
required: true,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: 'value',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_process where process_type = #{processType} and delete_mark = 0";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: '6dad49cc96da4279a8eca463be7ee3b3',
title: '额定工时',
dataIndex: 'ratedWorkingHours',
componentType: 'InputNumber',
defaultValue: 1,
componentProps: {
width: '100%',
span: '',
defaultValue: 1,
min: 0,
max: 100,
step: 0.01,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '7133da67da6f450a921a6aaa37d05364',
title: '采集方案',
dataIndex: 'collectionSchemeId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '无', value: '无' }],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'border: 0'",
},
},
{
key: 'd806a68e571c47ecbc653755cd908b0b',
title: '采集项',
dataIndex: 'collectionItemId',
componentType: 'XjrSelect',
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: true,
isMultiple: true,
clearable: false,
disabled: false,
staticOptions: [{ key: 1, label: '环境温度', value: '环境温度' }],
defaultSelect: null,
datasourceType: 'dic',
params: { itemId: '2001194974510096385' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2001194974510096385',
listStyle: "return 'border: 0'",
},
},
{
key: 'df36ce1665194f998c7f7b43bdf3e730',
title: '作业规范',
dataIndex: 'standardItemsNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'cce7f159869e44d7b7243b7f0b9544ed',
title: '作业指导',
dataIndex: 'documentNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '569b4f85f2a243d4bf69d190a7d299ba',
title: '关键物料',
dataIndex: 'pBomNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '8be06556e4864b0eb89a97477f9f8644',
title: '子工序',
dataIndex: 'childProcessNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: '23a0c5a0303840fd81f65f6fa36d3526',
title: '工作中心',
dataIndex: 'workCenterNumber',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: true,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
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: false,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
events: {},
showPagenation: true,
},
},
],
},
{
span: 24,
name: '质检设置',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '2b6470174fb74ea1b7ebcf0a745cc90a',
field: 'routingQualityMode',
label: '质检方式',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '20%',
span: 12,
placeholder: '请选择下拉选择质检方式质检方式',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '工单质检', value: '工单质检' },
{ key: 3, label: '质检单', value: '质检单' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: true,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '20%' },
},
},
],
},
{
span: 24,
name: '自动扣料',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '810345b81a7540a4917ef3c8ab8dea1a',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 6,
list: [
{
key: '7d2104a70396450485eb4225debf924f',
field: 'autoDeduction',
label: '自动扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 17,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {
change:
"let value = formModel.auto_deduction;\nvar fieldConfigs = [\n {field: 'deduction_work_center'},\n {field: 'deduction_auto_confirm'},\n {field: 'deduction_moment'},\n {field: 'deduction_basis'}\n];\nfieldConfigs.forEach(function(config) {\n var isDisabled = false;\n var isRequired = false;\n if (value == 1) {\n isDisabled = false; \n if (config.field === 'deduction_moment' || config.field === 'deduction_basis') {\n isRequired = true;\n }\n } else {\n isDisabled = true;\n isRequired = false;\n }\n formActionType.updateSchema({\n field: config.field,\n componentProps: {\n disabled: isDisabled,\n required: isRequired\n }\n });\n});",
},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
{
key: 'fdc20894032645628350fa8df3a515f3',
field: 'deductionWorkCenter',
label: '分车间扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 11,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: true,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 6,
list: [
{
key: '82efccd1f14a4a43b60f35ad75939c03',
field: 'deductionAutoConfirm',
label: '自动确认扣料',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 19,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: true,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 6,
list: [
{
key: '1684c8eba06c45c1a0e4df9bcbe4eaf2',
field: 'deductionMoment',
label: ' 扣料节点',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 17,
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: true,
staticOptions: [
{ key: 1, label: '首道扣料', value: '首道扣料' },
{ key: 2, label: '末道扣料', value: '末道扣料' },
{ key: 3, label: '入库扣料', value: '入库扣料' },
{ key: 4, label: '分步扣料', value: '分步扣料' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 6,
list: [
{
key: 'f529e8bc463f4811983593cf2987e15e',
field: 'deductionBasis',
label: '扣料依据',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 17,
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: true,
staticOptions: [
{ key: 1, label: '产品MOD', value: '产品MOD' },
{ key: 2, label: '工艺MOD', value: '工艺MO' },
],
defaultSelect: '',
datasourceType: 'staticData',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
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',
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
{
key: '16cce9dceb104efc9af33d84f3734488',
field: 'note',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入备注',
maxlength: null,
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',
},
},
],
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,
modal: null,
},
{
key: 'cancel',
code: 'cancel',
name: '取消',
style: 'default',
event: [],
isShow: true,
index: 1,
type: 1,
modal: null,
},
{
key: 'reset',
code: 'reset',
name: '重置',
style: 'default',
event: [],
isShow: true,
index: 0,
type: 1,
modal: null,
},
];
export const permissionList = [
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '名称',
fieldId: 'name',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8d9ef135306242729fb4673b9e2dd918',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '单件/批次号规则',
fieldId: 'lotRuleId',
isSubTable: false,
showChildren: true,
type: 'select',
key: '097aabe7380a49f5a691ed3b0613ab26',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '内部标识',
fieldId: 'internalCode',
isSubTable: false,
showChildren: true,
type: 'input',
key: '8a507b277c4d46fb9c3dacc18f98a41b',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '有效的',
fieldId: 'active',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '6636f959cd3a4c239aeb3ab43505a27b',
children: [],
options: {},
defaultValue: 1,
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '',
fieldId: 'rokeRoutingLineList',
type: 'form',
key: '3c2b6278f4114cbc86780eec1f980f0c',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序',
fieldId: 'processId',
type: 'XjrSelect',
key: '9432fa26a1e44a25b1d68d28eed7372a',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序提前/预产期',
fieldId: 'inAdvTime',
type: 'InputNumber',
key: 'c8785464a8a24157abeb102aa6637d0e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '计薪规则',
fieldId: 'salaryRule',
type: 'Input',
key: 'dbafb88382df488696722e143ff1b9b3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工序报工数',
fieldId: 'workQty',
type: 'InputNumber',
key: '63b9efd0597a4b73b381e31b2b0ec874',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '最终成品数',
fieldId: 'finishedQty',
type: 'InputNumber',
key: 'd7a9c539183d43a29ff1689e2cbe87e2',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '消耗工序',
fieldId: 'consumeProcessId',
type: 'XjrSelect',
key: 'e20b853140d143e7a90cf447ce0df137',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '额定工时',
fieldId: 'ratedWorkingHours',
type: 'InputNumber',
key: '6dad49cc96da4279a8eca463be7ee3b3',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '采集方案',
fieldId: 'collectionSchemeId',
type: 'XjrSelect',
key: '7133da67da6f450a921a6aaa37d05364',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '采集项',
fieldId: 'collectionItemId',
type: 'XjrSelect',
key: 'd806a68e571c47ecbc653755cd908b0b',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '作业规范',
fieldId: 'standardItemsNumber',
type: 'InputNumber',
key: 'df36ce1665194f998c7f7b43bdf3e730',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '作业指导',
fieldId: 'documentNumber',
type: 'InputNumber',
key: 'cce7f159869e44d7b7243b7f0b9544ed',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '关键物料',
fieldId: 'pBomNumber',
type: 'InputNumber',
key: '569b4f85f2a243d4bf69d190a7d299ba',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '子工序',
fieldId: 'childProcessNumber',
type: 'InputNumber',
key: '8be06556e4864b0eb89a97477f9f8644',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'rokeRoutingLineList',
fieldName: '工作中心',
fieldId: 'workCenterNumber',
type: 'InputNumber',
key: '23a0c5a0303840fd81f65f6fa36d3526',
children: [],
},
],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '质检方式',
fieldId: 'routingQualityMode',
isSubTable: false,
showChildren: true,
type: 'select',
key: '2b6470174fb74ea1b7ebcf0a745cc90a',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '自动扣料',
fieldId: 'autoDeduction',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '7d2104a70396450485eb4225debf924f',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '分车间扣料',
fieldId: 'deductionWorkCenter',
isSubTable: false,
showChildren: true,
type: 'switch',
key: 'fdc20894032645628350fa8df3a515f3',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '自动确认扣料',
fieldId: 'deductionAutoConfirm',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '82efccd1f14a4a43b60f35ad75939c03',
children: [],
options: {},
defaultValue: 0,
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: ' 扣料节点',
fieldId: 'deductionMoment',
isSubTable: false,
showChildren: true,
type: 'select',
key: '1684c8eba06c45c1a0e4df9bcbe4eaf2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '扣料依据',
fieldId: 'deductionBasis',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'f529e8bc463f4811983593cf2987e15e',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'note',
isSubTable: false,
showChildren: true,
type: 'textarea',
key: '16cce9dceb104efc9af33d84f3734488',
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>
<GylxModal @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 { getRokeRoutingPage, deleteRokeRouting} from '/@/api/jcsj/gylx';
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 GylxModal from './components/GylxModal.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 = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":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: 'Gylx列表',
api: getRokeRoutingPage,
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() {
deleteRokeRouting(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("gylx: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: `gylx:${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: `gylx:${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