|
|
|
@ -6,14 +6,17 @@
|
|
|
|
|
企业名称 |
|
|
|
|
</view> |
|
|
|
|
<view class="value"> |
|
|
|
|
<input |
|
|
|
|
class="input-value" |
|
|
|
|
<uni-easyinput |
|
|
|
|
type="text" |
|
|
|
|
placeholder-class="txt" |
|
|
|
|
placeholder="请输入企业名称" |
|
|
|
|
v-model="form.enterpriseName" |
|
|
|
|
:inputBorder="false" |
|
|
|
|
style="text-align: center" |
|
|
|
|
:value="form.enterprisesName" |
|
|
|
|
@blur="proofName" |
|
|
|
|
/> |
|
|
|
|
:clearable="false" |
|
|
|
|
:autoHeight="true" |
|
|
|
|
ref="nameRef" |
|
|
|
|
></uni-easyinput> |
|
|
|
|
<u-icon name="arrow-right"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -42,8 +45,8 @@
|
|
|
|
|
企业介绍 |
|
|
|
|
</view> |
|
|
|
|
<view class="value" @tap="goIntruduce"> |
|
|
|
|
<view class="input-textarea" v-if="form.introduce"> |
|
|
|
|
{{ form.introduce }} |
|
|
|
|
<view class="input-textarea" v-if="form.introduction"> |
|
|
|
|
{{ form.introduction }} |
|
|
|
|
</view> |
|
|
|
|
<view class="input-textarea" style="color: #808080" v-else> |
|
|
|
|
请输入企业介绍 |
|
|
|
@ -85,7 +88,11 @@
|
|
|
|
|
</view> |
|
|
|
|
<view class="value" @tap="goTags"> |
|
|
|
|
<view class="input-textarea" v-if="Object.keys(form.tags).length"> |
|
|
|
|
{{ Object.values(form.tags).map(tag => tag.name).join('、') }} |
|
|
|
|
{{ |
|
|
|
|
Object.values(form.tags) |
|
|
|
|
.map(tag => tag.name) |
|
|
|
|
.join('、') |
|
|
|
|
}} |
|
|
|
|
</view> |
|
|
|
|
<view class="input-textarea" style="color: #808080" v-else> |
|
|
|
|
请选择企业标签 |
|
|
|
@ -100,13 +107,15 @@
|
|
|
|
|
企业负责人 |
|
|
|
|
</view> |
|
|
|
|
<view class="value"> |
|
|
|
|
<input |
|
|
|
|
class="input-value" |
|
|
|
|
<uni-easyinput |
|
|
|
|
type="text" |
|
|
|
|
placeholder-class="txt" |
|
|
|
|
placeholder="请输入企业负责人" |
|
|
|
|
v-model="form.contactName" |
|
|
|
|
/> |
|
|
|
|
:inputBorder="false" |
|
|
|
|
style="text-align: center" |
|
|
|
|
:value="form.contactName" |
|
|
|
|
:clearable="false" |
|
|
|
|
:autoHeight="true" |
|
|
|
|
></uni-easyinput> |
|
|
|
|
<u-icon name="arrow-right"></u-icon> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -117,21 +126,13 @@
|
|
|
|
|
负责人电话 |
|
|
|
|
</view> |
|
|
|
|
<view class="value"> |
|
|
|
|
<!-- <input |
|
|
|
|
class="input-value" |
|
|
|
|
type="text" |
|
|
|
|
placeholder-class="txt" |
|
|
|
|
placeholder="请输入负责人电话" |
|
|
|
|
v-model="form.environmentalContactPhone" |
|
|
|
|
@blur="proofName" |
|
|
|
|
/> --> |
|
|
|
|
<uni-easyinput |
|
|
|
|
type="text" |
|
|
|
|
placeholder="请输入负责人电话" |
|
|
|
|
:inputBorder="false" |
|
|
|
|
style="text-align: center" |
|
|
|
|
v-model="form.environmentalContactPhone" |
|
|
|
|
@blur="proofName" |
|
|
|
|
:value="form.environmentalContactPhone" |
|
|
|
|
@blur="proofphone" |
|
|
|
|
:clearable="false" |
|
|
|
|
:autoHeight="true" |
|
|
|
|
></uni-easyinput> |
|
|
|
@ -203,7 +204,7 @@
|
|
|
|
|
|
|
|
|
|
<cs-bottom-wrapper> |
|
|
|
|
<view class="operation"> |
|
|
|
|
<button class="btn green">提交审核</button> |
|
|
|
|
<button class="btn green" @tap="submit">提交审核</button> |
|
|
|
|
</view> |
|
|
|
|
</cs-bottom-wrapper> |
|
|
|
|
</view> |
|
|
|
@ -212,34 +213,27 @@
|
|
|
|
|
<script> |
|
|
|
|
import { uploadFile } from '@/api/system/file.js' |
|
|
|
|
import { getDictBatchByType } from '@/api/system/dict.js' |
|
|
|
|
import { |
|
|
|
|
createEnterPrise, |
|
|
|
|
vertifyName, |
|
|
|
|
c |
|
|
|
|
} from '@/api/enterprise/index.js' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
form: { |
|
|
|
|
enterpiseName: undefined, |
|
|
|
|
enterprisesName: undefined, |
|
|
|
|
address: undefined, |
|
|
|
|
gpsLocation: undefined, |
|
|
|
|
introduce: '', |
|
|
|
|
introduction: '', |
|
|
|
|
photo: [], |
|
|
|
|
tags: {} |
|
|
|
|
tags: {}, |
|
|
|
|
environmentalContactPhone: undefined, |
|
|
|
|
contactName: undefined, |
|
|
|
|
id: '' |
|
|
|
|
}, |
|
|
|
|
dictMap: {}, |
|
|
|
|
prove: [ |
|
|
|
|
{ |
|
|
|
|
enterpriseAuth: '123', |
|
|
|
|
expiryDate: '2025-02-24', |
|
|
|
|
id: '', |
|
|
|
|
photo: [ |
|
|
|
|
{ |
|
|
|
|
id: 1890, |
|
|
|
|
message: '', |
|
|
|
|
status: 'success', |
|
|
|
|
url: 'http://60.23.29.213:19001/huanbao/7f71a5ed324fd6d35d61c7b6d68d8e6e06f16557f3150af3dece8ab386f9f189.png' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
qualificationName: '1' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
prove: [], |
|
|
|
|
inviteId: undefined |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -249,7 +243,7 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
uni.$on('enterpriseIntroduce', data => { |
|
|
|
|
this.form.introduce = data.introduce |
|
|
|
|
this.form.introduction = data.introduce |
|
|
|
|
}) |
|
|
|
|
uni.$on('enterpriseTag', data => { |
|
|
|
|
this.form.tags = data |
|
|
|
@ -260,7 +254,38 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
proofName(v) { |
|
|
|
|
console.log(v.detail.value) |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
vertifyName({ |
|
|
|
|
pageSize: -1, |
|
|
|
|
pageNo: 1, |
|
|
|
|
onlyEnterprisesName: v.detail.value |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.total > 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '企业名已存在', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.form.enterprisesName = '' |
|
|
|
|
} else { |
|
|
|
|
this.form.enterprisesName = v.detail.value |
|
|
|
|
} |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
proofphone(v) { |
|
|
|
|
// 校验手机号 |
|
|
|
|
const mobilePattern = /^1[3-9]\d{9}$/ // 中国手机号正则表达式 |
|
|
|
|
if (!mobilePattern.test(v.detail.value)) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入有效的手机号', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.form.environmentalContactPhone = '' |
|
|
|
|
} else { |
|
|
|
|
this.form.environmentalContactPhone = v.detail.value |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 获取字典 |
|
|
|
@ -283,12 +308,14 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
goIntruduce() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduce}` |
|
|
|
|
url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduction}` |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
goTags() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: `/sub/invite/enterpriseTags?tags=${JSON.stringify(this.form.tags)}` |
|
|
|
|
url: `/sub/invite/enterpriseTags?tags=${JSON.stringify( |
|
|
|
|
this.form.tags |
|
|
|
|
)}` |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
@ -336,6 +363,71 @@ export default {
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: `/sub/invite/prove?prove=${JSON.stringify(prove)}` |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async submit() { |
|
|
|
|
const valide = await this.verifyForm() |
|
|
|
|
if (!valide) return |
|
|
|
|
const data = { ...this.form } |
|
|
|
|
console.log(data) |
|
|
|
|
data.region = data.tags.qy.id |
|
|
|
|
// data.type = data.tags.qy.id |
|
|
|
|
data.tagIds = [data.tags.hy.id, data.tags.st.id, data.tags.wr.id] |
|
|
|
|
data.fileIds = data.photo.map(i => i.id) |
|
|
|
|
// data.userId = this.inviteId |
|
|
|
|
data.userId = 162 |
|
|
|
|
data.qualis = this.prove.map(i => { |
|
|
|
|
return { |
|
|
|
|
...i, |
|
|
|
|
expiryDate: new Date(i.expiryDate).getTime(), |
|
|
|
|
files: i.photo.map(f => f.id) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (this.form.id) { |
|
|
|
|
} else { |
|
|
|
|
createEnterPrise(data).then(res => { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: res.msg |
|
|
|
|
}) |
|
|
|
|
uni.navigateBack() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async verifyForm() { |
|
|
|
|
const msgMap = { |
|
|
|
|
enterprisesName: '请输入企业名', |
|
|
|
|
address: '请选择企业地址', |
|
|
|
|
gpsLocation: '请选择企业地址', |
|
|
|
|
introduction: '请填写企业介绍', |
|
|
|
|
photo: '最少上传一张企业照片', |
|
|
|
|
tags: '请选择企业标签', |
|
|
|
|
prove: '请填写企业资质', |
|
|
|
|
environmentalContactPhone: '请输入企业负责人', |
|
|
|
|
contactName: '请输入负责人电话' |
|
|
|
|
} |
|
|
|
|
const msg = [] |
|
|
|
|
Object.keys(this.form).forEach(i => { |
|
|
|
|
if (!Object.hasOwn(msgMap, i)) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (!this.form[i]) { |
|
|
|
|
msg.push(msgMap[i]) |
|
|
|
|
} |
|
|
|
|
if (typeof this.form[i] == 'Object' && this.form[i].length == 0) { |
|
|
|
|
msg.push(msgMap[i]) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (this.prove.length == 0) { |
|
|
|
|
msg.push(msgMap.prove) |
|
|
|
|
} |
|
|
|
|
if (msg.length > 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: msg.join('\n') |
|
|
|
|
}) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|