接口返回数据修改
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
|
||||||
<title>yy</title>
|
<title>永裕</title>
|
||||||
<script src="../../common/js/appmui.js"></script>
|
<script src="../../common/js/appmui.js"></script>
|
||||||
<!-- <script src="http://192.168.81.82:8000/CLodopfuncs.js" id='printid'></script> -->
|
<!-- <script src="http://192.168.81.82:8000/CLodopfuncs.js" id='printid'></script> -->
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import {post} from '@config/http.js'
|
import {post} from '@config/http.js'
|
||||||
|
|
||||||
|
// 测试接口返回结果
|
||||||
|
export const test = () => post('test/1', {})
|
||||||
|
|
||||||
// 手持登录
|
// 手持登录
|
||||||
export const loginApi = (user, password) => post('api/pda/handlogin', {
|
export const loginApi = (user, password) => post('api/pda/login', {
|
||||||
user: user,
|
username: user,
|
||||||
password: password
|
password: password
|
||||||
})
|
})
|
||||||
// 手持登陆查询菜单权限
|
// 手持登陆查询菜单权限
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Dialog, toast } from './mUtils.js'
|
import { Dialog } from './mUtils.js'
|
||||||
import store from '../vuex/store'
|
import store from '../vuex/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@@ -30,17 +30,14 @@ axios.interceptors.request.use(
|
|||||||
|
|
||||||
axios.interceptors.response.use(
|
axios.interceptors.response.use(
|
||||||
response => {
|
response => {
|
||||||
if (response.status === 200) {
|
return Promise.resolve(response)
|
||||||
return Promise.resolve(response)
|
|
||||||
} else {
|
|
||||||
return Promise.reject(response)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
if (error && error.response) {
|
if (error && error.response) {
|
||||||
switch (error.response.status) {
|
switch (error.response.status) {
|
||||||
|
case 400:
|
||||||
|
break
|
||||||
case 401:
|
case 401:
|
||||||
toast(error.response.data.message)
|
|
||||||
store.dispatch('setSignOut')
|
store.dispatch('setSignOut')
|
||||||
router.push('/login')
|
router.push('/login')
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<section class="content" style="margin-bottom: 0">
|
<section class="content" style="margin-bottom: 0">
|
||||||
<div class="userInfo">
|
<div class="userInfo">
|
||||||
<div class="fxcol">
|
<div class="fxcol">
|
||||||
<p class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).nick_name : ''}}</p>
|
<p class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).nickName : ''}}</p>
|
||||||
<p class="p2">欢迎进入永裕手持系统!</p>
|
<p class="p2">欢迎进入永裕手持系统!</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="exit" @click="Quit">
|
<div class="exit" @click="Quit">
|
||||||
@@ -70,11 +70,7 @@ export default {
|
|||||||
async _authority () {
|
async _authority () {
|
||||||
let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : ''
|
let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : ''
|
||||||
let res = await authority(accountId)
|
let res = await authority(accountId)
|
||||||
if (res.code === '1') {
|
this.menuList = [...res.result.sonTree]
|
||||||
this.menuList = [...res.result.sonTree]
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Quit () {
|
Quit () {
|
||||||
this.$store.dispatch('setSignOut')
|
this.$store.dispatch('setSignOut')
|
||||||
|
|||||||
@@ -35,36 +35,19 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
document.getElementsByTagName('body')[0].className = 'login-bg'
|
document.getElementsByTagName('body')[0].className = 'login-bg'
|
||||||
// window.getSystemInfoCallback = this.getSystemInfoCallback
|
|
||||||
// window.location.href = 'getSystemInfo'
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// getSystemInfoCallback (result) {
|
|
||||||
// window.localStorage.setItem('hhtId', result)
|
|
||||||
// },
|
|
||||||
// handleTest () {
|
|
||||||
// this.test = false
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.test = true
|
|
||||||
// this.testNumber = this.testNumber === 1 ? 2 : 1
|
|
||||||
// }, 200)
|
|
||||||
// },
|
|
||||||
changeType () {
|
changeType () {
|
||||||
this.type = this.type === 'password' ? 'text' : 'password'
|
this.type = this.type === 'password' ? 'text' : 'password'
|
||||||
},
|
},
|
||||||
async loginApi () {
|
async loginApi () {
|
||||||
try {
|
try {
|
||||||
let res = await loginApi(this.loginname, encrypt(this.password))
|
let res = await loginApi(this.loginname, encrypt(this.password))
|
||||||
if (res.code === '1') {
|
this.$store.dispatch('userInfo', JSON.stringify(res))
|
||||||
this.$store.dispatch('userInfo', JSON.stringify(res.result))
|
this.$router.push('/home')
|
||||||
this.$router.push('/home')
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
this.Dialog(err)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_Login () {
|
_Login () {
|
||||||
|
|||||||
@@ -71,15 +71,11 @@ export default {
|
|||||||
/** 查询点位 */
|
/** 查询点位 */
|
||||||
async _callEmptyqueryPoint () {
|
async _callEmptyqueryPoint () {
|
||||||
let res = await callEmptyqueryPoint()
|
let res = await callEmptyqueryPoint()
|
||||||
if (res.code === '1') {
|
this.option2 = [...res.result.regionja]
|
||||||
this.option2 = [...res.result.regionja]
|
this.option2.map(el => {
|
||||||
this.option2.map(el => {
|
this.$set(el, 'value', el.region_id)
|
||||||
this.$set(el, 'value', el.region_id)
|
this.$set(el, 'label', el.region_name)
|
||||||
this.$set(el, 'label', el.region_name)
|
})
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _callEmptyconfirm () {
|
async _callEmptyconfirm () {
|
||||||
@@ -90,12 +86,8 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await callEmptyconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2)
|
let res = await callEmptyconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.toCancle()
|
||||||
this.toCancle()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
|||||||
@@ -64,15 +64,11 @@ export default {
|
|||||||
/** 查询点位 */
|
/** 查询点位 */
|
||||||
async _callMaterialqueryPoint () {
|
async _callMaterialqueryPoint () {
|
||||||
let res = await callMaterialqueryPoint()
|
let res = await callMaterialqueryPoint()
|
||||||
if (res.code === '1') {
|
this.option2 = [...res.result.regionja]
|
||||||
this.option2 = [...res.result.regionja]
|
this.option2.map(el => {
|
||||||
this.option2.map(el => {
|
this.$set(el, 'value', el.region_id)
|
||||||
this.$set(el, 'value', el.region_id)
|
this.$set(el, 'label', el.region_name)
|
||||||
this.$set(el, 'label', el.region_name)
|
})
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _callMaterialconfirm () {
|
async _callMaterialconfirm () {
|
||||||
@@ -83,12 +79,8 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await callMaterialconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code)
|
let res = await callMaterialconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.toCancle()
|
||||||
this.toCancle()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
|||||||
@@ -50,12 +50,8 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await emptyAndQtyconfirm(this.val1, this.val2)
|
let res = await emptyAndQtyconfirm(this.val1, this.val2)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.toCancle()
|
||||||
this.toCancle()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
|||||||
@@ -98,14 +98,10 @@ export default {
|
|||||||
async _updatePass () {
|
async _updatePass () {
|
||||||
try {
|
try {
|
||||||
let res = await updatePass(encrypt(this.val1), encrypt(this.val2))
|
let res = await updatePass(encrypt(this.val1), encrypt(this.val2))
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.$store.dispatch('setSignOut')
|
||||||
this.$store.dispatch('setSignOut')
|
this.$router.push('/login')
|
||||||
this.$router.push('/login')
|
this.disabled = false
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
this.disabled = false
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,15 +81,11 @@ export default {
|
|||||||
/** 查询点位 */
|
/** 查询点位 */
|
||||||
async _sendEmptyqueryPoint () {
|
async _sendEmptyqueryPoint () {
|
||||||
let res = await sendEmptyqueryPoint()
|
let res = await sendEmptyqueryPoint()
|
||||||
if (res.code === '1') {
|
this.option2 = [...res.result.regionja]
|
||||||
this.option2 = [...res.result.regionja]
|
this.option2.map(el => {
|
||||||
this.option2.map(el => {
|
this.$set(el, 'value', el.region_id)
|
||||||
this.$set(el, 'value', el.region_id)
|
this.$set(el, 'label', el.region_name)
|
||||||
this.$set(el, 'label', el.region_name)
|
})
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _sendEmptyconfirm () {
|
async _sendEmptyconfirm () {
|
||||||
@@ -100,12 +96,8 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await sendEmptyconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val1, this.val2)
|
let res = await sendEmptyconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val1, this.val2)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.toCancle()
|
||||||
this.toCancle()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
|||||||
@@ -71,25 +71,11 @@ export default {
|
|||||||
/** 查询点位 */
|
/** 查询点位 */
|
||||||
async _sendMaterialqueryPoint () {
|
async _sendMaterialqueryPoint () {
|
||||||
let res = await sendMaterialqueryPoint()
|
let res = await sendMaterialqueryPoint()
|
||||||
if (res.code === '1') {
|
this.option2 = [...res.result.regionja]
|
||||||
// this.option1 = [...res.result.workprocedureja]
|
this.option2.map(el => {
|
||||||
// this.option1.map(el => {
|
this.$set(el, 'value', el.region_id)
|
||||||
// this.$set(el, 'value', el.workprocedure_id)
|
this.$set(el, 'label', el.region_name)
|
||||||
// this.$set(el, 'label', el.workprocedure_name)
|
})
|
||||||
// })
|
|
||||||
this.option2 = [...res.result.regionja]
|
|
||||||
this.option2.map(el => {
|
|
||||||
this.$set(el, 'value', el.region_id)
|
|
||||||
this.$set(el, 'label', el.region_name)
|
|
||||||
})
|
|
||||||
// this.option3 = [...res.result.workprocedureja.deviceja.pointArr]
|
|
||||||
// this.option3.map(el => {
|
|
||||||
// this.$set(el, 'value', el.point_id)
|
|
||||||
// this.$set(el, 'label', el.point_name)
|
|
||||||
// })
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
async _sendMaterialconfirm () {
|
async _sendMaterialconfirm () {
|
||||||
@@ -100,12 +86,8 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await sendMaterialconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2)
|
let res = await sendMaterialconfirm(this.option2[this.active2].value, this.option3[this.active3].value, this.option3[this.active3].point_code, this.val2)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast(res.desc)
|
this.toCancle()
|
||||||
this.toCancle()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
|||||||
@@ -76,33 +76,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async queryTask () {
|
async queryTask () {
|
||||||
try {
|
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
|
||||||
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
|
this.dataList = res.result
|
||||||
if (res.code === '1') {
|
|
||||||
this.dataList = res.result
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
this.Dialog(err)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async taskOperation (type) {
|
async taskOperation (type) {
|
||||||
try {
|
try {
|
||||||
let res = await taskOperation(this.pkId, type)
|
let res = await taskOperation(this.pkId, type)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast('操作成功')
|
this.disabled = false
|
||||||
this.disabled = false
|
this.pkId = ''
|
||||||
this.pkId = ''
|
this.btnred = false
|
||||||
this.btnred = false
|
this.dataList = []
|
||||||
this.dataList = []
|
this.queryTask()
|
||||||
this.queryTask()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
this.disabled = false
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
this.disabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toSure (type) {
|
toSure (type) {
|
||||||
|
|||||||
@@ -82,33 +82,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async queryInstraction () {
|
async queryInstraction () {
|
||||||
try {
|
let res = await queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
||||||
let res = await queryInstraction(this.keyword, this.startPoint, this.endPoint)
|
this.dataList = res.result
|
||||||
if (res.code === '1') {
|
|
||||||
this.dataList = res.result
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
this.Dialog(err)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async instOperation (type) {
|
async instOperation (type) {
|
||||||
try {
|
try {
|
||||||
let res = await instOperation(this.pkId, type)
|
let res = await instOperation(this.pkId, type)
|
||||||
if (res.code === '1') {
|
this.toast(res.desc)
|
||||||
this.toast('操作成功')
|
this.disabled = false
|
||||||
this.disabled = false
|
this.pkId = ''
|
||||||
this.pkId = ''
|
this.btnred = false
|
||||||
this.btnred = false
|
this.dataList = []
|
||||||
this.dataList = []
|
this.queryInstraction()
|
||||||
this.queryInstraction()
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
this.disabled = false
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
this.disabled = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toSure (type) {
|
toSure (type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user