index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <div class="dashboard-container">
  3. <div class="dashboard-editor-container" v-hasPermi="['his:index']">
  4. <panel-group />
  5. <div class="divBox">
  6. <el-card :bordered="false" dis-hover>
  7. <div slot="header">
  8. <div class="acea-row row-middle">
  9. <el-avatar
  10. icon="el-icon-s-operation"
  11. size="small"
  12. style="color: #1890ff; background: #e6f7ff; font-size: 13px"
  13. />
  14. <span class="ivu-pl-8" style="vertical-align: top;">订单统计</span>
  15. <el-link type="primary" :underline="false" class="ivu-pl-8" style="float: right; levertical-align: top;" @click="getDocT(0)">总排行</el-link>
  16. <el-link type="primary" :underline="false" class="ivu-pl-8" style="float: right; levertical-align: top;" @click="getDocT(1)">本年排行</el-link>
  17. <el-link type="primary" :underline="false" class="ivu-pl-8" style="float: right; levertical-align: top;" @click="getDocT(2)">本月排行</el-link>
  18. <el-link type="primary" :underline="false" class="ivu-pl-8" style="float: right; levertical-align: top;" @click="getDocT(3)">本周排行</el-link>
  19. <el-link type="primary" :underline="false" class="ivu-pl-8" style="float: right; levertical-align: top;" @click="getDocT(4)">今日排行</el-link>
  20. </div>
  21. </div>
  22. <el-row :gutter="24">
  23. <el-col
  24. :xl="16"
  25. :lg="16"
  26. :md="24"
  27. :sm="24"
  28. :xs="24"
  29. class="ivu-mb mb10 dashboard-console-visit"
  30. >
  31. <span >药品订单统计</span>
  32. <store-order-money />
  33. <span>问诊统计</span>
  34. <inquiry-order-money />
  35. </el-col>
  36. <el-col
  37. :xl="8"
  38. :lg="8"
  39. :md="24"
  40. :sm="24"
  41. :xs="24"
  42. class="ivu-mb mb10 dashboard-console-visit"
  43. >
  44. <span class="ivu-pl-8" >医生问诊排行榜TOP10</span>
  45. <div style=" margin-bottom: 50px;"></div>
  46. <doctor-chart ref="getDoc" />
  47. </el-col>
  48. </el-row>
  49. </el-card>
  50. </div>
  51. </div>
  52. <div class="dashboard-editor-container">
  53. {{greeting}}:{{user.nickName}}
  54. <span style="margin-left: 20px;color: gray;">{{ currentTime }}</span>
  55. <span style="margin-left: 20px;color: gray;">{{ currentDay }}</span>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import doctorChart from "./components/his/doctorChart.vue";
  61. import PanelGroup from "./components/his/panelGroup.vue";
  62. import StoreOrderMoney from "./components/his/storeOrderMoney.vue";
  63. import inquiryOrderMoney from "./components/his/inquiryOrderMoney.vue";
  64. import user from "../store/modules/user";
  65. export default {
  66. name: 'Index',
  67. components: {
  68. PanelGroup,StoreOrderMoney,doctorChart,inquiryOrderMoney
  69. },
  70. data() {
  71. return {
  72. data:null,
  73. currentTime: '',
  74. currentDay: '',
  75. greeting:'',
  76. }
  77. },
  78. created() {
  79. //this.getIndex();
  80. console.log(this.user);
  81. },
  82. computed: {
  83. user(){
  84. return this.$store.state.user.user;
  85. }
  86. },
  87. methods: {
  88. // getIndex() {
  89. // this.loading = true;
  90. // getIndex().then(response => {
  91. // this.data = response.data;
  92. //
  93. // });
  94. // },
  95. getDocT(row){
  96. setTimeout(() => {
  97. this.$refs.getDoc.getDoc(row);
  98. }, 1);
  99. },
  100. updateTime() {
  101. const now = new Date();
  102. const year = now.getFullYear();
  103. const month = String(now.getMonth() + 1).padStart(2, '0');
  104. const day = String(now.getDate()).padStart(2, '0');
  105. const hours = String(now.getHours()).padStart(2, '0');
  106. const minutes = String(now.getMinutes()).padStart(2, '0');
  107. const seconds = String(now.getSeconds()).padStart(2, '0');
  108. this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  109. const ampm = hours >= 12 ? '下午' : '上午';
  110. this.greeting = `${ampm}好`;
  111. const daysOfWeek = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  112. this.currentDay = daysOfWeek[now.getDay()];
  113. },
  114. },
  115. mounted() {
  116. // 更新时间并设置定时器每秒更新一次
  117. this.updateTime();
  118. setInterval(() => {
  119. this.updateTime();
  120. }, 1000);
  121. },
  122. }
  123. </script>
  124. <style rel="stylesheet/scss" lang="scss" scoped>
  125. .count{
  126. margin: 10px;
  127. padding-bottom: 25px;
  128. }
  129. .dashboard-editor-container {
  130. padding: 18px 22px 22px 22px;
  131. background-color: rgb(240, 242, 245);
  132. .chart-wrapper {
  133. background: #fff;
  134. padding: 16px 16px 0;
  135. margin-bottom: 32px;
  136. }
  137. }
  138. .acea-row {
  139. ::v-deep.el-avatar--small {
  140. width: 22px;
  141. height: 22px;
  142. line-height: 22px;
  143. }
  144. }
  145. .checkTime {
  146. ::v-deep.el-radio__input {
  147. display: none;
  148. }
  149. }
  150. .ivu-pl-8 {
  151. margin-left: 8px;
  152. font-size: 14px;
  153. }
  154. .divBox {
  155. // padding: 0 20px !important;
  156. }
  157. .dashboard-console-visit {
  158. ::v-deep.el-card__header {
  159. padding: 14px 20px !important;
  160. }
  161. ul {
  162. li {
  163. list-style-type: none;
  164. margin-top: 12px;
  165. }
  166. }
  167. }
  168. .ivu-mb {
  169. margin-bottom: 10px;
  170. }
  171. </style>