chooseCustomerBill.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="content flex flex_column">
  3. <view id="tab">
  4. <view class="header u-flex">
  5. <view class="tab">
  6. <u-tabs :show-bar="false" :active-item-style="activeItemStyle" :list="tabsList" :is-scroll="false" :current="params.allCustomerFlag" @change="changeTabs"></u-tabs>
  7. </view>
  8. <view class="payType" @click="gatherShow = true">
  9. <text :style="{ color: wordColor }">收款方式</text>
  10. <u-icon name="shaixuan" custom-prefix="iscm-icon" size="30" :color="wordColor"></u-icon>
  11. </view>
  12. </view>
  13. <view class="scroll-con u-flex u-row-between" v-show="params.allCustomerFlag == 0">
  14. <scroll-view scroll-x class="scroll-date">
  15. <view class="u-flex" v-show="!showType">
  16. <view v-for="(item, i) in dayGatherArr" :key="i">
  17. <view class="scroll-box" :class="chooseNum == i ? 'activeBox' : ''" v-if="i < 2" @click="handleDate(i)">
  18. <view>{{item}}</view>
  19. <view>{{i==0?'今日':'昨日'}}</view>
  20. </view>
  21. <view class="scroll-box" v-else :class="chooseNum == i ? 'activeBox' : ''" @click="handleDate(i)">{{item.split('.')[1]}}</view>
  22. </view>
  23. </view>
  24. <view class="u-flex" v-show="showType">
  25. <view v-for="(con, j) in monthGatherArr" :key="j">
  26. <view class="scroll-box" :class="chooseNum == j ? 'activeBox' : ''" v-if="j < 2" @click="handleDate(j)">
  27. <view>{{con}}</view>
  28. <view>{{j==0?'本月':'上月'}}</view>
  29. </view>
  30. <view class="scroll-box" v-else :class="chooseNum == j ? 'activeBox' : ''" @click="handleDate(j)">{{con}}</view>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. <u-image :src="`../../static/${theme}/navIcon/dayImg.png`" width="42" height="42" v-show="!showType" @click="chooseType"></u-image>
  35. <u-image :src="`../../static/${theme}/navIcon/monthImg.png`" width="42" height="42" v-show="showType" @click="chooseType"></u-image>
  36. </view>
  37. <view class="customer-search" v-show="params.allCustomerFlag == 1">
  38. <u-search
  39. v-model="keyword"
  40. @input="$u.debounce(getSearchCon, 800)"
  41. @search="getSearchCon"
  42. @custom="getSearchCon"
  43. @clear="clearSearch"
  44. :show-action="false"
  45. placeholder="请输入客户名称拼音首字母查询"
  46. ></u-search>
  47. </view>
  48. </view>
  49. <view class="customer-con">
  50. <customerList ref="customer" :height="listHeight" :params="params" ></customerList>
  51. </view>
  52. <!-- 收款方式弹窗 -->
  53. <search :showModal="gatherShow" @refresh="refreshList" @close="gatherShow=false"/>
  54. </view>
  55. </template>
  56. <script>
  57. import search from './gather.vue'
  58. import customerList from './customerList.vue'
  59. import { queryVerifySalesParams } from '@/api/dealerBizParam.js';
  60. import getDate from '@/libs/getDate.js';
  61. export default {
  62. components:{search,customerList},
  63. data() {
  64. return {
  65. tabsList: [
  66. {
  67. name: '最近开单'
  68. },
  69. {
  70. name: '全部客户'
  71. }
  72. ],
  73. activeItemStyle: {
  74. color: this.$config('primaryColor'),
  75. borderBottom: '4rpx solid ' + this.$config('primaryColor')
  76. },
  77. wordColor: this.$config('infoColor'),
  78. theme: '',
  79. showType: false,
  80. chooseNum: 0,
  81. keyword:'',
  82. gatherShow:false,
  83. params:{
  84. allCustomerFlag:0 ,//1全部 0需要查询条件
  85. customer:{
  86. queryWord:undefined,
  87. settleStyleSn:undefined
  88. },
  89. bizBeginDate:undefined,
  90. bizEndDate:undefined
  91. },
  92. pageNo:1,
  93. pageSize:15,
  94. noDataText: '暂无数据',
  95. listHeight:200,
  96. dayGatherArr:[],
  97. monthGatherArr:[]
  98. };
  99. },
  100. onReady() {
  101. uni.setNavigationBarColor({
  102. frontColor: '#ffffff',
  103. backgroundColor: this.$config('primaryColor')
  104. });
  105. const query = uni.createSelectorQuery().in(this);
  106. query.select('#tab').boundingClientRect(data => {
  107. this.listHeight = Math.floor(data.height)
  108. }).exec();
  109. },
  110. onLoad() {
  111. this.theme = getApp().globalData.theme;
  112. this.getSetInfo();
  113. //获取日期集合
  114. this.dayGatherArr = getDate.getWeekGather();
  115. this.monthGatherArr = getDate.getMonthGather();
  116. },
  117. onBackPress() {
  118. if(this.gatherShow){
  119. this.gatherShow = false
  120. return true
  121. }
  122. },
  123. methods: {
  124. //获取系统参数
  125. getSetInfo(){
  126. // month day all
  127. queryVerifySalesParams({}).then(res => {
  128. let result = res.data;
  129. let obj=result.find(item=>{return item.remarks == 'verify_default_customer'})
  130. if(obj.paramValue == 'all'){
  131. this.params.allCustomerFlag = 1;
  132. }else if(obj.paramValue == 'month'){
  133. this.showType = true
  134. }else{
  135. this.showType = false
  136. }
  137. this.momentTime(0)
  138. //获取系统对账周期设置
  139. this.$store.state.vuex_systemSetList = result
  140. });
  141. },
  142. changeTabs(index) {
  143. this.params.allCustomerFlag = index;
  144. this.$refs.customer.getList(1);
  145. },
  146. handleDate(i) {
  147. this.chooseNum = i;
  148. this.momentTime(i)
  149. },
  150. chooseType() {
  151. this.chooseNum = 0;
  152. this.showType = !this.showType;
  153. this.momentTime(0)
  154. },
  155. momentTime(pos){
  156. var obj=null;
  157. if(!this.showType){//日
  158. obj =getDate.getFullToday(this.dayGatherArr[pos])
  159. }else{
  160. obj=getDate.getFullMonth(this.monthGatherArr[pos])
  161. }
  162. this.params.bizBeginDate = obj.starttime;
  163. this.params.bizEndDate = obj.endtime;
  164. this.refreshList();
  165. },
  166. getSearchCon(){
  167. this.params.customer.queryWord = this.keyword.trim();
  168. this.refreshList();
  169. },
  170. clearSearch(){
  171. this.refreshList();
  172. },
  173. refreshList(e){
  174. const _this= this
  175. if(e){
  176. _this.params.customer.settleStyleSn = e.code;
  177. }
  178. this.$nextTick(()=>{
  179. _this.$refs.customer.getList(1);
  180. })
  181. }
  182. }
  183. };
  184. </script>
  185. <style lang="scss" scoped>
  186. .content {
  187. width: 100%;
  188. height: 100vh;
  189. .header {
  190. position: relative;
  191. background: #fff;
  192. .tab {
  193. width: 60%;
  194. margin: 0 auto;
  195. }
  196. .payType {
  197. position: absolute;
  198. right: 20rpx;
  199. text {
  200. vertical-align: top;
  201. font-size: 26rpx;
  202. }
  203. }
  204. }
  205. .scroll-con {
  206. width: 100%;
  207. background: #fff;
  208. margin: 6rpx 0;
  209. padding: 10rpx 20rpx;
  210. .scroll-date {
  211. width: calc(100% - 62rpx);
  212. .scroll-box {
  213. margin-right: 28rpx;
  214. padding: 10rpx 20rpx;
  215. text-align: center;
  216. font-size: 26rpx;
  217. view {
  218. &:last-child {
  219. font-size: 24rpx;
  220. color: #666;
  221. }
  222. }
  223. }
  224. .activeBox {
  225. font-weight: bold;
  226. color: $uni-color-primary;
  227. view {
  228. &:last-child {
  229. font-size: 24rpx;
  230. color: $uni-color-primary;
  231. }
  232. }
  233. }
  234. }
  235. }
  236. .customer-con {
  237. flex-grow: 1;
  238. overflow: auto;
  239. background: #fff;
  240. }
  241. //选择客户
  242. .customer-search {
  243. padding: 10rpx 20rpx;
  244. background: #fff;
  245. margin: 6rpx 0;
  246. }
  247. }
  248. </style>