index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20" style="margin-top: 0">
  4. <el-col :span="4" style="box-shadow: 0 3px 10px 0 rgb(0 0 0 / 6%); border-right: 1px solid #f1f2f4; overflow-y: auto; height: 100%">
  5. <el-input
  6. placeholder="输入部门关键字"
  7. :clearable="true"
  8. v-model="filterText">
  9. </el-input>
  10. <div style="height: calc(-203px + 100vh);overflow-y: auto; margin-top: 3px">
  11. <el-tree
  12. class="filter-tree"
  13. :data="deptOptions"
  14. default-expand-all
  15. :filter-node-method="filterNode"
  16. @node-click="handleNodeClick"
  17. ref="tree">
  18. </el-tree>
  19. </div>
  20. </el-col>
  21. <el-col :span="20" style="height: 100%">
  22. <el-form :model="queryParams" ref="queryForm" :inline="true" style="margin-top: 0;">
  23. <el-form-item prop="physician">
  24. <el-input v-model="queryParams.physician" placeholder="请输入主治医生" clearable @keyup.enter.native="handleQuery" class="se" />
  25. </el-form-item>
  26. <el-form-item prop="patientName">
  27. <el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable @keyup.enter.native="handleQuery" class="se" />
  28. </el-form-item>
  29. <el-form-item >
  30. <el-date-picker
  31. v-model="dischargeTime"
  32. type="daterange"
  33. start-placeholder="开始时间"
  34. end-placeholder="结束时间"
  35. value-format="yyyy-MM-dd"
  36. />
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  40. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-table :data="patientList" border @selection-change="selects" height="calc(100vh - 250px)">
  44. <el-table-column type="selection" width="55" align="center" />
  45. <el-table-column label="科室" align="center" prop="department" />
  46. <el-table-column label="患者姓名" align="center" prop="name" />
  47. <el-table-column label="主治医生" align="center" prop="physician" />
  48. <el-table-column label="出院方式" align="center" prop="dischargeMethod">
  49. <template slot-scope="scope">
  50. <dict-tag :options="dict.type.discharge_method" :value="scope.row.dischargeMethod"></dict-tag>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="出院时间" align="center" prop="dischargeTime" />
  54. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  55. <template slot-scope="scope">
  56. <el-button size="mini" type="text" icon="el-icon-search" @click="op('search',scope.row)">查看</el-button>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <pagination v-if="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
  61. </el-col>
  62. </el-row>
  63. </div>
  64. </template>
  65. <script>
  66. import search from "@/views/work/visit/search.vue";
  67. export default {
  68. dicts:['discharge_method'],
  69. name: 'User',
  70. data() {
  71. return {
  72. dischargeTime:[],
  73. filterText:'',
  74. total:0,
  75. // 选中数组
  76. ids: [],
  77. SearchShow:false,
  78. // 非单个禁用
  79. single: true,
  80. // 非多个禁用
  81. multiple: true,
  82. //科室名称
  83. deptName:undefined,
  84. // 部门树选项
  85. deptOptions: null,
  86. //患者表
  87. patientList:null,
  88. //查询参数
  89. queryParams: {
  90. pageNum:1,
  91. pageSize:10,
  92. physician: undefined,
  93. patientName:undefined,
  94. department:undefined,
  95. deptId:undefined,
  96. startTime:undefined,
  97. endTime: undefined
  98. },
  99. };
  100. },
  101. watch: {
  102. dischargeTime(newVal) {
  103. if (newVal && newVal.length === 2) {
  104. this.queryParams.startTime = newVal[0]; // 开始日期
  105. this.queryParams.endTime = newVal[1]; // 结束日期
  106. }
  107. },
  108. filterText(val) {
  109. this.$refs.tree.filter(val);
  110. }
  111. },
  112. created() {
  113. this.getDepartment();
  114. },
  115. methods: {
  116. filterNode(value, data) {
  117. if (!value) return true;
  118. return data.label.indexOf(value) !== -1;
  119. },
  120. // 表单重置
  121. reset() {
  122. this.form = {
  123. physician:undefined,
  124. name:undefined
  125. };
  126. this.resetForm('form');
  127. },
  128. /** 查询患者列表*/
  129. getList(){
  130. this.get({
  131. url:'/work/visit/patientCard',
  132. data: {
  133. ...this.queryParams,
  134. }
  135. }).then((response)=>{
  136. this.patientList = response.rows;
  137. this.total = response.total;
  138. })
  139. },
  140. /** 查询部门 */
  141. getDepartment() {
  142. this.get({
  143. url:'/system/user/deptTree'
  144. }).then((response) => {
  145. this.deptOptions = response.data;
  146. this.queryParams.deptId = response.data[0].id;
  147. this.getList();
  148. });
  149. },
  150. handleNodeClick(data){
  151. if(this.queryParams.deptId === data.id){
  152. return;
  153. }
  154. this.queryParams.deptId = data.id;
  155. this.getList();
  156. },
  157. selects(rows) {
  158. this.ids = rows.map(item => item.id)
  159. },
  160. op(tag, row) {
  161. if (tag === 'search') {
  162. this.iframe({ obj: search, param: {id:row.patId, cardId:row.cardId, name:row.name, department:row.department}, title:'查看患者信息',width: '90%', height: '93%'});
  163. }
  164. },
  165. handleQuery() {
  166. this.queryParams.pageNum = 1;
  167. this.getList();
  168. },
  169. /** 重置按钮操作 */
  170. resetQuery() {
  171. this.dischargeTime = [];
  172. this.queryParams.startTime='';
  173. this.queryParams.endTime='';
  174. this.resetForm('queryForm');
  175. this.handleQuery();
  176. },
  177. }
  178. };
  179. </script>