b0f3fd15842b59f92de5d29f371c4ed11cba626b.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <div>
  3. <div class="box">
  4. <div class="row allAlignment center head_on_box">
  5. <p
  6. class="logo"
  7. style="font-size:.6rem;color:#E1E1DF;font-family: 'Franklin Gothic Medium'"
  8. >
  9. <i style="color:#F76649;">HX</i>669
  10. </p>
  11. <p style="color:#fffffe;font-size:.36rem">盈亏记录</p>
  12. <!-- <img class="log" src="../assets/st-imges/indexlogo.png" alt=""> -->
  13. <div class="row allAlignment center">
  14. <img class="user-ion" @click="toRouter()" src="@/assets/st-imges/close.png" alt>
  15. <!-- <div v-if="nameShow" class="row allAlignment center username">
  16. {{name}}
  17. </div>-->
  18. <img
  19. style="margin-left: 0.44rem;"
  20. class="user-ion"
  21. src="@/assets/st-imges/contact.png"
  22. alt
  23. >
  24. </div>
  25. </div>
  26. </div>
  27. <div class="boxIn row item-center">
  28. <div class="date row center">
  29. <yd-button-group>
  30. <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openStart">{{startTime}}</yd-button>
  31. </yd-button-group>
  32. </div>
  33. <p style="margin:0 .22rem">至</p>
  34. <div class="date row center">
  35. <yd-button-group>
  36. <yd-button size="large" bgcolor="rgba(0,0,0,0)" @click.native="openEnd">
  37. <div>{{endTime}}</div>
  38. </yd-button>
  39. </yd-button-group>
  40. </div>
  41. <button class="dateBtn" @click="reset()">查询</button>
  42. </div>
  43. <div
  44. class="row center"
  45. style="height:.88rem;color:#ebebeb;font-size:.32rem;background:#666;margin-top:.1rem;"
  46. v-if="!list"
  47. >对不起,您当前没有登录,请前往登录</div>
  48. <div>
  49. <div class="datalist">
  50. <div>
  51. <yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
  52. <yd-list theme="5" slot="list">
  53. <yd-list-item v-for="(item,index) in list" :key="index">
  54. <yd-list-other slot="other">
  55. <div class="datalistbox row allAlignment">
  56. <p>{{item.money_time}}</p>
  57. <p>{{item.money_type=='1'?'+'+item.money:'-'+item.money}}元</p>
  58. </div>
  59. </yd-list-other>
  60. </yd-list-item>
  61. </yd-list>
  62. </yd-infinitescroll>
  63. </div>
  64. </div>
  65. </div>
  66. <yd-cell-group style="display:none;">
  67. <yd-cell-item arrow>
  68. <yd-datetime
  69. type="date"
  70. ref="datetimeStart"
  71. :end-date="endTime"
  72. slot="right"
  73. v-model="startTime"
  74. ></yd-datetime>
  75. </yd-cell-item>
  76. </yd-cell-group>
  77. <yd-cell-group style="display:none;">
  78. <yd-cell-item arrow>
  79. <yd-datetime
  80. type="date"
  81. ref="datetimeEnd"
  82. :start-date="startTime"
  83. :end-date="date"
  84. slot="right"
  85. v-model="endTime"
  86. ></yd-datetime>
  87. </yd-cell-item>
  88. </yd-cell-group>
  89. </div>
  90. </template>
  91. <script>
  92. import "@/css/index.css";
  93. export default {
  94. name: "ProfitAndLossRecord",
  95. data() {
  96. return {
  97. img: require("@/assets/st-imges/date.png"),
  98. img1: require("@/assets/st-imges/home.png"),
  99. img2: require("@/assets/st-imges/gengduo-1.png"),
  100. active: 0,
  101. list: [],
  102. // 当前时间 同时也是日历结束时间
  103. date: "",
  104. // 查询开始时间
  105. startTime: "",
  106. // 查询结束时间
  107. endTime: "",
  108. // 分页
  109. page: 1,
  110. pageSize: 10,
  111. timers: true
  112. };
  113. },
  114. created() {
  115. this.initialTime();
  116. },
  117. methods: {
  118. //判断登录是否过期
  119. getuserData() {
  120. if (localStorage.getItem("token")) {
  121. this.$http
  122. .post(this.$ports.login.getAgent, {
  123. token: localStorage.getItem("token")
  124. })
  125. .then(res => {
  126. if (res.data.status == -4001) {
  127. this.$store.dispatch("SET_TOKEN", "");
  128. this.$store.dispatch("GET_ISSHOW", false);
  129. this.$dialog.toast({
  130. mes: "对不起您的登录已过期,请您重新登录",
  131. timeout: 3000
  132. });
  133. this.$router.push("/");
  134. }
  135. });
  136. }
  137. },
  138. reset() {
  139. this.list = [];
  140. this.page = 1;
  141. // 重置下拉加载
  142. this.$refs.infinitescrollDemo.$emit("ydui.infinitescroll.reInit");
  143. this.loadList();
  144. },
  145. // 导航
  146. toRouter() {
  147. this.$router.go(-2);
  148. },
  149. // 初始化时间
  150. initialTime() {
  151. // 现在的时间
  152. let date = new Date();
  153. // 日历开始时间
  154. let date2 = new Date(date);
  155. date2.setMonth(date.getMonth() - 3);
  156. this.startDate += `${date2.getFullYear()}-${
  157. date2.getMonth() + 1 < 10
  158. ? "0" + (date2.getMonth() + 1)
  159. : date2.getMonth() + 1
  160. }-${date2.getDate() < 10 ? "0" + date2.getDate() : date2.getDate()}`;
  161. this.date += `${date.getFullYear()}-${
  162. date.getMonth() + 1 < 10
  163. ? "0" + (date.getMonth() + 1)
  164. : date.getMonth() + 1
  165. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  166. // 查询结束时间
  167. this.endTime += `${date.getFullYear()}-${
  168. date.getMonth() + 1 < 10
  169. ? "0" + (date.getMonth() + 1)
  170. : date.getMonth() + 1
  171. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  172. this.startTime = `${date.getFullYear()}-${
  173. date.getMonth() - 2 < 10
  174. ? "0" + (date.getMonth() - 2)
  175. : date.getMonth() - 2
  176. }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;
  177. // console.log(this.startDate);
  178. },
  179. loadList() {
  180. // 补全时间
  181. this.$http
  182. .post(this.$ports.login.ProfitAndLossRecord, {
  183. currentPage: this.page,
  184. pageSize: this.pageSize,
  185. startTime: this.startTime + " 00:00:00", //此处是补全开始时间的时间
  186. endTime:this.endTime + ' 23:59:59',
  187. token: localStorage.getItem("token"),
  188. money_type: 1
  189. })
  190. .then(res => {
  191. // console.log(res, "aaa");
  192. /* 单次请求数据完毕 */
  193. if (res.data.data) {
  194. let table = res.data.data.list;
  195. this.list = [...this.list, ...table];
  196. }
  197. if (res.data.data.list.length < this.pageSize) {
  198. this.$dialog.toast({ mes: "当前已经没有记录", timeout: 1500 });
  199. /* 所有数据加载完毕 */
  200. this.$refs.infinitescrollDemo.$emit(
  201. "ydui.infinitescroll.loadedDone"
  202. );
  203. return;
  204. } else {
  205. /* 单次请求数据完毕 */
  206. this.$refs.infinitescrollDemo.$emit(
  207. "ydui.infinitescroll.finishLoad"
  208. );
  209. this.page++;
  210. }
  211. });
  212. },
  213. // 日历开关
  214. openStart() {
  215. this.$refs.datetimeStart.open();
  216. },
  217. openEnd() {
  218. this.$refs.datetimeEnd.open();
  219. }
  220. },
  221. mounted() {
  222. this.loadList();
  223. let _this = this;
  224. this.$public.ajaxTimerFun(function(timing) {
  225. if (_this.timers) {
  226. _this.getuserData();
  227. } else {
  228. clearInterval(timing);
  229. }
  230. }, 1000 * 60);
  231. },
  232. beforeDestroy() {
  233. this.timers = false;
  234. }
  235. };
  236. </script>
  237. <style scoped>
  238. .yd-list-theme5 .yd-list-item {
  239. padding: 0;
  240. }
  241. div /deep/ .yd-list-theme5 .yd-list-item .yd-list-mes {
  242. padding: 0;
  243. }
  244. div /deep/ .yd-list-img {
  245. display: none;
  246. }
  247. div /deep/ .yd-list-mes {
  248. padding: 0;
  249. }
  250. div /deep/ .yd-list-other {
  251. padding: 0;
  252. }
  253. .boxIn {
  254. background: #e4e4e4;
  255. height: 0.88rem;
  256. padding: 0 0.32rem;
  257. }
  258. .date {
  259. width: 2.5rem;
  260. height: 0.6rem;
  261. border-radius: 0.25rem;
  262. background: #ccc;
  263. }
  264. .dateBtn {
  265. width: 0.94rem;
  266. height: 0.6rem;
  267. border: none;
  268. border-radius: 0.08rem;
  269. background-image: linear-gradient(7deg, #565656 0%, #999999 100%),
  270. linear-gradient(#4a4949, #4a4949);
  271. color: #ffffff;
  272. margin-left: 0.22rem;
  273. }
  274. .datalist-box p {
  275. height: 0.88rem;
  276. display: flex;
  277. align-items: center;
  278. }
  279. .datalistbox div {
  280. width: 100%;
  281. }
  282. .datalist-box {
  283. width: 100%;
  284. height: 0.88rem;
  285. }
  286. .paging {
  287. width: 100%;
  288. height: 0.88rem;
  289. position: absolute;
  290. bottom: 0;
  291. }
  292. .paging p {
  293. width: 0.6rem;
  294. height: 0.6rem;
  295. margin-left: 0.05rem;
  296. border-radius: 0.08rem;
  297. background: #ccc;
  298. display: flex;
  299. justify-content: center;
  300. align-items: center;
  301. color: #363636;
  302. }
  303. .paging p input {
  304. width: 0.6rem;
  305. height: 0.6rem;
  306. background: #ebebeb;
  307. border: 2px solid #ccc;
  308. border-radius: 0.08rem;
  309. }
  310. .paging p button {
  311. width: 0.6rem;
  312. height: 0.6rem;
  313. border: none;
  314. background: #555;
  315. color: #efefef;
  316. display: flex;
  317. justify-content: center;
  318. align-items: center;
  319. border-radius: 0.08rem;
  320. }
  321. .paging p button:active {
  322. background: rgb(126, 125, 125);
  323. color: #ccc;
  324. }
  325. .datalistbox {
  326. margin-top: 0.3rem;
  327. width: 100%;
  328. height: 1rem;
  329. background: #efefef;
  330. padding: 0 0.3rem;
  331. font-size: 0.28rem;
  332. color: #555555;
  333. line-height: 1rem;
  334. }
  335. .datalist {
  336. position: relative;
  337. }
  338. .datalistlet {
  339. background-color: #cccccc;
  340. }
  341. .datalist .active {
  342. background: #f76649 !important;
  343. color: #efefef !important;
  344. }
  345. .msg {
  346. height: 0.88rem;
  347. margin-top: 0.3rem;
  348. color: #ccc;
  349. background: #333;
  350. }
  351. .classifyactive {
  352. color: #f76649;
  353. border-bottom: 2px solid #f76649;
  354. }
  355. .active {
  356. color: rgb(247, 102, 73) !important;
  357. }
  358. .box {
  359. background: #ebebeb;
  360. padding-left: 0.14rem;
  361. }
  362. div /deep/ .yd-btn-block {
  363. height: 100%;
  364. }
  365. #NavSlide {
  366. width: 100%;
  367. overflow: hidden;
  368. }
  369. #NavSlide nav {
  370. padding-top: 0.1rem;
  371. display: -webkit-box;
  372. display: -ms-flexbox;
  373. display: flex;
  374. -webkit-box-align: middle;
  375. -ms-flex-align: middle;
  376. align-items: middle;
  377. overflow: auto;
  378. }
  379. div /deep/ .yd-datetime-content,
  380. div /deep/ .yd-datetime-shade,
  381. div /deep/ .yd-datetime-indicator {
  382. height: 2rem !important;
  383. }
  384. div /deep/ .yd-button {
  385. padding: 0;
  386. width: 100%;
  387. height: 100%;
  388. }
  389. div /deep/ .yd-button button {
  390. margin: 0;
  391. border-radius: 0;
  392. }
  393. #NavSlide p {
  394. text-align: center;
  395. font-size: 0.28rem;
  396. -ms-flex-negative: 0;
  397. flex-shrink: 0;
  398. padding: 0 0.1rem;
  399. color: #b8b8b8;
  400. }
  401. /* #NavSlide p a{
  402. color: #E5E5E5;
  403. text-decoration: none;
  404. } */
  405. #NavSlide p span.active {
  406. color: #363636;
  407. }
  408. .head_on_box {
  409. padding: 0 0.32rem;
  410. }
  411. .box {
  412. height: 0.88rem;
  413. background: linear-gradient(to bottom, #999999, #6a6a6b);
  414. overflow: hidden;
  415. }
  416. .user-ion {
  417. width: 0.3rem;
  418. height: 0.3rem;
  419. }
  420. #NavSlide p {
  421. width: 1.1rem;
  422. }
  423. </style>