transactionDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <view class="page">
  3. <public-module></public-module>
  4. <view class="flexd">
  5. <view class="headerFilter dis a-c j-s">
  6. <view class="drop dis a-c j-s" @tap="searchPopup">
  7. <image src="/static/image/addStaff/screen.png" mode="" style="width: 18px;height: 18px;"></image>
  8. <text>全部筛选</text>
  9. <u-icon name="arrow-down-fill" color="#9A9A9A" size="16"></u-icon>
  10. </view>
  11. <text>收入¥{{sumAmountSR?sumAmountSR:0}}</text>
  12. <text>支出¥{{sumAmountZC?sumAmountZC:0}}</text>
  13. </view>
  14. <view :class="['dropdown-content', { 'show': showDropdown }]" @tap="searchPopup">
  15. <view :class="['dropdown-content1','dis','f-c','j-s', { 'show1': showDropdown }]" @tap.stop.prevent>
  16. <view style="padding: 0 16px; box-sizing: border-box;">
  17. <view class="term">
  18. <text>业务板块</text>
  19. <view class="dis a-c f-wrap j-start" style="margin-top: 5px;">
  20. <view class="status-data"
  21. :class="{'active':item.dictValue==pageRequest.businessSegmentsType}"
  22. v-for="(item,index) in businessSegmentsSZTypeList"
  23. @tap.stop.prevent="statusclick('businessSegmentsType',item.dictValue)" :key="index">
  24. {{item.dictTag}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="term">
  29. <text>收支类型</text>
  30. <view class="dis a-c f-wrap j-start" style="margin-top: 5px;">
  31. <view class="status-data "
  32. :class="{'active':item.dictValue==pageRequest.incomeAndExpensesType,'disableSelection':!incomeAndExpensesDisabled.includes(item.dictValue)}"
  33. v-for="(item,index) in incomeAndExpensesTypeList"
  34. @tap.stop.prevent="statusclick('incomeAndExpensesType',item.dictValue)"
  35. :key="index">
  36. {{item.dictTag}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="term">
  41. <text>交易类型</text>
  42. <view class="dis a-c f-wrap j-start" style="margin-top: 5px;">
  43. <view class="status-data"
  44. :class="{'active':item.dictValue==pageRequest.transactionType,'disableSelection':!transactionDisabled.includes(item.dictValue)}"
  45. v-for="(item,index) in moneyAttrTypeList"
  46. @tap.stop.prevent="statusclick('transactionType',item.dictValue)" :key="index">
  47. {{item.dictTag}}
  48. </view>
  49. </view>
  50. </view>
  51. <view class="term">
  52. <text>筛选日期</text>
  53. <view class="dis a-c f-wrap j-start" style="margin-top: 5px;">
  54. <view class="status-data" :class="item.value==pageRequest.dateQueryType? 'active':''"
  55. v-for="(item,index) in dateList" @tap="dateclick(index)" :key="index">
  56. {{item.label}}
  57. </view>
  58. <view class="dis a-c">
  59. <view class="status-data" :class="startShow? 'active' :''" @tap="startShowmethod()">
  60. <text v-if="pageRequest.startDate!=''">{{pageRequest.startDate}}</text>
  61. <text v-else>{{transformTime()}}</text>
  62. </view>
  63. <text style="margin: 0 8px;font-size: 12px;">至</text>
  64. <view class="status-data" :class="endShow? 'active' :''" @tap="endShowmethod()">
  65. <text v-if="pageRequest.endDate!=''">{{pageRequest.endDate}}</text>
  66. <text v-else>{{transformTime()}}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="operateBtn dis ">
  73. <view class="cancel dis a-c j-c" @click="showDropdown=false">
  74. 取消
  75. </view>
  76. <view class="confirm dis a-c j-c" @click="querysearch">
  77. 确定
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="" style="padding-top: 52px;">
  84. <view class="yshoudata" v-for="(item,index) in dataList" :key="index" @click="details(item)">
  85. <view class=" dis f-c content">
  86. <view class="dis a-c j-s">
  87. <view class="dis a-c" v-if="item.transactionType==1">
  88. <image src="/static/image/wallet/shouxu.png" mode="">
  89. </image>
  90. <text style="margin-left: 5px;font-size: 14px;color: #333;">车险</text>
  91. </view>
  92. <view class="dis a-c" v-if="item.transactionType==2">
  93. <image src="/static/image/wallet/tuiguang.png" mode="">
  94. </image>
  95. <text style="margin-left: 5px;font-size: 14px;color: #333;">推广</text>
  96. </view>
  97. <view class="dis a-c" v-if="item.transactionType==3">
  98. <image src="/static/image/wallet/tixian.png" mode="">
  99. </image>
  100. <text style="margin-left: 5px;font-size: 14px;color: #333;">提现</text>
  101. </view>
  102. <text style="font-size: 14px;font-weight: bold;"
  103. :style="{ color: item.transactionType == 3 ? '#333' : '#FF5600' }">{{item.transactionType==3?'-':'+'}}{{item.amount}}</text>
  104. </view>
  105. <text v-if="item.transactionType !== 3">订单号:{{item.subOrderNo}}</text>
  106. <text>交易号:{{item.id}}</text>
  107. <view class="dis a-c j-s">
  108. <text>{{item.signingTime}}</text>
  109. <text v-if="item.transactionType!=3">车牌号:{{item.licenseNo}}</text>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 回到顶部 -->
  115. <u-picker v-model="startShow" mode="time" :params="params" @confirm="startconfirm"></u-picker>
  116. <u-picker v-model="endShow" mode="time" :params="params" @confirm="endconfirm"></u-picker>
  117. </view>
  118. </template>
  119. <script>
  120. import {
  121. mapState
  122. } from "vuex"
  123. export default {
  124. data() {
  125. return {
  126. params: {
  127. year: true, //年
  128. month: true, //月
  129. day: true, //日
  130. hour: false,
  131. minute: false,
  132. second: false,
  133. },
  134. sumAmountSR: 0, //总收入
  135. sumAmountZC: 0, //总支出
  136. dataList: [],
  137. startShow: false,
  138. endShow: false,
  139. timespecifications: null,
  140. pageRequest: {
  141. businessSegmentsType: 0, //业务板块
  142. dateQueryType: 0, //日期类型
  143. incomeAndExpensesType: 0, //收支类型
  144. transactionType: 0, //交易类型
  145. userId: "",
  146. endDate: "",
  147. startDate: "",
  148. pageNum: 1,
  149. pageSize: 20,
  150. },
  151. showDropdown: false,
  152. businessSegmentsSZTypeList: [],
  153. incomeAndExpensesTypeList: [],
  154. //交易类型字典
  155. moneyAttrTypeList: [],
  156. jiaoyiList: [{
  157. label: '车险',
  158. value: 1,
  159. src: "/static/image/wallet/shouxu.png"
  160. },
  161. {
  162. label: '推广费',
  163. value: 2,
  164. src: "/static/image/wallet/tuiguang.png"
  165. },
  166. {
  167. label: '提现',
  168. value: 3,
  169. src: "/static/image/wallet/tixian.png"
  170. }
  171. ],
  172. //日期筛选list
  173. dateList: [{
  174. label: '全部',
  175. value: 0,
  176. },
  177. {
  178. label: '一周内',
  179. value: 1,
  180. },
  181. {
  182. label: '一个月内',
  183. value: 2,
  184. },
  185. {
  186. label: '三个月内',
  187. value: 3,
  188. },
  189. {
  190. label: '六个月内',
  191. value: 4,
  192. },
  193. ],
  194. incomeAndExpensesDisabled: ['0', '1', '2'],
  195. transactionDisabled: ['0', '1', '2', '3', '4'],
  196. }
  197. },
  198. computed: {
  199. ...mapState(['userInfo'])
  200. },
  201. onShow() {},
  202. onLoad() {
  203. this.pageRequest.userId = this.userInfo.sysUser.id;
  204. this.getDictionary('businessSegmentsSZType'); //业务板块
  205. this.getDictionary('incomeAndExpensesType'); //收支类型
  206. this.getDictionary('moneyAttrType'); //交易类型
  207. this.queryList();
  208. },
  209. methods: {
  210. details(item) {
  211. switch (item.transactionType) {
  212. case '1':
  213. this.navigate({
  214. url: "/pages/wallet/billInfo1?companyId=" + item.subOrderNo,
  215. },
  216. "navigateTo", true);
  217. break;
  218. case '2':
  219. case '3':
  220. this.navigate({
  221. url: "/pages/wallet/billInfo?type=" + item.transactionType + '&id=' + item.id +
  222. '&subOrderNo=' + item.subOrderNo + '&amount=' + item.amount,
  223. },
  224. "navigateTo", true);
  225. break;
  226. default:
  227. }
  228. },
  229. //状态筛选
  230. statusclick(filed, e) {
  231. this.pageRequest[filed] = e;
  232. if (filed == 'businessSegmentsType') { //业务板块
  233. switch (e) {
  234. case '0':
  235. this.pageRequest.incomeAndExpensesType = '0';
  236. this.pageRequest.transactionType = "0";
  237. this.incomeAndExpensesDisabled = ['0', '1', '2'];
  238. this.transactionDisabled = ['0', '1', '2', '3', '4'];
  239. break;
  240. case '1':
  241. this.pageRequest.incomeAndExpensesType = '0';
  242. this.pageRequest.transactionType = "0";
  243. this.incomeAndExpensesDisabled = ['0', '1', '2'];
  244. this.transactionDisabled = ['0', '1', '2', '3'];
  245. break;
  246. case '2':
  247. this.pageRequest.incomeAndExpensesType = '1';
  248. this.pageRequest.transactionType = "4";
  249. this.incomeAndExpensesDisabled = ['1'];
  250. this.transactionDisabled = ['4'];
  251. break;
  252. }
  253. }
  254. if (filed == 'incomeAndExpensesType') { //收支类型
  255. switch (e) {
  256. case '0':
  257. this.pageRequest.transactionType = "0";
  258. this.transactionDisabled = ['0', '1', '2', '3', '4'];
  259. break;
  260. case '1':
  261. if (this.pageRequest.businessSegmentsType == '2') {
  262. this.pageRequest.transactionType = "4";
  263. this.transactionDisabled = ['4'];
  264. } else {
  265. this.pageRequest.transactionType = "0";
  266. this.transactionDisabled = ['0', '1', '2', '4'];
  267. }
  268. break;
  269. case '2':
  270. this.pageRequest.transactionType = "3";
  271. this.transactionDisabled = ['3'];
  272. break;
  273. }
  274. }
  275. },
  276. //查询事件
  277. querysearch() {
  278. this.queryList();
  279. this.showDropdown = false;
  280. },
  281. async getDictionary(type) {
  282. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  283. if (res.code == '200') {
  284. this[type + 'List'] = res.data.ddList;
  285. }
  286. },
  287. async queryList() {
  288. let res = await this.$http.post('/sysUserAccount/findMyIncomeAndExpensesByUserId', this.pageRequest);
  289. if (res.code == '200') {
  290. this.dataList = res.data.data.content;
  291. this.sumAmountSR = res.data.sumAmountSR;
  292. this.sumAmountZC = res.data.sumAmountZC;
  293. }
  294. },
  295. searchPopup() {
  296. this.showDropdown = !this.showDropdown;
  297. },
  298. //日期筛选
  299. dateclick(e) {
  300. this.pageRequest.dateQueryType = e;
  301. },
  302. startShowmethod() {
  303. this.startShow = true;
  304. },
  305. startconfirm(e) {
  306. this.pageRequest.startDate = e.year + '-' + e.month + '-' + e.day;
  307. },
  308. endShowmethod() {
  309. this.endShow = true;
  310. },
  311. endconfirm(e) {
  312. this.pageRequest.endDate = e.year + '-' + e.month + '-' + e.day;
  313. },
  314. //当前时间
  315. transformTime(day) {
  316. var date = new Date();
  317. date.setFullYear(date.getFullYear());
  318. date.setTime(date.getTime());
  319. var strYear = date.getFullYear();
  320. var strDay = day ? date.getDate() - day : date.getDate();
  321. var strMonth = date.getMonth() + 1;
  322. if (strMonth < 10) {
  323. strMonth = "0" + strMonth;
  324. }
  325. if (strDay < 10) {
  326. strDay = "0" + strDay;
  327. }
  328. var datastr = strYear + "-" + strMonth + "-" + strDay;
  329. return datastr;
  330. },
  331. transformTime1(month) {
  332. var date = new Date();
  333. date.setFullYear(date.getFullYear());
  334. date.setTime(date.getTime());
  335. var strYear = date.getFullYear();
  336. var strDay = date.getDate();
  337. var strMonth = month ? (date.getMonth() + 1) - month : date.getMonth() + 1;
  338. if (strMonth < 10) {
  339. strMonth = "0" + strMonth;
  340. }
  341. if (strDay < 10) {
  342. strDay = "0" + strDay;
  343. }
  344. var datastr = strYear + "-" + strMonth + "-" + strDay;
  345. return datastr;
  346. },
  347. }
  348. }
  349. </script>
  350. <style lang="scss" scoped>
  351. .disableSelection {
  352. color: rgba(51, 51, 51, 0.2);
  353. pointer-events: none;
  354. /* 禁用点击事件 */
  355. }
  356. .dropdown-content {
  357. background-color: rgba(0, 0, 0, 0.6);
  358. height: 0px;
  359. opacity: 0;
  360. transition: opacity 0.3s ease;
  361. .title {
  362. font-size: 14px;
  363. color: #232832;
  364. font-weight: bold;
  365. border-bottom: 1px solid #E1E1E1;
  366. }
  367. .term {
  368. padding-top: 10px;
  369. >text {
  370. color: #232832;
  371. font-weight: bold;
  372. font-size: 13px;
  373. }
  374. }
  375. .operateBtn {
  376. font-weight: bold;
  377. font-size: 16px;
  378. .cancel {
  379. width: 50%;
  380. height: 46px;
  381. color: #0052FF;
  382. background-color: #EAEAEA;
  383. }
  384. .confirm {
  385. width: 50%;
  386. height: 46px;
  387. color: #fff;
  388. background-color: #0052FF;
  389. }
  390. }
  391. }
  392. .dropdown-content1 {
  393. background-color: #fff;
  394. height: 0px;
  395. overflow: hidden;
  396. transition: height 0.4s ease;
  397. }
  398. .show {
  399. height: 100vh;
  400. opacity: 1;
  401. /* 下拉菜单内容的最大高度 */
  402. }
  403. .show1 {
  404. height: 400px;
  405. /* 下拉菜单遮罩最大高度 */
  406. }
  407. .status-data {
  408. padding: 4px 10px;
  409. box-sizing: border-box;
  410. margin: 0 8px 5px 0;
  411. font-size: 12px;
  412. border: 1px solid #eee;
  413. cursor: pointer;
  414. }
  415. .active {
  416. position: relative;
  417. background: rgba(0, 82, 255, 0.1);
  418. color: #0052FF;
  419. border: 1px solid #0052FF;
  420. font-weight: 700;
  421. }
  422. .active::before {
  423. content: "";
  424. position: absolute;
  425. top: 0;
  426. left: 0;
  427. width: 10px;
  428. height: 10px;
  429. background-image: url("/static/image/car-insure/before.png");
  430. background-size: cover;
  431. }
  432. .page {
  433. background: #F8FAFE;
  434. }
  435. .flexd {
  436. position: fixed;
  437. left: 0;
  438. right: 0;
  439. z-index: 9999;
  440. }
  441. .yshoudata {
  442. padding: 8px 16px;
  443. background-color: #fff;
  444. .content {
  445. border-bottom: 1px solid #CFCFCF;
  446. padding: 8px 0;
  447. >text:nth-child(2) {
  448. font-size: 13px;
  449. color: #333;
  450. margin: 4px 0;
  451. }
  452. >view:nth-child(3) {
  453. color: rgba(51, 51, 51, 0.8);
  454. font-size: 12px;
  455. }
  456. }
  457. image {
  458. width: 20px;
  459. height: 20px;
  460. }
  461. }
  462. .headerFilter {
  463. padding: 8px 16px;
  464. background: #F8FAFE;
  465. z-index: 99;
  466. .drop {
  467. width: 106px;
  468. height: 100%;
  469. background: #EAEEF5;
  470. border-radius: 6px;
  471. padding: 5px;
  472. text {
  473. color: rgba(51, 51, 51, 0.8);
  474. font-size: 14px;
  475. }
  476. }
  477. >text {
  478. color: rgba(51, 51, 51, 0.8);
  479. font-size: 14px;
  480. }
  481. }
  482. </style>