7d9fdf26d2230a036122b65a36a58837b3bb48cc.svn-base 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div id="trackTableContainer" class="trackTableClass">
  3. <draagable :title="draagableTitle" @closeDraggable="closeDraggable" initTop=-15
  4. initLeft=45 initWidth=615 initHeight=450 style="z-index: 999">
  5. <div style="padding:10px;">
  6. <!-- <div> -->
  7. <el-date-picker v-model="value1" value-format="yyyy-MM-dd HH-mm-ss" type="datetime" placeholder="选择开始时间"></el-date-picker>
  8. <el-date-picker v-model="value2" value-format="yyyy-MM-dd HH-mm-ss" type="datetime" placeholder="选择结束时间"></el-date-picker>
  9. <el-button type="primary" icon="el-icon-search" @click="clickHandler">查询</el-button>
  10. <!-- </div> -->
  11. <!-- <div>
  12. <el-date-picker v-model="value1" type="date" placeholder="选择日期"></el-date-picker>
  13. </div> -->
  14. </div>
  15. <div style="height:365px;">
  16. <el-table :data="tableResultData" :height="360">
  17. <el-table-column align="center" prop="persName" min-width="100" label="名称" show-overflow-tooltip></el-table-column>
  18. <el-table-column align="center" prop="mobile" min-width="100" label="手机号码" show-overflow-tooltip></el-table-column>
  19. <el-table-column align="center" prop="stDate" min-width="160" label="开始时间" show-overflow-tooltip></el-table-column>
  20. <el-table-column align="center" prop="enDate" min-width="160" label="结束时间" show-overflow-tooltip></el-table-column>
  21. <el-table-column align="center" label="操作" min-width="70">
  22. <template slot-scope="scope">
  23. <el-button type="text" size="small" @click="showTrackOnMap(scope.row,'track')">查看</el-button>
  24. </template>
  25. </el-table-column>
  26. </el-table>
  27. </div>
  28. </draagable>
  29. </div>
  30. </template>
  31. <script>
  32. import request from "../../../utils/gw_ajax_request.js"
  33. import {dateFormat} from "../../../utils/gw_date.js"
  34. import {getPersonTrack} from '../../../api/zhxxAPI.js'
  35. import draagable from './draggable.vue'
  36. export default {
  37. components:{
  38. draagable,
  39. },
  40. props:['perId'],
  41. data(){
  42. return{
  43. loading:false,
  44. input5:null,
  45. value1:"",
  46. value2:"",
  47. draagableTitle:'历史轨迹列表',
  48. columObj:[],
  49. tableResultData:[],
  50. perId1:'',
  51. }
  52. },
  53. mounted:function(){
  54. this.perId1 = this.perId;
  55. this.value1 = dateFormat(new Date(new Date().getTime()-24*60*60*1000),'yyyy-MM-dd HH-mm-ss');
  56. this.value2 = dateFormat(new Date(),'yyyy-MM-dd HH-mm-ss');
  57. this.getTrackList();
  58. },
  59. methods:{
  60. formatDate(row,column){
  61. if(row.stDate){
  62. return (dateFormat(row.stDate,'yyyy-MM-dd hh:mm:ss'));
  63. }
  64. },
  65. formatDate1(row,column){
  66. if(row.enDate){
  67. return (dateFormat(row.enDate,'yyyy-MM-dd hh:mm:ss'));
  68. }
  69. },
  70. searchButtonClick:function(){
  71. var _self = this;
  72. },
  73. closeDraggable:function(){
  74. this.$emit("closeDraggable","trackTable");
  75. },
  76. showTrackOnMap(row,type){
  77. this.$emit('showTrackOnMap',row,type)
  78. },
  79. clickHandler(){
  80. if(this.value1 == ''){
  81. this.$message('请选择开始时间');
  82. return;
  83. }else if(this.value2 == ''){
  84. this.$message('请选择结束时间');
  85. return;
  86. }
  87. this.getTrackList();
  88. },
  89. getTrackList:function(){
  90. var _self = this;
  91. getPersonTrack(_self.perId1,_self.value1,_self.value2).then((res)=>{
  92. if(res.success){
  93. _self.tableResultData = res.data.itudeList;
  94. _self.tableResultData.forEach((item)=>{
  95. item['persName'] = res.data.persName;
  96. item['mobile'] = res.data.mobile;
  97. })
  98. }
  99. });
  100. },
  101. }
  102. }
  103. </script>
  104. <style>
  105. #trackTableContainer .el-table__body-wrapper{
  106. /* overflow: auto; */
  107. }
  108. .trackTableClass{
  109. position: fixed;
  110. left: 20px;
  111. top: 119px;
  112. z-index: 590;
  113. /* width: 390px;
  114. height: 490px; */
  115. }
  116. #draggableContainer .el-table{
  117. color:#928f8f;
  118. }
  119. #draggableContainer .el-table thead{
  120. color: #a29a9a;
  121. }
  122. #draggableContainer .el-table tr{
  123. background-color: #f9f9f9;
  124. }
  125. </style>