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

4 лет назад
4 лет назад
4 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
4 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
2 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
2 лет назад
4 лет назад
4 лет назад
2 лет назад
2 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
2 лет назад
4 лет назад
4 лет назад
4 лет назад
2 лет назад
4 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div class="app-container">
  3. <van-search v-model="value" placeholder="请输入搜索关键词" @search="onSearch"/>
  4. <van-tabs v-model="active" color="#007b76" title-active-color="#007b76" @change="tabChange">
  5. <van-tab title="供应项目">
  6. <van-dropdown-menu>
  7. <van-dropdown-item v-model="value1" :options="projectTypeOption" @change="getList('search')"/>
  8. <van-dropdown-item v-model="value2" :title="value2" ref="item">
  9. <van-tree-select
  10. :active-id.sync="activeId"
  11. :items="deptListOption"
  12. :main-active-index.sync="activeIndex"
  13. :max="1"
  14. @click-item="clickItem"
  15. @click-nav="clickNav"
  16. />
  17. </van-dropdown-item>
  18. <van-dropdown-item v-model="value3" :options="option3" @change="getList('search')"/>
  19. </van-dropdown-menu>
  20. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList">
  21. <router-link :to="{path:'project/projectDetail',query:{id:item.id}}" v-for="(item,index) in infoList" :key="index">
  22. <van-card :thumb="item.fileUrl?'/api'+item.fileUrl:'../../static/images/zwtpxw.jpg'" >
  23. <template #tags>
  24. <p class="title">【{{item.rollout}}】{{item.projectName}}</p>
  25. <p class="type">{{ item.projectShowStatus }}</p>
  26. <p class="timeEnd">报名结束 {{ item.signupStopTime }}</p>
  27. <p class="timeEnd">竞价结束 {{ item.biddingStopSetime }}</p>
  28. <van-row>
  29. <van-col span="12" class="money"><span>{{ item.price }}</span>{{ item.unit }}</van-col>
  30. <van-col span="8" offset="4" class="time">{{ item.projectReleaseTime }}</van-col>
  31. </van-row>
  32. </template>
  33. </van-card>
  34. </router-link>
  35. </van-list>
  36. </van-tab>
  37. <van-tab title="需求项目">
  38. <van-dropdown-menu>
  39. <van-dropdown-item v-model="value1" :options="projectTypeOption" @change="getNeedProjectList"/>
  40. <van-dropdown-item :value="value2" :title="value2" ref="item">
  41. <van-tree-select
  42. :active-id.sync="activeId"
  43. :items="deptListOption"
  44. :main-active-index.sync="activeIndex"
  45. :max="1"
  46. @click-item="clickItem"
  47. @click-nav="clickNav"
  48. />
  49. </van-dropdown-item>
  50. </van-dropdown-menu>
  51. <van-list v-model="loading1" :finished="finished1" @load="getNeedProjectList" finished-text="没有更多了">
  52. <router-link :to="{path:'project/projectNeedsDetail',query:{id:item.id}}" v-for="(item,index) in infoList1" :key="index">
  53. <van-card :thumb="item.fileUrl?'/api'+item.fileUrl:'../../static/images/zwtpxw.jpg'" >
  54. <template #tags>
  55. <p class="title">{{ item.projectName }}</p>
  56. <p class="type" style="margin-top: 7px;">{{ item.needname }}</p>
  57. <p class="timeEnd" style="margin-top: 7px;">需求开始时间 {{ item.needStartTime }}</p>
  58. <p class="timeEnd" style="margin-top: 7px;">需求结束时间 {{ item.needStopTime }}</p>
  59. </template>
  60. </van-card>
  61. </router-link>
  62. </van-list>
  63. </van-tab>
  64. </van-tabs>
  65. </div>
  66. </template>
  67. <script>
  68. import { getOutProjectList , getDeptList , needProjectList } from "@/api/project/index" ;
  69. export default {
  70. name: "project",
  71. data() {
  72. return {
  73. active:0,
  74. value1: '',
  75. value2: '标的物位置',
  76. activeId: this.global.deptId,
  77. activeIndex: 0,
  78. value3: '',
  79. value:"",
  80. //是否显示加载
  81. loading: false,
  82. //是否滚动到底部
  83. finished: false,
  84. //是否显示加载
  85. loading1: false,
  86. //是否滚动到底部
  87. finished1: false,
  88. option1: [
  89. ],
  90. option2: [
  91. ],
  92. option3: [
  93. { text: '竞价状态', value: '' },
  94. { text: '正在报名', value: '正在报名' },
  95. { text: '等待竞价', value: '等待竞价' },
  96. { text: '正在竞价', value: '正在竞价' },
  97. { text: '等待成交', value: '等待成交' },
  98. { text: '已经成交', value: '已经成交' },
  99. ],
  100. //标的物类型
  101. projectTypeOption:[{text:'标的物类型',value:''}],
  102. //标的物所在地
  103. deptListOption: [
  104. ],
  105. input: '',
  106. infoList:[],
  107. infoList1:[],
  108. queryDatas : {
  109. deptId: this.activeId,
  110. projectNumber:this.value1,
  111. projectShowStatus:this.value3,
  112. pageNum:1,
  113. pageSize:10
  114. },
  115. queryNeedDatas : {
  116. deptId: this.activeId,
  117. projectNumber:this.value1,
  118. pageNum:1,
  119. pageSize:10
  120. }
  121. };
  122. },
  123. created() {
  124. this.getDicts("project_type").then(response => {
  125. console.log(response)
  126. response.data.map(item => {
  127. this.projectTypeOption.push({ value:item.dictValue, text: item.dictLabel});
  128. });
  129. });
  130. getDeptList().then(response => {
  131. response.data.map(item => {
  132. this.deptListOption.push({text: item.deptName,children: [],id:item.deptId})
  133. });
  134. console.log(this.deptListOption)
  135. if(response.data.length > 0){
  136. getDeptList(response.data[0].deptId).then(res => {
  137. let list = []
  138. res.data.map(i =>{
  139. list.push({text:i.deptName,children:[],id:i.deptId})
  140. })
  141. if(list.length==0){
  142. list.push({text:response.data[0].deptName,id:response.data[0].deptId})
  143. }else{
  144. this.$set(this.deptListOption[0], "children", list);
  145. }
  146. });
  147. }
  148. });
  149. this.getList();
  150. },
  151. mounted(){},
  152. methods: {
  153. tabChange(e){
  154. console.log(e)
  155. if (e == 0){
  156. this.getList();
  157. }else{
  158. this.getNeedProjectList()
  159. }
  160. },
  161. onSearch(val) {
  162. this.loading = true;
  163. if(this.infoList.length>0){
  164. let newList = []
  165. for(let j = 0 ;j<this.infoList.length;j++){
  166. if(this.infoList[j].projectName.indexOf(val)>-1){
  167. newList.push(this.infoList[j]);
  168. }
  169. }
  170. this.infoList = newList
  171. }
  172. if(val==""){
  173. this.getList()
  174. }
  175. this.loading = false;
  176. },
  177. getList(type){
  178. console.log(this.queryDatas)
  179. console.log(this.value1)
  180. console.log(this.value3)
  181. if (type == 'search'){
  182. this.queryDatas.pageNum = 1;
  183. this.infoList=[];
  184. this.finished = false;
  185. }
  186. this.loading = true;
  187. this.queryDatas.deptId = this.activeId;
  188. this.queryDatas.projectNumber = this.value1;
  189. this.queryDatas.projectShowStatus = this.value3;
  190. getOutProjectList(this.queryDatas).then(response =>{
  191. // console.log(response)
  192. // this.infoList = response.rows
  193. // if(this.infoList.length>0){
  194. // let newList = []
  195. // for(let j = 0 ;j<this.infoList.length;j++){
  196. // if(this.infoList[j].projectName.indexOf(this.value)>-1){
  197. // newList.push(this.infoList[j]);
  198. // }
  199. // }
  200. // this.infoList = newList
  201. // console.log(this.infoList)
  202. // }
  203. response.rows.forEach(res=>{
  204. this.infoList.push(res);
  205. })
  206. if(this.infoList.length >= response.total){
  207. this.finished = true;
  208. return;
  209. }else{
  210. this.loading = false;
  211. this.queryDatas.pageNum += 1 ;
  212. }
  213. });
  214. },
  215. getNeedProjectList(){
  216. this.loading1 = true;
  217. needProjectList(this.queryNeedDatas).then(response =>{
  218. response.rows.forEach(res=>{
  219. this.infoList1.push(res);
  220. })
  221. if(this.infoList1.length >= response.total){
  222. this.finished1 = true;
  223. return;
  224. }else{
  225. this.loading1 = false;
  226. this.queryNeedDatas.pageNum += 1 ;
  227. }
  228. });
  229. },
  230. clickNav(index){
  231. console.log(index)
  232. getDeptList(this.deptListOption[index].id).then(res => {
  233. let list = []
  234. res.data.map(i =>{
  235. list.push({text:i.deptName,children:[],id:i.deptId})
  236. })
  237. if(list.length==0){
  238. list.push({text:this.deptListOption[index].deptName,id:this.deptListOption[index].id})
  239. }else{
  240. this.$set(this.deptListOption[index], "children", list);
  241. }
  242. });
  243. },
  244. clickItem(data){
  245. console.log('clickItem')
  246. if(data.text==this.value2){
  247. this.activeId=1
  248. this.value2='标的物位置'
  249. }else{
  250. this.value2=data.text
  251. }
  252. this.getList('search')
  253. this.$refs.item.toggle();
  254. },
  255. },
  256. };
  257. </script>
  258. <style scoped lang="scss">
  259. .app-container {
  260. }
  261. .title{
  262. font-size: 0.4rem;
  263. }
  264. .type{
  265. font-size: 0.35rem;
  266. color: #E7851C;
  267. margin-top: 5px;
  268. }
  269. .timeEnd{
  270. color: #666666;
  271. margin-top: 5px;
  272. font-size: 12PX;
  273. }
  274. .money{
  275. color: #C21F3A;
  276. line-height: 0.5rem;
  277. margin-top: 5px;
  278. }
  279. .money span{
  280. font-size: 0.5rem;
  281. }
  282. .time{
  283. color: #666666;
  284. line-height: 0.6rem;
  285. margin-top: 5px;
  286. }
  287. </style>