|
@@ -228,95 +228,105 @@
|
|
|
//手动录入调用
|
|
|
manualentry() {
|
|
|
if (this.number_a.length != 0) {
|
|
|
- request({
|
|
|
- url: '/storeScan/storeScanGetTyre',
|
|
|
- method: 'Post',
|
|
|
- data: {
|
|
|
- storeId: this.$store.state.storeInfo.storeId,
|
|
|
- userId: this.$store.state.storeInfo.userId,
|
|
|
- tyreNum: this.number_a,
|
|
|
- scanType: 1,
|
|
|
- scanWay: 0,
|
|
|
- longitude: this.degree.x,
|
|
|
- latitude: this.degree.y,
|
|
|
- scanAddress: this.address
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- if (res.data.code == 513) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'regular'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 514) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'nonoperating'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 515) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'warehousing'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 517) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'atypism'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 518) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'gobeyond'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 519) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'notallow'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 500) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'error'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 0) {
|
|
|
+ console.log(this.degree)
|
|
|
+ if (this.degree == undefined) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '获取地址失败, 请检查是否开启定位权限~~',
|
|
|
+ position: "bottom"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ request({
|
|
|
+ url: '/storeScan/storeScanGetTyre',
|
|
|
+ method: 'Post',
|
|
|
+ data: {
|
|
|
+ storeId: this.$store.state.storeInfo.storeId,
|
|
|
+ userId: this.$store.state.storeInfo.userId,
|
|
|
+ tyreNum: this.number_a,
|
|
|
+ scanType: 1,
|
|
|
+ scanWay: 0,
|
|
|
+ longitude: this.degree.x,
|
|
|
+ latitude: this.degree.y,
|
|
|
+ scanAddress: this.address
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
console.log(res)
|
|
|
- this.res = res
|
|
|
- console.log(res.data.data[0].isRegular)
|
|
|
- for (let i = 0; i < this.lisi.length; i++) {
|
|
|
- if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
- console.log(res)
|
|
|
- let err = {
|
|
|
- "data": {
|
|
|
- "msg": "请勿重复录入",
|
|
|
+ if (res.data.code == 513) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'regular'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 514) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'nonoperating'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 515) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'warehousing'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 517) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'atypism'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 518) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'gobeyond'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 519) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'notallow'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'error'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ console.log(res)
|
|
|
+ this.res = res
|
|
|
+ console.log(res.data.data[0].isRegular)
|
|
|
+ for (let i = 0; i < this.lisi.length; i++) {
|
|
|
+ if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
+ console.log(res)
|
|
|
+ let err = {
|
|
|
+ "data": {
|
|
|
+ "msg": "请勿重复录入",
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(err.data.msg)
|
|
|
+ let name = 'duplicateentry'
|
|
|
+ this.tipss(err, name)
|
|
|
+ return
|
|
|
}
|
|
|
- console.log(err.data.msg)
|
|
|
- let name = 'duplicateentry'
|
|
|
- this.tipss(err, name)
|
|
|
- return
|
|
|
}
|
|
|
+ this.container()
|
|
|
}
|
|
|
- this.container()
|
|
|
- }
|
|
|
- console.log(this.lisi)
|
|
|
- }).catch(err => {
|
|
|
- // this.$refs.repeat.show({
|
|
|
- // title: "网络繁忙,请稍后再试",
|
|
|
- // type: 'default',
|
|
|
- // position: 'bottom'
|
|
|
- // })
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- // Loading.close()
|
|
|
- })
|
|
|
+ console.log(this.lisi)
|
|
|
+ }).catch(err => {
|
|
|
+ // this.$refs.repeat.show({
|
|
|
+ // title: "网络繁忙,请稍后再试",
|
|
|
+ // type: 'default',
|
|
|
+ // position: 'bottom'
|
|
|
+ // })
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // Loading.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$refs.repeat.show({
|
|
|
title: '请输入胎号',
|
|
@@ -407,119 +417,107 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- let datats = {
|
|
|
- storeId: this.$store.state.storeInfo.storeId,
|
|
|
- userId: this.$store.state.storeInfo.userId,
|
|
|
- tyreNum: this.number_s,
|
|
|
- scanType: 1,
|
|
|
- scanWay: 1,
|
|
|
- longitude: this.degree.x,
|
|
|
- latitude: this.degree.y,
|
|
|
- scanAddress: this.address
|
|
|
- }
|
|
|
- console.log(datats)
|
|
|
console.log(val)
|
|
|
this.number = val
|
|
|
this.number_s = val
|
|
|
- request({
|
|
|
- url: '/storeScan/storeScanGetTyre',
|
|
|
- method: 'Post',
|
|
|
- data: {
|
|
|
- storeId: this.$store.state.storeInfo.storeId,
|
|
|
- userId: this.$store.state.storeInfo.userId,
|
|
|
- tyreNum: this.number_s,
|
|
|
- scanType: 1,
|
|
|
- scanWay: 1,
|
|
|
- longitude: this.degree.x,
|
|
|
- latitude: this.degree.y,
|
|
|
- scanAddress: this.address
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- this.res_s = res
|
|
|
- this.tips = "胎号"
|
|
|
- if (res.data.code == 513) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'regular'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 514) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'nonoperating'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 515) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'warehousing'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 517) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'atypism'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 518) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'gobeyond'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 519) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'notallow'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 500) {
|
|
|
- console.log(res.data.msg)
|
|
|
- let name = 'error'
|
|
|
- this.tipss(res, name)
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data.code == 0) {
|
|
|
+ if (this.degree == undefined) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '获取地址失败, 请检查是否开启定位权限~~',
|
|
|
+ position: "bottom"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ request({
|
|
|
+ url: '/storeScan/storeScanGetTyre',
|
|
|
+ method: 'Post',
|
|
|
+ data: {
|
|
|
+ storeId: this.$store.state.storeInfo.storeId,
|
|
|
+ userId: this.$store.state.storeInfo.userId,
|
|
|
+ tyreNum: this.number_a,
|
|
|
+ scanType: 1,
|
|
|
+ scanWay: 0,
|
|
|
+ longitude: this.degree.x,
|
|
|
+ latitude: this.degree.y,
|
|
|
+ scanAddress: this.address
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
console.log(res)
|
|
|
- this.res = res
|
|
|
- console.log(res.data.data[0].isRegular)
|
|
|
- for (let i = 0; i < this.lisi.length; i++) {
|
|
|
- if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
- console.log(res)
|
|
|
- let err = {
|
|
|
- "data": {
|
|
|
- "msg": "请勿重复扫码",
|
|
|
+ if (res.data.code == 513) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'regular'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 514) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'nonoperating'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 515) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'warehousing'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 517) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'atypism'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 518) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'gobeyond'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 519) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'notallow'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ console.log(res.data.msg)
|
|
|
+ let name = 'error'
|
|
|
+ this.tipss(res, name)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ console.log(res)
|
|
|
+ this.res = res
|
|
|
+ console.log(res.data.data[0].isRegular)
|
|
|
+ for (let i = 0; i < this.lisi.length; i++) {
|
|
|
+ if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
+ console.log(res)
|
|
|
+ let err = {
|
|
|
+ "data": {
|
|
|
+ "msg": "请勿重复录入",
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(err.data.msg)
|
|
|
+ let name = 'duplicateentry'
|
|
|
+ this.tipss(err, name)
|
|
|
+ return
|
|
|
}
|
|
|
- console.log(err.data.msg)
|
|
|
- let name = 'repeatcode'
|
|
|
- this.tipss(err, name)
|
|
|
- return
|
|
|
}
|
|
|
+ this.container()
|
|
|
}
|
|
|
- this.container_s()
|
|
|
- }
|
|
|
- // console.log(this.lisi)
|
|
|
- }).catch(err => {
|
|
|
- if (err.code == 400) {//谁给我删了......
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: "无网络",
|
|
|
- type: 'default',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: "请重新扫码",
|
|
|
- type: 'default',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
- this.repeated()
|
|
|
- }
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- // Loading.close()
|
|
|
- })
|
|
|
+ console.log(this.lisi)
|
|
|
+ }).catch(err => {
|
|
|
+ // this.$refs.repeat.show({
|
|
|
+ // title: "网络繁忙,请稍后再试",
|
|
|
+ // type: 'default',
|
|
|
+ // position: 'bottom'
|
|
|
+ // })
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // Loading.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
container_s() {
|
|
|
this.show_d = false
|