From 4b3a01aa0809fb8f6c9abfc7494ff058b4844b16 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Mon, 27 Oct 2025 01:05:06 +0000
Subject: [PATCH] Merge branch 'wcd-2411-update' into dengjh-2507-update
---
eladmin-web-master/src/assets/images/cp_approval_del/app/5.jpg | 0
eladmin-master/eladmin-system/pom.xml | 5 +
eladmin-web-master/src/assets/images/cp_approval_del/web/2.png | 0
eladmin-web-master/src/components/CpApprovalDelDialog/index.vue | 86 +++++++++++++++++++++
eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java | 53 ++++++++++++-
eladmin-web-master/src/assets/images/cp_approval_del/web/3.png | 0
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue | 15 +++
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java | 12 +--
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue | 15 +++
eladmin-web-master/src/assets/images/cp_approval_del/app/1.jpg | 0
eladmin-master/eladmin-system/src/main/resources/config/application.yml | 5 +
eladmin-web-master/src/assets/images/cp_approval_del/app/3.jpg | 0
eladmin-web-master/src/assets/images/cp_approval_del/web/1.png | 0
eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue | 15 +++
eladmin-web-master/src/assets/images/cp_approval_del/web/4.png | 0
eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue | 15 +++
eladmin-web-master/src/assets/images/cp_approval_del/app/2.jpg | 0
eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue | 15 +++
eladmin-web-master/src/assets/images/cp_approval_del/app/4.jpg | 0
19 files changed, 217 insertions(+), 19 deletions(-)
diff --git a/eladmin-master/eladmin-system/pom.xml b/eladmin-master/eladmin-system/pom.xml
index 2cce50c..0ef5214 100644
--- a/eladmin-master/eladmin-system/pom.xml
+++ b/eladmin-master/eladmin-system/pom.xml
@@ -123,6 +123,11 @@
<!-- <version>4.7.2.B</version>-->
<version>4.7.7-20250915.094526</version>
</dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ <version>3.3.0</version>
+ </dependency>
<!-- 模拟前端渲染 -->
<dependency>
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
index f6b2085..e7ebc17 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
@@ -1,9 +1,11 @@
package me.zhengjie.config;
import com.binarywang.spring.starter.wxjava.cp.properties.WxCpProperties;
+import com.binarywang.spring.starter.wxjava.cp.properties.WxCpRedisProperties;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import me.chanjar.weixin.cp.config.impl.WxCpJedisConfigImpl;
import me.chanjar.weixin.cp.config.impl.WxCpRedisTemplateConfigImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -11,6 +13,8 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
/**
* @author baoLh
@@ -30,12 +34,27 @@
@Bean
public WxCpService wxCpService() {
-// // 默认缓存配置
-// WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl();
+ WxCpDefaultConfigImpl configStorage;
+ if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.redistemplate)) {
+ // redis缓存配置
+ StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class);
+ configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix());
+ } else if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.jedis)) {
+ // jedis配置
+ WxCpRedisProperties wxCpRedisProperties = wxCpProperties.getConfigStorage().getRedis();
+ JedisPool jedisPool;
+ if (wxCpRedisProperties != null && StringUtils.isNotEmpty(wxCpRedisProperties.getHost())) {
+ jedisPool = getJedisPool();
+ } else {
+ jedisPool = applicationContext.getBean(JedisPool.class);
+ }
+ configStorage = new WxCpJedisConfigImpl(jedisPool, wxCpProperties.getConfigStorage().getKeyPrefix());
+ } else {
+ // 默认缓存配置
+ configStorage = new WxCpDefaultConfigImpl();
+ }
- // redis缓存配置
- StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class);
- WxCpDefaultConfigImpl configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix());
+ // 基本配置
configStorage.setCorpId(wxCpProperties.getCorpId());
configStorage.setAgentId(wxCpProperties.getAgentId());
configStorage.setCorpSecret(wxCpProperties.getCorpSecret());
@@ -71,4 +90,28 @@
return wxCpService;
}
+
+ private JedisPool getJedisPool() {
+ WxCpProperties.ConfigStorage storage = wxCpProperties.getConfigStorage();
+ WxCpRedisProperties redis = storage.getRedis();
+
+ JedisPoolConfig config = new JedisPoolConfig();
+ if (redis.getMaxActive() != null) {
+ config.setMaxTotal(redis.getMaxActive());
+ }
+ if (redis.getMaxIdle() != null) {
+ config.setMaxIdle(redis.getMaxIdle());
+ }
+ if (redis.getMaxWaitMillis() != null) {
+ config.setMaxWaitMillis(redis.getMaxWaitMillis());
+ }
+ if (redis.getMinIdle() != null) {
+ config.setMinIdle(redis.getMinIdle());
+ }
+ config.setTestOnBorrow(true);
+ config.setTestWhileIdle(true);
+
+ return new JedisPool(config, redis.getHost(), redis.getPort(),
+ redis.getTimeout(), redis.getPassword(), redis.getDatabase());
+ }
}
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
index 4364299..e30a80f 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
@@ -1167,10 +1167,8 @@
Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_MSG)) {
// 发送消息
- WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl();
- wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY));
- wxCpService.setWxCpConfigStorage(wxCpDefaultConfig);
- wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_MSG), Arrays.asList("@all"), Arrays.asList());
+ String webhookUrl = wxCpService.getWxCpConfigStorage().getApiUrl("/cgi-bin/webhook/send?key=") + robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY);
+ wxCpService.getGroupRobotService().sendText(webhookUrl, robotParamMap.get(Constant.REMIND_REPORT_MSG), Arrays.asList("@all"), Arrays.asList());
}
} catch (WxErrorException wxErrorException) {
wxErrorException.printStackTrace();
@@ -1223,10 +1221,8 @@
Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_SUCCESS_MSG)) {
// 发送周报生成成功消息
- WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl();
- wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY));
- wxCpService.setWxCpConfigStorage(wxCpDefaultConfig);
- wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_SUCCESS_MSG), Arrays.asList("@all"), Arrays.asList());
+ String webhookUrl = wxCpService.getWxCpConfigStorage().getApiUrl("/cgi-bin/webhook/send?key=") + robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY);
+ wxCpService.getGroupRobotService().sendText(webhookUrl, robotParamMap.get(Constant.REMIND_REPORT_SUCCESS_MSG), Arrays.asList("@all"), Arrays.asList());
}
} catch (WxErrorException wxErrorException) {
wxErrorException.printStackTrace();
diff --git a/eladmin-master/eladmin-system/src/main/resources/config/application.yml b/eladmin-master/eladmin-system/src/main/resources/config/application.yml
index 5650ba4..e5fb944 100644
--- a/eladmin-master/eladmin-system/src/main/resources/config/application.yml
+++ b/eladmin-master/eladmin-system/src/main/resources/config/application.yml
@@ -87,4 +87,7 @@
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
timeout: 5000
-
+# max-active: 50
+# max-idle: 20
+# max-wait-millis: 1000
+# min-idle: 10
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/app/1.jpg b/eladmin-web-master/src/assets/images/cp_approval_del/app/1.jpg
new file mode 100644
index 0000000..68a79c3
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/app/1.jpg
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/app/2.jpg b/eladmin-web-master/src/assets/images/cp_approval_del/app/2.jpg
new file mode 100644
index 0000000..2a7167f
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/app/2.jpg
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/app/3.jpg b/eladmin-web-master/src/assets/images/cp_approval_del/app/3.jpg
new file mode 100644
index 0000000..a038e68
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/app/3.jpg
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/app/4.jpg b/eladmin-web-master/src/assets/images/cp_approval_del/app/4.jpg
new file mode 100644
index 0000000..5a25c98
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/app/4.jpg
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/app/5.jpg b/eladmin-web-master/src/assets/images/cp_approval_del/app/5.jpg
new file mode 100644
index 0000000..0fae61e
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/app/5.jpg
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/web/1.png b/eladmin-web-master/src/assets/images/cp_approval_del/web/1.png
new file mode 100644
index 0000000..05876af
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/web/1.png
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/web/2.png b/eladmin-web-master/src/assets/images/cp_approval_del/web/2.png
new file mode 100644
index 0000000..f50ae78
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/web/2.png
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/web/3.png b/eladmin-web-master/src/assets/images/cp_approval_del/web/3.png
new file mode 100644
index 0000000..6a1f3b5
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/web/3.png
Binary files differ
diff --git a/eladmin-web-master/src/assets/images/cp_approval_del/web/4.png b/eladmin-web-master/src/assets/images/cp_approval_del/web/4.png
new file mode 100644
index 0000000..4777a0d
--- /dev/null
+++ b/eladmin-web-master/src/assets/images/cp_approval_del/web/4.png
Binary files differ
diff --git a/eladmin-web-master/src/components/CpApprovalDelDialog/index.vue b/eladmin-web-master/src/components/CpApprovalDelDialog/index.vue
new file mode 100644
index 0000000..1f778e9
--- /dev/null
+++ b/eladmin-web-master/src/components/CpApprovalDelDialog/index.vue
@@ -0,0 +1,86 @@
+<template>
+ <el-dialog
+ title="删除提示"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :before-close="handleClose"
+ >
+ <div style="max-height: calc(80vh - 160px); overflow-y: scroll;">
+ <div style="font-size: 16px; font-weight: 600; margin-bottom: 20px;">当前删除的申请使用了【企微审核】,无法在系统内删除,请根据不同操作设备参照以下步骤在【企业微信】操作撤回申请:</div>
+ <el-collapse v-model="activeNames" @change="handleChange">
+ <el-collapse-item name="WEB">
+ <template slot="title">
+ <span style="font-size: 16px; font-weight: 600;">1.电脑端操作</span>
+ <span v-if="!activeNames.includes('WEB')" style="font-size: 12px; color: #999999; margin-left: 20px;">点击展开查看</span>
+ </template>
+ <div class="steps-image-box">
+ <el-image v-for="(webImage, webIndex) in webImageList" :key="'web_image_' + webIndex" class="steps-image" :src="webImage" fit="contain" :preview-src-list="webImageList" />
+ </div>
+ </el-collapse-item>
+ <el-collapse-item name="APP">
+ <template slot="title">
+ <span style="font-size: 16px; font-weight: 600;">2.手机端操作</span>
+ <span v-if="!activeNames.includes('APP')" style="font-size: 12px; color: #999999; margin-left: 20px;">点击展开查看</span>
+ </template>
+ <div class="steps-image-box">
+ <el-image v-for="(appImage, appIndex) in appImageList" :key="'web_image_' + appIndex" class="steps-image" :src="appImage" fit="contain" :preview-src-list="appImageList" />
+ </div>
+ </el-collapse-item>
+ </el-collapse>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="dialogVisible = false">我已知晓</el-button>
+ </span>
+ </el-dialog>
+</template>
+
+<script>
+import Web1 from '@/assets/images/cp_approval_del/web/1.png'
+import Web2 from '@/assets/images/cp_approval_del/web/2.png'
+import Web3 from '@/assets/images/cp_approval_del/web/3.png'
+import Web4 from '@/assets/images/cp_approval_del/web/4.png'
+import App1 from '@/assets/images/cp_approval_del/app/1.jpg'
+import App2 from '@/assets/images/cp_approval_del/app/2.jpg'
+import App3 from '@/assets/images/cp_approval_del/app/3.jpg'
+import App4 from '@/assets/images/cp_approval_del/app/4.jpg'
+import App5 from '@/assets/images/cp_approval_del/app/5.jpg'
+
+export default {
+ data() {
+ return {
+ dialogVisible: false,
+ activeNames: [],
+ webImageList: [Web1, Web2, Web3, Web4],
+ appImageList: [App1, App2, App3, App4, App5]
+ }
+ },
+ methods: {
+ handleOpen() {
+ const that = this
+ that.dialogVisible = true
+ },
+ handleClose() {
+ const that = this
+ that.dialogVisible = false
+ },
+ handleChange(val) {
+ const that = this
+ that.activeNames = val
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+.steps-image-box {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
+ padding: 12px;
+}
+.steps-image {
+ width: 200px;
+ border-radius: 5px;
+ border: 1px solid #999999;
+}
+</style>
diff --git a/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue b/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
index 050c1c0..133b3cc 100644
--- a/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -628,6 +628,8 @@
</el-table>
<!--分页组件-->
<pagination />
+
+ <cp-approval-del-dialog ref="cpApprovalDelDialog" />
</div>
</div>
</template>
@@ -643,6 +645,7 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import approvalLine from '@/components/ApprovalLine'
+import cpApprovalDelDialog from '@/components/CpApprovalDelDialog'
import constant from '../../../utils/constant'
const defaultForm = {
@@ -670,7 +673,7 @@
}
export default {
name: 'AttendanceBusinessTravel',
- components: { pagination, crudOperation, rrOperation, udOperation, approvalLine },
+ components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -783,6 +786,16 @@
this.form.userId = this.user.id
}
},
+ // 钩子:删除 - 之前
+ [CRUD.HOOK.beforeDelete]() {
+ const that = this
+ if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) {
+ that.$refs.cpApprovalDelDialog.handleOpen()
+ that.crud.delAllLoading = false
+ return false
+ }
+ return true
+ },
// 禁用
disabledUser(data) {
if (this.userRolesLevelMin > this.roleLevelGenerl) {
diff --git a/eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue b/eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue
index 1a0834f..b84aecc 100644
--- a/eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue
@@ -264,6 +264,8 @@
</el-table>
<!--分页组件-->
<pagination />
+
+ <cp-approval-del-dialog ref="cpApprovalDelDialog" />
</div>
</div>
</template>
@@ -278,12 +280,13 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import approvalLine from '@/components/ApprovalLine'
+import cpApprovalDelDialog from '@/components/CpApprovalDelDialog'
import constant from '../../../utils/constant'
const defaultForm = { id: null, userId: null, userName: null, approvalUserId: null, cardReplacementTime: null, cardReplacementReason: null, approvalStatus: null, approvalDescription: null, cardReplacementDistinguish: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null }
export default {
name: 'AttendanceCardreplacement',
- components: { pagination, crudOperation, rrOperation, udOperation, approvalLine },
+ components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
// 数据字典
dicts: [constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS, constant.APPROVAL_SITE_TYPE],
@@ -388,6 +391,16 @@
this.form.approvalUserId = 0
}
},
+ // 钩子:删除 - 之前
+ [CRUD.HOOK.beforeDelete]() {
+ const that = this
+ if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) {
+ that.$refs.cpApprovalDelDialog.handleOpen()
+ that.crud.delAllLoading = false
+ return false
+ }
+ return true
+ },
// 禁用
disabledUser(data) {
if (this.userRolesLevelMin > this.roleLevelGenerl) {
diff --git a/eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue b/eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue
index c39edd8..f1d2024 100644
--- a/eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue
@@ -607,6 +607,8 @@
</el-table>
<!--分页组件-->
<pagination />
+
+ <cp-approval-del-dialog ref="cpApprovalDelDialog" />
</div>
</div>
</template>
@@ -621,6 +623,7 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import approvalLine from '@/components/ApprovalLine'
+import cpApprovalDelDialog from '@/components/CpApprovalDelDialog'
import constant from '@/utils/constant'
const defaultForm = {
@@ -645,7 +648,7 @@
}
export default {
name: 'AttendanceGoOut',
- components: { pagination, crudOperation, rrOperation, udOperation, approvalLine },
+ components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -755,6 +758,16 @@
this.form.userId = this.user.id
}
},
+ // 钩子:删除 - 之前
+ [CRUD.HOOK.beforeDelete]() {
+ const that = this
+ if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) {
+ that.$refs.cpApprovalDelDialog.handleOpen()
+ that.crud.delAllLoading = false
+ return false
+ }
+ return true
+ },
// 禁用
disabledUser(data) {
if (this.userRolesLevelMin > this.roleLevelGenerl) {
diff --git a/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue b/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
index 5732ddd..42c6577 100644
--- a/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -324,6 +324,8 @@
</el-table>
<!--分页组件-->
<pagination />
+
+ <cp-approval-del-dialog ref="cpApprovalDelDialog" />
</div>
</div>
</template>
@@ -338,12 +340,13 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import approvalLine from '@/components/ApprovalLine'
+import cpApprovalDelDialog from '@/components/CpApprovalDelDialog'
import constant from '@/utils/constant'
const defaultForm = { id: null, userId: null, approvalUserId: null, leaveType: null, leaveStartTime: null, leaveEndTime: null, leaveDuration: null, leaveDurationUnit: null, leaveReason: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null }
export default {
name: 'AttendanceLeave',
- components: { pagination, crudOperation, rrOperation, udOperation, approvalLine },
+ components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '请假记录', url: 'api/attendanceLeave', idField: 'id', sort: 'leaveStartTime,desc', crudMethod: { ...crudAttendanceLeave }})
@@ -447,6 +450,16 @@
this.form.userId = this.user.id
}
},
+ // 钩子:删除 - 之前
+ [CRUD.HOOK.beforeDelete]() {
+ const that = this
+ if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) {
+ that.$refs.cpApprovalDelDialog.handleOpen()
+ that.crud.delAllLoading = false
+ return false
+ }
+ return true
+ },
// 钩子:在编辑之前执行
// [CRUD.HOOK.beforeToEdit]() {
// this.getUserTimes()
diff --git a/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue b/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
index 2c6f646..be835a0 100644
--- a/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
@@ -257,6 +257,8 @@
</el-table>
<!--分页组件-->
<pagination />
+
+ <cp-approval-del-dialog ref="cpApprovalDelDialog" />
</div>
</div>
</template>
@@ -270,13 +272,14 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import approvalLine from '@/components/ApprovalLine'
+import cpApprovalDelDialog from '@/components/CpApprovalDelDialog'
import constant from '@/utils/constant'
import { mapGetters } from 'vuex'
const defaultForm = { id: null, userId: null, approvalUserId: null, overtimeStartTime: null, overtimeEndTime: null, overtimeDuration: null, overtimeDurationUnit: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null }
export default {
name: 'AttendanceOvertime',
- components: { pagination, crudOperation, rrOperation, udOperation, approvalLine },
+ components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '考勤加班', url: 'api/attendanceOvertime', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceOvertime }})
@@ -367,6 +370,16 @@
this.form.userId = this.user.id
}
},
+ // 钩子:删除 - 之前
+ [CRUD.HOOK.beforeDelete]() {
+ const that = this
+ if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) {
+ that.$refs.cpApprovalDelDialog.handleOpen()
+ that.crud.delAllLoading = false
+ return false
+ }
+ return true
+ },
// 查询员工
getUsers() {
crudUser.getAll().then(res => {
--
Gitblit v1.9.3