Blame view

pages/datain/datain.vue 3.18 KB
290144e9   易尊强   第一次
1
2
3
4
5
6
  <template>
  	<view class="page">
  		<view class="listBox">
  			<view class="content">
  				<!-- 列表 -->
  				<view class="user-list" v-show="!isAdmin">
132aa3e8   易尊强   ss
7
8
  					<view class="list" @click="toData" style="background-color:#D32D25;">
  						<view class="title" style="color:white">
290144e9   易尊强   第一次
9
10
11
12
13
14
15
16
17
  							<text>表单设计</text>
  						</view>
  						<view class="more-content">
  							<view class="more-content-img">
  								<image src="../../static/right2.png"></image>
  							</view>
  						</view>
  					</view>
  				</view>
132aa3e8   易尊强   ss
18
19
20
21
22
23
24
25
26
27
28
29
  				<view class="user-list">
  					<view class="list" @click="toPostCom()" style="background-color:#D32D25;">
  						<view class="title" style="color:white">
  							<text>企业信息采集</text>
  						</view>
  						<view class="more-content">
  							<view class="more-content-img">
  								<image src="../../static/right2.png"></image>
  							</view>
  						</view>
  					</view>
  				</view>
290144e9   易尊强   第一次
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
  				<view class="user-list" v-for="(item,index) in formList">
  					<view class="list" @click="toForm(it)" v-for="(it,index) in item.children">
  						<view class="title">
  							<text>{{it.fullName}}</text>
  						</view>
  						<view class="more-content">
  							<view class="more-content-img">
  								<image src="../../static/right2.png"></image>
  							</view>
  						</view>
  					</view>
  				</view>
  			</view>
  		</view>
  	</view>
  	</view>
  </template>
  
  <script>
  	import request from "@/utils/request"
  	export default {
  		data() {
  			return {
  				formList:[],
  				// 判断用户是否是管理员
  				isAdmin:false
  			}
  		},
  		onLoad() {
  			this.getUser()
  		},
  		created() {
  			this.getFormList()
  		},
  		methods: {
  			// 获取用户信息
  			getUser(){
  				if (uni.getStorageSync('user')) {
  					let userCode = uni.getStorageSync('user')
  					// console.log("用户的code", this.userCode)
  					this.userId = userCode.userInfo.userId
  					this.userName = userCode.userInfo.userAccount
  					this.userIcon = userCode.userInfo.headIcon
  					this.organizeName = userCode.userInfo.organizeName
  					this.isAdmin = userCode.userInfo.isCompany
  					console.log(userCode)
  				} else {
  					uni.showToast({
  						title: '请登录',
  						icon: 'none'
  					})
  					setTimeout(() => {
  						uni.reLaunch({
  							url: '/pages/login/index'
  						})
  					})
  				}
  			},
  			// 获取表单列表
  			getFormList() {
  				let that = this
  				request({
  					url: '/api/visualdev/Base',
  					method: 'get',
  					data: {type:2},
  				}).then(res => {
  					console.log(res)
  					if(res.code === 600){
  						uni.showToast({
  							icon:"exception",
  							title:'登录过期,请重新登录'
  						})
  					}
  					this.formList = res.data.list
  				})
  			},
  			toData() {
  				uni.navigateTo({
  					url: '/pages/data/data'
  				})
  			},
132aa3e8   易尊强   ss
111
112
113
114
115
116
  			// 去企业信息表单采集
  			toPostCom(){
  				uni.navigateTo({
  					url:'/pages/postCompany/postCompany'
  				})
  			},
290144e9   易尊强   第一次
117
118
119
120
121
122
123
124
125
126
127
  			// 去表单填写页面
  			toForm(item){
  				// uni.navigateTo({
  				// 	url: `/pages/apply/dynamicModel/index?data=${JSON.stringify(it)}`
  				// })
  				uni.navigateTo({
  					url: '/pages/apply/dynamicModel/index?id=' + item.id + '&fullName=' + item.fullName,
  					fail: (err) => {
  						this.$u.toast("暂无此页面")
  					}
  				})
132aa3e8   易尊强   ss
128
  			},
290144e9   易尊强   第一次
129
130
131
132
133
134
135
  		}
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'datain.scss';
  </style>