保养
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.maint_item_code === pkId}">
|
<tr v-for="(e, i) in dataList" :key="i">
|
||||||
<td>{{e.indexId}}</td>
|
<td>{{e.indexId}}</td>
|
||||||
<td>
|
<td>
|
||||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="dataList.length === 0">确认</button>
|
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="_sportcheckconfirm">确认</button>
|
||||||
<button class="submit-button" @tap="toCancle">取消</button>
|
<button class="submit-button" @tap="toCancle">取消</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
|
import {sportcheckgetDtl, sportcheckconfirm} from '@/utils/getData1.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -67,35 +67,42 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
val1: '',
|
options: [{text: '否', value: '0'}, {text: '是', value: '1'}],
|
||||||
val2: '',
|
index: '',
|
||||||
|
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
|
||||||
|
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
|
||||||
pkObj: {},
|
|
||||||
disabled: false
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this._sportcheckgetDtl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 下拉框查询 */
|
selectChange (e) {
|
||||||
async _statusList () {
|
this.index = e
|
||||||
let res = await statusList()
|
},
|
||||||
this.options = [...res.data]
|
/** grid查询 */
|
||||||
|
async _sportcheckgetDtl () {
|
||||||
|
let res = await sportcheckgetDtl(this.val1, this.val2, this.$store.getters.publicObj.maint_id)
|
||||||
|
this.dataList = [...res.data]
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _confirmInstor () {
|
async _sportcheckconfirm () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || !this.pkId || !this.index) {
|
if (!this.val1 || !this.val2 || !this.dataList.length) {
|
||||||
|
this.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.dataList.every(item=>item.isfinish === '1')) {
|
||||||
|
// console.log('true')
|
||||||
|
} else {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await confirmInstor(this.pkObj, this.val1, this.index)
|
let res = await sportcheckconfirm(this.val1, this.val2, this.dataList)
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.searchList()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -104,10 +111,6 @@
|
|||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toCheck (e) {
|
|
||||||
this.pkId = this.pkId === e.maint_item_code ? '' : e.maint_item_code
|
|
||||||
this.pkObj = this.pkId === e.maint_item_code ? e : {}
|
|
||||||
},
|
|
||||||
toCancle () {
|
toCancle () {
|
||||||
this.$store.dispatch('setPublicObj', '')
|
this.$store.dispatch('setPublicObj', '')
|
||||||
this.goIn()
|
this.goIn()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.maint_item_code === pkId}">
|
<tr v-for="(e, i) in dataList" :key="i">
|
||||||
<td>{{e.indexId}}</td>
|
<td>{{e.indexId}}</td>
|
||||||
<td>
|
<td>
|
||||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="dataList.length === 0">确认</button>
|
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="_lubricateconfirm">确认</button>
|
||||||
<button class="submit-button" @tap="toCancle">取消</button>
|
<button class="submit-button" @tap="toCancle">取消</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
|
import {lubricategetDtl, lubricateconfirm} from '@/utils/getData1.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -67,35 +67,42 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
val1: '',
|
options: [{text: '否', value: '0'}, {text: '是', value: '1'}],
|
||||||
val2: '',
|
index: '',
|
||||||
|
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
|
||||||
|
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
|
||||||
pkObj: {},
|
|
||||||
disabled: false
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this._lubricategetDtl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 下拉框查询 */
|
selectChange (e) {
|
||||||
async _statusList () {
|
this.index = e
|
||||||
let res = await statusList()
|
},
|
||||||
this.options = [...res.data]
|
/** grid查询 */
|
||||||
|
async _lubricategetDtl () {
|
||||||
|
let res = await lubricategetDtl(this.val1, this.val2, this.$store.getters.publicObj.maint_id)
|
||||||
|
this.dataList = [...res.data]
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _confirmInstor () {
|
async _lubricateconfirm () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || !this.pkId || !this.index) {
|
if (!this.val1 || !this.val2 || !this.dataList.length) {
|
||||||
|
this.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.dataList.every(item=>item.isfinish === '1')) {
|
||||||
|
// console.log('true')
|
||||||
|
} else {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await confirmInstor(this.pkObj, this.val1, this.index)
|
let res = await lubricateconfirm(this.val1, this.val2, this.dataList)
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.searchList()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -104,10 +111,6 @@
|
|||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toCheck (e) {
|
|
||||||
this.pkId = this.pkId === e.maint_item_code ? '' : e.maint_item_code
|
|
||||||
this.pkObj = this.pkId === e.maint_item_code ? e : {}
|
|
||||||
},
|
|
||||||
toCancle () {
|
toCancle () {
|
||||||
this.$store.dispatch('setPublicObj', '')
|
this.$store.dispatch('setPublicObj', '')
|
||||||
this.goIn()
|
this.goIn()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.maint_item_code === pkId}">
|
<tr v-for="(e, i) in dataList" :key="i">
|
||||||
<td>{{e.indexId}}</td>
|
<td>{{e.indexId}}</td>
|
||||||
<td>
|
<td>
|
||||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="dataList.length === 0">确认</button>
|
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled" @tap="_upkeepconfirm">确认</button>
|
||||||
<button class="submit-button" @tap="toCancle">取消</button>
|
<button class="submit-button" @tap="toCancle">取消</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
|
import {upkeepgetDtl, upkeepconfirm} from '@/utils/getData1.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -67,35 +67,42 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
val1: '',
|
options: [{text: '否', value: '0'}, {text: '是', value: '1'}],
|
||||||
val2: '',
|
index: '',
|
||||||
|
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
|
||||||
|
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pkId: '',
|
|
||||||
pkObj: {},
|
|
||||||
disabled: false
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this._upkeepgetDtl()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 下拉框查询 */
|
selectChange (e) {
|
||||||
async _statusList () {
|
this.index = e
|
||||||
let res = await statusList()
|
},
|
||||||
this.options = [...res.data]
|
/** grid查询 */
|
||||||
|
async _upkeepgetDtl () {
|
||||||
|
let res = await upkeepgetDtl(this.val1, this.val2, this.$store.getters.publicObj.maint_id)
|
||||||
|
this.dataList = [...res.data]
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _confirmInstor () {
|
async _upkeepconfirm () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || !this.pkId || !this.index) {
|
if (!this.val1 || !this.val2 || !this.dataList.length) {
|
||||||
|
this.disabled = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.dataList.every(item=>item.isfinish === '1')) {
|
||||||
|
// console.log('true')
|
||||||
|
} else {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await confirmInstor(this.pkObj, this.val1, this.index)
|
let res = await upkeepconfirm(this.val1, this.val2, this.dataList)
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.searchList()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -104,10 +111,6 @@
|
|||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toCheck (e) {
|
|
||||||
this.pkId = this.pkId === e.maint_item_code ? '' : e.maint_item_code
|
|
||||||
this.pkObj = this.pkId === e.maint_item_code ? e : {}
|
|
||||||
},
|
|
||||||
toCancle () {
|
toCancle () {
|
||||||
this.$store.dispatch('setPublicObj', '')
|
this.$store.dispatch('setPublicObj', '')
|
||||||
this.goIn()
|
this.goIn()
|
||||||
|
|||||||
Reference in New Issue
Block a user