This commit is contained in:
2023-09-11 14:11:10 +08:00
parent 9919802536
commit dea7d6bb79
3 changed files with 72 additions and 63 deletions

View File

@@ -34,7 +34,7 @@
</tr>
</thead>
<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>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
@@ -50,7 +50,7 @@
</view>
</view>
<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>
</view>
</view>
@@ -59,7 +59,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
import {sportcheckgetDtl, sportcheckconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -67,35 +67,42 @@
},
data() {
return {
val1: '',
val2: '',
options: [{text: '否', value: '0'}, {text: '', value: '1'}],
index: '',
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false
};
},
created () {
this._sportcheckgetDtl()
},
methods: {
/** 下拉框查询 */
async _statusList () {
let res = await statusList()
this.options = [...res.data]
selectChange (e) {
this.index = e
},
/** 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
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
return
}
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.pkId = ''
this.pkObj = {}
this.searchList()
uni.showToast({
title: res.message,
icon: 'none'
@@ -104,10 +111,6 @@
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 () {
this.$store.dispatch('setPublicObj', '')
this.goIn()

View File

@@ -34,7 +34,7 @@
</tr>
</thead>
<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>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
@@ -50,7 +50,7 @@
</view>
</view>
<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>
</view>
</view>
@@ -59,7 +59,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
import {lubricategetDtl, lubricateconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -67,35 +67,42 @@
},
data() {
return {
val1: '',
val2: '',
options: [{text: '否', value: '0'}, {text: '', value: '1'}],
index: '',
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false
};
},
created () {
this._lubricategetDtl()
},
methods: {
/** 下拉框查询 */
async _statusList () {
let res = await statusList()
this.options = [...res.data]
selectChange (e) {
this.index = e
},
/** 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
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
return
}
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.pkId = ''
this.pkObj = {}
this.searchList()
uni.showToast({
title: res.message,
icon: 'none'
@@ -104,10 +111,6 @@
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 () {
this.$store.dispatch('setPublicObj', '')
this.goIn()

View File

@@ -34,7 +34,7 @@
</tr>
</thead>
<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>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
@@ -50,7 +50,7 @@
</view>
</view>
<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>
</view>
</view>
@@ -59,7 +59,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {coolIOQuery, confirmInstor, statusList} from '@/utils/getData2.js'
import {upkeepgetDtl, upkeepconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -67,35 +67,42 @@
},
data() {
return {
val1: '',
val2: '',
options: [{text: '否', value: '0'}, {text: '', value: '1'}],
index: '',
val1: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.device_code : '',
val2: this.$store.getters.publicObj !== '' ? this.$store.getters.publicObj.maint_code : '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false
};
},
created () {
this._upkeepgetDtl()
},
methods: {
/** 下拉框查询 */
async _statusList () {
let res = await statusList()
this.options = [...res.data]
selectChange (e) {
this.index = e
},
/** 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
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
return
}
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.pkId = ''
this.pkObj = {}
this.searchList()
uni.showToast({
title: res.message,
icon: 'none'
@@ -104,10 +111,6 @@
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 () {
this.$store.dispatch('setPublicObj', '')
this.goIn()