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,
}) })
} }
...@@ -63,3 +63,10 @@ export function numMoments(data) { ...@@ -63,3 +63,10 @@ export function numMoments(data) {
data: data, data: data,
}) })
} }
// 朋友圈 提醒执行
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,6 +214,19 @@ export default { ...@@ -208,6 +214,19 @@ export default {
}, },
changeBox(event, obj) { changeBox(event, obj) {
event.preventDefault() event.preventDefault()
let setStatus = true
if (this.isFriends) {
// 如果是朋友圈的
this.maxlength2 = 9
this.paneList.forEach((item, i) => {
if (item.list.length > 0 && i !== 0) {
this.$message.error('仅允许选择一种类型的素材')
setStatus = false
return
}
})
}
if (setStatus) {
this.ids = [] this.ids = []
this.paneList.forEach((item) => { this.paneList.forEach((item) => {
if (item.list && item.list.length) { if (item.list && item.list.length) {
...@@ -217,12 +236,12 @@ export default { ...@@ -217,12 +236,12 @@ export default {
} }
}) })
if ( if (
(this.ids.length + this.talkListLength > this.maxlength || (this.ids.length + this.talkListLength > this.maxlength2 ||
this.ids.length + this.talkListLength === this.maxlength) && this.ids.length + this.talkListLength === this.maxlength2) &&
!obj.isCheck !obj.isCheck
) { ) {
this.$message.error( this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材' '最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
) )
return return
} }
...@@ -242,6 +261,7 @@ export default { ...@@ -242,6 +261,7 @@ export default {
}) })
} }
}) })
}
}, },
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)
}) })
if (!this.isFriends) {
this.$message.error( this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材' '最多新建或选择' + 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)
}) })
if (!this.isFriends) {
this.$message.error( this.$message.error(
'最多新建或选择' + this.maxlength + '个素材,已新建' + this.talkListLength + '个素材' '最多新建或选择' + 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) => {
......
...@@ -2,7 +2,13 @@ ...@@ -2,7 +2,13 @@
<div> <div>
<el-row :gutter="10" type="flex" style="margin-top: 10px"> <el-row :gutter="10" type="flex" style="margin-top: 10px">
<el-col> <el-col>
<el-form label-width="110px" label-position="right"> <el-form
label-width="110px"
label-position="right"
:model="form"
:rules="rules"
ref="ruleForm"
>
<div class="g-card"> <div class="g-card">
<el-form-item label="任务名称:" prop="name"> <el-form-item label="任务名称:" prop="name">
<el-input <el-input
...@@ -10,10 +16,11 @@ ...@@ -10,10 +16,11 @@
placeholder="请输入任务名称" placeholder="请输入任务名称"
maxlength="20" maxlength="20"
show-word-limit show-word-limit
:disabled="firendId"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发送方式:" prop="sendType"> <el-form-item label="发送方式:" prop="sendType">
<el-radio-group v-model="form.sendType"> <el-radio-group v-model="form.sendType" :disabled="firendId">
<el-radio :label="0" <el-radio :label="0"
>企微群发 >企微群发
<el-popover placement="top" trigger="hover"> <el-popover placement="top" trigger="hover">
...@@ -27,7 +34,7 @@ ...@@ -27,7 +34,7 @@
</div> </div>
</el-popover></el-radio </el-popover></el-radio
> >
<el-radio :label="1" <el-radio :label="2"
>成员群发 >成员群发
<el-popover placement="top" trigger="hover"> <el-popover placement="top" trigger="hover">
<template #reference> <template #reference>
...@@ -41,7 +48,7 @@ ...@@ -41,7 +48,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="发送范围:" required> <el-form-item label="发送范围:" required>
<el-radio-group v-model="form.scopeType"> <el-radio-group v-model="form.scopeType" :disabled="firendId">
<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>
...@@ -54,6 +61,7 @@ ...@@ -54,6 +61,7 @@
@update="getExecuteData" @update="getExecuteData"
:show="true" :show="true"
v-if="form.scopeType === 1" v-if="form.scopeType === 1"
:disabled="firendId"
></SelectMember> ></SelectMember>
</el-form-item> </el-form-item>
<!-- <el-form-item label="选择客户标签" v-if="form.scopeType === 0"> <!-- <el-form-item label="选择客户标签" v-if="form.scopeType === 0">
...@@ -65,7 +73,7 @@ ...@@ -65,7 +73,7 @@
</div> </div>
</el-form-item> --> </el-form-item> -->
<el-form-item label="执行时间:"> <el-form-item label="执行时间:">
<div class="tips"> <div class="tips" v-if="!firendId">
可自由设定该朋友圈任务下发通知的开始时间,如未设置则默认创建时间即开始执行时间 可自由设定该朋友圈任务下发通知的开始时间,如未设置则默认创建时间即开始执行时间
</div> </div>
<el-date-picker <el-date-picker
...@@ -74,48 +82,57 @@ ...@@ -74,48 +82,57 @@
placeholder="选择年月日时分" placeholder="选择年月日时分"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
v-bind="pickerOptions" v-bind="pickerOptions"
:disabled="firendId"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="结束时间:" required> <el-form-item label="结束时间:" prop="executeEndTime">
<div class="tips">朋友圈任务可设置截止时间,则未完成的成员不允许再执行本条任务</div> <div class="tips" v-if="!firendId">
朋友圈任务可设置截止时间,则未完成的成员不允许再执行本条任务
</div>
<el-date-picker <el-date-picker
v-model="form.executeEndTime" v-model="form.executeEndTime"
type="datetime" type="datetime"
placeholder="选择年月日时分" placeholder="选择年月日时分"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
v-bind="pickerOptions" v-bind="pickerOptions"
:disabled="firendId"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="自动标签:"> <el-form-item label="自动标签:">
<div class="tips">可根据客户的点赞或评论行为分别打上对应标签</div> <div class="tips">可根据客户的点赞或评论行为分别打上对应标签</div>
<div>点赞自动打标签:</div> <div>点赞自动打标签:</div>
<div v-if="likeTagList.length">
<el-tag sizi="mini" v-for="(unit, key) in likeTagList" :key="key">{{ <el-tag sizi="mini" v-for="(unit, key) in likeTagList" :key="key">{{
unit.name unit.name
}}</el-tag> }}</el-tag>
<div> </div>
<div class="tips" v-if="!likeTagList.length && firendId">未选择标签</div>
<div v-if="!firendId">
<el-button type="primary" plain @click="selectedFn">选择标签</el-button> <el-button type="primary" plain @click="selectedFn">选择标签</el-button>
</div> </div>
<div class="mt10">评论自动打标签:</div> <div class="mt10">评论自动打标签:</div>
<div> <div v-if="commentTagList.length">
<el-tag sizi="mini" v-for="(unit, key) in commentTagList" :key="key">{{ <el-tag sizi="mini" v-for="(unit, key) in commentTagList" :key="key">{{
unit.name unit.name
}}</el-tag> }}</el-tag>
</div> </div>
<div class="tips" v-if="!commentTagList.length && firendId">未选择标签</div>
<div> <div v-if="!firendId">
<el-button type="primary" plain @click="selectedFn2">选择标签</el-button> <el-button type="primary" plain @click="selectedFn2">选择标签</el-button>
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
<!-- <FriendCircleContent ref="friendCircleContent" :data="form"></FriendCircleContent> --> <!-- <FriendCircleContent ref="friendCircleContent" :data="form"></FriendCircleContent> -->
{{firendId}}
<AddMaterial <AddMaterial
:moduleType="4" :moduleType="4"
@update="onBackStep" @update="onBackStep"
@submit="submit" @submit="submit"
:otherType="3" :otherType="3"
:showPhone="false" :showPhone="false"
:detail="firendId !== undefined"
></AddMaterial> ></AddMaterial>
<!-- <el-form-item label-width="0" style="margin-top: 20px; margin-bottom: 0"> <!-- <el-form-item label-width="0" style="margin-top: 20px; margin-bottom: 0">
...@@ -146,9 +163,10 @@ ...@@ -146,9 +163,10 @@
</template> </template>
<script> <script>
import { addMoments, numMoments } from '@/api/circle' import { addMoments, numMoments, getDetail } 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'
import moment from 'moment'
export default { export default {
name: 'publish-detail', name: 'publish-detail',
...@@ -194,14 +212,38 @@ export default { ...@@ -194,14 +212,38 @@ export default {
posts: [], posts: [],
customerTag: [], customerTag: [],
}, },
rules: {
name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
sendType: [{ required: true, message: '请选择发送方式', trigger: 'change' }],
executeEndTime: [
{ type: 'date', required: true, message: '请选择结束时间', trigger: 'change' },
],
},
firendId: undefined,
} }
}, },
mounted() { mounted() {
this.firendId = this.$route.query.id
this.firendType = this.$route.query.type
if (this.firendId) {
// 详情页面
this.getDetail(this.firendId)
} else {
// 新增页面
let form = {} let form = {}
form.scopeType = 0 form.scopeType = 0
this.getNumMoments(form) this.getNumMoments(form)
}
}, },
methods: { methods: {
// 获取页面详情
getDetail(id) {
getDetail(id)
.then((res) => {
console.log(231, res)
})
.catch()
},
// 获取可见客户数 // 获取可见客户数
getNumMoments(data) { getNumMoments(data) {
numMoments(data) numMoments(data)
...@@ -216,7 +258,6 @@ export default { ...@@ -216,7 +258,6 @@ export default {
let form = data let form = data
form.scopeType = 1 form.scopeType = 1
this.getNumMoments(form) this.getNumMoments(form)
console.log(174, data)
this.addWeUser = data this.addWeUser = data
}, },
selectedFn() { selectedFn() {
...@@ -233,9 +274,9 @@ export default { ...@@ -233,9 +274,9 @@ export default {
this.likeTagList = data this.likeTagList = data
}, },
submitSelectTag2(data) { submitSelectTag2(data) {
this.form.commentTagList = [] this.form.commentTagIds = []
data.forEach((el) => { data.forEach((el) => {
this.form.commentTagList.push(el.tagId) this.form.commentTagIds.push(el.tagId)
}) })
this.commentTagList = data this.commentTagList = data
}, },
...@@ -265,11 +306,26 @@ export default { ...@@ -265,11 +306,26 @@ export default {
}, },
submit(data) { submit(data) {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
if (this.form.scopeType === 1) {
if (
this.addWeUser.userIds.length ||
this.addWeUser.posts.length ||
this.addWeUser.deptIds.length ||
this.addWeUser.customerTag.length
) {
this.form = Object.assign(this.form, this.addWeUser)
} else {
this.msgError('请选择按条件筛选时的发送范围!')
return false
}
}
this.form.materialIds = [] this.form.materialIds = []
data.attachments.forEach((item) => { data.attachments.forEach((item) => {
this.form.materialIds.push(item.materialId) this.form.materialIds.push(item.materialId)
}) })
// this.form.content = data.templateInfo this.form.content = data.templateInfo
// if (data.attachments.length !== 0) { // if (data.attachments.length !== 0) {
// this.form.contentType = 'link' // this.form.contentType = 'link'
// this.form.realType = data.attachments[0].realType // this.form.realType = data.attachments[0].realType
...@@ -292,7 +348,19 @@ export default { ...@@ -292,7 +348,19 @@ export default {
// }) // })
// .join(',') // .join(',')
// } // }
console.log(this.form) if (this.form.executeTime) {
let time = this.form.executeTime.getTime()
let time2 = Date.now()
if (time2 > time) {
this.msgError('执行时间不可早于当前日期!')
return false
}
this.form.executeTime = moment(this.form.executeTime).format('YYYY-MM-DD HH:mm')
} else {
this.form.executeTime = ''
}
this.form.executeEndTime = moment(this.form.executeEndTime).format('YYYY-MM-DD HH:mm')
console.log(304, this.form)
addMoments(this.form).then((res) => { addMoments(this.form).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.msgSuccess('操作成功') this.msgSuccess('操作成功')
...@@ -300,6 +368,10 @@ export default { ...@@ -300,6 +368,10 @@ export default {
} }
}) })
// } // }
} else {
return false
}
})
}, },
filPicType(file) { filPicType(file) {
let filecontent = JSON.parse(JSON.stringify(file)) let filecontent = JSON.parse(JSON.stringify(file))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!