sale-client 3.6.471 → 3.6.472
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.
- package/package.json +1 -1
- package/src/components/revenue/comprehen/ComprehenOperation/MeterDisable/DisableManage.vue +10 -1
- package/src/filiale/bayan/Upload.vue +191 -194
- package/src/filiale/bayan/UploadImg.vue +190 -193
- package/.gradle/5.2.1/fileChanges/last-build.bin +0 -0
- package/.gradle/5.2.1/fileHashes/fileHashes.lock +0 -0
- package/.gradle/5.2.1/gc.properties +0 -0
- package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/.gradle/vcs-1/gc.properties +0 -0
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</validator>
|
|
28
28
|
</div>
|
|
29
|
-
<upload :blodid="blodid"
|
|
29
|
+
<upload :blodid="blodid" :businessid="randomBusinessId" isremark="true" :deleteimg="true" fusetype="停用"></upload>
|
|
30
30
|
</template>
|
|
31
31
|
<script>
|
|
32
32
|
/**
|
|
@@ -41,13 +41,22 @@
|
|
|
41
41
|
blodid: '',
|
|
42
42
|
showupload: true,
|
|
43
43
|
model: {},
|
|
44
|
+
randomBusinessId: '',
|
|
44
45
|
reason: this.$appdata.getParam('停用原因')
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
ready () {
|
|
48
49
|
this.blodid = this.row.f_userinfo_id
|
|
50
|
+
this.getRandomId()
|
|
49
51
|
},
|
|
50
52
|
methods: {
|
|
53
|
+
getRandomId () {
|
|
54
|
+
this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
55
|
+
let res = Math.random() * 16 | 0
|
|
56
|
+
let v = c == 'x' ? res : (res & 0x3 | 0x8)
|
|
57
|
+
return v.toString(16)
|
|
58
|
+
})
|
|
59
|
+
},
|
|
51
60
|
async confirm () {
|
|
52
61
|
await this.$LogicService.meterDisable(this.model, this.row)
|
|
53
62
|
let array = [{
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
51
|
-
<modal :show.sync="showUpload" styles="border-radius:
|
|
51
|
+
<modal :show.sync="showUpload" styles="border-radius:5px;margin-top:300px" v-ref:modal backdrop="false" :width="600" >
|
|
52
52
|
<header slot="modal-header" class="modal-header">
|
|
53
53
|
<button type="button" class="close" @click="close"><span class="glyphicon glyphicon-remove"></span></button>
|
|
54
54
|
<h4 class="modal-title" style="text-align: center">文件上传</h4>
|
|
@@ -66,227 +66,224 @@
|
|
|
66
66
|
</template>
|
|
67
67
|
<script>
|
|
68
68
|
import { HttpResetClass } from 'vue-client'
|
|
69
|
-
//import HttpResetClass from '../plugins/HttpResetClass'
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
// import HttpResetClass from '../plugins/HttpResetClass'
|
|
70
|
+
import Vue from 'vue'
|
|
71
|
+
|
|
72
|
+
export default {
|
|
73
|
+
title: '附件',
|
|
74
|
+
props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'fusetype', 'cols', 'width', 'height', 'deleteimg'],
|
|
75
|
+
data () {
|
|
76
|
+
return {
|
|
77
|
+
isDelete: '0', // 删除按钮,可以进行控制(权限等)
|
|
78
|
+
delimg: true, // 删除按钮,可以进行控制(权限等)
|
|
79
|
+
fileInfoData: [], // 数据库存储的文件记录对象数组
|
|
80
|
+
headers: {'username': this.$login.f.name, 'blodid': '', 'businessid': '', 'fremarks': '', 'defname': '', 'fusetype': this.fusetype ? this.fusetype : ''}, // 调用rs/file/uploadFile 的参数
|
|
81
|
+
showUpload: false, // 上传模态框控制
|
|
82
|
+
showhighmeter: false, // 高拍仪组件控制
|
|
83
|
+
useType: '', // 使用类型
|
|
84
|
+
fileRemark: '', // 文件说明
|
|
85
|
+
rotating: this.$appdata.getSingleValue('图片附加功能') // 文件是否旋转
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
confirmIdCard (IdCardInfo) {
|
|
90
|
+
this.showhighmeter = !this.showhighmeter
|
|
91
|
+
console.log(IdCardInfo)
|
|
92
|
+
if (IdCardInfo && IdCardInfo.strID) {
|
|
93
|
+
this.$emit('confirminfo', IdCardInfo)
|
|
86
94
|
}
|
|
87
95
|
},
|
|
88
|
-
methods: {
|
|
89
|
-
confirmIdCard (IdCardInfo) {
|
|
90
|
-
this.showhighmeter = !this.showhighmeter
|
|
91
|
-
console.log(IdCardInfo)
|
|
92
|
-
if(IdCardInfo && IdCardInfo.strID){
|
|
93
|
-
this.$emit('confirminfo', IdCardInfo)
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
96
|
// 查询按钮事件
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var link = document.createElement('a');
|
|
97
|
+
delet (index, row) {
|
|
98
|
+
this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
|
|
99
|
+
this.$dispatch('delResid', row.id)
|
|
100
|
+
this.fileInfoData.splice(index, 1)
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
downloadfile (filepath) {
|
|
104
|
+
var link = document.createElement('a')
|
|
106
105
|
// let pathName = "http://" + location.host + filepath;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return theRequest;
|
|
122
|
-
},
|
|
123
|
-
upload() {
|
|
124
|
-
|
|
125
|
-
if(this.showhighmeter){
|
|
126
|
-
console.log(this,'测试')
|
|
127
|
-
this.$refs.ltgao.closeVideo()
|
|
128
|
-
}
|
|
129
|
-
console.log('测试1')
|
|
130
|
-
this.showhighmeter = !this.showhighmeter
|
|
131
|
-
},
|
|
132
|
-
async load(self) {
|
|
133
|
-
let condition=''
|
|
134
|
-
if(this.businessid){
|
|
135
|
-
condition = `f_businessid= '${self.headers.businessid}' `
|
|
136
|
-
}else{
|
|
137
|
-
condition = `f_blobid= '${self.headers.blodid}' `
|
|
138
|
-
}
|
|
139
|
-
if(this.fusetype){
|
|
140
|
-
condition += ` and fusetype like '%${this.fusetype}%'`
|
|
141
|
-
}
|
|
142
|
-
var http = new HttpResetClass()
|
|
143
|
-
let data = {
|
|
144
|
-
condition: condition
|
|
145
|
-
}
|
|
146
|
-
let getFile = []
|
|
147
|
-
try {
|
|
148
|
-
getFile = await http.load('POST', 'rs/sql/getFiles', {data: data}, {
|
|
149
|
-
warnMsg: null,
|
|
150
|
-
resolveMsg: null
|
|
151
|
-
})
|
|
152
|
-
} catch (e) {
|
|
153
|
-
console.log(e)
|
|
106
|
+
link.href = filepath
|
|
107
|
+
link.target = '_blank'
|
|
108
|
+
link.dispatchEvent(new MouseEvent('click'))
|
|
109
|
+
},
|
|
110
|
+
GetRequest () {
|
|
111
|
+
var url = location.search
|
|
112
|
+
var theRequest = new Object()
|
|
113
|
+
if (url.indexOf('?') != -1) {
|
|
114
|
+
var str = url.substr(1)
|
|
115
|
+
let strs = str.split('&')
|
|
116
|
+
for (var i = 0; i < strs.length; i++) {
|
|
117
|
+
theRequest[strs[i].split('=')[0]] = decodeURIComponent(strs[i].split('=')[1])
|
|
154
118
|
}
|
|
155
|
-
|
|
119
|
+
}
|
|
120
|
+
return theRequest
|
|
121
|
+
},
|
|
122
|
+
upload () {
|
|
123
|
+
if (this.showhighmeter) {
|
|
124
|
+
console.log(this, '测试')
|
|
125
|
+
this.$refs.ltgao.closeVideo()
|
|
126
|
+
}
|
|
127
|
+
console.log('测试1')
|
|
128
|
+
this.showhighmeter = !this.showhighmeter
|
|
129
|
+
},
|
|
130
|
+
async load (self) {
|
|
131
|
+
let condition = ''
|
|
132
|
+
if (this.businessid) {
|
|
133
|
+
condition = `f_businessid= '${self.headers.businessid}' `
|
|
134
|
+
} else {
|
|
135
|
+
condition = `f_blobid= '${self.headers.blodid}' `
|
|
136
|
+
}
|
|
137
|
+
if (this.fusetype) {
|
|
138
|
+
condition += ` and fusetype like '%${this.fusetype}%'`
|
|
139
|
+
}
|
|
140
|
+
var http = new HttpResetClass()
|
|
141
|
+
let data = {
|
|
142
|
+
condition: condition
|
|
143
|
+
}
|
|
144
|
+
let getFile = []
|
|
145
|
+
try {
|
|
146
|
+
getFile = await http.load('POST', 'rs/sql/getFiles', {data: data}, {
|
|
147
|
+
warnMsg: null,
|
|
148
|
+
resolveMsg: null
|
|
149
|
+
})
|
|
150
|
+
} catch (e) {
|
|
151
|
+
console.log(e)
|
|
152
|
+
}
|
|
153
|
+
for (var i = 0; i < getFile.data.length; i++) {
|
|
156
154
|
// 如果使用类型包含导入字样,则是execl文件导入的,不做显示
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
let temp = getFile.data[i].f_downloadpath
|
|
163
|
-
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
164
|
-
var xy=this.$appdata.getSingleValue('协议')?this.$appdata.getSingleValue('协议'):"http://"
|
|
165
|
-
getFile.data[i].f_downloadURL = xy+ location.host + "/" + URL
|
|
155
|
+
if (getFile.data[i].fusetype && (getFile.data[i].fusetype.includes('execl导入'))) {
|
|
156
|
+
getFile.data.splice(i, 1)
|
|
157
|
+
i--
|
|
158
|
+
continue
|
|
166
159
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
let temp = getFile.data[i].f_downloadpath
|
|
161
|
+
let URL = temp.substring(temp.lastIndexOf(':\\') + 2)
|
|
162
|
+
var xy = this.$appdata.getSingleValue('协议') ? this.$appdata.getSingleValue('协议') : 'http://'
|
|
163
|
+
getFile.data[i].f_downloadURL = xy + location.host + '/' + URL
|
|
164
|
+
}
|
|
165
|
+
self.fileInfoData = []
|
|
166
|
+
self.fileInfoData = getFile.data
|
|
167
|
+
},
|
|
170
168
|
// 数据库时间格式化
|
|
171
|
-
|
|
172
|
-
//20180914151603 : 2018-09-14 15:16:03
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
},
|
|
169
|
+
formatdate (val) {
|
|
170
|
+
// 20180914151603 : 2018-09-14 15:16:03
|
|
171
|
+
if (val.length != 14) { return }
|
|
172
|
+
let year = val.substr(0, 4)
|
|
173
|
+
let month = val.substr(4, 2)
|
|
174
|
+
let day = val.substr(6, 2)
|
|
175
|
+
let hour = val.substr(8, 2)
|
|
176
|
+
let min = val.substr(10, 2)
|
|
177
|
+
let second = val.substr(12, 2)
|
|
178
|
+
return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + second
|
|
179
|
+
},
|
|
183
180
|
// 打开文件上传对话框
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
fileUpload () {
|
|
182
|
+
this.showUpload = true
|
|
183
|
+
},
|
|
187
184
|
// 关闭文件上传对话框
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
close () {
|
|
186
|
+
this.showUpload = false
|
|
190
187
|
// 将选的文件清空
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
this.$refs.file.$el.querySelector('input').value = ''
|
|
189
|
+
this.load(this)
|
|
190
|
+
},
|
|
191
|
+
convertBase64ToBlob (base64String) {
|
|
195
192
|
// 将base64解码
|
|
196
|
-
|
|
197
|
-
//var bytes = base64;
|
|
198
|
-
|
|
193
|
+
var bytes = atob(base64String)
|
|
194
|
+
// var bytes = base64;
|
|
195
|
+
var bytesCode = new ArrayBuffer(bytes.length)
|
|
199
196
|
// 转换为类型化数组
|
|
200
|
-
|
|
197
|
+
var byteArray = new Uint8Array(bytesCode)
|
|
201
198
|
|
|
202
199
|
// 将base64转换为ascii码
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
// 生成Blob对象(文件对象)
|
|
207
|
-
return new Blob([bytesCode], {type: 'image/jpeg'});
|
|
208
|
-
},
|
|
209
|
-
newPhoto(Imgbase64) {
|
|
210
|
-
let form = new FormData()
|
|
211
|
-
let xhr = new XMLHttpRequest()
|
|
212
|
-
let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
|
|
213
|
-
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
214
|
-
form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
|
|
215
|
-
xhr.open("POST", "rs/file/uploadFile")
|
|
216
|
-
|
|
217
|
-
if (this.headers) {
|
|
218
|
-
for (var header in this.headers) {
|
|
219
|
-
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (Vue.$login && Vue.$login.jwt) {
|
|
223
|
-
xhr.setRequestHeader('Authorization', 'Bearer ' + Vue.$login.jwtNew)
|
|
224
|
-
xhr.setRequestHeader('Token', Vue.$login.jwt)
|
|
225
|
-
}
|
|
226
|
-
xhr.send(form)
|
|
227
|
-
setTimeout(() => {
|
|
228
|
-
this.load(this)
|
|
229
|
-
}, 5000)
|
|
200
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
201
|
+
byteArray[i] = bytes.charCodeAt(i)
|
|
230
202
|
}
|
|
203
|
+
// 生成Blob对象(文件对象)
|
|
204
|
+
return new Blob([bytesCode], {type: 'image/jpeg'})
|
|
231
205
|
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
206
|
+
newPhoto (Imgbase64) {
|
|
207
|
+
let form = new FormData()
|
|
208
|
+
let xhr = new XMLHttpRequest()
|
|
209
|
+
let formDataBoundary = '----WebkitFormBoundary' + 'GaoPaiYi'
|
|
210
|
+
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
211
|
+
form.append('file', this.convertBase64ToBlob(Imgbase64), 'GaoPaiYi.jpg')
|
|
212
|
+
xhr.open('POST', 'rs/file/uploadFile')
|
|
213
|
+
|
|
214
|
+
if (this.headers) {
|
|
215
|
+
for (var header in this.headers) {
|
|
216
|
+
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
217
|
+
}
|
|
236
218
|
}
|
|
237
|
-
if (
|
|
238
|
-
|
|
219
|
+
if (Vue.$login && Vue.$login.jwt) {
|
|
220
|
+
xhr.setRequestHeader('Authorization', 'Bearer ' + Vue.$login.jwtNew)
|
|
221
|
+
xhr.setRequestHeader('Token', Vue.$login.jwt)
|
|
239
222
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
223
|
+
xhr.send(form)
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
this.load(this)
|
|
226
|
+
}, 5000)
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
ready () {
|
|
230
|
+
if (this.$login.r.find(value => value == '上传附件删除')) {
|
|
231
|
+
// 有删除权限
|
|
232
|
+
this.isDelete = '1'
|
|
233
|
+
}
|
|
234
|
+
if (this.deleteimg) {
|
|
235
|
+
this.delimg = false
|
|
236
|
+
}
|
|
237
|
+
this.headers.blodid = this.blodid
|
|
238
|
+
this.headers.businessid = this.businessid
|
|
239
|
+
console.log('123222', this.businessid)
|
|
240
|
+
if (this.blodid || this.businessid) {
|
|
241
|
+
this.load(this)
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
watch: {
|
|
245
|
+
'blodid' (val) {
|
|
246
|
+
if (val) {
|
|
247
|
+
console.log('观察blodid', val)
|
|
248
|
+
this.headers.blodid = this.blodid
|
|
244
249
|
this.load(this)
|
|
245
250
|
}
|
|
246
251
|
},
|
|
247
|
-
|
|
248
|
-
'
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
'businessid'(val) {
|
|
256
|
-
console.log('观察businessid')
|
|
257
|
-
if (val) {
|
|
258
|
-
console.log('观察businessid', val)
|
|
259
|
-
this.headers.businessid = this.businessid
|
|
260
|
-
this.load(this)
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
'useType'() {
|
|
264
|
-
this.headers.fusetype = this.useType[0] ? this.useType[0] : ''
|
|
265
|
-
},
|
|
266
|
-
'defname'() {
|
|
267
|
-
this.headers.defname=this.defname
|
|
252
|
+
'businessid' (val) {
|
|
253
|
+
console.log('观察businessid')
|
|
254
|
+
if (val) {
|
|
255
|
+
console.log('观察businessid', val)
|
|
256
|
+
this.headers.businessid = this.businessid
|
|
257
|
+
this.load(this)
|
|
268
258
|
}
|
|
269
259
|
},
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
260
|
+
'useType' () {
|
|
261
|
+
this.headers.fusetype = this.useType[0] ? this.useType[0] : ''
|
|
262
|
+
},
|
|
263
|
+
'defname' () {
|
|
264
|
+
this.headers.defname = this.defname
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
computed: {
|
|
268
|
+
foptions () {
|
|
269
|
+
let default_type = ['档案信息', '发卡售气', '卡表收费', '物联网表收费',
|
|
270
|
+
'机表收费', '表具停用', '表具启用', '换表&清零', '其他补气', '补气购气',
|
|
271
|
+
'预存收费', '调价补差', '黑名单', '补卡', '限购', '销户', '过户']
|
|
272
|
+
return !this.$appdata.getParam('附件使用类型') || !this.$appdata.getParam('附件使用类型').length
|
|
273
|
+
? default_type.map((item) => {
|
|
277
274
|
return {label: item, value: item}
|
|
278
275
|
}) : this.$appdata.getParam('附件使用类型')
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
events: {
|
|
279
|
+
onFileUpload: function (file, res) {
|
|
280
|
+
console.log('上传完毕', res)
|
|
281
|
+
this.$dispatch('resid', res.id)
|
|
282
|
+
this.headers.fremarks = ''
|
|
283
|
+
this.close()
|
|
288
284
|
}
|
|
289
285
|
}
|
|
286
|
+
}
|
|
290
287
|
</script>
|
|
291
288
|
<style scoped>
|
|
292
289
|
|
|
@@ -60,227 +60,224 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
<script>
|
|
62
62
|
import { HttpResetClass } from 'vue-client'
|
|
63
|
-
//import HttpResetClass from '../plugins/HttpResetClass'
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
// import HttpResetClass from '../plugins/HttpResetClass'
|
|
64
|
+
import Vue from 'vue'
|
|
65
|
+
|
|
66
|
+
export default {
|
|
67
|
+
title: '附件',
|
|
68
|
+
props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'fusetype', 'cols', 'width', 'height', 'deleteimg'],
|
|
69
|
+
data () {
|
|
70
|
+
return {
|
|
71
|
+
isDelete: '0', // 删除按钮,可以进行控制(权限等)
|
|
72
|
+
delimg: true, // 删除按钮,可以进行控制(权限等)
|
|
73
|
+
fileInfoData: [], // 数据库存储的文件记录对象数组
|
|
74
|
+
headers: {'username': this.$login.f.name, 'blodid': '', 'businessid': '', 'fremarks': '', 'defname': '', 'fusetype': this.fusetype ? this.fusetype : ''}, // 调用rs/file/uploadFile 的参数
|
|
75
|
+
showUpload: false, // 上传模态框控制
|
|
76
|
+
showhighmeter: false, // 高拍仪组件控制
|
|
77
|
+
useType: '', // 使用类型
|
|
78
|
+
fileRemark: '', // 文件说明
|
|
79
|
+
rotating: this.$appdata.getSingleValue('图片附加功能') // 文件是否旋转
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
methods: {
|
|
83
|
+
confirmIdCard (IdCardInfo) {
|
|
84
|
+
this.showhighmeter = !this.showhighmeter
|
|
85
|
+
console.log(IdCardInfo)
|
|
86
|
+
if (IdCardInfo && IdCardInfo.strID) {
|
|
87
|
+
this.$emit('confirminfo', IdCardInfo)
|
|
80
88
|
}
|
|
81
89
|
},
|
|
82
|
-
methods: {
|
|
83
|
-
confirmIdCard (IdCardInfo) {
|
|
84
|
-
this.showhighmeter = !this.showhighmeter
|
|
85
|
-
console.log(IdCardInfo)
|
|
86
|
-
if(IdCardInfo && IdCardInfo.strID){
|
|
87
|
-
this.$emit('confirminfo', IdCardInfo)
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
90
|
// 查询按钮事件
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var link = document.createElement('a');
|
|
91
|
+
delet (index, row) {
|
|
92
|
+
this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
|
|
93
|
+
this.$dispatch('delResid', row.id)
|
|
94
|
+
this.fileInfoData.splice(index, 1)
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
downloadfile (filepath) {
|
|
98
|
+
var link = document.createElement('a')
|
|
100
99
|
// let pathName = "http://" + location.host + filepath;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return theRequest;
|
|
116
|
-
},
|
|
117
|
-
upload() {
|
|
118
|
-
|
|
119
|
-
if(this.showhighmeter){
|
|
120
|
-
console.log(this,'测试')
|
|
121
|
-
this.$refs.ltgao.closeVideo()
|
|
122
|
-
}
|
|
123
|
-
console.log('测试1')
|
|
124
|
-
this.showhighmeter = !this.showhighmeter
|
|
125
|
-
},
|
|
126
|
-
async load(self) {
|
|
127
|
-
let condition=''
|
|
128
|
-
if(this.businessid){
|
|
129
|
-
condition = `f_businessid= '${self.headers.businessid}' `
|
|
130
|
-
}else{
|
|
131
|
-
condition = `f_blobid= '${self.headers.blodid}' `
|
|
132
|
-
}
|
|
133
|
-
if(this.fusetype){
|
|
134
|
-
condition += ` and fusetype like '%${this.fusetype}%'`
|
|
135
|
-
}
|
|
136
|
-
var http = new HttpResetClass()
|
|
137
|
-
let data = {
|
|
138
|
-
condition: condition
|
|
139
|
-
}
|
|
140
|
-
let getFile = []
|
|
141
|
-
try {
|
|
142
|
-
getFile = await http.load('POST', 'rs/sql/getFiles', {data: data}, {
|
|
143
|
-
warnMsg: null,
|
|
144
|
-
resolveMsg: null
|
|
145
|
-
})
|
|
146
|
-
} catch (e) {
|
|
147
|
-
console.log(e)
|
|
100
|
+
link.href = filepath
|
|
101
|
+
link.target = '_blank'
|
|
102
|
+
link.dispatchEvent(new MouseEvent('click'))
|
|
103
|
+
},
|
|
104
|
+
GetRequest () {
|
|
105
|
+
var url = location.search
|
|
106
|
+
var theRequest = new Object()
|
|
107
|
+
if (url.indexOf('?') != -1) {
|
|
108
|
+
var str = url.substr(1)
|
|
109
|
+
let strs = str.split('&')
|
|
110
|
+
for (var i = 0; i < strs.length; i++) {
|
|
111
|
+
theRequest[strs[i].split('=')[0]] = decodeURIComponent(strs[i].split('=')[1])
|
|
148
112
|
}
|
|
149
|
-
|
|
113
|
+
}
|
|
114
|
+
return theRequest
|
|
115
|
+
},
|
|
116
|
+
upload () {
|
|
117
|
+
if (this.showhighmeter) {
|
|
118
|
+
console.log(this, '测试')
|
|
119
|
+
this.$refs.ltgao.closeVideo()
|
|
120
|
+
}
|
|
121
|
+
console.log('测试1')
|
|
122
|
+
this.showhighmeter = !this.showhighmeter
|
|
123
|
+
},
|
|
124
|
+
async load (self) {
|
|
125
|
+
let condition = ''
|
|
126
|
+
if (this.businessid) {
|
|
127
|
+
condition = `f_businessid= '${self.headers.businessid}' `
|
|
128
|
+
} else {
|
|
129
|
+
condition = `f_blobid= '${self.headers.blodid}' `
|
|
130
|
+
}
|
|
131
|
+
if (this.fusetype) {
|
|
132
|
+
condition += ` and fusetype like '%${this.fusetype}%'`
|
|
133
|
+
}
|
|
134
|
+
var http = new HttpResetClass()
|
|
135
|
+
let data = {
|
|
136
|
+
condition: condition
|
|
137
|
+
}
|
|
138
|
+
let getFile = []
|
|
139
|
+
try {
|
|
140
|
+
getFile = await http.load('POST', 'rs/sql/getFiles', {data: data}, {
|
|
141
|
+
warnMsg: null,
|
|
142
|
+
resolveMsg: null
|
|
143
|
+
})
|
|
144
|
+
} catch (e) {
|
|
145
|
+
console.log(e)
|
|
146
|
+
}
|
|
147
|
+
for (var i = 0; i < getFile.data.length; i++) {
|
|
150
148
|
// 如果使用类型包含导入字样,则是execl文件导入的,不做显示
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
let temp = getFile.data[i].f_downloadpath
|
|
157
|
-
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
158
|
-
var xy=this.$appdata.getSingleValue('协议')?this.$appdata.getSingleValue('协议'):"http://"
|
|
159
|
-
getFile.data[i].f_downloadURL = xy+ location.host + "/" + URL
|
|
149
|
+
if (getFile.data[i].fusetype && (getFile.data[i].fusetype.includes('execl导入'))) {
|
|
150
|
+
getFile.data.splice(i, 1)
|
|
151
|
+
i--
|
|
152
|
+
continue
|
|
160
153
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
let temp = getFile.data[i].f_downloadpath
|
|
155
|
+
let URL = temp.substring(temp.lastIndexOf(':\\') + 2)
|
|
156
|
+
var xy = this.$appdata.getSingleValue('协议') ? this.$appdata.getSingleValue('协议') : 'http://'
|
|
157
|
+
getFile.data[i].f_downloadURL = xy + location.host + '/' + URL
|
|
158
|
+
}
|
|
159
|
+
self.fileInfoData = []
|
|
160
|
+
self.fileInfoData = getFile.data
|
|
161
|
+
},
|
|
164
162
|
// 数据库时间格式化
|
|
165
|
-
|
|
166
|
-
//20180914151603 : 2018-09-14 15:16:03
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
},
|
|
163
|
+
formatdate (val) {
|
|
164
|
+
// 20180914151603 : 2018-09-14 15:16:03
|
|
165
|
+
if (val.length != 14) { return }
|
|
166
|
+
let year = val.substr(0, 4)
|
|
167
|
+
let month = val.substr(4, 2)
|
|
168
|
+
let day = val.substr(6, 2)
|
|
169
|
+
let hour = val.substr(8, 2)
|
|
170
|
+
let min = val.substr(10, 2)
|
|
171
|
+
let second = val.substr(12, 2)
|
|
172
|
+
return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + second
|
|
173
|
+
},
|
|
177
174
|
// 打开文件上传对话框
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
fileUpload () {
|
|
176
|
+
this.showUpload = true
|
|
177
|
+
},
|
|
181
178
|
// 关闭文件上传对话框
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
close () {
|
|
180
|
+
this.showUpload = false
|
|
184
181
|
// 将选的文件清空
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
182
|
+
this.$refs.file.$el.querySelector('input').value = ''
|
|
183
|
+
this.load(this)
|
|
184
|
+
},
|
|
185
|
+
convertBase64ToBlob (base64String) {
|
|
189
186
|
// 将base64解码
|
|
190
|
-
|
|
191
|
-
//var bytes = base64;
|
|
192
|
-
|
|
187
|
+
var bytes = atob(base64String)
|
|
188
|
+
// var bytes = base64;
|
|
189
|
+
var bytesCode = new ArrayBuffer(bytes.length)
|
|
193
190
|
// 转换为类型化数组
|
|
194
|
-
|
|
191
|
+
var byteArray = new Uint8Array(bytesCode)
|
|
195
192
|
|
|
196
193
|
// 将base64转换为ascii码
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
// 生成Blob对象(文件对象)
|
|
201
|
-
return new Blob([bytesCode], {type: 'image/jpeg'});
|
|
202
|
-
},
|
|
203
|
-
newPhoto(Imgbase64) {
|
|
204
|
-
let form = new FormData()
|
|
205
|
-
let xhr = new XMLHttpRequest()
|
|
206
|
-
let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
|
|
207
|
-
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
208
|
-
form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
|
|
209
|
-
xhr.open("POST", "rs/file/uploadFile")
|
|
210
|
-
|
|
211
|
-
if (this.headers) {
|
|
212
|
-
for (var header in this.headers) {
|
|
213
|
-
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
if (Vue.$login && Vue.$login.jwt) {
|
|
217
|
-
xhr.setRequestHeader('Authorization', 'Bearer ' + Vue.$login.jwtNew)
|
|
218
|
-
xhr.setRequestHeader('Token', Vue.$login.jwt)
|
|
219
|
-
}
|
|
220
|
-
xhr.send(form)
|
|
221
|
-
setTimeout(() => {
|
|
222
|
-
this.load(this)
|
|
223
|
-
}, 5000)
|
|
194
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
195
|
+
byteArray[i] = bytes.charCodeAt(i)
|
|
224
196
|
}
|
|
197
|
+
// 生成Blob对象(文件对象)
|
|
198
|
+
return new Blob([bytesCode], {type: 'image/jpeg'})
|
|
225
199
|
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
200
|
+
newPhoto (Imgbase64) {
|
|
201
|
+
let form = new FormData()
|
|
202
|
+
let xhr = new XMLHttpRequest()
|
|
203
|
+
let formDataBoundary = '----WebkitFormBoundary' + 'GaoPaiYi'
|
|
204
|
+
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
205
|
+
form.append('file', this.convertBase64ToBlob(Imgbase64), 'GaoPaiYi.jpg')
|
|
206
|
+
xhr.open('POST', 'rs/file/uploadFile')
|
|
207
|
+
|
|
208
|
+
if (this.headers) {
|
|
209
|
+
for (var header in this.headers) {
|
|
210
|
+
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
211
|
+
}
|
|
230
212
|
}
|
|
231
|
-
if (
|
|
232
|
-
|
|
213
|
+
if (Vue.$login && Vue.$login.jwt) {
|
|
214
|
+
xhr.setRequestHeader('Authorization', 'Bearer ' + Vue.$login.jwtNew)
|
|
215
|
+
xhr.setRequestHeader('Token', Vue.$login.jwt)
|
|
233
216
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
217
|
+
xhr.send(form)
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
this.load(this)
|
|
220
|
+
}, 5000)
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
ready () {
|
|
224
|
+
if (this.$login.r.find(value => value == '上传附件删除')) {
|
|
225
|
+
// 有删除权限
|
|
226
|
+
this.isDelete = '1'
|
|
227
|
+
}
|
|
228
|
+
if (this.deleteimg) {
|
|
229
|
+
this.delimg = false
|
|
230
|
+
}
|
|
231
|
+
this.headers.blodid = this.blodid
|
|
232
|
+
this.headers.businessid = this.businessid
|
|
233
|
+
console.log('123222', this.businessid)
|
|
234
|
+
if (this.blodid || this.businessid) {
|
|
235
|
+
this.load(this)
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
watch: {
|
|
239
|
+
'blodid' (val) {
|
|
240
|
+
if (val) {
|
|
241
|
+
console.log('观察blodid', val)
|
|
242
|
+
this.headers.blodid = this.blodid
|
|
238
243
|
this.load(this)
|
|
239
244
|
}
|
|
240
245
|
},
|
|
241
|
-
|
|
242
|
-
'
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
'businessid'(val) {
|
|
250
|
-
console.log('观察businessid')
|
|
251
|
-
if (val) {
|
|
252
|
-
console.log('观察businessid', val)
|
|
253
|
-
this.headers.businessid = this.businessid
|
|
254
|
-
this.load(this)
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
'useType'() {
|
|
258
|
-
this.headers.fusetype = this.useType[0] ? this.useType[0] : ''
|
|
259
|
-
},
|
|
260
|
-
'defname'() {
|
|
261
|
-
this.headers.defname=this.defname
|
|
246
|
+
'businessid' (val) {
|
|
247
|
+
console.log('观察businessid')
|
|
248
|
+
if (val) {
|
|
249
|
+
console.log('观察businessid', val)
|
|
250
|
+
this.headers.businessid = this.businessid
|
|
251
|
+
this.load(this)
|
|
262
252
|
}
|
|
263
253
|
},
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
254
|
+
'useType' () {
|
|
255
|
+
this.headers.fusetype = this.useType[0] ? this.useType[0] : ''
|
|
256
|
+
},
|
|
257
|
+
'defname' () {
|
|
258
|
+
this.headers.defname = this.defname
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
computed: {
|
|
262
|
+
foptions () {
|
|
263
|
+
let default_type = ['档案信息', '发卡售气', '卡表收费', '物联网表收费',
|
|
264
|
+
'机表收费', '表具停用', '表具启用', '换表&清零', '其他补气', '补气购气',
|
|
265
|
+
'预存收费', '调价补差', '黑名单', '补卡', '限购', '销户', '过户']
|
|
266
|
+
return !this.$appdata.getParam('附件使用类型') || !this.$appdata.getParam('附件使用类型').length
|
|
267
|
+
? default_type.map((item) => {
|
|
271
268
|
return {label: item, value: item}
|
|
272
269
|
}) : this.$appdata.getParam('附件使用类型')
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
events: {
|
|
273
|
+
onFileUpload: function (file, res) {
|
|
274
|
+
console.log('上传完毕', res)
|
|
275
|
+
this.$dispatch('resid', res.id)
|
|
276
|
+
this.headers.fremarks = ''
|
|
277
|
+
this.close()
|
|
282
278
|
}
|
|
283
279
|
}
|
|
280
|
+
}
|
|
284
281
|
</script>
|
|
285
282
|
<style scoped>
|
|
286
283
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|