|
|
@@ -28,18 +28,22 @@
|
|
|
|
|
|
<el-table-column align="center" min-width="80px" label="类型" prop="typeName">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="150px" label="积分" prop="integral">
|
|
|
+ <el-table-column align="center" min-width="80px" label="积分" prop="integral">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="80px" label="截止日期" prop="deadline">
|
|
|
+ <el-table-column align="center" min-width="100px" label="截止日期" prop="deadline">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="100px" label="创建日期" prop="createTime">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="状态" prop="statusName">
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
- <!-- <el-button v-if="scope.row.status == 0" type="success" size="small"
|
|
|
- @click="changeState(scope.row.welfareId, 1)">开启</el-button>
|
|
|
+ <el-button v-if="scope.row.status == 0" type="success" size="small"
|
|
|
+ @click="changeState(scope.row.id, 1)">开启</el-button>
|
|
|
<el-button v-if="scope.row.status == 1" type="warning" size="small"
|
|
|
- @click="changeState(scope.row.welfareId, 0)">关闭</el-button> -->
|
|
|
- <el-button type="danger" size="small" @click="handleDelete(scope.row.welfareId, -1)">删除</el-button>
|
|
|
+ @click="changeState(scope.row.id, 0)">关闭</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="handleDelete(scope.row.postId, -1)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -138,7 +142,7 @@
|
|
|
</style>
|
|
|
|
|
|
<script>
|
|
|
-import { create, update, getList, changeState } from "@/api/postManage";
|
|
|
+import { create, update, getList, changeState, getDetailInfo } from "@/api/postManage";
|
|
|
import { allUserList } from "@/api/public";
|
|
|
import waves from "@/directive/waves"; // 水波纹指令
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
@@ -313,12 +317,12 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getAllUserList();
|
|
|
- // this.getList();
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
//改变类型
|
|
|
changeType(val){
|
|
|
- if(val==4){
|
|
|
+ if(val==5){
|
|
|
this.qesTypeList = [
|
|
|
{
|
|
|
value:'SCQ',
|
|
|
@@ -334,7 +338,7 @@ export default {
|
|
|
},
|
|
|
];
|
|
|
}
|
|
|
- if(val==5){
|
|
|
+ if(val==4){
|
|
|
this.qesTypeList = [
|
|
|
{
|
|
|
value:'SCQ',
|
|
|
@@ -432,46 +436,31 @@ export default {
|
|
|
let ifnone_data = this.ifnone_data();
|
|
|
if (valid&&ifnone_data==200) {
|
|
|
console.log(this.dataForm);
|
|
|
- // create(this.dataForm)
|
|
|
- // .then((response) => {
|
|
|
- // this.getList();
|
|
|
- // this.dialogFormVisible = false;
|
|
|
- // this.$notify({
|
|
|
- // title: "成功",
|
|
|
- // message: "创建成功",
|
|
|
- // type: "success",
|
|
|
- // duration: 2000,
|
|
|
- // });
|
|
|
- // this.getList();
|
|
|
- // })
|
|
|
- // .catch(() => { });
|
|
|
+ create(this.dataForm)
|
|
|
+ .then((response) => {
|
|
|
+ this.getList();
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.$notify({
|
|
|
+ title: "成功",
|
|
|
+ message: "创建成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
}else{
|
|
|
this.$message.error(ifnone_data);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
handleUpdate(row) {
|
|
|
- this.dataForm = Object.assign({}, row);
|
|
|
- let content = this.dataForm.content;
|
|
|
- if (this.dataForm.imgUrl) {
|
|
|
- let images = this.dataForm.imgUrl.split(",");
|
|
|
- this.dataForm.images = [];
|
|
|
- for (let i in images) {
|
|
|
- let url = images[i];
|
|
|
- let name = "image_" + i;
|
|
|
-
|
|
|
- this.dataForm.images.push({
|
|
|
- name: name,
|
|
|
- url: url,
|
|
|
- response: { error: "0", data: { url: url } },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- this.dialogStatus = 'update'
|
|
|
- this.dialogFormVisible = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['dataForm'].clearValidate()
|
|
|
- })
|
|
|
+ getDetailInfo({postId:row.id}).then(response => {
|
|
|
+ this.dataForm = response.data.data;
|
|
|
+ this.dataForm.questions = response.data.data.data;
|
|
|
+ this.dialogStatus = 'update'
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ }).catch(() => {})
|
|
|
},
|
|
|
updateData() {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
@@ -491,24 +480,24 @@ export default {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
- changeState(welfareId, index) {
|
|
|
- changeState({ welfareId: welfareId, status: index }).then(response => {
|
|
|
+ changeState(postId, index) {
|
|
|
+ changeState({ postId: postId, status: index }).then(response => {
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
|
- message: '福利状态修改成功',
|
|
|
+ message: '状态修改成功',
|
|
|
type: 'success',
|
|
|
duration: 2000
|
|
|
})
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
|
- handleDelete(welfareId, index) {
|
|
|
+ handleDelete(postId, index) {
|
|
|
this.$confirm('确认删除吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- changeState({ welfareId: welfareId, status: index }).then(response => {
|
|
|
+ changeState({ postId: postId, status: index }).then(response => {
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
|
message: '删除成功',
|