transactionDetails.vue 15 KB

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