index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="check-register">
  3. <NavBar />
  4. <div class="statistics-container">
  5. <!-- 搜索 -->
  6. <van-collapse v-model="active">
  7. <van-collapse-item title="搜索条件" name="1">
  8. <div class="org-line van-hairline--bottom">
  9. <van-row>
  10. <van-col span="5">
  11. <div class="org-label">检查机构</div>
  12. </van-col>
  13. <van-col span="19">
  14. <org-tree v-model="query.checkOrgId" @change="getDataList"></org-tree>
  15. </van-col>
  16. </van-row>
  17. </div>
  18. <div class="org-line van-hairline--bottom">
  19. <van-row>
  20. <van-col span="5">
  21. <div class="org-label">受检机构</div>
  22. </van-col>
  23. <van-col span="19">
  24. <org-tree v-model="query.beCheckedOrgId" @change="getDataList"></org-tree>
  25. </van-col>
  26. </van-row>
  27. </div>
  28. <div class="search-box van-hairline--bottom">
  29. <select-cell title="检查角色" v-model="query.roldIds" :dataList="planList" :prop="prop" @change="getDataList"/>
  30. </div>
  31. <div class="search-box van-hairline--bottom">
  32. <select-cell title="状态" v-model="query.planId" :dataList="planList" :prop="prop" @change="getDataList"/>
  33. <date-cell title="截止日期" v-model="query.taskTime" date-type="date" @change="getDataList"/>
  34. </div>
  35. </van-collapse-item>
  36. </van-collapse>
  37. <div class="card-list">
  38. <k-list :list="dataList" :params="query" :auto="false" ref="list" >
  39. <template slot-scope="{ data }">
  40. <van-cell-group>
  41. <van-cell :title="data.orgName" >
  42. <template #extra>
  43. <div class="card-num">
  44. {{data.finishRate}}
  45. </div>
  46. </template>
  47. <template #label>
  48. <div class="flex-box">
  49. <div>应培训数:{{data.shouldFinish}}</div>
  50. <div>已培训数:{{data.finish}}</div>
  51. </div>
  52. </template>
  53. </van-cell>
  54. </van-cell-group>
  55. </template>
  56. </k-list>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import NavBar from '@/components/NavBar'
  63. import OrgTree from '@/components/orgTree'
  64. import KList from '@/components/list'
  65. import dateCell from '@/components/dateCell'
  66. import selectCell from '@/components/selectCell'
  67. import {dataList} from './api'
  68. import {mapGetters} from "vuex";
  69. import {formatDate} from "@/filters/filter";
  70. export default {
  71. components: {
  72. NavBar,
  73. OrgTree,
  74. dateCell,
  75. selectCell,
  76. KList
  77. },
  78. data() {
  79. return {
  80. active:['1'],
  81. query:{
  82. taskTime:null,
  83. checkOrgId:null,
  84. beCheckedOrgId:null,
  85. roldIds:null,
  86. },
  87. planList:[],
  88. prop:{
  89. label:'name',
  90. value:'id',
  91. },
  92. loading:false,
  93. //dataList:[]
  94. }
  95. },
  96. mounted() {
  97. this.initData();
  98. },
  99. computed:{
  100. ...mapGetters(['orgId']),
  101. },
  102. watch:{
  103. 'query.checkOrgId':{
  104. handler(v){
  105. this.getRoleList();
  106. },
  107. immediate:true
  108. }
  109. },
  110. methods: {
  111. dataList,
  112. initData(){
  113. this.query.checkOrgId = this.orgId;
  114. this.getPlanList();
  115. },
  116. getRoleList(){
  117. },
  118. getDataList(){
  119. let data = {
  120. ...this.query
  121. }
  122. if(!this.query.orgId) return this.$toast('请选择机构');
  123. dataList(data).then(res=>{
  124. this.dataList = res.data;
  125. })
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .check-register{
  132. .van-cell-group{
  133. margin-bottom: 20px;
  134. }
  135. .van-cell-group:last-child{
  136. margin-bottom: 0;
  137. }
  138. .van-collapse-item__wrapper{
  139. overflow: visible;
  140. }
  141. }
  142. </style>
  143. <style lang="scss" scoped>
  144. .check-register{
  145. }
  146. .org-line{
  147. padding-left:30px;
  148. background-color: #fff;
  149. }
  150. .org-label{
  151. height: 90px;
  152. width: 100%;
  153. display: flex;
  154. align-items: center;
  155. font-size: 28px;
  156. }
  157. .card-list{
  158. padding: 20px;
  159. height: calc(100vh - 550px);
  160. overflow: auto;
  161. }
  162. .card-num{
  163. display: flex;
  164. align-items: center;
  165. font-size: 28px;
  166. color: #009dff;
  167. }
  168. .flex-box{
  169. display: flex;
  170. align-items: center;
  171. >div{
  172. margin-right: 40px;
  173. }
  174. }
  175. .search-box{
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. >div{
  180. width: 50%;
  181. }
  182. }
  183. </style>