Blame view

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