collectionManagement.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <view style="background-color: #f2f2f6;padding-bottom: 0.01rpx;" :class="mask ? 'tl-show': ''">
  3. <!-- <u-navbar title="代收款" bgColor="#FD4B09" :autoBack="true" :placeholder="true" leftIconColor="#fff" :titleStyle="{color: '#fff'}"> -->
  4. <!-- <view slot="right">
  5. <u-icon name="clock" size="40rpx" color="#fff" @click="historical0rders()"></u-icon>
  6. </view> -->
  7. <!-- </u-navbar> -->
  8. <view style="background-color: #fff;position: fixed;top: var(--window-top);width: 100%;z-index: 8;">
  9. <u-tabs :list="tabsList" itemStyle="height:88rpx;" lineColor="#FD4B09" @click="tabsClick"
  10. :current="current">
  11. <view slot="right" style="font-size: 15px;" @click="sortOpen = !sortOpen,mask = !mask">
  12. <text style="margin-left: 10rpx;">|<text style="margin:0rpx 15rpx">排序</text></text>
  13. </view>
  14. </u-tabs>
  15. <view style="background-color: #fff;padding: 10rpx 20rpx;">
  16. <u-search placeholder="请输入客户名称" v-model="form.corpsName" @custom="custom"></u-search>
  17. </view>
  18. </view>
  19. <view class="dropdown" v-if="sortOpen" @click.stop="dropdownOpen()">
  20. <view style="background-color: #fff;">
  21. <u-cell-group>
  22. <u-cell title="客户名称" @click="sortQuery(1)">
  23. <view style="display: flex;" slot="value" @click.stop="sortQuery(1,form.sort == 0?'1':'0')">
  24. {{form.typeSort == 1?form.sort==0?'正序':'倒序':''}}
  25. <u-icon :name="form.typeSort == 1?form.sort==0?'arrow-up-fill':'arrow-down-fill':''">
  26. </u-icon>
  27. </view>
  28. </u-cell>
  29. <u-cell title="销售单号" @click="sortQuery(2)">
  30. <view style="display: flex;" slot="value" @click.stop="sortQuery(2,form.sort == 0?'1':'0')">
  31. {{form.typeSort == 2?form.sort==0?'正序':'倒序':''}}
  32. <u-icon :name="form.typeSort == 2?form.sort==0?'arrow-up-fill':'arrow-down-fill':''">
  33. </u-icon>
  34. </view>
  35. </u-cell>
  36. <u-cell title="金额" @click="sortQuery(3)">
  37. <view style="display: flex;" slot="value" @click.stop="sortQuery(3,form.sort == 0?'1':'0')">
  38. {{form.typeSort == 3?form.sort==0?'正序':'倒序':''}}
  39. <u-icon :name="form.typeSort == 3?form.sort==0?'arrow-up-fill':'arrow-down-fill':''">
  40. </u-icon>
  41. </view>
  42. </u-cell>
  43. <u-cell title="日期" @click="sortQuery(4)">
  44. <view style="display: flex;" slot="value" @click.stop="sortQuery(4,form.sort == 0?'1':'0')">
  45. {{form.typeSort == 4?form.sort==0?'正序':'倒序':''}}
  46. <u-icon :name="form.typeSort == 4?form.sort==0?'arrow-up-fill':'arrow-down-fill':''">
  47. </u-icon>
  48. </view>
  49. </u-cell>
  50. <u-cell title="提交" @click="sortQuery(5)">
  51. <view style="display: flex;" slot="value" @click.stop="sortQuery(5,form.sort == 0?'1':'0')">
  52. {{form.typeSort == 5?form.sort==0?'正序':'倒序':''}}
  53. <u-icon :name="form.typeSort == 5?form.sort==0?'arrow-up-fill':'arrow-down-fill':''">
  54. </u-icon>
  55. </view>
  56. </u-cell>
  57. </u-cell-group>
  58. </view>
  59. </view>
  60. <view class="contentBox" style="margin-top: 100px;">
  61. <view class="textBox">
  62. <view>待收款总金额</view>
  63. <view>本月增加</view>
  64. </view>
  65. <view class="textBox">
  66. <view>¥
  67. <text style="font-size: 40rpx;">{{statistics.total}}</text>
  68. </view>
  69. <view>¥
  70. <text style="font-size: 44rpx;">{{statistics.month}}</text>
  71. </view>
  72. </view>
  73. <view class="textBox">
  74. <view>流动资金增长率:{{statistics.flowAmount}}%</view>
  75. </view>
  76. </view>
  77. <view class="content">
  78. <view class="contentBox" v-for="(item,index) in dataList" :key="index">
  79. <view style="width: 100%;margin: 0 auto;">
  80. <u-cell-group :border="false">
  81. <u-cell :border="false" center :titleStyle="{
  82. 'fontSize': '36rpx',
  83. 'color':'#000'
  84. }" :title="item.corpsName" arrow-direction="down">
  85. <view slot="icon" style="width: 10rpx;height: 35rpx;background-color: #fd4b09;"></view>
  86. <view slot="value" @click="choice(item,index)" style="padding: 5rpx 30rpx;border:1rpx solid #FD4B09;border-radius: 100rpx;color: #FD4B09;">收款</view>
  87. </u-cell>
  88. </u-cell-group>
  89. <view class="textBox">
  90. <view @click="makePhoneCall(item.tel)">{{item.tel}}</view>
  91. <view style="color: #FD4B09;font-size: 32rpx;">¥{{item.balanceAmount}}元</view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <u-empty v-if="total == 0" style="position: absolute;top: 45%;left: 50%;transform:translate(-50%,-50%)"
  97. mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
  98. <uni-calendar ref="calendar" :insert="false" :range="true" @confirm="confirmCalendar" />
  99. <u-picker :show="show" :columns="columns" :keyName="keyName" @cancel="show = false" @confirm="confirm"></u-picker>
  100. <u-loadmore v-if="total !== 0 && dataList.length != 0" :status="status" />
  101. </view>
  102. </template>
  103. <script>
  104. import {
  105. queryList,
  106. corpsDescList,
  107. profitStatistics,
  108. gainUser
  109. } from '@/api/views/sale/collectionManagement.js'
  110. export default {
  111. data() {
  112. return {
  113. dataList: [],
  114. columns: [],
  115. show: false,
  116. sortOpen: false,
  117. mask: false,
  118. current: 0,
  119. total: 0,
  120. status: 'loadmore',
  121. keyName: 'cname',
  122. statistics: {
  123. flowAmount: "0.00",
  124. month: "0.00",
  125. total: "0.00"
  126. },
  127. form: {
  128. current: 1,
  129. size: 20,
  130. },
  131. tabsList: [{
  132. name: '全部',
  133. badge: {
  134. value: 0,
  135. }
  136. }, {
  137. name: '订单区间',
  138. badge: {
  139. value: 0,
  140. }
  141. }, {
  142. name: '客户名称',
  143. badge: {
  144. value: 0,
  145. }
  146. }, {
  147. name: '业务员',
  148. badge: {
  149. value: 0,
  150. }
  151. }]
  152. }
  153. },
  154. onShow() {
  155. this.dataList = []
  156. this.query()
  157. },
  158. onReachBottom() {
  159. this.status = 'loading'
  160. if (this.dataList.length < this.total) {
  161. this.form.current++
  162. this.query()
  163. } else {
  164. this.status = 'nomore'
  165. }
  166. },
  167. methods: {
  168. custom(e){
  169. this.form = {
  170. current: 1,
  171. size: 20,
  172. corpsName:e
  173. }
  174. this.dataList = []
  175. this.query()
  176. },
  177. makePhoneCall(tel) {
  178. uni.makePhoneCall({
  179. phoneNumber: tel,
  180. success: function() {
  181. console.log('拨打电话成功');
  182. },
  183. fail() {
  184. uni.showToast({
  185. title: '拨打电话失败',
  186. icon: 'none',
  187. mask: true
  188. });
  189. }
  190. })
  191. },
  192. sortQuery(val, sort = 0) {
  193. this.form = {
  194. current: 1,
  195. size: 10,
  196. sort: sort,
  197. typeSort: val
  198. }
  199. this.dataList = []
  200. this.sortOpen = false
  201. this.mask = false
  202. this.current = 0
  203. this.query()
  204. },
  205. dropdownOpen() {
  206. this.sortOpen = false
  207. this.mask = false
  208. },
  209. choice(item, index) {
  210. uni.$u.route('/pages/views/salesSlip/aiiReceivables', item);
  211. },
  212. //查询
  213. query() {
  214. uni.showLoading({
  215. title: '加载中',
  216. mask: true
  217. });
  218. queryList({
  219. ...this.form,
  220. billType: "XS",
  221. tradeType: "YPJ",
  222. modular: 1
  223. }).then(res => {
  224. if (res.data.records) {
  225. this.dataList = this.dataList.concat(res.data.records)
  226. }
  227. this.total = res.data.total || 0
  228. uni.hideLoading();
  229. if (this.total < 10) {
  230. this.status = 'nomore'
  231. }
  232. })
  233. profitStatistics(this.form).then(res => {
  234. this.statistics = res.data
  235. })
  236. },
  237. tabsClick(item) {
  238. this.current = item.index
  239. if (item.name == "订单区间") {
  240. this.$refs.calendar.open()
  241. } else if (item.name == "客户名称") {
  242. uni.showLoading({
  243. title: '加载中',
  244. mask: true
  245. });
  246. corpsDescList({
  247. corpType: "KH"
  248. }).then(res => {
  249. this.columns = [res.data]
  250. this.show = true
  251. this.keyName = "cname"
  252. uni.hideLoading();
  253. })
  254. } else if (item.name == "业务员") {
  255. this.keyName = "name"
  256. this.screen = ['sales', 'salesName']
  257. uni.showLoading({
  258. title: '加载中',
  259. mask: true
  260. });
  261. gainUser().then(res => {
  262. this.columns = [res.data]
  263. this.show = true
  264. this.mask = true
  265. uni.hideLoading();
  266. })
  267. } else if (item.name == "全部") {
  268. this.form = {
  269. current: 1,
  270. size: 20
  271. }
  272. this.dataList = []
  273. this.query()
  274. }
  275. },
  276. confirm(e) {
  277. if (this.screen[1] == "salesName") {
  278. this.form = {
  279. current: 1,
  280. size: 20,
  281. salesName: e.value[0].id
  282. }
  283. this.dataList = []
  284. this.query()
  285. this.show = false
  286. this.mask = false
  287. }else{
  288. this.form = {
  289. current: 1,
  290. size: 20,
  291. corpId: e.value[0].id
  292. }
  293. this.dataList = []
  294. this.query()
  295. this.show = false
  296. this.mask = false
  297. }
  298. },
  299. //确认日期
  300. confirmCalendar(e) {
  301. this.form = {
  302. current: 1,
  303. size: 20,
  304. orderStartDate: e.range.before + ' 00:00:00',
  305. orderEndDate: e.range.after + ' 23:59:59'
  306. }
  307. this.dataList = []
  308. this.query()
  309. },
  310. }
  311. }
  312. </script>
  313. <style scoped>
  314. .contentBox {
  315. width: 96%;
  316. margin: 20rpx auto;
  317. background-color: #FFFFFF;
  318. border-radius: 20rpx;
  319. /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
  320. padding-top: 15rpx;
  321. padding-bottom: 10rpx;
  322. }
  323. .textBox {
  324. padding: 0 15px;
  325. display: flex;
  326. justify-content: space-between;
  327. font-size: 24rpx;
  328. margin-bottom: 10rpx;
  329. align-items: flex-end;
  330. }
  331. .dropdown {
  332. position: fixed;
  333. z-index: 9;
  334. background: rgba(0, 0, 0, .3);
  335. width: 100%;
  336. left: 0;
  337. top: calc(var(--status-bar-height) + 90px);
  338. bottom: 0;
  339. }
  340. .tl-show {
  341. overflow: hidden;
  342. position: fixed;
  343. height: 100%;
  344. width: 100%;
  345. }
  346. </style>