diff --git a/pages/enterprise.vue b/pages/enterprise.vue index afdc7c3..05a9a6e 100644 --- a/pages/enterprise.vue +++ b/pages/enterprise.vue @@ -322,7 +322,7 @@ export default { display: flex; gap: 4px; color: $uni-text-color-grey; - display: flex; + flex-flow: row wrap; .tag { font-size: 12px; display: flex; diff --git a/sub/enterprise/detail.vue b/sub/enterprise/detail.vue index a14169c..432bfcf 100644 --- a/sub/enterprise/detail.vue +++ b/sub/enterprise/detail.vue @@ -270,8 +270,8 @@ export default { .tagList { display: flex; gap: 4px; + flex-flow: row wrap; color: $uni-text-color-grey; - display: flex; .tag { font-size: 12px; display: flex; diff --git a/sub/invite/addEnterprise.vue b/sub/invite/addEnterprise.vue index 64c134c..2b21777 100644 --- a/sub/invite/addEnterprise.vue +++ b/sub/invite/addEnterprise.vue @@ -111,8 +111,7 @@ type="text" placeholder="请输入企业负责人" :inputBorder="false" - style="text-align: center" - :value="form.contactName" + v-model="form.contactName" :clearable="false" :autoHeight="true" > @@ -216,29 +215,33 @@ import { getDictBatchByType } from '@/api/system/dict.js' import { createEnterPrise, vertifyName, - c + getEnterPrise } from '@/api/enterprise/index.js' export default { data() { return { form: { - enterprisesName: undefined, - address: undefined, - gpsLocation: undefined, + enterprisesName: '', + address: '', + gpsLocation: '', introduction: '', photo: [], tags: {}, - environmentalContactPhone: undefined, - contactName: undefined, + environmentalContactPhone: '', + contactName: '', id: '' }, dictMap: {}, prove: [], - inviteId: undefined + inviteId: '' } }, onLoad(res) { this.inviteId = res.inviteId + if (res.id) { + this.form.id = res.id + this.init() + } this.getDict() }, onShow() { @@ -254,6 +257,7 @@ export default { }, methods: { proofName(v) { + if (v.detail.value == '') return uni.showLoading({ title: '加载中' }) @@ -287,6 +291,11 @@ export default { this.form.environmentalContactPhone = v.detail.value } }, + init() { + getEnterPrise(this.form.id).then(res => { + console.log(res) + }) + }, /** * 获取字典 */ @@ -323,6 +332,9 @@ export default { * @param {Object} e */ async addEnterprisePhoto(e) { + uni.showLoading({ + title: '上传中...' + }) e.file.forEach(p => { this.form.photo.push({ ...p, @@ -345,6 +357,7 @@ export default { }) ).then(res => { this.form.photo = res + uni.hideLoading() }) }, /** @@ -368,13 +381,11 @@ export default { 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.userId = this.inviteId data.qualis = this.prove.map(i => { return { ...i, @@ -384,10 +395,11 @@ export default { }) if (this.form.id) { } else { + console.log(data) createEnterPrise(data).then(res => { uni.showToast({ icon: 'none', - title: res.msg + title: '操作成功' }) uni.navigateBack() }) @@ -407,10 +419,7 @@ export default { } const msg = [] Object.keys(this.form).forEach(i => { - if (!Object.hasOwn(msgMap, i)) { - return - } - if (!this.form[i]) { + if (!this.form[i] && i != 'id') { msg.push(msgMap[i]) } if (typeof this.form[i] == 'Object' && this.form[i].length == 0) { diff --git a/sub/invite/index.vue b/sub/invite/index.vue index aabf85a..ffd7f7a 100644 --- a/sub/invite/index.vue +++ b/sub/invite/index.vue @@ -1,6 +1,6 @@