WXL (wul)
4 天以前 6e7f546cc37ed57e7e2eda4fdfc32fa2b3e0160c
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
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
      <el-form-item label="患者姓名">
        <el-input v-model="queryParams.patname" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" style="width:180px" />
      </el-form-item>
      <el-form-item label="专案类型">
        <el-select v-model="queryParams.subType" placeholder="请选择" clearable style="width:180px">
          <el-option label="孕妇随访" value="pregnancy" />
          <el-option label="更年期随访" value="menopause" />
        </el-select>
      </el-form-item>
      <el-form-item label="科室">
        <el-input v-model="queryParams.deptname" placeholder="请输入科室" clearable @keyup.enter.native="handleQuery" style="width:180px" />
      </el-form-item>
      <el-form-item label="建档日期">
        <el-date-picker v-model="dateRange" style="width:240px" value-format="yyyy-MM-dd" type="daterange"
          range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
 
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="medium" @click="handleCreateStandalone">新建建档</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="medium" :disabled="multiple" @click="handleDelete">删除</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
    </el-row>
 
    <el-table v-loading="loading" :data="displayList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column label="患者姓名" align="center" prop="patname" width="100" />
      <el-table-column label="性别" align="center" width="60">
        <template slot-scope="scope">{{ scope.row.sex == 1 ? '男' : '女' }}</template>
      </el-table-column>
      <el-table-column label="年龄" align="center" prop="age" width="60" />
      <el-table-column label="联系电话" align="center" prop="telcode" width="130" />
      <el-table-column label="科室" align="center" prop="deptname" width="120" show-overflow-tooltip />
      <el-table-column label="诊断" align="center" prop="diagname" min-width="150" show-overflow-tooltip />
      <el-table-column label="专案类型" align="center" width="140">
        <template slot-scope="scope">
          <el-tag :type="scope.row.subType === 'pregnancy' ? 'success' : 'warning'">{{ scope.row.subTypeLabel }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="妊娠情况" align="center" width="120" show-overflow-tooltip>
        <template slot-scope="scope">{{ scope.row.subType === 'pregnancy' ? (scope.row.pregnancyStatus || '-') : '-' }}</template>
      </el-table-column>
      <el-table-column label="随访周期" align="center" width="110" show-overflow-tooltip>
        <template slot-scope="scope">{{ scope.row.subType === 'menopause' ? (scope.row.followupCycles || '-') : '-' }}</template>
      </el-table-column>
      <el-table-column label="登记人员" align="center" prop="registrant" width="100" />
      <el-table-column label="建档时间" align="center" width="160">
        <template slot-scope="scope">{{ scope.row.createTime ? scope.row.createTime.substring(0, 10) : '-' }}</template>
      </el-table-column>
      <el-table-column label="来源" align="center" width="80">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.sourcePage === 'standalone'" type="info" size="mini">独立</el-tag>
          <span v-else>{{ scope.row.sourcePage === 'inpatient' ? '在院' : '门诊' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" fixed="right" width="120">
        <template slot-scope="scope">
          <el-button size="medium" type="text" @click="goDetail(scope.row)">
            <span class="button-textsc"><i class="el-icon-zoom-in" />查看</span>
          </el-button>
          <el-button size="medium" type="text" @click="handleSingleDelete(scope.row)">
            <span style="color:#f56c6c"><i class="el-icon-delete" />删除</span>
          </el-button>
        </template>
      </el-table-column>
    </el-table>
 
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
 
    <ArchiveDialog :visible.sync="createDialogVisible" :standalone="true" @created="getList" />
  </div>
</template>
 
<script>
import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
import { listArchivesByModule, removeArchiveList } from "../apiAdapter";
 
export default {
  name: "MaternalHealthArchive",
  components: { ArchiveDialog },
  data() {
    return {
      loading: false, showSearch: true, multiple: true, ids: [], selectedRows: [], dateRange: [], total: 0, allList: [], displayList: [],
      createDialogVisible: false,
      queryParams: { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" },
    };
  },
  created() { this.getList(); },
  methods: {
    getList() {
      this.loading = true;
      const params = { pageNum: this.queryParams.pageNum, pageSize: this.queryParams.pageSize };
      if (this.queryParams.patname) params.patname = this.queryParams.patname;
      if (this.queryParams.deptname) params.deptname = this.queryParams.deptname;
      // 专案类型:转成后端 archiveType(妇科 1-早孕关爱 2-围绝经期MHI)
      if (this.queryParams.subType) {
        params.archiveType = this.queryParams.subType === "pregnancy" ? "1" : "2";
      }
      if (this.dateRange && this.dateRange.length === 2) {
        params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
      }
      listArchivesByModule("maternal", params)
        .then((res) => {
          this.allList = res.rows || [];
          this.displayList = this.allList;
          this.total = res.total || 0;
        })
        .catch(() => { this.displayList = []; this.total = 0; })
        .finally(() => { this.loading = false; });
    },
    handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
    resetQuery() { this.dateRange = []; this.queryParams = { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" }; this.getList(); },
    handleSelectionChange(s) {
      this.selectedRows = s;
      this.ids = s.map(i => i.id);
      this.multiple = !s.length;
    },
    handleDelete() {
      if (this.ids.length === 0) { this.$modal.msgWarning("请至少选择一条"); return; }
      this.$modal.confirm("确认删除选中档案?").then(() => {
        return removeArchiveList(this.selectedRows).then(() => {
          this.$modal.msgSuccess("删除成功"); this.getList();
        });
      }).catch(() => {});
    },
    handleSingleDelete(row) { this.selectedRows = [row]; this.ids = [row.id]; this.handleDelete(); },
    handleCreateStandalone() { this.createDialogVisible = true; },
    goDetail(row) { this.$router.push({ path: "/filing/maternalDetail", query: { id: row.id, type: row.subType, detailId: row.detailId || "" } }); },
  },
};
</script>
 
<style lang="scss" scoped>
.button-textsc { color: #3664d9; }
</style>