apply-clients 7.1.36-yuchuan-24 → 7.1.36-yuchuan-27

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.
@@ -6,14 +6,14 @@ var proxyMiddleware = require('http-proxy-middleware')
6
6
  var app = express()
7
7
  var compiler = webpack(config)
8
8
  // var proxy = httpProxy.createProxyServer()
9
- var ldap = 'http://193.168.1.44:8600/'
9
+ var ldap = 'http://193.168.1.44:8600'
10
10
  // var applyinstall = 'http://121.36.79.201:8400'
11
11
  // var ldap = 'http://193.168.1.64:8082'
12
- // var ldap = 'http://61.134.61.238:8555'
13
- // var applyinstall = 'http://61.134.61.238:8555'
14
- var applyinstall = 'http://193.168.1.44:8600/'
15
- var fadada = 'http://193.168.1.44:8600/'
16
- // var fadada = 'http://61.134.61.238:8555'
12
+ // var ldap = 'http://61.134.61.238:8655'
13
+ // var applyinstall = 'http://61.134.61.238:8655'
14
+ var applyinstall = 'http://193.168.1.44:8600'
15
+ var fadada = 'http://193.168.1.44:8600'
16
+ // var fadada = 'http://61.134.61.238:8655'
17
17
  // var fadada = 'http://127.0.0.1:8080/'
18
18
  var proxyTable = {
19
19
  '/testfiles': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "7.1.36-yuchuan-24",
3
+ "version": "7.1.36-yuchuan-27",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -100,6 +100,7 @@
100
100
  "system-phone": "1.2.87-ycapply-7",
101
101
  "url-loader": "^0.5.7",
102
102
  "vue-client": "1.24.127",
103
+ "vue2-client": "1.8.329",
103
104
  "vue-hot-reload-api": "^1.2.0",
104
105
  "vue-html-loader": "^1.0.0",
105
106
  "vue-loader": "^8.2.1",
@@ -304,17 +304,27 @@ export default {
304
304
  let http = new HttpResetClass()
305
305
  let data = null
306
306
  let res = null
307
-
307
+ let data2 = {
308
+ condition: `ui.f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
309
+ }
310
+ let http2 = new HttpResetClass()
311
+ let res2 = await http2.load(
312
+ 'POST',
313
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
314
+ {data: data2},
315
+ {resolveMsg: null, rejectMsg: '档案获取失败!!!'}
316
+ )
317
+ let userinfo = res2.data[0]
308
318
  if (this.type !== '退出强制状态') {
309
319
  data = {
310
- condition: `f_meternumber = '${this.selectdata.f_meternumber}'`,
320
+ condition: `t_userfiles.f_meternumber = '${this.selectdata.f_meternumber}'`,
311
321
  contentData: {
312
322
  isOpen: this.type === '开阀' ? 1 : 0
313
323
  },
314
324
  inputtor: Vue.user.name,
315
325
  instructTitle: this.type,
316
326
  instructType: '阀门控制',
317
- meterBrandName: this.selectdata.f_meter_brand
327
+ meterBrandName: userinfo.f_alias
318
328
  }
319
329
  res = await http.load(
320
330
  'POST',
@@ -25,32 +25,31 @@
25
25
  condition="f_operate_date < '{}'"
26
26
  :show-reset-button="reset">
27
27
  </datepicker>
28
- </div><br>
29
- <!-- <div class="col-sm-2" style="margin-top: -24px">-->
30
- <!-- <label class="font_normal_body" for="f_insurance_company">保险公司:</label>-->
31
- <!-- <v-select-->
32
- <!-- placeholder='请选择'-->
33
- <!-- v-model="model.f_insurance_company"-->
34
- <!-- condition="f_insurance_company = '{}'"-->
35
- <!-- @change="$parent.$parent.changeCompany"-->
36
- <!-- :value.sync="model.f_insurance_company"-->
37
- <!-- :options="$parent.$parent.applyCompany"-->
38
- <!-- :value-single="true"-->
39
- <!-- style="margin-left:-12px"-->
40
- <!-- close-on-select></v-select>-->
41
- <!-- </div>-->
42
- <!-- <div class="col-sm-2" style="margin-top: -24px">-->
43
- <!-- <label class="font_normal_body" for="f_insurance_company">保险类型:</label>-->
44
- <!-- <v-select-->
45
- <!-- placeholder='请选择'-->
46
- <!-- v-model="model.f_insurance_type"-->
47
- <!-- condition="f_insurance_type = '{}'"-->
48
- <!-- :value.sync="model.f_insurance_type"-->
49
- <!-- :options="$parent.$parent.applyType"-->
50
- <!-- :value-single="true"-->
51
- <!-- style="margin-left:-12px"-->
52
- <!-- close-on-select></v-select>-->
53
- <!-- </div>-->
28
+ </div><br> <div class="col-sm-2" style="margin-top: -24px">
29
+ <label class="font_normal_body" for="f_insurance_company">保险公司:</label>
30
+ <v-select
31
+ placeholder='请选择'
32
+ v-model="model.f_insurance_company"
33
+ condition="f_insurance_company = '{}'"
34
+ @change="$parent.$parent.changeCompany"
35
+ :value.sync="model.f_insurance_company"
36
+ :options="$parent.$parent.applyCompany"
37
+ :value-single="true"
38
+ style="margin-left:-12px"
39
+ close-on-select></v-select>
40
+ </div>
41
+ <div class="col-sm-2" style="margin-top: -24px">
42
+ <label class="font_normal_body" for="f_insurance_company">保险类型:</label>
43
+ <v-select
44
+ placeholder='请选择'
45
+ v-model="model.f_insurance_type"
46
+ condition="f_insurance_type = '{}'"
47
+ :value.sync="model.f_insurance_type"
48
+ :options="$parent.$parent.applyType"
49
+ :value-single="true"
50
+ style="margin-left:-12px"
51
+ close-on-select></v-select>
52
+ </div>
54
53
  </div>
55
54
  <div class="span" style = "float:right;">
56
55
  <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
@@ -87,7 +87,7 @@ export default {
87
87
  },
88
88
  // 刷新控制层
89
89
  async 'breakControl' (servicedata) {
90
-
90
+ debugger
91
91
  if (servicedata.id) {
92
92
  let data = {
93
93
  condition: `u.id = ${servicedata.id}`,
@@ -72,7 +72,6 @@ export default {
72
72
  Vue.prototype.$workflow_vue = res.data
73
73
  },
74
74
  async breakControl (servicedata) {
75
-
76
75
  if (servicedata.id) {
77
76
  let data = {
78
77
  condition: `u.id = ${servicedata.id}`,
@@ -120,7 +119,6 @@ export default {
120
119
  },
121
120
  // 刷新控制层
122
121
  async 'breakControl' (servicedata) {
123
-
124
122
  if (servicedata.id) {
125
123
  let data = {
126
124
  condition: `u.id = ${servicedata.id}`,
@@ -134,7 +132,9 @@ export default {
134
132
  {data: data},
135
133
  {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
136
134
  )
137
-
135
+ if(res.data[0].f_userinfo_id==null || res.data[0].f_userinfo_id==''){
136
+ res.data[0].f_userinfo_id=servicedata.f_userinfo_id
137
+ }
138
138
  this.selectdata = res.data[0]
139
139
  } else {
140
140
  this.selectdata = servicedata
@@ -81,7 +81,7 @@ export default {
81
81
  },
82
82
  // 刷新控制层
83
83
  async 'breakControl'(servicedata) {
84
-
84
+ debugger
85
85
  if (servicedata.id) {
86
86
  let data = {
87
87
  condition: `u.id = ${servicedata.id}`,
@@ -508,7 +508,6 @@ export default {
508
508
  })
509
509
  }
510
510
  } else if (this.charge.f_bill_style === '专票') {
511
-
512
511
  data = {
513
512
  id: this.charge.f_bill_id
514
513
  }
@@ -68,7 +68,7 @@ export default {
68
68
  this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
69
69
  return
70
70
  }
71
-
71
+ debugger
72
72
  this.selectdata = Object.assign({}, this.selectdata, jsonData)
73
73
 
74
74
  // fields 字段填充值
@@ -278,7 +278,7 @@ export default {
278
278
  }
279
279
  // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
280
280
  let temp = JSON.parse(JSON.stringify(this.selectdata))
281
-
281
+ debugger
282
282
  this.show_data = temp
283
283
  this.$nextTick(() => {
284
284
  this.showview = true
@@ -1149,7 +1149,7 @@ export default {
1149
1149
  async getResidentialArea () {
1150
1150
  let data = {
1151
1151
  tablename: 't_area_address',
1152
- condition: `f_filiale like '%${this.$login.f.orgs}%' and f_area_status = '启用'`
1152
+ condition: `f_filiale in ('${this.$login.f.orgs}','榆林.榆川天然气') and f_area_status = '启用'`
1153
1153
  }
1154
1154
  let http = new HttpResetClass()
1155
1155
  let res = await http.load(
@@ -1940,7 +1940,7 @@ export default {
1940
1940
  let pcdText = `and f_residential_area like '%${val}%'`
1941
1941
  let data = {
1942
1942
  tablename: 't_area_address',
1943
- condition: `f_filiale like '%${Vue.user.orgs}%' and f_area_status = '启用' ${pcdText}`
1943
+ condition: `f_filiale like '%${this.$login.f.orgs}%' and f_area_status = '启用' ${pcdText}`
1944
1944
  }
1945
1945
  new HttpResetClass().load("POST", `rs/sql/applySingleTable`, {data:data}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
1946
1946
  console.log('请求发送完成!!!!!'+JSON.stringify(res))
@@ -1,285 +1,294 @@
1
- <template>
2
- <div class="col-sm-12" style="background-color: #FFFFFF">
3
- <div class="col-sm-12" style="padding:50px 100px;height: 25%">
4
- <div class="form-group col-sm-5" v-if="issearch">
5
- <v-select
6
- class="select select_list"
7
- :value.sync="useType"
8
- width="90%"
9
- v-model="useType"
10
- :options='typeOfUse'
11
- :valueSingle="true"></v-select>
12
- </div>
13
- <div class="form-group col-sm-2" style="text-align: center" v-if="issearch">
14
- <button type="button" class="btn btn-primary item_btn" @click="load">搜索</button>
15
- </div>
16
- <!-- && source!='流程查看'-->
17
- <div class="form-group col-sm-2" style="text-align: center" v-if="isupload ">
18
- <button type="button" class="btn btn-primary item_btn" @click="showUpload = !showUpload">本地上传</button>
19
- </div>
20
- <div class="form-group col-sm-2" style="text-align: center" v-if="takeimg">
21
- <button type="button" class="btn btn-primary item_btn" @click="upload()">拍照</button>
22
- </div>
23
- </div>
24
- <hr style="width: 90%;margin: 0px auto;border: #999999 1px solid;"/>
25
- <div class="col-sm-12" style="overflow: scroll;height: 75%">
26
- <div :class="bootstraped ? bootstraped + ' showData' : 'col-sm-6 showData'" v-for="row in fileInfoData">
27
- <div class="col-sm-12 item">
28
- <div class="left col-sm-5">
29
- <a href="#" class="thumbnail" style="width: 100%;height: 100%">
30
- <img v-if="row.f_filetype === 'jpg'||row.f_filetype === 'png'||row.f_filetype === 'gif'||row.f_filetype === 'bmp'" :src="row.f_downloadURL" alt="..."/>
31
- <img v-if="row.f_filetype === 'pdf'" src="../../image/pdf.jpg" alt="" />
32
- <img v-if="row.f_filetype === 'xls'||row.f_filetype === 'xlsx'" src="../../image/excel.jpg" alt="" />
33
- <img v-if="row.f_filetype === 'doc'||row.f_filetype === 'docx'" src="../../image/doc.jpg" alt="" />
34
- <img v-if="row.f_filetype === 'dwg'" src="../../image/dwg.png" alt="" />
35
- <img v-if="row.f_filetype === 'dxf'" src="../../image/dxf.png" alt="" />
36
- </a>
37
- </div>
38
- <div class="right col-sm-7">
39
- <p :title="row.f_filename" class="clears"><strong>文件名:</strong>{{row.f_filename}}</p>
40
- <p :title="row.f_username" class="clears"><strong>操作员:</strong><span>{{row.f_username}}</span></p>
41
- <p :title="row.fusetype" class="clears"><strong>使用类型:</strong><span>{{row.fusetype}}</span></p>
42
- <p :title="row.f_uploaddate" class="clears"><strong>上传时间:</strong><span>{{row.f_uploaddate}}</span></p>
43
- <p :title="row.fremarks" class="clears"><strong>文件说明:</strong>{{row.fremarks}}</p>
44
- <p class="clears">
45
- <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>
46
- <a v-if="row.f_filetype === 'dwg' || row.f_filetype==='dxf'" style="background:#6aa6e2" class="btn btn-primary" :href="row.f_downloadURL" role="button" download>下载</a>
47
- <a v-if="row.f_filetype !=='jpg' && row.f_filetype !=='png' && row.f_filetype !=='gif' && row.f_filetype !=='bmp' && row.f_filetype !=='dxf' && row.f_filetype !=='dwg'"
48
- @click="downloadfile(row.f_downloadURL)" style="background:#6aa6e2" class="btn btn-primary" role="button">下载</a>
49
- <a v-if="isdelete && row.defname === defname" @click="delet($index, row)" href="#" class="btn btn-default" role="button" role="button">删除</a>
50
- </p>
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- </div>
56
- <apply-high-meter
57
- v-if="showhighmeter"
58
- :show.sync="showhighmeter"
59
- :isusetype="isusetype"
60
- :isremark="isremark"
61
- @photo-finish="newPhoto"
62
- v-ref:ltgao
63
- ></apply-high-meter>
64
- <modal :show.sync="showUpload" v-ref:modal backdrop="false">
65
- <header slot="modal-header" class="modal-header">
66
- <button type="button" class="close" @click="close"><span class="glyphicon glyphicon-remove"></span></button>
67
- <h4 class="modal-title" style="text-align: center">文件上传</h4>
68
- </header>
69
- <article slot="modal-body" class="modal-body form-horizontal">
70
- <div class="form-group" style="text-align: center">
71
- <file-upload class="my-file-uploader" :name="'myFile' + blodid"
72
- action="rs/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
73
- </div>
74
- <div class="form-group" v-if="isusetype">
75
- <label class="col-sm-2 control-label">文件类型:</label>
76
- <div class="col-sm-10">
77
- <input-select
78
- class="select select_list"
79
- :value.sync="headers.fusetype"
80
- v-model="headers.fusetype"
81
- :options="$appdata.getParam('使用类型')"
82
- :valueSingle="true"></input-select>
83
- </div>
84
- </div>
85
- <div class="form-group" v-if="isremark" style="color: #df2424">
86
- <label class="col-sm-2 control-label">文件说明:</label>
87
- <div class="col-sm-10">
88
- <input class="form-control input_view" style=""
89
- v-model="headers.fremarks"
90
- :value="headers.fremarks"/>
91
- </div>
92
- </div>
93
- </article>
94
- <footer slot="modal-footer" class="modal-footer">
95
- </footer>
96
- </modal>
97
- </template>
98
-
99
- <script>
100
- import {HttpResetClass} from 'vue-client'
101
- import {isEmpty} from "../../Util";
102
- export default {
103
- title: '附件',
104
- props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'isdelete', 'bootstraped', 'issearch','source'],
105
- data () {
106
- return {
107
- fileInfoData: [], // 数据库存储的文件记录对象数组
108
- headers: {'username': this.$login.f.name, 'blodid': '','businessid':'', 'fremarks': '','defname':'','fusetype':''}, // 调用rs/file/uploadFile 的参数
109
- showUpload: false, // 上传模态框控制
110
- showhighmeter: false, // 高拍仪组件控制
111
- useType: null
112
- }
113
- },
114
- ready () {
115
- this.headers.blodid = this.blodid
116
- this.headers.businessid = this.businessid
117
- this.headers.defname = this.defname
118
- if (this.blodid || this.businessid) {
119
- this.load()
120
- }
121
- },
122
- methods: {
123
- delet(index, row) {
124
- this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
125
- this.$dispatch("delResid",row.id)
126
- this.load()
127
- })
128
- },
129
- // 下载
130
- downloadfile(filepath){
131
- var link = document.createElement('a');
132
- link.href = filepath;
133
- link.target='_blank'
134
- link.dispatchEvent(new MouseEvent('click'));
135
- },
136
- // 关闭文件上传对话框
137
- close () {
138
- this.showUpload = false
139
- this.showhighmeter = false
140
- // 将选的文件清空
141
- this.$refs.file.$el.querySelector('input').value = ''
142
- this.headers.fusetype = ''
143
- this.headers.fremarks = ''
144
- this.load()
145
- },
146
- // 查询
147
- async load() {
148
- let condition = ''
149
- if(this.businessid){
150
- condition = `f_businessid= '${this.headers.businessid}' `
151
- }else{
152
- condition = `f_blobid= '${this.headers.blodid}' `
153
- }
154
- if (this.defname === '冲正'){
155
- condition += `and defname= '${this.defname}' `
156
- }
157
- if (!isEmpty(this.useType)) {
158
- condition += `and fusetype like '${this.useType}'`
159
- }
160
- let http = new HttpResetClass()
161
- let data = {
162
- tablename: 't_files',
163
- condition: condition + ` order by f_uploaddate desc `
164
- }
165
- let getFile = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
166
- warnMsg: null,
167
- resolveMsg: null
168
- })
169
-
170
- for (var i = 0; i < getFile.data.length; i++) {
171
- // 如果使用类型包含导入字样,则是execl文件导入的,不做显示
172
- if(getFile.data[i].fusetype&&(getFile.data[i].fusetype.includes('execl导入'))){
173
- getFile.data.splice(i,1)
174
- i--
175
- continue
176
- }
177
- let temp = getFile.data[i].f_downloadpath
178
- if (temp.includes('http:')){
179
- getFile.data[i].f_downloadURL = temp
180
- } else {
181
- let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
182
- getFile.data[i].f_downloadURL = "http://" + location.host + "/" + URL
183
- }
184
- }
185
- this.fileInfoData = []
186
- this.fileInfoData = getFile.data
187
- },
188
- // 打开高拍仪
189
- upload () {
190
- if(this.showhighmeter){
191
- this.$refs.ltgao.closeVideo()
192
- }
193
- this.showhighmeter = !this.showhighmeter
194
- },
195
- // 高拍仪回调
196
- newPhoto(Imgbase64, fusetype, fremarks) {
197
- this.headers.fusetype = fusetype
198
- this.headers.fremarks = fremarks
199
-
200
- let form = new FormData()
201
- let xhr = new XMLHttpRequest()
202
- let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
203
- form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
204
- form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
205
- xhr.open("POST", "rs/file/uploadFile")
206
-
207
- if (this.headers) {
208
- for (var header in this.headers) {
209
- xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
210
- }
211
- }
212
- xhr.send(form)
213
- setTimeout(() => {
214
- this.close()
215
- }, 5000)
216
- },
217
- convertBase64ToBlob(base64String) {
218
- // 将base64解码
219
- var bytes = atob(base64String);
220
- //var bytes = base64;
221
- var bytesCode = new ArrayBuffer(bytes.length);
222
- // 转换为类型化数组
223
- var byteArray = new Uint8Array(bytesCode);
224
-
225
- // 将base64转换为ascii码
226
- for (var i = 0; i < bytes.length; i++) {
227
- byteArray[i] = bytes.charCodeAt(i);
228
- }
229
- // 生成Blob对象(文件对象)
230
- return new Blob([bytesCode], {type: 'image/jpeg'});
231
- },
232
- },
233
- computed: {
234
- typeOfUse () {
235
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
236
- }
237
- },
238
- events: {
239
- onFileUpload: function (file, res) {
240
- this.$dispatch("resid",res.id)
241
- this.headers.fremarks=''
242
- this.close()
243
- }
244
- }
245
- }
246
- </script>
247
-
248
- <style scoped>
249
- .clears{
250
- overflow:hidden;
251
- text-overflow:ellipsis;
252
- white-space:nowrap;
253
- }
254
- .showData {
255
- padding: 15px 10px 0px 10px;
256
- box-sizing: border-box;
257
- height: 230px;
258
- font-family: "微软雅黑";
259
- }
260
- .showData .item{
261
- padding-bottom: 10px;
262
- border-bottom: solid 1px #c1c1c1;
263
- }
264
- .left {
265
- padding-right: 10px;
266
- }
267
- .left img{
268
- height: 100%;
269
- width: 100%;
270
- }
271
- .right{
272
- height: 100%;
273
- /*display: -webkit-flex;*/
274
- /*display: flex;*/
275
- /*flex-direction: column;*/
276
- /*justify-content: space-around;*/
277
- }
278
- .item_btn{
279
- width: 80%;
280
- background-color: #6aa6e2;
281
- border-radius: 4px;
282
- color: #FFFFFF;
283
- font-family: PingFang;
284
- }
285
- </style>
1
+ <template>
2
+ <div class="col-sm-12" style="background-color: #FFFFFF">
3
+ <div class="col-sm-12" style="padding:50px 100px;height: 25%">
4
+ <div class="form-group col-sm-5" v-if="issearch">
5
+ <v-select
6
+ class="select select_list"
7
+ :value.sync="useType"
8
+ width="90%"
9
+ v-model="useType"
10
+ :options='typeOfUse'
11
+ :valueSingle="true"></v-select>
12
+ </div>
13
+ <div class="form-group col-sm-2" style="text-align: center" v-if="issearch">
14
+ <button type="button" class="btn btn-primary item_btn" @click="load">搜索</button>
15
+ </div>
16
+ <!-- && source!='流程查看'-->
17
+ <div class="form-group col-sm-2" style="text-align: center" v-if="isupload ">
18
+ <button type="button" class="btn btn-primary item_btn" @click="showUpload = !showUpload">本地上传</button>
19
+ </div>
20
+ <div class="form-group col-sm-2" style="text-align: center" v-if="takeimg">
21
+ <button type="button" class="btn btn-primary item_btn" @click="upload()">拍照</button>
22
+ </div>
23
+ </div>
24
+ <hr style="width: 90%;margin: 0px auto;border: #999999 1px solid;"/>
25
+ <div class="col-sm-12" style="overflow: scroll;height: 75%">
26
+ <div :class="bootstraped ? bootstraped + ' showData' : 'col-sm-6 showData'" v-for="row in fileInfoData">
27
+ <div class="col-sm-12 item">
28
+ <div class="left col-sm-5">
29
+ <a href="#" class="thumbnail" style="width: 100%;height: 100%">
30
+ <img v-if="row.f_filetype === 'jpg'||row.f_filetype === 'png'||row.f_filetype === 'gif'||row.f_filetype === 'bmp'" :src="row.f_downloadURL" alt="..."/>
31
+ <img v-if="row.f_filetype === 'pdf'" src="../../image/pdf.jpg" alt="" />
32
+ <img v-if="row.f_filetype === 'xls'||row.f_filetype === 'xlsx'" src="../../image/excel.jpg" alt="" />
33
+ <img v-if="row.f_filetype === 'doc'||row.f_filetype === 'docx'" src="../../image/doc.jpg" alt="" />
34
+ <img v-if="row.f_filetype === 'dwg'" src="../../image/dwg.png" alt="" />
35
+ <img v-if="row.f_filetype === 'dxf'" src="../../image/dxf.png" alt="" />
36
+ </a>
37
+ </div>
38
+ <div class="right col-sm-7">
39
+ <p :title="row.f_filename" class="clears"><strong>文件名:</strong>{{row.f_filename}}</p>
40
+ <p :title="row.f_username" class="clears"><strong>操作员:</strong><span>{{row.f_username}}</span></p>
41
+ <p :title="row.fusetype" class="clears"><strong>使用类型:</strong><span>{{row.fusetype}}</span></p>
42
+ <p :title="row.f_uploaddate" class="clears"><strong>上传时间:</strong><span>{{row.f_uploaddate}}</span></p>
43
+ <p :title="row.fremarks" class="clears"><strong>文件说明:</strong>{{row.fremarks}}</p>
44
+ <p class="clears">
45
+ <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>
46
+ <a v-if="row.f_filetype === 'dwg' || row.f_filetype==='dxf'" style="background:#6aa6e2" class="btn btn-primary" :href="row.f_downloadURL" role="button" download>下载</a>
47
+ <a v-if="row.f_filetype !=='jpg' && row.f_filetype !=='png' && row.f_filetype !=='gif' && row.f_filetype !=='bmp' && row.f_filetype !=='dxf' && row.f_filetype !=='dwg'"
48
+ @click="downloadfile(row.f_downloadURL)" style="background:#6aa6e2" class="btn btn-primary" role="button">下载</a>
49
+ <a v-if="isdelete && row.defname === defname" @click="delet($index, row)" href="#" class="btn btn-default" role="button" role="button">删除</a>
50
+ </p>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ <apply-high-meter
57
+ v-if="showhighmeter"
58
+ :show.sync="showhighmeter"
59
+ :isusetype="isusetype"
60
+ :isremark="isremark"
61
+ @photo-finish="newPhoto"
62
+ v-ref:ltgao
63
+ ></apply-high-meter>
64
+ <modal :show.sync="showUpload" v-ref:modal backdrop="false">
65
+ <header slot="modal-header" class="modal-header">
66
+ <button type="button" class="close" @click="close"><span class="glyphicon glyphicon-remove"></span></button>
67
+ <h4 class="modal-title" style="text-align: center">文件上传</h4>
68
+ </header>
69
+ <article slot="modal-body" class="modal-body form-horizontal">
70
+ <div class="form-group" style="text-align: center">
71
+ <file-upload class="my-file-uploader" :name="'myFile' + blodid"
72
+ action="rs/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
73
+ </div>
74
+ <div class="form-group" v-if="isusetype">
75
+ <label class="col-sm-2 control-label">文件类型:</label>
76
+ <div class="col-sm-10">
77
+ <input-select
78
+ class="select select_list"
79
+ :value.sync="headers.fusetype"
80
+ v-model="headers.fusetype"
81
+ :options="$appdata.getParam('使用类型')"
82
+ :valueSingle="true"></input-select>
83
+ </div>
84
+ </div>
85
+ <div class="form-group" v-if="isremark" style="color: #df2424">
86
+ <label class="col-sm-2 control-label">文件说明:</label>
87
+ <div class="col-sm-10">
88
+ <input class="form-control input_view" style=""
89
+ v-model="headers.fremarks"
90
+ :value="headers.fremarks"/>
91
+ </div>
92
+ </div>
93
+ </article>
94
+ <footer slot="modal-footer" class="modal-footer">
95
+ </footer>
96
+ </modal>
97
+ </template>
98
+
99
+ <script>
100
+ import {HttpResetClass} from 'vue-client'
101
+ import {isEmpty} from "../../Util";
102
+ export default {
103
+ title: '附件',
104
+ props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'isdelete', 'bootstraped', 'issearch','source'],
105
+ data () {
106
+ return {
107
+ fileInfoData: [], // 数据库存储的文件记录对象数组
108
+ headers: {'username': this.$login.f.name, 'blodid': '','businessid':'', 'fremarks': '','defname':'','fusetype':''}, // 调用rs/file/uploadFile 的参数
109
+ showUpload: false, // 上传模态框控制
110
+ showhighmeter: false, // 高拍仪组件控制
111
+ useType: null
112
+ }
113
+ },
114
+ ready () {
115
+ this.headers.blodid = this.blodid
116
+ this.headers.businessid = this.businessid
117
+ this.headers.defname = this.defname
118
+ if (this.blodid || this.businessid) {
119
+ this.load()
120
+ }
121
+ },
122
+ methods: {
123
+ delet(index, row) {
124
+ this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
125
+ this.$dispatch("delResid",row.id)
126
+ this.load()
127
+ })
128
+ },
129
+ // 下载
130
+ downloadfile(filepath){
131
+ var link = document.createElement('a');
132
+ link.href = filepath;
133
+ link.target='_blank'
134
+ link.dispatchEvent(new MouseEvent('click'));
135
+ },
136
+ // 关闭文件上传对话框
137
+ close () {
138
+ this.showUpload = false
139
+ this.showhighmeter = false
140
+ // 将选的文件清空
141
+ this.$refs.file.$el.querySelector('input').value = ''
142
+ this.headers.fusetype = ''
143
+ this.headers.fremarks = ''
144
+ this.load()
145
+ },
146
+ // 查询
147
+ async load() {
148
+ let condition = ''
149
+ if(this.businessid){
150
+ condition = `f_businessid= '${this.headers.businessid}' `
151
+ }else{
152
+ condition = `f_blobid= '${this.headers.blodid}' `
153
+ }
154
+ if (this.defname === '冲正'){
155
+ condition += `and defname= '${this.defname}' `
156
+ }
157
+ if (!isEmpty(this.useType)) {
158
+ condition += `and fusetype like '${this.useType}'`
159
+ }
160
+ let http = new HttpResetClass()
161
+ let data = {
162
+ tablename: 't_files',
163
+ condition: condition + ` order by f_uploaddate desc `
164
+ }
165
+ let getFile = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
166
+ warnMsg: null,
167
+ resolveMsg: null
168
+ })
169
+
170
+ for (var i = 0; i < getFile.data.length; i++) {
171
+ // 如果使用类型包含导入字样,则是execl文件导入的,不做显示
172
+ if(getFile.data[i].fusetype&&(getFile.data[i].fusetype.includes('execl导入'))){
173
+ getFile.data.splice(i,1)
174
+ i--
175
+ continue
176
+ }
177
+ let temp = getFile.data[i].f_downloadpath
178
+ if (temp.includes('http:')){
179
+ getFile.data[i].f_downloadURL = temp
180
+ } else {
181
+ let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
182
+ getFile.data[i].f_downloadURL = "http://" + location.host + "/" + URL
183
+ }
184
+ }
185
+ this.fileInfoData = []
186
+ this.fileInfoData = getFile.data
187
+ },
188
+ // 打开高拍仪
189
+ upload () {
190
+ if(this.showhighmeter){
191
+ this.$refs.ltgao.closeVideo()
192
+ }
193
+ this.showhighmeter = !this.showhighmeter
194
+ },
195
+ // 高拍仪回调
196
+ newPhoto(Imgbase64, fusetype, fremarks) {
197
+ this.headers.fusetype = fusetype
198
+ this.headers.fremarks = fremarks
199
+
200
+ let form = new FormData()
201
+ let xhr = new XMLHttpRequest()
202
+ let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
203
+ form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
204
+ form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
205
+ xhr.open("POST", "rs/file/uploadFile")
206
+
207
+ if (this.headers) {
208
+ for (var header in this.headers) {
209
+ xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
210
+ }
211
+ }
212
+ xhr.send(form)
213
+ setTimeout(() => {
214
+ this.close()
215
+ }, 5000)
216
+ },
217
+ convertBase64ToBlob(base64String) {
218
+ // 将base64解码
219
+ var bytes = atob(base64String);
220
+ //var bytes = base64;
221
+ var bytesCode = new ArrayBuffer(bytes.length);
222
+ // 转换为类型化数组
223
+ var byteArray = new Uint8Array(bytesCode);
224
+
225
+ // 将base64转换为ascii码
226
+ for (var i = 0; i < bytes.length; i++) {
227
+ byteArray[i] = bytes.charCodeAt(i);
228
+ }
229
+ // 生成Blob对象(文件对象)
230
+ return new Blob([bytesCode], {type: 'image/jpeg'});
231
+ },
232
+ },
233
+ computed: {
234
+ typeOfUse () {
235
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]
236
+ }
237
+ },
238
+ events: {
239
+ onFileUpload: function (file, res) {
240
+ this.$dispatch("resid",res.id)
241
+ this.headers.fremarks=''
242
+ this.close()
243
+ },
244
+ onFileChange: function ( res) {
245
+ const regex = /^[^#]+$/;
246
+ for (let i=0;i<res.length;i++){
247
+ if (!regex.test(res[i].name)){
248
+ this.$showMessage(`第${i+1}个文件名不能包含#号`, 'error')
249
+ this.close()
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ </script>
256
+
257
+ <style scoped>
258
+ .clears{
259
+ overflow:hidden;
260
+ text-overflow:ellipsis;
261
+ white-space:nowrap;
262
+ }
263
+ .showData {
264
+ padding: 15px 10px 0px 10px;
265
+ box-sizing: border-box;
266
+ height: 230px;
267
+ font-family: "微软雅黑";
268
+ }
269
+ .showData .item{
270
+ padding-bottom: 10px;
271
+ border-bottom: solid 1px #c1c1c1;
272
+ }
273
+ .left {
274
+ padding-right: 10px;
275
+ }
276
+ .left img{
277
+ height: 100%;
278
+ width: 100%;
279
+ }
280
+ .right{
281
+ height: 100%;
282
+ /*display: -webkit-flex;*/
283
+ /*display: flex;*/
284
+ /*flex-direction: column;*/
285
+ /*justify-content: space-around;*/
286
+ }
287
+ .item_btn{
288
+ width: 80%;
289
+ background-color: #6aa6e2;
290
+ border-radius: 4px;
291
+ color: #FFFFFF;
292
+ font-family: PingFang;
293
+ }
294
+ </style>