|
@@ -30,7 +30,7 @@
|
|
|
</view>
|
|
|
</uni-forms>
|
|
|
<view class="button-group">
|
|
|
- <button type="info" @click="reset">重置</button>
|
|
|
+ <button type="default" @click="reset">重置</button>
|
|
|
<button type="primary" @click="onsubmit" :loading="loading">
|
|
|
<uni-icons v-if="!loading" type="checkmarkempty" size="18" color="white"></uni-icons>
|
|
|
提交
|
|
@@ -73,16 +73,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- <uni-popup ref="historypopup" type="bottom">
|
|
|
- <view class="history">
|
|
|
- <view class="title">历史</view>
|
|
|
- <view class="item" v-for="(item, i) in waybillNoHistory" :key="i">
|
|
|
- <view class="type">库位</view>
|
|
|
- <view class="code">{{ item.space }}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </uni-popup> -->
|
|
|
-
|
|
|
<uni-popup ref="messageRef" type="message">
|
|
|
<uni-popup-message
|
|
|
:type="messageType"
|
|
@@ -114,7 +104,6 @@ const waybillNoHistory = ref([] as any)
|
|
|
const messageRef = ref()
|
|
|
const messageType = ref()
|
|
|
const messageText = ref()
|
|
|
-const historyPopup = ref()
|
|
|
let st: any
|
|
|
|
|
|
const valiFormData = ref({
|
|
@@ -157,7 +146,6 @@ const scanInput = async () => {
|
|
|
const reset = () => {
|
|
|
loading.value = false
|
|
|
valiFormData.value.code = ''
|
|
|
- // editSpaceNo.value && (valiFormData.value.space_id = '');
|
|
|
}
|
|
|
|
|
|
const submitSpace = () => {
|
|
@@ -201,7 +189,6 @@ const onsubmit = async () => {
|
|
|
})
|
|
|
loading.value = false
|
|
|
const space = options.space.find((item: any) => item.value === valiFormData.value.space_id)
|
|
|
- console.log('res--', res)
|
|
|
|
|
|
if (res.code == 1) {
|
|
|
messageType.value = 'success'
|
|
@@ -222,16 +209,16 @@ const onsubmit = async () => {
|
|
|
messageText.value = res.msg
|
|
|
messageRef.value.open()
|
|
|
|
|
|
- // const historyItem = {
|
|
|
- // code: valiFormData.value.code,
|
|
|
- // createTime: new Date(),
|
|
|
- // type: '运单号',
|
|
|
- // space: space.text,
|
|
|
- // status: false,
|
|
|
- // }
|
|
|
- // waybillNoHistory.value.unshift(historyItem)
|
|
|
- // uni.setStorageSync('waybillNoHistory', waybillNoHistory.value)
|
|
|
- // getHistory()
|
|
|
+ const historyItem = {
|
|
|
+ code: valiFormData.value.code,
|
|
|
+ createTime: new Date(),
|
|
|
+ type: '运单号',
|
|
|
+ space: space.text,
|
|
|
+ status: false,
|
|
|
+ }
|
|
|
+ waybillNoHistory.value.unshift(historyItem)
|
|
|
+ uni.setStorageSync('waybillNoHistory', waybillNoHistory.value)
|
|
|
+ getHistory()
|
|
|
}
|
|
|
st = setTimeout(() => {
|
|
|
reset()
|
|
@@ -256,7 +243,6 @@ const getHistory = () => {
|
|
|
waybillNoHistory.value = uni.getStorageSync('waybillNoHistory') || []
|
|
|
}
|
|
|
const keypress = (e: any) => {
|
|
|
- console.log(e, '按键码')
|
|
|
// 102 左侧 103 右侧 104 中间按键
|
|
|
if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
|
|
|
//这里按键成功
|
|
@@ -264,7 +250,6 @@ const keypress = (e: any) => {
|
|
|
|
|
|
if (e.keyCode == 66) {
|
|
|
//enter按键
|
|
|
- //这里input已经拿到数据了,在这里把拿到的数据,通过接口数据联调起来
|
|
|
onsubmit()
|
|
|
}
|
|
|
}
|
|
@@ -307,17 +292,12 @@ onBackPress(() => {
|
|
|
})
|
|
|
onShow(() => {
|
|
|
hidePage.value = false
|
|
|
- // token.value = uni.getStorageSync('token')
|
|
|
getOptions()
|
|
|
getHistory()
|
|
|
})
|
|
|
|
|
|
// 获取选项
|
|
|
const getOptions = async () => {
|
|
|
- // 1 调用services定义的方法 获取选项数据
|
|
|
- // 2 判断获取的数据是否成功,code === 1
|
|
|
- // 3 如果成功,将数据赋值给options.space数组中
|
|
|
-
|
|
|
const res = await waybillNoOptions()
|
|
|
if (res.code === 1) {
|
|
|
for (let key in res.data.space_id) {
|
|
@@ -327,29 +307,6 @@ const getOptions = async () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /**
|
|
|
- uni.request({
|
|
|
- url: 'url',
|
|
|
- method: 'GET',
|
|
|
- header: {
|
|
|
- // batoken: token.value,
|
|
|
- },
|
|
|
- success: (res: any) => {
|
|
|
- console.log(res)
|
|
|
- if (res.code === 1) {
|
|
|
- for (let key in res.data.space_id) {
|
|
|
- // eslint-disable-next-line no-prototype-builtins
|
|
|
- if (res.data.space_id.hasOwnProperty(key)) {
|
|
|
- options.space.push({ text: res.data.space_id[key], value: key })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- fail(e) {
|
|
|
- console.log('fail--', e)
|
|
|
- },
|
|
|
- })
|
|
|
- */
|
|
|
}
|
|
|
|
|
|
const setFocus = () => {
|
|
@@ -365,7 +322,7 @@ const setFocus = () => {
|
|
|
onNavigationBarButtonTap((event) => {
|
|
|
if (event.index === 0) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/waybillNo/waybillNoHistory',
|
|
|
+ url: '/pages/waybillNo/logList',
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -389,7 +346,7 @@ button {
|
|
|
justify-content: center;
|
|
|
height: 35px;
|
|
|
margin-left: 20rpx;
|
|
|
- font-size: 16rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
}
|
|
|
|
|
|
.weight-tip {
|
|
@@ -410,7 +367,7 @@ button {
|
|
|
height: 35px;
|
|
|
width: 50%;
|
|
|
margin-left: 10px;
|
|
|
- font-size: 16rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
}
|
|
|
|
|
|
.uni-icons {
|
|
@@ -430,11 +387,6 @@ button {
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
|
|
|
- // .type {
|
|
|
- // padding-right: 20rpx;
|
|
|
- // font-size: 24rpx;
|
|
|
- // }
|
|
|
-
|
|
|
.code {
|
|
|
font-weight: 600;
|
|
|
}
|
|
@@ -443,8 +395,9 @@ button {
|
|
|
padding: 20rpx;
|
|
|
font-size: 20rpx;
|
|
|
color: #666;
|
|
|
- // display: flex;
|
|
|
- // flex-direction: row;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
|
|
|
.status {
|
|
|
padding-left: 20rpx;
|