Blame view

subPackages/treePage/treeFiles.vue 6.4 KB
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
21
22
23
24
        <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>
            <tui-form-button width="188rpx" height="64rpx" background="#f2f2f2" color="#5677fc" size="24"
                             bold radius="12rpx">获取验证码</tui-form-button>
          </template>
  
c7744156   刘淇   录入树木
25
        </tui-form-item>
f20fa7ae   刘淇   搜索
26
27
  
  
c7744156   刘淇   录入树木
28
29
30
31
32
33
34
35
36
37
38
39
40
      </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   刘淇   树 新增
41
          <view v-for="(i,index) in depts" class="teamsItem" :key="index"
c7744156   刘淇   录入树木
42
43
                @click="teamsChange(i)"
                :class="{teamsActive:index==currentIndex}"
6cba22de   刘淇   图片上传
44
          >
21397afd   刘淇   树 新增
45
            <view class="fs-ellipsis fs-pt16 fs-pb16  fs-pl8 fs-pr8">{{ i.deptName }}</view>
6cba22de   刘淇   图片上传
46
  
c7744156   刘淇   录入树木
47
48
49
          </view>
        </view>
        <view class="full-height-col right-con">
21397afd   刘淇   树 新增
50
          <view class="nodata-wrap" v-if="roads.length==0">
c7744156   刘淇   录入树木
51
52
53
            <img src="/static/images/nodata.png" alt="">
            <view style="color: #aaa">暂无数据</view>
  
21397afd   刘淇   树 新增
54
            <!--          <tui-no-data imgUrl="/static/images/nodata.png">暂无数据</tui-no-data>-->
c7744156   刘淇   录入树木
55
          </view>
21397afd   刘淇   树 新增
56
          <view v-else>
b951d827   刘淇   树木详情
57
            <view v-for="i in roads" class="card-wrap cad-box-shadow" @click="toNewPage(i.roadId)">
c7744156   刘淇   录入树木
58
  
21397afd   刘淇   树 新增
59
              <p class="fs-flex__between">
b951d827   刘淇   树木详情
60
61
                <span class="fs-ellipsis">{{ i.roadName }}</span>
                <span class="treeCount  ">{{ i.treeCount }}颗</span>
21397afd   刘淇   树 新增
62
              </p>
c7744156   刘淇   录入树木
63
  
b951d827   刘淇   树木详情
64
65
66
              <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   刘淇   树 新增
67
68
  
            </view>
c7744156   刘淇   录入树木
69
          </view>
b951d827   刘淇   树木详情
70
          
c7744156   刘淇   录入树木
71
72
        </view>
      </view>
46b6767c   刘淇   init 提交到库
73
  
21397afd   刘淇   树 新增
74
75
      <tui-picker :show="show" :pickerData="belongCompanyData" textField="dictLabel" valueField="dictValue"
                  @hide="pickerHide" @change="pickerChange">
c7744156   刘淇   录入树木
76
77
78
79
80
81
82
      </tui-picker>
  
    </view>
  </template>
  
  
  <script>
21397afd   刘淇   树 新增
83
  import { belongCompanyreq, deptListReq, treeRoadReq } from "@/api/tree";
46b6767c   刘淇   init 提交到库
84
  export default {
c7744156   刘淇   录入树木
85
86
87
    name: "treeFiles",
    data() {
      return {
21397afd   刘淇   树 新增
88
89
        cardList: [],
        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: [], // 道路树
c7744156   刘淇   录入树木
101
102
103
104
105
106
107
108
109
110
111
112
113
114
        card: {
          title: {
            text: '白菜湾四街'
          },
          tag: {
            text: '153颗'
          },
          header: {
            bgcolor: '#F7F7F7',
            line: true
          }
        }
      }
    },
21397afd   刘淇   树 新增
115
116
117
118
119
120
121
122
123
124
125
    onLoad() {
      // 归属公司
      belongCompanyreq().then(res => {
        this.belongCompanyData = res.data
        if (this.belongCompanyData.length > 0) {
          this.formData.area = this.belongCompanyData[0].dictLabel
          this.companyId = (this.belongCompanyData[0].dictValue).toString()
          this.deptListQuery()
        }
      })
    },
c7744156   刘淇   录入树木
126
    methods: {
b951d827   刘淇   树木详情
127
      toNewPage(params) {
21397afd   刘淇   树 新增
128
129
        console.log('123312')
        uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${params}`)
21397afd   刘淇   树 新增
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
      },
      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
            this.roads = this.depts[0].roads
          }
          // this.treeRoadQuery()
        })
      },
      // 树列表
      treeRoadQuery() {
        treeRoadReq({data: {road: ''}}).then(res => {
          console.log(res)
        })
      },
      // 归属公司
c7744156   刘淇   录入树木
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
      teamsChange(i) {
        console.log(i)
        this.currentIndex = i
      },
      pickerShow() {
        this.show = true
      },
      pickerHide() {
        this.show = false
      },
      pickerChange(e) {
        console.log(e)
        this.formData.area = e.text
      },
    }
46b6767c   刘淇   init 提交到库
169
170
171
  }
  </script>
  
46b6767c   刘淇   init 提交到库
172
  
c7744156   刘淇   录入树木
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
  <style scoped lang="scss">
  .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;
    padding-top: 20rpx;
b951d827   刘淇   树木详情
205
    overflow: hidden;
c7744156   刘淇   录入树木
206
207
208
  }
  
  .teamsItem {
c7744156   刘淇   录入树木
209
210
211
212
213
214
215
  }
  
  .teamsActive {
    background: #fff;
  }
  
  .card-wrap {
b951d827   刘淇   树木详情
216
    //height: 200rpx;
c7744156   刘淇   录入树木
217
218
    margin: 0 20rpx 20rpx 20rpx;
    padding: 20rpx;
b951d827   刘淇   树木详情
219
  
c7744156   刘淇   录入树木
220
221
    border-radius: 10rpx;
  }
46b6767c   刘淇   init 提交到库
222
  
21397afd   刘淇   树 新增
223
  .nodata-wrap {
c7744156   刘淇   录入树木
224
225
    margin: 20px auto;
    text-align: center;
21397afd   刘淇   树 新增
226
227
228
  
    image {
      width: 160rpx;
c7744156   刘淇   录入树木
229
230
231
232
233
      height: 160rpx;
      margin-bottom: 20rpx;
    }
  }
  
b951d827   刘淇   树木详情
234
235
236
237
238
239
  .treeCount {
    color: #5f5fe2;
    min-width: 70px;
    text-align: right;
  }
  
c7744156   刘淇   录入树木
240
241
242
243
244
245
246
247
  </style>
  
  <style>
  /* 单独写一个不带 scoped 的 style 来设置 page */
  page {
    height: 100%;
    background: #fff;
  }
46b6767c   刘淇   init 提交到库
248
  </style>