transactionDetails.vue 14 KB

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