|
@@ -47,6 +47,28 @@
|
|
|
<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: 300rpx;font-size: 40rpx;margin-bottom: 40rpx;margin-top: 100rpx;">
|
|
|
+ {{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>
|
|
|
</template>
|
|
|
|
|
@@ -64,26 +86,30 @@
|
|
|
content: '请输入轮胎胎号',
|
|
|
number_s: '',
|
|
|
number_a: '',
|
|
|
+ regular: '轮胎非正规是否入库',
|
|
|
lisi: [],
|
|
|
background: {
|
|
|
backgroundColor: '#0094fe',
|
|
|
},
|
|
|
show: true,
|
|
|
+ show_s: false,
|
|
|
+ show_d: false,
|
|
|
+ res: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
uni.getNetworkType({
|
|
|
- success: function (res) {
|
|
|
+ success: function(res) {
|
|
|
let none = res.networkType
|
|
|
- console.log(res.networkType);
|
|
|
- if(none == 'none'){
|
|
|
+ console.log(res.networkType);
|
|
|
+ if (none == 'none') {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '无网络,请连接网络后再试~',
|
|
|
position: "bottom"
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
|
innerAudioContext.autoplay = true;
|
|
@@ -109,6 +135,16 @@
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log(res.data.code)
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '请扫描或输入正确的胎号',
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 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) {
|
|
|
this.$refs.repeat.show({
|
|
@@ -117,45 +153,19 @@
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
return
|
|
|
- } else if (res.data.data[0].flagRegular == 1) {
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: '轮胎非正规',
|
|
|
- type: 'default',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
- return
|
|
|
}
|
|
|
}
|
|
|
- if (res.data.code == 500) {
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: res.data.msg,
|
|
|
- type: 'default',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
+ if (res.data.data[0].isRegular == 1) {
|
|
|
+ console.log(res.data.data[0].isRegular)
|
|
|
+ // this.$refs.repeat.show({
|
|
|
+ // title: '轮胎非正规',
|
|
|
+ // type: 'default',
|
|
|
+ // position: 'bottom'
|
|
|
+ // })
|
|
|
+ this.show_s = true
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: '录入成功',
|
|
|
- type: 'success',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
- this.number_a = ""
|
|
|
- console.log("我成功啦")
|
|
|
- console.log(res)
|
|
|
- this.lisi.push({
|
|
|
- specs: res.data.data[0].specs,
|
|
|
- flagRegular: res.data.data[0].isRegular,
|
|
|
- diameter: res.data.data[0].diameter,
|
|
|
- maktx: res.data.data[0].maktx,
|
|
|
- pattern: res.data.data[0].pattern,
|
|
|
- soldToPartyKunnr: res.data.data[0].soldToPartyKunnr,
|
|
|
- matnr: res.data.data[0].matnr,
|
|
|
- tireNumber: res.data.data[0].tirenumber,
|
|
|
- brand: res.data.data[0].brand,
|
|
|
- shippedDate: res.data.data[0].shippedDate,
|
|
|
- scanWay: '0'
|
|
|
- })
|
|
|
+ this.container()
|
|
|
console.log(this.lisi)
|
|
|
}).catch(err => {
|
|
|
this.$refs.repeat.show({
|
|
@@ -169,20 +179,46 @@
|
|
|
// Loading.close()
|
|
|
})
|
|
|
},
|
|
|
+ container() {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '录入成功',
|
|
|
+ type: 'success',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ console.log(this.res.data.data[0].specs)
|
|
|
+ this.show_s = false
|
|
|
+ this.number_a = ''
|
|
|
+ console.log("我成功啦.")
|
|
|
+ this.lisi.push({
|
|
|
+ specs: this.res.data.data[0].specs,
|
|
|
+ flagRegular: this.res.data.data[0].isRegular,
|
|
|
+ diameter: this.res.data.data[0].diameter,
|
|
|
+ maktx: this.res.data.data[0].maktx,
|
|
|
+ pattern: this.res.data.data[0].pattern,
|
|
|
+ soldToPartyKunnr: this.res.data.data[0].soldToPartyKunnr,
|
|
|
+ matnr: this.res.data.data[0].matnr,
|
|
|
+ tireNumber: this.res.data.data[0].tirenumber,
|
|
|
+ brand: this.res.data.data[0].brand,
|
|
|
+ shippedDate: this.res.data.data[0].shippedDate,
|
|
|
+ plyRating: this.res.data.data[0].plyRating,
|
|
|
+ scanWay: '0'
|
|
|
+ })
|
|
|
+ console.log(this.lisi)
|
|
|
+ },
|
|
|
//获取扫码控件
|
|
|
getScanCode(val) {
|
|
|
uni.getNetworkType({
|
|
|
- success: function (res) {
|
|
|
+ success: function(res) {
|
|
|
let none = res.networkType
|
|
|
- console.log(res.networkType);
|
|
|
- if(none == 'none'){
|
|
|
+ console.log(res.networkType);
|
|
|
+ if (none == 'none') {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '无网络,请连接网络后再试~',
|
|
|
position: "bottom"
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
console.log(val)
|
|
|
this.number = val
|
|
@@ -196,6 +232,7 @@
|
|
|
tyreNum: this.number_s
|
|
|
}
|
|
|
}).then(res => {
|
|
|
+ this.res_s = res
|
|
|
this.tips = "胎号"
|
|
|
for (let i = 0; i < this.lisi.length; i++) {
|
|
|
if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
@@ -210,7 +247,7 @@
|
|
|
}
|
|
|
if (res.data.code == 500) {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: res.data.msg,
|
|
|
+ title: '请扫描或输入正确的胎号',
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
@@ -226,39 +263,17 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- this.number_s = ""
|
|
|
- console.log("我成功啦")
|
|
|
- console.log(res)
|
|
|
-
|
|
|
- this.lisi.push({
|
|
|
- specs: res.data.data[0].specs,
|
|
|
- flagRegular: res.data.data[0].isRegular,
|
|
|
- diameter: res.data.data[0].diameter,
|
|
|
- maktx: res.data.data[0].maktx,
|
|
|
- pattern: res.data.data[0].pattern,
|
|
|
- soldToPartyKunnr: res.data.data[0].soldToPartyKunnr,
|
|
|
- matnr: res.data.data[0].matnr,
|
|
|
- tireNumber: res.data.data[0].tirenumber,
|
|
|
- brand: res.data.data[0].brand,
|
|
|
- shippedDate: res.data.data[0].shippedDate,
|
|
|
- plyRating: res.data.data[0].plyRating,
|
|
|
- scanWay: '1'
|
|
|
- })
|
|
|
- const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
|
|
|
- innerAudioContext.onPlay(() => {
|
|
|
- console.log('开始播放');
|
|
|
- });
|
|
|
- innerAudioContext.onError((res) => {
|
|
|
- console.log(res.errMsg);
|
|
|
- console.log(res.errCode);
|
|
|
- });
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: '扫码成功',
|
|
|
- type: 'success',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
+ if (res.data.data[0].isRegular == 1) {
|
|
|
+ console.log(res.data.data[0].isRegular)
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '轮胎非正规',
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ this.show_d = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.container_s()
|
|
|
console.log(this.lisi)
|
|
|
}).catch(err => {
|
|
|
if (code == 400) {
|
|
@@ -281,6 +296,42 @@
|
|
|
// Loading.close()
|
|
|
})
|
|
|
},
|
|
|
+ container_s() {
|
|
|
+ console.log("什么????")
|
|
|
+ this.number_s = ''
|
|
|
+ console.log("我成功啦")
|
|
|
+ console.log(this.res_s)
|
|
|
+
|
|
|
+ this.lisi.push({
|
|
|
+ specs: this.res_s.data.data[0].specs,
|
|
|
+ flagRegular: this.res_s.data.data[0].isRegular,
|
|
|
+ diameter: this.res_s.data.data[0].diameter,
|
|
|
+ maktx: this.res_s.data.data[0].maktx,
|
|
|
+ pattern: this.res_s.data.data[0].pattern,
|
|
|
+ soldToPartyKunnr: this.res_s.data.data[0].soldToPartyKunnr,
|
|
|
+ matnr: this.res_s.data.data[0].matnr,
|
|
|
+ tireNumber: this.res_s.data.data[0].tirenumber,
|
|
|
+ brand: this.res_s.data.data[0].brand,
|
|
|
+ shippedDate: this.res_s.data.data[0].shippedDate,
|
|
|
+ plyRating: this.res_s.data.data[0].plyRating,
|
|
|
+ scanWay: '1'
|
|
|
+ })
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '扫码成功',
|
|
|
+ type: 'success',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ },
|
|
|
confirm(index) {
|
|
|
console.log(index + "什么情况")
|
|
|
this.lisi.splice(index, 1)
|
|
@@ -351,6 +402,11 @@
|
|
|
padding-top: 400px;
|
|
|
}
|
|
|
|
|
|
+ .content_s {
|
|
|
+ padding: 24rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
.logo {
|
|
|
height: 200rpx;
|
|
|
width: 200rpx;
|