Commit 572438de by ext.wangyuman1

客户朋友圈模块

1 parent 65dbb685
...@@ -9,11 +9,17 @@ export function getEnterpriceList(data) { ...@@ -9,11 +9,17 @@ export function getEnterpriceList(data) {
}) })
} }
// 朋友圈 企业 同步 // // 朋友圈 企业 同步
// export function syncHMoments(data) {
// return request({
// url: service + '/moments/synchMoments',
// params: data,
// })
// }
// 朋友圈 全部 同步
export function syncHMoments(data) { export function syncHMoments(data) {
return request({ return request({
url: service + '/moments/synchMoments', url: service + '/moments/sync/' + data,
params: data,
}) })
} }
...@@ -32,3 +38,28 @@ export function gotoPublish(data) { ...@@ -32,3 +38,28 @@ export function gotoPublish(data) {
data: data, data: data,
}) })
} }
// 朋友圈 停止发送朋友圈
export function cancelMoments(data) {
return request({
url: service + '/moments/cancel/' + data,
})
}
// 朋友圈 新增
export function addMoments(data) {
return request({
url: service + '/moments/add',
method: 'post',
data: data,
})
}
// 朋友圈 预估客户数量
export function numMoments(data) {
return request({
url: service + '/moments/estimate/num',
method: 'post',
data: data,
})
}
\ No newline at end of file \ No newline at end of file
...@@ -9,33 +9,45 @@ ...@@ -9,33 +9,45 @@
width="80%" width="80%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
@close="dialogClose"> @close="dialogClose"
>
<el-tabs v-model="activeName" @tab-click="tabClick"> <el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane <el-tab-pane
v-for="(item, index) in paneList" v-for="(item, index) in paneList"
:key="index" :key="index"
:label="item.label + '(' + item.list.length + ')'" :label="item.label + '(' + item.list.length + ')'"
:name="item.name"> :name="item.name"
>
<MaPage ref="page" :type="item.type" v-slot="{ list }" @listChange="listChange"> <MaPage ref="page" :type="item.type" v-slot="{ list }" @listChange="listChange">
<div v-if="item.type === '0'"> <div v-if="item.type === '0'">
<div v-if="list && list.length"> <div v-if="list && list.length">
<el-checkbox-group v-model="paneList[picindex].list" class="imgStyle"> <el-checkbox-group v-model="paneList[picindex].list" class="imgStyle">
<div class="imgItem" v-for="(item, index) in list" :key="index" @click="changeBox($event, item)"> <div
class="imgItem"
v-for="(item, index) in list"
:key="index"
@click="changeBox($event, item)"
>
<div class="checkboxStyle"> <div class="checkboxStyle">
<el-checkbox <el-checkbox
:label="item" :label="item"
style="width: 20px; height: 20px" style="width: 20px; height: 20px"
:checked="item.isCheck"></el-checkbox> :checked="item.isCheck"
></el-checkbox>
<el-tooltip <el-tooltip
:content="item.materialName" :content="item.materialName"
placement="top" placement="top"
:disabled="item.materialName ? item.materialName.length < 6 : true"> :disabled="item.materialName ? item.materialName.length < 6 : true"
>
<div class="title ml10"> <div class="title ml10">
{{ coverContent(item.materialName, 6) }} {{ coverContent(item.materialName, 6) }}
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="img" :style="{ 'background-image': 'url(' + item.materialUrl + ')' }"></div> <div
class="img"
:style="{ 'background-image': 'url(' + item.materialUrl + ')' }"
></div>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -43,7 +55,13 @@ ...@@ -43,7 +55,13 @@
<span>暂无数据</span> <span>暂无数据</span>
</div> </div>
</div> </div>
<el-table :data="list" ref="multipleTable" @select="handleSelect" @select-all="selectAll" v-else> <el-table
:data="list"
ref="multipleTable"
@select="handleSelect"
@select-all="selectAll"
v-else
>
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="素材" align="left"> <el-table-column label="素材" align="left">
<template #default="{ row }"> <template #default="{ row }">
...@@ -101,6 +119,11 @@ export default { ...@@ -101,6 +119,11 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
// 朋友圈
isFriends: {
type: Boolean,
default: false,
},
}, },
watch: { watch: {
choseDialog: { choseDialog: {
...@@ -198,7 +221,9 @@ export default { ...@@ -198,7 +221,9 @@ export default {
this.ids.length + this.talkListLength === this.maxlength) && this.ids.length + this.talkListLength === this.maxlength) &&
!obj.isCheck !obj.isCheck
) { ) {
this.$message.error('最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材') this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材'
)
return return
} }
obj.isCheck = !obj.isCheck obj.isCheck = !obj.isCheck
...@@ -274,7 +299,9 @@ export default { ...@@ -274,7 +299,9 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.index) this.$refs.multipleTable[this.inx].toggleRowSelection(row, false) if (this.index) this.$refs.multipleTable[this.inx].toggleRowSelection(row, false)
}) })
this.$message.error('最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材') this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材'
)
this.paneList[this.index].list = this.paneList[this.index].list.filter((item) => { this.paneList[this.index].list = this.paneList[this.index].list.filter((item) => {
return item.id != row.id return item.id != row.id
}) })
...@@ -294,7 +321,9 @@ export default { ...@@ -294,7 +321,9 @@ export default {
select.forEach((item) => { select.forEach((item) => {
this.$refs.multipleTable[this.inx].toggleAllSelection(item, false) this.$refs.multipleTable[this.inx].toggleAllSelection(item, false)
}) })
this.$message.error('最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材') this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材'
)
this.paneList[this.index].list = [] this.paneList[this.index].list = []
this.getIds() this.getIds()
} }
......
...@@ -63,6 +63,7 @@ let config = { ...@@ -63,6 +63,7 @@ let config = {
services: { services: {
wecom: '/open', wecom: '/open',
system: env.SYSTEM_API, system: env.SYSTEM_API,
// system: 'http://192.168.4.168:6180',
common: '/common', common: '/common',
}, },
......
<template> <template>
<div>
<div class="select_content"> <div class="select_content">
<!-- 部门与岗位开始 --> <!-- 部门与岗位开始 -->
<div class="flex"> <div class="flex">
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
@success="submitSelectTag" @success="submitSelectTag"
></SelectTag> ></SelectTag>
</div> </div>
</div>
</template> </template>
<script> <script>
import { getDeptTree, getDeptUserAll } from '@/api/organization' import { getDeptTree, getDeptUserAll } from '@/api/organization'
...@@ -252,6 +254,18 @@ export default { ...@@ -252,6 +254,18 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.customer-num {
span {
font-size: 12px;
line-height: 30px;
}
span:nth-child(1) {
color: #aaa;
}
span:nth-child(2) {
color: #07c160;
}
}
.select_content { .select_content {
.select_unit { .select_unit {
padding-bottom: 16px; padding-bottom: 16px;
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
<el-radio :label="0">全部客户</el-radio> <el-radio :label="0">全部客户</el-radio>
<el-radio :label="1">按条件筛选</el-radio> <el-radio :label="1">按条件筛选</el-radio>
</el-radio-group> </el-radio-group>
<div class="customer-num">
<span>朋友圈预计可见客户数(不去重):</span><span>{{ form.customerNum }}</span>
</div>
<SelectMember <SelectMember
ref="selectMember" ref="selectMember"
:initData="addWeUser" :initData="addWeUser"
...@@ -143,7 +146,7 @@ ...@@ -143,7 +146,7 @@
</template> </template>
<script> <script>
import { gotoPublish } from '@/api/circle' import { addMoments, numMoments } from '@/api/circle'
import AddMaterial from '@/components/ContentCenter/AddMaterial' import AddMaterial from '@/components/ContentCenter/AddMaterial'
import SelectMember from './components/SelectMember.vue' import SelectMember from './components/SelectMember.vue'
...@@ -193,9 +196,26 @@ export default { ...@@ -193,9 +196,26 @@ export default {
}, },
} }
}, },
mounted() {}, mounted() {
let form = {}
form.scopeType = 0
this.getNumMoments(form)
},
methods: { methods: {
// 获取可见客户数
getNumMoments(data) {
numMoments(data)
.then((res) => {
if (res.code === 200) {
this.form.customerNum = res.data
}
})
.catch()
},
getExecuteData(data) { getExecuteData(data) {
let form = data
form.scopeType = 1
this.getNumMoments(form)
console.log(174, data) console.log(174, data)
this.addWeUser = data this.addWeUser = data
}, },
...@@ -245,31 +265,35 @@ export default { ...@@ -245,31 +265,35 @@ export default {
}, },
submit(data) { submit(data) {
console.log(data) this.form.materialIds = []
this.form.content = data.templateInfo data.attachments.forEach((item) => {
if (data.attachments.length !== 0) { this.form.materialIds.push(item.materialId)
this.form.contentType = 'link'
this.form.realType = data.attachments[0].realType
this.form.materialId = data.attachments[0].materialId
this.dealType(data.attachments[0])
} else {
this.form.otherContent = []
this.form.contentType = 'text'
}
// if (this.$refs.friendCircleContent.validate()) {
if (this.form.scopeType === 0) {
this.form.customerTag = this.selectedTagList
.map((dd) => {
return dd.tagId
})
.join(',')
this.form.noAddUser = this.selectedUserList
.map((dd) => {
return dd.userId
}) })
.join(',') // this.form.content = data.templateInfo
} // if (data.attachments.length !== 0) {
gotoPublish(this.form).then((res) => { // this.form.contentType = 'link'
// this.form.realType = data.attachments[0].realType
// this.form.materialId = data.attachments[0].materialId
// this.dealType(data.attachments[0])
// } else {
// this.form.otherContent = []
// this.form.contentType = 'text'
// }
// // if (this.$refs.friendCircleContent.validate()) {
// if (this.form.scopeType === 0) {
// this.form.customerTag = this.selectedTagList
// .map((dd) => {
// return dd.tagId
// })
// .join(',')
// this.form.noAddUser = this.selectedUserList
// .map((dd) => {
// return dd.userId
// })
// .join(',')
// }
console.log(this.form)
addMoments(this.form).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.msgSuccess('操作成功') this.msgSuccess('操作成功')
this.$router.go(-1) this.$router.go(-1)
...@@ -371,6 +395,18 @@ export default { ...@@ -371,6 +395,18 @@ export default {
font-size: 12px; font-size: 12px;
line-height: 34px; line-height: 34px;
} }
.customer-num {
span {
font-size: 12px;
line-height: 30px;
}
span:nth-child(1) {
color: #aaa;
}
span:nth-child(2) {
color: #07c160;
}
}
.question { .question {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!