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

181 line
4.8 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-search v-model="value" placeholder="请输入搜索关键词" @search="onSearch"/>
  4. <van-dropdown-menu>
  5. <van-dropdown-item v-model="value1" :options="projectTypeOption" @change="getList"/>
  6. <van-dropdown-item :value="value2" :title="value2" ref="item">
  7. <van-tree-select
  8. :active-id.sync="activeId"
  9. :items="deptListOption"
  10. :main-active-index.sync="activeIndex"
  11. :max="1"
  12. @click-item="clickItem"
  13. @click-nav="clickNav"
  14. />
  15. </van-dropdown-item>
  16. <van-dropdown-item v-model="value3" :options="option3" @change="getList"/>
  17. </van-dropdown-menu>
  18. <van-list v-model="loading" :finished="finished" finished-text="没有更多了">
  19. <router-link :to="{path:'project/projectDetail',query:{id:item.id}}" v-for="(item,index) in infoList">
  20. <van-card :thumb="item.fileUrl?''+item.fileUrl:'../../static/images/index/projectImg.png'" >
  21. <template #tags>
  22. <p class="title">【{{item.rollout}}】{{item.projectName}}</p>
  23. <p class="type">{{ item.projectShowStatus }}</p>
  24. <p class="timeEnd">报名结束 {{ item.signupStopTime }}</p>
  25. <p class="timeEnd">竞价结束 {{ item.biddingStopTime }}</p>
  26. <van-row>
  27. <van-col span="12" class="money"><span>{{ item.price }}</span>{{ item.unit }}</van-col>
  28. <van-col span="8" offset="4" class="time">{{ item.projectReleaseTime }}</van-col>
  29. </van-row>
  30. </template>
  31. </van-card>
  32. </router-link>
  33. </van-list>
  34. </div>
  35. </template>
  36. <script>
  37. import {getOutProjectList,getDeptList} from "../../api/project";
  38. export default {
  39. name: "project",
  40. data() {
  41. return {
  42. value1: '',
  43. value2: '标的物位置',
  44. activeId: 1,
  45. activeIndex: 0,
  46. value3: '',
  47. value:"",
  48. //是否显示加载
  49. loading: false,
  50. //是否滚动到底部
  51. finished: true,
  52. option1: [
  53. ],
  54. option2: [
  55. ],
  56. option3: [
  57. { text: '竞价状态', value: '' },
  58. { text: '全部', value: '全部' },
  59. { text: '竞价中', value: '竞价中' },
  60. { text: '竞价结束', value: '竞价结束' },
  61. ],
  62. //标的物类型
  63. projectTypeOption:[{text:'标的物类型',value:''}],
  64. //标的物所在地
  65. deptListOption: [
  66. ],
  67. input: '',
  68. infoList:[],
  69. };
  70. },
  71. created() {
  72. this.getDicts("project_type").then(response => {
  73. response.data.map(item => {
  74. this.projectTypeOption.push({ value:item.dictCode, text: item.dictLabel});
  75. });
  76. });
  77. getDeptList().then(response => {
  78. response.data.map(item => {
  79. getDeptList(item.deptId).then(res => {
  80. let list = []
  81. res.data.map(i =>{
  82. list.push({text:i.deptName,children:[],id:i.deptId})
  83. })
  84. if(list.length==0){
  85. list.push({text:item.deptName,id:item.deptId})
  86. }else{
  87. this.deptListOption.push({ text: item.deptName,children: list});
  88. }
  89. });
  90. });
  91. });
  92. this.getList();
  93. },
  94. mounted() {},
  95. methods: {
  96. onSearch(val) {
  97. this.loading = true;
  98. if(this.infoList.length>0){
  99. let newList = []
  100. for(let j = 0 ;j<this.infoList.length;j++){
  101. if(this.infoList[j].projectName.indexOf(val)>-1){
  102. newList.push(this.infoList[j]);
  103. }
  104. }
  105. this.infoList = newList
  106. }
  107. if(val==""){
  108. this.getList()
  109. }
  110. this.loading = false;
  111. },
  112. getList(){
  113. let queryDatas = {
  114. deptId: this.value1,
  115. projectNumber:this.activeId,
  116. projectShowStatus:this.value3
  117. }
  118. getOutProjectList(queryDatas).then(response =>{
  119. this.infoList = response.rows
  120. if(this.infoList.length>0){
  121. let newList = []
  122. for(let j = 0 ;j<this.infoList.length;j++){
  123. if(this.infoList[j].projectName.indexOf(this.value)>-1){
  124. newList.push(this.infoList[j]);
  125. }
  126. }
  127. this.infoList = newList
  128. console.log(this.infoList)
  129. }
  130. });
  131. },
  132. clickNav(index){
  133. },
  134. clickItem(data){
  135. if(data.text==this.value2){
  136. this.activeId=1
  137. this.value2='标的物位置'
  138. }else{
  139. this.value2=data.text
  140. }
  141. this.getList()
  142. this.$refs.item.toggle();
  143. },
  144. },
  145. };
  146. </script>
  147. <style scoped lang="scss">
  148. .app-container {
  149. }
  150. .title{
  151. font-size: 0.4rem;
  152. }
  153. .type{
  154. font-size: 0.35rem;
  155. color: #E7851C;
  156. margin-top: 5px;
  157. }
  158. .timeEnd{
  159. color: #666666;
  160. margin-top: 5px;
  161. font-size: 0.1rem;
  162. }
  163. .money{
  164. color: #C21F3A;
  165. line-height: 0.5rem;
  166. margin-top: 5px;
  167. }
  168. .money span{
  169. font-size: 0.5rem;
  170. }
  171. .time{
  172. color: #666666;
  173. line-height: 0.6rem;
  174. margin-top: 5px;
  175. }
  176. </style>