Commit 07a92d0a by 张恒

feat(jcsj): 更新工艺管理配置和生产计划组件

- 添加额定工时字段配置
- 修改产品物料相关字段映射关系
- 调整工作流权限配置中的字段定义
- 更新生产计划产品列表组件配置
- 修改表单模型中字段名称映射逻辑
parent f6b76856
......@@ -26,6 +26,8 @@ export interface RokeProcessPageModel {
categoryId: string;
collectionSchemeId: string;
ratedWorkingHours: string;
}
/**
......@@ -118,60 +120,26 @@ export interface RokeProcessModel {
zyzdtpFile: string;
mesProcessItemList?: MesProcessItemModel;
mesProcessProductList?: MesProcessProductModel;
mesProcessSchemeList?: MesProcessSchemeModel;
}
/**
* @description: MesProcessItem表类型
* @description: MesProcessProduct表类型
*/
export interface MesProcessItemModel {
export interface MesProcessProductModel {
id: string;
processId: string;
code: string;
name: string;
required: string;
categoryId: string;
contentType: string;
dataType: string;
dictId: string;
relatedModelId: string;
relatedModelName: string;
relatedModelDomain: string;
standardValue: string;
upperValue: string;
lowerValue: string;
note: string;
companyId: string;
qualityCategoryId: string;
analysisMethod: string;
deleteMark: string;
qualityMethodId: string;
productId: string;
destructive: string;
processId: string;
keyItem: string;
erpid: string;
deleteMark: string;
bz: string;
createDate: string;
......@@ -180,67 +148,27 @@ export interface MesProcessItemModel {
modifyDate: string;
modifyUserId: string;
isFeeding: string;
number: string;
}
/**
* @description: MesProcessProduct表类型
* @description: MesProcessScheme表类型
*/
export interface MesProcessProductModel {
export interface MesProcessSchemeModel {
id: string;
deleteMark: string;
cpbh: string;
cpmc: string;
nbdm: string;
hjzt: string;
cptp: string;
kxs: string;
kcg: string;
wllx: string;
cplx: string;
gg: string;
xh: string;
fpl: string;
bzzl: string;
erpid: string;
zygf: string;
bz: string;
p1: string;
p2: string;
p3: string;
p4: string;
p5: string;
p6: string;
processId: string;
p7: string;
collectionSchemeId: string;
p8: string;
required: string;
p9: string;
note: string;
p10: string;
deleteMark: string;
createDate: string;
......@@ -249,12 +177,6 @@ export interface MesProcessProductModel {
modifyDate: string;
modifyUserId: string;
processId: string;
isFeeding: string;
number: string;
}
/**
......
......@@ -155,8 +155,23 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '产品物料id',
fieldId: 'productId',
type: 'Input',
key: '6e053d43971d4157b0f9118f9cbbb4bb',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '编号',
fieldId: 'cpbh',
fieldId: 'bianHao3907',
type: 'Input',
key: '00c0e93b675841f48265b896515a5241',
children: [],
......@@ -171,7 +186,7 @@ export const permissionList = [
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '名称',
fieldId: 'cpmc',
fieldId: 'mingChen2461',
type: 'Input',
key: '91863c5a0ec24d76ade8735cd401059b',
children: [],
......@@ -216,9 +231,9 @@ export const permissionList = [
showChildren: false,
tableName: 'mesProcessProductList',
fieldName: '备注',
fieldId: 'bz',
type: 'InputTextArea',
key: '1084a7c39baf47ba9a0251cb4e2f8c14',
fieldId: 'beiZhu7713',
type: 'Input',
key: '86ad9fb6998c4d0ea8e11ed0ef6585cb',
children: [],
},
],
......@@ -230,9 +245,9 @@ export const permissionList = [
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '',
fieldId: 'mesProcessItemList',
fieldId: 'mesProcessSchemeList',
type: 'form',
key: '3fd474ce5f8c4bf78bd86dc701cbdc4f',
children: [
......@@ -244,9 +259,9 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '编码',
fieldId: 'code',
fieldId: 'bianMa8881',
type: 'Input',
key: '3999831fde0a4e879f64f33eb2a1edd1',
children: [],
......@@ -259,9 +274,9 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '名称',
fieldId: 'name',
fieldId: 'mingChen4867',
type: 'Input',
key: 'ab6576e960ee44b4af09975e64088f05',
children: [],
......@@ -274,11 +289,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '数据类型',
fieldId: 'dataType',
type: 'XjrSelect',
key: '745cb3bb014d4dd9ba38139d17b2f305',
fieldId: 'mingChen3506',
type: 'Input',
key: 'f086101bc78b4471b3cb95b3970c368e',
children: [],
},
{
......@@ -289,11 +304,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '是否必填',
fieldId: 'required',
type: 'Switch',
key: '36a40652260d491e8a088ff843aab982',
fieldId: 'mingChen6235',
type: 'Input',
key: '5d40e3c7f274461aba1f041c5f33c13d',
children: [],
},
{
......@@ -304,11 +319,11 @@ export const permissionList = [
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProcessItemList',
tableName: 'mesProcessSchemeList',
fieldName: '备注',
fieldId: 'note',
type: 'InputTextArea',
key: 'f3ba1f809888475d925665668e2a1851',
fieldId: 'beiZhu2454',
type: 'Input',
key: '7674096c8feb431a8689c584a93c5b8a',
children: [],
},
],
......
......@@ -12,40 +12,40 @@
</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 { addMesProductionPlan, getMesProductionPlan, updateMesProductionPlan } from '/@/api/scgl/scjh';
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';
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesProductionPlan, getMesProductionPlan, updateMesProductionPlan } from '/@/api/scgl/scjh';
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 { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({
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({
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
});
const state = reactive({
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
});
const { currentRoute } = useRouter();
watch(
});
const { currentRoute } = useRouter();
watch(
() => state.formModel,
(val) => {
emits('update:value', val);
......@@ -53,9 +53,9 @@ watch(
{
deep: true,
},
);
);
onMounted(async () => {
onMounted(async () => {
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
......@@ -86,14 +86,14 @@ onMounted(async () => {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
}
}
// 校验form 通过返回表单数据
async function validate() {
// 校验form 通过返回表单数据
async function validate() {
let values = [];
try {
values = await systemFormRef.value?.validate();
......@@ -106,24 +106,11 @@ async function validate() {
} finally {
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getMesProductionPlan(rowId);
// 处理 mesProductionPlanProductList 字段映射
if (record.mesProductionPlanProductList && Array.isArray(record.mesProductionPlanProductList)) {
record.mesProductionPlanProductList = record.mesProductionPlanProductList.map((item) => {
return {
...item,
wuLiaoBianHao8001: item.cpbh || item.wuLiaoBianHao8001, // 物料编号
naBuDaiMa1765: item.nbdm || item.naBuDaiMa1765, // 内部代码
xingHao5094: item.xh || item.xingHao5094, // 型号
heJinZhuangTai4056: item.hjzt || item.heJinZhuangTai4056, // 合金状态 (兼容 hzjt 和 hjzt)
'guiGe(ChiCun)9562': item.gg || item['guiGe(ChiCun)9562'], // 规格(尺寸)
};
});
}
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
......@@ -132,9 +119,9 @@ async function setFormDataFromId(rowId) {
} catch (error) {
}
}
// 辅助返回表单数据
async function getFieldsValue() {
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
try {
values = await systemFormRef.value?.getFieldsValue();
......@@ -147,25 +134,25 @@ async function getFieldsValue() {
} finally {
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
// 获取行键值
function getRowKey() {
}
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
......@@ -175,9 +162,9 @@ async function update({ values, rowId }) {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesProductionPlan(values);
......@@ -186,9 +173,9 @@ async function add(values) {
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName;
......@@ -208,18 +195,18 @@ async function setWorkFlowForm(obj: WorkFlowFormParams) {
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
}
function handleChange(val) {
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe();
}
} catch (error) {}
}
defineExpose({
}
defineExpose({
setFieldsValue,
resetFields,
validate,
......@@ -232,6 +219,6 @@ defineExpose({
getRowKey,
getFieldsValue,
sendMessageForAllIframe
});
});
</script>
......@@ -487,6 +487,36 @@ export const formProps: FormProps = {
mainKey: 'mesProductionPlanProductList',
columns: [
{
key: '0b5e3de2d92f4a1cba6a650cff672653',
title: 'id',
dataIndex: 'id',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入id',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '416cd1b15c314d0dafaf6fc91e3f4653',
title: '产品选择',
dataIndex: 'cpid',
......
......@@ -156,6 +156,21 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: 'id',
fieldId: 'id',
type: 'Input',
key: '0b5e3de2d92f4a1cba6a650cff672653',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesProductionPlanProductList',
fieldName: '产品选择',
fieldId: 'cpid',
type: 'MultiplePopup',
......
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