diff --git a/src/router/index.ts b/src/router/index.ts index d91255d..ca8394d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -218,6 +218,20 @@ export const dynamicRoutes: RouteRecordRaw[] = [ meta: { title: '请假申请', activeMenu: '/workflow/leave', noCache: true } } ] + }, + { + path: '/mes/product-plan', + component: Layout, + hidden: true, + permissions: ['mes:orderInfo:edit'], + children: [ + { + path: 'index/:productOrderId(\\d+)', + component: () => import('@/views/mes/orderInfo/editProductPlan.vue'), + name: 'productPlanEdit', + meta: { title: '生产派工', activeMenu: '/mes/productplan', noCache: true } + } + ] } ]; diff --git a/src/views/mes/baseMaterialInfo/addMaterial.vue b/src/views/mes/baseMaterialInfo/addMaterial.vue new file mode 100644 index 0000000..d557fe6 --- /dev/null +++ b/src/views/mes/baseMaterialInfo/addMaterial.vue @@ -0,0 +1,482 @@ + + + diff --git a/src/views/mes/materialBom/addBom.vue b/src/views/mes/materialBom/addBom.vue index 8ca6352..c0b31c2 100644 --- a/src/views/mes/materialBom/addBom.vue +++ b/src/views/mes/materialBom/addBom.vue @@ -104,12 +104,9 @@ import { listMaterialBom } from '@/api/mes/materialBom'; -import { MaterialBomVO, MaterialBomQuery, MaterialBomForm } from '@/api/mes/materialBom/types'; - - +import {MaterialBomQuery, MaterialBomForm } from '@/api/mes/materialBom/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -; const { mes_check_type, material_classfication, active_flag } = toRefs(proxy?.useDict('mes_check_type', 'material_classfication', 'active_flag')); @@ -192,8 +189,6 @@ const getList = async () => { loading.value = false; }; - - // 取消按钮 const cancel = () => { reset(); @@ -216,10 +211,10 @@ const resetQuery = () => { queryFormRef.value?.resetFields(); handleQuery(); }; -//选中列赋值 + +/** 选中列赋值 */ const handleRowClick = (row) =>{ selectedRow.value = row - console.log(selectedRow.value); }; onMounted(() => { diff --git a/src/views/mes/materialBom/index.vue b/src/views/mes/materialBom/index.vue index c827397..2b738ed 100644 --- a/src/views/mes/materialBom/index.vue +++ b/src/views/mes/materialBom/index.vue @@ -52,7 +52,7 @@ > - + @@ -126,11 +126,12 @@ check-strictly /> - - - - - + + + + @@ -142,7 +143,7 @@ - + @@ -197,6 +198,16 @@ + + + + + + + @@ -209,6 +220,7 @@ import { updateMaterialBom } from '@/api/mes/materialBom'; import { MaterialBomVO, MaterialBomQuery, MaterialBomForm } from '@/api/mes/materialBom/types'; +import MaterialSelect from '@/views/mes/baseMaterialInfo/addMaterial.vue'; type MaterialBomOption = { materialBomId: number; @@ -231,6 +243,9 @@ const loading = ref(false); const queryFormRef = ref(); const materialBomFormRef = ref(); const materialBomTableRef = ref(); +const materialOpen = ref(false); +const materialSelectRef = ref(); + const dialog = reactive({ visible: false, @@ -246,7 +261,7 @@ const initFormData: MaterialBomForm = { materialBomDesc: undefined, materialBomVersion: undefined, ancestors: undefined, - standardAmount: undefined, + standardAmount: 1, topFlag: undefined, checkType: '1', projectId: undefined, @@ -284,8 +299,8 @@ const data = reactive>({ parentId: [ { required: true, message: '父级标识不能为空', trigger: 'blur' } ], - materialId: [ - { required: true, message: '物料ID不能为空', trigger: 'blur' } + materialName: [ + { required: true, message: '物料名称不能为空', trigger: 'blur' } ] } }); @@ -402,6 +417,19 @@ const handleDelete = async (row: MaterialBomVO) => { proxy?.$modal.msgSuccess('删除成功'); }; +/** 新增按钮操作 */ +const handleMaterialAdd = () => { + materialOpen.value = true; +} + +/** 提交物料BOM信息按钮 */ +const submitMaterialForm = () => { + let selectedRow = materialSelectRef.value.tableRef.store.states.currentRow.value; + form.value.materialId = selectedRow.materialId + form.value.materialName = selectedRow.materialName + materialOpen.value = false; +} + onMounted(() => { getList(); }); diff --git a/src/views/mes/planInfo/index.vue b/src/views/mes/planInfo/index.vue index 8c8ed9b..8991f1b 100644 --- a/src/views/mes/planInfo/index.vue +++ b/src/views/mes/planInfo/index.vue @@ -182,15 +182,22 @@ - - + + - + + + @@ -208,7 +215,7 @@ - + - + + + @@ -225,9 +239,9 @@ - - - + + + - - - + + + @@ -308,6 +322,8 @@ import { PlanInfoVO, PlanInfoQuery, PlanInfoForm } from '@/api/mes/planInfo/type import { getBaseShiftInfoList } from '@/api/mes/baseShiftInfo'; import { getBaseClassTeamInfoList } from '@/api/mes/baseClassTeamInfo'; import BomSelect from '@/views/mes/materialBom/addBom.vue'; +import { getProcessInfoList } from '@/api/mes/baseProcessInfo'; +import { getStationInfoList } from '@/api/mes/baseStationInfo'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { mes_import_flag, active_flag, mes_plan_status, mes_release_type, mes_finish_flag, mes_model_code } = toRefs(proxy?.useDict('mes_import_flag', 'active_flag', 'mes_plan_status', 'mes_release_type', 'mes_finish_flag', 'mes_model_code')); @@ -331,8 +347,9 @@ const dialog = reactive({ const shiftList = ref([]); const classTeamList = ref([]); - -const materialOpen = ref(false); +const processList = ref([]); +let stationList = ref([]); +const materialBomOpen = ref(false); const bomSelectRef = ref(); /*获取班次下拉框*/ @@ -347,6 +364,17 @@ const getClassTeamSelect = async () => { classTeamList.value = res.data; }; +/*获取工序下拉框*/ +const getProcessSelect = async () => { + let res = await getProcessInfoList(null); + processList.value = res.data; +}; + +/*获取工位下拉框*/ +const getStationSelect = async () => { + let res = await getStationInfoList(null); + stationList.value = res.data; +}; // 列显隐信息 const columns = ref([ @@ -402,10 +430,10 @@ const initFormData: PlanInfoForm = { processOrder: undefined, lastProcessId: undefined, finalProcessFlag: undefined, - releaseType: undefined, + releaseType: '1', releaseId: undefined, productionTime: undefined, - planAmount: undefined, + planAmount: 1, dispatchAmount: undefined, completeAmount: undefined, planBeginTime: undefined, @@ -461,21 +489,18 @@ const data = reactive>({ } }, rules: { - planCode: [ - { required: true, message: "计划编号不能为空", trigger: "blur" } - ], materialId: [ { required: true, message: "物料名称不能为空", trigger: "blur" } ], - materialBomId: [ + processId: [ + { required: true, message: "工序不能为空", trigger: "blur" } + ], + materialName: [ { required: true, message: "物料BOM不能为空", trigger: "blur" } ], planAmount: [ { required: true, message: "计划数量不能为空", trigger: "blur" } ], - dispatchAmount: [ - { required: true, message: "派工数量不能为空", trigger: "blur" } - ], } }); @@ -574,27 +599,23 @@ const handleExport = () => { } /** 新增按钮操作 */ -const handleMaterialAdd = () => { - materialOpen.value = true; - // bomSelectRef.value.open(); +const handleMaterialBomAdd = () => { + materialBomOpen.value = true; } -/** 提交物料信息按钮 */ -const submitMaterialForm = () => { - console.log("bomSelectRef.value",bomSelectRef.value.tableRef.store.states.currentRow.value); +/** 提交物料BOM信息按钮 */ +const submitMaterialBomForm = () => { let selectedRow = bomSelectRef.value.tableRef.store.states.currentRow.value; - console.log(selectedRow,form.value); + form.value.materialBomId = selectedRow.materialBomId form.value.materialName = selectedRow.materialName - console.log(selectedRow,form.value); - // this.$set(form, "materialId", selectedRow.materialId); - // this.$set(form, "materialName", selectedRow.materialName); - // this.$set(form, "erpMaterialId", selectedRow.erpId); - // materialOpen.value = false; + materialBomOpen.value = false; } onMounted(() => { getShiftSelect(); getClassTeamSelect(); + getProcessSelect(); + getStationSelect(); getList(); });