ruoyi-ui/src/views/honor/index.vue
@@ -38,7 +38,6 @@
                  </tablemax>
                </div>-->
        <!--        v-model="queryParams.id"
                  v-model:phone="queryParams.phone"
@@ -61,16 +60,31 @@
        </el-input>
      </el-form-item>
      <el-form-item label="类别" prop="type" >
        <el-input
<!--        <el-input-->
<!--          v-model="queryParams.type"-->
<!--          placeholder="请输入类别"-->
<!--          clearable-->
<!--          style="width: 240px"-->
<!--          @keyup.enter.native="handleQuery">-->
<!--          <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
<!--        </el-input>-->
        <el-select
          v-model="queryParams.type"
          placeholder="请输入类别"
          placeholder="所有类别"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery">
          <i slot="prefix" class="el-input__icon el-icon-search"></i>
        </el-input>
          @keyup.enter.native="handleQuery"
        >
          <el-option
            v-for="dict in typeOptions"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="级别" prop="grade">
        <el-input
@@ -91,14 +105,14 @@
      </el-form-item>
    </el-form>
    <div>
      <div style="width: 171px;
                  height: 28px;
                  font-size: 21px;
                  font-family: Microsoft YaHei-Regular, Microsoft YaHei;
                  font-weight: 400;
                  color: #000000;
                  line-height: 25px;
      ">证件、荣誉、资质</div>
<!--      <div style="width: 171px;-->
<!--                  height: 28px;-->
<!--                  font-size: 21px;-->
<!--                  font-family: Microsoft YaHei-Regular, Microsoft YaHei;-->
<!--                  font-weight: 400;-->
<!--                  color: #000000;-->
<!--                  line-height: 25px;-->
<!--      ">证件、荣誉、资质</div>-->
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
@@ -170,7 +184,8 @@
        <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '————'}}</template>
      </el-table-column>
      <el-table-column label="类别" prop="type" sortable :show-overflow-tooltip="true" width="120" align="center" >
        <template slot-scope="scope">{{scope.row.type? scope.row.type: '————'}}</template>
<!--        <template slot-scope="scope">{{scope.row.type? scope.row.type: '————'}}</template>-->
        <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>
      </el-table-column>
      <el-table-column label="名称" prop="name" sortable :show-overflow-tooltip="true" width="120" align="center" >
        <template slot-scope="scope">{{scope.row.name? scope.row.name: '————'}}</template>
@@ -187,8 +202,12 @@
      <el-table-column label="获得时间" prop="getDate" sortable width="170" align="center" >
        <template slot-scope="scope">{{scope.row.getDate? scope.row.getDate: '————'}}</template>
      </el-table-column>
      <el-table-column label="存放位置" prop="location" sortable width="170" align="center" >
        <template slot-scope="scope">{{scope.row.location? scope.row.location: '————'}}</template>
      </el-table-column>
      <el-table-column label="电子文件" prop="url" width="160" align="center">
        <template slot-scope="scope" >
          <div  @click="handleCheck(scope.row)">
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceLis.png"
@@ -204,7 +223,7 @@
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url ===',' "
          >
          ></div>
        </template>
      </el-table-column>
      <el-table-column label="备注" prop="remark" sortable width="120" align="center">
@@ -228,12 +247,12 @@
            v-hasPermi="['system:role:remove']"
          >删除</el-button>
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-d-arrow-right"-->
<!--            @click="handleCheck(scope.row)">-->
<!--            查看详情</el-button>-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-d-arrow-right"
            @click="handleCheck(scope.row)">
            查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -252,12 +271,19 @@
      <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
        <el-form-item label="时间" prop="createTime">
          <el-input v-model="formDat.createTime" placeholder="请输入创建时间" clearable :style="{width: '100%'}" >
          <el-input v-model="formDat.createTime" type='date' placeholder='选择日期' clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
<!--        <el-form-item label="获得时间" prop="happenTime">-->
<!--          <el-date-picker v-model='formDat.happenTime' type='date' placeholder='选择日期'></el-date-picker>-->
<!--        </el-form-item>-->
        <el-form-item label="类别" prop="type">
          <el-input v-model="formDat.type" placeholder="请输入类别" clearable :style="{width: '100%'}" >
          </el-input>
<!--          <el-input v-model="formDat.type" placeholder="请输入类别" clearable :style="{width: '100%'}" >-->
<!--          </el-input>-->
          <el-select v-model="formDat.type" placeholder="请选择类别" clearable :style="{width: '100%'}"  >
            <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="名称" prop="name">
          <el-input v-model="formDat.name" placeholder="请输入名称" clearable :style="{width: '100%'}" ></el-input>
@@ -271,11 +297,12 @@
          </el-input>
        </el-form-item>
        <el-form-item label="有效时间" prop="validityDate">
          <el-input v-model="formDat.validityDate" placeholder="请输入有效时间" clearable :style="{width: '100%'}" >
          <el-input v-model="formDat.validityDate" type='date' placeholder='选择日期' clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="获得时间" prop="getDate">
          <el-input v-model="formDat.getDate" placeholder="请输入获得时间" clearable :style="{width: '100%'}" >
          <el-input v-model="formDat.getDate" type='date' placeholder='选择日期' clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="存放位置" prop="location">
@@ -367,7 +394,7 @@
//导入接口函数
import {listHonor,enload, addHonor,updateHonor, delHonor,uploadPic} from "@/api/honor/index";
import {listHonor,enload, addHonor,updateHonor, delHonor,uploadPic,getCategory} from "@/api/honor/index";
import { Notification, MessageBox, Message, Loading } from 'element-ui'
export default {
@@ -498,12 +525,13 @@
          trigger: 'blur'
        }],
      },
      selected:'',
      typeOptions: [],
    };
  },
  created() {
    this.getList();
    // this.getCateInfor()
    this.getCateInfor()
    // for (let i = 0; i < this.contactList.length; i++) {
    //   this.formDat[i] = this.contactList[i];
    // }
@@ -526,7 +554,9 @@
    /** 查询记录列表 */
    getList() {
      this.loading = true;
      // console.log(this.queryParams)
      console.log(this.queryParams)
      this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
      this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listHonor(this.queryParams).then(response => {
          //  alert(123)
@@ -539,16 +569,40 @@
      );
    },
    /** 查询类别信息 */
    // getCateInfor()
    // {
    //   let _this = this
    //   getCategory().then(response=>{
    //
    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
    //     })
    //   })
    // },
    getCateInfor()
    {
      let _this = this
      getCategory().then(response=>{
        response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
          _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
        })
      })
    },
    //类别选择
    getSrc(type) {
      if (type === 1){
        return '出生证'
      }else if(type === 2){
        return '学生证'
      }else if(type === 3){
        return '毕业证'
      }else if(type === 4){
        return '结婚证'
      }else if(type === 5){
        return '户口簿'
      }else if(type === 6){
        return '独生子女证'
      }else if(type === 7){
        return '高级职称'
      }else if(type === 8){
        return '护照'
      }else if(type === 9){
        return '通行证'
      }else {
        return '其它'
      }
    },
    handleRemove(file) {
      alert(323)
@@ -626,7 +680,7 @@
    /** 查看详细信息 */
    handleCheck(row){
      const id = row.id;
      this.$router.push("/familymodel/Doctor/doctorInfo/" + id);
      this.$router.push("/self/Honor/honorInfo/" + id);
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
@@ -634,7 +688,7 @@
      let jd = true
      this.$router.push({
        path:"/familymodel/Doctor/doctorInfo/" + id,
        path:"/self/Honor/honorInfo/" + id,
        query:{
          detail:jd
        }