移动端
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.

houseAnnounce.vue 7.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. left-arrow
  5. title="公示查询"
  6. fixed
  7. placeholder
  8. @click-left="$router.back()"
  9. >
  10. <template #right>
  11. <van-icon name="@/../static/images/icon/icon_flow.png" size="20" @click="openFilter"/>
  12. </template>
  13. </van-nav-bar>
  14. <van-search
  15. v-model="queryParams.memberName"
  16. placeholder="请输入姓名"
  17. shape="round"
  18. @search="getList(0)"
  19. />
  20. <van-pull-refresh v-model="refreshing" @refresh="getList()">
  21. <van-list
  22. v-model="loading"
  23. :finished="finished"
  24. :immediate-check="false"
  25. finished-text="没有更多了"
  26. @load="getList('+1')"
  27. >
  28. <van-swipe-cell v-for="(item,index) in list" :key="index" class="delegate">
  29. <van-cell :title="item.projectName" center @click="viewItem(item)">
  30. <template #icon>
  31. <van-icon :name="{
  32. '1': '@/../static/images/onlineHome/icon_zjd8.png',
  33. '2': '@/../static/images/onlineHome/icon_zjd8.png',
  34. '3': '@/../static/images/onlineHome/icon_zjd8.png',
  35. '4': '@/../static/images/onlineHome/icon_zjd8.png',
  36. }[item.announceStatus]" size="30" color="#539FFD" style="margin-right: 10px;" />
  37. </template>
  38. <template #label>
  39. <p style="font-weight: bold;">{{formatDict(options.announce_type, item.announceType)}}&nbsp;&nbsp;&nbsp;&nbsp;{{item.startDate}} - {{item.endDate}}</p>
  40. </template>
  41. <template #title>
  42. <p style="font-weight: bold;">{{item.projectName}}</p>
  43. </template>
  44. <template #right-icon>
  45. <p :style="{'font-weight': 'bold',
  46. color: {
  47. '1': '#000000',
  48. '2': '#0066FF',
  49. '3': 'orange',
  50. '4': '#33cc33',
  51. }[item.announceStatus],
  52. }">{{formatDict(options.announce_status, item.announceStatus)}}</p>
  53. </template>
  54. </van-cell>
  55. <template #right>
  56. <van-row style="height: 100%;">
  57. <van-col style="height: 100%;">
  58. <van-button square text="二维码" type="info" style="height: 100%;" @click="openQrCodePreview(item.id)"/>
  59. </van-col>
  60. </van-row>
  61. </template>
  62. </van-swipe-cell>
  63. </van-list>
  64. </van-pull-refresh>
  65. <onlineHomeIndex :current="1"></onlineHomeIndex>
  66. <van-popup
  67. v-model="filterVisible"
  68. closeable
  69. position="top"
  70. :close-on-click-overlay="true"
  71. :lazy-render="false"
  72. >
  73. <van-form>
  74. <van-cell title="筛选查询"></van-cell>
  75. <field-select
  76. v-model="queryParams.announceStatus"
  77. label="公示状态"
  78. value-key="dictLabel"
  79. data-key="dictValue"
  80. placeholder="公示状态筛选"
  81. :columns="options.announce_status"
  82. />
  83. <field-select
  84. v-model="queryParams.announceType"
  85. label="公示类型"
  86. value-key="dictLabel"
  87. data-key="dictValue"
  88. placeholder="公示类型筛选"
  89. :columns="options.announce_type"
  90. />
  91. <field-date-picker
  92. v-model="queryParams.startDate"
  93. label="起始日期"
  94. formatter="yyyy-MM-dd"
  95. placeholder="起始日期"
  96. />
  97. <field-date-picker
  98. v-model="queryParams.endDate"
  99. label="结束日期"
  100. formatter="yyyy-MM-dd"
  101. placeholder="结束日期"
  102. />
  103. <div style="margin: 0.2rem; text-align: right;">
  104. <van-button type="info" native-type="submit" size="small" @click="resetQuery"> 重置 </van-button>
  105. <van-button type="primary" native-type="submit" size="small" @click="getList(0)"> 查询 </van-button>
  106. </div>
  107. </van-form>
  108. </van-popup>
  109. </div>
  110. </template>
  111. <script>
  112. import {listAnnounce, getProposer} from "@/api/onlineHome/homestead/houseAnnounce";
  113. import FieldSelect from "@/components/form/FieldSelect";
  114. import { formatDate } from "element-ui/src/utils/date-util.js"
  115. import { ImagePreview } from 'vant';
  116. import onlineHomeIndex from "@/views/onlineHomeIndex";
  117. import FieldDatePicker from "@/components/form/FieldDatePicker";
  118. export default {
  119. components: {FieldSelect, onlineHomeIndex, FieldDatePicker},
  120. name: "HouseAnnounce",
  121. data() {
  122. return {
  123. list: [],
  124. total: 0,
  125. // ?pageNum=1&pageSize=10&orderByColumn=createTime&isAsc=desc&startDate=2022-04-13&endDate=2022-04-12&announceStatus=2
  126. queryParams: {
  127. pageNum: 1,
  128. pageSize: 10,
  129. orderByColumn: 'createTime',
  130. isAsc: 'desc',
  131. startDate: '',
  132. endDate: '',
  133. announceStatus: null,
  134. memberName: '',
  135. announceType: null,
  136. },
  137. refreshing: false,
  138. loading: false,
  139. finished: false,
  140. options: {
  141. announce_status: [],
  142. announce_type: [],
  143. },
  144. filterVisible: false,
  145. }
  146. },
  147. created() {
  148. this.initOptions();
  149. this.getList();
  150. },
  151. methods: {
  152. getList(target) {
  153. let type = typeof (target);
  154. console.log(type, target);
  155. if (target === 0) {
  156. this.refreshing = true;
  157. this.finished = true;
  158. this.total = 0;
  159. this.queryParams.pageNum = 1;
  160. this.list = [];
  161. this.filterVisible = false;
  162. }
  163. else if (type === 'number')
  164. this.queryParams.pageNum = target;
  165. else if (type === 'string') {
  166. this.queryParams.pageNum = eval(this.queryParams.pageNum + target)
  167. }
  168. else
  169. {
  170. this.refreshing = true;
  171. this.finished = true;
  172. this.resetQuery();
  173. this.total = 0;
  174. this.queryParams.pageNum = 1;
  175. this.list = []
  176. }
  177. listAnnounce(this.queryParams).then((response) => {
  178. console.log(response)
  179. if (response.rows.length === 0) {
  180. this.finished = true;
  181. return;
  182. }
  183. response.rows.forEach((e) => {
  184. this.list.push(e);
  185. });
  186. this.total += response.rows.length;
  187. this.finished = this.total >= response.total;
  188. }).finally(() => {
  189. this.loading = false;
  190. this.refreshing = false;
  191. });
  192. },
  193. viewItem(item) {
  194. window.location = 'proposerLite?type=view&id=' + item.applyProposerId;
  195. },
  196. initOptions() {
  197. for(let k in this.options)
  198. {
  199. this.houseGetDicts(k).then((res) => {
  200. this.options[k] = res.data;
  201. });
  202. }
  203. },
  204. formatDict(dict, value) {
  205. return this.selectDictLabel(dict, value);
  206. },
  207. openFilter() {
  208. this.filterVisible = true;
  209. },
  210. onDatePickerConfirm(data) {
  211. if(data)
  212. {
  213. this.queryParams.startDate = formatDate(data[0], 'yyyy-MM-dd');
  214. this.queryParams.endDate = formatDate(data[1], 'yyyy-MM-dd');
  215. }
  216. else {
  217. this.queryParams.startDate = '';
  218. this.queryParams.endDate = '';
  219. }
  220. },
  221. resetQuery() {
  222. this.onDatePickerConfirm();
  223. this.queryParams.announceStatus = null;
  224. this.queryParams.announceType = null;
  225. },
  226. openQrCodePreview(id) {
  227. getProposer(id).then((resp) => {
  228. ImagePreview([this.$store.getters.baseRoutingUrl + resp.data.qrCodeUrl]);
  229. }).catch((e) => {
  230. this.$toast.fail('获取二维码失败!');
  231. });
  232. },
  233. },
  234. }
  235. </script>
  236. <style scoped>
  237. .delegate {
  238. width: 96%;
  239. margin: 3% 2% 3% 2%;
  240. border-radius: 0.18rem;
  241. overflow: hidden;
  242. box-shadow: 0.1rem 0.1rem 0.15rem 0.02rem rgba(0,0,0,0.16);
  243. }
  244. </style>