Explorar o código

Merge branch 'master' of http://git.cc-lotus.info/count/webnew-count

wuhongyu %!s(int64=5) %!d(string=hai) anos
pai
achega
c7397bfc16
Modificáronse 1 ficheiros con 31 adicións e 4 borrados
  1. 31 4
      src/views/pcenter/parts/infoAdmin.vue

+ 31 - 4
src/views/pcenter/parts/infoAdmin.vue

@@ -29,10 +29,15 @@
               </el-table-column>
               <el-table-column label="操作" align="center" width="220">
                 <template slot-scope="scope">
-                  <el-button size="mini" type="primary" @click="examineBtn(scope.row)" v-if="user.type == '0' || user.type == '1'">审核</el-button>
-                  <el-button size="mini" type="primary" @click="examineBtn(scope.row)">查看</el-button>
+                  <el-button size="mini" @click="examineBtn(scope.row)">查看</el-button>
                   <el-button size="mini" type="success" v-if="scope.row.status == '0'" @click="submitInfo(scope.row)">发布</el-button>
                   <el-button size="mini" type="danger" @click="deleteBtn(scope.row.id)">删除</el-button>
+                  <el-button v-if="user.type === '0' || user.type === '1'" type="success" size="mini" @click="refer(scope.row.id, { status: '2' })"
+                    >审核通过</el-button
+                  >
+                  <el-button v-if="user.type === '0' || user.type === '1'" type="warning" size="mini" @click="refer(scope.row.id, { status: '3' })"
+                    >审核拒绝</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -124,10 +129,10 @@
                 </el-radio-group>
               </el-form-item>
               <el-col :span="24" style="text-align:center;">
-                <el-button type="success" v-if="user.type == '0' || user.type == '1'" @click="examineIn()">审核通过</el-button>
-                <el-button type="danger" v-if="user.type == '0' || user.type == '1'" @click="examineOut()">审核拒绝</el-button>
                 <el-button type="primary" @click="submitDraft('form')">保存</el-button>
                 <el-button type="danger" @click="resetForm('form')">取消</el-button>
+                <el-button type="success" v-if="user.type == '0' || user.type == '1'" @click="examineIn()">审核通过</el-button>
+                <el-button type="danger" v-if="user.type == '0' || user.type == '1'" @click="examineOut()">审核拒绝</el-button>
               </el-col>
             </el-form>
           </el-col>
@@ -211,6 +216,18 @@ export default {
         this.$set(this, `total`, res.total);
       }
     },
+    async refer(id, { status }) {
+      const res = await this.newsUpdate({ id, status });
+      if (res.errcode === 0) {
+        this.$message({
+          message: '信息修改成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息修改失败');
+      }
+    },
     // 添加
     add() {
       this.display = 'detail';
@@ -347,4 +364,14 @@ export default {
     padding: 10px 0;
   }
 }
+.list /deep/.el-button {
+  display: inline-block;
+  height: 30px;
+  width: 47px;
+  text-align: center;
+  line-height: 20px;
+  padding: 0;
+  margin: 5px 1px;
+  font-size: 11px;
+}
 </style>