|
@@ -50,6 +50,20 @@
|
50
|
50
|
<cube-switch v-if="index%2==1" v-model="param[item.key]" :class="{'abnormal':param[item.key]}" :data-label="forms[index-1].templateOptions.placeholder" ></cube-switch>
|
51
|
51
|
</p>
|
52
|
52
|
</div>
|
|
53
|
+ <div class="label formLabel">
|
|
54
|
+ 图片上传
|
|
55
|
+ <span>(最多可上传3张JPG或PNG,每张不能超过10M)</span>
|
|
56
|
+ </div>
|
|
57
|
+ <div class="uplod">
|
|
58
|
+ <cube-upload
|
|
59
|
+ ref="upload"
|
|
60
|
+ :max="3"
|
|
61
|
+ :action="action"
|
|
62
|
+ :simultaneous-uploads="3"
|
|
63
|
+ @files-added="filesAdded"
|
|
64
|
+ @file-submitted="fileSubmitted"
|
|
65
|
+ />
|
|
66
|
+ </div>
|
53
|
67
|
<div class="btns">
|
54
|
68
|
<div class="btn" @click="createIncident()">生成事件</div>
|
55
|
69
|
<div class="btn submit" @click="submit()">提交</div>
|
|
@@ -61,6 +75,11 @@
|
61
|
75
|
export default {
|
62
|
76
|
data() {
|
63
|
77
|
return {
|
|
78
|
+ action: {
|
|
79
|
+ target:
|
|
80
|
+ this.$host + "/service/common/common/uploadAttachment/inspection/",
|
|
81
|
+ data: {}
|
|
82
|
+ },
|
64
|
83
|
loginUser: JSON.parse(localStorage.getItem("loginUser")),
|
65
|
84
|
valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
|
66
|
85
|
baseInfo: {}, //巡检基础信息
|
|
@@ -76,6 +95,26 @@ export default {
|
76
|
95
|
};
|
77
|
96
|
},
|
78
|
97
|
methods: {
|
|
98
|
+ fileSubmitted(files) {
|
|
99
|
+ this.action.data = { fileName: files.name };
|
|
100
|
+ },
|
|
101
|
+ filesAdded(files) {
|
|
102
|
+ let hasIgnore = false;
|
|
103
|
+ const maxSize = 10 * 1024 * 1024; // 10M
|
|
104
|
+ for (let k in files) {
|
|
105
|
+ const file = files[k];
|
|
106
|
+ if (file.size > maxSize) {
|
|
107
|
+ file.ignore = true;
|
|
108
|
+ hasIgnore = true;
|
|
109
|
+ }
|
|
110
|
+ }
|
|
111
|
+ hasIgnore &&
|
|
112
|
+ this.$createToast({
|
|
113
|
+ type: "warn",
|
|
114
|
+ time: 1000,
|
|
115
|
+ txt: "不能上传超过10M的文件"
|
|
116
|
+ }).show();
|
|
117
|
+ },
|
79
|
118
|
// 获取项目异常状态
|
80
|
119
|
getItems() {
|
81
|
120
|
var that = this;
|
|
@@ -138,6 +177,10 @@ export default {
|
138
|
177
|
.then(function(res) {
|
139
|
178
|
console.log(res.data);
|
140
|
179
|
if (res.data.status == 200) {
|
|
180
|
+ that.action.target = that.action.target + that.param.inspectionProcessActual.processInstanceId;
|
|
181
|
+ setTimeout(function() {
|
|
182
|
+ that.$refs.upload.start();
|
|
183
|
+ }, 100);
|
141
|
184
|
$("#fade").fadeIn();
|
142
|
185
|
that.promptingConent = "恭喜您,提交成功!";
|
143
|
186
|
that.promptingStatus = true;
|
|
@@ -176,11 +219,18 @@ export default {
|
176
|
219
|
this.forms=JSON.parse( window.localStorage.getItem('forms'))||[];
|
177
|
220
|
this.title = this.baseInfo.inspectionType.type;
|
178
|
221
|
this.getItems();
|
|
222
|
+ },
|
|
223
|
+ mounted(){
|
|
224
|
+ this.$refs.upload.pause();
|
179
|
225
|
}
|
180
|
226
|
};
|
181
|
227
|
</script>
|
182
|
228
|
<style lang="less" scoped>
|
183
|
229
|
.inspedtionDetail {
|
|
230
|
+ .uplod {
|
|
231
|
+ padding: 0.24rem;
|
|
232
|
+ border-bottom: 0.02rem solid rgb(245, 245, 245);
|
|
233
|
+ }
|
184
|
234
|
.label {
|
185
|
235
|
background-color: #eee;
|
186
|
236
|
height: 0.6rem;
|
|
@@ -245,17 +295,18 @@ export default {
|
245
|
295
|
justify-content: space-between;
|
246
|
296
|
align-items: center;
|
247
|
297
|
padding: 0.24rem;
|
|
298
|
+ display: flex;
|
248
|
299
|
.btn {
|
249
|
300
|
border: 0.01rem solid #005395;
|
250
|
301
|
color: #005395;
|
251
|
302
|
background-color: #fff;
|
252
|
|
- width: 1.8rem;
|
|
303
|
+ flex: 1;
|
|
304
|
+ margin: 0 0.1rem;
|
253
|
305
|
height: 0.88rem;
|
254
|
306
|
line-height: 0.88rem;
|
255
|
307
|
text-align: center;
|
256
|
308
|
border-radius: 0.1rem;
|
257
|
309
|
&.submit {
|
258
|
|
- width: 3.06rem;
|
259
|
310
|
background-color: #005395;
|
260
|
311
|
color: #fff;
|
261
|
312
|
}
|