guohua.wang
2024-05-06 a72cd635633dd72ee835f69788c0d71b6e3ae3c5
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
<template>
  <!-- 填写监理日志 -->
  <div class="container paddingB_form" >
    <NavBar customerTitle="填写监理日志" />
    
    <div class="main DetailsMaintainer" ref="keyboardControl">
      <div class="main-header">
        <div class="marginT_10 item">
          <div class="item-title">项目名称:{{supervisorLog.projectName}}</div>
          <div class="item-desc">项目编号:{{supervisorLog.projectCode}}</div>
          
          <div class="marginT_16 item-title">创建人</div>
          <div class="item-desc">{{supervisorLog.creator}}</div>
        </div>
      </div>
 
      <div class="marginT_16 bgc-fff">
        <van-cell title="接收人" is-link :value="notifierNameDeptName || '请选择'" @click="copyHumanPickershow=true"/>
      </div>
 
      <van-cell-group title="日志内容">
         <van-field label="天气" 
          class="dynamic text-right" 
          v-model="supervisorLog.meteorological" 
          placeholder="请输入"
        />
      </van-cell-group>
 
      <!-- <div class="marginT_10 bgc-fff">
        <van-field label="监理方人员动态" 
          class="dynamic text-right" 
          v-model="supervisorLog.supervisorInformationDynamics" 
          placeholder="请输入"
        />
      </div>
 
      <div class="marginT_10 bgc-fff">
        <van-field label="施工方人员动态" 
          class="dynamic text-right" 
          v-model="supervisorLog.supervisorPartyDynamics" 
          placeholder="请输入"
        />
      </div> -->
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="监理方人员动态" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.supervisorInformationDynamics"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote1" v-model="supervisorLog.supervisorInformationDynamics"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="施工方人员动态" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.supervisorPartyDynamics"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote2" v-model="supervisorLog.supervisorPartyDynamics"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="材料进场" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.materialEntry"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote3" v-model="supervisorLog.materialEntry"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="取证见证" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.forensicsWitness"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote4" v-model="supervisorLog.forensicsWitness"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="合格情况" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.forensicsWitness"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote5" v-model="supervisorLog.qualification"></div>
      </div>
 
      <!-- <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="合格情况" label-class="input_padding">
          <template #label>
            <van-field
              v-model="supervisorLog.qualification"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="200"
              placeholder="请输入(少于200字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        <!-- </van-cell>
        <div id="summernote5" v-model="supervisorLog.qualification"></div>
      </div> -->
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="施工情况" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.construction"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="800"
              placeholder="请输入(少于800字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote6" v-model="supervisorLog.construction"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="监理工作情况" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.supervision"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="300"
              placeholder="请输入(少于300字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote7" v-model="supervisorLog.supervision"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="检查问题及处理" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.problemDeal"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="300"
              placeholder="请输入(少于300字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote8" v-model="supervisorLog.problemDeal"></div>
      </div>
 
      <div class="marginT_10 bgc-fff input_padding_spec">
        <van-cell :border="false" title="协调内容或其他" label-class="input_padding">
          <!-- <template #label>
            <van-field
              v-model="supervisorLog.coordinateOthers"
              rows="2"
              autosize
              :readonly="statusReadlony"
              type="textarea"
              maxlength="300"
              placeholder="请输入(少于300字)"
              show-word-limit
              @focus="$fieldFocusEventFn"
              @blur="$fieldBlurEventFn"
            />
          </template> -->
        </van-cell>
        <div id="summernote9" v-model="supervisorLog.coordinateOthers"></div>
      </div>
 
      <div class="marginT_10 bgc-fff">
        <van-field name="uploader" label="上传图片">
          <template #input>
            <UploadImgCustom 
              :ywSid ="supervisorLog.supervisorLogSid+'_supervisorLog'"
              uploadImgType="supervisorLog" 
              :previewImage="true" 
              :uploader="imgBeforeArr" 
              :disabled="statusReadlony" 
              @uploadImg="getLoadImg" 
              @deleteImg="getLoadImg"
            />
          </template>
        </van-field>
      </div>
 
    </div>
 
    <div class="bottomSaveBoxHeight" v-if="showBtn">
      <div class="bottomSaveGroup bgc-fff bottomSaveGroupFixed flex-wrap-center">
        <span class="btn btn1" @click="submitFn('0')">保存</span>
        <span class="btn btn2" @click="submitFn('3')">发送</span>
      </div>
    </div>
 
    <AllProjectHuman 
      :show='copyHumanPickershow' 
      titleName="接收人" 
      @checkHuman='copyHumanSelect' 
      @closeCheck="copyHumanPickershow=false"
    />
  </div><!-- container end -->
</template>
 
<script>
import AllProjectHuman from "@/compontent/choosePeople/allProjectHuman"
import UploadImgCustom from "@/compontent/common/uploadImgCustom"
import { Dialog } from 'vant';
export default({
  name:'QualityForm',
  components:{
    AllProjectHuman,
    UploadImgCustom,
    [Dialog.Component.name]: Dialog.Component,
  },
  data(){
    return { 
      projectSid:'',
      supervisorLog:{},
      supervisorLogComp:{},
      status:'',
      supervisorLogSid:'',
 
      copyHumanPickershow:false,//接收人
      statusReadlony:false,
      imgBeforeArr:[],//上传的图片
 
      showBtn:true,//显示按钮
      isBack:true,
 
      notifierNameDeptName:"",//接收人
    }
  },
  created(){
    this.projectSid=this.$route.query.projectSid
    this.status=this.$route.query.status
    this.supervisorLogSid=this.$route.query.supervisorLogSid
    if(this.status == "add"){
      this.getData();// 获取天气
    }else{
      this.getDetail()
    }
  },
  beforeRouteLeave(to, from, next) {
    this.changeObj();
    if(this.isBack){
      next();
    }else{
      setTimeout(()=>{  //用定时器是返回时弹框二次不显示,加定时器就好
        Dialog.confirm({
          message: '是否放弃已编辑内容?',
        }).then(() => {
            next();//跳转下一个页面
          }).catch(() => {
          next(false);//跳转到当前页面
          this.isBack = true;
        });
 
      },200)
    }
  },
  mounted(){
    let _this = this;
    if(this.status == "add"){
      this.getWeath();// 获取天气
    }
 
    var newOptions = Object.assign({},this.$summernoteOption,{
      callbacks: {
        onFocus: function() {
          _this.$fieldFocusEventFn();
        },
        onBlur: function() {
          _this.$fieldBlurEventFn();
        }
      }
    })
 
    var newOptions1 = Object.assign({},this.$summernoteOption,{
      placeholder:"请输入(少于800字)",
      callbacks: {
        onFocus: function() {
          _this.$fieldFocusEventFn();
        },
        onBlur: function() {
          _this.$fieldBlurEventFn();
        }
      }
    })
 
    jQuery('#summernote1').summernote(newOptions);
    jQuery('#summernote2').summernote(newOptions);
    jQuery('#summernote3').summernote(newOptions);
    jQuery('#summernote4').summernote(newOptions);
    jQuery('#summernote5').summernote(newOptions);
    jQuery('#summernote6').summernote(newOptions1);
    jQuery('#summernote7').summernote(newOptions);
    jQuery('#summernote8').summernote(newOptions);
    jQuery('#summernote9').summernote(newOptions);
  },
  methods:{
    changeObj(){  
      let obj1 = this.supervisorLogComp;
      let obj2 = this.supervisorLog;
      for (let val in  obj2) { 
        // console.log(val)
        // console.log(obj1[val] ,"-------", obj2[val])
        if (obj1[val] != obj2[val]) {  
          this.isBack = false;  //有一个改变返回
          return false; 
        }else { this.isBack = true;} 
      }
    },
    getDetail(){
      let _this = this;
      _this.service({
        url:'/app/supervisorLog/supervisorLogInfo',
        params:{
          projectSid:this.projectSid,
          sid:this.supervisorLogSid
        }
      }).then(res => {
        if(res.success && res.data){
          console.log(106666,res);
          this.supervisorLog = res.data.supervisorLog;
          this.supervisorLogComp = JSON.parse(JSON.stringify(this.supervisorLog))
 
          let attachfiles=res.data.attachfiles||[],attachfilesLen=attachfiles.length;
          if(attachfilesLen){
            attachfiles.forEach(item => {
              item.url=item.attachUrl;
            })
            this.imgBeforeArr = attachfiles;
          }
 
          jQuery('#summernote1').summernote('code', this.supervisorLog.supervisorInformationDynamics || '')
          jQuery('#summernote2').summernote('code', this.supervisorLog.supervisorPartyDynamics || '')
          jQuery('#summernote3').summernote('code', this.supervisorLog.materialEntry || '') 
          jQuery('#summernote4').summernote('code', this.supervisorLog.forensicsWitness || '') 
          jQuery('#summernote5').summernote('code', this.supervisorLog.qualification || '') 
          jQuery('#summernote6').summernote('code', this.supervisorLog.construction || '') 
          jQuery('#summernote7').summernote('code', this.supervisorLog.supervision || '') 
          jQuery('#summernote8').summernote('code', this.supervisorLog.problemDeal || '') 
          jQuery('#summernote9').summernote('code', this.supervisorLog.coordinateOthers || '') 
 
          let toHuman = res.data.supervisorLog.notifierName;
          if(this.status == "modify"){//新增和修改接收人
            if(toHuman.search("-") != -1){
              this.notifierNameDeptName = toHuman.substring(0,toHuman.length-1);
            }else{
              this.notifierNameDeptName = toHuman;
            }
          }else{
            this.notifierNameDeptName = null;
          }
        }
      }).catch(err => {
          console.log(err);
      })
    },
    getData(){
      let _this = this;
      _this.service({
        url:'/app/supervisorLog/supervisorLogInit',
        params:{
          projectSid:this.projectSid,
          supervisorLogSid:this.supervisorLogSid
        }
      }).then(res => {
        if(res.success && res.data){
          let data = res.data.supervisorLog;
          for(let key in data){
            if(data[key] == null){
              data[key] = "";
            }
          }
          this.supervisorLog = data || {};
          this.supervisorLogComp = JSON.parse(JSON.stringify(this.supervisorLog))
        }
      }).catch(err => {
        console.log(err);
      })
    },
    getLoadImg(file){ //获取图片      
      this.imgBeforeArr = file;
    },
    submitFn(state){
      let _this = this;
      if(state == '3'){
        if(!this.supervisorLog.notifierName){
          this.$toast('请先填写接收人');
          return false;
        }
      }
 
      if(this.checkCharacterLength('summernote1') > 300){
        this.$toast("监理方人员动态超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote2') > 300){
        this.$toast("施工方人员动态超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote3') > 300){
        this.$toast("材料进场超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote4') > 300){
        this.$toast("取证见证超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote5') > 300){
        this.$toast("合格情况超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote6') > 800){
        this.$toast("施工情况超过800字");
        return false;
      }else if(this.checkCharacterLength('summernote7') > 300){
        this.$toast("监理工作情况超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote8') > 300){
        this.$toast("检查问题及处理超过300字");
        return false;
      }else if(this.checkCharacterLength('summernote9') > 300){
        this.$toast("协调内容或其他超过300字");
        return false;
      }
 
      this.supervisorLog.supervisorInformationDynamics = jQuery('#summernote1').summernote('code') || '',
      this.supervisorLog.supervisorPartyDynamics = jQuery('#summernote2').summernote('code') || '',
      this.supervisorLog.materialEntry = jQuery('#summernote3').summernote('code') || '',
      this.supervisorLog.forensicsWitness = jQuery('#summernote4').summernote('code') || '',
      this.supervisorLog.qualification = jQuery('#summernote5').summernote('code') || '',
      this.supervisorLog.construction = jQuery('#summernote6').summernote('code') || '',
      this.supervisorLog.supervision = jQuery('#summernote7').summernote('code') || '',
      this.supervisorLog.problemDeal = jQuery('#summernote8').summernote('code') || '',
      this.supervisorLog.coordinateOthers = jQuery('#summernote9').summernote('code') || '',
 
      _this.service({
        url:'/app/supervisorLog/saveOrUpdate',
        params:{
          model:{
            supervisorLogSid:this.supervisorLog.supervisorLogSid,//主键
            projectSid:this.projectSid,
            notifierName:this.supervisorLog.notifierName,
            notifierSid:this.supervisorLog.notifierSid,
 
            meteorological:this.supervisorLog.meteorological,//气象、平均温度
            supervisorInformationDynamics:this.supervisorLog.supervisorInformationDynamics,//    监理人员动态
            supervisorPartyDynamics:this.supervisorLog.supervisorPartyDynamics,//  施工方人员动态
            materialEntry:this.supervisorLog.materialEntry,//    材料进场
            forensicsWitness:this.supervisorLog.forensicsWitness,// 取证见证
            qualification:this.supervisorLog.qualification,// 合格情况
            construction:this.supervisorLog.construction,// 施工情况
            supervision:this.supervisorLog.supervision,// 监理工作情况
            problemDeal:this.supervisorLog.problemDeal,// 检查问题及处理
            coordinateOthers:this.supervisorLog.coordinateOthers,// 协调内容或其他
            
          },
          state:state
        }
      }).then(res => {
        console.log(254,state);
        this.supervisorLogComp = JSON.parse(JSON.stringify(this.supervisorLog));
        if(res.success){
          if(state=="0"){
            this.$toast("保存成功")
          }else{
            this.$toast("发送成功")
          }
          this.$router.go(-1)
        }
      }).catch(err => {
        console.log(err);
      })
    },
 
    getNoMarkupStr(markupStr) {
      var noMarkupStr=jQuery("<div>").html(markupStr).text();
      noMarkupStr=noMarkupStr.replace(/(\r\n|\n|\r)/gm,"");
      noMarkupStr=noMarkupStr.replace(/^\s+/g,"");
      noMarkupStr=noMarkupStr.replace(/\s+$/g,"");
      noMarkupStr=noMarkupStr.replace(/\s+/g," ");
      return noMarkupStr;
    },
 
    checkCharacterLength(id){
      var markupStr = jQuery('#'+id).summernote('code') || '';
      return this.getNoMarkupStr(markupStr).length || 0;
    },
    
    copyHumanSelect(data){// 接收人的弹出层方法
    if(!data){
        this.copyHumanPickershow=false
      }
      let humanNameStr='',humanSidStr='',humanDeptName = "";
      data.forEach((item,index) => {
        if(index!=0){
          humanNameStr+=item.humanName?","+item.humanName:'';
          humanSidStr+=item.humanSid?","+item.humanSid:'';
          humanDeptName += item.humanName + "-" + item.deptName + ',';
        }else{
          humanNameStr+=item.humanName ||'';
          humanSidStr+=item.humanSid ||'';
          humanDeptName += item.humanName + "-" + item.deptName + ','|| '';
        }
      })
      this.notifierNameDeptName = humanDeptName.substring(0,humanDeptName.length-1)
      this.supervisorLog.notifierName = humanDeptName;
      this.supervisorLog.notifierSid = humanSidStr;
    },
    getWeath(){// 获取天气
      let _this = this;
      let mapObj = new AMap.Map('container',{
        zoom: 17
      });
      mapObj.plugin('AMap.Geolocation', function () {
        let geolocation = new AMap.Geolocation({
          enableHighAccuracy: true,//是否使用高精度定位,默认:true
          timeout: 10000,          //超过10秒后停止定位,默认:无穷大
          maximumAge: 0,           //定位结果缓存0毫秒,默认:0
          convert: true,           //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
          showButton: true,        //显示定位按钮,默认:true
          buttonPosition: 'LB',    //定位按钮停靠位置,默认:'LB',左下角
          buttonOffset: new AMap.Pixel(6, 10),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
          showMarker: true,        //定位成功后在定位到的位置显示点标记,默认:true
          showCircle: true,        //定位成功后用圆圈表示定位精度范围,默认:true
          panToLocation: true,     //定位成功后将定位到的位置作为地图中心点,默认:true
          zoomToAccuracy:true      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
        });
        geolocation.getCurrentPosition();
        AMap.event.addListener(geolocation, 'complete', function(res){
          if(res.formattedAddress){
            _this.city = res.addressComponent.city ||  res.addressComponent.province;
 
            AMap.plugin('AMap.Geocoder', function() {
              var geocoder = new AMap.Geocoder();
              var lnglat = [res.position.lng,res.position.lat];//南京
 
              geocoder.getAddress(lnglat, function(status, result) {
                if (status === 'complete' && result.info === 'OK') {
                  AMap.plugin('AMap.Weather', function() {//加载天气查询插件
                    var weather = new AMap.Weather();//创建天气查询实例
                    //执行实时天气信息查询
                    weather.getLive(result.regeocode.addressComponent.adcode, function(err, data) {
                      if(data){
                        // _this.weather = data.weather;// 天气
                        // _this.temperature = data.temperature + '℃';// 温度
                        _this.supervisorLog.meteorological=data.weather+' '+data.temperature + '℃'
                      }
                    });
                  });
                }
              })
            })
          }
        });//返回定位信息
        AMap.event.addListener(geolocation, 'error', function(err){
          _this.$toast( `“未获得您的地理位置,请前往“设置”授权使用”`);
        });//返回定位出错信息
      });
    },
  },
})
</script>
 
<style lang="scss">
.main{
  padding: 10px 0 0 0;
  .main-header{
    padding:0 12px 10px 12px;
    .item{
      padding:14px 24px;
      background-color: #fff;
      border-radius: 12px;
      box-shadow: 0px -1px 0px 0px #F4F4F4;
      .item-title{
        min-height: 22px;
        line-height: 22px;
        font-size: 16px;
        color:#333;
      }
      .item-desc{
        min-height: 22px;
        line-height: 22px;
        font-size: 14px;
        color:#8c8c8c;
      }
      .item-descImg{
        float: left;
        max-width: 46px;
        max-height: 46px;
        margin:0 20px 14px 0;
      }
    }
  }
 
  .dynamic{
    .van-field__label{
      width:7.2em!important;
    }
  }
  .input_padding .van-cell{
    padding: 0;
  }
}
</style>