src/views/engineering/index.vue
@@ -217,8 +217,9 @@ <el-date-picker v-model="form.year " placeholder="选择时间" style="width: 100%" type="date" value-format="yyyy-MM-dd HH:mm:ss"/> type="year" value-format="yyyy" :picker-options="pickerOptions"/> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -304,6 +305,11 @@ this.getDeptList(); }, methods: { pickerOptions: { // 这里可以添加更多的picker选项,但为简化示例,只展示禁用其他日期的逻辑 // 关键设置:显示年份选择器 pickers: ['year'] }, getProjectOwnerUnit(unitId) { console.log(unitId) // if (deptId) {