k94314517
2025-04-16 14e0babcc1bed5e899342fa5536eafc4340cd899
admin/src/views/business/workorderShe.vue
@@ -3,13 +3,25 @@
    <!-- 搜索表单 -->
    <div slot="search-form">
      <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
        <el-form-item label="伤害类型" prop="typeId">
          <el-cascader  v-model="searchForm.categoryList" :options="categorys" @change="handleChangeCategory" :show-all-levels="false"
        <el-form-item label="伤害类型" prop="typeIdPath">
<!--          <el-cascader  v-model="searchForm.categoryList" :options="categorys" @change="handleChangeCategory" :show-all-levels="false"
                        clearable filterable :props="categoryprops"  >
            <template slot-scope="{ node, data }">
              <span>{{ data.name }}</span> <!-- 自定义显示内容 -->
              <span>{{ data.name }}</span> &lt;!&ndash; 自定义显示内容 &ndash;&gt;
            </template>
          </el-cascader>
          </el-cascader>-->
          <treeselect
              style="width: 150px"
              v-model="searchForm.typeIdPath"
              placeholder="伤害类型"
              clearable
              :options="categorys"
              :normalizer="normalizeOptions"
              :default-expand-level="1"
              @input="search"
              noChildrenText="没有子选项"
              noOptionsText="没有可选项"
              noResultsText="没有匹配的结果" />
        </el-form-item>
        <el-form-item label="上报人员" prop="memberName">
          <el-input v-model="searchForm.memberName" clearable placeholder="人员姓名或手机号" @keypress.enter.native="search"></el-input>
@@ -56,6 +68,7 @@
            <span v-else>本人</span>
          </template>
        </el-table-column>
        <el-table-column prop="happenTime" label="发现时间" min-width="150px"></el-table-column>
        <el-table-column prop="locationName" label="发生地点" min-width="100px"></el-table-column>
        <el-table-column prop="remark" label="具体位置" min-width="100px"></el-table-column>
          <el-table-column prop="outJiuyi" label="就医情况" min-width="100px">
@@ -127,7 +140,8 @@
        memberName: '',
        memberCompanyId: '',
        localtionId: '',
        typeId: '',
        typeId: null,
        typeIdPath: null,
        code: '',
        categoryList: []
      },
@@ -151,6 +165,17 @@
    this.search()
  },
  methods: {
    normalizeOptions(node) {
      if (node.childList && !node.childList.length) {
        // 去掉children=[]的children属性
        delete node.childList;
      }
      return {
        id: node.idPath,
        label: node.name,
        children: node.childList,
      };
    },
    handleChangeCategory (value) {
      if (this.searchForm.categoryList && this.searchForm.categoryList.length >= 1) {
        this.searchForm.typeId = this.searchForm.categoryList[this.searchForm.categoryList.length - 1]