record.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <view class="index" :style="'padding-top:'+padtop+'px'">
  3. <!-- 头部 -->
  4. <navbar :back="false" title="核销记录" :bgcolor="backgroundColor" color="#fff" fixed zIndex="1010" :center="true" :custom='true' @getTop="getTop" back="true"/>
  5. <view class="sous_sear">
  6. <view class="sous_box" @click="getSearch">
  7. <image :src="searimg" class="sous_img"></image>
  8. <input placeholder="请输入姓名或时间查询" class="sous_input" disabled/>
  9. </view>
  10. </view>
  11. <p style="height: 20rpx; background-color: #f2f2f2;"></p>
  12. <view class="tab">
  13. <!-- //表格 -->
  14. <view class="exele">
  15. <view class="box">
  16. <table @change="change">
  17. <tr class="tr_one">
  18. <th style="width: 120rpx; text-align: center;">姓名</th>
  19. <th style="width:230rpx; text-align: center;">手机号码</th>
  20. <th style="width: 120rpx; text-align: center;">等级</th>
  21. <th style="width: 230rpx; text-align: center;">核销时间</th>
  22. </tr>
  23. <scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40" @scrolltolower="bot_btn" :style="'max-height: calc(100vh - 210rpx - '+padtop+'px);'">
  24. <tr v-for="(item,index) in list" :key="index" :class=" [index%2 ==0 ? 'two_tr two_trtwo':'two_tr']" @click="chakn(item)">
  25. <td style="width: 120rpx; text-align: center;" >{{item.creditName==null?'暂无信息':item.creditName}}</td>
  26. <td style="width: 280rpx; text-align: center;" >{{item.creditPhone==null?'暂无信息':item.creditPhone}}</td>
  27. <td style="width: 120rpx; text-align: center;" >{{item.recordLevel==null?'暂无信息':item.recordLevel}}</td>
  28. <td style="width: 230rpx; text-align: center;" >{{item.createTime==null?'暂无信息':item.createTime}}</td>
  29. <!-- <td style="width: 50rpx; color: #32B16C;" @click.stop="goDetail(item)">查看</td> -->
  30. </tr>
  31. <div class="shax" v-if="list.length>0">
  32. {{wtdt}}
  33. </div>
  34. <div class="zanwu " v-else><span>暂无数据</span></div>
  35. </scroll-view>
  36. </table>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 弹窗 -->
  41. <!-- 搜索弹窗 -->
  42. <view class='bgbox' v-if="searchflag"></view>
  43. <view class="sfixed" v-if="searchflag">
  44. <view class="sfixed_tit">筛选查询</view>
  45. <image :src="closeimg" class="sfixed_clo" @click="getSearClose"></image>
  46. <view class="sfixed_box">
  47. <input placeholder="请输入姓名进行查询" class="sfixed_inp" type="text" value="" v-model="creditName"/>
  48. <view class="sfixed_line"></view>
  49. <view class="sfixed_flex">
  50. <view class="sfixed_a">筛选条件</view>
  51. <view class="sfixed_ar" @click="getClearFn">重置</view>
  52. </view>
  53. <view class="address">
  54. <view class="addtita">核销年份</view>
  55. <view class="addressa">
  56. <picker mode="date" fields="year" :value="recordYear" :start="startDate" :end="endDate" @change="bindDateChange">
  57. <view class="addsa" :style="recordYear?'':'color:#aaaaaa'">{{recordYear?recordYear:'选择核销年份'}}</view>
  58. </picker>
  59. <image :src="rimg" class="addsimg"></image>
  60. </view>
  61. </view>
  62. <view class="address">
  63. <view class="addtita">核销日期</view>
  64. <view class="addressa">
  65. <picker mode="date" :value="createTime" @change="bindDateChangeTime">
  66. <view class="addsa" :style="createTime?'':'color:#aaaaaa'">{{createTime?createTime:'选择核销日期'}}</view>
  67. </picker>
  68. <image :src="rimg" class="addsimg"></image>
  69. </view>
  70. <!-- <view class="addressa">
  71. <view class="addsa" style="color:#AAAAAA;">选择核销日期</view>
  72. <image :src="rimg" class="addsimg"></image>
  73. </view> -->
  74. </view>
  75. <view class="address">
  76. <view class="addtita">核销等级</view>
  77. <view class="addressa">
  78. <picker :value="levelval" :range="levellist" range-key='label' @change="bindDateChangeLevel">
  79. <view class="addsa" :style="recordLevel?'':'color:#aaaaaa'">{{recordLevel?recordLevel:'选择核销等级'}}</view>
  80. </picker>
  81. <!-- <view class="addsa" style="color:#AAAAAA;">选择核销等级</view> -->
  82. <image :src="rimg" class="addsimg"></image>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="sfixed_btn" @click="Seach">查询</view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. // const currentDate = this.getDate({
  94. // format: true
  95. // })
  96. return {
  97. padtop:this.$http._GET.customBarH||0,
  98. backgroundColor: 'linear-gradient(90deg, #A00517, #E93030)',
  99. searimg:require("@/static/images/search.png"),
  100. closeimg:require("@/static/images/del.png"),
  101. searchflag:false,
  102. rimg:require('@/static/images/backrimg.png'),
  103. //列表数据
  104. list: [],
  105. params: { //上拉刷新
  106. pageNum: 1,
  107. pageSize:20,
  108. recordYear:"",
  109. createTime:'',
  110. recordLevel:'',
  111. businessId:'',
  112. },
  113. haveMore: true,
  114. wtdt: '上拉加载更多',
  115. listShow: true, //判断是否有数据 true 有
  116. creditName:null,//姓名
  117. recordYear:'',//核销年份
  118. createTime:'',//核销日期
  119. recordLevel:"",//核销等级
  120. levellist: [],//核销等级
  121. levelval:0,
  122. businessId:'',
  123. };
  124. },
  125. onShow() {
  126. let type = uni.getStorageSync('token')
  127. if (!type) {
  128. uni.reLaunch({
  129. url: '/pages/login/login'
  130. })
  131. }
  132. },
  133. // computed: {
  134. // startDate() {
  135. // return this.getDate('start');
  136. // },
  137. // endDate() {
  138. // return this.getDate('end');
  139. // }
  140. // },
  141. onLoad(option) {
  142. uni.$on('refreshData',(data) => {
  143. this.params.pageNum = 1;
  144. this.list = []
  145. // 修改 获取列表的
  146. // 获取统计
  147. this.lists(this.params)
  148. })
  149. this.businessId = uni.getStorageSync('businessId');
  150. this.params.businessId=uni.getStorageSync('businessId');
  151. // this.getTownsFn();
  152. this.params.pageNum = 1
  153. this.list = []
  154. // 修改 获取列表的
  155. this.lists(this.params)
  156. // 获取字典值
  157. this.getStatelist()
  158. },
  159. beforeDestroy() {
  160. uni.$off("refreshData")
  161. },
  162. created() {
  163. },
  164. methods: {
  165. getTop(e){
  166. this.padtop=e
  167. },
  168. bindDateChange: function(e) {
  169. this.recordYear = e.detail.value
  170. },
  171. bindDateChangeTime(e){
  172. this.createTime = e.detail.value
  173. if(this.recordYear){
  174. var d=e.detail.value.split('-')
  175. this.recordYear=d[0]
  176. }
  177. },
  178. bindDateChangeLevel(e){
  179. var idx=e.detail.value
  180. this.levelval = idx;
  181. this.recordLevel=this.levellist[idx].value
  182. },
  183. // getDate(type) {
  184. // const date = new Date();
  185. // let year = date.getFullYear();
  186. // let month = date.getMonth() + 1;
  187. // let day = date.getDate();
  188. // if (type === 'start') {
  189. // year = year - 60;
  190. // } else if (type === 'end') {
  191. // year = year + 2;
  192. // }
  193. // month = month > 9 ? month : '0' + month;
  194. // day = day > 9 ? day : '0' + day;
  195. // // return `${year}-${month}-${day}`;
  196. // return `${year}`;
  197. // },
  198. // 字典值
  199. getStatelist(){
  200. var that=this;
  201. // 旧字典值
  202. this.$http.get("system/dict/data/type/credit_level").then(res => {
  203. if (res.code == 200) {
  204. that.levellist = res.data.map(v => {
  205. return {
  206. label: v.dictLabel,
  207. value: v.dictValue
  208. }
  209. })
  210. } else {
  211. uni.showToast({
  212. title: res.msg,
  213. duration: 1000,
  214. icon: 'none'
  215. });
  216. }
  217. })
  218. },
  219. getSearch(){
  220. this.recordYear=this.params.recordYear||"";
  221. this.createTime=this.params.createTime||"";
  222. this.recordLevel=this.params.recordLevel||"";
  223. this.creditName=this.params.creditName||"";
  224. this.searchflag=true;
  225. },
  226. getSearClose(){
  227. this.searchflag=false
  228. },
  229. getClose(){
  230. this.houseflag=false;
  231. this.delfalg=false;
  232. },
  233. getClearFn(){
  234. this.recordYear='';
  235. this.createTime='';
  236. this.recordLevel='';
  237. this.creditName='';
  238. },
  239. lists(params) {
  240. this.$http.get("system/record/list", params).then(res => {
  241. //停止下拉加载
  242. uni.hideNavigationBarLoading()
  243. uni.stopPullDownRefresh()
  244. if (res.code == 200) {
  245. if (res.rows.length < params.pageSize) {
  246. this.listShow = false
  247. this.haveMore = false
  248. this.wtdt='到底了~';
  249. } else {
  250. var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
  251. if(num<res.total){
  252. this.listShow = true
  253. this.haveMore = true
  254. this.wtdt='上拉加载更多'
  255. }else{
  256. this.listShow = false
  257. this.haveMore = false
  258. this.wtdt='到底了~';
  259. }
  260. }
  261. if(params.pageNum==1){
  262. this.list = res.rows
  263. }else{
  264. this.list = this.list.concat(res.rows)
  265. }
  266. } else {
  267. uni.showToast({
  268. title: res.msg,
  269. duration: 1000,
  270. icon: 'none'
  271. });
  272. }
  273. })
  274. },
  275. //刷新
  276. bot_btn() {
  277. if (this.haveMore) {
  278. this.params.pageNum++
  279. this.lists(this.params)
  280. }
  281. },
  282. //搜索
  283. Seach() {
  284. this.list = [];
  285. this.searchflag=false;
  286. this.params={
  287. pageNum:1,
  288. pageSize: 20,
  289. recordYear:this.recordYear,
  290. createTime:this.createTime,
  291. recordLevel:this.recordLevel,
  292. creditName:this.creditName,
  293. businessId:this.businessId,
  294. }
  295. this.list = [];
  296. this.lists(this.params)
  297. },
  298. }
  299. }
  300. </script>
  301. <style lang="scss" scoped>
  302. // 新的
  303. .sous_sear{
  304. padding: 18rpx 34rpx;background: #FFFFFF;
  305. .sous_box{width: 100%;height: 72rpx;
  306. background: #F2F2F2;
  307. border-radius: 36rpx;display: flex;align-items: center;padding: 0 34rpx;box-sizing: border-box;
  308. .sous_img{width: 32rpx;height: 34rpx;margin-right: 18rpx;flex: 0 0 auto;}
  309. .sous_input{font-size: 30rpx;color: #AAAAAA;flex: 1;}
  310. }
  311. }
  312. //tab
  313. .tab {
  314. .tabs {
  315. .one_tab {
  316. color: #1678FF !important;
  317. }
  318. .one_tabqie {
  319. border-bottom: 8rpx solid #1678FF;
  320. }
  321. }
  322. }
  323. // 搜索条件width: 562rpx;
  324. .bgbox{position: fixed;left: 0;right: 0;top: 0;bottom: 0;z-index: 3;
  325. background: rgba(0,0,0,0.5);}
  326. .sfixed{min-height: 768rpx;background: #FFFFFF;border-radius: 14rpx;padding: 40rpx 34rpx;box-sizing: border-box;position: fixed;left: 60rpx;right: 60rpx;top: 50%;transform: translateY(-50%);
  327. z-index: 100;max-height: calc(100vh - 280rpx);overflow-y: auto;
  328. .sfixed_tit{font-size: 28rpx;font-weight: bold;color: #343434;line-height: 44rpx;text-align: center;}
  329. .sfixed_clo{width: 34rpx;height: 34rpx;position: absolute;right: 34rpx;top: 44rpx;}
  330. .sfixed_box{
  331. padding-top: 20rpx;
  332. .sfixed_inp{width: 100%;height: 76rpx;background:#F2F2F2;padding: 0 34rpx;box-sizing: border-box;font-size: 28rpx;color: #333333;margin-top: 30rpx;}
  333. .sfixed_line{width: 62rpx;height: 6rpx;background: #D7262A;margin: 38rpx auto 32rpx;}
  334. .sfixed_flex{display: flex;align-items: center;justify-content: space-between;
  335. .sfixed_a{font-size: 26rpx;font-weight: bold;color: #666666;}
  336. .sfixed_ar{font-size: 26rpx;font-weight: bold;color: #DF0024;}
  337. }
  338. }
  339. .sfixed_btn{width: 100%;height: 76rpx;background: linear-gradient(90deg, #A00517, #E93030);
  340. border-radius: 38rpx;font-size: 28rpx;font-weight: bold;
  341. color: #FFFFFF;text-align: center;line-height: 76rpx;margin-top: 62rpx;}
  342. }
  343. .address{
  344. display: flex;align-items: center;
  345. margin-top: 38rpx;
  346. .addtita{flex: 0 0 auto;font-size: 28rpx;font-weight: bold;
  347. color: #343434;}
  348. .addressa{
  349. flex: 1;
  350. display: flex;align-items: center;justify-content: flex-end;
  351. overflow: hidden;
  352. .addsa{font-size: 26rpx;color: #333333;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
  353. flex: 1;text-align: right;
  354. }
  355. .addsimg{width: 16rpx;height: 24rpx;margin-left: 10rpx;flex: 0 0 auto;}
  356. }
  357. .addclear{color: #EA2929;font-size: 26rpx;flex: 0 0 auto;height: 60rpx;line-height: 60rpx;width: 128rpx;text-align:center}
  358. }
  359. //暂无数据
  360. .zanwu {
  361. text-align: center;
  362. padding-top: 20rpx;
  363. span {
  364. font-size: 24rpx;
  365. }
  366. }
  367. .shax {
  368. // height: 83rpx;
  369. font-size: 25rpx;
  370. color: #666;
  371. text-align: center;
  372. }
  373. // .scroll-view {
  374. // max-height: calc(100vh - 401rpx);
  375. // }
  376. // 新的
  377. .index {
  378. // padding-top: 33rpx;
  379. max-height: 100vh;
  380. box-sizing: border-box;
  381. //表格
  382. .exele {
  383. .box {
  384. table{border-spacing: 0rpx;}
  385. .tr_one {
  386. display: flex;
  387. // padding: 0 20rpx;
  388. box-sizing: border-box;
  389. justify-content: space-between;
  390. th {
  391. font-size: 24rpx;
  392. font-family: PingFang SC;
  393. font-weight: 500;
  394. color: #000000;
  395. overflow: hidden;
  396. text-overflow: ellipsis;
  397. white-space: nowrap;
  398. line-height: 78rpx;
  399. height: 78rpx;
  400. }
  401. }
  402. .two_tr {
  403. display: flex;
  404. // padding: 0 20rpx;
  405. box-sizing: border-box;
  406. justify-content: space-between;
  407. td {
  408. font-size: 24rpx;
  409. font-family: PingFang SC;
  410. font-weight: 500;
  411. color: #343434;
  412. min-height: 82rpx;
  413. padding: 20rpx 0;
  414. box-sizing: border-box;
  415. display: flex;
  416. align-items: center;
  417. justify-content: center;
  418. }
  419. // .tdse {
  420. // color: #E60012 !important;
  421. // }
  422. // .apply_span_xl{
  423. // color: #32B16C !important;
  424. // }
  425. // .apply_span_xltwo{
  426. // color: #ffa200 !important;
  427. // }
  428. // .apply_span_xlfive{
  429. // color: #4c4b4b !important;
  430. // }
  431. // .apply_span_xlthreo{
  432. // color: #f00404 !important;
  433. // }
  434. // .apply_span_xlforu{
  435. // color: #aaaaaa !important;
  436. // }
  437. // .coiu {
  438. // color: #EC1717;
  439. // }
  440. }
  441. .two_trtwo {
  442. background-color: #F2F2F2;
  443. }
  444. }
  445. }
  446. }
  447. </style>