设备维修
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
label="设备"
|
||||
v-model="val1"
|
||||
@handleChange="handleChange1"
|
||||
:seaShow="false"
|
||||
></search-box>
|
||||
</div>
|
||||
<div class="grid-wraper">
|
||||
@@ -15,8 +16,8 @@
|
||||
<tr>
|
||||
<th>维修单</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
|
||||
<td @click="toPage(e)">{{e.repair_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -28,19 +29,19 @@
|
||||
<th>状态</th>
|
||||
<th>维修日期</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<td>{{e.plan_start_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button">通过</button>
|
||||
<button class="btn submit-button">不通过</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">通过</button>
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">不通过</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
@@ -48,6 +49,7 @@
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import { queryRepairs, repairOpeate } from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'EquipRepairConfirm',
|
||||
components: {
|
||||
@@ -59,18 +61,75 @@ export default {
|
||||
val1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
beforeRouteLeave (to, from, next) {
|
||||
if (to.path === '/home' || to.path === '/login') {
|
||||
this.$store.dispatch('setKeepAlive', [])
|
||||
}
|
||||
next()
|
||||
},
|
||||
activated () {},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
console.log(e)
|
||||
this._queryRepairs(e)
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
|
||||
this.pkObj = this.pkId === e.worktask_id ? e : {}
|
||||
this.pkId = this.pkId === e.repair_id ? '' : e.repair_id
|
||||
this.pkObj = this.pkId === e.repair_id ? e : {}
|
||||
},
|
||||
/** 设备查询 */
|
||||
async _queryRepairs (e) {
|
||||
let res = await queryRepairs(e, '2')
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.content.rows]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _repairOpeate (type) {
|
||||
try {
|
||||
let res = await repairOpeate(this.pkObj, type)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
this.disabled3 = false
|
||||
}
|
||||
},
|
||||
toSure1 () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._repairOpeate('4')
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
this._repairOpeate('5')
|
||||
},
|
||||
toPage (e) {
|
||||
this.$store.dispatch('materObj', e)
|
||||
this.$router.push({
|
||||
path: '/MaintainDetails'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user