transactionDetails.vue 14 KB

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