index.vue 10.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
<template>
  <!-- 随访调查 -->
  <div class="screeningSearch">
    <div class="top">
      <form-components :forms="formList" :formEdit="formEdit" @handleSearch="onSearch"></form-components>
    </div>
    <div class="bot">
      <el-table-self
        ref="table"
        :table-data="tableData"
        :columns="columns"
        :header-class="'newHeader'"
        :list-loading="listLoading"
        :current-page="pageIndex"
        :total-count="total"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        @pageSizeChange="handleSizeChange"
        @currentPageChange="handleCurrentChange"
      />
    </div>
  </div>
</template>
<script>
import FormComponents from "@/components/FormComponents"
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import { getFollowSurvey } from "@/api/followup"
import { getDictDetail } from "@/api/dict.js"
export default {
  components: {
    CustomsTable,
    FormComponents,
  },
  mixins: [paginationMixin],
  data() {
    return {
      listLoading: false,
      keyword: "",
      modifiedFlag: false,
      columns: [
        {
          label: "医联体",
          minWidth: 120,
          value: "unionName",
          formatter: (row) => {
            return row.unionName ? row.unionName : "--"
          },
        },
        {
          label: "姓名",
          minWidth: 120,
          formatter: (row) => {
            return row.name ? row.name : "--"
          },
          value: "name",
        },
        {
          label: "性别",
          minWidth: 80,
          value: "sex",
          formatter: (row) => {
            return this.$handle.formatDicList(this.dictMap["d-sex"], row.sex + "")
          },
        },
        {
          label: "身份证",
          minWidth: 120,
          value: "idCard",
          formatter: (row) => {
            return row.idCard ? row.idCard : "--"
          },
        },
        {
          label: "年龄",
          minWidth: 120,
          value: "age",
          formatter: (row) => {
            return row.age ? row.age : "--"
          },
        },
        {
          label: "筛查时间",
          minWidth: 180,
          value: "screeningTime",
          formatter: (row) => {
            return row.createTime ? row.createTime : "--"
          },
        },
        {
          label: "风险评估结果",
          minWidth: 120,
          value: "riskRank",
          formatter: (row) => {
            return this.$handle.formatDicList(this.dictMap["risk_level"],String(row.riskRank))
          },
        },
        {
          label: "上次随访时间",
          value: "followTime",
          minWidth: 120,
          formatter: (row) => {
            return row.followTime ? row.followTime : "--"
          },
        },
        {
          label: "随访进度",
          value: "followBatch",
          minWidth: 120,
          formatter: (row) => {
            return this.$handle.formatDicList(this.dictMap["follow_type"],String(row.followBatch))
          },
        },
        {
          label: "计划随访时间",
          value: "nextFollowTime",
          formatter: (row) => {
            return this.$handle.formatDicList(this.dictMap["next_follow_time"],String(row.nextFollowTime))
          },
          minWidth: 120,
        },
        {
          label: "操作",
          width: 220,
          fixed: "right",
          operType: "button",
          operations: [
            {
              func: this.rowOpration,
              formatter(row) {
                return {
                  label: " 录入",
                  type: "text",
                }
              },
            },
          ],
        },
      ],
      tableData: [
        {
          "patientId": "1598222607734341634",
          "name": "小飞", //姓名
          "idCard": "340822199510260215", //身份证
          "phone": "18311112222", //手机号
          "sex": 1, //性别
          "birthday": "2022-12-31 00:00:00", //生日
          "age": 18, //年龄
          "id": "", //id
          "unionName": "合肥高新附院", //医联体名称
          "screeningTime": "2022-12-01 00:00:00", //筛查时间
          "riskRank": "", //风险等级
          "followTime": "", //随访时间
          "followContents": "", //随访内容
          "nextFollowTime": "", //计划随访时间
          "followBatch": 0, //随访进度
          "unionId": "2", //联盟id
          "riskScore": "", //风险分数
          "screeningAdvise": "", //筛查建议
          "formRecordId": "", //表单记录id
          "linkPhone": "0556-5556666", //联系方式
          "isContinueFollow": 1, //是否继续随访
          "checkStatus": "", //审核状态
          "riskRank":"medium"
          },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
        {
          name:'11',
        },
      ],//调试
      formList: [
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "select",
          label: "计划随访时间",
          prop: "nextFollowTime",
          trans:'next_follow_time',
          placeholder: "请选择计划随访时间",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "input",
          label: "姓名",
          prop: "name",
          placeholder: "请输入姓名",
          rules: [],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "input",
          label: "身份证",
          prop: "idCard",
          placeholder: "请输入身份证",
          rules: [],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "input",
          label: "医联体",
          prop: "unionName",
          placeholder: "请输入医联体",
          rules: [],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "select",
          label: "随访进度",
          prop: "followBatch",
          trans:'follow_type',
          placeholder: "请选择随访进度",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          xs: 1,
          sm: 2,
          md: 2,
          lg: 2,
          xl: 2,
          type: "btn",
          list: [
            {
              btnType: "button",
              type: "",
              style: {
                width: "80px",
                height: "32px",
                borderRadius: "4px",
                fontSize: "14px",
                marginLeft: "40px",
              },
              btnText: "查询",
              func: this.onSearch
            },
            // {
            //   btnType: "tobeModified",
            //   tobeModified: 20,
            // },
          ],
        },
      ],
      formEdit:{}
    }
  },
  watch: {
    pageSize(val){
      sessionStorage.setItem('followResearch-pageSize',val)
    },
    pageIndex(val){
      sessionStorage.setItem('followResearch-pageIndex',val)
    }
  },
  created(){
    // this.initColumn()
  },
  mounted() {
    this.formEdit = JSON.parse(sessionStorage.getItem('followResearch-form')) ||{}
    this.pageSize = Number(sessionStorage.getItem('followResearch-pageSize')) || 1
    this.pageIndex = Number(sessionStorage.getItem('followResearch-pageIndex')) || 10
    // this.handleSearch() //调试注释
  },
  methods: {
    changeModified() {
      this.modifiedFlag = !this.modifiedFlag
    },
    setSelectedIndex(i) {
      console.log(this.selectedIndex)
      this.selectedIndex = i
      sessionStorage.setItem("homeSelectedIndex", this.selectedIndex)
    },
    changePage(v) {
      this.page[v.type] = v.value
      console.log(this.page)
      this.$refs.customTable.loading = false
    },
    onSearch(form) {
      sessionStorage.setItem('followResearch-form',JSON.stringify(form))
      this.formEdit = form
      this.handleSearch()
    },
    rowOpration(data, i) {
      console.log('跳转',data, i)
      this.$router.push({path:"/followupentry",query:{formEdit:JSON.stringify(data)}})
    },
    async handleSearch(){
      this.listLoading = true
      let params={
        pageSize:this.pageSize,
        pageNum:this.pageIndex
      }
      if(this.formEdit){
        params=Object.assign(this.formEdit,params)
      }
      let res = await getFollowSurvey(params)
      if(res.code==1){
        //分页内容
        const d = res.data
        this.total= d.total
        this.tableData=d['records']
      }
      this.listLoading = false
    },
    // initColumn(){
    //   this.columns.forEach((item,index) => {
    //     if(item.trans){
    //       this.initDict(item.trans,index)
    //     }
    //   })
    // },
    // async initDict(type,index){
    //   let params={
    //     type:type
    //   }
    //   const res = await getDictDetail(params)
    //   let item = this.formList.find(_ => _.trans == type)
    //   res.data.forEach((itemD,inx) => {
    //     // if(!this.columns[index]['transList']){
    //     //    this.columns[index]['transList']={}
    //     // }
    //     // else{
    //     //   this.columns[index]['transList'][itemD.code]=itemD.name
    //     // }
    //     if(item){
    //       if(!item['opts']){
    //        item['opts']=[]
    //     }
    //     else {
    //         item['opts']=res.data.map((_) => {
    //           return {
    //             label: _.name,
    //             value: _.code,
    //           }
    //         })
    //       }
    //     }
    //   })
    // }
  },
}
</script>
<style lang="scss" scoped>
.screeningSearch {
  .top {
    width: 100%;
    // height: 72px;
    padding: 0 116px 0 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .bot {
    padding: 0 24px;
  }
}
</style>