ghStatistics-index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="mis-pageBox">
  3. <!-- 主页 -->
  4. <el-container>
  5. <el-header height="75px">
  6. <el-row>
  7. <el-col :span="24">
  8. <div style="display:flex;align-items:center;">
  9. <!--区域联动组件:公司、片区、抄表册-->
  10. <cpsLinkageArea :queryParams="queryParams" widthValue="180px"></cpsLinkageArea>&nbsp;
  11. 关 键 字:&nbsp;<el-input v-model="queryParams.searchText" size="small" style="width:180px;"
  12. placeholder="输入关键字" clearable @keyup.enter.native="clickQuery()" />
  13. </div>
  14. </el-col>
  15. </el-row>
  16. <el-row>
  17. <el-col :span="22">
  18. <div style="height:41px;display:flex;align-items:center;">
  19. 操作时间:&nbsp;<el-date-picker v-model="dprCreatedDate" type="datetimerange"
  20. :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期"
  21. end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" align="right"
  22. :default-time="['00:00:00', '23:59:59']" size="small" style="width:438px;" @change="() => {
  23. if (this.dprCreatedDate && this.dprCreatedDate.length > 0) {
  24. this.queryParams.operatorDate_Start = this.dprCreatedDate[0];
  25. this.queryParams.operatorDate_End = this.dprCreatedDate[1];
  26. } else {
  27. this.queryParams.operatorDate_Start = undefined;
  28. this.queryParams.operatorDate_End = undefined;
  29. }
  30. }">
  31. </el-date-picker>&nbsp;
  32. <el-button type="primary" size="small" icon="el-icon-search"
  33. @click="clickQuery()">查询</el-button>
  34. </div>
  35. </el-col>
  36. <el-col :span="2" class="list-opCol">
  37. <el-popover placement="top-start" title="提示" width="200" trigger="hover"
  38. content="数据量大时等待时间可能较长,请您耐心等待!">
  39. <el-button slot="reference" type="info" size="small" icon="el-icon-document"
  40. @click="clickExport()">导出</el-button>
  41. </el-popover>
  42. <!-- <el-button type="info" size="small" icon="el-icon-document" @click="clickExport()">导出</el-button> -->
  43. </el-col>
  44. </el-row>
  45. </el-header>
  46. <el-main>
  47. <tfTable :table-data="dataList" :column="columns" :for-id="false" :pagination="true"
  48. :currentpage="pageInfo.current" :pagesize="pageInfo.size" :total="pageInfo.tableTotal" :border="true"
  49. :multiple="false" :fixed="true" :isdelete="false" :is-select="false" :stripe="true"
  50. @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"
  51. @sortChange="onCustomerSortChange" />
  52. </el-main>
  53. </el-container>
  54. </div>
  55. </template>
  56. <script>
  57. import '@/views/mis/common/assets/styles/misStyle.scss'
  58. import { DateHelper, FileHelper } from '@/views/mis/common/assets/scripts/utils.js'
  59. import { CustomerGh } from '@/views/mis/common/api/customerManagement.js'
  60. import tfTable from '@/components/TableAuto/index.vue'
  61. import cpsLinkageArea from '@/views/mis/common/components/cps-linkageArea.vue';
  62. export default {
  63. components: { cpsLinkageArea, tfTable },
  64. props: ['data'],
  65. data() {
  66. return {
  67. /* ----- 主页 ----- */
  68. queryParams: {
  69. companyBranch: undefined,//公司
  70. mrArea: undefined,//片区
  71. mrBook: undefined,//抄表本
  72. searchText: undefined,//模糊查询
  73. operatorDate_Start: undefined,//开始日期
  74. operatorDate_End: undefined//结束日期
  75. },
  76. pageInfo: { current: 1, size: 20, tableTotal: 1, 'orders[0].asc': 'true', 'orders[0].column': 'operatorDate' }, // 分页数据
  77. columns: [
  78. // {
  79. // label: '所属片区',
  80. // prop: 'mrArea',
  81. // align: 'left'
  82. // },
  83. {
  84. label: '所属表册',
  85. prop: 'mrBook',
  86. align: 'left'
  87. },
  88. {
  89. label: '用户编号',
  90. prop: 'customerNo',
  91. align: 'center',
  92. sortable: true
  93. },
  94. {
  95. label: '原用户姓名',
  96. prop: 'oldCustomerName',
  97. align: 'center'
  98. },
  99. {
  100. label: '新用户姓名',
  101. prop: 'newCustomerName',
  102. align: 'center'
  103. },
  104. {
  105. label: '原联系电话',
  106. prop: 'oldPhone',
  107. align: 'center'
  108. },
  109. {
  110. label: '新联系电话',
  111. prop: 'newCustomerPhone',
  112. align: 'center'
  113. },
  114. {
  115. label: '原用户地址',
  116. prop: 'oldCustomerAddr',
  117. align: 'left'
  118. },
  119. {
  120. label: '新用户地址',
  121. prop: 'newCustomerAddr',
  122. align: 'left'
  123. },
  124. {
  125. label: '操作时间',
  126. prop: 'operatorDate',
  127. align: 'center',
  128. sortable: true,
  129. formatter: function (row, column, value, index) {
  130. return DateHelper.formatterTime(value);
  131. }
  132. },
  133. {
  134. label: '操作人员',
  135. prop: 'operatorOname',
  136. align: 'center'
  137. }
  138. ],
  139. dataList: [], // 表格数据
  140. dprCreatedDate: [],
  141. pickerOptions: {
  142. shortcuts: [{
  143. text: '最近一周',
  144. onClick(picker) {
  145. const end = new Date();
  146. const start = new Date();
  147. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  148. picker.$emit('pick', [start, end]);
  149. }
  150. }, {
  151. text: '最近一个月',
  152. onClick(picker) {
  153. const end = new Date();
  154. const start = new Date();
  155. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  156. picker.$emit('pick', [start, end]);
  157. }
  158. }, {
  159. text: '最近三个月',
  160. onClick(picker) {
  161. const end = new Date();
  162. const start = new Date();
  163. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  164. picker.$emit('pick', [start, end]);
  165. }
  166. }]
  167. }
  168. }
  169. },
  170. created() {
  171. },
  172. mounted() {
  173. this.bindList();
  174. },
  175. methods: {
  176. /* ----- 方法 ----- */
  177. /**
  178. * @description 绑定列表
  179. */
  180. bindList() {
  181. // 追加分页参数
  182. let params = Object.assign({}, this.pageInfo, this.queryParams);
  183. this.dataList = []
  184. CustomerGh.query(params).then((res) => {
  185. if (res.code !== 1) {
  186. this.$message.error('查询失败!')
  187. return
  188. }
  189. // 数据总数
  190. this.pageInfo.tableTotal = res.result.total
  191. this.dataList = res.result.records
  192. }).catch((ex) => {
  193. this.$message.error("查询失败!");
  194. }).finally(() => {
  195. });
  196. },
  197. /* ----- dom事件 ----- */
  198. /**
  199. * @description 查询
  200. */
  201. clickQuery() {
  202. this.pageInfo.current = 1
  203. this.bindList()
  204. },
  205. async clickExport() {
  206. // 追加分页参数
  207. let params = Object.assign({}, this.queryParams);
  208. await CustomerGh.exportFile(params).then((res) => {
  209. FileHelper.exportExcel(res, '更名过户统计.xlsx');
  210. }).catch((ex) => {
  211. this.$message.error("导出失败!");
  212. }).finally(() => {
  213. });
  214. },
  215. /* ----- 组件事件 ----- */
  216. /**
  217. * @description 改变当前页
  218. */
  219. handleCurrentChange(current) {
  220. this.pageInfo.current = current
  221. this.bindList()
  222. },
  223. /**
  224. * @description 分页每页条数
  225. */
  226. handleSizeChange(size) {
  227. this.pageInfo.size = size
  228. this.bindList()
  229. },
  230. //排序事件
  231. onCustomerSortChange(arrOrder) {
  232. this.pageInfo['orders[0].asc'] = arrOrder[0];
  233. this.pageInfo['orders[0].column'] = arrOrder[1];
  234. this.bindList();
  235. }
  236. }
  237. }
  238. </script>