managementDept.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="container">
  3. <view class="top-box">
  4. <view class="select-item" @click="showSelect(1)">
  5. <span class="name">{{params.hospitalId ? hospitalName : '全部医院'}}</span>
  6. <image src="/static/下箭头.png" mode="aspectFill"></image>
  7. </view>
  8. <view class="select-item" @click="showSelect(2)">
  9. <span class="name">{{params.departmentId ? deptName : '全部科室'}}</span>
  10. <image src="/static/下箭头.png" mode="aspectFill"></image>
  11. </view>
  12. </view>
  13. <view class="main-info">
  14. <view class="title">
  15. 订单汇总信息
  16. </view>
  17. <view class="num-box ">
  18. <view class="num-item flex-box-cloum">
  19. <span class="num">{{statisticsInfo.inProgressCount || 0}}</span>
  20. <span class="name">服务中</span>
  21. </view>
  22. <view class="num-item flex-box-cloum">
  23. <span class="num">{{statisticsInfo.finishCount || 0}}</span>
  24. <span class="name">已完成</span>
  25. </view>
  26. <view class="num-item flex-box-cloum">
  27. <span class="num">{{statisticsInfo.orderCount || 0}}</span>
  28. <span class="name">累计订单数</span>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="hospital-list">
  33. <view class="hospital-item" v-for="item,index in deptList" :key="index">
  34. <view class="title-box">
  35. <u-icon name="calendar" color="#2979ff" size="28"></u-icon>
  36. <span class="name">{{item.hospitalName || ''}}-{{item.departmentName || ''}}</span>
  37. </view>
  38. <view class="num-box">
  39. <view class="num-item flex-box-cloum">
  40. <span class="num">{{item.inProgressCount || 0}}</span>
  41. <span class="name">服务中</span>
  42. </view>
  43. <view class="num-item flex-box-cloum">
  44. <span class="num">{{item.finishCount || 0}}</span>
  45. <span class="name">已完成</span>
  46. </view>
  47. <view class="num-item flex-box-cloum">
  48. <span class="num">{{item.orderCount || 0}}</span>
  49. <span class="name">累计订单数</span>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <u-action-sheet :show="showAction" :actions="hospitalList" title="请选择" @close="showAction = false"
  55. :closeOnClickOverlay="true" :closeOnClickAction="true" @select="actionSelect">
  56. </u-action-sheet>
  57. <u-action-sheet :show="showDept" :actions="deptActions" title="请选择" @close="showDept = false"
  58. :closeOnClickOverlay="true" :closeOnClickAction="true" @select="deptSelect">
  59. </u-action-sheet>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. getDepartmentList,
  65. getHospitalListByManage,
  66. getDepartmentListByManage,
  67. getDepartmentOrderCount
  68. } from '@/api/hospital.js'
  69. export default {
  70. data() {
  71. return {
  72. showAction: false,
  73. hospitalId: undefined,
  74. actions: [],
  75. hospitalList: [],
  76. hospitalName: '',
  77. deptList: [],
  78. departmentId: '',
  79. showDept: false,
  80. deptActions: [],
  81. deptName: '',
  82. statisticsInfo: null,
  83. params: {
  84. hospitalId: undefined,
  85. departmentId: undefined
  86. },
  87. }
  88. },
  89. onLoad() {
  90. this.getHospitalList();
  91. this.getDepartmentOrderCount()
  92. },
  93. methods: {
  94. //获取于老师关联的医院
  95. getHospitalList() {
  96. let that = this;
  97. getHospitalListByManage().then(res => {
  98. if (res.code == 200) {
  99. let data = res.data;
  100. data.unshift({
  101. id: '',
  102. name: '全部医院',
  103. })
  104. that.hospitalList = data;
  105. }
  106. })
  107. .catch((err) => {
  108. console.log(err);
  109. })
  110. },
  111. //获取管理老师关联的科室订单统计
  112. getDepartmentOrderCount() {
  113. let that = this;
  114. uni.showLoading({
  115. title: '加载中',
  116. mask: true,
  117. });
  118. getDepartmentOrderCount(that.params).then(res => {
  119. if (res.code == 200) {
  120. if (res.data) {
  121. that.statisticsInfo = res.data;
  122. that.deptList = res.data.departmentOrderCountList
  123. }
  124. }
  125. }).catch((err) => {
  126. console.log(err);
  127. }).finally(() => {
  128. uni.hideLoading();
  129. })
  130. },
  131. //获取科室列表
  132. getDepartmentList() {
  133. let that = this;
  134. let param = {
  135. hospitalId: that.params.hospitalId
  136. };
  137. getDepartmentListByManage(param).then(res => {
  138. if (res.code == 200) {
  139. // this.actions = res.data
  140. let data = res.data
  141. data.unshift({
  142. id: '',
  143. name: '全部科室',
  144. })
  145. this.deptActions = data
  146. }
  147. })
  148. },
  149. showSelect(type) {
  150. switch (type) {
  151. case 1:
  152. this.showAction = true;
  153. break;
  154. case 2:
  155. this.showDept = true;
  156. break;
  157. }
  158. },
  159. deptSelect(e) {
  160. console.log(e);
  161. this.showDept = false;
  162. this.params.departmentId = e.id
  163. this.deptName = e.name
  164. this.getDepartmentOrderCount()
  165. },
  166. actionSelect(e) {
  167. console.log(e);
  168. this.showAction = false;
  169. this.params.hospitalId = e.id
  170. this.hospitalName = e.name
  171. this.getDepartmentList();
  172. this.getDepartmentOrderCount()
  173. },
  174. }
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. .container {
  179. padding: 20rpx;
  180. .top-box {
  181. display: flex;
  182. align-items: center;
  183. .select-item {
  184. display: flex;
  185. align-items: center;
  186. justify-content: space-between;
  187. padding: 20rpx;
  188. border-radius: 10rpx;
  189. background-color: #fff;
  190. flex: 1;
  191. &:first-child {
  192. margin-right: 20rpx;
  193. }
  194. .name {
  195. font-size: 30rpx;
  196. }
  197. image {
  198. width: 40rpx;
  199. height: 40rpx;
  200. }
  201. }
  202. }
  203. .main-info {
  204. background-color: #fff;
  205. border-radius: 10rpx;
  206. padding: 20rpx;
  207. margin-top: 20rpx;
  208. .title {
  209. width: 100%;
  210. padding: 0 20rpx;
  211. text-align: center;
  212. }
  213. }
  214. .hospital-list {
  215. .hospital-item {
  216. padding: 20rpx;
  217. margin-top: 20rpx;
  218. background-color: #fff;
  219. border-radius: 10rpx;
  220. .title-box {
  221. display: flex;
  222. align-items: center;
  223. padding: 0 20rpx;
  224. }
  225. }
  226. }
  227. .num-box {
  228. display: flex;
  229. align-items: center;
  230. justify-content: space-around;
  231. margin-top: 20rpx;
  232. .num-item {
  233. .num {
  234. font-size: 32rpx;
  235. font-weight: bold;
  236. }
  237. .name {
  238. margin-top: 10rpx;
  239. font-size: 28rpx;
  240. color: #666666;
  241. }
  242. }
  243. }
  244. }
  245. </style>