修复权限以及供应商入库

This commit is contained in:
Teo
2025-08-28 20:10:46 +08:00
parent e7cf93f7e4
commit 9ec6b9818c
8 changed files with 108 additions and 66 deletions

View File

@ -133,8 +133,8 @@
></el-col>
<el-col :span="12" :offset="0"
><el-form-item label="供应商" prop="supplier">
<el-select v-model="form.supplier" value-key="id" placeholder="请选择供应商" clearable filterable @change="">
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.name"> </el-option>
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供应商" clearable filterable @change="">
<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>
<el-col :span="12" :offset="0"
@ -268,6 +268,7 @@ import { useUserStoreHook } from '@/store/modules/user';
import { getToken } from '@/utils/auth';
import logisticsDetail from './comm/logisticsDetail.vue';
import { FormRules } from 'element-plus';
import { listSupplierInput } from '@/api/supplierInput/supplierInput';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const router = useRouter();
@ -307,6 +308,8 @@ const initFormData: any = {
docCode: undefined,
supplier: undefined,
reason: undefined,
supplierId: undefined,
name: undefined,
arrivalDate: undefined,
designDirectorTel: undefined,
@ -479,6 +482,7 @@ const submitForm = () => {
form.value.associationList = form.value.planId?.map((item: any) => ({
planId: item
}));
form.value.supplier = supplierOptions.value.find((item) => item.id == form.value.supplierId)?.supplierName;
if (form.value.id) {
await updatePurchaseDoc(form.value).finally(() => (buttonLoading.value = false));
@ -514,10 +518,10 @@ const getBatchList = async () => {
};
const getSupplierList = async () => {
const res = await listContractor({
const res = await listSupplierInput({
projectId: currentProject.value?.id,
pageNum: 1,
contractorType: 4,
state: 'finish',
pageSize: 10000
});
supplierOptions.value = res.rows;

View File

@ -81,6 +81,11 @@
<el-form-item label="公司名称" prop="name">
<el-input v-model="form.name" placeholder="请输入公司名称" />
</el-form-item>
<el-form-item label="供应商" prop="supplier">
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供应商" clearable filterable @change="">
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.supplierName" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人" prop="principal">
<el-input v-model="form.principal" placeholder="请输入负责人" />
</el-form-item>
@ -121,6 +126,7 @@ import { ContractorForm, ContractorQuery, ContractorVO } from '@/api/project/con
import ContractorFileDialog from '@/views/project/contractor/component/ContractorFileDialog.vue';
import { useUserStoreHook } from '@/store/modules/user';
import { getDicts, listData } from '@/api/system/dict/data';
import { listSupplierInput } from '@/api/supplierInput/supplierInput';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -152,6 +158,8 @@ const initFormData: ContractorForm = {
principalPhone: undefined,
custodian: undefined,
custodianPhone: undefined,
supplierId: undefined,
supplier: undefined,
contractorType: undefined,
fileMap: undefined,
remark: undefined,
@ -257,6 +265,8 @@ const submitForm = () => {
if (valid) {
form.value.projectId = currentProject.value?.id;
buttonLoading.value = true;
form.value.supplier = supplierOptions.value.find((item) => item.id == form.value.supplierId)?.supplierName;
if (form.value.id) {
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -278,15 +288,16 @@ const handleDelete = async (row?: ContractorVO) => {
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'project/contractor/export',
{
...queryParams.value
},
`contractor_${new Date().getTime()}.xlsx`
);
/** 获取供应商 */
const supplierOptions = ref([]);
const getSupplierList = async () => {
const res = await listSupplierInput({
projectId: currentProject.value?.id,
pageNum: 1,
state: 'finish',
pageSize: 10000
});
supplierOptions.value = res.rows;
};
/** 文件操作 **/
@ -304,6 +315,7 @@ const listeningProject = watch(
queryParams.value.projectId = nid;
form.value.projectId = nid;
console.log('监听项目id', queryParams.value.projectId, form.value.projectId);
getSupplierList();
getList();
}
);
@ -314,5 +326,6 @@ onUnmounted(() => {
onMounted(() => {
getDictList();
getList();
getSupplierList();
});
</script>

View File

@ -275,6 +275,7 @@
<el-row class="mb-4">
<el-col :span="24">
<el-form-item label="入库资料" prop="inputFile">
<template #label> <span class="text-red">*</span> 入库资料 </template>
<file-upload
v-model="form.inputFile"
:fileType="['doc', 'docx', 'pdf']"