dayReport.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. <template>
  2. <el-scrollbar style="height:100%">
  3. <div>
  4. <div>
  5. <el-form
  6. :model="queryParams"
  7. style="margin-left: 20px;"
  8. ref="queryForm"
  9. :inline="true"
  10. v-show="showSearch"
  11. label-width="68px"
  12. >
  13. <el-form-item>
  14. <el-button size="mini" @click="dayDataSource">今天</el-button>
  15. <el-button size="mini" @click="yesDataSource">昨天</el-button>
  16. <el-button size="mini" @click="workDataSource">本周</el-button>
  17. <el-button size="mini" @click="monthDataSource">本月</el-button>
  18. <el-date-picker
  19. style="margin: 0px 10px;"
  20. size="mini"
  21. v-model="dateRangeCreatedDate"
  22. type="datetimerange"
  23. range-separator="至"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. ></el-date-picker>
  27. <el-button type="cyan" size="mini" @click="queryDataSource">查询</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <span style="color:#ff9955;font-size:25px;">|</span>
  31. <span style="font-size:20px;">数据概览</span>
  32. <el-row :gutter="10" class="panel-group">
  33. <el-col :xs="12" :sm="12" :lg="6">
  34. <div class="flex xiaoliang">
  35. <div style="line-height: 62px;font-size: 44px;">{{ form.zongliters }}L</div>
  36. <div style="font-size: 28px;">总销量</div>
  37. </div>
  38. </el-col>
  39. <el-col :xs="12" :sm="12" :lg="6">
  40. <div class="flex xiaoe">
  41. <div style="line-height: 62px;font-size: 44px;">{{ form.zongAmt }}元</div>
  42. <div style="font-size: 28px;">总金额</div>
  43. </div>
  44. </el-col>
  45. <el-col :xs="12" :sm="12" :lg="6">
  46. <div class="flex xiaoliang">
  47. <div style="line-height: 62px;font-size: 44px;">{{ form.qyamt }}元</div>
  48. <div style="font-size: 28px;">汽油</div>
  49. </div>
  50. </el-col>
  51. <el-col :xs="12" :sm="12" :lg="6">
  52. <div class="flex xiaoliang">
  53. <div style="line-height: 62px;font-size: 44px;">{{ form.cyamt}}元</div>
  54. <div style="font-size: 28px;">柴油</div>
  55. </div>
  56. </el-col>
  57. </el-row>
  58. </div>
  59. <div style="width:100%; height: 360px;background: #FFFFFF;">
  60. <span style="color:#ff9955;font-size:25px;">|</span>
  61. <span style="font-size:20px;">销售情况(本月)</span>
  62. <div ref="myChart" style="width:100%; height: 350px;margin: 0px 25px;"></div>
  63. </div>
  64. <div style="width:100%; height: 181px;">
  65. <span style="color:#ff9955;font-size:25px;">|</span>
  66. <span style="font-size:20px;">详情:</span>
  67. <el-table v-loading="loading" :data="dayReportList">
  68. <el-table-column label="日期" align="center" prop="payDate">
  69. <template slot-scope="scope">
  70. <span>{{ parseTime(scope.row.createdDate, '{y}-{m}-{d}') }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="销额" align="center" prop="amt" />
  74. <el-table-column label="销量(L)" align="center" prop="orderLiters" v-if="false" />
  75. <el-table-column label="汽油" align="center" prop="qyAmt" />
  76. <el-table-column label="柴油" align="center" prop="cyAmt" />
  77. <el-table-column label="订单数" align="center" prop="orderNo" />
  78. <el-table-column label="应收(元)" align="center" prop="receivableAmt" />
  79. <el-table-column label="实收(元)" align="center" prop ="amt"/>
  80. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  81. <template slot-scope="scope">
  82. <el-button
  83. size="mini"
  84. type="text"
  85. icon="el-icon-edit"
  86. @click="handleLook(scope.row)"
  87. >详情</el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <pagination
  92. v-show="total>0"
  93. :total="total"
  94. :page.sync="queryParams.pageNum"
  95. :limit.sync="queryParams.pageSize"
  96. @pagination="dayReportDetail"
  97. />
  98. </div>
  99. <el-dialog :title="title" width="800px" :visible.sync="open" append-to-body>
  100. <el-table v-loading="loading" :data="dayReportDetailsList" show-summary :summary-method="getTotal" >
  101. <el-table-column label="油品" align="center" prop="oilName" />
  102. <el-table-column label="油枪号" align="center" prop="oilGun" />
  103. <el-table-column label="销量(L)" align="center" prop="orderLiters" />
  104. <el-table-column label="应收金额(元)" align="center" prop="receivableAmt" />
  105. <el-table-column label="实收金额(元)" align="center" prop="amt" />
  106. <el-table-column label="优惠金额(元)" align="center" prop="discountAmt" />
  107. <el-table-column label="优惠劵" align="center" prop="discountCouponAmt" v-if="false"/>
  108. <el-table-column label="会员支付" align="center" prop="menberAmt" v-if="false" />
  109. <el-table-column label="微信支付" align="center" prop="wxAmt" v-if="false" />
  110. <el-table-column label="支付宝支付" align="center" prop="zfbAmt" v-if="false" />
  111. <el-table-column label="会员充值" align="center" prop v-if="false" />
  112. <el-table-column label="积分消费" align="center" prop v-if="false" />
  113. </el-table>
  114. <!-- <pagination
  115. v-show="total1>0"
  116. :total="total1"
  117. :page.sync="queryInfo.pageNum"
  118. :limit.sync="queryInfo.pageSize"
  119. @pagination="getLookOrder"
  120. /> -->
  121. </el-dialog>
  122. </div>
  123. </el-scrollbar>
  124. </template>
  125. <script>
  126. import echarts from "echarts";
  127. require("echarts/theme/macarons"); // echarts theme
  128. import {
  129. listSum,
  130. listOilType,
  131. listDayReport,
  132. selectDayReportDetail,
  133. getDetails,
  134. listXdata,
  135. listQydata92,
  136. listQydata95,
  137. listQydata98,
  138. listQydata0,
  139. listQydata10,
  140. listQydata20
  141. } from "@/api/dataSource/saleReport";
  142. export default {
  143. name: "sourceO",
  144. data() {
  145. return {
  146. charts: null,
  147. // 遮罩层
  148. loading: true,
  149. // 选中数组
  150. ids: [],
  151. // 非单个禁用
  152. single: true,
  153. // 非多个禁用
  154. multiple: true,
  155. // 显示搜索条件
  156. showSearch: true,
  157. // 总条数
  158. total: 0,
  159. total1: 0,
  160. // 优惠劵管理表格数据
  161. couponList: [],
  162. dayReportDetailsList: [],
  163. dateRangeCreatedDate: [],
  164. //x轴数据
  165. xdata: [],
  166. //92#汽油数据
  167. qydata92: [],
  168. //95#汽油数据
  169. qydata95: [],
  170. //98#汽油数据
  171. qydata98: [],
  172. //0#柴油数据
  173. cydata0: [],
  174. //-10#柴油数据
  175. cydata10: [],
  176. //-20#柴油数据
  177. cydata20: [],
  178. // 弹出层标题
  179. title: "",
  180. // 是否显示弹出层
  181. open: false,
  182. // 查询参数
  183. queryParams: {
  184. createdDate: null,
  185. stationId:null,
  186. stationName: null,
  187. beginTime: null,
  188. endTime: null,
  189. payDate: null,
  190. pageNum: 1,
  191. pageSize: 10,
  192. status:"1"
  193. },
  194. // 查询参数
  195. queryInfo: {
  196. pageNum: 1,
  197. pageSize: 10,
  198. payDate: null,
  199. status: null,
  200. createdDate: null,
  201. beginTime: null,
  202. endTime: null,
  203. orderType: null,
  204. stationId:null
  205. },
  206. //日报数据
  207. dayReportList: [],
  208. // 表单参数
  209. form: {
  210. zongAmt: 0,
  211. zongliters: 0,
  212. qyamt: 0,
  213. cyamt: 0
  214. },
  215. // 表单校验
  216. rules: {}
  217. };
  218. },
  219. mounted() {
  220. this.$nextTick(() => {
  221. this.queryParams.beginTime = this.getMonthDate();
  222. this.queryParams.endTime = this.getEndFormatDate(new Date());
  223. this.queryParams.stationId=this.$store.selectDeptId;
  224. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  225. this.queryParams.stationId =this.$store.state.user.deptId;
  226. }
  227. setTimeout(() => {
  228. this.initChart();
  229. }, 1000);
  230. });
  231. },
  232. created() {
  233. this.dayDataSource();
  234. //获取折线图的数据
  235. this.reset();
  236. this.queryParams.beginTime = this.getMonthDate();
  237. this.queryParams.endTime = this.getEndFormatDate(new Date());
  238. this.queryParams.stationId=this.$store.selectDeptId;
  239. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  240. this.queryParams.stationId =this.$store.state.user.deptId;
  241. }
  242. this.getDatas();
  243. },
  244. methods: {
  245. initChart() {
  246. // 初始化echarts
  247. this.charts = echarts.init(this.$refs.myChart, "macarons");
  248. this.charts.setOption(
  249. {
  250. xAxis: {
  251. data: this.xdata,
  252. boundaryGap: false,
  253. axisTick: {
  254. show: false
  255. }
  256. },
  257. tooltip: {
  258. trigger: "axis",
  259. axisPointer: {
  260. type: "cross"
  261. },
  262. padding: [5, 10]
  263. },
  264. yAxis: {
  265. axisTick: {
  266. show: false
  267. },
  268. name:"元"
  269. },
  270. legend: {
  271. data: ["92#", "95#", "98#", "0#", "-10#", "-20#"]
  272. },
  273. animation: false,
  274. series: [
  275. {
  276. name: "92#",
  277. itemStyle: {
  278. normal: {
  279. color: "#FF005A",
  280. lineStyle: {
  281. color: "#FF005A",
  282. width: 2
  283. }
  284. }
  285. },
  286. smooth: true,
  287. type: "line",
  288. data: this.qydata92
  289. },
  290. {
  291. name: "95#",
  292. smooth: true,
  293. type: "line",
  294. itemStyle: {
  295. normal: {
  296. color: "#3888fa",
  297. lineStyle: {
  298. color: "#3888fa",
  299. width: 2
  300. }
  301. }
  302. },
  303. data: this.qydata95
  304. },
  305. {
  306. name: "98#",
  307. smooth: true,
  308. type: "line",
  309. itemStyle: {
  310. normal: {
  311. color: "#ffff00",
  312. lineStyle: {
  313. color: "#ffff00",
  314. width: 2
  315. }
  316. }
  317. },
  318. data: this.qydata98
  319. },
  320. {
  321. name: "0#",
  322. smooth: true,
  323. type: "line",
  324. itemStyle: {
  325. normal: {
  326. color: "#00ff00",
  327. lineStyle: {
  328. color: "#00ff00",
  329. width: 2
  330. }
  331. }
  332. },
  333. data: this.cydata0
  334. },
  335. {
  336. name: "-10#",
  337. smooth: true,
  338. type: "line",
  339. itemStyle: {
  340. normal: {
  341. color: "#00bfff",
  342. lineStyle: {
  343. color: "#00bfff",
  344. width: 2
  345. }
  346. }
  347. },
  348. data: this.cydata10
  349. },
  350. {
  351. name: "-20#",
  352. smooth: true,
  353. type: "line",
  354. itemStyle: {
  355. normal: {
  356. color: "#ffb6c1",
  357. lineStyle: {
  358. color: "#ffb6c1",
  359. width: 2
  360. }
  361. }
  362. },
  363. data: this.cydata20
  364. /* animationDuration: 2800,
  365. animationEasing: 'quadraticOut'*/
  366. }
  367. ]
  368. },
  369. true
  370. );
  371. },
  372. getXData() {
  373. return listXdata(this.queryParams).then(response => {
  374. this.xdata = [];
  375. if(response.hasOwnProperty('rows')){
  376. for (let i in response.rows) {
  377. this.xdata.push(response.rows[i].createdDate);
  378. }
  379. }
  380. });
  381. },
  382. getQyData92() {
  383. return listQydata92(this.queryParams).then(response => {
  384. this.qydata92 = [];
  385. if(response.hasOwnProperty('rows')){
  386. for (let i in response.rows) {
  387. let data = [];
  388. data.push(response.rows[i].createdDate);
  389. data.push(response.rows[i].amt);
  390. this.qydata92.push(data);
  391. }
  392. }
  393. });
  394. },
  395. getQydata95() {
  396. return listQydata95(this.queryParams).then(response => {
  397. this.qydata95 = [];
  398. if(response.hasOwnProperty('rows')){
  399. for (let i in response.rows) {
  400. let data = [];
  401. data.push(response.rows[i].createdDate);
  402. data.push(response.rows[i].amt);
  403. this.qydata95.push(data);
  404. }
  405. }
  406. });
  407. },
  408. getQydata98() {
  409. return listQydata98(this.queryParams).then(response => {
  410. this.qydata98 = [];
  411. if(response.hasOwnProperty('rows')){
  412. for (let i in response.rows) {
  413. let data = [];
  414. data.push(response.rows[i].createdDate);
  415. data.push(response.rows[i].amt);
  416. this.qydata98.push(data);
  417. }
  418. }
  419. });
  420. },
  421. getQydata0() {
  422. return listQydata0(this.queryParams).then(response => {
  423. this.cydata0 = [];
  424. if(response.hasOwnProperty('rows')){
  425. for (let i in response.rows) {
  426. let data = [];
  427. data.push(response.rows[i].createdDate);
  428. data.push(response.rows[i].amt);
  429. this.cydata0.push(data);
  430. }
  431. }
  432. });
  433. },
  434. getQydata10() {
  435. return listQydata10(this.queryParams).then(response => {
  436. this.cydata10 = [];
  437. if(response.hasOwnProperty('rows')){
  438. for (let i in response.rows) {
  439. let data = [];
  440. data.push(response.rows[i].createdDate);
  441. data.push(response.rows[i].amt);
  442. this.cydata10.push(data);
  443. }
  444. }
  445. });
  446. },
  447. getQydata20() {
  448. return listQydata20(this.queryParams).then(response => {
  449. this.cydata20 = [];
  450. if(response.hasOwnProperty('rows')){
  451. for (let i in response.rows) {
  452. let data = [];
  453. data.push(response.rows[i].createdDate);
  454. data.push(response.rows[i].amt);
  455. this.cydata20.push(data);
  456. }
  457. }
  458. });
  459. },
  460. //获取折线图用到的数据
  461. getDatas() {
  462. Promise.all([
  463. this.getXData(),
  464. this.getQyData92(),
  465. this.getQydata95(),
  466. this.getQydata98(),
  467. this.getQydata0(),
  468. this.getQydata10(),
  469. this.getQydata20()
  470. ]).then(res => {
  471. this.initChart();
  472. });
  473. },
  474. /** 查询优惠劵管理列表 */
  475. getList() {
  476. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  477. this.queryParams.stationId =this.$store.state.user.deptId;
  478. }
  479. listSum(this.queryParams).then(response => {
  480. if (response.hasOwnProperty('data')) {
  481. this.form.zongAmt = response.data.amt;
  482. this.form.zongliters = response.data.orderLiters;
  483. }
  484. });
  485. listOilType(this.queryParams).then(response => {
  486. if(response.hasOwnProperty('rows')){
  487. for (let i in response.rows) {
  488. if (response.rows[i].oilType === "2") {
  489. this.form.qyamt = response.rows[i].amt;
  490. } else if (response.rows[i].oilType === "1") {
  491. this.form.cyamt = response.rows[i].amt;
  492. }
  493. }
  494. }
  495. });
  496. this.dayReportDetail();
  497. },
  498. dayReportDetail(){
  499. selectDayReportDetail(this.queryParams).then(response => {
  500. this.dayReportList = response.rows;
  501. this.total = response.total;
  502. this.loading = false;
  503. });
  504. },
  505. //本日的数据
  506. dayDataSource() {
  507. this.reset();
  508. this.dateRangeCreatedDate=null;
  509. this.queryParams.beginTime = this.getNowFormatDate(new Date());
  510. this.queryParams.endTime = this.getEndFormatDate(new Date());
  511. this.queryParams.stationId=this.$store.selectDeptId;
  512. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  513. this.queryParams.stationId =this.$store.state.user.deptId;
  514. }
  515. this.getList();
  516. },
  517. //昨天的数据
  518. yesDataSource() {
  519. this.reset();
  520. this.dateRangeCreatedDate=null;
  521. this.queryParams.beginTime = this.getFormatDate(new Date());
  522. this.queryParams.endTime = this.getNowFormatDate(new Date());
  523. this.queryParams.stationId=this.$store.selectDeptId;
  524. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  525. this.queryParams.stationId =this.$store.state.user.deptId;
  526. }
  527. this.getList();
  528. },
  529. //本周的数据
  530. workDataSource() {
  531. this.reset();
  532. this.dateRangeCreatedDate=null;
  533. this.queryParams.beginTime = this.getDates();
  534. this.queryParams.endTime = this.getEndFormatDate(new Date());
  535. this.queryParams.stationId=this.$store.selectDeptId;
  536. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  537. this.queryParams.stationId =this.$store.state.user.deptId;
  538. }
  539. //this.initChart();
  540. //this.getDatas();
  541. this.getList();
  542. },
  543. //本月数据
  544. monthDataSource() {
  545. this.reset();
  546. this.dateRangeCreatedDate=null;
  547. this.queryParams.beginTime = this.getMonthDate();
  548. this.queryParams.endTime = this.getEndFormatDate(new Date());
  549. this.queryParams.stationId=this.$store.selectDeptId;
  550. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  551. this.queryParams.stationId =this.$store.state.user.deptId;
  552. }
  553. //this.getDatas();
  554. this.getList();
  555. },
  556. //按照指定日期
  557. queryDataSource() {
  558. this.reset();
  559. if(this.dateRangeCreatedDate==null){
  560. this.queryParams.stationId=this.$store.selectDeptId;
  561. this.queryParams.beginTime = null;
  562. this.queryParams.endTime = null;
  563. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  564. this.queryParams.stationId =this.$store.state.user.deptId;
  565. }
  566. // this.getDatas();
  567. this.getList();
  568. }else {
  569. this.queryParams.beginTime = this.dateRangeCreatedDate[0];
  570. this.queryParams.endTime = this.dateRangeCreatedDate[1];
  571. this.queryParams.stationId=this.$store.selectDeptId;
  572. if(this.queryParams.stationId==null || this.queryParams.stationId==""){
  573. this.queryParams.stationId =this.$store.state.user.deptId;
  574. }
  575. // this.getDatas();
  576. this.getList();
  577. }
  578. },
  579. //今天
  580. getNowFormatDate(date) {
  581. let seperator1 = "-";
  582. let month = date.getMonth() + 1;
  583. let strDate = date.getDate();
  584. if (month >= 1 && month <= 9) {
  585. month = "0" + month;
  586. }
  587. if (strDate >= 0 && strDate <= 9) {
  588. strDate = "0" + strDate;
  589. }
  590. let currentdate1 =
  591. date.getFullYear() + seperator1 + month + seperator1 + strDate;
  592. return currentdate1;
  593. },
  594. //明天
  595. getEndFormatDate(myDate) {
  596. let date = myDate.getDate();
  597. date = date + 1;
  598. myDate.setDate(date);
  599. let seperator2 = "-";
  600. let month = myDate.getMonth() + 1;
  601. let strDate = myDate.getDate();
  602. if (month >= 1 && month <= 9) {
  603. month = "0" + month;
  604. }
  605. if (strDate >= 0 && strDate <= 9) {
  606. strDate = "0" + strDate;
  607. }
  608. let currentdate2 =
  609. myDate.getFullYear() + seperator2 + month + seperator2 + strDate;
  610. return currentdate2;
  611. },
  612. //昨天
  613. getFormatDate(myDate) {
  614. let date = myDate.getDate();
  615. date = date - 1;
  616. myDate.setDate(date);
  617. let seperator3 = "-";
  618. let month = myDate.getMonth() + 1;
  619. let strDate = myDate.getDate();
  620. if (month >= 1 && month <= 9) {
  621. month = "0" + month;
  622. }
  623. if (strDate >= 0 && strDate <= 9) {
  624. strDate = "0" + strDate;
  625. }
  626. let currentdate3 =
  627. myDate.getFullYear() + seperator3 + month + seperator3 + strDate;
  628. return currentdate3;
  629. },
  630. getDates() {
  631. var new_Date = new Date();
  632. var timesStamp = new_Date.getTime();
  633. var currenDay = new_Date.getDay();
  634. var dates = new Date(
  635. timesStamp + 24 * 60 * 60 * 1000 * (0 - ((currenDay + 6) % 7))
  636. )
  637. .toLocaleDateString()
  638. .replace(/[年月]/g, "-")
  639. .replace(/[日上下午]/g, "");
  640. let s = dates.replace(/-/g, "/");
  641. var dt = new Date(s);
  642. var m = dt.getMonth() + 1;
  643. var d = dt.getDate();
  644. m = m < 10 ? "0" + m : m;
  645. d = d < 10 ? "0" + d : d;
  646. dates = dt.getFullYear() + "-" + m + "-" + d;
  647. return dates;
  648. },
  649. //本月第一天
  650. getMonthDate() {
  651. let date = new Date();
  652. let seperator1 = "-";
  653. let month = date.getMonth() + 1;
  654. if (month >= 1 && month <= 9) {
  655. month = "0" + month;
  656. }
  657. let currentdate =
  658. date.getFullYear() + seperator1 + month + seperator1 + "01";
  659. return currentdate;
  660. },
  661. // 表单重置
  662. reset() {
  663. this.queryParams = {
  664. pageNum: 1,
  665. pageSize: 10,
  666. createdDate: null,
  667. stationId: null,
  668. stationName: null,
  669. beginTime:null,
  670. endTime:null
  671. };
  672. this.form = {
  673. zongAmt: 0,
  674. zongliters: 0,
  675. qyamt: 0,
  676. cyamt: 0
  677. };
  678. },
  679. /** 查看详情按钮操作 */
  680. handleLook(row) {
  681. this.row =row;
  682. row.page= this.queryInfo.pageNum;
  683. row.limit= this.queryInfo.pageSize;
  684. this.getLookOrder(row);
  685. },
  686. getLookOrder(row) {
  687. const createdDate = this.row.createdDate;
  688. this.queryInfo.beginTime =createdDate.substring(0,10) +" 00:00:00";
  689. this.queryInfo.endTime =createdDate.substring(0,10) +" 23:59:59";
  690. this.queryInfo.status = "1";
  691. this.queryInfo.pageNum=row.page;
  692. this.queryInfo.pageSize =row.limit;
  693. this.queryInfo.orderType = "1";
  694. this.queryInfo.stationId=this.$store.selectDeptId;
  695. getDetails(this.queryInfo).then(response => {
  696. this.dayReportDetailsList = response.rows;
  697. this.total1 = response.total;
  698. this.open = true;
  699. this.title = "日报详细信息";
  700. });
  701. },
  702. getTotal(param) {
  703. const { columns, data } = param;
  704. const sums = [];
  705. columns.forEach((column, index) => {
  706. if (index === 0) {
  707. sums[index] = '合计';
  708. return;
  709. }
  710. const values = data.map(item => Number(item[column.property]));
  711. if (column.property === 'orderLiters') {
  712. sums[index] = values.reduce((prev, curr) => {
  713. const value = Number(curr);
  714. if (!isNaN(value)) {
  715. return prev + curr;
  716. } else {
  717. return prev;
  718. }
  719. }, 0);
  720. sums[index]=sums[index].toFixed(2);
  721. }else if(column.property === 'receivableAmt'){
  722. sums[index] = values.reduce((prev, curr) => {
  723. const value = Number(curr);
  724. if (!isNaN(value)) {
  725. return prev + curr;
  726. } else {
  727. return prev;
  728. }
  729. }, 0);
  730. sums[index]=sums[index].toFixed(2);
  731. }else if(column.property === 'amt'){
  732. sums[index] = values.reduce((prev, curr) => {
  733. const value = Number(curr);
  734. if (!isNaN(value)) {
  735. return prev + curr;
  736. } else {
  737. return prev;
  738. }
  739. }, 0);
  740. sums[index]=sums[index].toFixed(2);
  741. }else if(column.property === 'discountAmt'){
  742. sums[index] = values.reduce((prev, curr) => {
  743. const value = Number(curr);
  744. if (!isNaN(value)) {
  745. return prev + curr;
  746. } else {
  747. return prev;
  748. }
  749. }, 0);
  750. sums[index]=sums[index].toFixed(2);
  751. }else if(column.property === 'discountCouponAmt'){
  752. sums[index] = values.reduce((prev, curr) => {
  753. const value = Number(curr);
  754. if (!isNaN(value)) {
  755. return prev + curr;
  756. } else {
  757. return prev;
  758. }
  759. }, 0);
  760. sums[index]=sums[index].toFixed(2);
  761. }else if(column.property === 'menberAmt'){
  762. sums[index] = values.reduce((prev, curr) => {
  763. const value = Number(curr);
  764. if (!isNaN(value)) {
  765. return prev + curr;
  766. } else {
  767. return prev;
  768. }
  769. }, 0);
  770. sums[index]=sums[index].toFixed(2);
  771. }else if(column.property === 'wxAmt'){
  772. sums[index] = values.reduce((prev, curr) => {
  773. const value = Number(curr);
  774. if (!isNaN(value)) {
  775. return prev + curr;
  776. } else {
  777. return prev;
  778. }
  779. }, 0);
  780. sums[index]=sums[index].toFixed(2);
  781. }else if(column.property === 'zfbAmt'){
  782. sums[index] = values.reduce((prev, curr) => {
  783. const value = Number(curr);
  784. if (!isNaN(value)) {
  785. return prev + curr;
  786. } else {
  787. return prev;
  788. }
  789. }, 0);
  790. sums[index]=sums[index].toFixed(2);
  791. }else {
  792. sums[index] = '';
  793. }
  794. });
  795. return sums;
  796. },
  797. }
  798. };
  799. </script>
  800. <style lang="scss" scoped>
  801. .flex {
  802. display: flex;
  803. align-items: center;
  804. justify-content: center;
  805. width: 100%;
  806. height: 270px;
  807. flex-direction: column;
  808. }
  809. .flex-qy {
  810. display: flex;
  811. align-items: center;
  812. justify-content: center;
  813. }
  814. .flex-qy-sx {
  815. display: flex;
  816. align-items: center;
  817. justify-content: center;
  818. flex-direction: column;
  819. }
  820. .panel-group {
  821. padding-left: 10px;
  822. }
  823. .flex-sr {
  824. display: flex;
  825. align-items: center;
  826. justify-content: center;
  827. width: 100%;
  828. flex-direction: column;
  829. }
  830. .sr-font {
  831. font-size: 20px;
  832. color: #f4a645;
  833. }
  834. </style>