c7744156
刘淇
录入树木
|
1
2
3
|
<template>
<view class="container">
<tui-form ref="form" :show-message="false" :model="formData" style="border-bottom: 1px solid #f5f4f4">
|
f20fa7ae
刘淇
搜索
|
4
|
<tui-form-item arrow highlight prop="companyId" @click="pickerShow" label="归属单位" >
|
c7744156
刘淇
录入树木
|
5
|
<tui-input padding="0" :borderBottom="false" placeholder="请选择归属单位" disabled
|
f20fa7ae
刘淇
搜索
|
6
|
backgroundColor="transparent" v-model="formData.companyId"></tui-input>
|
c7744156
刘淇
录入树木
|
7
|
</tui-form-item>
|
f20fa7ae
刘淇
搜索
|
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<tui-form-item prop="roadName" :bottom-border="false" label="道路名称">
<!-- <tui-input padding="0" :borderBottom="false" placeholder="请输入道路" maxlength="20" :clearable="true" :backgroundColor="#f5f5f5" :inputBorder="true" :radius="30"-->
<!-- v-model="formData.roadName" @confirm="searchChange" :left-icon="Search" >-->
<!-- <slot :name="left">123</slot>-->
<!-- </tui-input>-->
<tui-input padding="0" :borderBottom="false" placeholder="请输入道路" maxlength="20" @confirm="searchChange"
v-model="formData.roadName">
<!-- <template v-slot:left>-->
<!-- <tui-icon name="search" :size="15" ></tui-icon>-->
<!-- </template>-->
</tui-input>
<template v-slot:right>
|
c872bdb3
刘淇
树木详情
|
21
22
23
|
<tui-icon name="search" :size="20" @click="searchChange"></tui-icon>
<!-- <tui-form-button width="188rpx" height="64rpx" background="#f2f2f2" color="#5677fc" size="24"-->
<!-- bold radius="12rpx">获取验证码</tui-form-button>-->
|
f20fa7ae
刘淇
搜索
|
24
25
|
</template>
|
c7744156
刘淇
录入树木
|
26
|
</tui-form-item>
|
f20fa7ae
刘淇
搜索
|
27
28
|
|
c7744156
刘淇
录入树木
|
29
30
31
32
33
34
35
36
37
38
39
40
41
|
</tui-form>
<!-- <tui-row marginTop="10px" :gutter="5" class="full-height-row">-->
<!-- <tui-col :span="8" class="left-con full-height-col" >-->
<!-- <view class="full-height-col left-con">1</view>-->
<!-- </tui-col>-->
<!-- <tui-col :span="16" class="right-con full-height-col" >-->
<!-- <view class="full-height-col">2</view>-->
<!-- </tui-col>-->
<!-- </tui-row>-->
<view class="full-height-row">
<view class="full-height-col left-con">
|
21397afd
刘淇
树 新增
|
42
|
<view v-for="(i,index) in depts" class="teamsItem" :key="index"
|
c872bdb3
刘淇
树木详情
|
43
|
@click="teamsChange(index)"
|
c7744156
刘淇
录入树木
|
44
|
:class="{teamsActive:index==currentIndex}"
|
6cba22de
刘淇
图片上传
|
45
|
>
|
21397afd
刘淇
树 新增
|
46
|
<view class="fs-ellipsis fs-pt16 fs-pb16 fs-pl8 fs-pr8">{{ i.deptName }}</view>
|
6cba22de
刘淇
图片上传
|
47
|
|
c7744156
刘淇
录入树木
|
48
49
50
|
</view>
</view>
<view class="full-height-col right-con">
|
21397afd
刘淇
树 新增
|
51
|
<view class="nodata-wrap" v-if="roads.length==0">
|
c7744156
刘淇
录入树木
|
52
53
54
|
<img src="/static/images/nodata.png" alt="">
<view style="color: #aaa">暂无数据</view>
|
21397afd
刘淇
树 新增
|
55
|
<!-- <tui-no-data imgUrl="/static/images/nodata.png">暂无数据</tui-no-data>-->
|
c7744156
刘淇
录入树木
|
56
|
</view>
|
21397afd
刘淇
树 新增
|
57
|
<view v-else>
|
b951d827
刘淇
树木详情
|
58
|
<view v-for="i in roads" class="card-wrap cad-box-shadow" @click="toNewPage(i.roadId)">
|
c7744156
刘淇
录入树木
|
59
|
|
21397afd
刘淇
树 新增
|
60
|
<p class="fs-flex__between">
|
b951d827
刘淇
树木详情
|
61
62
|
<span class="fs-ellipsis">{{ i.roadName }}</span>
<span class="treeCount ">{{ i.treeCount }}颗</span>
|
21397afd
刘淇
树 新增
|
63
|
</p>
|
c7744156
刘淇
录入树木
|
64
|
|
b951d827
刘淇
树木详情
|
65
66
67
|
<p class="fs-ellipsis fs-my8">已录入行道树:{{ i.recordedCount }}颗</p>
<p class="fs-ellipsis fs-my8" style="color: #999">起点:{{ i.startRemark }}</p>
<p class="fs-ellipsis " style="color: #999">终点:{{ i.endRemark }}</p>
|
21397afd
刘淇
树 新增
|
68
69
|
</view>
|
c7744156
刘淇
录入树木
|
70
|
</view>
|
b951d827
刘淇
树木详情
|
71
|
|
c7744156
刘淇
录入树木
|
72
73
|
</view>
</view>
|
46b6767c
刘淇
init 提交到库
|
74
|
|
21397afd
刘淇
树 新增
|
75
76
|
<tui-picker :show="show" :pickerData="belongCompanyData" textField="dictLabel" valueField="dictValue"
@hide="pickerHide" @change="pickerChange">
|
c7744156
刘淇
录入树木
|
77
78
79
80
81
82
83
|
</tui-picker>
</view>
</template>
<script>
|
21397afd
刘淇
树 新增
|
84
|
import { belongCompanyreq, deptListReq, treeRoadReq } from "@/api/tree";
|
46b6767c
刘淇
init 提交到库
|
85
|
export default {
|
c7744156
刘淇
录入树木
|
86
87
88
|
name: "treeFiles",
data() {
return {
|
c872bdb3
刘淇
树木详情
|
89
|
belongCompanyData: [], // 归属公司
|
c7744156
刘淇
录入树木
|
90
91
92
93
|
show: false,
currentIndex: 0,
formData: {
//道路
|
21397afd
刘淇
树 新增
|
94
|
roadName: '',
|
c7744156
刘淇
录入树木
|
95
|
//归属单位
|
f20fa7ae
刘淇
搜索
|
96
|
companyId: '',
|
c7744156
刘淇
录入树木
|
97
|
},
|
21397afd
刘淇
树 新增
|
98
99
100
|
companyId: '',// 归属公司
depts: [],// 归属班组
roads: [], // 道路树
|
c872bdb3
刘淇
树木详情
|
101
|
|
c7744156
刘淇
录入树木
|
102
103
|
}
},
|
21397afd
刘淇
树 新增
|
104
105
106
107
108
|
onLoad() {
// 归属公司
belongCompanyreq().then(res => {
this.belongCompanyData = res.data
if (this.belongCompanyData.length > 0) {
|
c872bdb3
刘淇
树木详情
|
109
|
this.formData.companyId = this.belongCompanyData[0].dictLabel
|
21397afd
刘淇
树 新增
|
110
111
112
113
114
|
this.companyId = (this.belongCompanyData[0].dictValue).toString()
this.deptListQuery()
}
})
},
|
c7744156
刘淇
录入树木
|
115
|
methods: {
|
c872bdb3
刘淇
树木详情
|
116
|
// 前往历史页面
|
b951d827
刘淇
树木详情
|
117
|
toNewPage(params) {
|
21397afd
刘淇
树 新增
|
118
|
uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${params}`)
|
21397afd
刘淇
树 新增
|
119
|
},
|
c872bdb3
刘淇
树木详情
|
120
|
// 搜索
|
21397afd
刘淇
树 新增
|
121
122
123
124
125
126
127
128
129
130
131
|
searchChange() {
this.deptListQuery()
},
// 归属班组
deptListQuery() {
deptListReq({data: {companyId: this.companyId, roadName: this.formData.roadName}}).then(res => {
if (res.data.length == 0) {
this.depts = []
this.roads = []
} else {
this.depts = res.data[0].depts
|
c872bdb3
刘淇
树木详情
|
132
|
this.roads = this.depts[this.currentIndex].roads
|
21397afd
刘淇
树 新增
|
133
134
135
136
|
}
// this.treeRoadQuery()
})
},
|
c872bdb3
刘淇
树木详情
|
137
138
|
// 班组切换
|
c7744156
刘淇
录入树木
|
139
140
141
|
teamsChange(i) {
console.log(i)
this.currentIndex = i
|
c872bdb3
刘淇
树木详情
|
142
|
this.roads = this.depts[this.currentIndex].roads
|
c7744156
刘淇
录入树木
|
143
144
145
146
147
148
149
150
151
|
},
pickerShow() {
this.show = true
},
pickerHide() {
this.show = false
},
pickerChange(e) {
console.log(e)
|
c872bdb3
刘淇
树木详情
|
152
|
this.formData.companyId = e.text
|
c7744156
刘淇
录入树木
|
153
154
|
},
}
|
46b6767c
刘淇
init 提交到库
|
155
156
157
|
}
</script>
|
46b6767c
刘淇
init 提交到库
|
158
|
|
c7744156
刘淇
录入树木
|
159
|
<style scoped lang="scss">
|
c872bdb3
刘淇
树木详情
|
160
161
162
163
164
165
166
|
::v-deep .tui-form__item-wrap {
padding-top: 8px !important; /* 原可能是 12px/16px,按需减小 */
padding-bottom: 8px !important;
min-height: auto !important; /* 清除默认最小高度限制 */
}
|
c7744156
刘淇
录入树木
|
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
.container {
height: 100%;
display: flex;
flex-direction: column;
}
/* tui-row 设置100%高度 */
.full-height-row {
/* 确保row使用flex布局 */
display: flex;
flex: 1
}
/* tui-col 设置100%高度 */
.full-height-col {
height: 100%;
background-color: #f0f0f0;
}
.left-con {
width: 220rpx;
height: 100%;
background: #f3f3f3;
}
.right-con {
flex: 1;
height: 100%;
background: #fff;
|
b951d827
刘淇
树木详情
|
197
|
overflow: hidden;
|
c7744156
刘淇
录入树木
|
198
199
200
|
}
.teamsItem {
|
c7744156
刘淇
录入树木
|
201
202
203
204
205
206
207
|
}
.teamsActive {
background: #fff;
}
.card-wrap {
|
c872bdb3
刘淇
树木详情
|
208
|
margin: 20px 10px 0;
|
c7744156
刘淇
录入树木
|
209
|
padding: 20rpx;
|
c872bdb3
刘淇
树木详情
|
210
|
border-radius: 14rpx;
|
c7744156
刘淇
录入树木
|
211
|
}
|
46b6767c
刘淇
init 提交到库
|
212
|
|
21397afd
刘淇
树 新增
|
213
|
.nodata-wrap {
|
c7744156
刘淇
录入树木
|
214
215
|
margin: 20px auto;
text-align: center;
|
21397afd
刘淇
树 新增
|
216
217
218
|
image {
width: 160rpx;
|
c7744156
刘淇
录入树木
|
219
220
221
222
223
|
height: 160rpx;
margin-bottom: 20rpx;
}
}
|
b951d827
刘淇
树木详情
|
224
225
226
227
228
229
|
.treeCount {
color: #5f5fe2;
min-width: 70px;
text-align: right;
}
|
c7744156
刘淇
录入树木
|
230
231
232
233
234
235
236
237
|
</style>
<style>
/* 单独写一个不带 scoped 的 style 来设置 page */
page {
height: 100%;
background: #fff;
}
|
46b6767c
刘淇
init 提交到库
|
238
|
</style>
|