Lijy 1 éve
szülő
commit
eb2716a78b

+ 13 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -9,8 +9,8 @@
         <div class="OutSide_center">
           <div class="block">
             <span class="demonstration">查询以往{{ titleText }}</span>
-            <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" @change="getTableData(hasChooseDept)"
-              placeholder="选择日期" size="small">
+            <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" :clearable="false" @change="getTableData(hasChooseDept)"
+              placeholder="选择日期" size="small" :picker-options="planType == 1 ? toMPickerOptions : todayPickerOptions">
             </el-date-picker>
           </div>
           <div class="OutSide" style="padding-bottom: 0;">
@@ -196,6 +196,16 @@ export default {
   },
   data() {
     return {
+      todayPickerOptions: {
+        disabledDate(v) {
+          return v.getTime() > Date.now();
+        }
+      },
+      toMPickerOptions: {
+        disabledDate(v) {
+          return v.getTime() < Date.now();
+        }
+      },
       steelStampNumber: "",
       planDate: this.todayDate,
       deptSetDialog: false,
@@ -258,6 +268,7 @@ export default {
   watch: {},
   created() { },
   mounted() {
+    console.log(this.planType, '费雷')
     this.getDepartmentList(),
       this.getPlanDeptSet(),
       this.getHasSetPlanDeptList(),