handOverList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="form-wrap">
  3. <el-form
  4. class="search-box"
  5. ref="form"
  6. :model="form"
  7. :inline="true"
  8. label-position="left"
  9. label-width="76px"
  10. >
  11. <div class="block-title">
  12. 查询条件
  13. </div>
  14. <el-form-item
  15. label="开始时间"
  16. prop="handOverStartTime"
  17. >
  18. <el-date-picker
  19. v-model="form.handOverStartTime"
  20. type="datetime"
  21. format="yyyy-MM-dd HH:mm:ss"
  22. value-format="yyyy-MM-dd HH:mm:ss"
  23. placeholder="选择日期时间"
  24. >
  25. </el-date-picker>
  26. </el-form-item>
  27. <el-form-item
  28. label="结束时间"
  29. prop="handOverEndTime"
  30. >
  31. <el-date-picker
  32. v-model="form.handOverEndTime"
  33. format="yyyy-MM-dd HH:mm:ss"
  34. value-format="yyyy-MM-dd HH:mm:ss"
  35. type="datetime"
  36. placeholder="选择日期时间"
  37. >
  38. </el-date-picker>
  39. </el-form-item>
  40. <div class="btn-wrap">
  41. <el-button
  42. @click="reset"
  43. >
  44. 重置
  45. </el-button>
  46. <el-button
  47. :disabled="loading"
  48. type="primary"
  49. @click="queryList(true)"
  50. >
  51. 搜索
  52. </el-button>
  53. </div>
  54. </el-form>
  55. <div class="table-box">
  56. <!-- <div class="block-title">
  57. 交班记录列表
  58. </div> -->
  59. <el-table
  60. stripe
  61. border
  62. v-loading="loading"
  63. :data="tableData">
  64. <el-table-column
  65. prop="adminName"
  66. label="交班人"
  67. >
  68. </el-table-column>
  69. <el-table-column
  70. prop="handOverStartTime"
  71. label="开始时间"
  72. >
  73. </el-table-column>
  74. <el-table-column
  75. prop="handOverEndTime"
  76. label="结束时间"
  77. >
  78. </el-table-column>
  79. <el-table-column
  80. label="交班统计数据"
  81. prop="handOverStatistics"
  82. >
  83. <template slot-scope="scope">
  84. <el-link
  85. type="primary"
  86. @click="viewDetail(scope.row)">
  87. 详情
  88. </el-link>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. label="操作"
  93. width="120"
  94. >
  95. <template slot-scope="scope">
  96. <el-link
  97. type="primary"
  98. @click="downloadExport(scope.row)">
  99. 下载
  100. </el-link>
  101. <el-link
  102. type="primary"
  103. @click="exportExcel(scope.row)">
  104. 导出
  105. </el-link>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <el-pagination
  110. background
  111. :current-page.sync="form.pageNum"
  112. @current-change="queryList()"
  113. layout="total, prev, pager, next"
  114. :total="total"
  115. >
  116. </el-pagination>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import { apiHandOverList, apiHandOverDetail } from '@/api/handOver'
  122. import { getPayStatus } from '@/utils/index'
  123. import moment from 'moment'
  124. // import ReaderInput from '@/components/ReaderInput'
  125. export default {
  126. name: 'freeQuery',
  127. computed: {
  128. salesList () {
  129. return this.$store.state.user.salesList
  130. },
  131. saleChannel () {
  132. return this.$store.state.app.saleChannel
  133. },
  134. payChannelOptions () {
  135. return this.$store.getters.payChannelOptions
  136. },
  137. ticketTypeList () {
  138. return this.$store.state.app.ticketTypeList
  139. },
  140. scenicList () {
  141. return this.$store.state.app.scenicList
  142. }
  143. },
  144. components: {
  145. // ReaderInput
  146. },
  147. data () {
  148. return {
  149. form: {
  150. handOverStartTime: new Date(moment().startOf('day').valueOf()),
  151. handOverEndTime: new Date(moment().endOf('day').valueOf()),
  152. pageNum: 1,
  153. pageSize: 10
  154. },
  155. tableData: [],
  156. total: 0,
  157. loading: false,
  158. deviceList: []
  159. }
  160. },
  161. created () {
  162. this.queryList()
  163. },
  164. methods: {
  165. getPayStatus,
  166. reset () {
  167. this.$refs.form.resetFields()
  168. },
  169. queryList (goFirst) {
  170. this.loading = true
  171. goFirst && (this.form.pageNum = 1)
  172. apiHandOverList(this.form).then(res => {
  173. this.tableData = res.data.records || []
  174. this.total = res.data.total || 0
  175. }).finally(() => {
  176. this.loading = false
  177. })
  178. },
  179. exportExcel (row) {
  180. const params = {
  181. id: row.id,
  182. export: true,
  183. pageSize: -1,
  184. pageNum: 1
  185. }
  186. apiHandOverDetail(params).then(() => {
  187. this.$message.success('导出成功。')
  188. this.goToDownload()
  189. }, () => {
  190. this.$message.success('导出失败。')
  191. })
  192. },
  193. viewDetail (row) {
  194. this.$router.push({
  195. name: 'handOverReport', params: { id: row.id }
  196. })
  197. }
  198. }
  199. }
  200. </script>
  201. <style scoped>
  202. </style>