From 0a9888e1cff934d4fedf46a2698e4a47c1c06ed1 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 23 Sep 2025 16:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/User/PurchaserAdd.vue | 176 +++++++++++++++++++++++++------- 1 file changed, 141 insertions(+), 35 deletions(-) diff --git a/src/views/User/PurchaserAdd.vue b/src/views/User/PurchaserAdd.vue index 046cedb..ad4efae 100644 --- a/src/views/User/PurchaserAdd.vue +++ b/src/views/User/PurchaserAdd.vue @@ -11,66 +11,74 @@ - +
拒绝理由:{{ user.reason }}
+ - -
单位信息
- + + +
+
单位信息
+ 编辑 +
+ + + - + :on-change="handleAvatarChange" :show-file-list="false" :disabled="isEdit"> +
- - + + - - + +
- - + +
联系人信息
- - + + - - + +
+
- - + + - - + +
- - - - - + + +
-
+
保存 - 关闭 +
@@ -85,39 +93,125 @@ export default { name: 'OrderDetail', data() { return { + canSubmit: true, // 是否可提交 + isEdit: false, // 是否编辑 + showNotice:false, //拒绝提示 activities: [ { status: '待完善', }, - { status: '信息待审核', }, + { status: '信息审核中', }, { status: '审核通过', }, ], options: [ {value: 'zhinan',label: '指南', children: [{value: 'shejiyuanze',label: '设计原则', children: [{value: 'yizhi', label: '一致'}]}]}, ], - activeIndex:2, - activeIndexFlag:1, - user: {}, + activeIndex:0, // 已完成 + activeIndexFlag:0, // 当前 + user: { + business_license: "", + }, inputRequired: { required: true, message: '请输入', trigger: 'blur' }, selectRequired: { required: true, message: '请选择', trigger: 'change' }, }; }, - computed: { - + mounted() { + this.getEnterprise() }, methods: { handleAvatarChange(file) { - this.user.avatar = URL.createObjectURL(file.raw); + this.util.imgToBase64(file.raw).then(base64 => { + console.log(base64); + this.post({ + img_base64: base64 + }, "/api/pbservice/Other/base64Upload").then(res=>{ + this.user.business_license = res.data.url; + }) + }) + }, + + getEnterprise () { + this.post({},"/api/enterprise/index").then(res=>{ + console.log(res) + // 未完善 + if (!res.data) { + this.activeIndex = 0; + this.activeIndexFlag = 0; + this.canSubmit = true; + return + } + // 审核中 + if (res.data.status == 0) { + this.activeIndex = 1; + this.activeIndexFlag = 1; + this.user = res.data; + this.canSubmit = false; + return + } + + // 审核通过 + if (res.data.status == 1) { + this.activeIndex = 3; + this.activeIndexFlag = 3; + this.user = res.data; + this.canSubmit = false; + return + } + // 审核拒绝 + if (res.data.status == 2) { + this.activeIndex = 2; + this.activeIndexFlag = 2; + this.user = res.data; + this.canSubmit = true; + this.activities = [ + { status: '待完善', }, + { status: '信息审核中', }, + { status: '审核拒绝,请重新提交', }, + ]; + if (res.data.reason) { + this.showNotice = true; + } + } + + }) + }, + + saveUser () { + this.$refs.userForm.validate((valid) => { + if (valid) { + let api = "/api/enterprise/edit"; + if (!this.isEdit) { + api = "/api/enterprise/create"; + delete this.user.id + delete this.user.status + delete this.user.reason + } + this.post(this.user, api).then(res => { + if (res.code == 1 || res.code == 200) { + this.$message.success(res.msg); + this.getEnterprise(); + } + }) + } + }) + }, + + editUser () { + this.canSubmit = true; + this.isEdit = true; }, } }