From 8e406d0fdbc87187983d9d507a3dbe9ff676141c Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Mon, 13 Nov 2023 17:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=BB=9F=E4=B8=80=E7=A4=BE?= =?UTF-8?q?=E4=BC=9A=E4=BF=A1=E7=94=A8=E4=BB=A3=E7=A0=81=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=BF=85=E5=A1=AB=E4=B8=8E=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9=E4=BF=A1=E6=81=AF=E4=BC=9A?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../information/info/components/corpEdit.vue | 171 +++++++++--------- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/src/views/corpInfo/information/info/components/corpEdit.vue b/src/views/corpInfo/information/info/components/corpEdit.vue index f3be9fd..8def7dc 100644 --- a/src/views/corpInfo/information/info/components/corpEdit.vue +++ b/src/views/corpInfo/information/info/components/corpEdit.vue @@ -496,27 +496,27 @@ import { upload } from '@/utils/upload' export default { components: { SelectTree }, data() { - var hasCode = (rule, value, callback) => { - if (value) { - requestFN( - '/corpinfo/hasCode', - { - CODE: value, - CORPINFO_ID: this.form.CORPINFO_ID - } - ).then((data) => { - if (!data.pd) { - callback() - } else { - callback(new Error('统一社会信用代码重复')) - } - }).catch((e) => { - - }) - } else { - callback() - } - } + // var hasCode = (rule, value, callback) => { + // if (value) { + // requestFN( + // '/corpinfo/hasCode', + // { + // CODE: value, + // CORPINFO_ID: this.form.CORPINFO_ID + // } + // ).then((data) => { + // if (!data.pd) { + // callback() + // } else { + // callback(new Error('统一社会信用代码重复')) + // } + // }).catch((e) => { + // + // }) + // } else { + // callback() + // } + // } return { config: config, dialogMap: false, @@ -569,12 +569,12 @@ export default { { required: true, message: '企业名称不能为空', trigger: 'blur' } ], CODE: [ - { required: true, message: '统一社会信用代码不能为空', trigger: 'blur' }, - { - pattern: /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/, - message: '请输入正确的统一社会信用代码' - }, - { validator: hasCode, trigger: 'blur' } + { required: false, message: '统一社会信用代码不能为空', trigger: 'blur' } + // , { + // pattern: /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/, + // message: '请输入正确的统一社会信用代码' + // }, + // { validator: hasCode, trigger: 'blur' } ], PROVINCE: [ { required: true, message: '省不能为空', trigger: 'blur' } @@ -748,66 +748,73 @@ export default { }) }, confirm() { - this.$refs.form.validate(valid => { - if (valid) { - const loading = this.$loading({ - lock: true, - text: '提交中...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - if (this.form.INDUSTRYALL && this.form.INDUSTRYALL.length > 0) { - this.form.CORP_TYPE = this.form.INDUSTRYALL[0] || '' - this.form.CORP_TYPE2 = this.form.INDUSTRYALL[1] || '' - this.form.CORP_TYPE3 = this.form.INDUSTRYALL[2] || '' - this.form.CORP_TYPE4 = this.form.INDUSTRYALL[3] || '' - } - const formData = new FormData() - Object.keys(this.pdrelated).map(key => { - formData.append(key, this.pdrelated[key]) - }) - Object.keys(this.form).map(key => { - formData.append(key, this.form[key]) - }) - if (this.form.FOURTYPE == '1') { - if (this.$refs.fourUpload.uploadFiles.length > 0) { - // eslint-disable-next-line no-redeclare - for (var i = 0; i < this.$refs.fourUpload.uploadFiles.length; i++) { - if (this.$refs.fourUpload.uploadFiles[i]) { - formData.append('fourFiles', this.$refs.fourUpload.uploadFiles[i].raw) + this.$confirm('此操作将会修改企业登录密码为Aa@123456789是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$refs.form.validate(valid => { + if (valid) { + const loading = this.$loading({ + lock: true, + text: '提交中...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + if (this.form.INDUSTRYALL && this.form.INDUSTRYALL.length > 0) { + this.form.CORP_TYPE = this.form.INDUSTRYALL[0] || '' + this.form.CORP_TYPE2 = this.form.INDUSTRYALL[1] || '' + this.form.CORP_TYPE3 = this.form.INDUSTRYALL[2] || '' + this.form.CORP_TYPE4 = this.form.INDUSTRYALL[3] || '' + } + const formData = new FormData() + Object.keys(this.pdrelated).map(key => { + formData.append(key, this.pdrelated[key]) + }) + Object.keys(this.form).map(key => { + formData.append(key, this.form[key]) + }) + if (this.form.FOURTYPE == '1') { + if (this.$refs.fourUpload.uploadFiles.length > 0) { + // eslint-disable-next-line no-redeclare + for (var i = 0; i < this.$refs.fourUpload.uploadFiles.length; i++) { + if (this.$refs.fourUpload.uploadFiles[i]) { + formData.append('fourFiles', this.$refs.fourUpload.uploadFiles[i].raw) + } } } + } else if (this.form.FOURTYPE == '2') { + formData.append('fourFiles', this.FFILE) } - } else if (this.form.FOURTYPE == '2') { - formData.append('fourFiles', this.FFILE) - } - formData.append('COMPANY_AREA', this.$refs.PROVINCE.selected.label + this.$refs.CITY.selected.label + this.$refs.COUNTRY.selected.label) - this.form.COMPANY_AREA = - upload( - '/corpinfo/edit', - formData - ).then((data) => { - if (this.$refs.upload.uploadFiles.length > 0) { - loading.close() - this.uploadImg() - } else { - loading.close() - this.$message({ - message: '操作成功', - type: 'success' + formData.append('COMPANY_AREA', this.$refs.PROVINCE.selected.label + this.$refs.CITY.selected.label + this.$refs.COUNTRY.selected.label) + this.form.COMPANY_AREA = + upload( + '/corpinfo/edit', + formData + ).then((data) => { + if (this.$refs.upload.uploadFiles.length > 0) { + loading.close() + this.uploadImg() + } else { + loading.close() + this.$message({ + message: '操作成功', + type: 'success' + }) + this.goOut('0') + // this.$parent.activeName = 'CorpView' + } + }).catch((e) => { + loading.close() + this.$message({ + message: '操作失败', + type: 'error' + }) }) - this.goOut('0') - // this.$parent.activeName = 'CorpView' - } - }).catch((e) => { - loading.close() - this.$message({ - message: '操作失败', - type: 'error' - }) - }) - } + } + }) + }).catch(() => { }) },