Commit 04d7be6db903454d682eaf4b336c5830d15fdfa5

Authored by liuqimichale
1 parent 83ffa354

进出场

src/components/VInout.vue
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <card-title> <span>进出场消息</span></card-title> 3 <card-title> <span>进出场消息</span></card-title>
4 <div class="theme-body"> 4 <div class="theme-body">
5 <div class="access-title"> 5 <div class="access-title">
6 - <p><span><span class="access-icon"></span>{{inoutmsg}} 进场</span> <span>{{inouttime}}</span></p> 6 + <p><span><span class="access-icon"></span>{{inoutmsg}} </span> <span>{{inouttime|formatDate}}</span></p>
7 </div> 7 </div>
8 <div class="access-img" :style="{backgroundImage:'url('+imgUrl+')'}"></div> 8 <div class="access-img" :style="{backgroundImage:'url('+imgUrl+')'}"></div>
9 </div> 9 </div>
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 <script> 13 <script>
14 import CardTitle from './base/CardTitle' 14 import CardTitle from './base/CardTitle'
15 import AccountNum from './base/AccountNum' 15 import AccountNum from './base/AccountNum'
  16 +import { formatDate } from '../utils/date'
  17 +
16 export default { 18 export default {
17 name: 'VInout', 19 name: 'VInout',
18 components: { 20 components: {
@@ -23,6 +25,12 @@ export default { @@ -23,6 +25,12 @@ export default {
23 data(){ 25 data(){
24 return{ 26 return{
25 } 27 }
  28 + },
  29 + filters:{
  30 + formatDate(time){
  31 + var date = new Date(time)
  32 + return formatDate(date, 'yyyy-MM-dd hh:mm');
  33 + }
26 } 34 }
27 } 35 }
28 </script> 36 </script>
src/utils/api.js
@@ -18,3 +18,6 @@ export const equipmentAddress = p =&gt; post(&#39;urban/intelligence/device/queryDevice @@ -18,3 +18,6 @@ export const equipmentAddress = p =&gt; post(&#39;urban/intelligence/device/queryDevice
18 18
19 //....地图 19 //....地图
20 export const mapAddress = p => post('urban/intelligence/park/queryParkDetailInfoByOrgIds',p) 20 export const mapAddress = p => post('urban/intelligence/park/queryParkDetailInfoByOrgIds',p)
  21 +
  22 +//....进出场
  23 +export const inoutAddress = p => post('urban/intelligence/orderPark/queryLastOrderPark',p)
src/utils/date.js 0 → 100644
  1 +export function formatDate (date, fmt) {
  2 + if (/(y+)/.test(fmt)) {
  3 + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  4 + }
  5 + let o = {
  6 + 'M+': date.getMonth() + 1,
  7 + 'd+': date.getDate(),
  8 + 'h+': date.getHours(),
  9 + 'm+': date.getMinutes(),
  10 + 's+': date.getSeconds()
  11 + };
  12 + for (let k in o) {
  13 + if (new RegExp(`(${k})`).test(fmt)) {
  14 + let str = o[k] + '';
  15 + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
  16 + }
  17 + }
  18 + return fmt;
  19 +};
  20 +function padLeftZero (str) {
  21 + return ('00' + str).substr(str.length);
  22 +};
src/view/VHome.vue
@@ -41,7 +41,7 @@ import VIncome from &#39;../components/VIncome&#39; @@ -41,7 +41,7 @@ import VIncome from &#39;../components/VIncome&#39;
41 import VBerth from '../components/VBerth' 41 import VBerth from '../components/VBerth'
42 import VEquipment from '../components/VEquipment' 42 import VEquipment from '../components/VEquipment'
43 43
44 -import { parkAddress, tollAddress, incomeAddress, berthAddress, equipmentAddress, mapAddress } from '../utils/api' 44 +import { parkAddress, tollAddress, incomeAddress, berthAddress, equipmentAddress, mapAddress, inoutAddress } from '../utils/api'
45 45
46 export default { 46 export default {
47 name: 'VHome', 47 name: 'VHome',
@@ -101,7 +101,7 @@ export default { @@ -101,7 +101,7 @@ export default {
101 mounted(){ 101 mounted(){
102 //this.setmethod() 102 //this.setmethod()
103 this.initView(); 103 this.initView();
104 - //this.setmethod() 104 + this.setmethod()
105 105
106 106
107 }, 107 },
@@ -128,6 +128,27 @@ export default { @@ -128,6 +128,27 @@ export default {
128 console.log(response); 128 console.log(response);
129 }) 129 })
130 130
  131 + inoutAddress({//进出场
  132 + orgIds: ['10078','10003']
  133 + }).then((response)=>{
  134 + let data = response.data.data
  135 + console.log(response)
  136 + let inoutdata = data[0]
  137 + if(inoutdata.parkState == 10){
  138 + inoutdata.parkState = "进场"
  139 + this.inouttime = inoutdata.parkInTime
  140 + this.imgUrl = inoutdata.inCarUrl
  141 + }else{
  142 + inoutdata.parkState = "出场"
  143 + this.inouttime = inoutdata.parkOutTime
  144 + this.imgUrl = inoutdata.outCarUrl
  145 + }
  146 + this.inoutmsg = inoutdata.plName+' '+inoutdata.carNumber +' '+inoutdata.parkState
  147 +
  148 + }).catch((response)=>{
  149 + console.log(response);
  150 + })
  151 +
131 incomeAddress({//收入 152 incomeAddress({//收入
132 orgIds: this.GLOBAL.orignId 153 orgIds: this.GLOBAL.orignId
133 }).then((response)=>{ 154 }).then((response)=>{
@@ -137,7 +158,6 @@ export default { @@ -137,7 +158,6 @@ export default {
137 seriesData:[data.aliPay,data.wxPay,data.otherPay], 158 seriesData:[data.aliPay,data.wxPay,data.otherPay],
138 total:1 159 total:1
139 } 160 }
140 -  
141 }).catch((response)=>{ 161 }).catch((response)=>{
142 console.log(response); 162 console.log(response);
143 }) 163 })
@@ -149,7 +169,6 @@ export default { @@ -149,7 +169,6 @@ export default {
149 this.bertotal = data.allBerthNum 169 this.bertotal = data.allBerthNum
150 this.pieChartData = { 170 this.pieChartData = {
151 yData: [data.freeBerthNum,data.isOccupyBertnNum], 171 yData: [data.freeBerthNum,data.isOccupyBertnNum],
152 -  
153 } 172 }
154 173
155 }).catch((response)=>{ 174 }).catch((response)=>{
@@ -160,14 +179,10 @@ export default { @@ -160,14 +179,10 @@ export default {
160 orgIds: this.GLOBAL.orignId 179 orgIds: this.GLOBAL.orignId
161 }).then((response)=>{ 180 }).then((response)=>{
162 let data = response.data.data 181 let data = response.data.data
163 - console.log(data)  
164 var tempData = []; 182 var tempData = [];
165 for(var index in data){ 183 for(var index in data){
166 -  
167 var item = data[index]; 184 var item = data[index];
168 var tempItem = 185 var tempItem =
169 -  
170 -  
171 { 186 {
172 Name: item.parkInfo.plName, 187 Name: item.parkInfo.plName,
173 lonId: item.parkInfo.lonId, 188 lonId: item.parkInfo.lonId,
@@ -180,9 +195,7 @@ export default { @@ -180,9 +195,7 @@ export default {
180 income:(item.realTimeInfoDTO.allIncome/100).toFixed(2), 195 income:(item.realTimeInfoDTO.allIncome/100).toFixed(2),
181 arreageincome:(item.realTimeInfoDTO.escapeFee).toFixed(2) 196 arreageincome:(item.realTimeInfoDTO.escapeFee).toFixed(2)
182 } 197 }
183 -  
184 tempData.push(tempItem); 198 tempData.push(tempItem);
185 -  
186 } 199 }
187 200
188 this.ditudata = tempData; 201 this.ditudata = tempData;
@@ -192,8 +205,6 @@ export default { @@ -192,8 +205,6 @@ export default {
192 // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'}, 205 // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'},
193 // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'} 206 // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'}
194 // ] 207 // ]
195 -  
196 - //console.log(this.ditudata)  
197 }).catch((response)=>{ 208 }).catch((response)=>{
198 console.log(response); 209 console.log(response);
199 }) 210 })
@@ -266,11 +277,11 @@ export default { @@ -266,11 +277,11 @@ export default {
266 setmethod(){ 277 setmethod(){
267 278
268 setInterval(()=>{ 279 setInterval(()=>{
269 - this.parkingTotal++  
270 - this.rodeside++  
271 - },1000) 280 + this.initView()
  281 + },10000)
272 } 282 }
273 - } 283 + },
  284 +
274 } 285 }
275 </script> 286 </script>
276 287