零件采购

This commit is contained in:
wb_zhanghaoyuan 2025-06-27 17:59:02 +08:00
parent 775f03825a
commit 2e9df0c375
2 changed files with 88 additions and 6 deletions

View File

@ -21,6 +21,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
import com.chanko.yunxi.mes.module.heli.enums.BoomDetailTypeEnum; import com.chanko.yunxi.mes.module.heli.enums.BoomDetailTypeEnum;
import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum;
@ -198,7 +199,7 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
MPJLambdaWrapper<MaterialPlanBoomDO> query = new MPJLambdaWrapper<>(); MPJLambdaWrapper<MaterialPlanBoomDO> query = new MPJLambdaWrapper<>();
query.selectAll(MaterialPlanBoomDO.class) query.selectAll(MaterialPlanBoomDO.class)
.select("p.project_name as projectName","p.name as projectSubName") .select("p.project_name as projectName","p.name as projectSubName")
.select("d.blueprint_no as blueprintNo","d.unit as unit") .select("d.blueprint_no as blueprintNo","d.unit as unit","f.name as supplierName")
.select("a.nickname as duEmpName","c.name as procedureName","e.name as compositionName") .select("a.nickname as duEmpName","c.name as procedureName","e.name as compositionName")
.select(MaterialPlanDO::getBrief) .select(MaterialPlanDO::getBrief)
.leftJoin(MaterialPlanDO.class, "p", MaterialPlanDO::getId,MaterialPlanBoomDO::getProjectMaterialPlanId) .leftJoin(MaterialPlanDO.class, "p", MaterialPlanDO::getId,MaterialPlanBoomDO::getProjectMaterialPlanId)
@ -206,6 +207,7 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
.leftJoin(AdminUserDO.class, "a", AdminUserDO::getId, MaterialPlanBoomDO::getDuEmpId) .leftJoin(AdminUserDO.class, "a", AdminUserDO::getId, MaterialPlanBoomDO::getDuEmpId)
.leftJoin(ProcedureDO.class, "c", ProcedureDO::getId, MaterialPlanBoomDO::getProcedureId) .leftJoin(ProcedureDO.class, "c", ProcedureDO::getId, MaterialPlanBoomDO::getProcedureId)
.leftJoin(CompositionDO.class, "e", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) .leftJoin(CompositionDO.class, "e", CompositionDO::getId, ProcessBomDetailDO::getCompositionId)
.leftJoin(SupplierDO.class, "f", SupplierDO::getId, MaterialPlanBoomDO::getSupplierId)
.disableSubLogicDel(); .disableSubLogicDel();
query query
.like(!StringUtils.isEmpty(pageReqVO.getProjectName()),MaterialPlanDO::getProjectName, pageReqVO.getProjectName()) .like(!StringUtils.isEmpty(pageReqVO.getProjectName()),MaterialPlanDO::getProjectName, pageReqVO.getProjectName())

View File

@ -71,16 +71,70 @@
</el-table-column> </el-table-column>
<el-table-column label="客户简称" align="center" prop="customerBriefName" min-width="180" /> <el-table-column label="客户简称" align="center" prop="customerBriefName" min-width="180" />
<el-table-column label="项目名称" align="center" prop="projectName" min-width="180" /> <el-table-column label="项目名称" align="center" prop="projectName" min-width="180" />
<el-table-column label="子项目名称" align="center" prop="projectSubName" min-width="180" />
<el-table-column min-width="200px" align="center">
<template #header>泡沫</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.isFoam`" class="mb-0px!">
<el-checkbox-group v-model="row.isFoam">
<el-checkbox v-for="dict in ['是', '否']" :key="dict" :label="dict">
{{ dict }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" prop="matName" min-width="180" /> <el-table-column label="零件名称" align="center" prop="matName" min-width="180" />
<el-table-column label="材质" align="center" prop="compositionName" min-width="120" /> <el-table-column label="材质" align="center" prop="compositionName" min-width="120" />
<el-table-column label="图号" align="center" prop="blueprintNo" min-width="120" /> <el-table-column label="图号" align="center" prop="blueprintNo" min-width="120" />
<el-table-column label="需求数量" align="center" prop="boomAmount" min-width="120" /> <el-table-column label="需求数量" align="center" prop="boomAmount" min-width="120" />
<el-table-column label="采购数量" align="center" prop="unit" min-width="120" /> <el-table-column label="单位" align="center" prop="unit" min-width="120" />
<el-table-column min-width="200px" align="center"> <el-table-column min-width="200px" align="center">
<template #header>采购数量</template> <template #header>采购数量</template>
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<el-form-item :prop="`${$index}.matWeight`" class="mb-0px!" > <el-form-item :prop="`${$index}.purchaseAmount`" class="mb-0px!" >
<el-input-number v-model="row.matWeight" type="number" :precision="0" /> <el-input-number v-model="row.purchaseAmount" type="number" :precision="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="200px" align="center" >
<template #header><span class="hl-table_header">*</span>供应商</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.supplierId`" class="mb-0px!" >
<SupplierSelect v-model="row.supplierId" class="!w-265px" clearable @update:newValue="handleSelectedUser($index, $event)"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="200px" align="center">
<template #header>预估总价</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.estimatedPrice`" class="mb-0px!" >
<el-input-number v-model="row.estimatedPrice" type="number" :precision="2" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="200px" align="center" >
<template #header><span class="hl-table_header">*</span>预计到货日期</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.arriveTime`" class="mb-0px!" >
<el-date-picker class="!w-265px" v-model="row.arriveTime" type="date" value-format="x" placeholder="预计到货日期" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="200px" align="center" >
<template #header>技术要求</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.description`" class="mb-0px!" >
<el-input class="!w-265px" v-model="row.description" placeholder="技术要求" />
</el-form-item>
</template>
</el-table-column>
<el-table-column min-width="200px" align="center">
<template #header>理论重量()</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.theWeight`" class="mb-0px!" >
<el-input-number v-model="row.theWeight" type="number" :precision="3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -110,6 +164,7 @@ import {ElTable} from "element-plus";
import {useUserStore} from "@/store/modules/user"; import {useUserStore} from "@/store/modules/user";
import {dateFormatter1} from "@/utils/formatTime"; import {dateFormatter1} from "@/utils/formatTime";
import {getPartPurchasePages} from "@/api/heli/materialplan"; import {getPartPurchasePages} from "@/api/heli/materialplan";
import SupplierSelect from "@/views/heli/hlvuestyle/supplierSelect.vue";
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
defineOptions({ name: 'standard' }) defineOptions({ name: 'standard' })
@ -184,9 +239,14 @@ const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
getList() getList()
} }
// //
// const handleSelectedSupplier = (newValue: any) => {
// formData.value.supplierId = newValue?.id
// }
const handleSelectedUser = (currentIndex, newValue: any) => { const handleSelectedUser = (currentIndex, newValue: any) => {
list.value[currentIndex].duEmpId = newValue?.id list.value[currentIndex].supplierId = newValue?.id
} }
const singleSubmission= (val) =>{ const singleSubmission= (val) =>{
multipleTable.value=[] multipleTable.value=[]
multipleTable.value.push(val) multipleTable.value.push(val)
@ -211,6 +271,26 @@ const submitForm = async () => {
return; return;
} }
for (let i = 0; i < list.length; i++) {
if (list[i].purchaseAmount === null || list[i].purchaseAmount === 0) {
message.error("采购数量为0或空");
break;
}
if (list[i].supplierId === null) {
message.error("供应商为空");
break;
}
if (list[i].arriveTime === null) {
message.error("预计到货日期为空");
break;
}
if (list[i].estimatedPrice === null) {
message.error("预估总价为空");
break;
}
}
// 2. // 2.
const firstSupplierId = list[0].supplierId; const firstSupplierId = list[0].supplierId;
if (list.some(item => item.supplierId !== firstSupplierId)) { if (list.some(item => item.supplierId !== firstSupplierId)) {