Commit 7d52864b by 怪兽?别跑

Merge branch 'dev-jpk' into vue3-master

2 parents ac3454bc 765c4bb3
...@@ -70,7 +70,11 @@ ...@@ -70,7 +70,11 @@
redemptionRule: '', redemptionRule: '',
weUserId: '', weUserId: '',
userName: '' userName: ''
} },
activeTitle: '',
activeDescr: '',
activeCoverType: 1,
activeCoverUrl: ''
} }
} }
}, },
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
width="55" width="55"
align="center" align="center"
fixed="left" fixed="left"
:selectable="selectable"></el-table-column> :selectable="selectable"
></el-table-column>
<el-table-column prop="fassionName" label="任务名称" align="center" width="120" fixed="left"></el-table-column> <el-table-column prop="fassionName" label="任务名称" align="center" width="120" fixed="left"></el-table-column>
<el-table-column prop="statusType" label="任务状态" align="center" width="100"> <el-table-column prop="statusType" label="任务状态" align="center" width="100">
<template #default="{ row }"> <template #default="{ row }">
...@@ -103,7 +104,8 @@ ...@@ -103,7 +104,8 @@
<el-button <el-button
text text
v-if="row.fassionState == 1" v-if="row.fassionState == 1"
@click="$router.push({ path: './add', query: { id: row.id } })"> @click="$router.push({ path: './add', query: { id: row.id } })"
>
编辑 编辑
</el-button> </el-button>
<el-button text v-if="row.fassionState !== 2" @click="deleteFn(row)">删除</el-button> <el-button text v-if="row.fassionState !== 2" @click="deleteFn(row)">删除</el-button>
...@@ -115,129 +117,130 @@ ...@@ -115,129 +117,130 @@
:total="total" :total="total"
v-model:page="query.pageNum" v-model:page="query.pageNum"
v-model:limit="query.pageSize" v-model:limit="query.pageSize"
@pagination="getList" /> @pagination="getList"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getList, deleteFassion, deleteMultFa } from '../taskGroup/api' import { getList, deleteFassion, deleteMultFa } from '../taskGroup/api'
export default { export default {
name: 'task-group-list', name: 'task-group-list',
data() { data() {
return { return {
statusType: [ statusType: [
{ name: '待开始', key: 1 }, { name: '待开始', key: 1 },
{ name: '进行中', key: 2 }, { name: '进行中', key: 2 },
{ name: '已结束', key: 3 }, { name: '已结束', key: 3 }
], ],
query: { query: {
fassionType: 2, //1 任务宝 2群裂变 fassionType: 2, //1 任务宝 2群裂变
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
fassionName: '', fassionName: '',
fassionState: '', fassionState: ''
}, },
total: 0, total: 0,
loading: false, loading: false,
list: [], list: [],
selectList: [], selectList: []
}
},
methods: {
selectable(row, index) {
if (row.fassionState !== 2) {
return true
} }
}, },
setType(data) { methods: {
let str = '' selectable(row, index) {
this.infoType.forEach((dd) => { if (row.fassionState !== 2) {
if (dd.key == data.type) { return true
str = dd.name
}
})
return str
},
setStatus(data) {
let str = ''
this.statusType.forEach((dd) => {
if (dd.key == data.fassionState) {
str = dd.name
} }
}) },
return str setType(data) {
}, let str = ''
getList() { this.infoType.forEach((dd) => {
this.loading = true if (dd.key == data.type) {
getList(this.query).then((res) => { str = dd.name
this.total = Number(res.total) }
this.list = res.rows
this.loading = false
})
},
handleSearch() {
this.query.pageNum = 1
this.getList()
},
resetQuery() {
this.query.pageNum = 1
this.$refs['queryForm'].resetFields()
this.getList()
},
handleSelectionChange(e) {
this.selectList = e.map((dd) => dd.id)
},
deleteFn(data) {
this.$confirm('是否确认删除当前裂变任务?删除后不可撤销,请谨慎操作。', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return deleteFassion(data.id)
}) })
.then(() => { return str
this.handleSearch() },
this.msgSuccess('删除成功') setStatus(data) {
let str = ''
this.statusType.forEach((dd) => {
if (dd.key == data.fassionState) {
str = dd.name
}
}) })
}, return str
deleteMult() { },
if (!this.selectList.length) { getList() {
this.msgInfo('请选择要删除项!') this.loading = true
return getList(this.query).then((res) => {
} this.total = Number(res.total)
const ids = this.selectList.join(',') this.list = res.rows
this.$confirm('是否确认删除当前裂变任务?删除后不可撤销,请谨慎操作。', '警告', { this.loading = false
confirmButtonText: '确定', })
cancelButtonText: '取消', },
type: 'warning', handleSearch() {
}) this.query.pageNum = 1
.then(() => { this.getList()
return deleteMultFa(ids) },
resetQuery() {
this.query.pageNum = 1
this.$refs['queryForm'].resetFields()
this.getList()
},
handleSelectionChange(e) {
this.selectList = e.map((dd) => dd.id)
},
deleteFn(data) {
this.$confirm('是否确认删除当前裂变任务?删除后不可撤销,请谨慎操作。', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}) })
.then(() => { .then(() => {
this.handleSearch() return deleteFassion(data.id)
this.msgSuccess('删除成功') })
.then(() => {
this.handleSearch()
this.msgSuccess('删除成功')
})
},
deleteMult() {
if (!this.selectList.length) {
this.msgInfo('请选择要删除项!')
return
}
const ids = this.selectList.join(',')
this.$confirm('是否确认删除当前裂变任务?删除后不可撤销,请谨慎操作。', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}) })
.catch(function () {}) .then(() => {
return deleteMultFa(ids)
})
.then(() => {
this.handleSearch()
this.msgSuccess('删除成功')
})
.catch(function () {})
}
}, },
}, created() {
created() { this.getList()
this.getList() this.$store.setBusininessDesc(
this.$store.setBusininessDesc( `
`
<div>通过任务形式,引导老客裂变新客加群,实现客群增长</div> <div>通过任务形式,引导老客裂变新客加群,实现客群增长</div>
`, `
) )
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.self_a { .self_a {
color: var(--color); color: var(--color);
text-decoration: underline; text-decoration: underline;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
}
} }
}
</style> </style>
...@@ -70,7 +70,11 @@ ...@@ -70,7 +70,11 @@
redemptionRule: '', redemptionRule: '',
weUserId: '', weUserId: '',
userName: '' userName: ''
} },
activeTitle: '',
activeDescr: '',
activeCoverType: 1,
activeCoverUrl: ''
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!