|
|
@@ -1,16 +1,8 @@
|
|
|
<script>
|
|
|
import Vue from 'vue'
|
|
|
-import hugerte from 'hugerte'
|
|
|
-import 'hugerte/models/dom'
|
|
|
-import 'hugerte/icons/default'
|
|
|
-import 'hugerte/themes/silver'
|
|
|
-import 'hugerte/skins/ui/oxide/skin.js'
|
|
|
-import 'hugerte/skins/ui/oxide/content.js'
|
|
|
-import 'hugerte/skins/content/default/content.js'
|
|
|
-
|
|
|
import XLSX from 'xlsx'
|
|
|
-import { getAudienceList, sentInvitation, getFormList, getFormInfo, importAudience } from '@/api/form'
|
|
|
-import { getExpoList, getMyExpoInfo } from '@/api/expo'
|
|
|
+import { getAudienceList, getFormList, getFormInfo, importAudience } from '@/api/form'
|
|
|
+import { getExpoList, getMyExpoInfo, auditInvitation } from '@/api/expo'
|
|
|
import { getTemplateList } from '@/api/template'
|
|
|
import expoPopover from '@/views/components/expoPopover.vue'
|
|
|
export default Vue.extend({
|
|
|
@@ -21,7 +13,10 @@ export default Vue.extend({
|
|
|
expoList: [],
|
|
|
userList: [],
|
|
|
invitation_data: {
|
|
|
+ apply_id: 0,
|
|
|
+ template_id: 0,
|
|
|
code: '',
|
|
|
+ price: '0',
|
|
|
tempIndex: 0,
|
|
|
data: [],
|
|
|
exhibitorSetting: {},
|
|
|
@@ -87,11 +82,11 @@ export default Vue.extend({
|
|
|
this.import_data.xlsx = workBook
|
|
|
this.loading = false
|
|
|
}).catch(err => {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '获取表单列表失败:'+err,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '获取表单列表失败:' + err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
this.loading = false
|
|
|
})
|
|
|
} else {
|
|
|
@@ -121,7 +116,7 @@ export default Vue.extend({
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '获取展会信息失败'+err,
|
|
|
+ message: '获取展会信息失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
this.loading = false
|
|
|
@@ -152,7 +147,7 @@ export default Vue.extend({
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '导入观众失败'+err,
|
|
|
+ message: '导入观众失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
this.loading = false
|
|
|
@@ -210,7 +205,7 @@ export default Vue.extend({
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '获取邀请函列表失败'+err,
|
|
|
+ message: '获取邀请函列表失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
})
|
|
|
@@ -221,7 +216,7 @@ export default Vue.extend({
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '获取展会列表失败'+err,
|
|
|
+ message: '获取展会列表失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
})
|
|
|
@@ -239,8 +234,12 @@ export default Vue.extend({
|
|
|
if (this.loading) {
|
|
|
return
|
|
|
}
|
|
|
+ let isReview = void 0
|
|
|
+ if (this.$route.name === 'invitationSend') {
|
|
|
+ isReview = 1
|
|
|
+ }
|
|
|
this.loading = true
|
|
|
- getAudienceList(this.current_page, this.page_size, this.searchWord, this.is_export, this.expo_id).then(res => {
|
|
|
+ getAudienceList(this.current_page, this.page_size, this.searchWord, this.is_export, this.expo_id, isReview).then(res => {
|
|
|
this.current_page = res.data.current_page
|
|
|
this.last_page = res.data.last_page
|
|
|
this.total = res.data.total
|
|
|
@@ -249,7 +248,7 @@ export default Vue.extend({
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '获取观众列表失败'+err,
|
|
|
+ message: '获取观众列表失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
this.loading = false
|
|
|
@@ -258,38 +257,22 @@ export default Vue.extend({
|
|
|
openDialog(row) {
|
|
|
this.invitation_data.show = true
|
|
|
this.invitation_data.userSetting = row
|
|
|
+ this.invitation_data.apply_id = row.apply_invitation_id
|
|
|
+ this.invitation_data.template_id = this.invitation_data.data[0].id
|
|
|
getMyExpoInfo(row.expo_id).then(res => {
|
|
|
this.invitation_data.exhibitorSetting = res.data
|
|
|
this.changeTemp(0)
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '获取展会信息失败'+err,
|
|
|
+ message: '获取展会信息失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
changeTemp(index) {
|
|
|
- hugerte.init({
|
|
|
- selector: '#editor',
|
|
|
- skin_url: 'default',
|
|
|
- content_css: 'default',
|
|
|
- statusbar: false,
|
|
|
- toolbar: false,
|
|
|
- menubar: false,
|
|
|
- height: '100%',
|
|
|
- width: '100%',
|
|
|
- setup: editor => {
|
|
|
- editor.on('drop', event => {
|
|
|
- event.preventDefault()
|
|
|
- const html = event.dataTransfer.getData('text/html')
|
|
|
- editor.insertContent(html)
|
|
|
- })
|
|
|
- }
|
|
|
- }).then(editor => {
|
|
|
- this.invitation_data.tempIndex = index
|
|
|
- this.parseCode(this.invitation_data.data[index].content)
|
|
|
- })
|
|
|
+ this.invitation_data.template_id = this.invitation_data.data[index].id
|
|
|
+ this.parseCode(this.invitation_data.data[index].content)
|
|
|
},
|
|
|
dragStart(event, text) {
|
|
|
console.log(text)
|
|
|
@@ -310,27 +293,49 @@ export default Vue.extend({
|
|
|
}
|
|
|
})
|
|
|
this.invitation_data.code = tempDiv.innerHTML
|
|
|
- hugerte.activeEditor.setContent(tempDiv.innerHTML)
|
|
|
},
|
|
|
closeDialog() {
|
|
|
this.invitation_data.show = false
|
|
|
- hugerte.remove('#editor')
|
|
|
},
|
|
|
sendInvitation() {
|
|
|
this.invitation_data.is_sending = true
|
|
|
- const content = hugerte.activeEditor.getContent()
|
|
|
- sentInvitation([this.invitation_data.userSetting.id], content).then(res => {
|
|
|
+ console.log(this.invitation_data.template_id)
|
|
|
+ auditInvitation(this.invitation_data.apply_id, 2, this.invitation_data.price, this.invitation_data.template_id).then(res => {
|
|
|
this.closeDialog()
|
|
|
this.$message.success('发送成功')
|
|
|
this.invitation_data.is_sending = false
|
|
|
+ this.getAudience()
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: '邀请函发送失败'+err,
|
|
|
+ message: '邀请函发送失败' + err,
|
|
|
type: 'error'
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ disagreeInvitation(row) {
|
|
|
+ if (this.loading) { return }
|
|
|
+ this.$confirm('是否拒绝该邀请函申请?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(res => {
|
|
|
+ auditInvitation(row.apply_invitation_id, 3, 0, '').then(res => {
|
|
|
+ this.getAudience()
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '拒绝成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }).catch(err => {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '审核接口错误:' + err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
copy(text) {
|
|
|
navigator.clipboard.writeText(text).then(() => {
|
|
|
this.$message.success('复制成功')
|
|
|
@@ -395,11 +400,24 @@ export default Vue.extend({
|
|
|
prop="mobile"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ label="申请状态"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.apply_audit_status == '0'" class="status">未申请</div>
|
|
|
+ <div v-if="scope.row.apply_audit_status == '1'" class="status wait">待审核</div>
|
|
|
+ <div v-if="scope.row.apply_audit_status == '2'" class="status agre">已审批</div>
|
|
|
+ <div v-if="scope.row.apply_audit_status == '3'" class="status dis">已拒绝</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
label="操作"
|
|
|
fixed="right"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <span class="button" @click="openDialog(scope.row)">发送邀请函</span>
|
|
|
+ <span v-if="scope.row.apply_audit_status == '1'" class="button" @click="openDialog(scope.row)">发送邀请函</span>
|
|
|
+ <span v-if="scope.row.apply_audit_status == '1'" class="button del" @click="disagreeInvitation(scope.row)">拒绝</span>
|
|
|
+ <span v-if="scope.row.apply_audit_status == '2'" class="button dis">无需操作</span>
|
|
|
+ <span v-if="scope.row.apply_audit_status == '3'" class="button dis">无需操作</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -479,13 +497,13 @@ export default Vue.extend({
|
|
|
:append-to-body="true"
|
|
|
title="发送邀请函"
|
|
|
:visible.sync="invitation_data.show"
|
|
|
- width="90%"
|
|
|
+ width="80%"
|
|
|
@close="closeDialog()"
|
|
|
>
|
|
|
<div class="dialog-body">
|
|
|
<div class="title">模板列表</div>
|
|
|
- <div class="title">邮件编辑器</div>
|
|
|
- <div class="title">观众信息(按住复制按钮可拖拽)</div>
|
|
|
+ <div class="title">预览邮件</div>
|
|
|
+ <!-- <div class="title">观众信息(按住复制按钮可拖拽)</div>-->
|
|
|
<div class="temp-list">
|
|
|
<div
|
|
|
v-for="(temp,index) in invitation_data.data"
|
|
|
@@ -502,21 +520,24 @@ export default Vue.extend({
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="view">
|
|
|
- <div id="editor" />
|
|
|
- </div>
|
|
|
- <div class="var-list-cont">
|
|
|
- <div class="var-list">
|
|
|
- <div v-for="(item,key) in invitation_data.userSetting" class="var-item">
|
|
|
- <div class="title">{{ getLabelName(key) }}</div>
|
|
|
- <div>{{ item || '暂无数据' }}</div>
|
|
|
- <el-button-group class="button-list">
|
|
|
- <el-button draggable="true" @dragstart.native="dragStart($event,item)" type="primary" size="mini" icon="el-icon-document-copy" @click="copy(item)"></el-button>
|
|
|
- </el-button-group>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="view-inner" v-html="invitation_data.code" />
|
|
|
</div>
|
|
|
+ <!-- <div class="var-list-cont">-->
|
|
|
+ <!-- <div class="var-list">-->
|
|
|
+ <!-- <div v-for="(item,key) in invitation_data.userSetting" class="var-item">-->
|
|
|
+ <!-- <div class="title">{{ getLabelName(key) }}</div>-->
|
|
|
+ <!-- <div>{{ item || '暂无数据' }}</div>-->
|
|
|
+ <!-- <el-button-group class="button-list">-->
|
|
|
+ <!-- <el-button draggable="true" type="primary" size="mini" icon="el-icon-document-copy" @dragstart.native="dragStart($event,item)" @click="copy(item)" />-->
|
|
|
+ <!-- </el-button-group>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
+ <el-input v-model="invitation_data.price" placeholder="请输入价格" class="input">
|
|
|
+ <template slot="prepend">申请者付款¥</template>
|
|
|
+ </el-input>
|
|
|
<el-button @click="closeDialog()">取 消</el-button>
|
|
|
<el-button v-permission="'audience.sendInvite'" :disabled="invitation_data.is_sending" type="primary" @click="sendInvitation()">
|
|
|
发 送
|
|
|
@@ -554,6 +575,23 @@ export default Vue.extend({
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
+ .status{
|
|
|
+ border-radius: 6px;
|
|
|
+ background-color: #8f8f8f;
|
|
|
+ color: white;
|
|
|
+ display: inline-block;
|
|
|
+ padding: 0 6px;
|
|
|
+ font-size: 12px;
|
|
|
+ &.wait{
|
|
|
+ background-color: #409EFF;
|
|
|
+ }
|
|
|
+ &.agre{
|
|
|
+ background-color: #5bae32;
|
|
|
+ }
|
|
|
+ &.dis{
|
|
|
+ background-color: #ff6f6f;
|
|
|
+ }
|
|
|
+ }
|
|
|
.button{
|
|
|
cursor: pointer;
|
|
|
padding: 0 5px;
|
|
|
@@ -561,6 +599,9 @@ export default Vue.extend({
|
|
|
&.del{
|
|
|
color: #DC2626;
|
|
|
}
|
|
|
+ &.dis{
|
|
|
+ color: grey;
|
|
|
+ }
|
|
|
}
|
|
|
.expand-form{
|
|
|
display: grid;
|
|
|
@@ -615,16 +656,34 @@ export default Vue.extend({
|
|
|
}
|
|
|
}
|
|
|
.invitation-dialog{
|
|
|
+ .dialog-footer{
|
|
|
+ .input{
|
|
|
+ margin-right: 24px;
|
|
|
+ width: 240px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.dialog-body{
|
|
|
overflow: hidden;
|
|
|
height: 68vh;
|
|
|
display: grid;
|
|
|
- grid-template-columns: 240px 1fr 240px;
|
|
|
+ grid-template-columns: 240px 1fr;
|
|
|
grid-template-rows: auto 1fr;
|
|
|
grid-gap: 4px 12px;
|
|
|
.view{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ position: relative;
|
|
|
+ border: 2px solid #eee;
|
|
|
+ border-radius: 10px;
|
|
|
+ .view-inner{
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
}
|
|
|
.var-list-cont{
|
|
|
border: 2px solid #eee;
|