chooseCustomerBill.vue 6.8 KB

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