获取物资列表

This commit is contained in:
Teo
2025-08-19 22:15:00 +08:00
parent da3a46189e
commit d97838a919
3 changed files with 35 additions and 6 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
VITE_APP_BASE_API = 'http://192.168.110.209:8899' VITE_APP_BASE_API = 'http://192.168.110.180:8899'
# 无人机接口地址 # 无人机接口地址

View File

@ -130,3 +130,16 @@ export const listSelectCailiaoshebei = (query?: any): AxiosPromise<Cailiaoshebei
params: query params: query
}); });
}; };
/**
* 查询字典数据
* @param dictType
* @returns {*}
*/
export const getDictList = (query: any): AxiosPromise<any[]> => {
return request({
url: '/cailiaoshebei/purchaseDoc/engineeringList',
method: 'get',
params: query
});
};

View File

@ -124,6 +124,9 @@
<el-table-column prop="name" align="center" label="物资名称"> <el-table-column prop="name" align="center" label="物资名称">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.name" placeholder="请输入物资" /> <el-input v-model="scope.row.name" placeholder="请输入物资" />
<el-select v-model="scope.row.suppliespriceId" placeholder="请选择">
<el-option v-for="item in nameList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="specification" align="center" label="规格型号" width="150"> <el-table-column prop="specification" align="center" label="规格型号" width="150">
@ -175,7 +178,15 @@
</template> </template>
<script setup name="Cailiaoshebei" lang="ts"> <script setup name="Cailiaoshebei" lang="ts">
import { getCailiaoshebei, updateCailiaoshebei, listBatch, getBatch, delBatch, listSelectCailiaoshebei } from '@/api/materials/batchPlan'; import {
getCailiaoshebei,
updateCailiaoshebei,
listBatch,
getBatch,
delBatch,
listSelectCailiaoshebei,
getDictList
} from '@/api/materials/batchPlan';
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types'; import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
@ -254,7 +265,7 @@ const data = reactive({
}); });
const batchNumber = ref(''); const batchNumber = ref('');
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
const nameList = ref([]);
/** 查询物资-材料设备列表 */ /** 查询物资-材料设备列表 */
const getList = async (type?: string) => { const getList = async (type?: string) => {
loading.value = true; loading.value = true;
@ -448,9 +459,15 @@ const handleAudit = async () => {
}); });
}; };
const getNameList = () => {
getDictList({ projectId: currentProject.value?.id, suppliespriceId: '123' }).then((res) => {
nameList.value = res.data;
});
};
onMounted(() => { onMounted(() => {
getList(); getList();
// getSupplierList(); getNameList();
}); });
//监听项目id刷新数据 //监听项目id刷新数据
@ -458,9 +475,8 @@ const listeningProject = watch(
() => currentProject.value?.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.mainData.projectId = nid; queryParams.value.mainData.projectId = nid;
queryParams.value.batchData.projectId = nid;
form.value.mrpBaseBo.projectId = nid; form.value.mrpBaseBo.projectId = nid;
getList(); getList();
} }
); );