This commit is contained in:
tcy
2025-08-23 06:31:22 +08:00
parent dbb649d1ce
commit cfb6085bbf
4 changed files with 21 additions and 9 deletions

View File

@ -143,6 +143,13 @@ export const getDictList = (query: any): AxiosPromise<any[]> => {
params: query
});
};
export const coryEngineeringList = (query: any): AxiosPromise<any[]> => {
return request({
url: '/cailiaoshebei/mrpBase/coryEngineeringList',
method: 'get',
params: query
});
};
/**
* 获取到物资状态为已完成的版本
*/

View File

@ -166,7 +166,7 @@ import {
getBatch,
delBatch,
listSelectCailiaoshebei, obtainTheVersion,
getDictList
getDictList, coryEngineeringList
} from '@/api/materials/batchPlan';
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
import { useUserStoreHook } from '@/store/modules/user';
@ -459,7 +459,7 @@ const handleAudit = async () => {
};
const getNameList = (versions) => {
getDictList({ projectId: currentProject.value?.id, versions }).then((res) => {
coryEngineeringList({ projectId: currentProject.value?.id, versions }).then((res) => {
nameList.value = res.data;
});
};

View File

@ -6,8 +6,8 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table height="70vh" v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
<el-table-column type="index" width="80" label="序号" align="center" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="规格" align="center" prop="specification" />
<el-table-column label="单位" align="center" prop="unit" />
@ -50,7 +50,7 @@ import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const monthPlanList = ref<MonthPlanVO[]>([]);
const monthPlanList = ref([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
@ -107,7 +107,9 @@ const getList = async (type?) => {
}
loading.value = true;
const res = await purchaseValueA({ projectId: currentProject.value?.id, type: queryParams.value.type });
monthPlanList.value = res.rows;
monthPlanList.value = res.data;
console.log(monthPlanList.value);
total.value = res.total;
loading.value = false;
};
@ -146,7 +148,6 @@ const submitForm = () => {
if (valid) {
buttonLoading.value = true;
form.value.isDesign = true;
if (form.value.id) {
await purchaseValueAup(form.value).finally(() => (buttonLoading.value = false));
}

View File

@ -14,13 +14,17 @@
<script setup name="MonthPlan" lang="ts">
import { ref, watch, computed } from 'vue';
import purchPage from './comm/purchPage.vue';
import { on } from 'events';
// 引用子组件
const activeName = ref('1');
const purchPageRef1 = ref<InstanceType<typeof purchPage> | null>(null);
const purchPageRef2 = ref<InstanceType<typeof purchPage> | null>(null);
const handleClick = (val) => {
if (val.props.name == '1') {
purchPageRef1.value.getList(val.props.name); //子组件方法
} else {
purchPageRef2.value.getList(val.props.name); //子组件方法
}
};
onMounted(() => {
purchPageRef1.value?.getList('1'); //初始加载