Commit 6b83832f by 胡悦

提交群发助手

1 parent fe0eee8d
...@@ -163,6 +163,24 @@ const remindUserGroup = params => { ...@@ -163,6 +163,24 @@ const remindUserGroup = params => {
sign: true sign: true
}) })
} }
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.card.class.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -179,5 +197,7 @@ export default { ...@@ -179,5 +197,7 @@ export default {
groupDetailStatistic, groupDetailStatistic,
staffList, staffList,
customerDetailList, customerDetailList,
groupDetailList groupDetailList,
getMerchant,
getCard
} }
export function debounce(func, wait= 200){
let timeout;
return function(event){
clearTimeout(timeout)
timeout = setTimeout(()=>{
func.call(this, event)
},wait)
}
}
export function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') { export function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime) const date = new Date(dateTime)
const config = { const config = {
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers :selectData="selectData" ref="membersForm"></SelectMembers> <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers>
</glsx-dialog> </glsx-dialog>
</div> </div>
<div <div
...@@ -219,6 +219,7 @@ export default { ...@@ -219,6 +219,7 @@ export default {
} }
} }
const validatorAttachment = (rule, value, callback) => { const validatorAttachment = (rule, value, callback) => {
console.log(this.$refs.welcome.previewList)
const previewList = this.$refs.welcome.previewList const previewList = this.$refs.welcome.previewList
if (previewList.length != 0) { if (previewList.length != 0) {
this.basicForm.attachmentList = previewList this.basicForm.attachmentList = previewList
...@@ -332,13 +333,13 @@ export default { ...@@ -332,13 +333,13 @@ export default {
this.$refs.selectLabel.init() this.$refs.selectLabel.init()
}, },
handleSubmit() { handleSubmit() {
console.log(this.basicForm) console.log(this.basicForm, this.$refs.welcome.previewList)
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
console.log(valid) console.log(valid)
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(v => {
if (v) { if (v) {
if (this.groupNumber == 0) { if (this.basicForm.selectType == 2 && this.groupNumber == 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '选择客户数量为0,不可创建' message: '选择客户数量为0,不可创建'
...@@ -347,8 +348,15 @@ export default { ...@@ -347,8 +348,15 @@ export default {
} }
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
params.attachmentList = this.basicForm.attachmentList // params.attachmentList = this.basicForm.attachmentList
params.sendType = this.basicForm.sendType params.sendType = this.basicForm.sendType
const attachmentList = this.$common.utils.deepClone(this.$refs.welcome.previewList).map(item => {
if (item.attType == 1) {
item.attContent = item.attContent.replace('@昵称', '[@昵称]')
}
return item
})
params.attachmentList = attachmentList
// const params = { // const params = {
// type: 1, // type: 1,
// attachmentList: this.basicForm.attachmentList, // attachmentList: this.basicForm.attachmentList,
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers ref="membersForm"></SelectMembers> <SelectMembers ref="membersForm" islord="true"></SelectMembers>
</glsx-dialog> </glsx-dialog>
</div> </div>
</template> </template>
......
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="model-panel">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane label="券营销" name="1"></el-tab-pane>
<el-tab-pane label="权益卡" name="2"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div
class="model-item"
:class="{ checked: selectItem == item }"
v-for="(item, index) in modelList"
:key="index"
@click="handleSelectItem(item)"
>
<div class="model-item-title" v-show="activeName == 2">{{ item.cardClassName }}</div>
<div class="model-item-title" v-show="activeName == 1">{{ item.couponName }}</div>
<div class="model-item-content" v-show="activeName == 1">数量:{{ item.residueAmount }}</div>
<div class="model-item-content" v-show="activeName == 2">价格:{{ item.price }}</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 2"
>有效期:{{ item.effectiveNum }}天</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 1"
>有效期:无限制</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 2"
>有效期:{{ item.effectiveStartTime }}~{{ item.effectiveEndTime }}</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 1"
>有效期:{{ item.effectiveDays }}天</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 3"
>有效期:无限制</div>
<div
class="model-item-content"
v-show="activeName == 1"
>类型:{{ item.discountType == 1 ? '满减劵' : item.discountType == 2 ? '折扣券' : item.discountType == 3 ? '代金券' : item.discountType == 4 ? '实物券' : item.discountType == 5 ? '购车代金券' : item.discountType == 6 ? '商品折扣券' : item.discountType == 7 ? '会员服务' : '' }}</div>
<div class="model-item-content" v-show="activeName == 2">类型:权益卡</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="tableTotal"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'ActivityModel',
data() {
return {
dialogVisible: false,
loading: false,
activeName: '1',
modelList: [],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
selectItem: {}
}
},
methods: {
handleSelectItem(item) {
this.selectItem = item
},
handleSelect() {
if (!this.selectItem.id) {
this.$message({
type: 'error',
message: '请选择活动'
})
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id, marketingType: this.activeName == 1 ? 2 : 3, marketingName: this.activeName == 2 ? this.selectItem.cardClassName : this.selectItem.couponName })
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '1':
market = 'getMerchant'
break
case '2':
market = 'getCard'
break
}
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
this.$apis.customerTransform[market](params).then(res => {
this.modelList = res.list ? res.list : res.data
this.tableTotal = res.total
this.loading = false
})
},
init() {
this.dialogVisible = true
this.getModelList()
this.selectItem = {}
},
handleClick() {
this.getModelList()
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-empty {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
}
.model-item-panel {
display: grid;
grid-template-columns: repeat(4, 25%);
grid-row-gap: 10px;
height: 40vh;
overflow: auto;
.model-item {
position: relative;
height: 128px;
background: #ffffff;
border-radius: 4px;
border: 2px solid #e6e6e6;
padding: 14px 24px;
box-sizing: border-box;
margin-right: 10px;
&:nth-child(4n) {
margin-right: 0px;
}
&.checked {
border: 2px solid #5850ff;
}
&-qrcode {
position: absolute;
right: 10px;
bottom: 10px;
width: 60px;
height: 60px;
border: 1px solid #979797;
}
&-title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div> <div class="preview-text text">{{ item.attContent }}</div>
</template> </template>
<template v-else-if="item.attType == 4"> <template v-else-if="item.attType == 7">
<div class="preview-text preview-link"> <div class="preview-activity">
<img class="applet-logo" src="@/assets/guestCustom/applet-logo.png" alt />
<div class="activity-name">{{item.attContent.marketingName}}</div>
<img class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt />
<div class="activity-footer">
<img src="@/assets/guestCustom/applet-footer.png" alt />
</div>
</div>
<!-- <div class="preview-text preview-link">
{{ item.attContent.url }} {{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt /> <img src="@/assets/guestCustom/preview-link.png" alt />
</div> </div>-->
</template> </template>
<template v-else-if="item.attType == 2"> <template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
...@@ -139,6 +147,31 @@ export default { ...@@ -139,6 +147,31 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
.preview-activity {
width: 160px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #dce1e5;
padding: 7px 7px 0;
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.applet-logo {
width: 95px;
height: 24px;
}
.activity-footer {
margin-top: 4px;
border-top: 1px solid #edeff3;
}
}
} }
} }
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<script> <script>
export default { export default {
name: 'selectEmp', name: 'selectEmp',
props: ['selectData'], props: ['selectData', 'islord'],
data() { data() {
return { return {
treeHeight: 0, treeHeight: 0,
...@@ -69,7 +69,6 @@ export default { ...@@ -69,7 +69,6 @@ export default {
] ]
}, },
tableEmpData: [], tableEmpData: [],
group: {},
currentArr: [], currentArr: [],
loading: true loading: true
} }
...@@ -79,10 +78,14 @@ export default { ...@@ -79,10 +78,14 @@ export default {
this.$emit('selectTable', val) this.$emit('selectTable', val)
}, },
listDepartmentTree() { listDepartmentTree() {
this.$apis.customerTransform.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => { const params = { merchantId: 10001001, addChildrensFlag: true }
if (this.islord) {
params.islord = this.islord
}
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.listTree = res this.listTree = res
this.loading = false this.loading = false
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree) // this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree) console.log(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses) this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
this.selectData.forEach(i => { this.selectData.forEach(i => {
...@@ -145,6 +148,7 @@ export default { ...@@ -145,6 +148,7 @@ export default {
// } // }
}, },
mounted() { mounted() {
console.log('islord', this.islord)
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 650 this.treeHeight = clientHeight - 650
this.listDepartmentTree() this.listDepartmentTree()
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="select-sale-panel"> <div class="select-sale-panel">
<select-emp <select-emp
:selectData="selectData" :selectData="selectData"
@group="handlGroup" :islord="islord"
@selectTable="selectTable" @selectTable="selectTable"
ref="selectEmpTabel" ref="selectEmpTabel"
></select-emp> ></select-emp>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
import selectEmp from './selectEmp.vue' import selectEmp from './selectEmp.vue'
export default { export default {
name: 'SelectMembers', name: 'SelectMembers',
props: ['selectData'], props: ['selectData', 'islord'],
components: { components: {
selectEmp selectEmp
}, },
......
...@@ -70,8 +70,8 @@ export default { ...@@ -70,8 +70,8 @@ export default {
console.log(val) console.log(val)
const xData = val.map(i => i.dataDateStr) const xData = val.map(i => i.dataDateStr)
const yData = val.map(i => i.amount) const yData = val.map(i => i.amount)
this.option.xAxis.data = xData.reverse() this.option.xAxis.data = xData
this.option.series[0].data = yData.reverse() this.option.series[0].data = yData
this.option.series[0].count = val.map(i => i.count) this.option.series[0].count = val.map(i => i.count)
this.option && this.myChart.setOption(this.option) this.option && this.myChart.setOption(this.option)
} }
......
...@@ -366,21 +366,24 @@ export default { ...@@ -366,21 +366,24 @@ export default {
switch (name) { switch (name) {
case 'week': case 'week':
startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek) startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek)
endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek) endTime = new Date()
// endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
break break
case 'month': case 'month':
startTime = new Date(nowYear, nowMonth, 1) startTime = new Date(nowYear, nowMonth, 1)
endTime = new Date(nowYear, nowMonth + 1, 0) endTime = new Date()
// endTime = new Date(nowYear, nowMonth + 1, 0)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
break break
case 'year': case 'year':
startTime = new Date(nowYear, 0, 1) startTime = new Date(nowYear, 0, 1)
endTime = new Date(nowYear, 11, 31) endTime = new Date()
// endTime = new Date(nowYear, 11, 31)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!