|
@@ -1,16 +1,20 @@
|
|
|
<template>
|
|
|
-
|
|
|
<view class="content">
|
|
|
<view class="text-area">
|
|
|
- <scan @getCode="getScanCode"/>
|
|
|
+ <scan @getCode="getScanCode" />
|
|
|
</view>
|
|
|
<view class="stripe"></view>
|
|
|
<view class="roll">
|
|
|
<view>
|
|
|
- <view @click="show = true">
|
|
|
+ <view @click="show =! show">
|
|
|
<u-icon name="edit-pen"></u-icon>手动录入
|
|
|
</view>
|
|
|
- <view>{{tips}}:{{number}}</view>
|
|
|
+ <view class="" v-if="show==true">
|
|
|
+ <input type="text" value="wocao" style="background-color: #DD6161;width: 60%;font-size: 42rpx;border: 1rpx solid #000;" />
|
|
|
+ </view>
|
|
|
+ <view class="" v-else>
|
|
|
+ <view>{{tips}}:{{number}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view></view>
|
|
@@ -24,68 +28,139 @@
|
|
|
<u-tr class="u-tr">
|
|
|
<u-th class="u-th" width="30%">胎号</u-th>
|
|
|
<u-th class="u-th">规格</u-th>
|
|
|
- <u-th class="u-th" width="15%"></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-td class="u-td" width="30%">{{item.name}}</u-td>
|
|
|
- <u-td class="u-td">{{item.Specifications}}</u-td>
|
|
|
- <u-td class="u-td" width="15%">删除</u-td>
|
|
|
+ <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>
|
|
|
</u-tr>
|
|
|
</u-table>
|
|
|
<u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多了</u-divider>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="determine">
|
|
|
- <u-button type="primary" :ripple="true" shape="circle" @click="scancodein">扫码确认</u-button>
|
|
|
+ <u-button type="primary" shape="circle" @click="scancodein">扫码确认</u-button>
|
|
|
</view>
|
|
|
<view>
|
|
|
</view>
|
|
|
+ <u-toast ref="repeat" position="bottom" />
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ request
|
|
|
+ } from '../../../common/request/request'
|
|
|
+ require("promise.prototype.finally").shim()
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tips: '提示',
|
|
|
number: '请扫码入库',
|
|
|
nbTitle: '扫码标题',
|
|
|
- i: 1,
|
|
|
- lisi: [{
|
|
|
- name: '123456789154Sad',
|
|
|
- Specifications: '175/70R14 88T XL BH15 BGBL'
|
|
|
- }],
|
|
|
+ content: '东临碣石,以观沧海',
|
|
|
+ number_s: '',
|
|
|
+ lisi: [],
|
|
|
background: {
|
|
|
backgroundColor: '#0094fe',
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
+ },
|
|
|
+ show: true,
|
|
|
+ zoom:18,//地图相关设置
|
|
|
+ center:{lng:0,lat:0}
|
|
|
|
|
|
- },
|
|
|
- onReady() {
|
|
|
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- bug() {
|
|
|
- console.log("成功")
|
|
|
- this.i++
|
|
|
- this.lisi.push({
|
|
|
- name: this.i,
|
|
|
- Specifications: this.i
|
|
|
- })
|
|
|
- },
|
|
|
//获取扫码控件
|
|
|
getScanCode(val) {
|
|
|
console.log(val)
|
|
|
this.number = val
|
|
|
- this.tips = "胎号"
|
|
|
- this.bug()
|
|
|
+ this.number_s = val
|
|
|
+ request({
|
|
|
+ url: '/storeScan/storeScanGetTyre',
|
|
|
+ method: 'Post',
|
|
|
+ data: {
|
|
|
+ storeId: '1000',
|
|
|
+ userId: '123',
|
|
|
+ tyreNum: this.number_s
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ this.tips = "胎号"
|
|
|
+ for (let i = 0; i < this.lisi.length; i++) {
|
|
|
+ if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '请勿重复扫码',
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else if (res.data.data[0].flagRegular == 1) {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '轮胎非正规',
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '扫码成功',
|
|
|
+ type: 'success',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ 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,
|
|
|
+ scanWay: '1'
|
|
|
+ })
|
|
|
+ console.log(this.lisi)
|
|
|
+ }).catch(err => {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: "请重新扫码",
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // Loading.close()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirm(index) {
|
|
|
+ console.log(index + "什么情况")
|
|
|
+ this.lisi.splice(index, 1)
|
|
|
},
|
|
|
scancodein() {
|
|
|
- this.$u.route({
|
|
|
- url: 'pages/home/Scan-code-in/index'
|
|
|
- })
|
|
|
+ if (this.lisi == '') {
|
|
|
+ this.$refs.repeat.show({
|
|
|
+ title: '请扫码后再点击!',
|
|
|
+ type: 'default',
|
|
|
+ position: 'bottom'
|
|
|
+ })
|
|
|
+ } else { //解
|
|
|
+ this.$u.route({
|
|
|
+ url: 'pages/home/Scan-code-in/index'
|
|
|
+ })
|
|
|
+ uni.$emit('update', {
|
|
|
+ materialList: this.lisi
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -94,16 +169,17 @@
|
|
|
<style lang="scss" scoped>
|
|
|
.generate {
|
|
|
width: 98%;
|
|
|
- height: 420rpx;
|
|
|
- overflow:auto;
|
|
|
+ height: 300rpx;
|
|
|
+ overflow: auto;
|
|
|
margin: 0 auto;
|
|
|
margin-top: 120rpx;
|
|
|
}
|
|
|
|
|
|
.determine {
|
|
|
width: 690rpx;
|
|
|
- margin-top: 330rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
}
|
|
|
+
|
|
|
.content {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
@@ -122,7 +198,7 @@
|
|
|
}
|
|
|
|
|
|
.stripe {
|
|
|
- width: 720rpx;
|
|
|
+ width: 740rpx;
|
|
|
height: 30rpx;
|
|
|
background-color: #00A0EA;
|
|
|
border-radius: 12rpx;
|
|
@@ -149,7 +225,7 @@
|
|
|
}
|
|
|
|
|
|
.roll {
|
|
|
- width: 690rpx;
|
|
|
+ width: 710rpx;
|
|
|
height: auto;
|
|
|
background: #FFFFFF;
|
|
|
margin: 0 auto;
|