소스 검색

状态操作修改

htc 6 일 전
부모
커밋
295c178ac3
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      src/views/modules/activity/list.vue

+ 9 - 6
src/views/modules/activity/list.vue

@@ -46,7 +46,7 @@
               </el-table-column>
               <el-table-column prop="" label="报名人数" width="100">
                 <template #default="scope">
-                  <div class="adfac"><span style="color: #00AE57;">{{ scope.row.signedNumber||0 }}</span>/{{ scope.row.recruitmentMax||'无限制' }}</div>
+                  <div class="adfac"><span style="color: #00AE57;">{{ scope.row.recruitmentNow||0 }}</span>/{{ scope.row.recruitmentMax||'无限制' }}</div>
                 </template>
               </el-table-column>
               <el-table-column prop="" label="上下架" width="100">
@@ -60,15 +60,17 @@
                   <div class="as" :class="{'jxz':scope.row.activeState==2}">{{ activeStateCfg[scope.row.activeState] || '未知' }}</div>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="250" fixed="right">
+              <el-table-column label="操作" width="270" fixed="right">
                   <template #default="scope">
-                      <el-button link type="text" @click="handleEdit(scope.row)" v-if="scope.row.activeState!=3&&$hasPermission('core:activity:update')">编辑</el-button>
+                      <!-- <el-button link type="text" @click="handleEdit(scope.row)" v-if="scope.row.activeState!=3&&$hasPermission('core:activity:update')">编辑</el-button> -->
+                      <el-button link type="text" @click="handleEdit(scope.row)" v-if="$hasPermission('core:activity:update')">编辑</el-button>
                       <el-button link type="text" @click="handleInfo(scope.row)" v-if="scope.row.activeState!=0&&$hasPermission('core:activity:info')">报名信息</el-button>
                       <el-button link type="text" @click="handleCode(scope.row)" v-if="!scope.row.signCode&&scope.row.activeState==2&&$hasPermission('core:activity:code')">生成签到码</el-button>
                       <el-button link type="text" @click="handleReviewCode(scope.row)" v-if="scope.row.signCode&&scope.row.activeState==2&&$hasPermission('core:activity:code')">查看签到码</el-button>
-                      <el-button link type="text" @click="handleUpDown(scope.row,0)" v-if="scope.row.state==1&&(scope.row.activeState==0||scope.row.activeState==3)&&$hasPermission('core:activity:updown')">下架</el-button>
-                      <el-button link type="text" @click="handleUpDown(scope.row,1)" v-if="scope.row.state==0&&scope.row.activeState==0&&$hasPermission('core:activity:updown')">上架</el-button>
-                      <el-button link type="text" @click="handleDelete(scope.row)" v-if="$hasPermission('core:activity:delete')&&(scope.row.state==0||scope.row.activeState==0||scope.row.activeState==3)">删除</el-button>
+                      <!-- <el-button link type="text" @click="handleUpDown(scope.row,0)" v-if="scope.row.state==1&&(scope.row.activeState==0||scope.row.activeState==3)&&$hasPermission('core:activity:updown')">下架</el-button> -->
+                      <el-button link type="text" @click="handleUpDown(scope.row,0)" v-if="scope.row.state==1&&$hasPermission('core:activity:updown')">下架</el-button>
+                      <el-button link type="text" @click="handleUpDown(scope.row,1)" v-if="scope.row.state==0&&$hasPermission('core:activity:updown')">上架</el-button>
+                      <el-button link type="text" @click="handleDelete(scope.row)" v-if="$hasPermission('core:activity:delete')&&scope.row.state==0&&scope.row.activeState==0">删除</el-button>
                   </template>
               </el-table-column>
             </el-table>
@@ -211,6 +213,7 @@ export default {
       this.show = false
     },
     handleUpDown (row, state) {
+      if (row.recruitmentNow > 0) return this.$message.error('当前活动已存在报名人数,无法下架')
       this.$confirm(`是否确认${state ? '上架' : '下架'}活动【${row.activityName}】?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',