Commit e712f9b5 by 前端

更新v3.4.0代码

1 parent 59889dac
......@@ -37,6 +37,23 @@ export default {
}
},
methods: {
// 返回
handleCancel(path) {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push(path)
})
.catch(() => {
})
} else {
this.$router.push(path)
}
},
// 选择客户change事件
radioChange(val) {
this.isSelectCrowd = false
......@@ -119,8 +136,20 @@ export default {
this.taggingList = arr
this.isUpdate = true
},
async getTheNumberOfPeople(params) {
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
this.groupNumber = res
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
},
// 查看群发人数
viewMembers() {
async viewMembers() {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
return this.$message({
type: 'error',
......@@ -133,24 +162,11 @@ export default {
message: '请选择人群'
})
}
const params = this.getBaseInfo()
let params = this.getBaseInfo()
this.viewLoading = true
this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.isUpdate = false
this.groupNumber = res
} else {
this.isUpdate = true
}
this.viewLoading = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
await this.getTheNumberOfPeople(params)
this.isUpdate = false
this.viewLoading = false
},
getBaseInfo() {
let params = {
......
......@@ -20,9 +20,9 @@
<i class="el-icon-plus"></i>
选择员工
</el-button>
<div class="sale-select" v-show="basicForm.userList && basicForm.userList.length != 0">
<div class="sale-select" v-show="basicForm.staffUserList && basicForm.staffUserList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.userList" :key="idx" closable
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.staffUserList" :key="idx" closable
:disable-transitions="false" @close="remove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
......@@ -111,7 +111,7 @@
</GLDialog>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button @click="handleCancel('/friendGroup/index')">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId"
......@@ -211,15 +211,16 @@ export default {
// templateDetailApi: this.$apis.welcomeword.templateDetail
// }
],
dialogVisible: false,
basicForm: {
userList: [],
staffUserList: [],
taskName: '',
taskMerchantId: '',
sendType: 1,
sendTime: '',
sendDate: '',
selectType: 1,
selectType: 0,
crowdList: []
},
attachmentShow: false,
......@@ -238,8 +239,6 @@ export default {
key: new Date(),
previewFlag: false,
selectData: [],
// 是否有修改筛选成员
// isUpdate: true,
tagging: [],
editStatus: false,
firstFlag: true,
......@@ -248,17 +247,7 @@ export default {
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.userList'() {
'basicForm.staffUserList'() {
this.empErrorShow = false
}
},
......@@ -274,28 +263,12 @@ export default {
openMembers() {
this.membersVisible = !this.membersVisible
},
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/friendGroup/index')
})
.catch(() => {
})
} else {
this.$router.push('/friendGroup/index')
}
},
// 成员弹窗
handleConfirm() {
if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList
this.$set(this.basicForm, 'staffUserList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.staffUserList
this.openMembers()
this.isUpdate = true
this.editStatus = true
......@@ -309,11 +282,11 @@ export default {
remove(val, idx) {
if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.$set(this.basicForm, 'staffUserList', this.$refs.membersForm.innerTags)
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.basicForm.staffUserList.splice(idx, 1)
this.selectData = this.basicForm.staffUserList
this.key = new Date()
}
this.isUpdate = true
......@@ -321,7 +294,21 @@ export default {
handleSubmit: utils.debounce(function () {
this.$refs.groupForm.validate(valid => {
if (valid) {
if (this.basicForm.userList.length == 0) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
this.$message({
type: 'error',
message: '请选择标签'
})
return
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
this.$message({
type: 'error',
message: '请选择人群'
})
return
}
if (this.basicForm.staffUserList.length == 0) {
this.empErrorShow = true
return
}
......@@ -334,7 +321,7 @@ export default {
if (previewList.length != 0) {
this.basicForm.attachmentList = previewList
}
let staffIds = this.basicForm.userList.map(item => {
let staffIds = this.basicForm.staffUserList.map(item => {
return item.staffId
})
let attachmentList = this.$refs.welcome.previewList
......@@ -358,6 +345,15 @@ export default {
}
const {taskName, taskMerchantId, sendType} = this.basicForm
const taskMerchantName = this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName
let peopleParams = this.getBaseInfo()
this.getTheNumberOfPeople(peopleParams)
if (this.groupNumber == 0) {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
let params = {
materialType,
attachmentList,
......@@ -559,17 +555,20 @@ export default {
.group-content {
padding: 22px 0 20px;
}
.crowd-tips {
color: #999999;
font-size: 12px;
line-height: 16px;
}
.filter-footer {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
display: inline-block;
line-height: 20px;
......@@ -577,6 +576,7 @@ export default {
background-color: #e6e9ff;
color: #333;
margin-top: 8px;
span {
color: #5850ff;
cursor: pointer;
......
......@@ -13,8 +13,8 @@
<!-- 表格区域 开始 -->
<GLTable v-loading="loading" ref="proGroupRef" @refreshTable="handleSearch" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div class="loginStatus" slot="sendStatus" slot-scope="scope">
<span class="cycle" :style="{ background: scope.scope.sendStatus == '2' ? '#2CCA74' : scope.scope.sendStatus == '-1' ? '#EB4E4E' : scope.scope.sendStatus == '1' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendStatus == '2' ? '已完成' : scope.scope.sendStatus == '-1' ? '发送失败' : scope.scope.sendStatus == '1' ? '发送中' : '' }}
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : scope.scope.sendState == '3' ? '#E5E5E5':'' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : scope.scope.sendState == '3' ? '待发送':'' }}
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
......@@ -22,6 +22,15 @@
</GLTable>
<!-- 表格区域 end -->
</div>
<GLDialog :title="'终止发送'" mode="small" :visible.sync="popVisible">
<div class="qrIMGbox">
是否确认终止发送
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="popVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="getCode">确定</el-button>
</span>
</GLDialog>
<draw-record ref="drawForm"></draw-record>
</div>
</template>
......@@ -40,6 +49,7 @@ export default {
},
data() {
return {
popVisible:false,
size: 'small',
loading: false,
url: url,
......@@ -101,6 +111,19 @@ export default {
listeners: {
click: this.handleRecord
}
},
{
type: 'el-button',
name: '终止',
attrs: {
type: 'text'
},
condition: row => {
return row.sendStatus == 3
},
listeners: {
click: this.terminatePopup
}
}
],
// 表格
......@@ -162,6 +185,9 @@ export default {
},
methods: {
terminatePopup(){
this.popVisible = true
},
handleRecord(row) {
this.$refs.drawForm.init(row)
},
......
......@@ -98,7 +98,7 @@
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button @click="handleCancel('/wechatGroup/index')">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
......@@ -109,8 +109,6 @@
</div>
</template>
<script>
import department from "@/mixins/department";
const combineType = {
label: 2,
crowd: 1
......@@ -118,17 +116,35 @@ const combineType = {
import emoji from '@/utils/emo'
import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel'
import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup'
// import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs'
export default {
mixins: [marketingGroup],
mixins: [department,marketingGroup],
components: {
SelectLabel,
SelectCrowd
},
data() {
const validatorSendType = (rule, value, callback) => {
if (value) {
if (value == 2) {
if (!this.basicForm.sendTime) {
callback(new Error('请选择日期'))
}
if (!this.basicForm.sendDate) {
callback(new Error('请选择时间'))
}
if (this.basicForm.sendTime && this.basicForm.sendDate) {
callback()
}
} else {
callback()
}
}
}
return {
resetMerchantId: '',
msgMerchantName: '',
......@@ -248,13 +264,20 @@ export default {
basicRules: {
groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectStore: [{required: true, message: '请选择门店', trigger: 'change'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}]
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'}
]
},
basicForm: {
groupName: '',
selectStore: '',
selectType: 1,
crowdList: []
sendType:1,
crowdList: [],
sendDate:'',
sendTime:''
},
groupList: [],
selectData: [],
......@@ -271,74 +294,15 @@ export default {
dataItems: []
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.selectType'(newVal, oldVal) {
if (oldVal == 2 || newVal == 2) {
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
async mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
this.loadUpData()
const merchantList = await this.merchantList()
this.dataItems = merchantList ? merchantList : []
},
methods: {
async loadUpData() {
const params = {
pageNum: 1,
pageSize: 10000
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.dataItems = res || []
})
},
// 返回
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/wechatGroup/index')
})
.catch(() => {
})
} else {
this.$router.push('/wechatGroup/index')
}
},
// 提交
async handleSubmit() {
const params = this.getBaseInfo()
// 统计群发人数
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.groupNumber = res
}
})
.catch(err => {
this.groupNumber = 0
})
this.$refs.basicForm.validate(valid => {
if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
......@@ -370,20 +334,22 @@ export default {
} else {
return (this.attachmentText = '请输入群发内容')
}
if (this.groupNumber == '0') {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
this.$refs.groupForm.validate(async v => {
if (v) {
const params = this.getBaseInfo()
params.type = 1
let params = this.getBaseInfo()
await this.getTheNumberOfPeople(params)
if (this.groupNumber == 0) {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
params.sendType = this.basicForm.sendType
if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
}
params.type = 1
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const contentList = previewList.map(item => {
if (item.attType == 1) {
......
......@@ -10,18 +10,30 @@
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="optionBtns" slot-scope="scope">
<div v-if="scope.scope.sendState == '1'">
<div v-if="scope.scope.sendState == '3'">
<span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div>
<div v-if="scope.scope.sendState == '1'">
<span class="sendRecord" @click="terminatePopup">终止</span>
</div>
</div>
<div slot="sendState" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : '' }}
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : scope.scope.sendState == '3' ? '#E5E5E5':'' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : scope.scope.sendState == '3' ? '待发送':'' }}
</div>
</div>
</GLTable>
</div>
<GLDialog :title="'终止发送'" mode="small" :visible.sync="popVisible">
<div class="qrIMGbox">
是否确认终止发送
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="popVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="getCode">确定</el-button>
</span>
</GLDialog>
<el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div>
<div class="sendRecordDrawerbox">
......@@ -53,6 +65,7 @@ export default {
data() {
return {
url,
popVisible:false,
sendRecordDrawer: {
isVisible: false,
direction: 'rtl',
......@@ -181,6 +194,11 @@ export default {
}
},
methods: {
terminatePopup(){
console.log('??????')
this.popVisible = true
console.log(this.popVisible )
},
handleSearch() {
this.$refs.activeTable.refreshTable()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!