chooseCustomerBill.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. systemSetList:null,//系统参数列表
  84. params:{
  85. allCustomerFlag:0 ,//1全部 0需要查询条件
  86. customer:{
  87. queryWord:undefined,
  88. settleStyleSn:undefined
  89. },
  90. bizBeginDate:undefined,
  91. bizEndDate:undefined
  92. },
  93. pageNo:1,
  94. pageSize:15,
  95. noDataText: '暂无数据',
  96. listHeight:200,
  97. dayGatherArr:[],
  98. monthGatherArr:[]
  99. };
  100. },
  101. onReady() {
  102. uni.setNavigationBarColor({
  103. frontColor: '#ffffff',
  104. backgroundColor: this.$config('primaryColor')
  105. });
  106. const query = uni.createSelectorQuery().in(this);
  107. query.select('#tab').boundingClientRect(data => {
  108. this.listHeight = Math.floor(data.height)
  109. }).exec();
  110. },
  111. onLoad() {
  112. this.theme = getApp().globalData.theme;
  113. this.getSetInfo();
  114. //获取日期集合
  115. this.dayGatherArr = getDate.getWeekGather();
  116. this.monthGatherArr = getDate.getMonthGather();
  117. },
  118. onBackPress() {
  119. if(this.gatherShow){
  120. this.gatherShow = false
  121. return true
  122. }
  123. },
  124. methods: {
  125. //获取系统参数
  126. getSetInfo(){
  127. // month day all
  128. queryVerifySalesParams({}).then(res => {
  129. this.systemSetList = res.data;
  130. let obj=res.data.find(item=>{return item.remarks == 'verify_default_customer'})
  131. if(obj.paramValue == 'all'){
  132. this.params.allCustomerFlag = 1;
  133. }else if(obj.paramValue == 'month'){
  134. this.showType = true
  135. }else{
  136. this.showType = false
  137. }
  138. this.momentTime(0)
  139. });
  140. },
  141. changeTabs(index) {
  142. this.params.allCustomerFlag = index;
  143. this.$refs.customer.getList(1);
  144. },
  145. handleDate(i) {
  146. this.chooseNum = i;
  147. this.momentTime(i)
  148. },
  149. chooseType() {
  150. this.chooseNum = 0;
  151. this.showType = !this.showType;
  152. this.momentTime(0)
  153. },
  154. momentTime(pos){
  155. var obj=null;
  156. if(!this.showType){//日
  157. obj =getDate.getFullToday(this.dayGatherArr[pos])
  158. }else{
  159. obj=getDate.getFullMonth(this.monthGatherArr[pos])
  160. }
  161. this.params.bizBeginDate = obj.starttime;
  162. this.params.bizEndDate = obj.endtime;
  163. this.refreshList();
  164. },
  165. getSearchCon(){
  166. this.params.customer.queryWord = this.keyword.trim();
  167. this.refreshList();
  168. },
  169. clearSearch(){
  170. this.refreshList();
  171. },
  172. refreshList(e){
  173. const _this= this
  174. if(e){
  175. _this.params.customer.settleStyleSn = e.code;
  176. }
  177. this.$nextTick(()=>{
  178. _this.$refs.customer.getList(1);
  179. })
  180. }
  181. }
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. .content {
  186. width: 100%;
  187. height: 100vh;
  188. .header {
  189. position: relative;
  190. background: #fff;
  191. .tab {
  192. width: 60%;
  193. margin: 0 auto;
  194. }
  195. .payType {
  196. position: absolute;
  197. right: 20rpx;
  198. text {
  199. vertical-align: top;
  200. font-size: 26rpx;
  201. }
  202. }
  203. }
  204. .scroll-con {
  205. width: 100%;
  206. background: #fff;
  207. margin: 6rpx 0;
  208. padding: 10rpx 20rpx;
  209. .scroll-date {
  210. width: calc(100% - 62rpx);
  211. .scroll-box {
  212. margin-right: 28rpx;
  213. padding: 10rpx 20rpx;
  214. text-align: center;
  215. font-size: 26rpx;
  216. view {
  217. &:last-child {
  218. font-size: 24rpx;
  219. color: #666;
  220. }
  221. }
  222. }
  223. .activeBox {
  224. font-weight: bold;
  225. color: $uni-color-primary;
  226. view {
  227. &:last-child {
  228. font-size: 24rpx;
  229. color: $uni-color-primary;
  230. }
  231. }
  232. }
  233. }
  234. }
  235. .customer-con {
  236. flex-grow: 1;
  237. overflow: auto;
  238. background: #fff;
  239. }
  240. //选择客户
  241. .customer-search {
  242. padding: 10rpx 20rpx;
  243. background: #fff;
  244. margin: 6rpx 0;
  245. }
  246. }
  247. </style>