sunlupeng 2 лет назад
Родитель
Сommit
870ec5a729

+ 4 - 4
config/dev.env.js

@@ -2,10 +2,10 @@ module.exports = {
 	NODE_ENV: '"development"',
 	ENV_CONFIG: '"dev"',
   // 本地数据库:登录用户名 admin123,密码 admin123
-  // BASE_API: '"http://192.168.100.208:9083/admin"',
-  // OS_API: '"http://192.168.100.208:9083/admin"',
-  BASE_API: '"http://47.103.79.143:9085/admin"',
-  OS_API: '"http://47.103.79.143:9085/admin"',
+  BASE_API: '"http://192.168.100.208:9083/admin"',
+  OS_API: '"http://192.168.100.208:9083/admin"',
+  // BASE_API: '"http://47.103.79.143:9085/admin"',
+  // OS_API: '"http://47.103.79.143:9085/admin"',
   // OS_API: '"https://xiaoyou.dgtis.com/admin"',
   // BASE_API: '"https://xiaoyou.dgtis.com/admin"',
   

+ 11 - 3
src/api/postManage.js

@@ -19,7 +19,7 @@ export function update(query) {
 export function getList(query) {
   return request({
     url: '/mall-post/list',
-    method: 'post',
+    method: 'get',
     params:query
   })
 }
@@ -34,7 +34,15 @@ export function changeState(query) {
 
 export function approvalList(query) {
   return request({
-    url: '/system/dict/type/list',
+    url: '/mall-post/complete/list',
+    method: 'get',
+    params:query
+  })
+}
+
+export function getDetailInfo(query) {
+  return request({
+    url: '/mall-post/answer/info',
     method: 'get',
     params:query
   })
@@ -42,7 +50,7 @@ export function approvalList(query) {
 
 export function complete(data) {
   return request({
-    url: '/mall-train/admin/complete',
+    url: '/mall-post/complete/answer',
     method: 'post',
     data
   })

+ 0 - 1
src/permission.js

@@ -96,7 +96,6 @@ const myRoles = [
 ]
 
 router.beforeEach((to, from, next) => {
-  debugger
   NProgress.start() // start progress bar
   // store.dispatch('SetToken', 'y8evar5b5yecmr6hjrhyokxw5tiqizw9');
   // setToken('y8evar5b5yecmr6hjrhyokxw5tiqizw9');

+ 21 - 25
src/views/postManage/postApprovalList.vue

@@ -14,21 +14,18 @@
         </el-option>
       </el-select>
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
-      <!-- <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button> -->
+      <!-- <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="completeAll">批量审批</el-button> -->
     </div>
 
     <!-- 查询结果 -->
     <el-table size="small" :data="list" @selection-change="handleSelectionChange" v-loading="listLoading"
       element-loading-text="正在查询中。。。" border fit highlight-current-row>
-      <el-table-column type="selection" width="55px"> </el-table-column>
-
-      <el-table-column align="center" min-width="100px" label="部门" prop="deptName">
+      <!-- <el-table-column type="selection" width="55px"> </el-table-column> -->
+      <el-table-column align="center" min-width="100px" label="帖子Id" prop="postId">
       </el-table-column>
-
-
-      <el-table-column align="center" min-width="200px" label="姓名" prop="userName">
+      <el-table-column align="center" min-width="200px" label="部门" prop="deptName">
       </el-table-column>
-      <el-table-column align="center" min-width="100px" label="帖子Id" prop="topicId">
+      <el-table-column align="center" min-width="100px" label="姓名" prop="userName">
       </el-table-column>
       <el-table-column align="center" min-width="200px" label="帖子标题" prop="title">
       </el-table-column>
@@ -38,8 +35,8 @@
       </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="handleView(scope.row)">查看</el-button>
-          <el-button type="success" size="small" @click="handleComplete(scope.row)">处理</el-button>
+          <el-button type="primary" size="small" @click="handleView(scope.row,'view')">查看</el-button>
+          <el-button type="success" size="small" @click="handleView(scope.row,'complete')">处理</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -113,7 +110,7 @@
 </style>
   
 <script>
-import { approvalList, complete } from "@/api/postManage";
+import { approvalList,getDetailInfo,complete } from "@/api/postManage";
 import waves from "@/directive/waves"; // 水波纹指令
 import Tinymce from '@/components/Tinymce'
 
@@ -308,7 +305,7 @@ export default {
     }
   },
   created() {
-    // this.getList();
+    this.getList();
   },
   methods: {
     checked(val){
@@ -324,6 +321,7 @@ export default {
         },
     complete(flag) {
             const parms = {
+                postId:this.postId,
                 comment: this.comment,
                 flag:flag,
             }
@@ -370,17 +368,15 @@ export default {
       this.listQuery.page = val
       this.getList()
     },
-    handleView(row){
-      this.dataForm = Object.assign({}, row);
-      this.dialogStatus = 'view'
-      this.dialogFormVisible = true
-    },
-    handleComplete(row) {
-      this.dataForm = Object.assign({}, row);
-      this.dialogStatus = 'complete'
-      this.dialogFormVisible = true
+    handleView(row,val){
+      this.postId = row.postId,
+      getDetailInfo({postId:row.postId}).then(response => {
+        this.data = response.data.data.data;
+        this.dialogStatus = val;
+        this.dialogFormVisible = true;
+      }).catch(() => {})
     },
-    delAll() {
+    completeAll() {
       this.$confirm("确认删除吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -391,10 +387,10 @@ export default {
 
           if (length > 0) {
             for (let i = 0; i < length; i++) {
-              this.delarr.push(this.multipleSelection[i].dictId);
+              this.delarr.push(this.multipleSelection[i].postId);
             }
-            const dictIds = this.delarr.join(",");
-            deleteitem({ dictIds: dictIds })
+            const postIds = this.delarr.join(",");
+            deleteitem({ postIds: postIds })
               .then(() => {
                 this.$notify({
                   title: "成功",

+ 38 - 49
src/views/postManage/postList.vue

@@ -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: '删除成功',