|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<view >
|
|
|
<u-navbar title="申请归还">
|
|
|
- <view slot="right" style="margin-right: 10px;">
|
|
|
+ <!-- <view slot="right" style="margin-right: 10px;">
|
|
|
|
|
|
<u-icon name="scan" size="48" @click="gotoscan('')"></u-icon>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</u-navbar>
|
|
|
|
|
|
|
|
@@ -19,7 +19,7 @@
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
+ <view class="item" v-if="false">
|
|
|
<view class="name">
|
|
|
归还至
|
|
|
</view>
|
|
@@ -31,6 +31,68 @@
|
|
|
|
|
|
|
|
|
</view>
|
|
|
+ <u-popup v-model="showpopup" class="" mode="bottom"
|
|
|
+ border-radius="14"
|
|
|
+ :closeable="true" >
|
|
|
+ <view class="scantitle">连续扫码</view>
|
|
|
+ <view class="list">
|
|
|
+ <view class=" list-infos">
|
|
|
+ <view class="infos-head">
|
|
|
+ <view class="name">
|
|
|
+ {{nowscan.title?nowscan.title:'扫码后出当前结果'}}
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="name">
|
|
|
+ 编号:{{nowscan.code}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="infos">
|
|
|
+ <view class="infos-1">
|
|
|
+ <view class="infos-item">
|
|
|
+ <view class="item-name">
|
|
|
+ 厂家:
|
|
|
+ </view>
|
|
|
+ <view class="item-value">
|
|
|
+ {{nowscan.manufactor}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="infos-item">
|
|
|
+ <view class="item-name">
|
|
|
+ 单位:
|
|
|
+ </view>
|
|
|
+ <view class="item-value">
|
|
|
+ {{nowscan.unit}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="infos-2">
|
|
|
+ <view class="infos-item">
|
|
|
+ <view class="item-name">
|
|
|
+ 规格:
|
|
|
+ </view>
|
|
|
+ <view class="item-value">
|
|
|
+ {{nowscan.specifications}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="infos-item">
|
|
|
+ <view class="item-name">
|
|
|
+ 型号:
|
|
|
+ </view>
|
|
|
+ <view class="item-value">
|
|
|
+ {{nowscan.model}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <camera mode="scanCode" resolution='medium'
|
|
|
+ @scancode="takeCode" v-if="showpopup"
|
|
|
+ device-position="back" flash="off" @error="error"
|
|
|
+ style="width: 100%; height: 300px;"></camera>
|
|
|
+
|
|
|
+ </u-popup>
|
|
|
<!-- 出库设备清单 -->
|
|
|
<view class="list">
|
|
|
<view class="list-head">
|
|
@@ -96,8 +158,10 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 确认出库 -->
|
|
|
- <view class="bottom" @click="gotoOut()" >
|
|
|
- <button>确认出库</button>
|
|
|
+ <view class="bottom" >
|
|
|
+
|
|
|
+ <u-button type="primary" @click="gotoOut()" >确认归还</u-button>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -108,7 +172,21 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ scanFunctionIsUseable:true,
|
|
|
+ nowscan:{
|
|
|
+ "title": "",
|
|
|
+ "specifications": "",
|
|
|
+
|
|
|
+ "manufactor": "",
|
|
|
+ "unit": "",
|
|
|
+ "model": "",
|
|
|
+ "code": "",
|
|
|
+
|
|
|
+ },
|
|
|
address:"",
|
|
|
+ showpopup:false,
|
|
|
+ deviceposition:"back",
|
|
|
+
|
|
|
form:{
|
|
|
projectName:"",
|
|
|
addressId:"",
|
|
@@ -200,6 +278,15 @@
|
|
|
})
|
|
|
},
|
|
|
getscan(val) {
|
|
|
+ this.showpopup=true;
|
|
|
+ var c = this.scanList.find(item => {
|
|
|
+ return item.code == val
|
|
|
+ })
|
|
|
+ if (c) {
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
@@ -211,7 +298,7 @@
|
|
|
uni.hideLoading();
|
|
|
if (res.data.deviceInfo) {
|
|
|
console.log(res.data.deviceInfo)
|
|
|
-
|
|
|
+ this.nowscan=res.data.deviceInfo;
|
|
|
var c = this.scanList.find(item => {
|
|
|
return item.id == res.data.deviceInfo.id
|
|
|
})
|
|
@@ -244,8 +331,47 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ error(e) {
|
|
|
+ console.log(e.detail);
|
|
|
+ },
|
|
|
gotoscan(val) {
|
|
|
+ // #ifdef H5
|
|
|
+ this.gotoscanH5(val)
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+
|
|
|
+ this.gotoscanMP(val)
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ takeCode(e){
|
|
|
+ console.log(e);
|
|
|
+ if(this.scanFunctionIsUseable) {
|
|
|
+ this.scanFunctionIsUseable = false;
|
|
|
+ // 对扫码结果进行处理
|
|
|
+ console.log(e.detail.result);
|
|
|
+ this.getscan(e.detail.result)
|
|
|
+ // 扫码间隔两秒
|
|
|
+ setTimeout(() => {
|
|
|
+ this.scanFunctionIsUseable = true;
|
|
|
+
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ gotoscanMP(val){
|
|
|
+ this.showpopup=true;
|
|
|
+ // const ctx = uni.createCameraContext();
|
|
|
+ // ctx.takePhoto({
|
|
|
+ // quality: 'high',
|
|
|
+ // success: (res) => {
|
|
|
+ // this.src = res.tempImagePath
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ gotoscanH5(val) {
|
|
|
console.log('111')
|
|
|
+
|
|
|
var _this = this;
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
@@ -259,12 +385,19 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+ .scantitle{
|
|
|
+ text-align: center;
|
|
|
+ font-size: 44rpx;
|
|
|
+ padding-top: 20px;
|
|
|
+ }
|
|
|
page {
|
|
|
padding-bottom: 200rpx;
|
|
|
}
|