Commit 62f2fe23 by 前端

commit:添加欢迎语

1 parent eee15d58
<template>
<div class="ai-main">
<div class="ai-main-header">
<div class="ai-main-title">
离店客户加企微
</div>
<div class="ai-main-title">离店客户加企微</div>
<div class="ai-main-desc">系统将通过AI机器人,使用门店的福利官企微号自动添加客户,并自动发放客户福利权益。</div>
</div>
<div class="ai-main-guidance scrm-box-f">
......@@ -41,11 +39,11 @@
<el-tab-pane label="任务记录" :name="2"></el-tab-pane>
</el-tabs>
<ai-tabel :activeIndex="activeIndex" ref="AiForm"></ai-tabel>
<GLDialog title="创建任务" okText="创建" class="gl-form-page gl-form-min" v-loading="loading" @onOk="handleSure" @onCancel="dialogVisible = false" :visible.sync="dialogVisible">
<el-form ref="addForm" class="code-body-form" label-width="120px">
<GLDialog title="创建任务" destroy-on-close="true" okText="创建" class="gl-form-page gl-form-min" v-loading="loading" @onOk="handleSure" @onCancel="dialogVisible = false" :visible.sync="dialogVisible">
<el-form ref="addForm" class="code-body-form" label-width="154px">
<div class="el-form-item is-required el-form-item--small">
<label for="remark" class="el-form-item__label" style="width: 120px;">任务名称:</label>
<div class="el-form-item__content" style="margin-left: 120px;">
<label for="remark" class="el-form-item__label" style="width: 154px">任务名称:</label>
<div class="el-form-item__content" style="margin-left: 154px">
<div class="el-input el-input--small">
<input type="text" @blur="checkTask" v-model.trim="taskName" autocomplete="off" placeholder="请输入任务名称" maxlength="10" class="el-input__inner" />
</div>
......@@ -53,8 +51,8 @@
</div>
</div>
<div class="el-form-item is-required el-form-item--small">
<label for="remark" class="el-form-item__label" style="width: 120px;">导入手机号:</label>
<div class="el-form-item__content" style="margin-left: 120px;">
<label for="remark" class="el-form-item__label" style="width: 154px">导入手机号:</label>
<div class="el-form-item__content" style="margin-left: 154px">
<div class="import-link">
<div class="upload-btn">
<el-button size="small">
......@@ -83,8 +81,8 @@
</div>
</div>
<div class="el-form-item is-required el-form-item--small">
<label for="remark" class="el-form-item__label" style="width: 120px;">选择专员:</label>
<div class="el-form-item__content" style="margin-left: 120px;">
<label for="remark" class="el-form-item__label" style="width: 154px">选择专员:</label>
<div class="el-form-item__content" style="margin-left: 154px">
<div class="market-content">
<el-button size="small" @click="handleAddEmp">
<i class="el-icon-plus"></i>
......@@ -98,6 +96,16 @@
<!-- <div class="tips-error" v-if="staffStatus">请选择专员</div> -->
</div>
</div>
<div class="el-form-item el-form-item--small">
<label for="remark" class="el-form-item__label" style="width: 154px">自动发送欢迎语:</label>
<div class="el-form-item__content" style="margin-left: 154px">
<el-switch v-model="autoSend" active-color="#5850FF" inactive-color="#F2F3F5"></el-switch>
</div>
</div>
<div style="margin-left: 154px; margin-top: -8px" v-if="autoSend">
<GLEditor :boxHeight="240" ref="welcome" :btnList="btnList"></GLEditor>
</div>
</el-form>
</GLDialog>
<GLDialog title="导入数据失败" :hasFooter="true" mode="small" :visible.sync="importVisible">
......@@ -114,9 +122,7 @@
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false">
取消
</el-button>
<el-button size="small" @click="importVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="handleImport">导出错误数据</el-button>
</span>
</GLDialog>
......@@ -125,7 +131,7 @@
</template>
<script>
import selectEmp from '@/components/selectEmp/emp'
import selectEmp from '@/components/selectEmp'
import aiTabel from './components/ai-tabel.vue'
import util from '@/utils/util'
export default {
......@@ -144,11 +150,105 @@ export default {
dialogVisible: false,
importVisible: false,
dialogVisibleDel: false,
autoSend: true,
staffInfo: [],
ImportResult: {},
taskName: '',
url: '',
fileName: ''
fileName: '',
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
uploadApi: this.$apis.common.pictureUpload
},
{
name: '昵称',
type: 'nickname',
funName: 'nickname'
},
{
name: '活动',
type: 'activity',
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.welcomeword.merchant,
merchantOpen: {
merchantOpenApi: this.$apis.welcomeword.merchantOpen,
params: {
merchantId: this.$globalState.session.merchantId
}
},
params: {
merchantId: this.$globalState.session.merchantId
}
}
]
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi
// videoNo: true
// pdfNo: true
},
{
name: '兑换码',
type: 'code',
funName: 'code'
}
]
}
},
methods: {
......@@ -162,6 +262,8 @@ export default {
this.fileName = ''
this.dialogVisible = true
this.taskStatus = false
this.autoSend = true
this.$refs.welcome.previewList = []
},
selectTable(item) {
this.staffInfo = item.map(item => {
......@@ -227,8 +329,9 @@ export default {
})
},
handleSure() {
const staffInfo = this.staffInfo.map(item => item.staffId)
const staffId = staffInfo.join(',')
console.log(this.$refs.welcome.previewList)
const staffIds = this.staffInfo.map(item => item.staffId)
// const staffId = staffInfo.join(',')
const { url, fileName, taskName } = this
if (!taskName) {
this.$message.error('请输入任务名称')
......@@ -242,12 +345,23 @@ export default {
this.$message.error('请上传手机号')
return
}
if (staffInfo.length == 0) {
if (staffIds.length == 0) {
this.$message.error('请选择专员')
return
}
const previewList = this.$refs.welcome.previewList ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : []
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
const autoSend = this.autoSend ? 1 : 0
this.loading = true
this.$apis.aiCard.createTask({ url, fileName, taskName, staffId }).then(res => {
this.$apis.aiCard.createTask({ url, fileName, taskName, staffIds, attachmentList, autoSend }).then(res => {
if (res) {
this.dialogVisible = false
this.$refs.AiForm.handleSeach()
......@@ -469,4 +583,12 @@ export default {
}
}
}
.market-content /deep/ {
.full-container {
margin-bottom: 5px;
}
}
.gl-form-min /deep/.el-form .welcome-box {
width: 100% !important;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!