Commit 50497cb2 by 徐忆琳

Merge branch 'xuyl_dev_v3.6.0' into 'v3.6.0'

更新v3.6.0代码

See merge request !89
2 parents 09d3748f ef6a2fd6
import request from './request'
const path = 'merchants.api.staff.withdrawal.'
const bankCardApi = {
// 客户名单列表查询
bankCardListApi(data = {}) {
data.method = `${path}page`
return request(data)
},
// 批量核销
batchWriteOff(data = {}) {
data.method = `${path}batchWithdrawal`
return request(data)
},
// 批量失败
batchFail(data = {}) {
data.method = `${path}batchFail`
return request(data)
}
}
export { bankCardApi }
......@@ -9,7 +9,8 @@ const request = (
method = RequestMethods.GET,
noSignAttr = [],
url = '',
isMd5 = false
isMd5 = false,
isParams=true
) => {
params.source = 'glsx-oss-withdrawal-data'
params.appKey = '48e5e13229b82c1b4e6e8c96151f0637'
......@@ -24,9 +25,12 @@ const request = (
// return axios.post(`${url}/router?method=${method}`, qs.stringify(data))
}
var data = isMd5 ? sign(params, noSignAttr, true) : sign(params, noSignAttr)
if (url) {
if (url && isParams) {
return axios.post(`${url}/router?method=${method}`, qs.stringify(data))
}
if (url && !isParams) {
return axios.post(`${url}/router`, qs.stringify(data))
}
return method === RequestMethods.GET
? GlAxios.get('router', {
params: sign(params, noSignAttr),
......
......@@ -49,5 +49,31 @@ const taskApi = {
data.method = 'merchants.api.mission.staticMission'
return request(data, 'post')
},
// 获取机器人列表
getlistDepartmentTree(data) {
data.method = 'entmicro.api.department.listDepartmentTreeNoSession'
return request(
data,
'entmicro.api.department.listDepartmentTreeNoSession',
[],
Vue.prototype.entmicroURL
)
},
// 获取群聊列表
getGroupList(data) {
data.method =
'entmicro.api.wechatcloudcontrol.batchmessaging.group.list.nosession'
return request(
data,
'entmicro.api.wechatcloudcontrol.batchmessaging.group.list.nosession',
[],
Vue.prototype.entmicroURL
)
},
// 获取企业接口
findEntmicroList(data) {
data.method = 'merchants.api.mission.findEntmicroList'
return request(data, 'post')
},
}
export { taskApi }
import request from './request'
import Vue from 'vue'
const uploadApi = {
// 多文件上传接口
multipleUpload(data = {}) {
// 'http://192.168.1.182:8561/rop-scrm-renewal'
data.method = 'scrm.api.renewal.common.upload.common.multiple'
data.method = 'glsx.accounts.biz.common.pictureUpload'
// return request(data, 'scrm.api.equity.common.upload.common.multiple', [], 'http://scrm.test.glsx.com.cn/rop-scrm-renewal')
return request(data, 'post')
return request(data, 'glsx.accounts.biz.common.pictureUpload',['file'], Vue.prototype.fileUploadURL,true)
}
}
export { uploadApi }
import Vue from 'vue'
export const Util = {
getExplorer: function() {
getExplorer: function () {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
......@@ -29,7 +29,7 @@ export const Util = {
return browserType
},
exportFn: function(url) {
exportFn: function (url) {
console.log(url)
let browserType = getExplorer()
if (browserType == 'QQ') {
......@@ -42,8 +42,48 @@ export const Util = {
iframe.src = url
document.body.appendChild(iframe)
console.log(document.body)
}
},
deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = Util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
timeTransfer: function (time) {
const date = new Date(time)
const y = date.getFullYear()
let m = date.getMonth() + 1
m = m < 10 ? '0' + m : m
let d = date.getDate()
d = d < 10 ? '0' + d : d
let h = date.getHours()
h = h < 10 ? '0' + h : h
let minute = date.getMinutes()
minute = minute < 10 ? '0' + minute : minute
let s = date.getSeconds()
s = s < 10 ? '0' + s : s
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
},
}
export const getExplorer = Util.getExplorer
export const exportFn = Util.exportFn
export const deepClone = Util.deepClone
export const timeTransfer = Util.timeTransfer
......@@ -438,6 +438,7 @@ export default {
watch: {
previewList: {
handler(val) {
console.log(val)
this.$emit('shareMatrial', val)
this.$emit('getEditor')
},
......
import App from './index'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
import Vue from 'vue'
base.getConfig().then(data => {
const { vue, config } = data
Vue.prototype.fileUploadURL = config.axios.fileUploadURL
vue.use(GlsxVueCommon, config)
base.render(App)
})
<template>
<div>
<el-dialog :title='dialogTitle[dialogType]' :visible.sync='bankCardVisible' width='30%'>
<div v-if="dialogType == 'resultImport'">
<div>
<span class='redPoint'>*</span>
模板类型:
<el-select
v-model='exportTemplate'
placeholder='请选择导出模板'
>
<el-option label='河南优登信息科技有限公司' value='1'></el-option>
<el-option label='湖南好招网络科技有限公司' value='2'></el-option>
</el-select>
</div>
<div>
<div class='upfile'>
<p class='fileText'><span class='redPoint'>*</span>上传文件:</p>
<div class='filebtn'>
<div class='upload-btn'>
<el-button size='small'>
<i class='el-icon-plus'></i>
上传文件
</el-button>
<input
class='uploadInput'
style='opacity: 0'
type='file'
ref='file'
accept='*'
@change='uploadFile'
/>
</div>
<a
v-if="exportTemplate == 1 || exportTemplate == ''"
class='download'
href='https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/河南优登信息科技有限公司.xlsx'
>下载模板</a
>
<a
v-if='exportTemplate == 2'
class='download'
href='https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/湖南好招网络科技有限公司.xlsx'
>下载模板</a
>
</div>
</div>
<el-input
class='fileExpand'
v-if='fileName'
v-model='fileName'
></el-input>
</div>
</div>
<div v-if="dialogType =='export'">
<div>
<div class='flexCon'><p><span class='errColoe'>*</span>导出类型:</p>
<el-select
v-model='derivedType'
placeholder='请选择导出类型'
>
<el-option label='河南优登信息科技有限公司' value='1'></el-option>
<el-option label='湖南好招网络科技有限公司' value='2'></el-option>
</el-select>
</div>
<p>说明:系统自动导出当前筛选条件下的全部数据至指定模板中</p>
</div>
</div>
<div v-if="dialogType =='batchWriteOff'">
完成核销,即表示提现金额已转账至客户银行卡;
<p>是否确定核销?</p>
</div>
<div v-if="dialogType =='batchWithdrawalFailed'">
<div class='causeOfFailure'><span class='redPoint'>*</span>
失败原因:
</div>
<el-input
type='textarea'
:rows='2'
placeholder='请输入原因说明'
v-model='causeOfFailure'>
</el-input>
<p>说明:提现失败,并自动返还提现积分;请谨慎操作。</p>
</div>
<span slot='footer' class='dialog-footer'>
<el-button @click='bankCardVisible = false'>取 消</el-button>
<el-button type='primary' @click='handleConfirm(dialogType)'>确 定</el-button>
</span>
</el-dialog>
<el-dialog :title="'提示'" :visible.sync='tipsVisible' width='30%'>
<template v-if="tipsType == 'succeed'">
<p>导入成功</p>
<p>总共导入{resultImportRecord}条记录</p>
</template>
<template v-if="tipsType == 'beDefeated'">
<p>导入失败</p>
<p class='redPoint'>点击下载失败结果并查看</p>
</template>
<span slot='footer' class='dialog-footer'>
<el-button type='primary' @click='handleTipConfirm(tipsType)'>确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { bankCardApi } from '@/api/bankCardWithdrawal'
import { uploadApi } from '@/api/upload'
import debounce from '@/utils/debounce'
import { profitApi } from '@/api/profitManagement'
export default {
name: 'BankCardDialog',
props: {
dialogType: {
type: String,
default: ''
},
choiceData: {
type: Array,
default: []
},
bankCardSearchForm: {
type: Object,
default: {}
}
},
data() {
return {
dialogTitle: {
'resultImport': '结果导入',
'export': '导出',
'batchWriteOff': '批量核销',
'batchWithdrawalFailed': '批量提现失败'
},
bankCardVisible: false,
bankCardDialogForm: {},
tipsVisible: false,
tipsType: '',
// 结果导入
exportTemplate: '',
fileBaseUrl: '',
fileName: '',
resultImportRecord: '',
importFailedTemplate: '',
// 导出
derivedType: '',
// 失败原因
causeOfFailure: '',
bankCardDialogRules: {
templateType: [
{ required: true, message: '请选择活动区域', trigger: 'change' }
]
}
}
},
methods: {
handleConfirm(type) {
switch (type) {
case 'resultImport':
this.confirmationResultImport()
break
case 'export':
this.exportValidation()
break
case 'batchWriteOff':
this.batchVerificationConfirmation()
break
case 'batchWithdrawalFailed':
this.batchWithdrawalFailureConfirmed()
break
}
},
confirmationResultImport: debounce(function() {
if (!this.exportTemplate || !this.fileBaseUrl) {
return this.$message({
type: 'error',
message: !this.exportTemplate ? '请选择模板类型!' : '请上传文件!'
})
}
let parmas = {
fileBaseUrl: this.fileBaseUrl,
type: 2
}
bankCardApi.batchWriteOff({ ...params }).then(res => {
this.bankCardVisible = false
this.tipsVisible = true
if (res.data) {
this.resultImportRecord = ''
} else {
// importFailedTemplate
}
})
}, 300),
exportValidation() {
if (!this.derivedType) {
return this.$message({
type: 'error',
message: '请选择导出类型!'
})
}
let params = JSON.parse(JSON.stringify(this.bankCardSearchForm))
console.log(params)
// let pageConfig = {
// pageSize: 9999,
// pageNum: 1
// }
// profitApi.exportProfitList({ ...params, ...pageConfig }).then((res) => {
// if (res.code == 0) {
// this.$Utils.exportFn(res.data)
// } else {
// this.$message({
// type: 'error',
// message: '导出失败!'
// })
// }
// })
},
batchVerificationConfirmation: debounce(function() {
let params = {
idList: [],
withDrawType: 2
}
params.idList = this.choiceData.map(item => item.id)
bankCardApi.batchWriteOff({ ...params }).then(res => {
this.$message({
message: res.data ? '批量核销成功!' : res.message,
type: res.data ? 'success' : 'error'
})
if (res.data) {
this.bankCardVisible = false
// 刷新操作
this.$emit('sendResetTable', 'reset')
}
})
}, 1000),
batchWithdrawalFailureConfirmed: debounce(function() {
if (!this.causeOfFailure) {
return this.$message({
type: 'error',
message: '请输入失败原因!'
})
}
let params = {
ids: [],
failReason: this.causeOfFailure
}
params.ids = this.choiceData.map(item => item.id)
bankCardApi.batchFail({ ...params }).then(res => {
this.$message({
message: res.data ? '批量提现成功!' : res.message,
type: res.data ? 'success' : 'error'
})
if (res.data) {
this.bankCardVisible = false
// 刷新操作
this.$emit('sendResetTable', 'reset')
}
})
}, 1000),
handleTipConfirm(type) {
this.tipsVisible = !this.tipsVisible
if (type == 'beDefeated') {
this.$Utils.exportFn(this.importFailedTemplate)
}
},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
if (file) {
let extName = file.name
.substring(file.name.lastIndexOf('.'))
.toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = file.size / 1024 / 1024
if (size > 5) {
this.$message.error('单文件体积需小于5M')
return
}
this.downloadStatus = true
this.setInter = setInterval(this.addProcess, 100)
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = (event) => {
this.fileName = file.name
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
uploadApi.multipleUpload({ file: fileUrl }).then(
(res) => {
if (res) {
if (res.data && res.data.returnCode == '0') {
this.fileBaseUrl = res.data.data
this.$refs.file.value = ''
} else {
this.fileName = ''
this.$refs.file.value = ''
this.$message.error('文件上传失败')
}
}
}
)
}
}
}
}
}
</script>
<style scoped>
.redPoint {
color: red;
}
.flexCon {
display: flex;
}
.errColoe {
color: red;
}
.upfile {
display: flex;
align-items: center;
}
.filebtn {
display: flex;
align-items: center;
}
.fileError {
color: red;
margin-left: 100px;
font-size: 1px;
}
.fileText {
font-size: 14px;
margin-right: 10px;
color: #606266;
}
.download {
margin-left: 8px;
font-size: 14px;
color: #1994f9;
cursor: pointer;
}
.fileExpand {
width: 300px;
margin-left: 84px;
}
.upload-btn {
position: relative;
display: inline-block;
}
.uploadInput {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
.causeOfFailure {
margin-bottom: 12px;
}
</style>
<template>
<el-form
size='small'
inline
ref='bankCardForm'
:model='bankCardSearchForm'
label-width='120px'
class='demo-form-inline'
>
<el-form-item label='员工名称:'>
<el-input
clearable
v-model='bankCardSearchForm.staffName'
placeholder='请输入员工名称'
maxlength='20'
maxLen
></el-input>
</el-form-item>
<el-form-item label='员工手机号:'>
<el-input
clearable
v-model='bankCardSearchForm.staffPhone'
maxlength='11'
placeholder='请输入员工手机号'
></el-input>
</el-form-item>
<el-form-item label='门店名称:'>
<el-input
clearable
v-model='bankCardSearchForm.merchantName'
maxlength='50'
placeholder='请输入门店名称'
></el-input>
</el-form-item>
<el-form-item label='状态:'>
<el-select
v-model='bankCardSearchForm.status'
placeholder='请选择状态'
>
<el-option label='全部' value=''></el-option>
<el-option label='待核销' value='1'></el-option>
<el-option label='已核销' value='2'></el-option>
<el-option label='未核销' value='3'></el-option>
<el-option label='提现失败' value='4'></el-option>
</el-select>
</el-form-item>
<el-form-item label='提现时间:'>
<el-date-picker
value-format='yyyy-MM-dd'
v-model='bankCardSearchForm.withdrawal'
type='daterange'
range-separator='至'
start-placeholder='开始日期'
end-placeholder='结束日期'
>
</el-date-picker>
</el-form-item>
<el-form-item label='核销时间:'>
<el-date-picker
value-format='yyyy-MM-dd'
v-model='bankCardSearchForm.review'
type='daterange'
range-separator='至'
start-placeholder='开始日期'
end-placeholder='结束日期'
>
</el-date-picker>
</el-form-item>
<el-form-item label='导出状态:'>
<el-select
v-model='bankCardSearchForm.exportStatus'
placeholder='请选择导出状态'
>
<el-option label='全部' value=''></el-option>
<el-option label='已导出' value='0'></el-option>
<el-option label='未导出' value='1'></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type='primary' @click='handleSearch'>查询</el-button>
<el-button @click='reset'>重置</el-button>
</el-form-item>
</el-form>
</template>
<script>
import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default {
name: 'bankCardSearch',
mixins: [nearlyAMonth],
data() {
return {
bankCardSearchForm: {
status: '',
exportStatus: '',
isWithdrawal: 3
}
}
},
methods: {
handleSearch() {
this.$emit('sendSearchForm', this.bankCardSearchForm)
},
reset() {
Object.keys(this.bankCardSearchForm).forEach((key) => {
this.bankCardSearchForm[key] = ''
})
this.bankCardSearchForm.isWithdrawal = 3
this.$emit('sendResetTable', 'reset')
this.$nextTick(() => {
this.handleSearch()
})
}
}
}
</script>
<style scoped></style>
<template>
<div style='margin: 16px'>
<BankCardSearch
ref='bankCardSearch'
@sendSearchForm='getSearchForm'
@sendResetTable='reset'
/>
<div class='buttonSet'>
<el-button v-for='(itm,idx) in buttonTraversal' :key='idx' size='small' type='primary'
@click='openDialog(itm.byValue)'>{{ itm.btnName }}
</el-button>
</div>
<d2-table
class='my-row-height'
ref='bankCardTable'
:hasNum='true'
:tableParams='bankCardTableParams'
:searchForm='bankCardSearchForm'
:getListApi='getListApi'
:pageConf='pageConf'
>
<div slot='exportStatus' slot-scope='scope'>
{{
scope.scope.exportStatus == '0'
? '未导出'
: scope.scope.exportStatus == '1'
? '已导出'
: ''
}}
</div>
<div slot='status' slot-scope='scope'>
<span v-if="scope.scope.status == '1'">待核销</span>
<span v-if="scope.scope.status == '2'">到账中</span>
<span v-if="scope.scope.status == '3'">已到账</span>
<span v-if="scope.scope.status == '4'">到账失败</span>
</div>
</d2-table>
<BankCardDialog ref='bankCardDialog' @sendResetTable='reset' :bankCardSearchForm='bankCardSearchForm' :choiceData='choiceData'
:dialogType='dialogType'></BankCardDialog>
</div>
</template>
<script>
import BankCardSearch from '@/views/bankCardWithdrawal/bankCardList/cpns/bankCardSearch'
import BankCardDialog from '@/views/bankCardWithdrawal/bankCardList/cpns/BankCardDialog'
import { bankCardApi } from '@/api/bankCardWithdrawal'
export default {
name: 'bankCardList',
components: {
BankCardSearch,
BankCardDialog
},
data() {
return {
buttonTraversal: [
{ byValue: 'resultImport', btnName: '结果导入' },
{ byValue: 'export', btnName: '导出' },
{ byValue: 'batchWriteOff', btnName: '批量核销' },
{ byValue: 'batchWithdrawalFailed', btnName: '批量提现失败' }
],
dialogType: '',
bankCardSearchForm: {},
dialogVisible: false,
totalScore: '',
choiceData: [],
choiceDataBack: [],
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
},
getListApi: bankCardApi.bankCardListApi,
bankCardTableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectName: 'list',
listName: 'data.data',
tableColumns: [
{
label: '流水号',
prop: 'rewardScore'
},
{
label: '员工名称',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '所属商户',
prop: 'merchantName'
},
{
label: '积分值',
prop: 'withdrawalScore'
},
{
label: '提现金额(元)',
prop: 'withdrawalAmount'
},
{
label: '提现时间',
prop: 'withdrawalTime'
},
{
label: '银行名称',
prop: 'bankName'
},
{
label: '银行卡号',
prop: 'bankNumber'
},
{
label: '持卡人姓名',
prop: 'bankuserName'
},
{
label: '银行预留手机号',
prop: 'bankPhone'
},
{
label: '身份证号',
prop: 'idCardNo'
},
{
label: '状态',
prop: 'status',
addHtml: 'status'
},
{
label: '导出状态',
prop: 'exportStatus',
addHtml: 'exportStatus'
},
{
label: '核销人',
prop: 'reviewer'
},
{
label: '核销时间',
prop: 'reviewTime'
},
{
label: '失败原因',
prop: 'failReason'
}
]
},
timeout: null
}
},
computed: {},
methods: {
openDialog(type) {
this.dialogType = type
this.getSeletedData()
if (type == 'batchWriteOff' || type == 'batchWithdrawalFailed') {
if (this.choiceData && (this.choiceData.length == 0 || this.choiceData.some((item) => {
return item.status !== 1
}))) {
this.$message({
type: 'error',
message: '请勾选需要核销的积分记录!'
})
return
}
}
this.$refs.bankCardDialog.bankCardVisible = true
},
getSeletedData() {
this.choiceData =
this.$refs.bankCardTable.mutiSelectArr.list &&
this.$refs.bankCardTable.mutiSelectArr.list.map((item) => {
let {
status,
id
} = item
return {
status,
id
}
})
},
getSearchForm(val) {
let params = JSON.parse(JSON.stringify(val))
this.bankCardSearchForm = params
setTimeout(() => {
this.$refs.bankCardTable.refreshTable(false, true)
}, 500)
},
reset() {
if (this.choiceData) {
this.$refs.bankCardTable.mutiSelectArr.list = []
this.$refs.bankCardTable.$children[0].clearSelection()
}
let params = {
isWithdrawal: 3
}
this.getSearchForm(params)
}
}
}
</script>
<style scoped>
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
.buttonSet {
margin-bottom: 16px;
}
</style>
......@@ -206,7 +206,6 @@ export default {
numberOfStoresArr.includes(next.merchantName)
? ''
: numberOfStoresArr.push(next.merchantName)
console.log(totalPoints)
next.rewardScore
? (totalPoints += next.rewardScore)
: (totalPoints += 0)
......
......@@ -7,6 +7,7 @@ base.getConfig().then((data) => {
Vue.prototype.otherUrl = config.axios.otherURL
Vue.prototype.fileUploadURL = config.axios.fileUploadURL
Vue.prototype.businessURL = config.axios.businessURL
Vue.prototype.entmicroURL = config.axios.entmicroURL
vue.use(GlsxVueCommon, config)
base.render(App)
})
<!--
* @Author: your name
* @Date: 2022-03-07 14:32:50
* @LastEditTime: 2022-04-21 18:43:21
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue
-->
<template>
<div v-loading="loading">
<div class="select-input-box" @click="switchBrand">
<div>
<template v-for="(item, idx) in treeArr">
<el-tag
effect="plain"
type="info"
:key="idx"
closable
:disable-transitions="false"
@close="removeItem(item, idx)"
v-if="idx < 3"
>
{{ item.staffName }}
</el-tag>
</template>
<el-popover
placement="top"
width="600"
trigger="hover"
class="select-popover"
>
<div class="select-popover-box">
<el-tag
effect="plain"
class="popover-item"
v-for="(item, idx) in getCheckedArr"
type="info"
:key="idx"
closable
:disable-transitions="false"
@close="removeItem(item, idx)"
>
{{ item.staffName }}
</el-tag>
</div>
<el-tag
effect="plain"
slot="reference"
type="info"
v-show="getCheckedArr.length > 3"
>+ {{ getCheckedArr.length - 3 }}</el-tag
>
</el-popover>
</div>
<div>
<i
v-show="!brandTree"
class="el-icon-arrow-up"
style="color: #909399"
></i>
<i
v-show="brandTree"
class="el-icon-arrow-down"
style="color: #909399"
></i>
</div>
</div>
<div class="tree-box" v-show="brandTree">
<el-input
class="tree-input"
prefix-icon="el-icon-search"
placeholder="输入关键字进行过滤"
v-model="filterText"
></el-input>
<el-tree
class="filter-tree"
@check="handleCheck"
:data="robotListTree"
:props="defaultProps"
node-key="id"
show-checkbox
default-expand-all
:default-expanded-keys="expandedKeys"
:filter-node-method="filterNode"
:ref="memberRef"
></el-tree>
<div class="tree-footer">
<!-- <div class="tree-footer-checkbox">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkedAll"
@change="selectAll"
>全部</el-checkbox
>
</div> -->
<div class="tree-footer-reset" @click="selectClear">重置</div>
</div>
</div>
</div>
</template>
<script>
import { taskApi } from '../../../../api/task'
export default {
name: 'selectBrand',
data() {
return {
loading: false,
checkedAll: false,
filterText: '',
isIndeterminate: false,
treeArr: [],
getCheckedArr: [],
expandedKeys: [],
defaultProps: {
children: 'children',
label: 'label',
},
brandTree: false,
ids: [],
robotListTree: [],
currentCheckData: {},
// selectItem: this.selectRobot,
}
},
props: {
// brandListTree: {
// type: Array,
// default: () => [],
// },
memberRef: {
type: String,
},
selectRobot: {
type: [Array, String],
},
type: {
type: Boolean,
},
cloneType: {
type: Boolean,
},
errorType: {
type: Boolean,
},
robotNo: {
type: [Number, String],
},
},
watch: {
filterText(val) {
this.$refs[this.memberRef].filter(val)
},
treeArr: {
handler() {
this.$emit('getSelectRobot', this.treeArr)
this.$emit('getMenbers')
const getCheckedNodes = this.$refs[this.memberRef].getCheckedNodes()
this.getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (
Object.keys(cur).includes('children') &&
cur.children &&
cur.children.length > 0
) {
return prev
}
return prev.concat(cur)
}, [])
},
deep: true,
},
// brandListTree: {
// handler(val) {
// console.log(val)
// // this.robotListTree = val
// this.initData(val)
// console.log(this.selectItem)
// if (this.selectItem) {
// this.$nextTick(() => {
// this.$refs[this.memberRef].setCheckedKeys(this.selectItem)
// this.treeArr = this.$refs[this.memberRef]
// .getCheckedNodes()
// .filter((item) => item.children && item.children.length == 0)
// })
// }
// },
// deep: true,
// },
// brandListTree(val) {
// console.log(val)
// this.dealVal(val)
// },
// selectRobot(val) {
// console.log(val)
// this.$refs[this.memberRef].setCheckedKeys(val)
// this.getCheckedArr = this.robotListTree.find((item) => item.id == val[0])
// },
},
mounted() {
console.log(this.type, this.errorType, this.robotNo, this.selectRobot)
if (this.type && this.robotNo && this.selectRobot)
this.getlistDepartmentTree(this.robotNo)
if (this.cloneType && this.robotNo && this.selectRobot)
this.getlistDepartmentTree(this.robotNo)
if (this.errorType && this.robotNo) this.getlistDepartmentTree(this.robotNo)
},
methods: {
getlistDepartmentTree(merchantId) {
console.log(222)
let params = { addChildrensFlag: true, queryMerchantId: merchantId }
taskApi.getlistDepartmentTree(params).then(async (res) => {
if (res) {
this.robotListTree = res.data.data
await this.initData(this.robotListTree)
console.log(this.robotListTree)
if (this.selectRobot && this.selectRobot.length) {
if (this.errorType) {
this.$refs[this.memberRef].setCheckedKeys([this.selectRobot])
} else {
this.$refs[this.memberRef].setCheckedKeys(this.selectRobot)
}
let treeArrInfo = this.getTreeName(
this.robotListTree,
this.errorType ? this.selectRobot : this.selectRobot[0]
)
this.treeArr.push(treeArrInfo)
}
}
})
},
getTreeName(treeList, id) {
console.log(treeList, id)
for (let i = 0; i < treeList.length; i++) {
let treeItem = treeList[i]
if (treeItem.id == id) {
return treeItem
} else {
if (treeItem.children && treeItem.children.length > 0) {
let res = this.getTreeName(treeItem.children, id)
if (res) {
return res
}
}
}
}
},
initData(data) {
data.forEach((item, index) => {
this.$set(
item,
'label',
item.staffName ? item.staffName : item.departmentName
)
let entmicroStaffResponses =
this.$Utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'label', staff.staffName)
} else {
this.$set(staff, 'label', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$Utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'label', staff.staffName)
} else {
this.$set(staff, 'label', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
data.splice(index, 1)
}
children.length && this.initData(children)
})
},
//勾选
handleCheck(val) {
console.log(val)
if (val.children.length) {
this.$message({
message: '企微机器人只能选择单个员工',
type: 'error',
})
this.$refs[this.memberRef].setCheckedKeys([])
return
}
this.currentCheckData = val
console.log(111)
this.$refs[this.memberRef].setCheckedKeys([val.id])
if (!this.treeArr.length) {
this.treeArr = [this.currentCheckData]
}
if (
this.treeArr.length &&
this.currentCheckData.staffId != this.treeArr[0].staffId
) {
this.treeArr = [this.currentCheckData]
}
this.currentCheckData = []
this.isIndeterminate =
this.treeArr.length > 0 && this.treeArr.length < this.ids.length
this.checkedAll = this.treeArr.length === this.ids.length
},
// //获取选择项
// getTreeArray() {
// let tree_arr = []
// this.robotListTree.forEach((k) => {
// let child = k.children
// if (child && child.length > 0) {
// child.forEach((j) => {
// tree_arr.push(j.id)
// })
// } else {
// tree_arr.push(k.id)
// }
// })
// return tree_arr
// },
// //全选
// selectAll() {
// this.loading = true
// this.treeArr = this.getTreeArray()
// if (this.getCheckedArr.length == this.treeArr.length) {
// this.checkedAll = false
// this.$refs[this.memberRef].setCheckedKeys([])
// } else {
// this.checkedAll = true
// this.$refs[this.memberRef].setCheckedKeys(this.treeArr)
// }
// setTimeout(() => {
// this.loading = false
// }, 1000)
// },
//重置
selectClear() {
this.treeArr = []
this.$refs[this.memberRef].setCheckedKeys([])
// this.handleCheck()
},
//删除
removeItem(checkItem, index) {
this.treeArr.splice(index, 1)
let ids = this.treeArr.map((item) => item.staffId)
this.$refs[this.memberRef].setCheckedKeys(ids)
this.checkedAll = ids.length < this.ids.length
},
//过滤
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 显示隐藏
switchBrand() {
this.brandTree = !this.brandTree
this.$emit('clickBrand', this.brandTree)
},
},
}
</script>
<style lang="scss" scoped>
.select-input-box {
width: 100%;
height: 38px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
/deep/ .el-tag {
margin-right: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
.select-popover {
&-box {
display: flex;
flex-wrap: wrap;
max-height: 500px;
overflow-y: auto;
.popover-item {
margin-right: 5px;
margin-bottom: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
}
.tree-box {
margin-top: 10px;
padding: 15px 15px 0px;
background: #ffffff;
// box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.tree-input {
margin-bottom: 10px;
}
.filter-tree {
height: 300px;
overflow-y: auto;
}
.tree-footer {
border-top: 1px solid #e5e5e5;
height: 48px;
padding: 0px 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tree-footer-reset {
cursor: pointer;
}
</style>
......@@ -17,10 +17,13 @@
v-model="basicForm.businessScene"
placeholder="请选择业务场景"
size="small"
:disabled="isEditor"
:disabled="isEditor || isClone"
>
<!-- <el-option label="车损升级" :value="0"></el-option>
<el-option label="精品升级" :value="1"></el-option> -->
<el-option label="1.2膨胀金活动" :value="2"></el-option>
<el-option label="1.3众筹活动" :value="3"></el-option>
<el-option label="5.2私域用户代运营" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="商户:" prop="merchantId">
......@@ -45,7 +48,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="活动/产品:" prop="activityId">
<el-form-item
label="活动/产品:"
prop="activityId"
v-if="basicForm.businessScene && basicForm.businessScene != 4"
>
<el-input
v-model="basicForm.activityName"
placeholder="请选择活动/产品"
......@@ -55,7 +62,11 @@
readonly
></el-input>
</el-form-item>
<el-form-item label="任务指定人群:" prop="crowd">
<el-form-item
label="任务指定人群:"
prop="crowd"
v-if="basicForm.businessScene && basicForm.businessScene != 4"
>
<el-select
v-model="basicForm.crowd"
multiple
......@@ -80,8 +91,9 @@
v-model="basicForm.withdrawalFlag"
:disabled="isEditor && activityStatus == 2"
>
<el-radio :label="1">是(员工发起提现)</el-radio>
<el-radio :label="2">否(运营从后台核销)</el-radio>
<el-radio :label="1">员工发起提现</el-radio>
<el-radio :label="2">运营从后台核销</el-radio>
<el-radio :label="3">银行卡提现</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注:">
......@@ -93,7 +105,7 @@
</el-form-item>
</el-form>
</div>
<div class="basic-box-right">
<div class="basic-box-right" v-if="preViewShow">
<Preview
ref="preView"
@refresh="refresh"
......@@ -101,7 +113,7 @@
></Preview>
</div>
</div>
<template v-if="basicForm.activityName || isClone || isEditor">
<template v-if="basicForm.activityName || isClone || isEditor || isShow">
<div class="title-box">
<span class="task-title">任务计划</span>
<span
......@@ -161,14 +173,64 @@
:disabled="isEditor && activityStatus == 2"
>
<el-option label="注册认证" :value="1"></el-option>
<el-option label="分享指标" :value="2"></el-option>
<el-option label="浏览指标" :value="3"></el-option>
<el-option label="访客指标" :value="4"></el-option>
<el-option
v-if="item.activityTime == -1"
label="分享指标"
:value="2"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
label="浏览指标"
:value="3"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
label="访客指标"
:value="4"
v-show="
basicForm.businessScene &&
basicForm.businessScene != 4
"
></el-option>
<el-option
v-show="
item.activityTime == -1 &&
basicForm.businessScene &&
basicForm.businessScene != 4
"
label="成单指标"
:value="5"
></el-option>
<el-option
label="添加福利官"
:value="7"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 4
"
></el-option>
<el-option
label="组建客户福利群"
:value="8"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 4
"
></el-option>
<el-option
label="二次跟进指标"
:value="6"
v-show="
basicForm.businessScene &&
basicForm.businessScene == 2 &&
item.activityTime == -1
"
></el-option>
</el-select>
</el-form-item>
<el-form-item
......@@ -197,9 +259,136 @@
></el-input>
</el-form-item>
<el-form-item
label="自动提醒:"
:prop="'missionList.' + index1 + '.autoReminderFlag'"
:rules="taskFormRules.autoReminderFlag"
v-if="itm.missonType && itm.missonType != 1"
>
<el-radio-group
v-model="itm.autoReminderFlag"
@change="remindTypeChange(itm)"
:disabled="
itm.autoReminderFlag == 1 && activityStatus == 2
"
><el-radio :label="1">无提醒</el-radio>
<el-radio :label="2">自动提醒</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="提醒时间:"
:prop="'missionList.' + index1 + '.autoReminderTime'"
:rules="taskFormRules.autoReminderTime"
v-if="itm.autoReminderFlag && itm.autoReminderFlag == 2"
>
<el-date-picker
v-if="
item.activityTime != -1 ||
basicForm.businessScene == 4
"
v-model="itm.autoReminderTime"
:picker-options="pickerOptions"
type="datetime"
placeholder="选择日期时间"
size="small"
value-format="yyyy/MM/dd HH:mm:ss"
:disabled="activityStatus == 2"
>
</el-date-picker>
<el-time-picker
v-else
v-model="itm.autoReminderTime"
placeholder="任意时间点"
size="small"
format="HH:mm:ss"
value-format="HH:mm:ss"
:disabled="activityStatus == 2"
>
</el-time-picker>
</el-form-item>
<el-form-item
label="所属企业:"
:prop="'missionList.' + index1 + '.robotMerchantNo'"
:rules="taskFormRules.robotMerchantNo"
v-if="itm.autoReminderFlag == 2"
>
<el-radio-group
v-model="itm.robotMerchantNo"
@change="robotMerchantChange(itm)"
>
<el-radio
v-for="item in entmicroList"
:key="item.merchantNo"
:label="item.merchantNo"
>{{ item.entmicroName }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label="企微机器人:"
:prop="'missionList.' + index1 + '.enterMicroRobot'"
:rules="taskFormRules.enterMicroRobot"
v-if="itm.robotMerchantNo && itm.autoReminderFlag == 2"
>
<SelectMembers
:id="'missionList' + (itm.taskid || itm.id) + 'robot'"
:key="
'missionList' + (itm.taskid || itm.id) + 'robot'
"
:ref="
'missionList' + (itm.taskid || itm.id) + 'robot'
"
:type="isEditor"
:cloneType="isClone"
:errorType="isSubmit"
:robotNo="itm.robotMerchantNo"
:selectRobot="itm.enterMicroRobot"
:memberRef="
'missionList' + (itm.taskid || itm.id) + 'robot'
"
@getMenbers="getMenbers(item, index, itm, index1)"
@getSelectRobot="getSelectRobot"
></SelectMembers>
</el-form-item>
<el-form-item
label="目标群聊:"
:prop="'missionList.' + index1 + '.groupChat'"
:rules="taskFormRules.groupChat"
v-if="
itm.robotMerchantNo &&
itm.enterMicroRobot &&
itm.autoReminderFlag == 2
"
>
<el-select
@focus="getGroupList(item, index, itm, index1)"
@change="
(val) => {
changeGroup(val, item, index, itm, index1)
}
"
v-model="itm.groupChat"
placeholder="请选择目标群聊"
size="small"
filterable
>
<el-option
v-for="(item, index) in groupListData"
:key="index"
:label="item.roomName || '默认群聊'"
:value="item.roomChatId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
:prop="'missionList.' + index1 + '.missionMaterialList'"
:rules="taskFormRules.attachmentList"
v-if="itm.missonType && itm.missonType != 1"
v-if="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 6 &&
itm.missonType != 7 &&
itm.missonType != 8
"
>
<label slot="label" class="required">分享素材:</label>
<GLEditor
......@@ -226,7 +415,7 @@
<el-form-item
label="页面风格:"
:rules="taskFormRules.textType"
v-show="itm.showArticle"
v-if="itm.showArticle"
>
<el-radio-group
v-model="itm.textType"
......@@ -239,7 +428,7 @@
<el-form-item
label="文章素材:"
:prop="'missionList.' + index1 + '.textContent'"
v-show="
v-if="
itm.showArticle && itm.textType && itm.textType == 1
"
>
......@@ -274,7 +463,7 @@
label="奖励模式:"
:prop="'missionList.' + index1 + '.rewardType'"
:rules="taskFormRules.rewardType"
v-show="itm.missonType"
v-if="itm.missonType"
>
<el-radio-group
v-model="itm.rewardType"
......@@ -283,17 +472,30 @@
><el-radio :label="3">无奖励</el-radio>
<el-radio
:label="1"
v-show="itm.missonType && itm.missonType != 1"
v-show="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 7
"
>累计奖励</el-radio
>
<el-radio
:label="2"
v-show="itm.missonType && itm.missonType != 1"
v-show="
itm.missonType &&
itm.missonType != 1 &&
itm.missonType != 7 &&
itm.missonType != 8 &&
itm.missonType != 6
"
>排名奖励</el-radio
>
<el-radio
:label="4"
v-show="itm.missonType && itm.missonType == 1"
v-show="
itm.missonType &&
(itm.missonType == 1 || itm.missonType == 7)
"
>有奖励</el-radio
>
</el-radio-group>
......@@ -484,6 +686,7 @@ import { commonApi } from '../../../api/commonApi'
import { taskApi } from '../../../api/task'
import ActivityDia from './components/activityDia.vue'
import ActivityDate from './components/activityDate.vue'
import SelectMembers from './components/selectMembers.vue'
import Preview from './components/preView.vue'
import { utils } from 'glsx-common'
export default {
......@@ -491,6 +694,7 @@ export default {
ActivityDia,
ActivityDate,
Preview,
SelectMembers,
},
data() {
// 奖励积分校验规则
......@@ -516,7 +720,7 @@ export default {
merchantName: '',
activityId: '',
activityName: '',
crowd: ['3'],
crowd: [],
withdrawalFlag: 1,
channel: 1,
remark: '',
......@@ -533,6 +737,7 @@ export default {
isEditor: false,
// 是否是克隆
isClone: false,
isSubmit: false,
// 活动弹框
activityDiaVisible: false,
// 选择任务开始日期弹框
......@@ -547,6 +752,7 @@ export default {
activityStatus: '',
addTabList: [],
dateList: [],
preViewShow: true,
btnList: [
{
name: '表情',
......@@ -588,6 +794,10 @@ export default {
textIds: [],
// 判断复制任务选择活动是否小于复制前任务天数
dateLess: false,
// 目标群聊
groupListData: [],
// 树结构
brandListTree: [],
// 公共任务类型
basicObj: {
taskid: '',
......@@ -595,7 +805,14 @@ export default {
missionName: '',
missonDesc: '',
rewardScore: '',
rewardType: 3,
rewardType: '',
autoReminderFlag: '',
autoReminderTime: '',
groupChat: '',
groupChatName: '',
enterMicroRobot: [],
enterMicroRobotName: '',
robotMerchantNo: '',
},
// 分享指标任务类型
shareObj: {
......@@ -640,8 +857,31 @@ export default {
textContent: '',
showArticle: true,
},
// 添加福利官任务类型
walefaleObj: {},
// 添加一客一群任务类型
customerObj: {
rewardCount: '',
triggerValue: '',
},
// 二次跟进指标任务类型
secondObj: {
rewardCount: '',
repeatCount: '',
triggerValue: '',
},
// 编辑任务计划数据
taskEditList: {},
// 是否展示任务tab
isShow: false,
// ids: [],
selectRobot: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now()
},
},
// 基础信息表单验证
basicRules: {
businessScene: [
......@@ -702,10 +942,31 @@ export default {
textType: [
{ required: true, message: '请选择页面风格', trigger: 'change' },
],
autoReminderFlag: [
{ required: true, message: '请选择自动提醒方式', trigger: 'change' },
],
autoReminderTime: [
{
type: 'string',
required: true,
message: '请选择提醒时间',
trigger: 'change',
},
],
enterMicroRobot: [
{ required: true, message: '请选择企微机器人', trigger: 'change' },
],
groupChat: [
{ required: true, message: '请选择目标群聊', trigger: 'change' },
],
robotMerchantNo: [
{ required: true, message: '请选择所属企业', trigger: 'change' },
],
},
}
},
mounted() {
this.findEntmicroList()
this.$root.eventBus.$on('params', (params) => {
// 判断是否是编辑
if (params && params.type) {
......@@ -723,6 +984,12 @@ export default {
},
computed: {},
methods: {
// 查询发送企微
findEntmicroList() {
taskApi.findEntmicroList({}).then((res) => {
if (res.code == 0) this.entmicroList = res.data
})
},
// 初始化富文本
getTextBox(id, dateTaskIndex, taskIndex, textContent) {
// 如果找到了相同的id则直接返回
......@@ -847,6 +1114,12 @@ export default {
this.basicForm.merchantName = ''
this.basicForm.activityId = ''
this.basicForm.activityName = ''
this.isShow = false
if (this.basicForm.businessScene == 4) {
this.setHouseRatesColumn()
this.isShow = true
this.preViewShow = false
}
},
// 商户改变获取商户名
changeMerchant(val) {
......@@ -856,8 +1129,70 @@ export default {
// 清空活动
this.basicForm.activityId = ''
this.basicForm.activityName = ''
// this.getlistDepartmentTree(val)
// this.taskList = []
},
// 获取选中机器人
getSelectRobot(treeArr) {
this.selectRobot = treeArr.map((item) => item.staffId)
this.selectRobotName = treeArr.map((item) => item.staffName)
},
getMenbers(dateTask, dateTaskIndex, task, taskIndex) {
let changeFlag =
this.selectRobot[0] !=
this.taskList[dateTaskIndex].missionList[taskIndex].enterMicroRobot[0]
console.log(changeFlag)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'enterMicroRobot',
this.selectRobot
)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'enterMicroRobotName',
this.selectRobotName[0]
)
if (changeFlag) {
console.log(222)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'groupChat',
''
)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'groupChatName',
''
)
}
this.$refs['taskForm'][dateTaskIndex].clearValidate()
},
// 获取群聊数据
getGroupList(item, index, itm, index1) {
if (!itm.enterMicroRobot) {
this.$message({
message: '请先选择企微机器人',
type: 'error',
})
return
}
let membersIds = itm.enterMicroRobot.join(',')
taskApi.getGroupList({ msgStaffIdList: membersIds }).then((res) => {
if (res.data.code == 0) {
this.groupListData = res.data.data
}
})
},
// 选择群聊数据
changeGroup(val, item, index, itm, index1) {
let groupList = this.groupListData.find((item) => item.roomChatId == val)
this.$set(this.taskList[index].missionList[index1], 'groupChat', val)
this.$set(
this.taskList[index].missionList[index1],
'groupChatName',
groupList.roomName
)
},
// 根据商户名搜索商户
filterMethod: utils.debounce(function (val) {
this.searchValue = val
......@@ -1026,6 +1361,8 @@ export default {
activityTime: '-1',
missionList: [],
})
// 如果没有传时间值,直接返回
if (!startTime) return this.taskList
// 如果是编辑/复制页面,任务计划回显
if (this.isEditor || (this.isClone && !this.basicForm.activityName))
this.dealEcho()
......@@ -1035,8 +1372,11 @@ export default {
this.getEditTaskList()
this.$nextTick(() => {
this.creatEdtior()
this.cloneList = this.taskList
// this.cloneList = this.taskList
})
this.cloneList = this.taskList
console.log(this.taskList, '==')
console.log(this.cloneList, '==')
return this.taskList
},
// 任务日期变化重新创建富文本
......@@ -1098,14 +1438,6 @@ export default {
})
}
},
// 根据日期获取天数
// getDateByDays(startDate, endDdate) {
// let d1 = Date.parse(new Date(startDate))
// let d2 = Date.parse(new Date(endDdate))
// // 时间戳相减 / 天数
// let day = parseInt((d2 - d1) / (1000 * 60 * 60 * 24)) + 1
// return day
// },
// 处理复制任务活动天数大于选择活动天数
getNextDate(date, day = 1, format = '{y}-{m}-{d}') {
if (date) {
......@@ -1186,6 +1518,15 @@ export default {
case 5:
taskItem = Object.assign({}, this.basicObj, this.orderObj)
break
case 6:
taskItem = Object.assign({}, this.basicObj, this.secondObj)
break
case 7:
taskItem = Object.assign({}, this.basicObj, this.walefaleObj)
break
case 8:
taskItem = Object.assign({}, this.basicObj, this.customerObj)
break
default:
taskItem = { ...this.basicObj }
}
......@@ -1193,14 +1534,23 @@ export default {
taskItem.missonType = task.missonType
taskItem.taskid = task.taskid || task.id
// 任务类型=浏览、访客、成单时,默认添加活动专属链接
if (taskItem.missonType != 1 && taskItem.missonType != 2) {
if (
taskItem.missonType == 3 ||
taskItem.missonType == 4 ||
taskItem.missonType == 5
) {
taskItem.linkStatus = true
} else {
taskItem.linkStatus = false
}
this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem)
if (
this.basicForm.businessScene == 4 ||
taskItem.missonType == 1 ||
taskItem.missonType == 6
)
return
this.$nextTick(() => {
// this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem)
var box = document.getElementById(
'missionList' + task.taskid + 'welcome'
)
......@@ -1306,11 +1656,6 @@ export default {
})
})
},
// handleBlur(dateTask) {
// if (dateTask.repeatCount) {
// dateTask.repeatFlag = false
// }
// },
// 重复次数选择框改变
repeatChange(listindex, dateTask, type, taskIndex) {
if (type) {
......@@ -1337,11 +1682,21 @@ export default {
this.getTextBox(textId, index, index1)
}
},
// 选择日期时间
selectRemindTime(dateTask, dateTaskIndex, task, taskIndex) {
let date = task.autoReminderTime
const remindTime = this.$Utils.timeTransfer(date)
this.$set(
this.taskList[dateTaskIndex].missionList[taskIndex],
'autoReminderTime',
remindTime
)
},
// 获取任务信息详情
findMissionDeail(taskId) {
var params = { id: taskId }
var params = { id: taskId } /* */
taskApi.findMissionDeail(params).then(
(res) => {
async (res) => {
if (res && res.code == 0) {
const {
activityId,
......@@ -1375,6 +1730,8 @@ export default {
// 处理空素材数据
this.taskEditList.missionDateList.map((item) => {
item.missionList.map((itm) => {
// 默认所属企业为广联赛讯
// itm.bussiness = 1
if (
itm.missonType &&
itm.missonType != 1 &&
......@@ -1414,10 +1771,30 @@ export default {
if (itm.missonType == 1 && !itm.rewardType) {
itm.rewardType = 4
}
// 处理企微机器人
if (itm.enterMicroRobot) {
itm.enterMicroRobot = itm.enterMicroRobot.split(',')
}
// 处理目标群聊回显
if (itm.groupChat) {
this.groupListData.push({
roomName: itm.groupChatName,
roomChatId: itm.groupChat,
})
}
console.log(this.groupListData, '---')
})
})
this.setHouseRatesColumn(startTime, endTime)
if (this.isClone) {
// 获取其为机器人列表
// await this.getlistDepartmentTree(merchantId)
// 判断场景(代运营只有完整周期)
if (businessScene == 4) {
this.taskList = this.taskEditList.missionDateList
this.preViewShow = false
} else {
this.setHouseRatesColumn(startTime, endTime)
}
if (businessScene != 4 && this.isClone) {
this.taskDateNum = this.getDateByDays(startTime, endTime)
}
}
......@@ -1470,6 +1847,19 @@ export default {
})
}
},
// 自动提醒切换
remindTypeChange(itm) {
this.$set(itm, 'remindTime', '')
this.$set(itm, 'enterMicroRobot', [])
this.$set(itm, 'groupChat', '')
this.$set(itm, 'enterMicroRobotName', '')
this.$set(itm, 'groupChatName', '')
},
// 企业机器人切换
robotMerchantChange(itm) {
let refLable = 'missionList' + (itm.taskid || itm.id) + 'robot'
this.$refs[refLable][0].getlistDepartmentTree(itm.robotMerchantNo)
},
// 基础信息表单验证
basicFormValidate() {
this.$refs['basicForm'].validate((valid) => {
......@@ -1508,6 +1898,7 @@ export default {
submitTask() {
// 遍历
// let submitList = JSON.parse(JSON.stringify(this.taskList))
this.isSubmit = true
this.taskList.map((item) => {
item.missionList.map((itm) => {
// 重复次数处理
......@@ -1535,6 +1926,10 @@ export default {
} catch (err) {
if (err) {
// this.taskList = JSON.parse(JSON.stringify(this.cloneList))
this.$message({
message: '基本信息未填写完成',
type: 'error',
})
return
}
}
......@@ -1575,11 +1970,6 @@ export default {
}
// 处理软文表情太大
if (itm.textContent) {
// let regErr = /<img\b/gi
// itm.textContent = itm.textContent.replace(
// regErr,
// `<img style="width: 18px;height 18px"`
// )
var regex0 = new RegExp('(i?)(\<img)([^\>]+\>)', 'gmi')
itm.textContent = itm.textContent
......@@ -1590,6 +1980,12 @@ export default {
'$2 style="width: 18px;height: 18px" $3'
)
}
// 处理企微机器人
if (itm.enterMicroRobot) {
itm.enterMicroRobot = Array.isArray(itm.enterMicroRobot)
? itm.enterMicroRobot.join(',')
: itm.enterMicroRobot
}
})
})
let params = JSON.parse(JSON.stringify(this.basicForm))
......@@ -1605,7 +2001,6 @@ export default {
}
params.missionDateList = this.taskList
params.id = this.taskId
console.log(params, '===')
// 创建
if (!this.isEditor) {
taskApi.creatMission(params).then(
......
......@@ -37,6 +37,20 @@
</template>
<div class="taskAward">
<div class="showInfoForm">
<span v-if="item.autoReminderFlag"
>自动提醒:{{
item.autoReminderFlag && item.autoReminderFlag == 1
? '无提醒'
: '自动提醒'
}}</span
>
<span v-if="item.autoReminderFlag && item.autoReminderFlag != 1"
>提醒时间:{{ item.autoReminderTime }}</span
><span v-if="item.autoReminderFlag && item.autoReminderFlag != 1"
>企微机器人:{{ item.enterMicroRobotName }}</span
><span v-if="item.autoReminderFlag && item.autoReminderFlag != 1"
>目标群聊:{{ item.groupChatName }}</span
>
<span v-if="item.rewardTypeName"
>奖励模式:{{ item.rewardTypeName }}</span
>
......
......@@ -22,46 +22,46 @@ export default {
{
name: '业务场景:',
value: 'businessSceneName',
id:'businessSceneName'
id: 'businessSceneName'
},
{
name: '商户:',
value: 'merchantName',
id:'merchantName'
id: 'merchantName'
},
{
name: '活动/产品:',
value: 'activityName',
id:'activityName'
id: 'activityName'
},
{
name: '任务指定人群:',
value: 'crowdName',
id:'crowdName'
id: 'crowdName'
},
{
name: '发放渠道:',
value: 'channelName',
id:'channelName'
id: 'channelName'
},
{
name: '积分提现:',
value: 'withdrawalFlag',
id:'withdrawalFlag'
id: 'withdrawalFlag'
}
]
}
},
watch: {
taskInfo:{
handler(newVal,oldVal){
taskInfo: {
handler(newVal, oldVal) {
if (!oldVal || newVal !== oldVal) {
this.taskInfoList.map(item => {
Object.keys(newVal).forEach(key => {
if (item.id == key) {
item.value = newVal[key]
if (item.id == 'withdrawalFlag') {
item.value = item.value == '1' ? '员工发起提现' : item.value == '2' ? '运营从后台核销' : ''
item.value = item.value == '1' ? '员工发起提现' : item.value == '2' ? '运营从后台核销' : item.value == '3' ? '银行卡提现' : ''
}
}
})
......@@ -70,7 +70,7 @@ export default {
},
immediate: true,
deep: true
},
}
}
}
</script>
......
......@@ -39,7 +39,7 @@ export default {
if (item.id == key) {
item.infoVal = newVal[key]
if (item.id == 'withdrawalFlag') {
item.infoVal = item.infoVal == '1' ? '员工发起提现' : item.infoVal == '2' ? '运营从后台核销' : ''
item.infoVal = item.infoVal == '1' ? '员工发起提现' : item.infoVal == '2' ? '运营从后台核销' : item.infoVal == '3' ? '银行卡提现' : ''
}
}
......
......@@ -48,6 +48,30 @@
</div>
</template>
<div class="showInfoForm">
<span v-if="displayList.autoReminderFlag"
>自动提醒:{{
displayList.autoReminderFlag == 1 ? '无提醒' : '自动提醒'
}}</span
>
<span
v-if="
displayList.autoReminderFlag &&
displayList.autoReminderFlag != 1
"
>提醒时间:{{ displayList.autoReminderTime }}</span
><span
v-if="
displayList.autoReminderFlag &&
displayList.autoReminderFlag != 1
"
>企微机器人:{{ displayList.enterMicroRobotName }}</span
><span
v-if="
displayList.autoReminderFlag &&
displayList.autoReminderFlag != 1
"
>目标群聊:{{ displayList.groupChatName }}</span
>
<span v-if="displayList.rewardTypeName"
>奖励模式:{{ displayList.rewardTypeName }}</span
>
......
......@@ -81,6 +81,7 @@
<span v-if="scope.scope.businessScene == 1">1.1精品升级</span>
<span v-if="scope.scope.businessScene == 2">1.2膨胀金活动</span>
<span v-if="scope.scope.businessScene == 3">1.3众筹活动</span>
<span v-if="scope.scope.businessScene == 4">5.2私域用户代运营</span>
</div>
<div slot="activityStatus" slot-scope="scope">
<span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH"
......@@ -125,7 +126,10 @@
@click="handleInactive(scope.scope)"
>结束</el-button
>
<el-button type="text" @click="handleClone(scope.scope)"
<el-button
type="text"
@click="handleClone(scope.scope)"
v-if="scope.scope.businessScene != 4"
>复制</el-button
>
<el-button
......@@ -161,6 +165,10 @@ const sceneOption = [
label: '1.3众筹活动',
value: '3',
},
{
label: '5.2私域用户代运营',
value: '4',
},
]
const statusNum = {
ALL: '',
......
......@@ -24,27 +24,28 @@ export default {
}
},
methods: {
handleDebounce:debounce(
async function(){
handleDebounce: debounce(
async function() {
const params = {
...JSON.parse(JSON.stringify(
{ idList: this.auditId }
))
)),
withDrawType: 1
}
await withdrawalApi.batchWithdrawal(params).then(res => {
if (res.code !== '0'){
if (res.code !== '0') {
this.$message.error('审核失败')
}else{
} else {
this.$message.success('审核成功')
}
}).catch(err=>{
}).catch(err => {
this.$message.error(err)
}
)
this.dialogVisible = false
},
1000
),
)
}
}
</script>
......
<template>
<div style="margin: 16px">
<div style='margin: 16px'>
<el-form
size="small"
size='small'
inline
ref="withdrawalForm"
:model="withdrawalSearchForm"
label-width="100px"
class="demo-form-inline"
ref='withdrawalForm'
:model='withdrawalSearchForm'
label-width='100px'
class='demo-form-inline'
>
<el-form-item label="员工名称">
<el-form-item label='员工名称'>
<el-input
clearable
v-model="withdrawalSearchForm.staffName"
placeholder="请输入员工名称"
v-model='withdrawalSearchForm.staffName'
placeholder='请输入员工名称'
></el-input>
</el-form-item>
<el-form-item label="员工手机号">
<el-form-item label='员工手机号'>
<el-input
clearable
v-model="withdrawalSearchForm.staffPhone"
placeholder="请输入员工手机号"
v-model='withdrawalSearchForm.staffPhone'
placeholder='请输入员工手机号'
></el-input>
</el-form-item>
<el-form-item label="门店名称">
<el-form-item label='门店名称'>
<el-input
clearable
v-model="withdrawalSearchForm.merchantName"
placeholder="请输入门店名称"
v-model='withdrawalSearchForm.merchantName'
placeholder='请输入门店名称'
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-form-item label='状态'>
<el-select
v-model="withdrawalSearchForm.status"
placeholder="请选择状态"
v-model='withdrawalSearchForm.status'
placeholder='请选择状态'
>
<el-option label="全部" value=""></el-option>
<el-option label="待审核" value="1"></el-option>
<el-option label="到账中" value="2"></el-option>
<el-option label="已到账" value="3"></el-option>
<el-option label="到账失败" value="4"></el-option>
<el-option label='全部' value=''></el-option>
<el-option label='待审核' value='1'></el-option>
<el-option label='到账中' value='2'></el-option>
<el-option label='已到账' value='3'></el-option>
<el-option label='到账失败' value='4'></el-option>
</el-select>
</el-form-item>
<el-form-item label="提现时间">
<el-form-item label='提现时间'>
<el-date-picker
value-format="yyyy-MM-dd"
v-model="withdrawalSearchForm.withdrawalTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format='yyyy-MM-dd'
v-model='withdrawalSearchForm.withdrawalTime'
type='daterange'
range-separator='至'
start-placeholder='开始日期'
end-placeholder='结束日期'
>
</el-date-picker>
</el-form-item>
<el-form-item label="审核时间">
<el-form-item label='审核时间'>
<el-date-picker
value-format="yyyy-MM-dd"
v-model="withdrawalSearchForm.reviewTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format='yyyy-MM-dd'
v-model='withdrawalSearchForm.reviewTime'
type='daterange'
range-separator='至'
start-placeholder='开始日期'
end-placeholder='结束日期'
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询 </el-button>
<el-button @click="reset">重置</el-button>
<el-button type='primary' @click='handleSearch'>查询</el-button>
<el-button @click='reset'>重置</el-button>
</el-form-item>
</el-form>
</div>
......@@ -81,13 +81,14 @@ export default {
return {
withdrawalSearchForm: {
status: '',
},
isWithdrawal: 1
}
}
},
created() {
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [
this.defalutStartTime,
this.defalutEndTime,
this.defalutEndTime
])
},
mounted() {
......@@ -101,15 +102,16 @@ export default {
Object.keys(this.withdrawalSearchForm).forEach((key) => {
this.withdrawalSearchForm[key] = ''
})
this.withdrawalSearchForm.isWithdrawal = 3
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [
this.defalutStartTime,
this.defalutEndTime,
this.defalutEndTime
])
this.$nextTick(() => {
this.handleSearch()
})
},
},
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!