instrumentRankingComponentTable.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <div class="instrumentRankingComponentTable">
  3. <div class="top-title-max-ox">
  4. <p></p>
  5. <p>大仪使用排行</p>
  6. <p></p>
  7. <div class="title-button" @click="outButton">
  8. <img src="@/assets/ZDimages/icon_yh_fh@1x.png">
  9. <p>返回</p>
  10. </div>
  11. </div>
  12. <div class="table-title-box">
  13. <p class="table-title-p">数据筛选</p>
  14. <el-form :model="queryParams" class="form-box" ref="queryForm"
  15. :inline="true" style="width:100%;">
  16. <el-form-item label="设备:" prop="deviceName">
  17. <el-input
  18. v-model="queryParams.deviceName"
  19. placeholder="输入设备"
  20. style="width:178px;"
  21. />
  22. </el-form-item>
  23. <p class="form-inquire-common-style-button" @click="handleQuery">查询</p>
  24. <p class="form-reset-common-style-button" @click="resetQuery">重置</p>
  25. </el-form>
  26. </div>
  27. <div class="table-list-box">
  28. <p class="table-list-p">数据列表</p>
  29. <div class="table-list">
  30. <el-table class="table-box"
  31. :data="dataList" @sort-change="sortChange">
  32. <el-table-column align="center" label="序号" width="150" type="index"/>
  33. <el-table-column align="center" label="设备名称" prop="deviceName" show-overflow-tooltip/>
  34. <el-table-column align="center" sortable="custom" label="使用机时" prop="useTime" width="400" show-overflow-tooltip/>
  35. <el-table-column align="center" sortable="custom" label="预约费用" prop="appointFee" width="400" show-overflow-tooltip/>
  36. <el-table-column align="center" sortable="custom" label="测试样品" prop="testSample" width="400" show-overflow-tooltip/>
  37. </el-table>
  38. <pagination :page-sizes="[20, 30, 40, 50]"
  39. v-show="total>0"
  40. :total="total"
  41. layout="total,sizes, prev, pager, next"
  42. :page.sync="queryParams.page"
  43. :limit.sync="queryParams.pageSize"
  44. @pagination="getList"
  45. />
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import { reportReportBsEquipRankList} from "@/api/index";
  52. export default {
  53. name: 'instrumentRankingComponentTable',
  54. data () {
  55. return {
  56. //查询条件
  57. queryParams:{
  58. page:1,
  59. pageSize:20,
  60. deviceName:"",
  61. ascOrDesc:'',
  62. type:'',
  63. },
  64. //列表数据
  65. dataList:[],
  66. //数据数量
  67. total:0,
  68. }
  69. },
  70. created(){
  71. },
  72. mounted(){
  73. this.getList();
  74. },
  75. methods:{
  76. outButton(){
  77. this.$parent.checkComponentType(null)
  78. },
  79. //排序方法
  80. sortChange(val){
  81. if(val.prop == 'useTime'){
  82. this.$set(this.queryParams,'ascOrDesc',val.order=='ascending'?true:(val.order=='descending'?false:''));
  83. this.$set(this.queryParams,'type',1);
  84. this.handleQuery();
  85. }else if(val.prop == 'appointFee'){
  86. this.$set(this.queryParams,'ascOrDesc',val.order=='ascending'?true:(val.order=='descending'?false:''));
  87. this.$set(this.queryParams,'type',2);
  88. this.handleQuery();
  89. }else if(val.prop == 'testSample'){
  90. this.$set(this.queryParams,'ascOrDesc',val.order=='ascending'?true:(val.order=='descending'?false:''));
  91. this.$set(this.queryParams,'type',3);
  92. this.handleQuery();
  93. }else{
  94. this.$set(this.queryParams,'ascOrDesc','');
  95. this.$set(this.queryParams,'type','');
  96. this.handleQuery();
  97. }
  98. },
  99. //列表查询
  100. getList(){
  101. reportReportBsEquipRankList(this.queryParams).then(response => {
  102. this.$set(this,'dataList',response.data.records);
  103. this.$set(this,'total',response.data.total);
  104. });
  105. },
  106. //查询按钮
  107. handleQuery(){
  108. this.$set(this.queryParams,'page',1);
  109. this.getList();
  110. },
  111. //重置按钮
  112. resetQuery(){
  113. this.$set(this,'queryParams',{
  114. page:1,
  115. pageSize:20,
  116. deviceName:"",
  117. ascOrDesc:'',
  118. type:'',
  119. });
  120. this.getList();
  121. },
  122. },
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .instrumentRankingComponentTable{
  127. padding:0 62px;
  128. height:1340px;
  129. display: flex;
  130. flex-direction: column;
  131. flex:1;
  132. overflow: hidden;
  133. .top-title-max-ox{
  134. display: flex;
  135. margin:20px 0;
  136. p:nth-child(1){
  137. width:10px;
  138. height:30px;
  139. background-color: #15827C;
  140. margin:5px 20px 0 0;
  141. }
  142. p:nth-child(2){
  143. color:#00FFFF;
  144. font-size:26px;
  145. line-height:40px;
  146. }
  147. p:nth-child(3){
  148. flex:1;
  149. }
  150. .title-button{
  151. width:120px;
  152. height:40px;
  153. background-color: #021D20;
  154. border:1px solid #15827C;
  155. display: flex;
  156. cursor: pointer;
  157. img{
  158. display: block;
  159. width:24px;
  160. height:24px;
  161. margin:8px 15px 0 12px;
  162. }
  163. p{
  164. font-size:18px;
  165. line-height:42px;
  166. color:#fff;
  167. }
  168. }
  169. }
  170. .table-title-box{
  171. height:200px;
  172. background-color: #002329;
  173. margin-bottom:20px;
  174. .table-title-p{
  175. line-height:80px;
  176. border-bottom:1px solid #15827C;
  177. padding-left:30px;
  178. font-size:24px;
  179. color:#fff;
  180. }
  181. }
  182. .table-list-box{
  183. flex:1;
  184. display: flex;
  185. flex-direction: column;
  186. overflow: hidden;
  187. background: linear-gradient(180deg, rgba(4, 117, 129, 0.2) 0%, rgba(0, 15, 22, 0) 100%);
  188. .table-list-p{
  189. line-height:80px;
  190. border-bottom:1px solid #15827C;
  191. padding-left:30px;
  192. font-size:24px;
  193. color:#fff;
  194. }
  195. .table-list{
  196. padding:35px 30px 0;
  197. flex:1;
  198. display: flex;
  199. flex-direction: column;
  200. overflow: hidden;
  201. }
  202. }
  203. }
  204. </style>