update 硫化计划添加区分左右模物料、BOM

master
yinq 1 month ago
parent bc8709b798
commit ceab46627e

@ -323,6 +323,15 @@ 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;
}
export interface PlanInfoQuery extends PageQuery {

@ -361,7 +361,8 @@
<!-- 添加物料BOM信息对话框 -->
<el-dialog title='选择物料BOM信息' v-model='materialBomOpen' append-to-body>
<BomSelect @selection='handleSelection' ref='bomSelectRef' v-if='materialBomOpen' :materialIdForm="materialIdForm" ></BomSelect>
<BomSelect @selection='handleSelection' ref='bomSelectRef' v-if='materialBomOpen'
:materialIdForm='materialIdForm'></BomSelect>
<div slot='footer' class='dialog-footer'>
<el-button type='primary' @click='submitMaterialBomForm'> </el-button>
<el-button @click='materialBomOpen = false'> </el-button>
@ -600,7 +601,7 @@
</el-dialog>
<!-- 批量添加硫化计划信息对话框 -->
<el-dialog v-model='vulBatchDialog.visible' width='1200px' append-to-body>
<el-dialog v-model='vulBatchDialog.visible' width='1300px' append-to-body>
<template #header='{ close, titleId, titleClass }'>
<div class='my-header'>
{{ vulBatchDialog.title }}
@ -639,8 +640,32 @@
<el-form ref='planInfoFormRef' :model='form' :rules='rules' label-width='100px'>
<el-row :gutter='10' class='mb8'>
<el-col :span='12'>
<el-form-item label='物料名称' prop='materialId'>
<el-input v-model='form.materialName' placeholder='请点击检索物料' @click='handleMaterialAdd'
<el-form-item label='计划时间' prop='planBeginTime'>
<el-date-picker clearable
v-model='form.planBeginTime'
type='date'
value-format='YYYY-MM-DD HH:mm:ss'
placeholder='请选择计划时间'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label='班组' prop='classTeamId'>
<el-select v-model='form.classTeamId' placeholder='请选择班组'>
<el-option
v-for='item in classTeamList'
:key='item.classTeamId'
:label='item.teamName'
:value='item.classTeamId'
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter='10' class='mb8'>
<el-col :span='12'>
<el-form-item label='左模物料' prop='materialNameL'>
<el-input v-model='form.materialNameL' placeholder='请点击检索物料' @click='handleMaterialAdd("L")'
readonly>
<template #append>
<el-icon class='el-input__icon'>
@ -651,9 +676,8 @@
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label='物料BOM' prop='materialBoMName'>
<el-input v-model='form.materialBoMName' placeholder='请点击检索物料BOM'
@click='handleMaterialBomAdd'
<el-form-item label='右模物料' prop='materialNameR'>
<el-input v-model='form.materialNameR' placeholder='请点击检索物料' @click='handleMaterialAdd("R")'
readonly>
<template #append>
<el-icon class='el-input__icon'>
@ -664,74 +688,34 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter='10' class='mb8'>-->
<!-- <el-col :span='12'>-->
<!-- <el-form-item label='工序名称' prop='processId'>-->
<!-- <el-select v-model='form.processId' placeholder='请选择工序'>-->
<!-- <el-option-->
<!-- v-for='item in processList'-->
<!-- :key='item.processId'-->
<!-- :label='item.processName'-->
<!-- :value='item.processId'-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span='12'>-->
<!-- <el-form-item label='下达类型' prop='releaseType'>-->
<!-- <el-radio-group v-model='form.releaseType' :disabled='true'>-->
<!-- <el-radio-->
<!-- v-for='dict in mes_release_type'-->
<!-- :key='dict.value'-->
<!-- :value='dict.value'-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label='机台名称' prop='releaseId'>-->
<!-- <el-select v-model='form.releaseId' placeholder='请选择机台名称'>-->
<!-- <el-option-->
<!-- v-for='item in releaseList'-->
<!-- :key='item.machineId'-->
<!-- :label='item.machineName'-->
<!-- :value='item.machineId'-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row :gutter='10' class='mb8'>
<el-col :span='12'>
<el-form-item label='计划时间' prop='planBeginTime'>
<el-date-picker clearable
v-model='form.planBeginTime'
type='date'
value-format='YYYY-MM-DD HH:mm:ss'
placeholder='请选择计划时间'>
</el-date-picker>
<el-form-item label='左模BOM' prop='materialBoMNameL'>
<el-input v-model='form.materialBoMNameL' placeholder='请点击检索物料BOM'
@click='handleMaterialBomAdd("L")'
readonly>
<template #append>
<el-icon class='el-input__icon'>
<search />
</el-icon>
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<!-- <el-form-item label='计划结束时间' prop='planEndTime'>-->
<!-- <el-date-picker clearable-->
<!-- v-model='form.planEndTime'-->
<!-- type='date'-->
<!-- value-format='YYYY-MM-DD HH:mm:ss'-->
<!-- placeholder='请选择计划结束时间'>-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label='右模BOM' prop='materialBoMNameR'>
<el-input v-model='form.materialBoMNameR' placeholder='请点击检索物料BOM'
@click='handleMaterialBomAdd("R")'
readonly>
<template #append>
<el-icon class='el-input__icon'>
<search />
</el-icon>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label='班组' prop='classTeamId'>
<el-select v-model='form.classTeamId' placeholder='请选择班组'>
<el-option
v-for='item in classTeamList'
:key='item.classTeamId'
:label='item.teamName'
:value='item.classTeamId'
/>
</el-select>
</el-form-item>
<el-row :gutter='10' class='mb8'>
<el-col :span='12'>
<el-form-item label='左模早班数量' prop='planAmount1'>
@ -880,6 +864,8 @@ const machineIds = ref<Array<string | number>>([]);
const machineQueryParams = ref({});
const modelCodeRef = ref();
/*获取班次下拉框*/
const getShiftSelect = async () => {
let res = await getBaseShiftInfoList(null);
@ -1188,6 +1174,8 @@ const batchesAddAssemblyData = () => {
if (formData.planAmount1 > 0) {
let data = { ...formData };
data.modelCode = formData.workshopId === '4' ? 'L' : null;
data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdL : formData.materialBomId;
data.shiftId = '1';
data.planAmount = formData.planAmount1;
list.push(data);
@ -1197,6 +1185,8 @@ const batchesAddAssemblyData = () => {
data.modelCode = formData.workshopId === '4' ? 'L' : null;
data.shiftId = '2';
data.planAmount = formData.planAmount2;
data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdL : formData.materialBomId;
list.push(data);
}
if (formData.planAmount3 > 0) {
@ -1204,6 +1194,8 @@ const batchesAddAssemblyData = () => {
data.modelCode = formData.workshopId === '4' ? 'L' : null;
data.shiftId = '3';
data.planAmount = formData.planAmount3;
data.materialId = formData.workshopId === '4' ? formData.materialIdL : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdL : formData.materialBomId;
list.push(data);
}
if (formData.planAmount4 > 0) {
@ -1211,6 +1203,8 @@ const batchesAddAssemblyData = () => {
data.modelCode = 'R';
data.shiftId = '1';
data.planAmount = formData.planAmount4;
data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdR : formData.materialBomId;
list.push(data);
}
if (formData.planAmount5 > 0) {
@ -1218,6 +1212,8 @@ const batchesAddAssemblyData = () => {
data.modelCode = 'R';
data.shiftId = '2';
data.planAmount = formData.planAmount5;
data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdR : formData.materialBomId;
list.push(data);
}
if (formData.planAmount6 > 0) {
@ -1225,6 +1221,8 @@ const batchesAddAssemblyData = () => {
data.modelCode = 'R';
data.shiftId = '3';
data.planAmount = formData.planAmount6;
data.materialId = formData.workshopId === '4' ? formData.materialIdR : formData.materialId;
data.materialBomId = formData.workshopId === '4' ? formData.materialBomIdR : formData.materialBomId;
list.push(data);
}
return list;
@ -1256,37 +1254,56 @@ const handleExport = () => {
}, `planInfo_${new Date().getTime()}.xlsx`);
};
/** 新增物料按钮操作 */
const handleMaterialAdd = (modelCode) => {
modelCodeRef.value = modelCode;
materialOpen.value = true;
};
/** 提交物料信息按钮 */
const submitMaterialForm = () => {
let selectedRow = materialSelectRef.value.tableRef.store.states.currentRow.value;
if (modelCodeRef.value === 'L') {
form.value.materialIdL = selectedRow.materialId;
form.value.materialNameL = selectedRow.materialName;
} else if (modelCodeRef.value === 'R') {
form.value.materialIdR = selectedRow.materialId;
form.value.materialNameR = selectedRow.materialName;
} else {
form.value.materialId = selectedRow.materialId;
form.value.materialName = selectedRow.materialName;
}
materialIdForm.value = selectedRow.materialId;
materialOpen.value = false;
};
/** 新增物料BOM按钮操作 */
const handleMaterialBomAdd = () => {
if (form.value.materialId == null){
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 = () => {
let selectedRow = bomSelectRef.value.tableRef.store.states.currentRow.value;
form.value.materialBomId = selectedRow.materialBomId;
form.value.materialBoMName = selectedRow.materialName;
if (modelCodeRef.value === 'L') {
form.value.materialBomIdL = selectedRow.materialBomId;
form.value.materialBoMNameL = selectedRow.materialName;
} else if (modelCodeRef.value === 'R') {
form.value.materialBomIdR = selectedRow.materialBomId;
form.value.materialBoMNameR = selectedRow.materialName;
} else {
form.value.materialBomId = selectedRow.materialBomId;
form.value.materialBoMName = selectedRow.materialName;
}
materialBomOpen.value = false;
};
/** 新增按钮操作 */
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;
materialIdForm.value =selectedRow.materialId;
materialOpen.value = false;
};
/** 搜索机台信息按钮操作 */
function handleMachineQuery() {
getReleaseSelect();

@ -116,10 +116,10 @@
<!-- <el-input v-model='form.ancestors' placeholder='请输入祖级列表'/>-->
<!-- </el-form-item>-->
<el-form-item :label='masterDataTitle + "编号"' prop='dataDetailCode'>
<el-input v-model='form.dataDetailCode' placeholder='请输入主数据明细编号'/>
<el-input v-model='form.dataDetailCode' :placeholder='"请输入" + masterDataTitle+ "编号"'/>
</el-form-item>
<el-form-item :label='masterDataTitle + "名称"' prop='dataDetailName'>
<el-input v-model='form.dataDetailName' placeholder='请输入主数据明细名称'/>
<el-input v-model='form.dataDetailName' :placeholder='"请输入" + masterDataTitle+ "名称"'/>
</el-form-item>
<el-form-item :label='i.label' :prop='i.tableKey' v-for="i in reservedFieldList">
<el-input v-model='form[i.tableKey]' placeholder='请输入预留字段1数据'/>
@ -246,10 +246,10 @@ const data = reactive<PageData<MasterDataDetailForm, MasterDataDetailQuery>>({
},
rules: {
dataDetailCode: [
{required: true, message: '主数据明细编号不能为空', trigger: 'blur'}
{required: true, message: '编号不能为空', trigger: 'blur'}
],
dataDetailName: [
{required: true, message: '主数据明细名称不能为空', trigger: 'blur'}
{required: true, message: '名称不能为空', trigger: 'blur'}
],
activeFlag: [
{required: true, message: '激活标识不能为空', trigger: 'change'}

Loading…
Cancel
Save