生产计划 子项目数据编辑

生产计划 子项目数据编辑
pull/4/head
siontion 8 months ago
parent 1cbc705d7c
commit af425f41f9

@ -29,6 +29,14 @@ public class PlanSubRespVO {
@ExcelProperty("子项目id")
private Long projectSubId;
@Schema(description = "子项目简称")
@ExcelProperty("子项目简称")
private String projectSubShortName;
@Schema(description = "子项目编码")
@ExcelProperty("子项目编码")
private String projectSubCode;
@Schema(description = "模具类型id")
@ExcelProperty("模具类型id")
private Long mouldId;
@ -65,4 +73,5 @@ public class PlanSubRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -25,6 +25,12 @@ public class PlanSubSaveReqVO {
@Schema(description = "子项目id")
private Long projectSubId;
@Schema(description = "子项目简称")
private String projectSubShortName;
@Schema(description = "子项目编号")
private String projectSubCode;
@Schema(description = "模具类型id")
private Long mouldId;

@ -74,5 +74,13 @@ public class PlanSubDO extends BaseDO {
* 3D
*/
private String threeDimOwner;
/**
*
*/
private String projectSubShortName;
/**
*
*/
private String projectSubCode;
}

@ -1,46 +1,48 @@
import request from '@/config/axios'
export interface PlanSubVO {
id: number
projectPlanId: number
projectId: number
projectSubId: number
mouldId: number
equipId: number
blankDate: Date
blankOwner: string
twoDimDate: Date
twoDimOwner: string
threeDimDate: Date
threeDimOwner: string
}
// 查询生产计划子项目分页
export const getPlanSubPage = async (params) => {
return await request.get({ url: `/heli/plan-sub/page`, params })
}
// 查询生产计划子项目详情
export const getPlanSub = async (id: number) => {
return await request.get({ url: `/heli/plan-sub/get?id=` + id })
}
// 新增生产计划子项目
export const createPlanSub = async (data: PlanSubVO) => {
return await request.post({ url: `/heli/plan-sub/create`, data })
}
// 修改生产计划子项目
export const updatePlanSub = async (data: PlanSubVO) => {
return await request.put({ url: `/heli/plan-sub/update`, data })
}
// 删除生产计划子项目
export const deletePlanSub = async (id: number) => {
return await request.delete({ url: `/heli/plan-sub/delete?id=` + id })
}
// 导出生产计划子项目 Excel
export const exportPlanSub = async (params) => {
return await request.download({ url: `/heli/plan-sub/export-excel`, params })
}
import request from '@/config/axios'
export interface PlanSubVO {
id: number
projectPlanId: number
projectId: number
projectSubId: number
projectSubShortName: string
projectSubCode: string
mouldId: number
equipId: number
blankDate: Date
blankOwner: string
twoDimDate: Date
twoDimOwner: string
threeDimDate: Date
threeDimOwner: string
}
// 查询生产计划子项目分页
export const getPlanSubPage = async (params) => {
return await request.get({ url: `/heli/plan-sub/page`, params })
}
// 查询生产计划子项目详情
export const getPlanSub = async (id: number) => {
return await request.get({ url: `/heli/plan-sub/get?id=` + id })
}
// 新增生产计划子项目
export const createPlanSub = async (data: PlanSubVO) => {
return await request.post({ url: `/heli/plan-sub/create`, data })
}
// 修改生产计划子项目
export const updatePlanSub = async (data: PlanSubVO) => {
return await request.put({ url: `/heli/plan-sub/update`, data })
}
// 删除生产计划子项目
export const deletePlanSub = async (id: number) => {
return await request.delete({ url: `/heli/plan-sub/delete?id=` + id })
}
// 导出生产计划子项目 Excel
export const exportPlanSub = async (params) => {
return await request.download({ url: `/heli/plan-sub/export-excel`, params })
}

@ -256,7 +256,7 @@ const formData = ref({
id: undefined,
projectId: undefined,
projectOwner:undefined,
hasCraft:undefined,
hasCraft:1,
craftOwner:undefined,
craftStartTime:undefined,
craftEndTime:undefined,
@ -305,9 +305,8 @@ const submitForm = async () => {
var planId = await PlanApi.createPlan(data)
message.success(t('common.createSuccess'))
dialogVisible.value = false
//
emit('success')
//emit('success')
router.push({ path: '/plan/edit',query: { id: planId }})
} finally {
formLoading.value = false

@ -250,10 +250,17 @@
<el-form ref="projectOrderSubFormRef" :model="formData.projectOrderSubs" :rules="subFormRules"
v-loading="subFormLoading" label-width="0">
<el-table :data="formData.projectOrderSubs" class="hl-table">
<el-table-column label="序号" type="index" width="80" />
<el-table-column prop="name" label="子项目名称" min-width="120" align="center" />
<el-table-column prop="shortName" label="子项目简称" min-width="120" align="center" />
<el-table-column prop="code" label="子项目编号" min-width="120" align="center" />
<el-table-column label="序号" type="index" width="80" fixed />
<el-table-column prop="name" label="子项目名称" min-width="120" align="center" fixed/>
<el-table-column prop="projectSubShortName" min-width="150" align="center" >
<template #header>子项目简称</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.projectSubShortName`" class="mb-0px!">
<el-input disabled v-model="row.projectSubShortName" placeholder="子项目简称" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="projectSubCode" label="子项目编号" min-width="120" align="center" />
<el-table-column prop="mouldId" align="center" min-width="120">
<template #header> 模具类型 </template>
<template #default="scope">
@ -265,7 +272,7 @@
</template>
</el-table-column>
<el-table-column prop="equipId" align="center" min-width="120">
<template #header> 设备型号 </template>
<template #header> 设备信息 </template>
<template #default="scope">
<el-form-item :prop="`${scope.$index}.equipId`" class="mb-0px!">
<el-select disabled v-model="scope.row.equipId" clearable placeholder="下拉选择" style="width: 100%">
@ -396,7 +403,7 @@
</el-row>
</el-card>
<el-card class="hl-card-info">
<el-card class="hl-card-info" v-if="false">
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">操作日志</span>
</template>
@ -553,6 +560,8 @@ const handleInitPlanSub = async ()=>{
item.projectPlanId = subTemp.projectPlanId
item.projectId = subTemp.projectId
item.projectSubId = subTemp.projectSubId
item.projectSubShortName = subTemp.projectSubShortName
item.projectSubCode = subTemp.projectSubCode
item.mouldId = subTemp.mouldId
item.equipId = subTemp.equipId
item.blankDate = subTemp.blankDate

@ -247,13 +247,20 @@
<el-row>
<el-col>
<el-card class="hl-incard">
<el-form ref="projectOrderSubFormRef" :model="formData.projectOrderSubs" :rules="subFormRules"
<el-form ref="subFormRef" :model="formData.projectOrderSubs" :rules="subFormRules"
v-loading="subFormLoading" label-width="0">
<el-table :data="formData.projectOrderSubs" class="hl-table">
<el-table-column label="序号" type="index" width="80" />
<el-table-column prop="name" label="子项目名称" min-width="120" align="center" />
<el-table-column prop="shortName" label="子项目简称" min-width="120" align="center" />
<el-table-column prop="code" label="子项目编号" min-width="120" align="center" />
<el-table-column label="序号" type="index" width="80" fixed />
<el-table-column prop="name" label="子项目名称" min-width="120" align="center" fixed/>
<el-table-column prop="projectSubShortName" min-width="150" align="center" :rules="subFormRules.projectSubShortName" >
<template #header>子项目简称</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.projectSubShortName`" class="mb-0px!">
<el-input v-model="row.projectSubShortName" placeholder="子项目简称" @change="(name)=>handleSubCode(row,name)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="projectSubCode" label="子项目编号" min-width="120" align="center" />
<el-table-column prop="mouldId" align="center" min-width="120">
<template #header> 模具类型 </template>
<template #default="scope">
@ -265,7 +272,7 @@
</template>
</el-table-column>
<el-table-column prop="equipId" align="center" min-width="120">
<template #header> 设备型号 </template>
<template #header> 设备信息 </template>
<template #default="scope">
<el-form-item :prop="`${scope.$index}.equipId`" class="mb-0px!">
<el-select v-model="scope.row.equipId" clearable placeholder="下拉选择" style="width: 100%">
@ -336,8 +343,6 @@
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
@ -396,7 +401,7 @@
</el-row>
</el-card>
<el-card class="hl-card-info">
<el-card class="hl-card-info" v-if="false">
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">操作日志</span>
</template>
@ -447,6 +452,7 @@ const reload = inject('reload')
const formLoading = ref(false) // 12
const formRef = ref() //
const subFormRef = ref() // Ref
const formData = ref({
id: undefined,
projectId: undefined,
@ -473,6 +479,10 @@ const formData = ref({
const formRules = reactive({
projectCode: [{ required: true, message: '项目编号不能为空', trigger: 'blur' }],
})
const subFormRules = reactive({
projectSubShortName: [{ required: true, message: '子项目简称不能为空', trigger: 'blur' }],
})
const projectOrderDialog = ref()
const openProjectOrderDialog = () => {
@ -495,6 +505,11 @@ const handleSelectedProjectOrder = (arr: ProjectOrderVO[]) => {
handleInitPlanSub()
}
}
const handleSubCode = (row,name) =>{
row.projectSubCode = formData.value.projectCode+'-'+customerInit.value.code + '-'+ name
}
const handleMouldType = async (scope,mid) => {
//
scope.row.equipList = equipInit.value.filter( rg => rg.mould_type_id == mid)
@ -503,6 +518,7 @@ const handleMouldType = async (scope,mid) => {
const submitForm = async () => {
//
await formRef.value.validate()
await subFormRef.value.validate()
//
formLoading.value = true
try {
@ -514,6 +530,8 @@ const submitForm = async () => {
var subData = item as unknown as PlanSubApid.PlanSubVo
subData.projectId = item.projectOrderId
subData.projectPlanId = formData.value.id
subData.projectSubShortName = item.projectSubShortName
subData.projectSubCode = item.projectSubCode
subData.projectSubId = item.id
if(item.planSubId == undefined){
subData.id = 0
@ -554,6 +572,8 @@ const handleInitPlanSub = async ()=>{
item.projectPlanId = subTemp.projectPlanId
item.projectId = subTemp.projectId
item.projectSubId = subTemp.projectSubId
item.projectSubShortName = subTemp.projectSubShortName
item.projectSubCode = subTemp.projectSubCode
item.mouldId = subTemp.mouldId
item.equipId = subTemp.equipId
item.blankDate = subTemp.blankDate
@ -570,6 +590,7 @@ const handleInitPlanSub = async ()=>{
const equipInit = ref()
const mouldTypeList = ref()
const customerInit = ref()
onMounted(async () => {
//
@ -582,12 +603,12 @@ onMounted(async () => {
await handleInitPlanSub()
var projectInit = await ProjectOrderApi.getProjectOrder(formData.value.projectId)
var customerInit = await CustomerApi.getCustomer(projectInit.customerId)
customerInit.value = await CustomerApi.getCustomer(projectInit.customerId)
var businessManInit = await UserApi.getUser(projectInit.businessMan)
formData.value.projectCode = projectInit.code
formData.value.projectStatus = projectInit.orderStatus
formData.value.customerName = customerInit?.name
formData.value.customerName = customerInit?.value.name
formData.value.projectName = projectInit.projectName
formData.value.businessMan = businessManInit?.nickname
formData.value.projectStartTime = projectInit.projectStartTime

@ -106,6 +106,8 @@ CREATE TABLE `project_plan_sub` (
`project_plan_id` bigint(20) NOT NULL COMMENT '计划id',
`project_id` bigint(20) NOT NULL COMMENT '项目id',
`project_sub_id` bigint(20) DEFAULT NULL COMMENT '子项目id',
`project_sub_short_name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '子项目简称',
`project_sub_code` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '子项目编码',
`mould_id` bigint(20) DEFAULT NULL COMMENT '模具类型id',
`equip_id` bigint(20) DEFAULT NULL COMMENT '设备id',
`blank_date` datetime DEFAULT NULL COMMENT '毛坯结束日期',
@ -121,4 +123,4 @@ CREATE TABLE `project_plan_sub` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='生产计划子项目表';
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='生产计划子项目表';
Loading…
Cancel
Save