采购员任命

This commit is contained in:
Teo
2025-08-13 19:10:35 +08:00
parent fbe1dae085
commit b90b0a457c
12 changed files with 1210 additions and 286 deletions

View File

@ -8,8 +8,8 @@
@approvalVerifyOpen="approvalVerifyOpen"
@handleApprovalRecord="handleApprovalRecord"
:buttonLoading="buttonLoading"
:id="form.id"
:status="form.approvalProject"
:id="form.mrpBaseBo.id"
:status="form.mrpBaseBo.status"
:pageType="routeParams.type"
/>
</el-card>
@ -17,17 +17,36 @@
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
<h3 class="text-lg font-semibold text-gray-800">物资设备批次需求计划</h3>
<el-row :gutter="20">
<el-col :span="8" :offset="0">
<el-form-item label="物资类别" prop="mrpBaseBo.matCat">
<el-input v-model="form.mrpBaseBo.matCat" placeholder="请输入物资类别" disabled />
</el-form-item>
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="编制日期" prop="mrpBaseBo.preparedDate">
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD" disabled placeholder="请选择编制日期" />
</el-form-item>
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="计划编号" prop="mrpBaseBo.planCode">
<el-input v-model="form.mrpBaseBo.planCode" placeholder="请输入计划编号" disabled />
</el-form-item>
</el-col>
</el-row>
</div>
<div class="p-6">
<el-table v-loading="loading" :data="cailiaoshebeiList">
<el-table-column label="供货商" align="center" prop="supplierCompany" />
<el-table-column label="设备材料名称" align="center" prop="name" />
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column label="供货商ID" align="center" prop="supplierId" /> -->
<el-table-column label="物资名称" align="center" prop="name" />
<el-table-column label="质量标准" align="center" prop="qs" />
<el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
<el-table-column label="计量单位" align="center" prop="unit" width="80" />
<el-table-column label="供应周期(天)" align="center" prop="estimatedCycle" />
<el-table-column label="需求数量" align="center" prop="demandQuantity" />
<el-table-column label="计划到场时间" align="center" prop="arrivalTime" width="250" />
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
</div>
</el-card>
@ -77,7 +96,7 @@ const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_
import { getKnowledgeDocument } from '@/api/design/technicalStandard';
import { getConstructionValue } from '@/api/out/constructionValue';
import { workScheduleListDetail } from '@/api/progress/plan';
import { getCailiaoshebei } from '@/api/materials/suppliesprice';
import { getCailiaoshebei } from '@/api/materials/batchPlan';
import { getPcDetail, listCailiaoshebei } from '@/api/materials/batchPlan';
import { CailiaoshebeiVO } from '@/api/materials/batchPlan/types';
// 获取用户 store
@ -101,7 +120,7 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
//按钮组件
const flowCodeOptions = [
{
value: currentProject.value?.id + '_batchRequirements',
value: currentProject.value?.id + '_mrp',
label: '物资供应总计划审批'
}
];
@ -121,9 +140,28 @@ const taskVariables = ref<Record<string, any>>({});
const selectValue = ref<string[]>([]);
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
const initFormData = {
id: undefined,
approvalProject: undefined
const initFormData: any = {
mrpBaseBo: {
id: undefined,
preparedDate: undefined,
planCode: undefined,
matCat: undefined,
status: undefined,
projectId: currentProject.value.id
},
planList: [
{
id: undefined,
name: undefined,
specification: undefined,
unit: undefined,
demandQuantity: undefined,
qs: undefined,
arrivalTime: undefined,
remark: undefined
}
]
};
const data = reactive({
form: { ...initFormData },
@ -148,18 +186,11 @@ const getInfo = () => {
loading.value = true;
buttonLoading.value = false;
nextTick(async () => {
const id = routeParams.value.id.split('_')[0];
const res = await listCailiaoshebei({ pageNum: 1, pageSize: 10, batchNumber: id });
cailiaoshebeiList.value = res.rows;
if (!form.value.approvalProject) {
const res = await getPcDetail(id);
form.value.approvalProject = res.data.approvalProject;
} else {
form.value.approvalProject = routeParams.value.approvalProject;
}
console.log('🚀 ~ getInfo ~ form.value.approvalProject:', form.value.approvalProject);
form.value.id = routeParams.value.id;
const id = routeParams.value.id;
const res: any = await getCailiaoshebei(id);
cailiaoshebeiList.value = res.data.planList;
Object.assign(form.value, res.data);
console.log('🚀 ~ getInfo ~ form.value:', form.value);
loading.value = false;
buttonLoading.value = false;
@ -177,10 +208,10 @@ const submitFlow = async () => {
dialogVisible.visible = false;
};
//提交申请
const handleStartWorkFlow = async (data: LeaveForm) => {
const handleStartWorkFlow = async (data: any) => {
try {
submitFormData.value.flowCode = flowCode.value;
submitFormData.value.businessId = data.id;
submitFormData.value.businessId = data.mrpBaseBo.id;
//流程变量
taskVariables.value = {
// leave4/5 使用的流程变量
@ -198,7 +229,7 @@ const handleStartWorkFlow = async (data: LeaveForm) => {
};
//审批记录
const handleApprovalRecord = () => {
approvalRecordRef.value.init(form.value.id);
approvalRecordRef.value.init(form.value.mrpBaseBo.id);
};
//提交回调
const submitCallback = async () => {
@ -218,7 +249,7 @@ const submit = async (status, data) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1);
} else {
if ((form.value.approvalProject === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
if ((form.value.mrpBaseBo.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
flowCode.value = flowCodeOptions[0].value;
dialogVisible.visible = true;
return;