This commit is contained in:
2023-10-12 11:24:33 +08:00
parent 40b946dde4
commit 8c9bf09057
3 changed files with 62 additions and 19 deletions

View File

@@ -47,7 +47,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import {queryInstraction, instOperation} from '@/utils/getData2.js'
import {insts, inst} from '@/utils/getData1.js'
export default {
components: {
NavBar
@@ -65,11 +65,11 @@
};
},
created () {
this._queryInstraction(this.keyword, this.startPoint, this.endPoint)
this._insts(this.keyword, this.startPoint, this.endPoint)
},
methods: {
async _queryInstraction () {
let res = await queryInstraction(this.keyword, this.startPoint, this.endPoint)
async _insts () {
let res = await insts(this.keyword, this.startPoint, this.endPoint)
if (res.code === '1') {
this.dataList = [...res.result]
} else {
@@ -79,15 +79,15 @@
})
}
},
async _instOperation (type) {
async _inst (type) {
try {
let res = await instOperation(this.pkId, type)
let res = await inst(type, this.pkId)
if (res.code === '1') {
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
this.pkId = ''
this._queryInstraction()
this._insts()
uni.showToast({
title: res.desc,
icon: 'none'
@@ -116,7 +116,7 @@
this.disabled1 = false
return
}
this._instOperation(type)
this._inst(type)
},
toSure2 (type) {
this.disabled2 = true
@@ -124,7 +124,7 @@
this.disabled2 = false
return
}
this._instOperation(type)
this._inst(type)
},
toSure3 (type) {
this.disabled3 = true
@@ -132,7 +132,7 @@
this.disabled3 = false
return
}
this._instOperation(type)
this._inst(type)
}
}
}