settleList.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="jie-suan">
  3. <h1>结算列表</h1>
  4. <table-lists
  5. ref="tableLists"
  6. v-model="list"
  7. :filter="filter"
  8. :sear="sear"
  9. :filterSear="2"
  10. @emptyFilter="emptyFilter"
  11. requestApi="/sales/settleList"
  12. style="background:#fff;padding:10px"
  13. @loading="load"
  14. >
  15. <template slot="filterContent">
  16. <FormItem label="可提现金额:" :label-width="90">
  17. <Input style="width: 73px" type="text" size="large" v-model="filter.cashMoneyMin" placeholder="最小金额" clearable/>
  18. <Input style="width: 73px;margin-left: 2px" type="text" size="large" v-model="filter.cashMoneyMax" placeholder="最大金额" clearable/>
  19. </FormItem>
  20. <FormItem label="结算时间:" :label-width="70" style="margin-right: 30px">
  21. <DatePicker
  22. type="datetime"
  23. size="large"
  24. v-model="dataVals1"
  25. placeholder="起始时间"
  26. format="yyyy-MM-dd HH:mm:ss"
  27. style="width: 172px"
  28. :options="options1"
  29. @on-change="handleChange1"
  30. @on-ok="confirmed1"
  31. @on-open-change="opened1"
  32. ></DatePicker>
  33. <DatePicker
  34. type="datetime"
  35. size="large"
  36. v-model="dataVals2"
  37. placeholder="截止时间"
  38. format="yyyy-MM-dd HH:mm:ss"
  39. style="width:172px; margin-left:2px"
  40. :options="options2"
  41. @on-change="handleChange2"
  42. @on-ok="confirmed2"
  43. @on-open-change="opened2"
  44. ></DatePicker>
  45. </FormItem>
  46. </template>
  47. <template slot="filterRight">
  48. <Input suffix="md-search" type="text" size="large" v-model="sear.keyword" placeholder="搜索单号或手机号" clearable class="ser-ipt"/>
  49. </template>
  50. <Table
  51. size="large"
  52. ellipsis
  53. :loading="loading"
  54. ref="selection"
  55. :columns="columns"
  56. :data="list.lists"
  57. stripe
  58. @on-row-click="rowClick"
  59. >
  60. </Table>
  61. <template slot="options">
  62. <div style="color:#d7d7d7;font-size:14px">共计{{list.total ? list.total : '0'}}条结算记录</div>
  63. </template>
  64. </table-lists>
  65. </div>
  66. </template>
  67. <script>
  68. import { ChangeDate } from '../../assets/js/date'
  69. export default {
  70. methods: {
  71. load (val) {
  72. this.loading = val
  73. },
  74. rowClick (data) {
  75. const news = this.$router.resolve({path: '/sales/settleList/settleDetail', query:{id:data.id, uid:data.uid, deType:'jiesuan'}})
  76. window.open(news.href,'_blank')
  77. },
  78. emptyFilter (val) {
  79. if (val) {
  80. this.filter.keyword = ''
  81. this.filter.cashMoneyMin = ''
  82. this.filter.cashMoneyMax = ''
  83. this.filter.cashTimeStart = ''
  84. this.filter.cashTimeEnd = ''
  85. this.dataVals1 = ''
  86. this.dataVals2 = ''
  87. }
  88. },
  89. handleChange1 (date) {
  90. this.filter.cashTimeStart = date
  91. },
  92. handleChange2 (date) {
  93. this.filter.cashTimeEnd = date
  94. },
  95. confirmed1 () {
  96. if (this.filter.cashTimeStart && this.filter.cashTimeEnd) {
  97. if (this.filter.cashTimeStart > this.filter.cashTimeEnd) {
  98. this.dataVals1 = ''
  99. this.filter.cashTimeStart = ''
  100. this.$Notice.warning({
  101. title: '警告提示',
  102. desc: "起始时间应小于截止时间",
  103. duration: 5
  104. })
  105. }
  106. }
  107. },
  108. confirmed2 () {
  109. if (this.filter.cashTimeStart && this.filter.cashTimeEnd) {
  110. if (this.filter.cashTimeStart > this.filter.cashTimeEnd) {
  111. this.dataVals2 = ''
  112. this.filter.cashTimeEnd = ''
  113. this.$Notice.warning({
  114. title: '警告提示',
  115. desc: "截止时间应大于起始时间",
  116. duration: 5
  117. })
  118. }
  119. }
  120. },
  121. opened1 (val) {
  122. if (val) {
  123. return
  124. } else {
  125. this.confirmed1()
  126. }
  127. },
  128. opened2 (val) {
  129. if (val) {
  130. return
  131. } else {
  132. this.confirmed2()
  133. }
  134. }
  135. },
  136. data () {
  137. return {
  138. lis: '',
  139. loading: false,
  140. requestType: [],
  141. dataVals1: '',
  142. dataVals2: '',
  143. filter: {
  144. // keyword: '',
  145. cashMoneyMin: '',
  146. cashMoneyMax: '',
  147. cashTimeStart: '',
  148. cashTimeEnd: ''
  149. },
  150. sear: {
  151. keyword: ''
  152. },
  153. options1: {
  154. disabledDate: (function(date) {
  155. var timeEnd = ChangeDate(this.filter.cashTimeEnd)
  156. var p_time = new Date(timeEnd).getTime()
  157. return date && date.valueOf() > p_time;
  158. }).bind(this)
  159. },
  160. options2: {
  161. disabledDate: (function(date) {
  162. var timeStart = ChangeDate(this.filter.cashTimeStart)
  163. var p_time = new Date(timeStart).getTime()
  164. return date && date.valueOf() < p_time;
  165. }).bind(this)
  166. },
  167. columns: [
  168. {
  169. title: '结算单号',
  170. key: 'code',
  171. align: 'center'
  172. },
  173. {
  174. title: '手机号',
  175. key: 'phone',
  176. align: 'center'
  177. },
  178. {
  179. title: '结算时间',
  180. key: 'createtime',
  181. width: '170',
  182. align: 'center'
  183. },
  184. {
  185. title: '销售金额',
  186. key: 'sale_cash',
  187. align: 'center',
  188. render: (h, {row}) => {
  189. return h('div','¥' + (row.sale_cash/100).toLocaleString('en-US'))
  190. }
  191. },
  192. {
  193. title: '佣金金额',
  194. key: 'commission',
  195. align: 'center',
  196. render: (h, {row}) => {
  197. return h('div','¥' + (row.commission/100).toLocaleString('en-US'))
  198. }
  199. },
  200. {
  201. title: '个税金额',
  202. key: 'tax_cash',
  203. align: 'center',
  204. render: (h, {row}) => {
  205. return h('div','¥' + (row.tax_cash/100).toLocaleString('en-US'))
  206. }
  207. },
  208. {
  209. title: '认证金额',
  210. key: 'auth_cash',
  211. align: 'center',
  212. render: (h, {row}) => {
  213. return h('div','¥' + (row.auth_cash/100).toLocaleString('en-US'))
  214. }
  215. },
  216. {
  217. title: '可提现金额',
  218. key: 'can_cash',
  219. className: 'table-info-settle',
  220. align: 'center',
  221. render: (h, {row}) => {
  222. return h('div','¥' + (row.can_cash/100).toLocaleString('en-US'))
  223. }
  224. }
  225. ],
  226. list: []
  227. }
  228. },
  229. }
  230. </script>
  231. <style lang="scss" scoped>
  232. .jie-suan {
  233. h1 {
  234. font-size:24px;
  235. color:#3f4047;
  236. padding: 10px 0 20px 10px;
  237. }
  238. .ser-ipt {
  239. width: 162px;
  240. }
  241. }
  242. </style>