优化
This commit is contained in:
@ -93,7 +93,7 @@ export const isSubmit = (id): AxiosPromise => {
|
||||
*/
|
||||
export const getMonthInfo = (query): AxiosPromise<MonthPlanVO> => {
|
||||
return request({
|
||||
url: '/out/monthPlan/monthInfo',
|
||||
url: '/out/monthPlan/monthInfo/' + query.id,
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
|
@ -133,7 +133,7 @@
|
||||
></el-col>
|
||||
<el-col :span="12" :offset="0"
|
||||
><el-form-item label="供应商" prop="supplier">
|
||||
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供应商" clearable filterable @change="">
|
||||
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供应商" clearable filterable @change="getPlanList">
|
||||
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.supplierName" :value="item.id"> </el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
@ -145,7 +145,14 @@
|
||||
></el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求计划" prop="planId">
|
||||
<el-select v-model="form.planId" value-key="id" placeholder="请选择需求计划" multiple filterable :disabled="!form.mrpBaseId">
|
||||
<el-select
|
||||
v-model="form.planId"
|
||||
value-key="id"
|
||||
placeholder="请选择需求计划"
|
||||
multiple
|
||||
filterable
|
||||
:disabled="!form.mrpBaseId && !form.supplierId"
|
||||
>
|
||||
<el-option v-for="item in planList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
@ -498,13 +505,16 @@ const submitForm = () => {
|
||||
|
||||
const getPlanList = async () => {
|
||||
form.value.planId = '';
|
||||
const res = await getBatch({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
mrpBaseId: form.value.mrpBaseId
|
||||
});
|
||||
planList.value = res.rows;
|
||||
if (form.value.mrpBaseId && form.value.supplierId) {
|
||||
const res = await getBatch({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
mrpBaseId: form.value.mrpBaseId,
|
||||
supplierId: form.value.supplierId
|
||||
});
|
||||
planList.value = res.rows;
|
||||
}
|
||||
};
|
||||
|
||||
const getBatchList = async () => {
|
||||
|
@ -272,6 +272,7 @@ const handleDelete = async (row?: MonthPlanVO) => {
|
||||
const handleAudit = async (row?: MonthPlanVO) => {
|
||||
proxy?.$tab.openPage('/approval/monthPlan/indexEdit', '审核月度产值计划', {
|
||||
planMonth: row?.planMonth,
|
||||
id: row?.id,
|
||||
type: 'update'
|
||||
});
|
||||
};
|
||||
|
@ -104,6 +104,7 @@ import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { getMonthInfo, isSubmit } from '@/api/out/monthPlan';
|
||||
import { id } from 'element-plus/es/locale/index.mjs';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -169,14 +170,11 @@ const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
console.log('🚀 ~ routeParams.value:', routeParams.value.businessId);
|
||||
const projectId = routeParams.value.businessId ? routeParams.value.businessId.split('_')[0] : currentProject.value?.id;
|
||||
const res = await getMonthInfo({ projectId: projectId, planMonth: routeParams.value.planMonth });
|
||||
routeParams.value.businessId ? routeParams.value.businessId.split('_')[0] : currentProject.value?.id;
|
||||
const res = await getMonthInfo({ id: routeParams.value.id });
|
||||
form.value = res.data as any;
|
||||
|
||||
console.log('🚀 ~ getInfo ~ form.value:', form.value[0].projectId);
|
||||
form.value[0].mid = form.value[0].id;
|
||||
form.value[0].id = form.value[0].projectId + '_' + form.value[0].planMonth;
|
||||
form.value[0].id = form.value[0].projectId + '_plan';
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
@ -239,12 +237,12 @@ const submit = async (status, data) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
const res = await isSubmit(data[0]?.mid);
|
||||
// const res = await isSubmit(data[0]?.mid);
|
||||
|
||||
if (!res.data) {
|
||||
proxy?.$modal.msgError('三种计划产值必须填写');
|
||||
return;
|
||||
}
|
||||
// if (!res.data) {
|
||||
// proxy?.$modal.msgError('三种计划产值必须填写');
|
||||
// return;
|
||||
// }
|
||||
if ((form.value[0]?.planAuditStatus === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
@ -261,12 +259,9 @@ const submit = async (status, data) => {
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
console.log('🚀 ~ routeParams.value:', routeParams.value);
|
||||
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
|
@ -34,15 +34,13 @@
|
||||
<el-table-column :show-overflow-tooltip="true" prop="flowName" align="center" label="流程定义名称"></el-table-column>
|
||||
<el-table-column align="center" prop="flowCode" label="流程定义编码"></el-table-column>
|
||||
<el-table-column align="center" prop="categoryName" label="流程分类"></el-table-column>
|
||||
<el-table-column align="center" prop="version" label="版本号" width="90">
|
||||
<template #default="scope"> v{{ scope.row.version }}.0</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="nodeName" label="任务名称"></el-table-column>
|
||||
<el-table-column align="center" label="流程状态" min-width="70">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.flowStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="updateTime" label="更新时间" width="150"></el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||
|
Reference in New Issue
Block a user