移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

188 строки
5.1 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" :key="index">
  20. <van-card :thumb="item.fileUrl?global.severApi+item.fileUrl:'../../static/images/zwtpxw.jpg'" >
  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/index";
  38. export default {
  39. name: "project",
  40. data() {
  41. return {
  42. value1: '',
  43. value2: '标的物位置',
  44. activeId: this.global.deptId,
  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. { text: '等待成交', value: '等待成交' },
  62. { text: '已经成交', value: '已经成交' },
  63. ],
  64. //标的物类型
  65. projectTypeOption:[{text:'标的物类型',value:''}],
  66. //标的物所在地
  67. deptListOption: [
  68. ],
  69. input: '',
  70. infoList:[],
  71. };
  72. },
  73. created() {
  74. this.getDicts("project_type").then(response => {
  75. console.log(response)
  76. response.data.map(item => {
  77. this.projectTypeOption.push({ value:item.dictCode, text: item.dictLabel});
  78. });
  79. });
  80. getDeptList().then(response => {
  81. response.data.map(item => {
  82. getDeptList(item.deptId).then(res => {
  83. let list = []
  84. res.data.map(i =>{
  85. list.push({text:i.deptName,children:[],id:i.deptId})
  86. })
  87. if(list.length==0){
  88. list.push({text:item.deptName,id:item.deptId})
  89. }else{
  90. this.deptListOption.push({ text: item.deptName,children: list});
  91. }
  92. });
  93. });
  94. });
  95. this.getList();
  96. },
  97. mounted() {},
  98. methods: {
  99. onSearch(val) {
  100. this.loading = true;
  101. if(this.infoList.length>0){
  102. let newList = []
  103. for(let j = 0 ;j<this.infoList.length;j++){
  104. if(this.infoList[j].projectName.indexOf(val)>-1){
  105. newList.push(this.infoList[j]);
  106. }
  107. }
  108. this.infoList = newList
  109. }
  110. if(val==""){
  111. this.getList()
  112. }
  113. this.loading = false;
  114. },
  115. getList(){
  116. let queryDatas = {
  117. deptId: this.activeId,
  118. projectNumber:this.value1,
  119. projectShowStatus:this.value3
  120. }
  121. console.log(queryDatas)
  122. getOutProjectList(queryDatas).then(response =>{
  123. console.log(response)
  124. this.infoList = response.rows
  125. if(this.infoList.length>0){
  126. let newList = []
  127. for(let j = 0 ;j<this.infoList.length;j++){
  128. if(this.infoList[j].projectName.indexOf(this.value)>-1){
  129. newList.push(this.infoList[j]);
  130. }
  131. }
  132. this.infoList = newList
  133. console.log(this.infoList)
  134. }
  135. });
  136. },
  137. clickNav(index){
  138. },
  139. clickItem(data){
  140. if(data.text==this.value2){
  141. this.activeId=1
  142. this.value2='标的物位置'
  143. }else{
  144. this.value2=data.text
  145. }
  146. this.getList()
  147. this.$refs.item.toggle();
  148. },
  149. },
  150. };
  151. </script>
  152. <style scoped lang="scss">
  153. .app-container {
  154. }
  155. .title{
  156. font-size: 0.4rem;
  157. }
  158. .type{
  159. font-size: 0.35rem;
  160. color: #E7851C;
  161. margin-top: 5px;
  162. }
  163. .timeEnd{
  164. color: #666666;
  165. margin-top: 5px;
  166. font-size: 0.1rem;
  167. }
  168. .money{
  169. color: #C21F3A;
  170. line-height: 0.5rem;
  171. margin-top: 5px;
  172. }
  173. .money span{
  174. font-size: 0.5rem;
  175. }
  176. .time{
  177. color: #666666;
  178. line-height: 0.6rem;
  179. margin-top: 5px;
  180. }
  181. </style>