企业统一社会信用代码取消必填与校验,并添加修改信息会重置密码提示
parent
670c0f6622
commit
8e406d0fdb
|
@ -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(() => {
|
||||
})
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue