Commit 6dcf1d0d by ext.wangyuman1

客户朋友圈模块

1 parent 572438de
...@@ -23,10 +23,10 @@ export function syncHMoments(data) { ...@@ -23,10 +23,10 @@ export function syncHMoments(data) {
}) })
} }
// 朋友圈 企业 详情 // 朋友圈 详情
export function getDetail(id) { export function getDetail(id) {
return request({ return request({
url: service + '/moments/findMomentsDetail/' + id, url: service + '/moments/get/' + id,
}) })
} }
...@@ -62,4 +62,11 @@ export function numMoments(data) { ...@@ -62,4 +62,11 @@ export function numMoments(data) {
method: 'post', method: 'post',
data: data, data: data,
}) })
}
\ No newline at end of file \ No newline at end of file
}
// 朋友圈 提醒执行
export function reminderMoments(data) {
return request({
url: service + '/moments/reminder/execution/' + data,
})
}
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<el-button @click="getCancel" v-if="moduleType !== 4">取消</el-button> <el-button @click="getCancel" v-if="moduleType !== 4">取消</el-button>
<el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button> <el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button>
</template> </template>
<template v-else-if="otherType === 3 && moduleType !== 2"> <template v-else-if="otherType === 3 && moduleType !== 2 && !detail">
<el-button @click="goBack">取消</el-button> <el-button @click="goBack">取消</el-button>
<el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button> <el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button>
</template> </template>
...@@ -411,6 +411,11 @@ export default { ...@@ -411,6 +411,11 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
// 是否为详情页面
detail: {
type: Boolean,
default: false,
},
}, },
watch: { watch: {
baseData(val) { baseData(val) {
...@@ -586,8 +591,17 @@ export default { ...@@ -586,8 +591,17 @@ export default {
this.talkList = val this.talkList = val
this.$emit('phoneData', this.talkList) this.$emit('phoneData', this.talkList)
}, },
getItemArry(val) { getItemArry(val, length) {
this.talkList = this.talkList.concat(val) this.talkList = this.talkList.concat(val)
if (this.otherType === 3) {
this.maxlength = length
if (this.maxlength === 9) {
this.fontType = '图片类型的附件'
} else {
this.fontType = '其他类型的附件'
}
}
// 当手机为非内嵌时 // 当手机为非内嵌时
this.$emit('phoneData', this.talkList) this.$emit('phoneData', this.talkList)
}, },
...@@ -637,13 +651,22 @@ export default { ...@@ -637,13 +651,22 @@ export default {
// 新建话术 // 新建话术
tackSubmit() { tackSubmit() {
this.talkLoading = true this.talkLoading = true
if ([3, 4].includes(this.moduleType) && !this.talkForm.templateInfo) { if ([3, 4].includes(this.moduleType) && !this.talkForm.templateInfo && this.otherType !== 3) {
this.templateInfo = '请输入' + this.lableOne this.templateInfo = '请输入' + this.lableOne
this.talkLoading = false this.talkLoading = false
return return
} else { } else {
this.templateInfo = '' this.templateInfo = ''
} }
if (this.otherType === 3) {
if (!this.talkForm.templateInfo && !this.talkList.length) {
this.templateInfo = '文本或附件内容至少填写一种'
this.talkLoading = false
return
} else {
this.templateInfo = ''
}
}
if (!this.talkForm.userIds && this.tplType == 2) { if (!this.talkForm.userIds && this.tplType == 2) {
this.userInfo = '请选择员工' this.userInfo = '请选择员工'
this.talkLoading = false this.talkLoading = false
...@@ -856,7 +879,7 @@ export default { ...@@ -856,7 +879,7 @@ export default {
this.talkList = this.baseData.attachments this.talkList = this.baseData.attachments
} }
this.dealType() this.dealType()
if (this.otherType === 3 || this.tplType == 3) { if (this.tplType == 3) {
this.maxlength = 1 this.maxlength = 1
} else { } else {
this.maxlength = 9 this.maxlength = 9
......
...@@ -131,6 +131,11 @@ export default { ...@@ -131,6 +131,11 @@ export default {
this.dialogVisibel = val this.dialogVisibel = val
}, },
}, },
maxlength: {
handler(val) {
this.maxlength2 = val
},
},
}, },
computed: {}, computed: {},
components: { components: {
...@@ -152,6 +157,7 @@ export default { ...@@ -152,6 +157,7 @@ export default {
ids: [], // 选中数组 ids: [], // 选中数组
itemArry: [], // 选中数组 itemArry: [], // 选中数组
inx: 0, inx: 0,
maxlength2: 9, // 最大确认数
} }
}, },
methods: { methods: {
...@@ -208,40 +214,54 @@ export default { ...@@ -208,40 +214,54 @@ export default {
}, },
changeBox(event, obj) { changeBox(event, obj) {
event.preventDefault() event.preventDefault()
this.ids = [] let setStatus = true
this.paneList.forEach((item) => { if (this.isFriends) {
if (item.list && item.list.length) { // 如果是朋友圈的
item.list.forEach((item1) => { this.maxlength2 = 9
this.ids.push(item1) this.paneList.forEach((item, i) => {
}) if (item.list.length > 0 && i !== 0) {
} this.$message.error('仅允许选择一种类型的素材')
}) setStatus = false
if ( return
(this.ids.length + this.talkListLength > this.maxlength || }
this.ids.length + this.talkListLength === this.maxlength) &&
!obj.isCheck
) {
this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材'
)
return
}
obj.isCheck = !obj.isCheck
if (obj.isCheck) {
this.paneList[this.picindex].list.push(obj)
} else {
this.paneList[this.picindex].list = this.paneList[this.picindex].list.filter((list) => {
return list.id !== obj.id
}) })
} }
this.ids = [] if (setStatus) {
this.paneList.forEach((item) => { this.ids = []
if (item.list && item.list.length) { this.paneList.forEach((item) => {
item.list.forEach((item1) => { if (item.list && item.list.length) {
this.ids.push(item1) item.list.forEach((item1) => {
this.ids.push(item1)
})
}
})
if (
(this.ids.length + this.talkListLength > this.maxlength2 ||
this.ids.length + this.talkListLength === this.maxlength2) &&
!obj.isCheck
) {
this.$message.error(
'最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
)
return
}
obj.isCheck = !obj.isCheck
if (obj.isCheck) {
this.paneList[this.picindex].list.push(obj)
} else {
this.paneList[this.picindex].list = this.paneList[this.picindex].list.filter((list) => {
return list.id !== obj.id
}) })
} }
}) this.ids = []
this.paneList.forEach((item) => {
if (item.list && item.list.length) {
item.list.forEach((item1) => {
this.ids.push(item1)
})
}
})
}
}, },
centerCancel() { centerCancel() {
this.dialogVisibel = false this.dialogVisibel = false
...@@ -262,12 +282,12 @@ export default { ...@@ -262,12 +282,12 @@ export default {
this.ids = [] this.ids = []
}, },
centerSubmit() { centerSubmit() {
if (this.ids.length + this.talkListLength > this.maxlength) { if (this.ids.length + this.talkListLength > this.maxlength2) {
this.$message.error('最多新建或选择' + this.maxlength + '个素材') this.$message.error('最多新建或选择' + this.maxlength2 + '个素材')
return return
} else { } else {
this.dialogVisibel = false this.dialogVisibel = false
this.$emit('itemArry', this.ids) this.$emit('itemArry', this.ids, this.maxlength2)
this.$emit('update:choseDialog', this.dialogVisibel) this.$emit('update:choseDialog', this.dialogVisibel)
this.$refs.multipleTable.forEach((item) => { this.$refs.multipleTable.forEach((item) => {
item.clearSelection() item.clearSelection()
...@@ -276,7 +296,21 @@ export default { ...@@ -276,7 +296,21 @@ export default {
this.clearPaneList() this.clearPaneList()
} }
}, },
// 单个选择
handleSelect(select, row) { handleSelect(select, row) {
if (this.isFriends) {
// 如果是朋友圈的
this.maxlength2 = 1
this.paneList.forEach((item, i) => {
if (item.list.length > 0 && i !== +this.index) {
this.$message.error('仅允许选择一种类型的素材')
return
}
})
if (this.paneList[this.index].list.length > 0) {
this.$message.error('除图片素材可选9条数据,其他类型仅可选择一条数据')
}
}
let list = this.paneList[this.index].list let list = this.paneList[this.index].list
let falg = false let falg = false
if (list.length) { if (list.length) {
...@@ -295,13 +329,16 @@ export default { ...@@ -295,13 +329,16 @@ export default {
}) })
} }
this.getIds() this.getIds()
if (this.ids.length + this.talkListLength > this.maxlength) { if (this.ids.length + this.talkListLength > this.maxlength2) {
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( if (!this.isFriends) {
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材' this.$message.error(
) '最多新建或选择' + this.maxlength2 + '个素材,已新建' + 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
}) })
...@@ -309,6 +346,16 @@ export default { ...@@ -309,6 +346,16 @@ export default {
} }
}, },
selectAll(select) { selectAll(select) {
if (this.isFriends) {
// 如果是朋友圈的
this.maxlength2 = 1
// this.paneList.forEach((item, i) => {
// if (item.list.length > 0 && i !== +this.index) {
// this.$message.error('仅允许选择一种类型的素材')
// return
// }
// })
}
if (select.length) { if (select.length) {
// 全选 // 全选
this.paneList[this.index].list = select this.paneList[this.index].list = select
...@@ -317,13 +364,16 @@ export default { ...@@ -317,13 +364,16 @@ export default {
this.paneList[this.index].list = [] this.paneList[this.index].list = []
} }
this.getIds() this.getIds()
if (this.ids.length + this.talkListLength > this.maxlength) { if (this.ids.length + this.talkListLength > this.maxlength2) {
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( if (!this.isFriends) {
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材' this.$message.error(
) '最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
)
}
this.paneList[this.index].list = [] this.paneList[this.index].list = []
this.getIds() this.getIds()
} }
...@@ -338,30 +388,6 @@ export default { ...@@ -338,30 +388,6 @@ export default {
} }
}) })
}, },
// 多选框选中数据
// handleSelectionChange(selection) {
// let list = JSON.parse(JSON.stringify(this.paneList[this.index].list))
// this.paneList[this.index].list = selection
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// if (this.ids.length + this.talkListLength > this.maxlength) {
// this.paneList[this.index].list = list
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// }
// },
// 处理文件类型 // 处理文件类型
filType(file) { filType(file) {
let filecontent = JSON.parse(JSON.stringify(file)) let filecontent = JSON.parse(JSON.stringify(file))
...@@ -385,13 +411,6 @@ export default { ...@@ -385,13 +411,6 @@ export default {
} else { } else {
this.inx = index this.inx = index
} }
// if (this.picindex === 0) {
// // 不包含文本
// this.inx = this.index - 1
// } else if (this.picindex === 1) {
// // 包含文本
// }
}, },
}, },
} }
......
...@@ -62,8 +62,8 @@ let config = { ...@@ -62,8 +62,8 @@ let config = {
services: { services: {
wecom: '/open', wecom: '/open',
system: env.SYSTEM_API, // system: env.SYSTEM_API,
// system: 'http://192.168.4.168:6180', system: 'http://192.168.4.168:6180',
common: '/common', common: '/common',
}, },
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<template #default="{ row }"> <template #default="{ row }">
<el-button text @click="remind(row.id)" v-if="row.status === 2">提醒执行</el-button> <el-button text @click="remind(row.id)" v-if="row.status === 2">提醒执行</el-button>
<el-button text @click="detailFn(row.id)">统计</el-button> <el-button text @click="detailFn(row.id)">统计</el-button>
<el-button text @click="detailFn(row.id)">查看</el-button> <el-button text @click="detailFn(row)">查看</el-button>
<el-button text @click="cease(row.id)" v-if="row.status !== 3">停止</el-button> <el-button text @click="cease(row.id)" v-if="row.status !== 3">停止</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
:defaultValues="userArray" :defaultValues="userArray"
@success="getSelectUser" @success="getSelectUser"
></SelectUser> ></SelectUser>
<el-dialog title="详情" v-model="detailDialogVisible" width="40%"> <!-- <el-dialog title="详情" v-model="detailDialogVisible" width="40%">
<el-form label-position="right" label-width="100px"> <el-form label-position="right" label-width="100px">
<span style="margin-left: 40px; font-size: 16px">内容:</span> <span style="margin-left: 40px; font-size: 16px">内容:</span>
<template v-for="(data, index) in detail.otherContent" :key="index"> <template v-for="(data, index) in detail.otherContent" :key="index">
...@@ -164,12 +164,12 @@ ...@@ -164,12 +164,12 @@
</span> </span>
</template> </template>
</el-form> </el-form>
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import { getEnterpriceList, syncHMoments, getDetail, cancelMoments } from '@/api/circle' import { getEnterpriceList, syncHMoments, cancelMoments, reminderMoments } from '@/api/circle'
export default { export default {
name: 'enterprise', name: 'enterprise',
components: {}, components: {},
...@@ -192,8 +192,8 @@ export default { ...@@ -192,8 +192,8 @@ export default {
loading: false, loading: false,
tableData: [], tableData: [],
total: 0, total: 0,
detailDialogVisible: false, // detailDialogVisible: false,
detail: {}, // detail: {},
sendType: [ sendType: [
{ label: '企微群发', value: 0 }, { label: '企微群发', value: 0 },
{ label: '成员群发', value: 1 }, { label: '成员群发', value: 1 },
...@@ -233,12 +233,19 @@ export default { ...@@ -233,12 +233,19 @@ export default {
break break
} }
}, },
remind() { remind(id) {
this.$confirm('提醒执行将针对本任务未执行的成员再次催促执行,是否确认提醒?', '提示', { this.$confirm('提醒执行将针对本任务未执行的成员再次催促执行,是否确认提醒?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
}) })
.then(() => {}) .then(() => {
reminderMoments(id).then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg)
this.getList()
}
})
})
.catch(() => {}) .catch(() => {})
}, },
cease(id) { cease(id) {
...@@ -274,13 +281,34 @@ export default { ...@@ -274,13 +281,34 @@ export default {
this.query.executeEndTime = '' this.query.executeEndTime = ''
} }
}, },
detailFn(id) { detailFn(row) {
this.detailDialogVisible = true let type = '' // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
getDetail(id).then((dd) => { if (row.isLwPush === 1) {
if (dd.code === 200) { // 非同步型
this.detail = dd.data type = 1
} else if (row.isLwPush === 0) {
// 同步型
if (row.type === 0) {
// 企业同步型
type = 2
} else if (row.type === 1) {
// 个人同步型
type = 3
} }
}
this.$router.push({
path: '/customerMaintain/friendCircle/publish',
query: {
type,
id: row.id,
},
}) })
// this.detailDialogVisible = true
// getDetail(id).then((dd) => {
// if (dd.code === 200) {
// this.detail = dd.data
// }
// })
}, },
syncFn() { syncFn() {
syncHMoments(2).then((res) => { syncHMoments(2).then((res) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!