浏览代码

Merge branch 'master' of http://106.55.241.82:3000/lzf/zhbsq-vue-web

Sanmu8 1 年之前
父节点
当前提交
e437d12c74

+ 2 - 2
src/api/portal/COUNSELINGMESSAGE/COUNSELINGMESSAGE.js

@@ -61,10 +61,10 @@ export function upload(data) {
 }
 
 // 提交审核   暂存提交  驳回提交   新增新闻都需要调用这个
-export function newCommit(CbNewsVo) {
+export function newCommit(data) {
   return request({
     url: '/COUNSELINGMESSAGE/audit/',
     method: 'post',
-    data:CbNewsVo
+    data:data
   })
 }

+ 4 - 6
src/views/COUNSELINGMESSAGE/edit.vue

@@ -5,7 +5,7 @@
         <el-input v-model="form.title" placeholder="请输入标题"></el-input>
       </el-form-item>
       <el-form-item label="图片上传">
-        <cropper v-model="form.fileUrl"></cropper>
+        <cropper v-model="form.fileUrl" :fixed_number="[4, 2]"></cropper>
       </el-form-item>
       <el-form-item label="内容" prop="content">
         <editor v-model="form.content" />
@@ -66,9 +66,6 @@ export default {
     if (this.param.id) {
       getCOUNSELINGMESSAGE(this.param.id).then(response => {
         this.form = response.data;
-        // if (this.form.fileUrl != null){
-        //   this.fileList.push({ name: 'xxx', url: this.form.fileUrl });
-        // }
         this.form.content = response.data.content.replace(new RegExp('/profile/upload/', 'g'), this.baseUrl + '/profile/upload/');
       });
     }
@@ -115,7 +112,7 @@ export default {
               this.$layer.close(this.layerid);
               this.$parent.getList();
             });
-          } else if (this.form.status == 0 || this.form.status == 2 || this.form.status == 3 || this.form.status == 5) {
+          } else if (this.form.status == 0 || this.form.status == 2 || this.form.status == 3 || this.form.status == 5 ||this.form.status == 2) {
             updateCOUNSELINGMESSAGE(this.form).then(response => {
               this.$modal.msgSuccess('修改成功');
               this.$layer.close(this.layerid);
@@ -130,7 +127,8 @@ export default {
       this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateCOUNSELINGMESSAGE(this.form).then(response => {
+            this.form.status = '1';
+            newCommit(this.form).then(response => {
               this.$modal.msgSuccess('修改成功');
               this.$layer.close(this.layerid);
               this.$parent.getList();

+ 23 - 14
src/views/COUNSELINGMESSAGE/index.vue

@@ -46,22 +46,23 @@
       </el-table-column>
       <el-table-column label="信息状态" align="center" prop="status">
         <template slot-scope="scope">
-          <span v-if="scope.row.status == 0"><el-tag>草稿</el-tag></span>
+          <span v-if="scope.row.status == 0"><el-tag type="info">草稿</el-tag></span>
           <span v-if="scope.row.status == 1"><el-tag type="warning">审核中</el-tag></span>
           <span v-if="scope.row.status == 2"><el-tag type="danger">审核驳回</el-tag></span>
           <span v-if="scope.row.status == 3"><el-tag type="success">已审核</el-tag></span>
           <span v-if="scope.row.status == 4"><el-tag type="success">已上报</el-tag></span>
-          <span v-if="scope.row.status == 5"><el-tag type="info">已发布</el-tag></span>
-          <span v-if="scope.row.status == 6"><el-tag>已下架</el-tag></span>
+          <span v-if="scope.row.status == 5"><el-tag>已发布</el-tag></span>
+          <span v-if="scope.row.status == 6"><el-tag type="info">已下架</el-tag></span>
         </template>
       </el-table-column>
 
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button v-if="scope.row.status == 4" size="mini" type="text"  @click="handleDownOrUp(scope.row)" v-hasPermi="['business:COUNSELINGMESSAGE:remove']">下架</el-button>
-          <el-button v-if="scope.row.status == 0 || scope.row.status == 2" size="mini" type="text" v-hasPermi="['business:COUNSELINGMESSAGE:remove']" @click="handleCommit(scope.row)">提交审核</el-button>
-          <el-button v-if="scope.row.status == 0 || scope.row.status == 2 || scope.row.status == 5" size="mini" type="text" @click="handleUpdate(scope.row)" v-hasPermi="['business:COUNSELINGMESSAGE:remove']">修改</el-button>
-          <el-button v-if="scope.row.status == 5 || scope.row.status == 3" size="mini" type="text" @click="handleDownOrUp(scope.row)" v-hasPermi="['business:COUNSELINGMESSAGE:remove']">发布</el-button>
+          <el-button v-if="scope.row.status == 5" size="mini" type="text"  @click="handleDownOrUp(scope.row)">下架</el-button>
+          <el-button v-if="scope.row.status == 0 || scope.row.status == 2" size="mini" type="text" @click="handleCommit(scope.row)">提交审核</el-button>
+          <el-button v-if="scope.row.status == 3" size="mini" type="text"  @click="handleDownOrUp(scope.row)">上报</el-button>
+          <el-button v-if="scope.row.status == 6 || scope.row.status == 4" size="mini" type="text" @click="handleDownOrUp(scope.row)">发布</el-button>
+          <el-button v-if="scope.row.status == 0 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4 || scope.row.status == 5 || scope.row.status == 6" size="mini" type="text" @click="handleUpdate(scope.row)">修改</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -92,8 +93,9 @@ export default {
         { label: '审核中', value: 1 },
         { label: '审核驳回', value: 2 },
         { label: '已审核', value: 3 },
-        { label: '已发布', value: 4 },
-        { label: '已下架', value: 5 },
+        { label: '已上报', value: 4 },
+        { label: '已发布', value: 5 },
+        { label: '已下架', value: 6 },
       ],
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
@@ -157,23 +159,30 @@ export default {
     /** 发布 */
     handleDownOrUp(row) {
       //修改发布、下架状态
-
-      if (row.status == '4' || row.status == '3') {
+      if (row.status == '5') {
         //已发布 已审核
-        row.status = '5';
+        row.status = '6';
         updateCOUNSELINGMESSAGE(row).then(response => {
           this.$modal.msgSuccess('下架成功');
           this.open = false;
           this.getList();
         });
-      } else if (row.status == '5') {
+      } else if (row.status == '4'|| row.status == '6') {
         //已下架
-        row.status = '4';
+        row.status = '5';
         updateCOUNSELINGMESSAGE(row).then(response => {
           this.$modal.msgSuccess('发布成功');
           this.open = false;
           this.getList();
         });
+      } else if (row.status == '3') {
+        //已上报
+        row.status = '4';
+        updateCOUNSELINGMESSAGE(row).then(response => {
+          this.$modal.msgSuccess('上报成功');
+          this.open = false;
+          this.getList();
+        });
       }
     },
     /** 提交审核 */

+ 39 - 7
src/views/COUNSELINGMESSAGE/task/index.vue

@@ -20,12 +20,28 @@
 
         <el-form ref="form" :model="taskList" label-width="80px" style="margin-top: 20px">
           <el-form-item label="标题" prop="title">{{ taskList.formobj.title }}</el-form-item>
-          <el-form-item label="附件上传" prop="fileUrl">
-            <el-upload class="upload-demo" drag action="#" :limit="1" :auto-upload="true" :disabled="true">
-              <i class="el-icon-upload"></i>
-              <div class="el-upload__text">
-                将文件拖到此处,或
-                <em>点击上传</em>
+          <el-form-item label="图片" prop="fileUrl" disabled>
+            <el-upload
+              action="#"
+              list-type="picture-card"
+              :limit="1"
+              :auto-upload="false"
+              :file-list="fileList"
+              :disabled="true"
+            >
+              <i slot="default" class="el-icon-plus"></i>
+              <div slot="file" slot-scope="{ file }">
+                <img class="el-upload-list__item-thumbnail" :src="file.url" />
+
+                <!-- 放大预览 -->
+                <span class="el-upload-list__item-actions">
+                  <span
+                    class="el-upload-list__item-preview"
+                    @click="handlePictureCardPreview(file)"
+                  >
+                    <i class="el-icon-zoom-in"></i>
+                  </span>
+                </span>
               </div>
             </el-upload>
           </el-form-item>
@@ -55,6 +71,7 @@
 export default {
   data() {
     return {
+      baseURL: process.env.VUE_APP_BASE_API,
       activeName: '详细信息',
       fileList: [],
       BigImgVisible: false
@@ -63,8 +80,23 @@ export default {
   props: ['taskList'],
   created() {
     if (this.taskList.formobj.fileUrl) {
-      this.fileList.push({ name: 'xxx', url: this.taskList.formobj.fileUrl });
+      this.fileList.push({
+        url: this.baseURL + this.taskList.formobj.fileUrl,
+        name: "xxx",
+      });
     }
+    console.log('1231132',this.taskList.formobj);
+  },
+  watch: {
+    taskList(curVal, oldVal) {
+      if (curVal) {
+        this.fileList.pop();
+        this.fileList.push({
+          url: this.baseURL + curVal.formobj.fileUrl,
+          name: "xxx",
+        });
+      }
+    },
   },
   methods: {
     handlePictureCardPreview(file) {