上传多张照片

This commit is contained in:
2022-07-04 16:24:50 +08:00
parent 45f105ca67
commit f13e6d6c9a
6 changed files with 56 additions and 117 deletions

View File

@@ -1,6 +1,6 @@
<template>
<section>
<nav-bar :inner="true" title="设备报修"></nav-bar>
<nav-bar title="设备报修"></nav-bar>
<section class="content mgt186">
<div class="filter-wraper">
<search-box
@@ -62,7 +62,7 @@
<th>图片编号</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.workorder_code}}</td>
<td>{{e.photo}}</td>
</tr>
</table>
</div>
@@ -93,15 +93,14 @@ export default {
val2: '',
val3: '',
dataList: [],
pkId: '',
pkObj: {},
option1: [],
active1: '',
open1: false,
option2: [],
active2: '',
open2: false,
disabled1: false
disabled1: false,
formData: new FormData()
}
},
beforeRouteLeave (to, from, next) {
@@ -110,7 +109,14 @@ export default {
}
next()
},
activated () {},
activated () {
if (this.$store.getters.receivePlateArr.length) {
this.dataList = this.$store.getters.receivePlateArr
this.dataList.map(el => {
this.formData.append('file', el.file)
})
}
},
created () {
this._errorType()
this._errorLevel()
@@ -144,7 +150,15 @@ export default {
try {
let type = this.active1 !== '' ? this.option1[this.active1].value : ''
let level = this.active2 !== '' ? this.option2[this.active2].value : ''
let res = await repairs(this.val1, type, this.val2, level)
this.formData.append('device_code', this.val1)
this.formData.append('device_faultclass_id', type)
this.formData.append('fault_desc', this.val2)
this.formData.append('fault_level', level)
let data = {
'formData': this.formData,
'flag': true
}
let res = await repairs(data)
if (res.code === '1') {
this.toast(res.desc)
Object.assign(this.$data, this.$options.data())
@@ -164,10 +178,6 @@ export default {
query: {url: 'EquipRepair'}
})
},
toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
this.pkObj = this.pkId === e.worktask_id ? e : {}
},
toggleItem1 () {
if (!this.open1) {
this.open1 = true

View File

@@ -7,7 +7,6 @@
label="设备"
v-model="val1"
@handleChange="handleChange1"
:seaShow="false"
></search-box>
</div>
<div class="grid-wraper">

View File

@@ -72,9 +72,7 @@ export default {
}
next()
},
activated () {
this._queryMaintenance(this.val1)
},
activated () {},
methods: {
handleChange1 (e, type) {
if (type) {
@@ -88,8 +86,8 @@ export default {
/** 设备查询 */
async _queryMaintenance (e) {
let res = await queryMaintenance(e, '1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
if (res.code === '1' && res.rows !== null) {
this.dataList = [...res.rows]
} else {
this.Dialog(res.desc)
}