维修作业
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar title="设备维修执行"></nav-bar>
|
||||
<nav-bar title="设备维修作业"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="filter_item">
|
||||
@@ -10,6 +10,8 @@
|
||||
<view class="filter_input_wraper">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
:focused="true"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -27,11 +29,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.device_code === pkId}">
|
||||
<td>{{e.repair_code}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.status_name}}</td>
|
||||
<td>{{e.invstatus_name}}</td>
|
||||
<td>{{e.plan_start_date}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -40,10 +42,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1">开始维修</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" @tap="toJump">填报</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2">委外维修</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled3" @tap="toSure3">结束维修</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled" @tap="toSure1">开始维修</button>
|
||||
<button class="submit-button" :class="{'btn-disabled': !pkId}" @tap="toJump">结束维修</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -51,7 +51,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
|
||||
import {deviceRepairGetAllQuery, deviceRepairBegin} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -63,32 +63,47 @@
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
/** 下拉框查询 */
|
||||
async _statusList () {
|
||||
let res = await statusList()
|
||||
this.options = [...res.data]
|
||||
handleChange (e) {
|
||||
this._deviceRepairGetAllQuery(e)
|
||||
},
|
||||
/** 确认 */
|
||||
async _confirmInstor () {
|
||||
/** grid查询 */
|
||||
async _deviceRepairGetAllQuery (e) {
|
||||
let res = await deviceRepairGetAllQuery(e)
|
||||
res.data.map(el => {
|
||||
if(el.invstatus === '01') {
|
||||
this.$set(el, 'invstatus_name', '生成')
|
||||
}
|
||||
if(el.invstatus === '02') {
|
||||
this.$set(el, 'invstatus_name', '提交')
|
||||
}
|
||||
if(el.invstatus === '03') {
|
||||
this.$set(el, 'invstatus_name', '维修开始')
|
||||
}
|
||||
if(el.invstatus === '06') {
|
||||
this.$set(el, 'invstatus_name', '维修结束')
|
||||
}
|
||||
if(el.invstatus === '99') {
|
||||
this.$set(el, 'invstatus_name', '审核完毕')
|
||||
}
|
||||
})
|
||||
this.dataList = [...res.data]
|
||||
},
|
||||
async toSure1 () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.pkId || !this.index) {
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmInstor(this.pkObj, this.val1, this.index)
|
||||
let res = await deviceRepairBegin(this.pkObj)
|
||||
this.disabled = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.searchList()
|
||||
this._deviceRepairGetAllQuery(this.val1)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -98,14 +113,14 @@
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.repair_id ? '' : e.repair_id
|
||||
this.pkObj = this.pkId === e.repair_id ? e : {}
|
||||
this.pkId = this.pkId === e.device_code ? '' : e.device_code
|
||||
this.pkObj = this.pkId === e.device_code ? e : {}
|
||||
},
|
||||
toJump () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateTo({
|
||||
url: '/pages/modules/MaintainResultFill'
|
||||
url: '/pages/device/RepairFill'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user