reduceRecord.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <van-nav-bar
  3. title="扣缴记录"
  4. left-arrow
  5. @click-left="onClickLeft"
  6. safe-area-inset-top
  7. />
  8. <div class="page_check">
  9. <div class="search_pannel">
  10. <div class="pannel_left">
  11. <van-image
  12. :src="require('@/assets/position.svg')"
  13. width="16"
  14. height="16"
  15. fit="contain"
  16. />
  17. <span>{{ name }}</span>
  18. <van-image
  19. :src="require('@/assets/arrow-right.svg')"
  20. width="24"
  21. height="24"
  22. fit="contain"
  23. />
  24. </div>
  25. <div class="pannel_right" @click="toPath">
  26. <van-image
  27. :src="require('@/assets/search.svg')"
  28. width="16"
  29. height="16"
  30. fit="contain"
  31. />
  32. </div>
  33. </div>
  34. <div class="drop_down">
  35. <van-dropdown-menu active-color="#1989fa">
  36. <van-dropdown-item
  37. v-model="checkType"
  38. @change="handelChange('checkType', checkType)"
  39. :title="checkTypeTitle"
  40. :options="checkTypeList"
  41. />
  42. <van-dropdown-item
  43. v-model="checkPerson"
  44. @change="handelChange('checkPerson', checkPerson)"
  45. :title="checkPersonTitle"
  46. :options="checkPersonList"
  47. />
  48. </van-dropdown-menu>
  49. </div>
  50. <div class="list_total">
  51. <span>共有</span>
  52. <v-count-up
  53. :end-val="total"
  54. class="count_up"
  55. options="{ separator: ',' }"
  56. />
  57. <span>条记录</span>
  58. </div>
  59. <div class="check_info">
  60. <div class="info_list">
  61. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  62. <van-list
  63. v-model:loading="loading"
  64. :finished="finished"
  65. :error="error"
  66. error-text="请求失败,点击重新加载"
  67. finished-text="没有更多了"
  68. @load="onLoad"
  69. >
  70. <div v-for="item in list" :key="item.id" class="list_item">
  71. <div
  72. class="reduce_type"
  73. :style="{
  74. 'background-color': `${
  75. reduceType_filter(item.reduceType)['color']
  76. }`,
  77. }"
  78. >
  79. <span>{{
  80. `${reduceType_filter(item.reduceType)["label"]}`
  81. }}</span>
  82. </div>
  83. <span class="header">{{ item.name }}</span>
  84. <span>扣缴金额:¥{{ item.reduceMoney }}</span>
  85. <span>账户余额:{{ item.accountMoney }}</span>
  86. <span>租户电话:{{ item.tel }}</span>
  87. <span>操作人:{{ item.operator }}</span>
  88. <span>扣缴时间:{{ item.reduceTime }}</span>
  89. </div>
  90. </van-list>
  91. </van-pull-refresh>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import VCountUp from "./CountUp";
  98. export default {
  99. components: {
  100. "v-count-up": VCountUp,
  101. },
  102. data() {
  103. return {
  104. loading: false,
  105. name: "电商园四期-B座",
  106. checkType: "",
  107. checkPerson: "",
  108. checkTypeTitle: "巡检类型",
  109. checkPersonTitle: "巡检人员",
  110. checkTypeList: [
  111. { text: "安保", value: 1 },
  112. { text: "保洁", value: 2 },
  113. ],
  114. checkPersonList: [
  115. { text: "张三", value: 1 },
  116. { text: "李四", value: 2 },
  117. ],
  118. total: 3,
  119. list: [
  120. {
  121. name: "合肥市传秀科技有限公司",
  122. reduceType: 1,
  123. reduceMoney: 100,
  124. accountMoney: 100,
  125. tel: 13212341111,
  126. operator: "张浩",
  127. reduceTime: "2022-09-20 10:34:22",
  128. },
  129. ],
  130. loading: false,
  131. refreshing: false,
  132. finished: false,
  133. };
  134. },
  135. methods: {
  136. reduceType_filter(val) {
  137. if (val == 1) {
  138. return { label: "预存", color: "#30D3A2" };
  139. }
  140. if (val == 2) {
  141. return { label: "补助", color: "#09C700" };
  142. }
  143. if (val == 3) {
  144. return { label: "退费", color: "#FA5555" };
  145. }
  146. if (val == 4) {
  147. return { label: "核缴(水)", color: "#FF9C27" };
  148. }
  149. if (val == 4) {
  150. return { label: "核缴(电)", color: "#FF9C27" };
  151. }
  152. if (val == 4) {
  153. return { label: "核缴(物业)", color: "#FF9C27" };
  154. }
  155. },
  156. onLoad() {
  157. setTimeout(() => {
  158. if (this.refreshing) {
  159. this.list = [];
  160. this.refreshing = false;
  161. }
  162. for (let i = 0; i < 10; i++) {
  163. this.list.push(this.list.length + 1);
  164. }
  165. this.loading = false;
  166. if (this.list.length >= 40) {
  167. this.finished = true;
  168. }
  169. }, 1000);
  170. },
  171. onRefresh() {
  172. // 清空列表数据
  173. this.finished = false;
  174. // 重新加载数据
  175. // 将 loading 设置为 true,表示处于加载状态
  176. this.loading = true;
  177. this.onLoad();
  178. },
  179. // change事件可以拿到的是value
  180. handelChange(type, val) {
  181. console.log(type, val);
  182. if (type == "checkType") {
  183. // 这里打印出来的值就是我们想要的text
  184. this.checkTypeTitle = this.checkTypeList.filter(
  185. (item) => item.value === val
  186. )[0].text;
  187. }
  188. if (type == "checkPerson") {
  189. // 这里打印出来的值就是我们想要的text
  190. this.checkPersonTitle = this.checkPersonList.filter(
  191. (item) => item.value === val
  192. )[0].text;
  193. }
  194. },
  195. onClickLeft() {},
  196. },
  197. };
  198. </script>
  199. <style lang="scss" scoped>
  200. .page_check {
  201. height: 100%;
  202. .search_pannel {
  203. padding: 10px 16px;
  204. background: #5c8fff;
  205. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.04);
  206. display: flex;
  207. align-items: center;
  208. .pannel_left {
  209. display: flex;
  210. align-items: center;
  211. span {
  212. height: 24px;
  213. font-size: 16px;
  214. font-weight: 400;
  215. color: #ffffff;
  216. line-height: 24px;
  217. text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04);
  218. text-indent: 4px;
  219. }
  220. }
  221. .pannel_left,
  222. .pannel_right {
  223. flex: 1;
  224. }
  225. .pannel_right {
  226. text-align: right;
  227. }
  228. }
  229. .drop_down {
  230. /deep/ {
  231. --van-gray-4: #999999;
  232. --van-dropdown-menu-title-text-color: #0c1935;
  233. }
  234. }
  235. .list_total {
  236. padding: 0 16px;
  237. margin: 8px 0;
  238. display: flex;
  239. text-align: left;
  240. span {
  241. height: 16px;
  242. font-size: 12px;
  243. font-weight: 400;
  244. color: #999999;
  245. line-height: 16px;
  246. }
  247. .count_up {
  248. font-size: 16px;
  249. font-weight: 500;
  250. color: #fa5555;
  251. margin: 0 2px;
  252. }
  253. }
  254. .check_info {
  255. padding: 0 16px;
  256. height: calc(
  257. 100% - var(--van-nav-bar-height) - var(--van-dropdown-menu-height) - 76px
  258. );
  259. .info_list {
  260. height: 100%;
  261. overflow-y: auto;
  262. .list_item {
  263. background: #ffffff;
  264. box-shadow: 0px 0px 10px 0px rgba(153, 153, 153, 0.15);
  265. border-radius: 4px;
  266. margin-bottom: 12px;
  267. padding: 12px 16px;
  268. display: flex;
  269. flex-direction: column;
  270. align-items: flex-start;
  271. position: relative;
  272. &:nth-last-child(1) {
  273. margin-bottom: 0;
  274. }
  275. .header {
  276. height: 22px;
  277. font-size: 16px;
  278. font-weight: 600;
  279. color: #313836;
  280. line-height: 22px;
  281. margin-bottom: 8px;
  282. }
  283. span {
  284. height: 18px;
  285. font-size: 14px;
  286. font-weight: 400;
  287. color: #999999;
  288. line-height: 18px;
  289. margin-bottom: 4px;
  290. &:nth-last-child(1) {
  291. margin-bottom: 0;
  292. }
  293. }
  294. .reduce_type {
  295. position: absolute;
  296. top: 0;
  297. right: 0;
  298. width: 48px;
  299. height: 24px;
  300. border-radius: 0px 4px 0px 10px;
  301. span {
  302. height: 16px;
  303. font-size: 12px;
  304. font-weight: 400;
  305. color: #ffffff;
  306. line-height: 16px;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. }
  313. </style>