From 2645242b302427ac75a0de65e45f0bac4314d746 Mon Sep 17 00:00:00 2001 From: wangchengming <15110151257@163.com> Date: Wed, 20 Aug 2025 19:28:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/supplier/index.vue | 37 ++++++++++++++++++++++------- src/views/supplier/supplierForm.vue | 16 +++++++++---- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/views/supplier/index.vue b/src/views/supplier/index.vue index 0702d7d..891e891 100644 --- a/src/views/supplier/index.vue +++ b/src/views/supplier/index.vue @@ -69,24 +69,23 @@
- + - - - + + @@ -243,6 +242,7 @@ import { useBackgroundStore } from '@/store/modules/background' import otherbg from '@/assets/images/otherbg.png' import { sysRegionListByPid } from "@/api/system/administrativeRegion" import { busSupplierPage, deleteBusSupplier } from "@/api/supplier" +import { listDept } from "@/api/system/dept" import supplierForm from "./supplierForm.vue"; import supplierDetail from "./supplierDetail.vue"; @@ -258,7 +258,8 @@ const showDetail = ref(false) const supplierDetailRef = ref(null) const showLogs = ref(false) const supplierLogsRef = ref(null) - +// 业务部门数据 +const deptList = ref([]) // 查询条件 省、市、县 const province = ref([]) const city = ref([]) @@ -297,11 +298,22 @@ const data = reactive({ isCooperation: undefined, meitiZhiliang: undefined, supplierLevel: undefined, + supplierPeihe: undefined, + zhuyingYewu: undefined, + yewuDept: undefined, + provinceId: undefined, + cityId: undefined, + countyId: undefined, } }) const { queryParams } = toRefs(data) - +// 获取业务部门 +const getDepList = () => { + listDept({ businessFlag: 1 }).then(response => { + deptList.value = response.data + }) +} // 折叠展开 const unfoldFlag = ref(false) const handleFlod = () => { @@ -362,6 +374,12 @@ const resetQuery = () => { isCooperation: undefined, meitiZhiliang: undefined, supplierLevel: undefined, + supplierPeihe: undefined, + zhuyingYewu: undefined, + yewuDept: undefined, + provinceId: undefined, + cityId: undefined, + countyId: undefined, } handleQuery() } @@ -447,6 +465,7 @@ const handleCloseLogs = () => { // 初始化 onMounted(() => { bgStore.setBgImage(otherbg) + getDepList() getProvinceList() getSupplierPageList() }); diff --git a/src/views/supplier/supplierForm.vue b/src/views/supplier/supplierForm.vue index 47951a9..4b04401 100644 --- a/src/views/supplier/supplierForm.vue +++ b/src/views/supplier/supplierForm.vue @@ -11,8 +11,9 @@ - - + + @@ -349,7 +350,7 @@ const mediaRightsRef = ref(null) const data = reactive({ ruleForm: {}, rules: { - yewuDept: [{ required: true, message: "业务部门不能为空", trigger: "change" }], + yewuDeptId: [{ required: true, message: "业务部门不能为空", trigger: "change" }], supplierName: [{ required: true, message: "供应商公司全称不能为空", trigger: "blur" }], zhuceZiben: [{ required: true, message: "注册资本不能为空", trigger: "blur" }], supplierLevel: [{ required: true, message: "供应商级别不能为空", trigger: "change" }], @@ -443,6 +444,13 @@ const handleChangeSize = (val) => { ruleForm.value.renyuanGuimo = curSizeInfo?.label } +// 业务部门选择 +const handleChangeDept = (val) => { + const curDepInfo = deptList.value.filter(item => item.deptId == val)[0] + ruleForm.value.yewuDeptId = val + ruleForm.value.yewuDept = curDepInfo?.deptName +} + // 获取业务部门 const getDepList = () => { listDept({ businessFlag: 1 }).then(response => { @@ -473,7 +481,7 @@ const handleSubmit = () => { proxy.$refs["ruleFormRef"].validate(valid => { if (valid) { // 使用扩展运算符合并数组 - const mergedArray = [...businessLicenseList.value, ...otherFileList.value, ...mediaRightsList.value]; + const mergedArray = [...businessLicenseList.value, ...otherFileList.value, ...mediaRightsList.value]; console.log('营业资质', mergedArray) ruleForm.value.busSupplierFileList = mergedArray if (ruleForm.value.supplierId != undefined) {