设备保修

This commit is contained in:
2022-07-07 11:30:05 +08:00
parent cc7e454ffe
commit d78b6e8bf2
3 changed files with 38 additions and 11 deletions

View File

@@ -6,7 +6,7 @@
<search-box
label="设备"
v-model="val1"
:seaShow='false'
@handleChange="handleChange1"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">故障类型</div>
@@ -79,7 +79,7 @@
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {errorType, errorLevel, repairs} from '@config/getData2.js'
import {queryDevice1, errorType, errorLevel, repairs} from '@config/getData2.js'
export default {
name: 'EquipRepair',
components: {
@@ -100,12 +100,14 @@ export default {
active2: '',
open2: false,
disabled1: false,
formData: new FormData()
formData: new FormData(),
devicerecordId: ''
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
this.$store.dispatch('receivePlateArr', [])
}
next()
},
@@ -122,6 +124,26 @@ export default {
this._errorLevel()
},
methods: {
handleChange1 (e, type) {
if (type) {
this._queryDevice1(e)
}
},
/** 查询设备 */
async _queryDevice1 (e) {
let res = await queryDevice1(e)
if (res.code === '1') {
this.devicerecordId = res.content.devicerecordId
this.option1.map((el, i) => {
if (el.value === res.content.material_type_id) {
this.active1 = i + ''
this.val3 = this.option1[i].solutions
}
})
} else {
this.Dialog(res.desc)
}
},
/** 故障类型 */
async _errorType () {
let res = await errorType()
@@ -154,6 +176,7 @@ export default {
this.formData.append('device_faultclass_id', type)
this.formData.append('fault_desc', this.val2)
this.formData.append('fault_level', level)
this.formData.append('devicerecord_id', this.devicerecordId)
let data = {
'formData': this.formData,
'flag': true