diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java index 6430669..2cee04b 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java @@ -140,6 +140,7 @@ public class ActivityReimbursementMineController { cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy())); } // cnd.groupBy("t.id"); + cnd.groupBy("info.id"); sql.setCondition(cnd); Pagination pagination = activityReimbursementService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql); return Result.success().addData(pagination); diff --git a/src/main/java/com/budwk/app/zhgh/activity/workscollection/controller/ActivityWorksCollectionUploadController.java b/src/main/java/com/budwk/app/zhgh/activity/workscollection/controller/ActivityWorksCollectionUploadController.java index 795f076..a691680 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/workscollection/controller/ActivityWorksCollectionUploadController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/workscollection/controller/ActivityWorksCollectionUploadController.java @@ -1,6 +1,7 @@ package com.budwk.app.zhgh.activity.workscollection.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.date.DateUtil; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; @@ -25,6 +26,7 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.validation.Valid; +import java.util.Date; import java.util.List; /** @@ -47,8 +49,6 @@ public class ActivityWorksCollectionUploadController { public void index() { } - - /** * @param pageForm 分页 * @param activityId 活动id @@ -161,6 +161,8 @@ public class ActivityWorksCollectionUploadController { Dao extDao = Daos.ext(dao, FieldFilter.create(Activity_works_collection.class, "id|name|")); Cnd cnd = Cnd.NEW(); cnd.and(Activity_works_collection::getEnable,"=",1); + cnd.and(Activity_works_collection::getStartDateTime,"<=", DateUtil.now()); + cnd.and(Activity_works_collection::getEndDateTime,">=", DateUtil.now()); SqlExpressionGroup seg = new SqlExpressionGroup(); seg.or(Activity_works_collection::getActivityGroupId,"=",""); seg.or(Activity_works_collection::getActivityGroupId,"is",null); diff --git a/src/main/resources/static/components/plugins/sysCard/index.vue b/src/main/resources/static/components/plugins/sysCard/index.vue new file mode 100644 index 0000000..b635275 --- /dev/null +++ b/src/main/resources/static/components/plugins/sysCard/index.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/main/resources/static/components/plugins/sysUpload/h5Index.vue b/src/main/resources/static/components/plugins/sysUpload/h5Index.vue index 1155afb..e818518 100644 --- a/src/main/resources/static/components/plugins/sysUpload/h5Index.vue +++ b/src/main/resources/static/components/plugins/sysUpload/h5Index.vue @@ -56,6 +56,11 @@ module.exports = { default: "url", required: false }, + upload_size: { + type: Number, + default: 1024 * 1024 * 10, + required: false + }, // 上传返回分类 数组或字符串逗号隔离 interval | array upload_result_category: { type: String, @@ -142,7 +147,39 @@ module.exports = { this.$emit("update:value", this.fileList) }, beforeRead(file) { - return true + debugger + console.log(file) + console.log(this.upload_size) + if (file.size > this.upload_size) { + this.$toast("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(2) + "M的文件!") + return false + } + + if (!this.accept || typeof this.accept !== "string") { + return true + } + + // 去除前后空格并转换为数组 + const acceptTypes = this.accept + .trim() + .split(",") + .map((type) => type.trim().toUpperCase()) + + let fileType + const dotIndex = file.name.lastIndexOf(".") + if (dotIndex !== -1) { + fileType = file.name.substring(dotIndex).toUpperCase() + } else { + this.$toast("文件必须包含有效的扩展名!") + return false + } + + const valid = acceptTypes.includes(fileType) + if (valid) { + return true + } + this.$toast(`文件只能是 ${this.accept} 格式!`) + return false }, afterRead(files) { this.fileList.map((f) => { diff --git a/src/main/resources/static/components/plugins/sysUpload/index.vue b/src/main/resources/static/components/plugins/sysUpload/index.vue index e00ea1e..42f55f2 100644 --- a/src/main/resources/static/components/plugins/sysUpload/index.vue +++ b/src/main/resources/static/components/plugins/sysUpload/index.vue @@ -34,6 +34,7 @@ :accept="fileAccept" :multiple="true" list-type="picture-card" + :class="{ hide: hideUpload }" > @@ -212,10 +213,14 @@ module.exports = { tips = tips + '不限格式;' } if (fileSize) { - tips = tips + `单个文件大小不能超过${fileSize / 1024 / 1024}M;` + tips = tips + `单个文件大小不能超过${(fileSize / 1024 / 1024).toFixed(2)}M;` } return tips - } + }, + hideUpload() { + // 实时根据文件列表长度和限制数量计算 + return this.fileList.length >= this.upload_number; + }, }, methods: { buildFileObject(url, id) { @@ -309,38 +314,35 @@ module.exports = { beforeUpload(file) { if (file.size > this.upload_size) { - this.$message.error("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(0) + "M的文件!") + this.$message.error("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(2) + "M的文件!") return false } + if (!this.fileAccept || typeof this.fileAccept !== "string") { + return true + } - return true + // 去除前后空格并转换为数组 + const acceptTypes = this.fileAccept + .trim() + .split(",") + .map((type) => type.trim().toUpperCase()) - // if (!this.fileAccept || typeof this.fileAccept !== "string") { - // return true - // } - // - // // 去除前后空格并转换为数组 - // const acceptTypes = this.fileAccept - // .trim() - // .split(",") - // .map((type) => type.trim().toUpperCase()) - // - // let fileType - // const dotIndex = file.name.lastIndexOf(".") - // if (dotIndex !== -1) { - // fileType = file.name.substring(dotIndex).toUpperCase() - // } else { - // this.$message.error("文件必须包含有效的扩展名!") - // return false - // } - // - // const valid = acceptTypes.includes(fileType) - // if (valid) { - // return true - // } - // this.$message.error(`文件只能是 ${this.fileAccept} 格式!`) - // return false + let fileType + const dotIndex = file.name.lastIndexOf(".") + if (dotIndex !== -1) { + fileType = file.name.substring(dotIndex).toUpperCase() + } else { + this.$message.error("文件必须包含有效的扩展名!") + return false + } + + const valid = acceptTypes.includes(fileType) + if (valid) { + return true + } + this.$message.error(`文件只能是 ${this.fileAccept} 格式!`) + return false }, // 预览图片 @@ -643,4 +645,7 @@ module.exports = { height: var(--upload-height, 148px); } +.hide .el-upload--picture-card { + display: none; +} diff --git a/src/main/resources/views/layouts/v4/baseLayout.html b/src/main/resources/views/layouts/v4/baseLayout.html index 56f649c..dc9a561 100644 --- a/src/main/resources/views/layouts/v4/baseLayout.html +++ b/src/main/resources/views/layouts/v4/baseLayout.html @@ -392,6 +392,7 @@ Vue.component("excel-import", httpVueLoader("/components/plugins/sysImport/excelImport.vue?v=" + new Date().getTime())) Vue.component("flow-form-button", httpVueLoader("/components/plugins/flowable/formButton.vue?v=" + new Date().getTime())) Vue.component("snaker-flow", httpVueLoader("/components/plugins/snaker/snakerFlow.vue?v=" + new Date().getTime())) + Vue.component("custom-card", httpVueLoader("/components/plugins/sysCard/index.vue?v=" + new Date().getTime())) Vue.component( "snaker-flow-task-form-action", httpVueLoader("/components/plugins/snaker/snakerFlowTaskFormAction.vue?v=" + new Date().getTime()) diff --git a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/basicForm.js b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/basicForm.js index efcc890..826b8a9 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/basicForm.js +++ b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/basicForm.js @@ -536,12 +536,6 @@ const basicForm = { } this.formData.isDisabled = false await this.doHandle('提交') - } else { - if(Object.keys(errMsg).length > 0) { - this.$message.warning(errMsg[Object.keys(errMsg)[0]][0].message) - return - } - this.$message.warning("存在必填项未填写") } }) }, diff --git a/src/main/resources/views/platform/zhgh/activity/workscollection/manage/index.html b/src/main/resources/views/platform/zhgh/activity/workscollection/manage/index.html index 8d16a2c..118bbdc 100644 --- a/src/main/resources/views/platform/zhgh/activity/workscollection/manage/index.html +++ b/src/main/resources/views/platform/zhgh/activity/workscollection/manage/index.html @@ -230,12 +230,14 @@ layout("/layouts/platform.html"){ - - 取消 - 保存 - 确定 - + + + diff --git a/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html b/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html index f6c89a5..03feab1 100644 --- a/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html +++ b/src/main/resources/views/platform/zhgh/welfare/projectMange/index.html @@ -225,10 +225,11 @@ layout("/layouts/platform.html"){ > - - 取消 - 提交 - + + + diff --git a/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js index 2cd25a3..5494d49 100644 --- a/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js +++ b/src/main/resources/views/platform/zhgh/welfare/select/optionSelect.js @@ -180,13 +180,11 @@ const optionSelect = { - + - - @@ -250,6 +248,13 @@ const optionSelect = { `, store, data() { + const validateUserSign = (rule, value, callback) => { + if (this.projectInfo.signMode === 2 && !value) { + callback(new Error("请签字")) + return + } + callback() + } return { projectId: null, // 项目ID userId: null, // 用户id 代选的时候用得到 @@ -279,6 +284,9 @@ const optionSelect = { message: "请输入正确的手机号码", trigger: "blur" } + ], + userSign: [ + {validator: validateUserSign, message: "请签字", trigger: "blur"} ] }, addressOptions: [] diff --git a/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/applyForm.js b/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/applyForm.js index df0a511..3c62d76 100644 --- a/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/applyForm.js +++ b/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/applyForm.js @@ -84,6 +84,7 @@ const applyForm = { upload_result_type="url" complete_result :accept="fileAccept" + :upload_size="(chooseWorksType?.allowSingleFileSize / 1024 * 1024 * 1024) || 10 * 1024 * 1024" > diff --git a/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/index.html b/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/index.html index 555f4ed..345f85e 100644 --- a/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/workscollection/upload/index.html @@ -128,7 +128,14 @@ layout("/layouts/platform_h5.html"){ "pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime()) }, methods: { - onApply(row) { + async onApply(row) { + const res = await this.$axios.post('/platform/activity/basic/scope/getScopeUser', { + activityGroupId: Number(row.activityGroupId) + }) + if (res.data === 0) { + this.$toast.fail("您没有权限参与此活动") + return + } if (this.$moment().isBefore(this.$moment(row.startDateTime))) { this.onView(row) return