Kaynağa Gözat

子项目必填功能

seyason 2 yıl önce
ebeveyn
işleme
0b92fedd76

+ 8 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
 import java.util.List;
-import java.util.Map;
 
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -18,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2023-01-17
+ * @since 2023-02-10
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -433,6 +432,13 @@ public class TimeType extends Model<TimeType> {
     private Integer restartTaskNeedReason;
 
 
+    /**
+     * 0-否 1-是  子项目是否必填
+     */
+    @TableField("sub_pro_must_fill")
+    private Integer subProMustFill;
+
+
     @Override
     protected Serializable pkVal() {
         return this.companyId;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 28 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -177,7 +177,7 @@
                                             <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
                                                 <el-card shadow="never">
                                                     <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
-                                                    <!-- <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span> -->
+                                                    <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
                                                     <span v-if="user.company.packageEngineering == 0">
                                                     <span style="margin-left:15px;color:#DAA520;"  v-if="item2.state == 0">[ 
                                                         <span v-if="item2.isDeptAudit==0">
@@ -435,7 +435,7 @@
                             </el-select>
                             <template v-if="user.timeType.mainProjectState != 1">
                             <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
-                                style="margin-left:45px;">{{$t('lable.subproject')}}</span>
+                                style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
 
                             <!--子项目 -->
                             <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
@@ -590,7 +590,7 @@
                                 </el-select>
                                 <template v-if="user.timeType.mainProjectState != 1">
                                 <span  v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
-                                    style="margin-left:45px;">{{$t('lable.subproject')}}</span>
+                                    style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>{{$t('lable.subproject')}}</span>
                                 <!--子项目 -->
                                 <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
                                 v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
@@ -865,7 +865,7 @@
         <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
             <div>
                 <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
-                    <p>{{$t('lable.subproject')}}</p>
+                    <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
                     <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
                         <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
@@ -4757,6 +4757,14 @@
             },
             // 按周填报里内容的填写点击确定
             btnTianxiaes() {
+                //检查子项目是否必填
+                if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
+                    this.$message({
+                        message: '子项目必填,请检查',
+                        type: "error"
+                    });
+                    return;
+                }
                 if (!this.zhoBao.projectAuditorId && this.user.timeType.reportAuditType != 3) {
                     this.$message({
                         message: this.$t('message.Pleaseselectareviewer'),
@@ -4773,7 +4781,7 @@
                         auditTips = auditTips.substring(0,auditTips.length - 1)
                         this.$message({
                             message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
-                            type: 'warning'
+                            type: 'error'
                         })
                         return
                     }
@@ -4795,7 +4803,7 @@
                         errtips = errtips.substring(0,errtips.length - 1)
                         this.$message({
                             message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
-                            type: 'warning'
+                            type: 'error'
                         })
                         return
                     }
@@ -5917,6 +5925,20 @@
                                 }
                             }
                         }
+                        //检查子项目
+                        if (this.user.timeType.subProMustFill == 1) {
+                            for(var p in this.workForm.domains) {
+                                var oneProItem = this.workForm.domains[p]
+                                if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
+                                    //没有选择子项目
+                                    this.$message({
+                                        message: '子项目必填,请检查',
+                                        type: "error"
+                                    });
+                                    return
+                                }
+                            }
+                        }
 
                         // return
                         //代填的情况,检查人员是否已经选择

+ 15 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1611,13 +1611,24 @@ import timetoolVue from '../timetool/timetool.vue';
                         }
                     }
                     this.dateAr = alp
-                        if(this.dateAr.length > 0) {
-                            let trus = this.fns()
-                            if(!trus) {
-                                this.$toast('填写的时间段重叠')
+                    if(this.dateAr.length > 0) {
+                        let trus = this.fns()
+                        if(!trus) {
+                            this.$toast('填写的时间段重叠')
+                            return
+                        }
+                    }
+                    //检查子项目
+                    if (this.user.timeType.subProMustFill == 1) {
+                        for(var p in this.form.domains) {
+                            var oneProItem = this.form.domains[p]
+                            if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
+                                //没有选择子项目
+                                this.$toast('子项目必填,请检查')
                                 return
                             }
                         }
+                    }
                     // return
                     const toast = this.$toast.loading({
                         forbidClick: true,

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -1550,7 +1550,19 @@
             // 提交日报
             submitReport() {
                 this.form[this.inbtn] = this.currentForm
-
+                //检查子项目
+                if (this.user.timeType.subProMustFill == 1) {
+                    for(let i in this.form){
+                        for(let m in this.form[i].domains){
+                            var oneProItem = this.form[i].domains[m]
+                            if (oneProItem.subProjectList && oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
+                                //没有选择子项目
+                                this.$toast('子项目必填,请检查')
+                                return
+                            }
+                        }
+                    }
+                }
 
                 if(this.user.timeType.notAllowedNoAttendance == 1){
                     let toast = ''