|
@@ -47,29 +47,7 @@
|
|
|
<view>
|
|
|
</view>
|
|
|
<u-toast ref="repeat" position="bottom" />
|
|
|
- <u-popup mode="bottom" v-model="show_s" :mask-close-able="false" :safe-area-inset-bottom="true">
|
|
|
- <view class="confrim-btn">
|
|
|
- <u-button @click="show_s = false;" style="float: left;border: none;" :hair-line="false" :plain="false">取消</u-button>
|
|
|
- <u-button @click="container" style="float: right;border: none;" :hair-line="false" :plain="false">确定</u-button>
|
|
|
- </view>
|
|
|
- <view class="content_s">
|
|
|
- <scroll-view scroll-y="true" style="height: 200rpx;">
|
|
|
- {{regular}}
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- </u-popup>
|
|
|
- <u-popup mode="bottom" v-model="show_d" :mask-close-able="false" :safe-area-inset-bottom="true">
|
|
|
- <view class="confrim-btn">
|
|
|
- <u-button @click="show_d = false;" style="float: left;border: none;" :hair-line="false" :plain="false">取消</u-button>
|
|
|
- <u-button @click="container_s" style="float: right;border: none;" :hair-line="false" :plain="false">确定</u-button>
|
|
|
- </view>
|
|
|
- <view class="content_s">
|
|
|
- <scroll-view scroll-y="true" style="height: 200rpx;">
|
|
|
- {{regular}}
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- </u-popup>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -90,7 +68,7 @@
|
|
|
content: '请输入轮胎胎号',
|
|
|
number_s: '',
|
|
|
number_a: '',
|
|
|
- regular: '轮胎非正规是否入库',
|
|
|
+ // regular: '轮胎非正规是否入库',
|
|
|
lisi: [],
|
|
|
background: {
|
|
|
backgroundColor: '#0094fe',
|
|
@@ -157,6 +135,10 @@
|
|
|
this.mounteds()
|
|
|
},
|
|
|
methods: {
|
|
|
+ switchLang() {
|
|
|
+ // 切换为英文
|
|
|
+ this.$i18n.locale = 'en';
|
|
|
+ },
|
|
|
mounteds() {
|
|
|
let that = this
|
|
|
uni.getLocation({
|
|
@@ -169,7 +151,7 @@
|
|
|
fail: function(e) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: '获取地址失败, 请检查是否开启定位权限~~'
|
|
|
+ title: '获取地址失败, 请检查是否开启定位权限~'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -228,95 +210,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 +399,108 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- 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: val,
|
|
|
+ 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": "请勿重复扫码",
|
|
|
+ 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) {
|
|
|
+ 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 {
|
|
|
+ console.log(this.lisi)
|
|
|
+ }).catch(err => {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: "请重新扫码",
|
|
|
+ title: "网络繁忙,请稍后再试",
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
- this.repeated()
|
|
|
- }
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- // Loading.close()
|
|
|
- })
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // Loading.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
container_s() {
|
|
|
this.show_d = false
|