Blame view

pages/companyInfoList/companyInfoList.vue 2.78 KB
0189b356   易尊强   登录问题
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
  <template>
  	<view class="page">
  		<!-- 搜索 -->
  		<view class="search-head">
  			<view class="search">
  				<image src="../../static/fdj1.png"></image>
  				<text></text>
  				<input type="text" placeholder="搜索关键词" v-model="selectName" @input="getMoHuList()"/>
  			</view>
  			<view class="btn">
  				<text>搜索</text>
  			</view>
  			<mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name"
  				value-name="id" style="margin-top: 100rpx;"></mo-hu-search>
  		</view>
  		<view class="" style="margin-top: 110rpx;">
  			<view class="item" v-for="(it,index) in companyList" :key="index" @click="toAddComInfo(it.id)">
  				<view class="comName">
  					{{it.enterpriseName}}
  				</view>
  				
  				<view class="more-content">
  					<view class="comTime">
  						{{it.creatorTime}}
  					</view>
  					<view class="more-content-img">
  						<image src="../../static/right2.png"></image>
  					</view>
  				</view>
  			</view>
  		</view>
  	</view>
  </template>
  
  <script>
  	import request from '@/utils/request.js'
  	import utils from '../../service/utils'
  	import moHuSearch from '../../components/qj-fuzzy-search/index.vue'
  	export default {
  		components:{
  			moHuSearch
  		},
  		data() {
  			return {
  				companyList:[],
  				comList:[],
  				selectShow:false,
  				selectName:'',
  				selectId:'',
  			}
  		},
  		onLoad(){
  			this.getCompanylist()
  		},
  		methods: {
  			// 首页模糊查询
  			getMoHuList(){
  				this.selectShow = true
  				if(this.selectName === ''){
  					this.selectShow = false
  				}else{
  					request({
  						url:'/api/SubDev/baseenterprisemanager',
  						method:'get',
  						data:{
  							enterpriseName:this.selectName
  						}
  					}).then(res=>{
  						console.log('模糊查询',res.data)
  						if(res.code === 200){
  							let arr = res.data.list
  							this.comList = arr.map(it=>{
  								return {
  									...it,
  									name:it.enterpriseName
  								}
  							})
  							this.comList = 	JSON.parse(JSON.stringify(this.comList))
  							console.log('mohu',this.comList)
  						}
  					})
  				}
  				
  			},
  			select(item) {
  				this.selectName = item.name;
  				this.selectId = item.id
  				this.toAddComInfo(this.selectId)
  				// if()
  				this.selectShow = false;
  			},
  			// 跳转到企业采集表单数据详情页面
  			toAddComInfo(id){
  				uni.navigateTo({
  					url:'/pages/companyInfoList/addComInfo/addComInfo?data=' + `${JSON.stringify(id)}`
  				})
  			},
  			// 获取企业采集列表
  			getCompanylist(){
  				request({
  					url:'/api/SubDev/baseenterprisemanager',
  					method:'get',
  					data:{}
  				}).then(res=>{
  					if(res.code == 200){
  						console.log(res)
  						this.companyList = res.data.list.map(it=>{
  							return {
  								...it,
  								creatorTime:utils.formatTime(it.creatorTime)
  							}
  						})
  					}
  				})
  			}
  		}
  	}
  </script>
  
  <style lang="scss" scoped>
  @import 'datain.scss';
  </style>