saleReport.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <div>
  3. <div>
  4. <span style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">数据概览</span>
  5. <el-form :model="queryParams" style="margin-left: 20px;" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  6. <el-form-item>
  7. <el-button size="mini" @click="dayDataSource">今天</el-button>
  8. <el-button size="mini" @click="yesDataSource">昨天</el-button>
  9. <el-button size="mini" @click="workDataSource">本周</el-button>
  10. <el-button size="mini" @click="monthDataSource">本月</el-button>
  11. <el-date-picker style="margin: 0px 10px;"
  12. v-model="dateRangeCreatedDate"
  13. type="daterange"
  14. size="mini"
  15. range-separator="至"
  16. start-placeholder="开始日期"
  17. end-placeholder="结束日期">
  18. </el-date-picker>
  19. <el-button size="mini" @click="queryDataSource">查询</el-button>
  20. </el-form-item>
  21. </el-form>
  22. <el-row :gutter="10" class="panel-group">
  23. <el-col :xs="12" :sm="12" :lg="6" >
  24. <div class="flex xiaoliang">
  25. <div style="line-height: 62px;font-size: 44px;">
  26. {{ form.zongliters }}L
  27. </div>
  28. <div style="font-size: 28px;">
  29. 总销量
  30. </div>
  31. </div>
  32. </el-col>
  33. <el-col :xs="12" :sm="12" :lg="6">
  34. <div class="flex xiaoe">
  35. <div style="line-height: 62px;font-size: 44px;">
  36. {{ form.zongAmt }}元
  37. </div>
  38. <div style="font-size: 28px;">
  39. 总金额
  40. </div>
  41. </div>
  42. </el-col>
  43. <el-col :xs="12" :sm="12" :lg="6">
  44. <div class="flex qiyou">
  45. <div style="font-size: 28px;margin-top: -80px;"> 汽油 </div>
  46. <div class="flex-qy" style="margin-top: 30px;">
  47. <div class="flex-qy-sx" style="margin-right: 25px;">
  48. <div style="font-size: 36px;" >
  49. {{ form.qyliters }}L
  50. </div>
  51. <div style="font-size: 22px;">升数</div>
  52. </div>
  53. <div class="flex-qy-sx" style="margin-left: 25px;">
  54. <div style="font-size: 36px;">
  55. {{ form.qyamt }}元
  56. </div>
  57. <div style="font-size: 22px;">金额</div>
  58. </div>
  59. </div>
  60. </div>
  61. </el-col>
  62. <el-col :xs="12" :sm="12" :lg="6">
  63. <div class="flex chaiyou">
  64. <div style="font-size: 28px;margin-top: -80px;"> 柴油 </div>
  65. <div class="flex-qy" style="margin-top: 30px;">
  66. <div class="flex-qy-sx" style="margin-right: 25px;">
  67. <div style="font-size: 36px;">{{ form.cyliters }}L</div>
  68. <div style="font-size: 22px;">升数</div>
  69. </div>
  70. <div class="flex-qy-sx" style="margin-left: 25px;">
  71. <div style="font-size: 36px;">{{ form.cyamt }}元</div>
  72. <div style="font-size: 22px;">金额</div>
  73. </div>
  74. </div>
  75. </div>
  76. </el-col>
  77. </el-row>
  78. </div>
  79. <div style="width:100%; height: 181px;background: #FFFFFF;">
  80. <span style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">收入概览</span>
  81. <el-row style="display:flex; align-items:center;justify-content:center;width:100%; height: 100%;">
  82. <el-col :xs="12" :sm="12" :lg="3" >
  83. <div class="flex-sr">
  84. <div>
  85. <span class="sr-font">{{ form.wxAmt }}</span>
  86. </div>
  87. <div>微信(元)</div>
  88. </div>
  89. </el-col>
  90. <el-col :xs="12" :sm="12" :lg="3">
  91. <div class="flex-sr">
  92. <div><span class="sr-font">{{ form.zfbAmt }}</span></div>
  93. <div>支付宝(元)</div>
  94. </div>
  95. </el-col>
  96. <el-col :xs="12" :sm="12" :lg="3">
  97. <div class="flex-sr">
  98. <div>
  99. <span class="sr-font">{{ form.xjAmt }}</span>
  100. </div>
  101. <div >现金(元)</div>
  102. </div>
  103. </el-col>
  104. <el-col :xs="12" :sm="12" :lg="3">
  105. <div class="flex-sr">
  106. <div>
  107. <span class="sr-font">{{ form.posAmt }}</span>
  108. </div>
  109. <div >POS(元)</div>
  110. </div>
  111. </el-col>
  112. <el-col :xs="12" :sm="12" :lg="3">
  113. <div class="flex-sr">
  114. <div>
  115. <span class="sr-font">{{ form.didiAppAmt }}</span>
  116. </div>
  117. <div>滴滴APP(元)</div>
  118. </div>
  119. </el-col>
  120. <el-col :xs="12" :sm="12" :lg="3">
  121. <div class="flex-sr">
  122. <div>
  123. <span class="sr-font">{{ form.tyAppAmt }}</span>
  124. </div>
  125. <div>团油APP(元)</div>
  126. </div>
  127. </el-col>
  128. <el-col :xs="12" :sm="12" :lg="3">
  129. <div class="flex-sr">
  130. <div>
  131. <span class="sr-font">{{ form.otherAmt }}</span>
  132. </div>
  133. <div>其他(元)</div>
  134. </div>
  135. </el-col>
  136. </el-row>
  137. </div>
  138. <div style="width:100%; height: 181px;">
  139. <span style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">今日数据</span>
  140. <el-row style="display:flex; align-items:center;justify-content:center;width:100%; height: 100%;">
  141. <el-col :xs="12" :sm="12" :lg="3">
  142. <div class="flex-sr">
  143. <div>
  144. <span>0</span>
  145. </div>
  146. <div>充值金额(元)</div>
  147. </div>
  148. </el-col>
  149. <el-col :xs="12" :sm="12" :lg="3">
  150. <div class="flex-sr">
  151. <div>
  152. <span>0</span>
  153. </div>
  154. <div>会员消费金额(元)</div>
  155. </div>
  156. </el-col>
  157. <el-col :xs="12" :sm="12" :lg="3">
  158. <div class="flex-sr">
  159. <div><span>0</span></div>
  160. <div>会员余额(元)</div>
  161. </div>
  162. </el-col>
  163. <el-col :xs="12" :sm="12" :lg="3">
  164. <div class="flex-sr">
  165. <div><span>0</span></div>
  166. <div>新增会员(人)</div>
  167. </div>
  168. </el-col>
  169. <el-col :xs="12" :sm="12" :lg="3">
  170. <div class="flex-sr">
  171. <div><span>0</span></div>
  172. <div>会员总数(人)</div>
  173. </div>
  174. </el-col>
  175. <el-col :xs="12" :sm="12" :lg="3">
  176. <div class="flex-sr">
  177. <div><span>0</span></div>
  178. <div>营销费用(元)</div>
  179. </div>
  180. </el-col>
  181. <el-col :xs="12" :sm="12" :lg="3">
  182. <div class="flex-sr">
  183. <div><span>0</span></div>
  184. <div>营销产出比(%)</div>
  185. </div>
  186. </el-col>
  187. </el-row>
  188. </div>
  189. <!-- <span style="color:#ff9955;font-size:25px;" >|</span><span style="font-size:20px;">数据环比</span>-->
  190. <!-- <el-row>-->
  191. <!-- <el-col :span="6"><div class="grid-content bg-purple">汽油升数环比</div></el-col>-->
  192. <!-- <el-col :span="6"><div class="grid-content bg-purple-light">柴油升数环比</div></el-col>-->
  193. <!-- <el-col :span="6"><div class="grid-content bg-purple">总升数环比</div></el-col>-->
  194. <!-- <el-col :span="6"><div class="grid-content bg-purple-light">总金额环比</div></el-col>-->
  195. <!-- </el-row>-->
  196. </div>
  197. </template>
  198. <script>
  199. import { listSum,listOilType,listViewData } from "@/api/dataSource/saleReport";
  200. export default {
  201. name: "source",
  202. data() {
  203. return {
  204. // 遮罩层
  205. loading: true,
  206. // 选中数组
  207. ids: [],
  208. // 非单个禁用
  209. single: true,
  210. // 非多个禁用
  211. multiple: true,
  212. // 显示搜索条件
  213. showSearch: true,
  214. // 总条数
  215. total: 0,
  216. // 优惠劵管理表格数据
  217. couponList: [],
  218. dateRangeCreatedDate:[],
  219. // 弹出层标题
  220. title: "",
  221. // 是否显示弹出层
  222. open: false,
  223. // 查询参数
  224. queryParams: {
  225. createdDate: null,
  226. stationNo: null,
  227. stationName: null,
  228. beginTime:null,
  229. endTime:null
  230. },
  231. // 表单参数
  232. form: {
  233. zongAmt:0,
  234. zongliters:0,
  235. qyamt:0,
  236. cyamt:0,
  237. qyliters:0,
  238. cyliters:0,
  239. wxAmt:0,
  240. zfbAmt:0,
  241. xjAmt:0,
  242. didiAppAmt:0,
  243. tyAppAmt:0,
  244. otherAmt:0,
  245. memberAmt:0,
  246. posAmt:0
  247. },
  248. // 表单校验
  249. rules: {
  250. }
  251. };
  252. },
  253. created() {
  254. this.dayDataSource();
  255. },
  256. methods: {
  257. /** 查询优惠劵管理列表 */
  258. getList() {
  259. listSum(this.queryParams).then(response => {
  260. if(response.hasOwnProperty('data')){
  261. this.form.zongAmt = response.data.amt;
  262. this.form.zongliters = response.data.orderLiters;
  263. }
  264. });
  265. listOilType(this.queryParams).then(response => {
  266. if(response.hasOwnProperty('rows')){
  267. for(let i in response.rows){
  268. if(response.rows[i].oilType==="2"){
  269. this.form.qyamt=response.rows[i].amt;
  270. this.form.qyliters=response.rows[i].orderLiters;
  271. }else if(response.rows[i].oilType==="1"){
  272. this.form.cyamt=response.rows[i].amt;
  273. this.form.cyliters=response.rows[i].orderLiters;
  274. }
  275. }
  276. }
  277. });
  278. listViewData(this.queryParams).then(response => {
  279. if(response.hasOwnProperty('data')){
  280. if(response.data.wxAmt){
  281. this.form.wxAmt = response.data.wxAmt;
  282. }else{
  283. this.form.wxAmt = 0;
  284. }
  285. if(response.data.zfbAmt){
  286. this.form.zfbAmt = response.data.zfbAmt;
  287. }else{
  288. this.form.zfbAmt = 0;
  289. }
  290. if(response.data.xjAmt){
  291. this.form.xjAmt = response.data.xjAmt;
  292. }else{
  293. this.form.xjAmt = 0;
  294. }
  295. if(response.data.didiAppAmt){
  296. this.form.didiAppAmt = response.data.didiAppAmt;
  297. }else{
  298. this.form.didiAppAmt = 0;
  299. }
  300. if(response.data.tyAppAmt){
  301. this.form.tyAppAmt = response.data.tyAppAmt;
  302. }else{
  303. this.form.tyAppAmt = 0;
  304. }
  305. if(response.data.otherAmt){
  306. this.form.otherAmt = response.data.otherAmt;
  307. }else{
  308. this.form.otherAmt = 0;
  309. }
  310. if(response.data.memberAmt){
  311. this.form.memberAmt = response.data.memberAmt;
  312. }else{
  313. this.form.memberAmt = 0;
  314. }
  315. if(response.data.posAmt){
  316. this.form.posAmt = response.data.posAmt;
  317. }else{
  318. this.form.posAmt = 0;
  319. }
  320. }
  321. });
  322. },
  323. //本日的数据
  324. dayDataSource(){
  325. this.reset();
  326. this.queryParams.beginTime=this.getNowFormatDate(new Date());
  327. this.queryParams.endTime =this.getEndFormatDate(new Date());
  328. this.getList();
  329. },
  330. //昨天的数据
  331. yesDataSource(){
  332. this.reset();
  333. this.queryParams.beginTime=this.getFormatDate(new Date());
  334. this.queryParams.endTime =this.getNowFormatDate(new Date());
  335. this.getList();
  336. },
  337. //本周的数据
  338. workDataSource(){
  339. this.reset();
  340. this.queryParams.beginTime=this.getDates();
  341. this.queryParams.endTime =this.getEndFormatDate(new Date());
  342. this.getList();
  343. },
  344. //本月数据
  345. monthDataSource(){
  346. this.reset();
  347. this.queryParams.beginTime=this.getMonthDate();
  348. this.queryParams.endTime =this.getEndFormatDate(new Date());
  349. this.getList();
  350. },
  351. //按照指定日期
  352. queryDataSource(){
  353. this.reset();
  354. this.queryParams.beginTime =this.dateRangeCreatedDate[0];
  355. this.queryParams.endTime = this.dateRangeCreatedDate[1];
  356. this.getList();
  357. },
  358. //今天
  359. getNowFormatDate(date){
  360. let seperator1="-";
  361. let month=date.getMonth()+1;
  362. let strDate=date.getDate();
  363. if (month>=1&&month<=9){
  364. month="0"+month;
  365. }
  366. if (strDate>=0&&strDate<=9){
  367. strDate="0"+strDate;
  368. }
  369. let currentdate=date.getFullYear()+seperator1+month+seperator1+strDate;
  370. return currentdate;
  371. },
  372. //明天
  373. getEndFormatDate(myDate){
  374. let date = myDate.getDate();
  375. date = date +1;
  376. myDate.setDate(date);
  377. let seperator1="-";
  378. let month=myDate.getMonth()+1;
  379. let strDate=myDate.getDate();
  380. if (month>=1&&month<=9){
  381. month="0"+month;
  382. }
  383. if (strDate>=0&&strDate<=9){
  384. strDate="0"+strDate;
  385. }
  386. let currentdate=myDate.getFullYear()+seperator1+month+seperator1+strDate;
  387. return currentdate;
  388. },
  389. //昨天
  390. getFormatDate(myDate){
  391. let date = myDate.getDate();
  392. date = date - 1;
  393. myDate.setDate(date);
  394. let seperator1="-";
  395. let month=myDate.getMonth()+1;
  396. let strDate=myDate.getDate();
  397. if (month>=1&&month<=9){
  398. month="0"+month;
  399. }
  400. if (strDate>=0&&strDate<=9){
  401. strDate="0"+strDate;
  402. }
  403. let currentdate=myDate.getFullYear()+seperator1+month+seperator1+strDate;
  404. return currentdate;
  405. },
  406. //本周
  407. getDates() {
  408. var new_Date = new Date()
  409. var timesStamp = new_Date.getTime();
  410. var currenDay = new_Date.getDay();
  411. var dates = new Date(timesStamp + 24 * 60 * 60 * 1000 * (0 - (currenDay + 6) % 7)).toLocaleDateString().replace(/[年月]/g, '-').replace(/[日上下午]/g, '');
  412. let s=dates.replace(/-/g,"/");
  413. var dt =new Date(s);
  414. var m = dt.getMonth()+1;
  415. var d = dt.getDate();
  416. m = m<10?"0"+m:m;
  417. d = d<10?"0"+d:d;
  418. dates= dt.getFullYear() +"-"+ m+"-" + d
  419. return dates;
  420. },
  421. /*本月*/
  422. getMonthDate(){
  423. let date=new Date();
  424. let seperator1="-";
  425. let month=date.getMonth()+1;
  426. if (month>=1&&month<=9){
  427. month="0"+month;
  428. }
  429. let currentdate=date.getFullYear()+seperator1+month+seperator1+"01";
  430. return currentdate;
  431. },
  432. // 表单重置
  433. reset() {
  434. this.queryParams = {
  435. createdDate: null,
  436. stationNo: null,
  437. stationName: null
  438. };
  439. this.form = {
  440. zongAmt:0,
  441. zongliters:0,
  442. qyamt:0,
  443. cyamt:0,
  444. qyliters:0,
  445. cyliters:0,
  446. wxAmt:0,
  447. zfbAmt:0,
  448. xjAmt:0,
  449. didiAppAmt:0,
  450. tyAppAmt:0,
  451. otherAmt:0,
  452. memberAmt:0,
  453. posAmt:0
  454. };
  455. }
  456. },
  457. };
  458. </script>
  459. <style lang="scss" scoped>
  460. .flex{
  461. display:flex;
  462. align-items:center;
  463. justify-content:center;
  464. width: 100%;
  465. height: 270px;
  466. flex-direction:column;
  467. }
  468. .xiaoliang{
  469. background-image: url('../../assets/image/bj-1.png');
  470. background-size: 100% 100%;
  471. }
  472. .xiaoe{
  473. background-image: url('../../assets/image/bj-02.png');
  474. background-size: 100% 100%;
  475. }
  476. .qiyou{
  477. background-image: url('../../assets/image/bj-3.png');
  478. background-size: 100% 100%;
  479. }
  480. .chaiyou{
  481. background-image: url('../../assets/image/bj-4.png');
  482. background-size: 100% 100%;
  483. }
  484. .flex-qy{
  485. display:flex;
  486. align-items:center;
  487. justify-content:center;
  488. }
  489. .flex-qy-sx{
  490. display:flex;
  491. align-items:center;
  492. justify-content:center;
  493. flex-direction:column;
  494. }
  495. .panel-group {
  496. padding-left: 10px;
  497. }
  498. .flex-sr{
  499. display:flex;
  500. align-items:center;
  501. justify-content:center;
  502. width: 100%;
  503. flex-direction:column;
  504. }
  505. .sr-font{
  506. font-size: 20px;
  507. color: #F4A645;
  508. }
  509. </style>