You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

335 lines
8.5 KiB

  1. <template>
  2. <view class="page">
  3. <view class="mainpage" :class="sideOpen ? 'show' : ''" style="padding-top: 40px;">
  4. <!-- <l-customlist-banner></l-customlist-banner> -->
  5. <!-- <view class="records"></view> -->
  6. <!-- 顶部条目/分页信息栏 -->
  7. <l-customlist-banner @buttonClick="sideOpen = true">共 {{ records }} 条数据</l-customlist-banner>
  8. <l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="data">
  9. <l-customlist :tips="loadState" showTips>
  10. <l-list>
  11. <l-list-item v-for="(item, ind) in data" :key="item.Id" @click="itemClick(item)">
  12. <view style="flex: 1;">
  13. <view style="display: flex;">
  14. <view style="flex: 1;color: #303133;font-size: 14px;padding: 8px 0;">
  15. <view class="wrap1">{{item.bigGroup}}{{item.smallGroup?"-"+item.smallGroup:""}}</view>
  16. <view style="color: #909399;font-size: 12px;">
  17. <view>
  18. 餐次:{{item.seg||"--"}}
  19. </view>
  20. <view>中心时间:{{item.centralTm||"--"}}</view>
  21. </view>
  22. </view>
  23. <view style="color: #303133;font-weight: 700;font-size: 18px;padding-top: 14px;">
  24. <view style="text-align: right;">{{item.flowamount}}</view>
  25. <view style="color: #909399;font-size: 12px;font-weight: 500;">余额:{{item.balance}}</view>
  26. </view>
  27. </view>
  28. <view class="detail" v-if="item.detailVisiable">
  29. <view>
  30. <text class="title">账 号</text>
  31. {{item.accountNo}}
  32. </view>
  33. <view>
  34. <text class="title">姓 名</text>
  35. {{item.accountName}}
  36. </view>
  37. <view>
  38. <text class="title">部门名称</text>
  39. {{item.depName}}
  40. </view>
  41. <view>
  42. <text class="title">身份证号</text>
  43. {{item.personId}}
  44. </view>
  45. <view>
  46. <text class="title">身份名称</text>
  47. {{item.identiName}}
  48. </view>
  49. <view>
  50. <text class="title">流水类型</text>
  51. {{item.flowtype}}
  52. </view>
  53. <view>
  54. <text class="title">交易金额</text>
  55. {{item.flowamount}}
  56. </view>
  57. <view>
  58. <text class="title">余 额</text>
  59. {{item.balance}}
  60. </view>
  61. <view>
  62. <text class="title">卡 号</text>
  63. {{item.cardNo}}
  64. </view>
  65. <view>
  66. <text class="title">中心时间</text>
  67. {{item.centralTm}}
  68. </view>
  69. <view>
  70. <text class="title">中心序号</text>
  71. {{item.centralNo}}
  72. </view>
  73. <view>
  74. <text class="title">发生时间</text>
  75. {{item.occurTime}}
  76. </view>
  77. <view>
  78. <text class="title">节点名称</text>
  79. {{item.node}}
  80. </view>
  81. <view>
  82. <text class="title">营业大组名称</text>
  83. {{item.bigGroup}}
  84. </view>
  85. <view>
  86. <text class="title">营业小组名称</text>
  87. {{item.smallGroup}}
  88. </view>
  89. <view>
  90. <text class="title">营业餐次</text>
  91. {{item.seg}}
  92. </view>
  93. <view>
  94. <text class="title">Pos机序号</text>
  95. {{item.pos}}
  96. </view>
  97. </view>
  98. </view>
  99. </l-list-item>
  100. </l-list>
  101. </l-customlist>
  102. </l-scroll-list>
  103. </view>
  104. <!-- 侧边栏,用于设置查询条件 -->
  105. <scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
  106. <view v-if="ready" class="padding">
  107. <l-customlist-sidepage-datefilter
  108. v-model="dateRange"
  109. @change="searchChange"
  110. title="按时间日期查询: "
  111. ref="datefilter"
  112. class="margin-bottom"
  113. />
  114. <!-- <l-input
  115. v-model="queryData.LibraryCard"
  116. @change="searchChange"
  117. title ="借书证"
  118. placeholder="按借书证查询"
  119. /> -->
  120. <!-- 重置查询条件按钮 -->
  121. <view class="padding-tb">
  122. <l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
  123. </view>
  124. </view>
  125. </scroll-view>
  126. <!-- 关闭侧边抽屉按钮 -->
  127. <view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
  128. <l-icon type="pullright" color="blue" />
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import pickBy from 'lodash/pickBy'
  134. import mapValues from 'lodash/mapValues'
  135. export default {
  136. data() {
  137. return {
  138. dateRange:null,
  139. weekChina: ['一', '二', '三', '四', '五', '六', '日'],
  140. user: null,
  141. data: [],
  142. total: 1,
  143. records: 0,
  144. ready: false,
  145. page: 1,
  146. rows: 10,
  147. multipleData: {
  148. IsPhone:"0" ,
  149. IdentityCardNo:"",
  150. startTime:undefined,
  151. endTime:undefined,
  152. },
  153. sideOpen: false,
  154. loadState: '向下翻以加载更多',
  155. isReset:false,
  156. // tips: '加载中...',
  157. };
  158. },
  159. onUnload() {
  160. this.OFF('askList');
  161. },
  162. methods: {
  163. async init() {
  164. this.ON('askList', this.refreshList);
  165. // 拉取加载列表和数据源
  166. Promise.all([() => {}]);
  167. var _this = this;
  168. this.user = await this.GET_GLOBAL('loginUser');
  169. this.multipleData.IdentityCardNo = this.user.IdentityCardNo
  170. this.defaultQueryData = this.COPY(this.multipleData)
  171. this.fetchList();
  172. this.ready = true;
  173. },
  174. // 拉取列表
  175. async fetchList() {
  176. if(!this.multipleData.IdentityCardNo)return
  177. if (this.page > this.total)return
  178. let _this = this;
  179. let _postParam = {
  180. pagination: {
  181. rows: _this.rows,
  182. page: _this.page,
  183. sidx: 'centralTm',
  184. sord: 'desc',
  185. },
  186. queryJson: JSON.stringify(_this.multipleData)
  187. };
  188. _this.LOADING('加载数据中…')
  189. _this.HTTP_GET('/Learun/adms/MealCardRunTab/getlist', _postParam, '加载数据时出错').then(res => {
  190. _this.HIDE_LOADING();
  191. console.log(res);
  192. this.data = this.data.concat(res.rows);
  193. _this.total = res.total;
  194. _this.records = res.records;
  195. this.page = res.page + 1;
  196. this.loadState = res.page >= res.total ? '已加载所有数据' : '向下翻以加载更多';
  197. // console.log(_this.$refs.data.$el)
  198. // console.log(_this.$refs.data.$el.getElementsByClassName("customlist"))
  199. // console.log(_this.data);
  200. });
  201. },
  202. // 列表下拉
  203. pullDown() {
  204. this.refreshList().then(() => {
  205. this.$refs.data.stopPullDown();
  206. });
  207. },
  208. async refreshList() {
  209. this.page = 1;
  210. this.total = 1;
  211. this.data = [];
  212. this.fetchList();
  213. },
  214. // 设置搜索条件
  215. async searchChange() {
  216. if(this.isReset)return
  217. const result = {}
  218. // 时间查询相关参数
  219. if (this.dateRange) {
  220. this.multipleData.StartTime = this.dateRange.start
  221. this.multipleData.EndTime = this.dateRange.end
  222. } else{
  223. this.multipleData.StartTime = ""
  224. this.multipleData.EndTime = ""
  225. }
  226. // console.log(this.dateRange,"==========")
  227. this.searchData = result
  228. await this.refreshList()
  229. },
  230. // 点击「清空查询条件」按钮
  231. reset() {
  232. this.isReset = true
  233. this.$refs.datefilter.changeDateRange('all')
  234. this.multipleData = this.COPY(this.defaultQueryData)
  235. this.isReset = false
  236. this.searchChange()
  237. },
  238. itemClick(item){
  239. this.data = this.data.map(item1=>{
  240. if(item1.Id == item.Id){
  241. item.detailVisiable = item.detailVisiable?false:true
  242. }
  243. return item1
  244. })
  245. }
  246. },
  247. computed: {
  248. },
  249. created() {
  250. this.init();
  251. }
  252. };
  253. </script>
  254. <style lang="less" scoped>
  255. @import '~@/common/css/sidepage.less';
  256. @import '~@/common/css/customlist.less';
  257. .page {
  258. background-color: #fff;
  259. }
  260. .page-content {
  261. margin-top: 39px;
  262. }
  263. .records {
  264. color: #8f8f94;
  265. background: #ffffff;
  266. padding: 10px 12px;
  267. width: 100%;
  268. vertical-align: middle;
  269. border-bottom: 0.5px solid #ddd;
  270. position: fixed;
  271. top: var(--window-top);
  272. z-index: 1024;
  273. border-bottom: 0.5px solid #ddd;
  274. height: 40px;
  275. width: 100%;
  276. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  277. // background: #f1f1f1;
  278. }
  279. .pageBox {
  280. // margin-top: 34px;
  281. padding: 5px 15px;
  282. line-height: 24px;
  283. border-bottom: 5px solid #f5f5f5;
  284. }
  285. .delbtn {
  286. position: absolute;
  287. right: 15px;
  288. bottom: 7px;
  289. padding: 3px 10px;
  290. background: #dd524d;
  291. color: #fff;
  292. border-radius: 3px;
  293. }
  294. .wrap1>span{
  295. // width: 100%;
  296. text-overflow: ellipsis;
  297. overflow: hidden;
  298. white-space: nowrap;
  299. }
  300. .detail{
  301. font-size: 12px;
  302. .title{
  303. display: inline-block;
  304. width: 100px;
  305. }
  306. }
  307. </style>