transactionDetails.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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. <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?'-':'+'}}¥{{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. }
  218. },
  219. computed: {
  220. ...mapState(['userInfo'])
  221. },
  222. onShow() {},
  223. onLoad() {
  224. this.pageRequest.userId = this.userInfo.sysUser.id;
  225. this.getDictionary('businessSegmentsSZType'); //业务板块
  226. this.getDictionary('incomeAndExpensesType'); //收支类型
  227. this.getDictionary('moneyAttrType'); //交易类型
  228. this.queryList();
  229. },
  230. methods: {
  231. details(item) {
  232. switch (item.transactionType) {
  233. case '1':
  234. this.navigate({
  235. url: "/pages/wallet/billInfo1?companyId=" + item.subOrderNo,
  236. },
  237. "navigateTo", true);
  238. break;
  239. case '2':
  240. case '3':
  241. case '4':
  242. this.navigate({
  243. url: "/pages/wallet/billInfo?type=" + item.transactionType + '&id=' + item.id +
  244. '&subOrderNo=' + item.subOrderNo + '&amount=' + item.amount,
  245. },
  246. "navigateTo", true);
  247. break;
  248. default:
  249. }
  250. },
  251. //状态筛选
  252. statusclick(filed, e) {
  253. this.pageRequest[filed] = e;
  254. if (filed == 'businessSegmentsType') { //业务板块
  255. switch (e) {
  256. case '0':
  257. this.pageRequest.incomeAndExpensesType = '0';
  258. this.pageRequest.transactionType = "0";
  259. this.incomeAndExpensesDisabled = ['0', '1', '2'];
  260. this.transactionDisabled = ['0', '1', '2', '3', '4'];
  261. break;
  262. case '1':
  263. this.pageRequest.incomeAndExpensesType = '0';
  264. this.pageRequest.transactionType = "0";
  265. this.incomeAndExpensesDisabled = ['0', '1', '2'];
  266. this.transactionDisabled = ['0', '1', '2', '3'];
  267. break;
  268. case '2':
  269. this.pageRequest.incomeAndExpensesType = '1';
  270. this.pageRequest.transactionType = "4";
  271. this.incomeAndExpensesDisabled = ['1'];
  272. this.transactionDisabled = ['4'];
  273. break;
  274. }
  275. }
  276. if (filed == 'incomeAndExpensesType') { //收支类型
  277. switch (e) {
  278. case '0':
  279. this.pageRequest.transactionType = "0";
  280. this.transactionDisabled = ['0', '1', '2', '3', '4'];
  281. break;
  282. case '1':
  283. if (this.pageRequest.businessSegmentsType == '2') {
  284. this.pageRequest.transactionType = "4";
  285. this.transactionDisabled = ['4'];
  286. } else {
  287. this.pageRequest.transactionType = "0";
  288. this.transactionDisabled = ['0', '1', '2', '4'];
  289. }
  290. break;
  291. case '2':
  292. this.pageRequest.transactionType = "3";
  293. this.transactionDisabled = ['3'];
  294. break;
  295. }
  296. }
  297. },
  298. //查询事件
  299. querysearch() {
  300. this.queryList();
  301. this.showDropdown = false;
  302. },
  303. async getDictionary(type) {
  304. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  305. if (res.code == '200') {
  306. this[type + 'List'] = res.data.ddList;
  307. }
  308. },
  309. async queryList() {
  310. let res = await this.$http.post('/sysUserAccount/findMyIncomeAndExpensesByUserId', this.pageRequest);
  311. if (res.code == '200') {
  312. this.dataList = res.data.data.content;
  313. this.sumAmountSR = res.data.sumAmountSR;
  314. this.sumAmountZC = res.data.sumAmountZC;
  315. } else {
  316. uni.showToast({
  317. title: data.msg,
  318. icon: 'none',
  319. });
  320. }
  321. },
  322. searchPopup() {
  323. this.showDropdown = !this.showDropdown;
  324. },
  325. //日期筛选
  326. dateclick(e) {
  327. this.pageRequest.dateQueryType = e;
  328. },
  329. startShowmethod() {
  330. this.startShow = true;
  331. },
  332. startconfirm(e) {
  333. this.pageRequest.startDate = e.year + '-' + e.month + '-' + e.day;
  334. },
  335. endShowmethod() {
  336. this.endShow = true;
  337. },
  338. endconfirm(e) {
  339. this.pageRequest.endDate = e.year + '-' + e.month + '-' + e.day;
  340. },
  341. //当前时间
  342. transformTime(day) {
  343. var date = new Date();
  344. date.setFullYear(date.getFullYear());
  345. date.setTime(date.getTime());
  346. var strYear = date.getFullYear();
  347. var strDay = day ? date.getDate() - day : date.getDate();
  348. var strMonth = 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. transformTime1(month) {
  359. var date = new Date();
  360. date.setFullYear(date.getFullYear());
  361. date.setTime(date.getTime());
  362. var strYear = date.getFullYear();
  363. var strDay = date.getDate();
  364. var strMonth = month ? (date.getMonth() + 1) - month : date.getMonth() + 1;
  365. if (strMonth < 10) {
  366. strMonth = "0" + strMonth;
  367. }
  368. if (strDay < 10) {
  369. strDay = "0" + strDay;
  370. }
  371. var datastr = strYear + "-" + strMonth + "-" + strDay;
  372. return datastr;
  373. },
  374. }
  375. }
  376. </script>
  377. <style lang="scss" scoped>
  378. .disableSelection {
  379. color: rgba(51, 51, 51, 0.2);
  380. pointer-events: none;
  381. /* 禁用点击事件 */
  382. }
  383. .dropdown-content {
  384. background-color: rgba(0, 0, 0, 0.6);
  385. height: 0px;
  386. opacity: 0;
  387. transition: opacity 0.3s ease;
  388. .title {
  389. font-size: 14px;
  390. color: #232832;
  391. font-weight: bold;
  392. border-bottom: 1px solid #E1E1E1;
  393. }
  394. .term {
  395. padding-top: 10px;
  396. >text {
  397. color: #232832;
  398. font-weight: bold;
  399. font-size: 13px;
  400. }
  401. }
  402. .operateBtn {
  403. font-weight: bold;
  404. font-size: 16px;
  405. .cancel {
  406. width: 50%;
  407. height: 46px;
  408. color: #0052FF;
  409. background-color: #EAEAEA;
  410. }
  411. .confirm {
  412. width: 50%;
  413. height: 46px;
  414. color: #fff;
  415. background-color: #0052FF;
  416. }
  417. }
  418. }
  419. .dropdown-content1 {
  420. background-color: #fff;
  421. height: 0px;
  422. overflow: hidden;
  423. transition: height 0.4s ease;
  424. }
  425. .show {
  426. height: 100vh;
  427. opacity: 1;
  428. /* 下拉菜单内容的最大高度 */
  429. }
  430. .show1 {
  431. height: 400px;
  432. /* 下拉菜单遮罩最大高度 */
  433. }
  434. .status-data {
  435. padding: 4px 10px;
  436. box-sizing: border-box;
  437. margin: 0 8px 5px 0;
  438. font-size: 12px;
  439. border: 1px solid #eee;
  440. cursor: pointer;
  441. }
  442. .active {
  443. position: relative;
  444. background: rgba(0, 82, 255, 0.1);
  445. color: #0052FF;
  446. border: 1px solid #0052FF;
  447. font-weight: 700;
  448. }
  449. .active::before {
  450. content: "";
  451. position: absolute;
  452. top: 0;
  453. left: 0;
  454. width: 10px;
  455. height: 10px;
  456. background-image: url("/static/image/car-insure/before.png");
  457. background-size: cover;
  458. }
  459. .page {
  460. background: #F8FAFE;
  461. }
  462. .flexd {
  463. position: fixed;
  464. left: 0;
  465. right: 0;
  466. z-index: 9999;
  467. }
  468. .yshoudata {
  469. padding: 8px 16px;
  470. background-color: #fff;
  471. .content {
  472. border-bottom: 1px solid #CFCFCF;
  473. padding: 8px 0;
  474. >text:nth-child(2) {
  475. font-size: 13px;
  476. color: #333;
  477. margin: 4px 0;
  478. }
  479. >view:nth-child(3) {
  480. color: rgba(51, 51, 51, 0.8);
  481. font-size: 12px;
  482. }
  483. }
  484. image {
  485. width: 20px;
  486. height: 20px;
  487. }
  488. }
  489. .headerFilter {
  490. padding: 8px 16px;
  491. background: #F8FAFE;
  492. z-index: 99;
  493. .drop {
  494. width: 106px;
  495. height: 100%;
  496. background: #EAEEF5;
  497. border-radius: 6px;
  498. padding: 5px;
  499. text {
  500. color: rgba(51, 51, 51, 0.8);
  501. font-size: 14px;
  502. }
  503. }
  504. >text {
  505. color: rgba(51, 51, 51, 0.8);
  506. font-size: 14px;
  507. }
  508. }
  509. </style>