LiGuang 2 tahun lalu
induk
melakukan
520ca3f199

+ 6 - 0
src/components/jeecg/JImageUpload.vue

@@ -59,6 +59,7 @@
         uploadLoading:false,
         picUrl:false,
         headers:{},
+        isupload:true,
         fileList: [],
         previewImage:"",
         previewVisible: false,
@@ -143,14 +144,17 @@
         this.fileList = fileList
       },
       beforeUpload: function(file){
+        this.isupload=true;
         var fileType = file.type;
         if(fileType.indexOf('image')<0){
+          this.isupload=false;
           this.$message.warning('请上传图片');
           return false;
         }
       },
       handleChange(info) {
         this.picUrl = false;
+        if(this.isupload){
         let fileList = info.fileList
         //update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
         if(this.number>0 && this.isMultiple){
@@ -177,6 +181,8 @@
         if(info.file.status==='done' || info.file.status === 'removed'){
           this.handlePathChange()
         }
+        }
+        
       },
       // 预览
       handlePreview (file) {

+ 1 - 1
src/views/system/AttendanceRuleList.vue

@@ -389,7 +389,7 @@
         this.columns.push({
           title: '名称',
           dataIndex: 'realname',
-          width: '80px',
+          width: '85px',
           fixed: 'left',
           sorter: true
         })

+ 14 - 2
src/views/system/modules/UserModal.vue

@@ -209,7 +209,7 @@
         <a-row>
           <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="司龄" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input style="width: 70%"  :maxLength="5" placeholder="请输入司龄" suffix="月" v-model="moth" />
+              <a-input style="width: 70%" disabled  :maxLength="5" placeholder="请输入司龄" suffix="月" v-model="moth" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8" :lg="8">
@@ -309,7 +309,7 @@
     <depart-windows ref="departWindows" @ok="modalFormOk"></depart-windows>
 
     <a-modal title="附件" :visible="visiblet" @ok="saveUpload()" @cancel="handleCancelts()" footer="">
-      <a-upload :action="url.fileUpload" list-type="picture"
+      <a-upload :action="url.fileUpload" list-type="picture" :beforeUpload="beforeUploads"
         :file-list="fileLists" @change="t" method="post" @download="handleDownload" :showUploadList="{
               showRemoveIcon: true,
               showDownloadIcon: true
@@ -572,6 +572,7 @@
         uploadLoading: false,
         visloading:false,
         confirmLoading: false,
+        isupload:true,
         headers: {},
         form: this.$form.createForm(this),
         picUrl: "",
@@ -651,6 +652,15 @@
         this.workMoths=this.workMoth;
         this.visloading=true;
       },
+      beforeUploads(file){
+        this.isupload=true;
+      const isLtM=file.size / 1024 / 1024>10
+      if(isLtM){
+        this.isupload=false;
+        this.$message.warning('文件不能超过10mb!');
+        return false;
+      }
+      },
       zwOk() {
         if (this.selectionRows != null && this.selectionRows.length > 0) {
           this.zwName = this.selectionRows[0].name;
@@ -733,7 +743,9 @@
         //     this.files.push(list[i].response.message);
         //   }
         // }
+        if(this.isupload){
         this.fileLists = info.fileList //重点
+        }
         //console.log(info)
       },
       saveUpload() {

+ 238 - 18
src/views/system/schedulingInformation/BdWorkOverTimeList.vue

@@ -105,11 +105,12 @@
                />
          </a-form-item>
         </a-col>
-        <a-col :xl="6" :lg="7" :md="8" :sm="24">
-          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+        <a-col :xl="4" :lg="4" :md="4" :sm="24">
+          <span style="float: left;overflow: hidden;margin-left: -60px;" class="table-page-search-submitButtons">
             <a-button type="primary" @click="searchQuerys()" icon="search">查询</a-button>
             <a-button type="primary" @click="searchResets" icon="reload" style="margin-left: 8px">重置</a-button>
             <a-button type="primary" icon="download" @click="handleExportXlst('请假息列表')" style="margin-left: 8px;">导出</a-button>
+            <a-button @click="handleAdds()" type="primary" icon="plus" style="margin-left: 8px;">新增</a-button>
          <a @click="handleToggleSearchs" style="margin-left: 8px">
            {{ toggleSearchStatuss ? '收起' : '展开' }}
            <a-icon :type="toggleSearchStatuss ? 'up' : 'down'"/>
@@ -131,9 +132,9 @@
       </a-form>
     </div>
 
-   <!-- <div class="table-operator">
-     <a-button @click="handleAdds()" type="primary" icon="plus" >新增</a-button>
-     </div> -->
+   <div class="table-operator" v-if="isShow==2||isShow=='2'">
+     
+     </div>
     <!-- table区域-begin -->
     <a-tabs default-active-key="1" @change="callback">
       
@@ -185,7 +186,7 @@
       
        </a-tab-pane>
     </a-tabs>
-    <a-modal v-model="vailts" title="年假新增"  @ok="addval()">
+    <a-modal v-model="vailts" title="年假新增"  @ok="addval()" >
       <a-spin :spinning="confirmLoading">
        <a-form :form="form">
          <a-form-item
@@ -212,13 +213,30 @@
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="开始日期">
-           <a-date-picker showTime format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'startDate', validatorRules.startDate]" />
+           <a-date-picker  format='YYYY-MM-DD' v-decorator="[ 'startDate', validatorRules.startDate]" />
+         <a-select style="width: 40%"     v-decorator="['startType',validatorRules.startType]" placeholder="请选择时间"
+           :getPopupContainer="(target) => target.parentNode" >
+           <a-select-option value="00:00:00">上午</a-select-option>
+           <a-select-option value="12:00:00">下午</a-select-option>
+         </a-select>
          </a-form-item>
+         
          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="结束日期">
-           <a-date-picker showTime :disabled-date="disabledDate" format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'endDate', validatorRules.endDate]" />
+           <a-date-picker  :disabled-date="disabledDate" format='YYYY-MM-DD' v-decorator="[ 'endDate', validatorRules.endDate]" />
+         <a-select style="width: 40%"     v-decorator="['endType',validatorRules.endType]" placeholder="请选择时间"
+           :getPopupContainer="(target) => target.parentNode" >
+           <a-select-option value="00:00:00">上午</a-select-option>
+           <a-select-option value="12:00:00">下午</a-select-option>
+         </a-select>
+         </a-form-item>
+         <a-form-item
+           :labelCol="labelCol"
+           :wrapperCol="wrapperCol"
+           label="时长">
+           <a-input disabled  placeholder="请输时长" suffix="小时" v-decorator="['holidayCount', {initialValue:0}]" />
          </a-form-item>
          <a-form-item
            :labelCol="labelCol"
@@ -272,9 +290,11 @@ import moment from "moment"
                validator: this.validateRealname
              }]},
          deptname:{rules: [{ required: true, message: '请输入部门名称!' }]},
+         startType:{initialValue:"00:00:00",rules: [{ required: true, message: '请选择时间!' },{validator:this.validatestartType}]},
+         endType:{initialValue:"00:00:00",rules: [{ required: true, message: '请选择时间!' },{validator:this.validateendType}]},
          type:{rules: [{ required: true, message: '请选择类型' }]},
          startDate:{rules: [{ required: true, message: '请选择开始日期' },{validator:this.validatestartDate}]},
-         endDate:{rules: [{ required: true, message: '请选择结束日期' }]},
+         endDate:{rules: [{ required: true, message: '请选择结束日期' },{validator:this.validateendDate}]},
          },
          model: {},
          labelCol: {
@@ -461,28 +481,32 @@ import moment from "moment"
       addval(){
         this.form.validateFields((err, values) => {
           if (!err) { 
-            var startDate= this.form.getFieldValue('startDate');
-            var endDate= this.form.getFieldValue('endDate');
+            var startDate= moment(this.form.getFieldValue('startDate')).format('YYYY-MM-DD')+" "+this.form.getFieldValue('startType');
+            var endDate=moment(this.form.getFieldValue('endDate')).format('YYYY-MM-DD')+" "+this.form.getFieldValue('endType');
             var holidayType= this.form.getFieldValue('holidayType');
             var demo=this.form.getFieldValue('demo');
             var userId=this.form.getFieldValue('userId');
+            var holidayCount=this.form.getFieldValue('holidayCount');
             this.confirmLoading=true;
             httpAction(this.url.add, {
               userId: userId,
               startDate:moment(startDate).format('YYYY-MM-DD HH:mm:ss'),
               endDate:moment(endDate).format('YYYY-MM-DD HH:mm:ss'),
               demo:demo,
+              holidayCount:holidayCount,
               holidayType:holidayType
             },"post").then(res => { 
               if (res.success) {
                 this.$message.success(res.message);
-                this.confirmLoading=false;
                 this.vailts=false;
+                this.querys();
               } else {
                 this.$message.warning(res.message);
               }
             
-            })
+            }).finally(() => {
+          this.confirmLoading=false;
+        })
             
           } 
         })
@@ -494,7 +518,10 @@ import moment from "moment"
           startDate:null,
           demo:null,
           userId:null,
-          deptNames:null
+          deptNames:null,
+          holidayCount:0,
+          startType:"00:00:00",
+          endType:"00:00:00"
         }) 
         this.vailts=true;
       },
@@ -507,18 +534,211 @@ import moment from "moment"
           callback()
         } else {
           callback()
-         var end=this.form.getFieldValue('endDate');
+         var end=moment(this.form.getFieldValue('endDate')).format('YYYY-MM-DD');
+         var start=moment(value).format('YYYY-MM-DD');
+         var endType=this.form.getFieldValue('endType');
+         var startType=this.form.getFieldValue('startType');
          if(end!=null){
-           var start=new Date(value);
+           var starts=new Date(start);
            var ends=new Date(end);
-           if(ends.getTime()<start.getTime()){
+           if(ends.getTime()<starts.getTime()){
              this.form.setFieldsValue({
-               endDate:null
+               endDate:null,
+               holidayCount:0,
+             }) 
+           }else{
+             var count=0;
+             if(ends.getTime()==starts.getTime()){
+               if(endType==startType){
+                 count=12;
+               }else{
+                 count=24;
+               }
+             }else{
+               for(var i=starts.getDate();i<=ends.getDate();i++){
+                  if(i==starts.getDate()){
+                    if(startType=="00:00:00"){
+                      count+=24;
+                    }else{
+                      count+=12;
+                    }
+                  }else if(i==ends.getDate()){
+                    if(endType=="00:00:00"){
+                      count+=12;
+                    }else{
+                      count+=24;
+                    }
+                  }else{
+                    count+=24;
+                  }
+               }
+             }
+             this.form.setFieldsValue({
+               holidayCount:count
              }) 
            }
          }
         }
       },
+      validateendDate(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          callback()
+          var start=moment(this.form.getFieldValue('startDate')).format('YYYY-MM-DD');
+          var end=moment(value).format('YYYY-MM-DD');
+          var endType=this.form.getFieldValue('endType');
+          var startType=this.form.getFieldValue('startType');
+          if(start!=null){
+            var starts=new Date(start);
+            var ends=new Date(end);
+            if(ends.getTime()<starts.getTime()){
+              this.form.setFieldsValue({
+                startDate:null,
+                holidayCount:0,
+              }) 
+            }else{
+              var count=0;
+              if(ends.getTime()==starts.getTime()){
+                if(endType==startType){
+                  count=12;
+                }else{
+                  count=24;
+                }
+              }else{
+                for(var i=starts.getDate();i<=ends.getDate();i++){
+                   if(i==starts.getDate()){
+                     if(startType=="00:00:00"){
+                       count+=24;
+                     }else{
+                       count+=12;
+                     }
+                   }else if(i==ends.getDate()){
+                     if(endType=="00:00:00"){
+                       count+=12;
+                     }else{
+                       count+=24;
+                     }
+                   }else{
+                     count+=24;
+                   }
+                }
+              }
+              this.form.setFieldsValue({
+                holidayCount:count
+              }) 
+            }
+          }
+        
+        }
+      },
+      validateendType(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          callback()
+          var start=moment(this.form.getFieldValue('startDate')).format('YYYY-MM-DD');
+          var end=moment(this.form.getFieldValue('endDate')).format('YYYY-MM-DD');
+          var startType=this.form.getFieldValue('startType');
+         if(end!=null&&start!=null){
+           if(value!=startType){
+             if(value=="00:00:00"&&startType=="12:00:00"){
+               this.form.setFieldsValue({
+                 startType:"00:00:00"
+               }) 
+             }
+             
+           }
+           var startTypes=this.form.getFieldValue('startType');
+             var starts=new Date(start);
+             var ends=new Date(end);
+               var count=0;
+               if(ends.getTime()==starts.getTime()){
+                 if(value==startTypes){
+                   count=12;
+                 }else{
+                   count=24;
+                 }
+               }else{
+                 for(var i=starts.getDate();i<=ends.getDate();i++){
+                    if(i==starts.getDate()){
+                      if(startTypes=="00:00:00"){
+                        count+=24;
+                      }else{
+                        count+=12;
+                      }
+                    }else if(i==ends.getDate()){
+                      if(value=="00:00:00"){
+                        count+=12;
+                      }else{
+                        count+=24;
+                      }
+                    }else{
+                      count+=24;
+                    }
+                 }
+               }
+               this.form.setFieldsValue({
+                 holidayCount:count
+               }) 
+             }
+         
+        }
+      },
+      validatestartType(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          callback()
+          var start=moment(this.form.getFieldValue('startDate')).format('YYYY-MM-DD');
+          var end=moment(this.form.getFieldValue('endDate')).format('YYYY-MM-DD');
+          var endType=this.form.getFieldValue('endType');
+         if(end!=null&&start!=null){
+           if(value!=endType){
+             if(value=="12:00:00"&&endType=="00:00:00"){
+               this.form.setFieldsValue({
+                 endType:"12:00:00"
+               }) 
+             }
+             
+           }
+           
+           var endTypes=this.form.getFieldValue('endType');
+             var starts=new Date(start);
+             var ends=new Date(end);
+               var count=0;
+               if(ends.getTime()==starts.getTime()){
+                 if(value==endTypes){
+                   count=12;
+                 }else{
+                   count=24;
+                 }
+               }else{
+                 for(var i=starts.getDate();i<=ends.getDate();i++){
+                    if(i==starts.getDate()){
+                      if(endTypes=="00:00:00"){
+                        count+=24;
+                      }else{
+                        count+=12;
+                      }
+                    }else if(i==ends.getDate()){
+                      if(value=="00:00:00"){
+                        count+=12;
+                      }else{
+                        count+=24;
+                      }
+                    }else{
+                      count+=24;
+                    }
+                 }
+               }
+               this.form.setFieldsValue({
+                 holidayCount:count
+               }) 
+             }
+         
+        }
+      },
       queryDeptName(e){
         getAction(this.url.dept,{id:e}).then((res)=>{
           if(res.success){