Commit bd45b149 by test

任务宝状态类型补全;群发附件传参调整

1 parent ced63aee
<script> <script>
import * as api from '@/api/task' import * as api from '@/api/task'
export default { export default {
name: 'Group', name: 'Group',
data() { data () {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
loading: false loading: false
} }
}, },
created() { created () {
this.getList() this.getList()
this.$store.dispatch( this.$store.dispatch(
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
) )
}, },
methods: { methods: {
setChange(e) { setChange (e) {
if (e) { if (e) {
this.query.startTime = e[0] this.query.startTime = e[0]
this.query.overTime = e[1] this.query.overTime = e[1]
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
this.query.overTime = '' this.query.overTime = ''
} }
}, },
resetFn() { resetFn () {
this.query = { this.query = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
this.dateRange = [] this.dateRange = []
this.getList() this.getList()
}, },
getList(data) { getList (data) {
this.loading = true this.loading = true
let params = Object.assign({}, this.query, data) let params = Object.assign({}, this.query, data)
api.getList(params).then(({ rows, total }) => { api.getList(params).then(({ rows, total }) => {
...@@ -60,24 +60,24 @@ export default { ...@@ -60,24 +60,24 @@ export default {
this.loading = false this.loading = false
}) })
}, },
resetForm() {}, resetForm () { },
toDetail(row) { toDetail (row) {
this.$router.push({ this.$router.push({
path: `taskDetail?id=${row.id}` path: `taskDetail?id=${row.id}`
}) })
}, },
newAdd() { newAdd () {
this.$router.push({ this.$router.push({
path: 'addTask' path: 'addTask'
}) })
}, },
toEdit(row) { toEdit (row) {
this.$router.push({ this.$router.push({
path: `addTask?id=${row.id}` path: `addTask?id=${row.id}`
}) })
} }
} }
} }
</script> </script>
<template> <template>
...@@ -87,33 +87,13 @@ export default { ...@@ -87,33 +87,13 @@ export default {
<el-input v-model="query.taskName" placeholder="请输入"></el-input> <el-input v-model="query.taskName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="添加日期"> <el-form-item label="添加日期">
<el-date-picker <el-date-picker v-model="dateRange" @change="setChange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"></el-date-picker>
v-model="dateRange"
@change="setChange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button <el-button v-hasPermi="['customerManage:customer:query']" type="primary" :loading="loading" @click="getList({ pageNum: 1 })">查询</el-button>
v-hasPermi="['customerManage:customer:query']"
type="primary"
:loading="loading"
@click="getList({ pageNum: 1 })"
>查询</el-button
>
<el-button @click="resetFn" type="success">清空</el-button> <el-button @click="resetFn" type="success">清空</el-button>
<el-button <el-button v-hasPermi="['customerManage:customer:query']" type="primary" @click="newAdd()" style="background: #FA7216;color: #FFFFFF;border-color:#FA7216">新增任务</el-button>
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="newAdd()"
style="background: #FA7216;color: #FFFFFF;border-color:#FA7216"
>新增任务</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData"> <el-table :data="tableData">
...@@ -121,7 +101,8 @@ export default { ...@@ -121,7 +101,8 @@ export default {
<el-table-column prop="fissNum" label="裂变客户数量"> </el-table-column> <el-table-column prop="fissNum" label="裂变客户数量"> </el-table-column>
<el-table-column prop="fissStatus" label="活动状态"> <el-table-column prop="fissStatus" label="活动状态">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.fissStatus === 1 ? '进行中' : '已结束' }}</p> <!-- -1-发送失败 0-待发送 1-进行中 2-已结束 -->
<p>{{ scope.row.fissStatus === 1 ? '进行中' : scope.row.fissStatus === -1 ? '发送失败':scope.row.fissStatus === 0 ? '待发送':'已结束' }}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="startTime" label="活动时间"> <el-table-column prop="startTime" label="活动时间">
...@@ -131,32 +112,12 @@ export default { ...@@ -131,32 +112,12 @@ export default {
</el-table-column> </el-table-column>
<el-table-column prop="operation" label="操作" width="120"> <el-table-column prop="operation" label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button @click="toDetail(scope.row)" v-hasPermi="['enterpriseWechat:view']" size="medium" type="text" icon="el-icon-view"></el-button>
@click="toDetail(scope.row)" <el-button v-if="scope.row.fissStatus != 2" @click="toEdit(scope.row)" v-hasPermi="['enterpriseWechat:edit']" size="medium" type="text" icon="el-icon-edit-outline" style="color:#E74E59"></el-button>
v-hasPermi="['enterpriseWechat:view']"
size="medium"
type="text"
icon="el-icon-view"
></el-button>
<el-button
v-if="scope.row.fissStatus != 2"
@click="toEdit(scope.row)"
v-hasPermi="['enterpriseWechat:edit']"
size="medium"
type="text"
icon="el-icon-edit-outline"
style="color:#E74E59"
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" />
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div> </div>
</template> </template>
......
...@@ -341,11 +341,49 @@ ...@@ -341,11 +341,49 @@
} }
return dest return dest
}, },
resetData (list) {
let arr = []
if (list && list.length) {
list.forEach(dd => {
if (dd.msgType === '0') {
let obj = {
msgType: 'image',
picUrl: dd.materialUrl
}
arr.push(obj)
} else if (dd.msgType === '8') {
let ob = {
msgType: 'link',
title: dd.materialName,
linkUrl: dd.materialUrl
}
arr.push(ob)
} else if (dd.msgType === '9') {
let ff = {
msgType: 'miniprogram',
appId: dd.digest,
title: dd.materialName,
picUrl: dd.coverUrl,
linkUrl: dd.materialUrl
}
arr.push(ff)
}
})
}
return arr
},
save (materialData) { save (materialData) {
let data = Object.assign({}, this.form, { console.log(materialData)
let list = this.resetData(materialData.materialMsgList)
let myObj = {
content: materialData.welcomeMsg, content: materialData.welcomeMsg,
attachmentsList: materialData.materialMsgList attachments: [{
}) content: materialData.welcomeMsg,
msgType: 'text'
}]
}
myObj.attachments.push(...list)
let data = Object.assign({}, this.form, myObj)
data.senderList = [] data.senderList = []
data = JSON.parse(JSON.stringify(data)) data = JSON.parse(JSON.stringify(data))
if (data.chatType === 1) { if (data.chatType === 1) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!