record.vue 13 KB

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