handleChangeViewB.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. Vue.component('comB', {
  2. template: '<div class="tab2" >\
  3. <template>\
  4. <span>就诊类型:</span> \
  5. <el-select v-model="eventType" placeholder="请选择">\
  6. <el-option v-for="item in event_type" :key="item.code" :label="item.name" :value="item.code">\
  7. </el-option>\
  8. </el-select>\
  9. <span>机构等级:</span> \
  10. <el-select v-model="level" placeholder="请选择" @change="selectChange">\
  11. <el-option v-for="item in level_id" :key="item.code" :label="item.name" :value="item.code">\
  12. </el-option>\
  13. </el-select>\
  14. <el-select v-model="hos" placeholder="请选择">\
  15. <el-option v-for="item in hos_hierarchy" :key="item.code" :label="item.name" :value="item.code">\
  16. </el-option>\
  17. </el-select>\
  18. <el-date-picker v-model="value4" type="month" placeholder="选择时间">\
  19. </el-date-picker>\
  20. <div class="search" @click="searchClick">搜 索</div>\
  21. <span class="span" >{{feiyong}}</span>\
  22. <el-table :data="tableData" border style="width: 100%">\
  23. <el-table-column prop="event_date" label="就诊时间">\
  24. </el-table-column>\
  25. <el-table-column prop="patient_name" label="姓名">\
  26. </el-table-column>\
  27. <el-table-column prop="demographic_id" label="身份证号" >\
  28. </el-table-column>\
  29. <el-table-column prop="fee" label="就诊费用">\
  30. </el-table-column>\
  31. <el-table-column prop="diagnosis" label="主要诊断">\
  32. </el-table-column>\
  33. <el-table-column label="性别">\
  34. <template slot-scope="scope">\
  35. <span v-if="scope.row.patient_sex == 1">男</span>\
  36. <span v-else>女</span>\
  37. </template>\
  38. </el-table-column>\
  39. <el-table-column prop="patient_age" label="年龄">\
  40. </el-table-column>\
  41. <el-table-column prop="address" label="家庭地址" >\
  42. </el-table-column>\
  43. <el-table-column fixed="right" label="操作">\
  44. <template slot-scope="scope">\
  45. <el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>\
  46. </template>\
  47. </el-table-column>\
  48. </el-table>\
  49. <div class="flex f_y_c f_x_e">\
  50. <el-pagination @size-change="handleSizeChange" background @current-change="handleCurrentChange" :current-page="currentPage"\
  51. :page-sizes=" pageSizeArr" :page-size="pageSize" layout="total,sizes,prev, pager, next, jumper"\
  52. :total="total">\
  53. </el-pagination>\
  54. </div>\
  55. </template>\
  56. </div>',
  57. data: function () {
  58. return {
  59. currentPage: 1, //初始页
  60. pageSize: 10, // 每页的数据
  61. pageSizeArr: [10, 20, 30, 50],
  62. tableData: [],
  63. feiyong: '',
  64. total: 0,
  65. eventType: '0',
  66. item: '',
  67. hosLevel: '',
  68. level: "",
  69. hos: "",
  70. value4: new Date(),
  71. event_type: [{
  72. "code": '0',
  73. "name": '门急诊'
  74. }, {
  75. "code": '1',
  76. "name": '住院'
  77. }],
  78. hos_hierarchy: [{
  79. "code": '',
  80. "name": '全部'
  81. }, {
  82. "code": "1",
  83. "name": '甲等'
  84. }, {
  85. "code": "2",
  86. "name": '乙等'
  87. }, {
  88. "code": "3",
  89. "name": '丙等'
  90. }],
  91. level_id: [{
  92. "code": "",
  93. "name": '全部',
  94. }, {
  95. "code": "1",
  96. "name": '一级'
  97. }, {
  98. "code": "2",
  99. "name": '二级'
  100. }, {
  101. "code": "3",
  102. "name": '三级'
  103. },
  104. ]
  105. }
  106. },
  107. watch: {
  108. },
  109. mounted: function () {
  110. this.getData()
  111. },
  112. methods: {
  113. handleClick: function (row) {
  114. demographic_id = row.demographic_id,
  115. blurry_type = row.eventType,
  116. searchParam = ''
  117. var url = httpRequest.server + '/profile/app/medication/html/jiuzhen-item.html?' +
  118. 'healthProblemName=' + '&demographic_id=' + demographic_id + '&blurry_type=' + blurry_type + '&searchParam=' + searchParam
  119. console.log(url)
  120. // window.open(url)
  121. var width = 1000 + 'px';
  122. var height = 600+ 'px';
  123. top.layer.open({
  124. id: 'Lay_xiangqingB',
  125. type: 2,
  126. title: false,
  127. closeBtn: 0,
  128. shade: 0.5,
  129. shadeClose: true,
  130. area: [width, height],
  131. content: url
  132. })
  133. },
  134. selectChange(value) {
  135. console.log(value);
  136. if (value == 3) {
  137. this.hos_hierarchy.push({ 'code': '9', "name": '特等' })
  138. this.hos = ''
  139. } else {
  140. if (this.level.code == 3) {
  141. this.hos = ''
  142. } else {
  143. this.hos = ''
  144. var vm = this.hos_hierarchy[0].code
  145. console.log(vm)
  146. this.hos_hierarchy.splice(4)
  147. }
  148. }
  149. },
  150. handleCurrentChange: function (val) { //page 当前页
  151. this.currentPage = val;
  152. this.getData()
  153. },
  154. handleSizeChange: function (val) {// size 页面展示数据条数
  155. this.pageSize = val;
  156. this.initData()
  157. },
  158. searchClick: function () {
  159. console.log(this.eventType)
  160. this.initData()
  161. this.getFeiYongStr()
  162. },
  163. initData: function () { //初始化数据
  164. this.currentPage = 1;
  165. this.getData()
  166. },
  167. getData: function () {
  168. var vm = this;
  169. var params = {
  170. month: this.value4.format('yyyy-MM'),
  171. eventType: this.eventType,
  172. hosLevel: this.level,
  173. hosHierarchy: this.hos,
  174. size: this.pageSize,
  175. page: this.currentPage
  176. }
  177. GlobalEventBus.$emit('setLoading', {
  178. loading: true
  179. });
  180. bigDataOutApi.getHighCostList(params).then(function (res) {
  181. console.log(res)
  182. GlobalEventBus.$emit('setLoading');
  183. vm.tableData = res.detailModelList;
  184. vm.total = res.totalCount;
  185. var obj = res.obj;
  186. vm.getFeiYongStr(obj)
  187. console.log(obj)
  188. }).catch(function (err) {
  189. console.log(err)
  190. GlobalEventBus.$emit('setLoading');
  191. })
  192. },
  193. getFeiYongStr: function (obj) {
  194. debugger
  195. if (this.eventType == "0") {
  196. this.feiyong = '门急诊费用>=' + obj .toFixed(2)+' ('+ obj.toFixed(2)+'='+ (obj/5).toFixed(2) +'(上月门急诊次均费用)*5)'
  197. } else {
  198. this.feiyong = '住院费用>=' + obj .toFixed(2)+' ('+ obj.toFixed(2)+'='+ (obj/5).toFixed(2) +'(上月住院次均费用)*5)'
  199. }
  200. }
  201. }
  202. })