|
@@ -1,8 +1,8 @@
|
|
|
-<!-- 出库扫码 -->
|
|
|
+<!-- 入库扫码 -->
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
<view class="text-area">
|
|
|
- <scan @getCode="getScanCode"/>
|
|
|
+ <scan @getCode="getScanCode" />
|
|
|
</view>
|
|
|
<view class="stripe"></view>
|
|
|
<view class="roll">
|
|
@@ -32,7 +32,7 @@
|
|
|
<u-th class="u-th">规格</u-th>
|
|
|
<u-th class="u-th" width="15%">操作</u-th>
|
|
|
</u-tr>
|
|
|
- <u-tr class="u-tr" :key="index" v-for="(item, index) in lisi">
|
|
|
+ <u-tr class="u-tr" v-for="(item, index) in lisi" :key="index">
|
|
|
<u-td class="u-td" width="30%">{{item.tireNumber}}</u-td>
|
|
|
<u-td class="u-td">{{item.maktx}}</u-td>
|
|
|
<u-td class="u-td" width="15%"><text @click="confirm(index)" style="color: #FA3534;">删除</text></u-td>
|
|
@@ -47,6 +47,17 @@
|
|
|
<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>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -64,36 +75,60 @@
|
|
|
content: '请输入轮胎胎号',
|
|
|
number_s: '',
|
|
|
number_a: '',
|
|
|
+ regular: '轮胎非正规是否出库',
|
|
|
lisi: [],
|
|
|
background: {
|
|
|
backgroundColor: '#0094fe',
|
|
|
},
|
|
|
show: true,
|
|
|
+ show_s: false,
|
|
|
+ show_d: false,
|
|
|
+ res: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onBackPress(options) {
|
|
|
+ console.log(options)
|
|
|
+ if (options.from == 'backbutton') {
|
|
|
+ this.$u.route({
|
|
|
+ type: 'switchTab',
|
|
|
+ url: 'pages/home/index'
|
|
|
+ })
|
|
|
}
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ onLaunch(){
|
|
|
+ uni.$on('update', data => {
|
|
|
+ this.lisi = data.lisi
|
|
|
+ console.log(this.lisi)
|
|
|
+ })
|
|
|
},
|
|
|
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"
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
+ uni.$on('data', res => {
|
|
|
+ this.lisi = res.lisi
|
|
|
+ console.log(res.lisi)
|
|
|
+ })
|
|
|
const innerAudioContext = uni.createInnerAudioContext();
|
|
|
innerAudioContext.autoplay = true;
|
|
|
innerAudioContext.src = '../../../static/mp3/startscan.mp3';
|
|
|
innerAudioContext.onPlay(() => {
|
|
|
- console.log('开始播放');
|
|
|
+ console.log('开始播放');
|
|
|
});
|
|
|
innerAudioContext.onError((res) => {
|
|
|
- console.log(res.errMsg);
|
|
|
- console.log(res.errCode);
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
@@ -103,11 +138,22 @@
|
|
|
url: '/storeScan/storeScanGetTyre',
|
|
|
method: 'Post',
|
|
|
data: {
|
|
|
- storeId:this.$store.state.storeInfo.storeId,
|
|
|
- userId:this.$store.state.storeInfo.userId,
|
|
|
+ storeId: this.$store.state.storeInfo.storeId,
|
|
|
+ userId: this.$store.state.storeInfo.userId,
|
|
|
tyreNum: this.number_a
|
|
|
}
|
|
|
}).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({
|
|
@@ -118,40 +164,20 @@
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- this.$refs.repeat.show({
|
|
|
- title: '录入成功',
|
|
|
- type: 'success',
|
|
|
- position: 'bottom'
|
|
|
- })
|
|
|
- if (res.data.code == 500){
|
|
|
+ if (res.data.data[0].isRegular == 1) {
|
|
|
+ console.log(res.data.data[0].isRegular)
|
|
|
this.$refs.repeat.show({
|
|
|
- title: res.data.msg,
|
|
|
+ title: '轮胎非正规',
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- this.number_a = ""
|
|
|
- console.log("我成功啦")
|
|
|
- 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: '0'
|
|
|
- })
|
|
|
+ this.container()
|
|
|
console.log(this.lisi)
|
|
|
}).catch(err => {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: "请重新录入",
|
|
|
+ title: "无网络,请连接网络后再试~",
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
@@ -161,34 +187,61 @@
|
|
|
// Loading.close()
|
|
|
})
|
|
|
},
|
|
|
+ container() {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '录入成功',
|
|
|
+ type: 'success',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ console.log(this.res.data.data[0].specs)
|
|
|
+ this.show_s = false
|
|
|
+ console.log(this.show_s)
|
|
|
+ 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) {
|
|
|
- console.log(val)
|
|
|
- this.number = val
|
|
|
- this.number_s = 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
|
|
|
+ this.number_s = val
|
|
|
request({
|
|
|
url: '/storeScan/storeScanGetTyre',
|
|
|
method: 'Post',
|
|
|
data: {
|
|
|
- storeId:this.$store.state.storeInfo.storeId,
|
|
|
- userId:this.$store.state.storeInfo.userId,
|
|
|
+ storeId: this.$store.state.storeInfo.storeId,
|
|
|
+ userId: this.$store.state.storeInfo.userId,
|
|
|
tyreNum: this.number_s
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(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) {
|
|
@@ -197,22 +250,13 @@
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
- const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = '../../../static/mp3/rescan.mp3';
|
|
|
- innerAudioContext.onPlay(() => {
|
|
|
- console.log('开始播放');
|
|
|
- });
|
|
|
- innerAudioContext.onError((res) => {
|
|
|
- console.log(res.errMsg);
|
|
|
- console.log(res.errCode);
|
|
|
- });
|
|
|
+ this.repeated()
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if (res.data.code == 500){
|
|
|
+ if (res.data.code == 500) {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: res.data.msg,
|
|
|
+ title: '请扫描或输入正确的胎号',
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
@@ -220,46 +264,24 @@
|
|
|
innerAudioContext.autoplay = true;
|
|
|
innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';
|
|
|
innerAudioContext.onPlay(() => {
|
|
|
- console.log('开始播放');
|
|
|
+ console.log('开始播放');
|
|
|
});
|
|
|
innerAudioContext.onError((res) => {
|
|
|
- console.log(res.errMsg);
|
|
|
- console.log(res.errCode);
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
});
|
|
|
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'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.container_s()
|
|
|
console.log(this.lisi)
|
|
|
}).catch(err => {
|
|
|
if (code == 400) {
|
|
@@ -274,6 +296,7 @@
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
+ this.repeated()
|
|
|
}
|
|
|
console.log(err)
|
|
|
})
|
|
@@ -281,6 +304,45 @@
|
|
|
// Loading.close()
|
|
|
})
|
|
|
},
|
|
|
+ container_s() {
|
|
|
+ this.show_d = false
|
|
|
+ console.log(this.show_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'
|
|
|
+ })
|
|
|
+ console.log(this.lisi)
|
|
|
+ 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)
|
|
@@ -288,20 +350,31 @@
|
|
|
scancodein() {
|
|
|
if (this.lisi == '') {
|
|
|
this.$refs.repeat.show({
|
|
|
- title: '请扫码或录入后再点击!',
|
|
|
+ title: '请扫码或录入后再点击!',
|
|
|
type: 'default',
|
|
|
position: 'bottom'
|
|
|
})
|
|
|
} else {
|
|
|
this.$u.route({
|
|
|
- type:'redirectTo',
|
|
|
- url: 'pages/home/Scan-code-out/index',
|
|
|
+ type: 'redirectTo',
|
|
|
+ url: 'pages/home/Scan-code-out/index'
|
|
|
})
|
|
|
uni.$emit('update', {
|
|
|
materialList: this.lisi
|
|
|
})
|
|
|
- this.lisi = []
|
|
|
}
|
|
|
+ },
|
|
|
+ repeated() {
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = true;
|
|
|
+ innerAudioContext.src = '../../../static/mp3/rescan.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -339,6 +412,11 @@
|
|
|
padding-top: 400px;
|
|
|
}
|
|
|
|
|
|
+ .content_s {
|
|
|
+ padding: 24rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
.logo {
|
|
|
height: 200rpx;
|
|
|
width: 200rpx;
|