transactionDetails.vue 15 KB

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