From 09ed54aba513050cb543ef3869594c1be892c407 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Mon, 28 Oct 2024 16:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/material/ma/supplier/index.vue | 41 +++++++++--------------- src/views/material/ma/type/index.vue | 26 +++++++++++++-- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/views/material/ma/supplier/index.vue b/src/views/material/ma/supplier/index.vue index 09b34740..54819b23 100644 --- a/src/views/material/ma/supplier/index.vue +++ b/src/views/material/ma/supplier/index.vue @@ -317,7 +317,7 @@ //图片上传1张后,隐藏上传框 uploadDisabled() { - return this.fileList.length > 0 + return this.businessLicenseList.length > 2 }, }, created() { @@ -336,13 +336,14 @@ }, // 图片上传 - imgUpLoadTwo(param, name, index) { + async imgUpLoadTwoAll(param, name, index) { console.log(param, 'image') param.type = 'ma' - imgUpLoadTwo(param) + await imgUpLoadTwo(param) .then((res) => { if (res.code == 200) { - this.imageUrl = res.data.fileUrl + this.imageUrl = res.data.url + this.businessLicenseFileList.push(this.imageUrl); } else { // this.$msgError(res.msg) this.$modal.msgError(res.msg) @@ -448,7 +449,7 @@ this.businessLicenseList = fileList; }, - getList() { + async getList() { this.loading = true; getListFacturer(this.queryParams).then(response => { this.houseList = response.rows; @@ -488,12 +489,13 @@ }, //** 提交按钮 */ - submitForm() { + async submitForm() { this.$refs["form"].validate(valid => { if (valid) { if (this.form.supplierId != undefined) { const reqData = new FormData(); - editFacturer(this.form).then(response => { + + editFacturer(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.showHouse = false; this.getList(); @@ -503,29 +505,16 @@ } else { const reqData = new FormData() const {fileTwo} = this.getFileData() - fileTwo.forEach(item=>{ - let obj={file: item} - imgUpLoadTwo(obj) - .then((res) => { - if (res.code == 200) { - this.imageUrl = res.data.fileUrl - console.log('imageUrl',this.imageUrl) - this.businessLicenseFileList.push(this.imageUrl); - } else { - // this.$msgError(res.msg) - this.$modal.msgError(res.msg) - } - }) - .catch((error) => { - // this.$msgError(error) - this.$modal.msgError(error) - }) + fileTwo.forEach(async item=>{ + let obj={file: item}; + await this.imgUpLoadTwoAll(obj,name,name); + }) this.form.businessLicenseFileList=this.businessLicenseFileList - addFacturer(this.form).then(response => { + addFacturer(this.form).then(async response => { this.$modal.msgSuccess("新增成功"); this.showHouse = false; - this.getList(); + await this.getList(); this.businessLicenseList=[]; this.delBusinessFileIdList=[]; this.businessLicenseFileList=[]; diff --git a/src/views/material/ma/type/index.vue b/src/views/material/ma/type/index.vue index 4d3c85d3..35fc2440 100644 --- a/src/views/material/ma/type/index.vue +++ b/src/views/material/ma/type/index.vue @@ -668,6 +668,7 @@ export default { // 树选项 treeOptions: undefined, treeTemp:[], + treeTempTwo:[], //列表数据 typeList: undefined, // 是否显示弹出层 @@ -793,6 +794,22 @@ export default { getTreeData() { getMaTypeList().then((response) => { this.treeOptions = response.data + // if(response.data!=null){ + // const firstTree = response.data[0]; + // for(let i = 1;i { if (valid) {