Эх сурвалжийг харах

+ 实现批量审核功能

chen.cheng 10 сар өмнө
parent
commit
80dc4b78f3

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsUsrApplyController.java

@@ -107,6 +107,18 @@ public class CpsUsrApplyController extends BaseController {
         return toAjax(cpsUsrApplyService.rejectCpsUsrApply(cpsUsrApply));
     }
 
+    @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.UPDATE)
+    @PutMapping("/reject/{ids}")
+    public AjaxResult rejectByIds(@PathVariable("ids") Long[] ids, @RequestBody CpsUsrApply cpsUsrApply) {
+        return toAjax(cpsUsrApplyService.rejectCpsUsrApplyByIds(ids, cpsUsrApply));
+    }
+
+    @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.UPDATE)
+    @PutMapping("/pass/{ids}")
+    public AjaxResult passByIds(@PathVariable("ids") Long[] ids) {
+        return toAjax(cpsUsrApplyService.passCpsUsrApplyByIds(ids));
+    }
+
     /**
      * 删除cps_usr_apply与会申请
      */

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CpsUsrApplyMapper.java

@@ -67,4 +67,8 @@ public interface CpsUsrApplyMapper
      * @return 结果
      */
     public int deleteCpsUsrApplyByIds(Long[] ids);
+
+    int rejectUsrApplyByIds(@Param("ids") Long[] ids, @Param("reviewMsg") String reviewMsg);
+
+    int passUsrApplyByIds(@Param("ids") Long[] ids);
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICpsUsrApplyService.java

@@ -56,6 +56,10 @@ public interface ICpsUsrApplyService
 
     int rejectCpsUsrApply(CpsUsrApply cpsUsrApply);
 
+    int rejectCpsUsrApplyByIds(Long[] ids, CpsUsrApply cpsUsrApply);
+
+    int passCpsUsrApplyByIds(Long[] ids);
+
     /**
      * 批量删除cps_usr_apply与会申请
      *

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CpsUsrApplyServiceImpl.java

@@ -136,6 +136,17 @@ public class CpsUsrApplyServiceImpl implements ICpsUsrApplyService {
         return cpsUsrApplyMapper.updateCpsUsrApply(cpsUsrApply);
     }
 
+
+    @Override
+    public int rejectCpsUsrApplyByIds(Long[] ids, CpsUsrApply cpsUsrApply) {
+        return cpsUsrApplyMapper.rejectUsrApplyByIds(ids, cpsUsrApply.getReviewMsg());
+    }
+
+    @Override
+    public int passCpsUsrApplyByIds(Long[] ids) {
+        return cpsUsrApplyMapper.passUsrApplyByIds(ids);
+    }
+
     /**
      * 批量删除cps_usr_apply与会申请
      *

+ 15 - 0
ruoyi-system/src/main/resources/mapper/cp/CpsUsrApplyMapper.xml

@@ -291,4 +291,19 @@
             #{id}
         </foreach>
     </delete>
+    <update id="rejectUsrApplyByIds" >
+        update cps_usr_apply set review_state = 1, review_msg = #{reviewMsg}
+        where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="passUsrApplyByIds" >
+        update cps_usr_apply set review_state = 0, review_msg = null
+        where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
 </mapper>

+ 15 - 1
ruoyi-ui/src/api/cp/usrApply.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request from '@/utils/request';
 
 // 查询cps_usr_apply与会申请列表
 export function listUsrApply(query) {
@@ -50,3 +50,17 @@ export function delUsrApply(id) {
     method: 'delete'
   })
 }
+
+export const rejectByIds = (ids,data) =>
+  request({
+    url: `cp/usrApply/reject/${ids}`,
+    method: 'put',
+    data: data
+  });
+export const passByIds = (ids,data) =>
+  request({
+    url: `cp/usrApply/pass/${ids}`,
+    method: 'put',
+    data: data
+  });
+

+ 163 - 0
ruoyi-ui/src/utils/EnumConst.js

@@ -0,0 +1,163 @@
+export const COMP_CODE = {
+  index_ctl: 'index_ctl',
+  index_swip: 'index_swip',
+  my: 'my',
+};
+export const ICON_CFG = {
+  file_icon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
+  login_bg: '/profile/upload/2024/08/17/head-bg_20240817230007A002.png',
+};
+
+export const CONTENT_TYPE = {
+  news: 1,
+  conference: 6,
+  theme: 4,
+  conferenceMaterials: 5,
+};
+
+export const MEETING_TYPE = {
+  1: {
+    name: '大会报名',
+    value: '1',
+  },
+  2: {
+    name: '会场调研',
+    value: '2',
+  },
+  3: {
+    name: '主题研讨',
+    value: '3',
+  },
+  meeting: {
+    name: '会议报名',
+    value: '1',
+  },
+  theme: {
+    name: '主题研讨',
+    value: '3',
+  },
+  conference: {
+    name: '会场调研',
+    value: '2',
+  },
+};
+
+export const USR_TYPE_LIST = [
+  {
+    value: '1',
+    name: '大会代表',
+  },
+  {
+    value: '2',
+    name: '随行人员',
+  },
+];
+
+export const USR_TYPE = {
+  1: {
+    name: '大会代表',
+    value: '1',
+  },
+  2: {
+    name: '随行人员',
+    value: '2',
+  },
+
+};
+export const FILE_ICON = {
+  doc: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
+  docx: '/profile/upload/2024/08/20/word_20240820110735A012.svg',
+  xls: '/profile/upload/2024/08/20/excel_20240820110613A006.svg',
+  xlsx: '/profile/upload/2024/08/20/excel_20240820110613A006.svg',
+  txt: '/profile/upload/2024/08/20/text_20240820110711A010.svg',
+  text: '/profile/upload/2024/08/20/text_20240820110711A010.svg',
+  ppt: '/profile/upload/2024/08/20/ppt_20240820110657A009.svg',
+  pptx: '/profile/upload/2024/08/20/ppt_20240820110657A009.svg',
+  pdf: '/profile/upload/2024/08/20/pdf_20240820110643A008.svg',
+  png: '/profile/upload/2024/08/20/image_20240820110632A007.svg',
+  mp4: '/profile/upload/2024/08/20/video_20240820110721A011.svg',
+  defIcon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
+};
+export const SYS_YES_NO = {
+  '0': {
+    name: '是',
+    value: 0,
+  },
+  '1': {
+    name: '否',
+    value: 1,
+  },
+};
+export const REVIEW_STATUS = {
+  '0': {
+    name: '审核通过',
+    value: '0',
+    tag: 'success',
+    tip: 32,
+    color: 'green',
+  },
+  '1': {
+    name: '审核不通过',
+    value: '1',
+    tag: 'error',
+    tip: 33,
+    color: 'red',
+  },
+  '2': {
+    name: '待审核',
+    value: '2',
+    tag: 'warning',
+    color: 'orange',
+  },
+  'pass': {
+    name: '审核通过',
+    value: '0',
+    tag: 'success',
+  },
+  'noPass': {
+    name: '审核不通过',
+    value: '1',
+    tag: 'error',
+  },
+  'wait': {
+    name: '待审核',
+    value: '2',
+    tag: 'warning',
+  },
+};
+
+export const TFC_TYPE = {
+  1: {
+    name: '铁路',
+    value: 1,
+  },
+  2: {
+    name: '航空',
+    value: 2,
+  },
+  3: {
+    name: '公路',
+    value: 3,
+  },
+};
+
+export const TFC_INFO = {
+
+  1: {
+    name: '车次',
+    value: 1,
+  },
+  2: {
+    name: '航班号',
+    value: 2,
+  },
+  3: {
+    name: '高速公路出入口',
+    value: 3,
+  },
+};
+
+export const FORM_MOD = {
+  add: 'add',
+  modify: 'mod',
+};

+ 115 - 37
ruoyi-ui/src/views/cp/usrApply/index.vue

@@ -53,16 +53,6 @@
           />
         </el-select>
       </el-form-item>
-<!--      <el-form-item label="申请类型" prop="applyType">-->
-<!--        <el-select v-model="queryParams.applyType" placeholder="请选择申请类型" clearable>-->
-<!--          <el-option-->
-<!--              v-for="dict in dict.type.apply_type"-->
-<!--              :key="dict.value"-->
-<!--              :label="dict.label"-->
-<!--              :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
       <el-form-item label="审核状态" prop="reviewState">
         <el-select v-model="queryParams.reviewState" placeholder="请选择审核状态" clearable>
           <el-option
@@ -80,16 +70,6 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--            type="primary"-->
-<!--            plain-->
-<!--            icon="el-icon-plus"-->
-<!--            size="mini"-->
-<!--            @click="handleAdd"-->
-<!--        >新增-->
-<!--        </el-button>-->
-<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
             type="success"
@@ -114,6 +94,40 @@
         >删除
         </el-button>
       </el-col>
+      <el-col :span="2">
+        <el-button
+            :disabled="multiple"
+            type="success"
+            plain
+            icon="el-icon-check"
+            size="mini"
+            @click="batchPass"
+        >批量审核通过
+        </el-button>
+      </el-col>
+      <el-col :span="2">
+        <el-button
+            type="danger"
+            :disabled="multiple"
+            plain
+            icon="el-icon-check"
+            size="mini"
+            @click="batchReject"
+        >批量审核不通过
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            type="danger"
+            plain
+            icon="el-icon-delete"
+            size="mini"
+            :disabled="multiple"
+            @click="handleDelete"
+            v-hasPermi="['cp:apply:del']"
+        >删除
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
             type="warning"
@@ -128,12 +142,14 @@
     </el-row>
 
     <el-table v-loading="loading" :data="usrApplyList" @selection-change="handleSelectionChange" style="width: 100%">
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="selection" width="55" align="center">
+      </el-table-column>
+      <el-table-column label="编号" align="center" prop="id" width="100" fixed />
       <el-table-column label="参会人" align="center" prop="usrName" width="100" fixed />
       <el-table-column label="联系电话" align="center" prop="tel" width="120" fixed />
-      <el-table-column label="参会人单位" align="center" prop="orgUnitName" width="150"  fixed show-overflow-tooltip/>
-      <el-table-column label="参会人职务" align="center" prop="uniLevel"  width="150" fixed/>
-      <el-table-column label="邮箱信息" align="center" prop="email" width="100"/>
+      <el-table-column label="参会人单位" align="center" prop="orgUnitName" width="150" fixed show-overflow-tooltip />
+      <el-table-column label="参会人职务" align="center" prop="uniLevel" width="150" fixed />
+      <el-table-column label="邮箱信息" align="center" prop="email" width="100" />
       <el-table-column label="参会人角色" align="center" prop="usrType" width="100">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.met_usr_type" :value="scope.row.usrType" />
@@ -149,25 +165,38 @@
           <dict-tag :options="dict.type.apply_type" :value="scope.row.applyType" />
         </template>
       </el-table-column>
-      <el-table-column label="审核状态" align="center" prop="reviewState" width="100">
+      <el-table-column label="审核状态" align="center" prop="reviewState" width="120">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.review_state" :value="scope.row.reviewState" />
+          <div style="display: flex;align-items: center; justify-content: center;">
+            <i
+                :style="{
+                color: REVIEW_STATUS[scope.row.reviewState].color,
+                width: '10px',
+                height: '10px',
+                borderRadius: '10px',
+                background: REVIEW_STATUS[scope.row.reviewState].color,
+                marginRight: '5px'
+              }"
+            />
+            <dict-tag :options="dict.type.review_state" :value="scope.row.reviewState" />
+          </div>
+
         </template>
       </el-table-column>
-      <el-table-column label="审核信息" align="center" prop="reviewMsg" width="150" show-overflow-tooltip/>
+      <el-table-column label="审核信息" align="center" prop="reviewMsg" width="150" show-overflow-tooltip />
       <el-table-column label="与会内容" align="center" prop="contentTitle" width="150" />
       <el-table-column label="来程方式" align="center" prop="wayComing" width="100">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.tfc_type" :value="scope.row.wayComing"/>
+          <dict-tag :options="dict.type.tfc_type" :value="scope.row.wayComing" />
         </template>
       </el-table-column>
-      <el-table-column label="来程信息" align="center" prop="comInfo" width="150"/>
+      <el-table-column label="来程信息" align="center" prop="comInfo" width="150" />
       <el-table-column label="返程方式" align="center" prop="wayBack" width="150">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.tfc_type" :value="scope.row.wayBack"/>
+          <dict-tag :options="dict.type.tfc_type" :value="scope.row.wayBack" />
         </template>
       </el-table-column>
-      <el-table-column label="返程信息" align="center" prop="backInfo" width="150"/>
+      <el-table-column label="返程信息" align="center" prop="backInfo" width="150" />
       <el-table-column label="备注" align="center" prop="remark" width="150" show-overflow-tooltip />
       <el-table-column label="创建时间" align="center" prop="updateTime" width="80">
       </el-table-column>
@@ -277,7 +306,8 @@
                 v-for="dict in dict.type.tfc_type"
                 :key="dict.value"
                 :label="dict.value"
-            >{{dict.label}}</el-radio>
+            >{{ dict.label }}
+            </el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="车次/航班/高速公路出入口" prop="comInfo">
@@ -289,7 +319,8 @@
                 v-for="dict in dict.type.tfc_type"
                 :key="dict.value"
                 :label="dict.value"
-            >{{dict.label}}</el-radio>
+            >{{ dict.label }}
+            </el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="车次/航班/高速公路出入口" prop="backInfo">
@@ -403,15 +434,44 @@
         <el-button @click="rejectCancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="批量拒绝用户参会申请" :visible.sync="openBatcheReject" width="700px" append-to-body>
+      <el-form ref="rejectForm" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="审核状态" prop="reviewState">
+          <el-radio-group v-model="form.reviewState" :disabled="true">
+            <el-radio
+                v-for="dict in dict.type.review_state"
+                :key="dict.value"
+                :label="dict.value"
+            >{{ dict.label }}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="审核信息" prop="reviewMsg">
+          <el-input v-model="form.reviewMsg" type="textarea" rows="3" placeholder="审核信息" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="rejectByIds">确 定</el-button>
+        <el-button @click="rejectCancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { addUsrApply, delUsrApply, getUsrApply, listUsrApply, rejectUsrApply, updateUsrApply } from '@/api/cp/usrApply';
+import {
+  addUsrApply, delUsrApply, getUsrApply, listUsrApply, passByIds, rejectByIds, rejectUsrApply, updateUsrApply,
+} from '@/api/cp/usrApply';
+import { REVIEW_STATUS } from '@/utils/EnumConst';
 
 export default {
   name: 'UsrApply',
-  dicts: ['apply_type', 'conference_flag', 'review_state', 'met_usr_type',"tfc_type"],
+  computed: {
+    REVIEW_STATUS() {
+      return REVIEW_STATUS;
+    },
+  },
+  dicts: ['apply_type', 'conference_flag', 'review_state', 'met_usr_type', 'tfc_type'],
   data() {
     return {
       // 遮罩层
@@ -433,6 +493,7 @@ export default {
       // 是否显示弹出层
       open: false,
       openReject: false,
+      openBatcheReject: false,
       openDetail: false,
       // 查询参数
       queryParams: {
@@ -450,7 +511,7 @@ export default {
         comInfo: null,
         wayBack: null,
         backInfo: null,
-        remark: null
+        remark: null,
       },
       applyType: '',
       // 表单参数
@@ -489,6 +550,7 @@ export default {
     },
     rejectCancel() {
       this.openReject = false;
+      this.openBatcheReject = false;
       this.reset();
     },
 
@@ -618,13 +680,29 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除cps_usr_apply与会申请编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除与会申请编号为"' + ids + '"的数据项?').then(function () {
         return delUsrApply(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess('删除成功');
       }).catch(() => {});
     },
+    batchPass() {
+      passByIds(this.ids).then(response => {
+        this.getList();
+      });
+    },
+    batchReject() {
+      this.openBatcheReject = true;
+      this.form.reviewState = '1';
+    },
+    rejectByIds() {
+      const ids = this.ids;
+      rejectByIds(ids, this.form).then(response => {
+        this.getList();
+        this.openBatcheReject = false;
+      });
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download('cp/usrApply/export', {