apply-clients 3.2.38-2 → 3.2.38-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@
27
27
  <th style="white-space: nowrap;">
28
28
  <button type="button" class="btn btn-info head-but"
29
29
  :disabled="$parent.$parent.$parent.mark === 1"
30
- @click="$parent.$parent.$parent.showFile = !$parent.$parent.$parent.showFile">导入</button>
30
+ @click="$parent.$parent.$parent.showFile = !$parent.$parent.$parent.showFile,$parent.$parent.$parent.files = '导入'">导入</button>
31
31
  <a v-if="$parent.$parent.$parent.selectdata.f_apply_type === '开发商集体报建'" type="button" class="btn btn-info head-but"
32
32
  href="/apply/download/excel/批量导入地址及安装明细.xlsx" download>模板下载</a>
33
33
  <a v-else type="button" class="btn btn-info head-but"
@@ -82,7 +82,7 @@
82
82
  </data-grid>
83
83
  </criteria-paged>
84
84
  </div>
85
- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
85
+ <modal v-if="showFile" style="z-index: 10000;" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
86
86
  <header slot="modal-header" class="modal-header">
87
87
  <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
88
88
  <h4 class="modal-title">选择文件</h4>
@@ -95,7 +95,7 @@
95
95
  <footer slot="modal-footer" class="modal-footer"></footer>
96
96
  </modal>
97
97
 
98
- <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
98
+ <modal v-if="showUserFile" :show.sync="showUserFile" v-ref:modal :large="true" :backdrop="false" title="安装明细">
99
99
  <header slot="modal-header" class="modal-header">
100
100
  <button type="button" class="close" @click="closeUserFile"><span>&times;</span></button>
101
101
  <h4 class="modal-title">安装明细</h4>
@@ -258,7 +258,40 @@
258
258
  </div>
259
259
  </div>
260
260
  </div>
261
-
261
+ <div class="form-group col-sm-12 panel panel-info">
262
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
263
+ <div class="col-sm-6 text-left">附件信息</div>
264
+ <div class="col-sm-6 text-right">
265
+ <button type="button" class="btn btn-info head-but"
266
+ :disabled="$parent.$parent.$parent.mark === 1"
267
+ @click="showFile = !showFile,files = '上传'">上传</button>
268
+ </div>
269
+ </div>
270
+ <div class="col-sm-6 showData" v-for="row in user_files">
271
+ <div class="col-sm-12 item">
272
+ <div class="left col-sm-5">
273
+ <a href="#" class="thumbnail" style="width: 100%;height: 100%">
274
+ <img v-if="row.f_filetype === 'jpg'||row.f_filetype === 'png'||row.f_filetype === 'gif'||row.f_filetype === 'bmp'" :src="row.f_downloadURL" alt="..."/>
275
+ <img v-if="row.f_filetype === 'pdf'" src="../../../image/pdf.jpg" alt="" />
276
+ <img v-if="row.f_filetype === 'xls'||row.f_filetype === 'xlsx'" src="../../../image/excel.jpg" alt="" />
277
+ <img v-if="row.f_filetype === 'doc'||row.f_filetype === 'docx'" src="../../../image/doc.jpg" alt="" />
278
+ </a>
279
+ </div>
280
+ <div class="right col-sm-7">
281
+ <p :title="row.f_filename"><strong>文件名:</strong>{{row.f_filename}}</p>
282
+ <p :title="row.f_username" ><strong>操作员:</strong><span>{{row.f_username}}</span></p>
283
+ <p :title="row.fusetype"><strong>使用类型:</strong><span>{{row.fusetype}}</span></p>
284
+ <p :title="row.f_uploaddate"><strong>上传时间:</strong><span>{{row.f_uploaddate}}</span></p>
285
+ <p :title="row.fremarks"><strong>文件说明:</strong>{{row.fremarks}}</p>
286
+ <p>
287
+ <a v-if="row.f_filetype === 'jpg' || row.f_filetype==='png' || row.f_filetype==='gif' || row.f_filetype==='bmp'" :href="row.f_downloadURL" style="background:#6aa6e2" class="btn btn-primary" target="_blank" role="button">预览</a>
288
+ <a v-else @click="downloadfile(row.f_downloadURL)" style="background:#6aa6e2" class="btn btn-primary" role="button">下载</a>
289
+ <a @click="delet($index, row)" href="#" class="btn btn-default" role="button" role="button">删除</a>
290
+ </p>
291
+ </div>
292
+ </div>
293
+ </div>
294
+ </div>
262
295
  </article>
263
296
  <footer slot="modal-footer" class="modal-footer">
264
297
  <!-- 去除一户多表 -->
@@ -295,7 +328,9 @@
295
328
  }),
296
329
  meterbrands: [], // 气表品牌
297
330
  useradders: null,
298
- userinfo: {}
331
+ userinfo: {},
332
+ files: '导入',
333
+ user_files:[]
299
334
  }
300
335
  },
301
336
  ready () {
@@ -442,7 +477,7 @@
442
477
  }
443
478
  }
444
479
  }
445
-
480
+ await this.getfiles()
446
481
  this.showUserFile = true
447
482
  },
448
483
  // 获取气表品牌
@@ -473,30 +508,76 @@
473
508
  this.showFile = false
474
509
  // 将选的文件清空
475
510
  this.$refs.file.$el.querySelector('input').value = ''
476
- this.search()
477
- }
511
+ if (this.files === '导入'){
512
+ this.search()
513
+ }
514
+ },
515
+ getfiles(){
516
+ let http = new HttpResetClass()
517
+ let data = {
518
+ tablename: 't_files',
519
+ condition: `f_blobid= '${this.userinfo.f_userinfo_id}' and fusetype = '表具附件'` + ` order by f_uploaddate desc `
520
+ }
521
+ http.load('POST', 'rs/sql/singleTable', {data: data}, {
522
+ warnMsg: null,
523
+ resolveMsg: null
524
+ }).then(res=>{
525
+ const protocol = location.protocol + '//'
526
+ const host = location.host
527
+ this.user_files = res.data.map(item => {
528
+ let temp = item.f_downloadpath
529
+ let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
530
+ return {
531
+ ...item,
532
+ f_downloadURL: URL ? `${protocol}${host}/${URL}` : ''
533
+ }
534
+ })
535
+ console.log('this.user_files',this.user_files)
536
+ })
537
+ },
538
+ delet(index, row) {
539
+ this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
540
+ this.getfiles()
541
+ })
542
+ },
543
+ // 下载
544
+ downloadfile(filepath){
545
+ var link = document.createElement('a');
546
+ link.href = filepath;
547
+ link.target='_blank'
548
+ link.dispatchEvent(new MouseEvent('click'));
549
+ },
478
550
  },
479
551
  events: {
480
552
  async 'onFileUpload'(file, result) {
481
- let data = {
482
- selectdata: this.selectdata,
483
- filepath: result.f_downloadpath,
484
- user: this.$login.f
485
- }
486
- let url = null
487
- if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
488
- url = 'rs/logic/importAddressUserFiles'
489
- } else {
490
- url = 'rs/logic/importAddInstallationDetails'
491
- }
553
+ if (this.files === '导入'){
554
+ let data = {
555
+ selectdata: this.selectdata,
556
+ filepath: result.f_downloadpath,
557
+ user: this.$login.f
558
+ }
559
+ let url = null
560
+ if (this.selectdata.f_apply_type === '开发商集体报建' || this.selectdata.f_apply_type === '散户集体报建') {
561
+ url = 'rs/logic/importAddressUserFiles'
562
+ } else {
563
+ url = 'rs/logic/importAddInstallationDetails'
564
+ }
492
565
 
493
- let res = await this.$resetpost(url, {data:data}, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0)
494
- if(res.data.type === "success"){
495
- this.$showAlert("导入信息:"+res.data.msg, res.data.type, 2000);
496
- }else{
497
- this.$showMessage(res.data.msg);
566
+ let res = await this.$resetpost(url, {data:data}, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0)
567
+ if(res.data.type === "success"){
568
+ this.$showAlert("导入信息:"+res.data.msg, res.data.type, 2000);
569
+ }else{
570
+ this.$showMessage(res.data.msg);
571
+ }
572
+ this.$dispatch('breakControl', this.selectdata)
573
+ }
574
+ if (this.files === '上传') {
575
+ await this.$resetpost(
576
+ 'rs/entity/t_files', { id: result.id, f_blobid: this.userinfo.f_userinfo_id, fusetype:'表具附件'}
577
+ )
578
+ await this.getfiles()
579
+ await this.closeFile()
498
580
  }
499
- this.$dispatch('breakControl', this.selectdata)
500
581
  }
501
582
  },
502
583
  computed: {
@@ -523,6 +604,29 @@
523
604
  }
524
605
  </script>
525
606
  <style scoped>
607
+ p {
608
+ margin: 0;
609
+ }
610
+ .showData {
611
+ padding: 15px 10px 0px 10px;
612
+ box-sizing: border-box;
613
+ height: 230px;
614
+ font-family: "微软雅黑";
615
+ }
616
+ .showData .item{
617
+ padding-bottom: 10px;
618
+ border-bottom: solid 1px #c1c1c1;
619
+ }
620
+ .left {
621
+ padding-right: 10px;
622
+ }
623
+ .left img{
624
+ height: 100%;
625
+ width: 100%;
626
+ }
627
+ .right{
628
+ height: 100%;
629
+ }
526
630
  .head-but{
527
631
  margin-left: 5px;
528
632
  height: 34px;