LiGuang před 2 roky
rodič
revize
a99428093b
1 změnil soubory, kde provedl 20 přidání a 8 odebrání
  1. 20 8
      src/views/system/modules/UserModal.vue

+ 20 - 8
src/views/system/modules/UserModal.vue

@@ -280,9 +280,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8" :lg="8">
-            <a-form-item v-if="!isEdit" label="合同结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-             <a-date-picker  style="width: 70%" placeholder="请选择试合同结束日期"
-               v-model="cEndDate"
+            <a-form-item v-if="!isEdit" label="合同日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
+             <a-date-picker v-decorator="['cEndDate', {rules: [{ required: true, message: '请选择结束日期'}]}]"  style="width: 70%" placeholder="请选择试合同结束日期"
+               
                />
             </a-form-item>
           </a-col>
@@ -951,7 +951,7 @@
             'nationality', 'trialMoth', 'entryDate', 'trialEndDate', 'workMoth', 'divisionMoth',
             'infoSy', 'syFund', 'category', 'employmentStatus', 'wagesOne', 'wagesTwo', 'security', 'wagesBase',
             'homeAddr', 'education', 'school', 'contractDate', 'contractDate2', 'type', 'contractDate3',
-            'shareDept','contractType'))
+            'shareDept','contractType','cEndDate'))
         });
         //身份为上级显示负责部门,否则不显示
         if (this.model.userIdentity == "2") {
@@ -1068,7 +1068,6 @@
         this.statet=false;
         const that = this;
         // 触发表单验证
-        
         this.form.validateFields((err, values) => {
           if (!err) {
             that.confirmLoading = true;
@@ -1109,7 +1108,7 @@
             formData.urgentPhone=this.urgentPhone;
             formData.wagesBase=this.wagesBase;
             formData.age=this.age;
-            formData.cEndDate=this.cEndDate;
+           // formData.cEndDate=this.cEndDate;
             
             //如果是上级择传入departIds,否则为空
             // if (this.identity === "2") {
@@ -1202,7 +1201,7 @@
             if (this.wkDate != null && this.wkDate != "") {
               var date = new Date(this.wkDate)
               var num = this.wkMoth;
-              var d =moment(new Date());
+              var d =moment(date);
               if(num!=0&&num!='0'){
                 date.setMonth(date.getMonth() + num)
                  d=moment(date).subtract(1, "days");
@@ -1248,6 +1247,10 @@
               da.setFullYear(da.getFullYear()+1)
               this.cEndDate=moment(da).subtract(1, "days");
             }
+            
+            this.form.setFieldsValue({
+              cEndDate:this.cEndDate
+            })
           }
 
           this.wkDate = value;
@@ -1296,7 +1299,9 @@
              da.setFullYear(da.getFullYear()+1)
              this.cEndDate=moment(da).subtract(1, "days");
            }
-            
+            this.form.setFieldsValue({
+              cEndDate:this.cEndDate
+            })
          }else if(date==null){
            callback("请输入入职日期!")
          }
@@ -1320,6 +1325,12 @@
         if (!value) {
           callback()
         } else {
+          if (!RegExp(/^[A-Za-z]*$/).test(value)) {
+            this.form.setFieldsValue({
+              egName: value.replace(/[^A-Za-z]/g,"")
+            })
+          }else{
+          
           this.egName = value.substr(0, 1).toLowerCase() + value.substr(1, value.length);
           this.form.setFieldsValue({
             egName: value.substr(0, 1).toUpperCase()+ value.substr(1, value.length)
@@ -1347,6 +1358,7 @@
              
           }
           callback()
+          }
         }
       },
       validatesyFund(rule, value, callback) {