xiangpei
2025-03-03 fabe25575a7b8c8d4bef61c4ef4deaa7dc219cfe
src/views/engineering/index.vue
@@ -105,7 +105,7 @@
      default-expand-all
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
      :show-overflow-tooltip="true">
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="项目名称" prop="projectName" />
      <el-table-column label="项目推进类型" align="center" prop="projectType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/>
@@ -133,18 +133,21 @@
            size="mini"
            type="text"
            icon="el-icon-plus"
            style="margin-right: 10px"
            @click="handleadd(scope.row)"
          >添加子工程</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            v-if="!isProject(scope.row.id)"
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            v-if="!isProject(scope.row.id)"
            @click="deleteById(scope.row)"
          >删除</el-button>
        </template>
@@ -217,8 +220,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 +308,15 @@
    this.getDeptList();
  },
  methods: {
    pickerOptions: {
      // 这里可以添加更多的picker选项,但为简化示例,只展示禁用其他日期的逻辑
      // 关键设置:显示年份选择器
      pickers: ['year']
  },
    isProject(id) {
      const numericPattern = /^\d+(\.\d+)?$/;
      return numericPattern.test(id)
    },
    getProjectOwnerUnit(unitId) {
      console.log(unitId)
      // if (deptId) {