diff --git a/src/api/mes/baseToolingInfo/types.ts b/src/api/mes/baseToolingInfo/types.ts
index 38c2e4b..eea65f5 100644
--- a/src/api/mes/baseToolingInfo/types.ts
+++ b/src/api/mes/baseToolingInfo/types.ts
@@ -132,6 +132,7 @@ export interface BaseToolingInfoForm extends BaseEntity {
*/
weight?: number;
+
/**
* 备注
*/
@@ -142,6 +143,7 @@ export interface BaseToolingInfoForm extends BaseEntity {
*/
activeFlag?: string;
+ toolingTypeId?: number;
}
export interface BaseToolingInfoQuery extends PageQuery {
diff --git a/src/api/mes/planInfo/types.ts b/src/api/mes/planInfo/types.ts
index 20ccaf0..03e851f 100644
--- a/src/api/mes/planInfo/types.ts
+++ b/src/api/mes/planInfo/types.ts
@@ -335,15 +335,6 @@ export interface PlanInfoForm extends BaseEntity {
materialBoMName?: string | number;
- materialIdL?: string | number;
- materialNameL?: string | number;
- materialIdR?: string | number;
- materialNameR?: string | number;
- materialBoMIdL?: string | number;
- materialBoMNameL?: string | number;
- materialBoMIdR?: string | number;
- materialBoMNameR?: string | number;
-
/**
* 班次id
*/
@@ -356,6 +347,24 @@ export interface PlanInfoForm extends BaseEntity {
materialName?: string;
+ // 业务临时字段补充,便于 index.vue 类型推断
+ planAmount1?: number;
+ planAmount2?: number;
+ planAmount3?: number;
+ planAmount4?: number;
+ planAmount5?: number;
+ planAmount6?: number;
+ materialIdL?: string | number;
+ materialNameL?: string;
+ materialIdR?: string | number;
+ materialNameR?: string;
+ materialBomVersion?: string;
+ materialBomVersionL?: string;
+ materialBomVersionR?: string;
+ materialBoMNameL?: string;
+ materialBoMNameR?: string;
+ materialBoMIdL?: string | number;
+ materialBoMIdR?: string | number;
}
export interface PlanInfoQuery extends PageQuery {
@@ -520,6 +529,7 @@ export interface PlanInfoQuery extends PageQuery {
*/
params?: any;
+ planRangeTime?: [string, string];
/**
* 班次名称
diff --git a/src/views/mes/baseToolingInfo/index.vue b/src/views/mes/baseToolingInfo/index.vue
index 39cce2f..f9e2269 100644
--- a/src/views/mes/baseToolingInfo/index.vue
+++ b/src/views/mes/baseToolingInfo/index.vue
@@ -13,11 +13,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -74,11 +74,7 @@
-
-
-
-
-
+
@@ -134,13 +130,13 @@
-
+
+ v-for="item in toolingTypeList"
+ :key="item.toolingTypeId"
+ :label="item.toolingTypeName"
+ :value="item.toolingTypeId"
+ />
@@ -189,8 +185,17 @@
diff --git a/src/views/mes/planInfo/index.vue b/src/views/mes/planInfo/index.vue
index 7c96f71..fba6d5e 100644
--- a/src/views/mes/planInfo/index.vue
+++ b/src/views/mes/planInfo/index.vue
@@ -238,17 +238,7 @@
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
@@ -956,7 +946,7 @@ const columns = ref([
{ key: 24, label: `计划状态`, visible: true },
{ key: 25, label: `导入类型`, visible: false },
{ key: 26, label: `完成标识`, visible: true },
- { key: 27, label: `优先级`, visible: true },
+ { key: 27, label: `优先级`, visible: false },
{ key: 28, label: `班次`, visible: true },
{ key: 29, label: `班组`, visible: true },
{ key: 30, label: `模号`, visible: true },
@@ -1001,7 +991,26 @@ const initFormData: PlanInfoForm = {
modelCode: undefined,
remark: undefined,
materialBoMName: undefined,
- workshopId: undefined
+ workshopId: undefined,
+ // 批量计划相关字段
+ planAmount1: undefined,
+ planAmount2: undefined,
+ planAmount3: undefined,
+ planAmount4: undefined,
+ planAmount5: undefined,
+ planAmount6: undefined,
+ materialIdL: undefined,
+ materialNameL: undefined,
+ materialIdR: undefined,
+ materialNameR: undefined,
+ materialBomVersion: undefined,
+ materialBomVersionL: undefined,
+ materialBomVersionR: undefined,
+ materialBoMNameL: undefined,
+ materialBoMNameR: undefined,
+ materialBoMIdL: undefined,
+ materialBoMIdR: undefined,
+ shiftName: '',
};
const data = reactive>({
form: { ...initFormData },
@@ -1039,7 +1048,11 @@ const data = reactive>({
classTeamId: undefined,
modelCode: undefined,
workshopId: undefined,
- params: {}
+ params: {},
+ planRangeTime: undefined,
+ materialName: undefined,
+ shiftName: '',
+ shifitId: undefined,
},
rules: {
materialId: [
@@ -1060,15 +1073,15 @@ const data = reactive>({
planBeginTime: [
{ required: true, message: '计划日期不能为空', trigger: 'blur' }
],
- planAmount1: [
- { required: true, message: '早班数量不能为空', trigger: 'blur' }
- ],
- planAmount2: [
- { required: true, message: '中班数量不能为空', trigger: 'blur' }
- ],
- planAmount3: [
- { required: true, message: '晚班数量不能为空', trigger: 'blur' }
- ]
+ // planAmount1: [
+ // { required: true, message: '早班数量不能为空', trigger: 'blur' }
+ // ],
+ // planAmount2: [
+ // { required: true, message: '中班数量不能为空', trigger: 'blur' }
+ // ],
+ // planAmount3: [
+ // { required: true, message: '晚班数量不能为空', trigger: 'blur' }
+ // ]
}
});
@@ -1186,7 +1199,14 @@ const handleUpdate = async (row?: PlanInfoVO) => {
const _planId = row?.planId || ids.value[0];
const res = await getPlanInfo(_planId);
Object.assign(form.value, res.data);
- form.value.finishFlag = form.value.finishFlag.split(',');
+ // finishFlag 类型守卫
+ if (Array.isArray(form.value.finishFlag)) {
+ // do nothing
+ } else if (typeof form.value.finishFlag === 'string') {
+ form.value.finishFlag = form.value.finishFlag.split(',').filter(Boolean).join(',');
+ } else {
+ form.value.finishFlag = [];
+ }
dialog.visible = true;
dialog.title = '修改生产计划信息';
};
@@ -1209,12 +1229,14 @@ const submitForm = () => {
planInfoFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
- form.value.finishFlag = form.value.finishFlag !== null ? form.value.finishFlag.join(',') : null;
- // if (form.value.planId) {
- // await updatePlanInfo(form.value).finally(() => buttonLoading.value = false);
- // } else {
- // await addPlanInfo(form.value).finally(() => buttonLoading.value = false);
- // }
+ // finishFlag 类型守卫
+ if (Array.isArray(form.value.finishFlag)) {
+ form.value.finishFlag = form.value.finishFlag.join(',');
+ } else if (typeof form.value.finishFlag === 'string') {
+ // do nothing
+ } else {
+ form.value.finishFlag = '';
+ }
//半制品、成型、硫化新增
let assemblyData = batchesAddAssemblyData();
if (machineIds.value.length == 0) {
@@ -1239,60 +1261,61 @@ const submitForm = () => {
/** 批量新增组装数据 */
const batchesAddAssemblyData = () => {
const formData = form.value;
- formData.workshopId = workshopId.value;//车间
+ // 统一workshopId类型为字符串,保证比较安全
+ const workshopIdStr = formData.workshopId != null ? String(formData.workshopId) : '';
let list = [];
- if (formData.planAmount1 > 0) {
+ if (typeof formData.planAmount1 === 'number' && formData.planAmount1 > 0) {
let data = { ...formData };
- data.modelCode = formData.workshopId === '4' ? 'L' : null;
- data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
+ data.modelCode = workshopIdStr === '4' ? 'L' : null;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdL : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
data.shiftId = '1';
data.planAmount = formData.planAmount1;
list.push(data);
}
- if (formData.planAmount2 > 0) {
+ if (typeof formData.planAmount2 === 'number' && formData.planAmount2 > 0) {
let data = { ...formData };
- data.modelCode = formData.workshopId === '4' ? 'L' : null;
+ data.modelCode = workshopIdStr === '4' ? 'L' : null;
data.shiftId = '2';
data.planAmount = formData.planAmount2;
- data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdL : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
list.push(data);
}
- if (formData.planAmount3 > 0) {
+ if (typeof formData.planAmount3 === 'number' && formData.planAmount3 > 0) {
let data = { ...formData };
- data.modelCode = formData.workshopId === '4' ? 'L' : null;
+ data.modelCode = workshopIdStr === '4' ? 'L' : null;
data.shiftId = '3';
data.planAmount = formData.planAmount3;
- data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdL : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionL : formData.materialBomVersion;
list.push(data);
}
- if (formData.planAmount4 > 0) {
+ if (typeof formData.planAmount4 === 'number' && formData.planAmount4 > 0) {
let data = { ...formData };
data.modelCode = 'R';
data.shiftId = '1';
data.planAmount = formData.planAmount4;
- data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdR : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
list.push(data);
}
- if (formData.planAmount5 > 0) {
+ if (typeof formData.planAmount5 === 'number' && formData.planAmount5 > 0) {
let data = { ...formData };
data.modelCode = 'R';
data.shiftId = '2';
data.planAmount = formData.planAmount5;
- data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdR : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
list.push(data);
}
- if (formData.planAmount6 > 0) {
+ if (typeof formData.planAmount6 === 'number' && formData.planAmount6 > 0) {
let data = { ...formData };
data.modelCode = 'R';
data.shiftId = '3';
data.planAmount = formData.planAmount6;
- data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
- data.materialBomVersion = formData.workshopId === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
+ data.materialId = workshopIdStr === '4' ? formData.materialIdR : formData.materialId;
+ data.materialBomVersion = workshopIdStr === '4' ? formData.materialBomVersionR : formData.materialBomVersion;
list.push(data);
}
return list;
@@ -1351,15 +1374,15 @@ const submitMaterialForm = () => {
};
/** 新增物料BOM按钮操作 */
-const handleMaterialBomAdd = (modelCode) => {
- if (form.value.materialId == null && form.value.materialIdL == null
- && form.value.materialIdR == null) {
- proxy?.$modal.msgWarning('请先选择物料!');
- return;
- }
- modelCodeRef.value = modelCode;
- materialBomOpen.value = true;
-};
+// const handleMaterialBomAdd = (modelCode) => {
+// if (form.value.materialId == null && form.value.materialIdL == null
+// && form.value.materialIdR == null) {
+// proxy?.$modal.msgWarning('请先选择物料!');
+// return;
+// }
+// modelCodeRef.value = modelCode;
+// materialBomOpen.value = true;
+// };
/** 提交物料BOM信息按钮 */
const submitMaterialBomForm = () => {
@@ -1425,12 +1448,6 @@ const getTreeSelect = async () => {
materialBomVersionOptions.value = res.data;
};
-async function handleMaterialBomChange(value: number | string) {
- const response = await optionselect(value);
- postOptions.value = response.data;
- form.value.postIds = [];
-}
-
onMounted(() => {
getWorkshopId();