Merge branch 'main-cq' of http://192.168.0.56:3000/hywen/SmartStorage into main-cq

This commit is contained in:
BianLzhaoMin 2024-11-04 15:49:52 +08:00
commit 232331df54
13 changed files with 639 additions and 248 deletions

View File

@ -19,8 +19,8 @@ class Http {
title: "登录状态过期,请重新登录!",
success: () => {
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});
@ -56,8 +56,8 @@ class Http {
title: "登录状态过期,请重新登录!",
success: () => {
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});
@ -93,8 +93,8 @@ class Http {
title: "登录状态过期,请重新登录!",
success: () => {
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});
@ -129,8 +129,8 @@ class Http {
title: "登录状态过期,请重新登录!",
success: () => {
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});
@ -163,8 +163,8 @@ class Http {
title: "登录状态过期,请重新登录!",
success: () => {
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});

View File

@ -25,12 +25,13 @@
<span>待退料数量</span>
<h4>{{ fetch.maxBackNum }}</h4>
</view>
<!-- v-if="
fetch.maxBackNum * 1 > 0 &&
store.includes('return:receive:view')
" -->
<h5
@click="openPopup(fetch)"
v-if="
fetch.maxBackNum * 1 > 0 &&
store.includes('return:receive:view')
">
>
点击退料
</h5>
</view>
@ -42,10 +43,11 @@
</checkbox-group>
<text>全选</text>
</view> -->
<!-- v-if="store.includes('return:receive:view')" -->
<view
class="exam"
@click="totalBack"
v-if="store.includes('return:receive:view')">
>
完成退料
</view>
</view>
@ -72,7 +74,7 @@
<view class="select-area">
<view @click="scanCode">二维码</view>
<view @click="codeOut">编码接收</view>
<!-- <view @click="rfidOut">RFID接收</view> -->
<view @click="rfidOut">RFID接收</view>
</view>
<!-- <view class="ipt-area">
<uni-easyinput v-model="codeVal" placeholder="请输入编码"></uni-easyinput>
@ -186,7 +188,8 @@
this.infoList = list;
this.rfidNum = list.maxBackNum;
this.transMaCode = list.code;
this.sendTypeId = list.typeId;
// this.sendTypeId = list.typeId;
this.sendTypeId = list.modelId
this.parentId = list.id;
if (Number(list.maxBackNum) == 0) {
uni.showToast({

View File

@ -363,8 +363,8 @@
uni.removeStorageSync("token");
uni.removeStorageSync("userInfo");
uni.reLaunch({
// url: '/pages/login/login'
url: "/pages/nwLogin/index",
url: '/pages/login/login'
// url: "/pages/nwLogin/index",
});
},
});

View File

@ -440,8 +440,8 @@
uni.removeStorageSync("token");
uni.removeStorageSync("userInfo");
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});

View File

@ -655,8 +655,8 @@
uni.removeStorageSync("token");
uni.removeStorageSync("userInfo");
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
},
});

View File

@ -41,7 +41,7 @@
<view class="select-area">
<view @click="scanCode">二维码</view>
<view @click="codeOut">编码出库</view>
<!-- <view @click="rfidOut">RFID出库</view> -->
<view @click="rfidOut">RFID出库</view>
</view>
<!-- <view class="ipt-area">
<uni-easyinput v-model="codeVal" placeholder="请输入编码"></uni-easyinput>

View File

@ -272,12 +272,12 @@
success: () => {
uni.removeStorageSync("token");
uni.removeStorageSync("userInfo");
// uni.reLaunch({
// url: "/pages/login/login",
// });
uni.reLaunch({
url: "/pages/nwLogin/index",
url: "/pages/login/login",
});
// uni.reLaunch({
// url: "/pages/nwLogin/index",
// });
},
});
}

View File

@ -2,22 +2,14 @@
<view class="hole-page">
<view class="upper-bgd">
<h4 style="font-size: 16px; font-weight: normal;">RFID标签绑定</h4>
<uni-data-select
v-model="powerVal"
:localdata="powerRange"
placeholder="请选择功率"
@change="powerChange"
:clear="false"
></uni-data-select>
<uni-data-select v-model="powerVal" :localdata="powerRange" placeholder="请选择功率" @change="powerChange"
:clear="false"></uni-data-select>
</view>
<view class="lower-rfid" v-show="showStats">
<view class="stat-cont">
<view class="cont-upper">
<h4 style="font-size: 14px;">识别数据</h4>
<view
style="color: #3198FF; font-size: 12px;"
@click="clearStat"
>
<view style="color: #3198FF; font-size: 12px;" @click="clearStat">
<uni-icons type="trash" size="12" style="color: #3198FF;"></uni-icons>
清空数据
</view>
@ -39,7 +31,7 @@
<h4>物资状态</h4>
<span>{{ bindStats.sdStatus }}</span>
</view>
<view>
<!-- <view>
<h4>本次维修时间</h4>
<span>5</span>
</view>
@ -54,13 +46,51 @@
<view>
<h4>领料单位名称</h4>
<span>8</span>
</view>
</view> -->
</view>
</view>
</view>
<view v-show="showDev">
<uni-forms ref="qrForm" :modelValue="qrFormData" label-position="top" :rules="rules" class="qr-stats">
<uni-forms-item name="typeVal" required label="设备类型">
<zxz-uni-data-select v-model="qrFormData.typeVal" :localdata="typeRange" @change="typeChange"
filterable>
</zxz-uni-data-select>
</uni-forms-item>
<uni-forms-item name="specVal" required label="规格型号">
<uni-data-select v-model="qrFormData.specVal" :localdata="specRange"
@change="specChange"></uni-data-select>
</uni-forms-item>
<view class="middle">
<h4 style="font-weight: normal; margin-bottom: 15rpx;">标签编号</h4>
<span>{{ qrcode }}</span>
</view>
<uni-forms-item name="deviceCode" required label="设备编号">
<uni-easyinput v-model="qrFormData.deviceCode"></uni-easyinput>
</uni-forms-item>
<view>
<view>RFID:</view>
<input class="uni-input" readonly v-model="rfid" />
</view>
</uni-forms>
<u-loading-page :loading="showLoading" color="#000" loading-text="加载中,请稍后..."></u-loading-page>
</view>
<!-- <div v-if="showPrompt" class="prompt">{{ promptMessage }}</div> -->
<!-- 添加新的加载效果 -->
<div v-if="showPrompt" class="custom-loading-overlay">
<div class="custom-loading-content">
<div class="custom-spinner"></div>
<p>{{ promptMessage }}</p>
</div>
</div>
<view class="btns-area">
<view @click="startVeri">开始识别</view>
<view @click="toggleBind">绑定</view>
<view @click="toggleBind" v-show="showBid">绑定</view>
<view @click="toggleBinds" v-show="showDev">绑定</view>
</view>
</view>
</template>
@ -71,94 +101,156 @@
data() {
return {
showStats: false,
showDev: false,
showBid: true,
rfidCode: '',
maId: '',
maCode: '',
powerVal: 0,
powerRange: [
],
bindStats: {}
bindStats: {},
showLoading: false,
qrFormData: {
typeVal: '',
specVal: '',
deviceCode: ''
},
rules: {
typeVal: {
rules: [{
required: true,
errorMessage: '请输设备类型!'
}]
},
specVal: {
rules: [{
required: true,
errorMessage: '请输规格型号!'
}]
},
deviceCode: {
rules: [{
required: true,
errorMessage: '请输设备编号!'
}]
},
},
qrcode: '',
typeRange: [],
specRange: [],
rfid: '',
showPrompt: false, //
promptMessage: '' //
}
},
methods: {
startVeri () {
startVeri() {
let that = this
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.rfidCode = goVeri.res
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.fetchMaterialOutStore.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.bindStats = res.data.data[0]
that.maCode = res.data.data[0].maCode
that.maId = res.data.data[0].maId
that.showStats = true
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
that.showPrompt = true;
that.promptMessage = '识别中,请稍候...';
// Toast
setTimeout(() => {
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.showPrompt = false; //
that.rfidCode = goVeri.res
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.fetchMaterialOutStore.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
console.log(res.data.data[0]);
if (res.data.data.length > 0) {
that.bindStats = res.data.data[0]
that.maCode = res.data.data[0].maCode
that.maId = res.data.data[0].maId
that.showStats = true
that.showDev = false
that.showBid = true
} else {
that.showDev = true
that.showBid = false
that.showStats = false
that.rfid = that.rfidCode
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showPrompt = false; //
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
}, 1000)
},
toggleBind () {
toggleBind() {
let that = this
if (that.maCode == '' || that.maId == '') {
uni.showToast({
icon: 'none',
title: '未识别到绑定设备!'
})
} else {
that.$api.rfidBinding.bindRfid({
rfidCode: that.rfidCode,
maId: that.maId,
maCode: that.maCode,
}).then(res => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.switchTab({
url: '/pages/workSpace/workSpace'
})
}
})
} else {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
}
this.showPrompt = true;
this.promptMessage = '正在绑定,请稍候...';
// Toast
setTimeout(() => {
if (that.maCode == '' || that.maId == '') {
this.showPrompt = false; //
uni.showToast({
icon: 'none',
title: '未识别到绑定设备!'
})
} else {
that.$api.rfidBinding.bindRfid({
rfidCode: that.rfidCode,
maId: that.maId,
maCode: that.maCode,
}).then(res => {
this.showPrompt = false; //
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.switchTab({
url: '/pages/workSpace/workSpace'
})
}
})
} else {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
this.showPrompt = false; //
console.log(err);
})
}
}, 1000)
},
clearStat () {
clearStat() {
let that = this
that.rfidCode = ''
that.maCode = ''
that.maId = ''
that.showStats = false
},
powerChange (e) {
powerChange(e) {
console.log(e);
const ctrlPower = rfidMod.setPower(e)
console.log(ctrlPower);
@ -166,7 +258,88 @@
icon: 'none',
title: ctrlPower.res
})
},
//
typeChange(e) {
let that = this
console.log(e);
//
that.$api.qrcodeBinding.fetchDeviceSpec({
level: '4',
parentId: String(e.value)
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.specRange = res.data.data.map(item => {
return {
text: item['typeName'],
value: item['typeId'],
code: item['code'],
modelCode: item['modelCode']
}
})
}
}).catch(err => {
console.log(err);
})
},
specChange(e) {
let that = this
console.log(e, that.specRange);
const confirmedRange = that.specRange.filter(item => {
return item.value == e
})
console.log(confirmedRange);
if (confirmedRange[0].code && confirmedRange[0].modelCode) {
that.qrFormData.deviceCode = `NS${confirmedRange[0].code}${confirmedRange[0].modelCode}`
} else {
that.qrFormData.deviceCode = ''
}
},
toggleBinds() {
let that = this
this.showPrompt = true;
this.promptMessage = '识别中,请稍候...';
// Toast
setTimeout(() => {
that.$refs.qrForm.validate().then(formData => {
that.showLoading = true
console.log(formData);
that.$api.rfidBinding.bindRfid({
rfidCode: that.rfidCode,
maCode: formData.deviceCode,
}).then(res => {
this.showPrompt = false; //
console.log(res);
if (res.data.code == 200) {
that.showLoading = false
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.switchTab({
url: '/pages/workSpace/workSpace'
})
}
})
} else {
that.showLoading = false
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
this.showPrompt = false; //
console.log(err);
})
})
}, 1000)
}
},
onLoad() {
// rfid
@ -179,12 +352,30 @@
text: String(i)
})
}
let that = this
//
that.$api.qrcodeBinding.fetchDeviceType({
level: '3'
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.typeRange = res.data.data.map(item => {
return {
text: item['typeName'],
value: item['typeId']
}
})
}
}).catch(err => {
console.log(err);
})
}
}
</script>
<style lang="scss">
.hole-page{
.hole-page {
width: 100vw;
height: 100vh;
display: flex;
@ -193,7 +384,8 @@
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;
.upper-bgd{
.upper-bgd {
width: 100%;
height: 20%;
box-sizing: border-box;
@ -201,53 +393,63 @@
display: flex;
flex-direction: column;
justify-content: space-around;
h4{
h4 {
color: #fff;
}
.uni-select[data-v-6b64008e] {
background-color: #fff;
}
}
.lower-rfid{
.lower-rfid {
flex: 1;
margin-top: -3%;
border-radius: 25rpx;
box-sizing: border-box;
padding: 0 25rpx;
.stat-cont{
.stat-cont {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
.cont-upper{
.cont-upper {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.cont-lower{
.cont-lower {
width: 100%;
display: flex;
flex-direction: column;
view{
view {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 20rpx;
h4{
h4 {
width: 35%;
font-weight: normal;
font-size: 14px;
color: #929292;
}
span{
span {
font-size: 14px;
}
}
}
}
}
.btns-area{
.btns-area {
position: absolute;
width: 70%;
left: 15%;
@ -256,7 +458,8 @@
display: flex;
flex-direction: column;
justify-content: space-around;
view{
view {
width: 100%;
box-sizing: border-box;
padding: 15rpx 0;
@ -270,4 +473,37 @@
}
}
}
</style>
//
.custom-loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.custom-loading-content {
background-color: white;
padding: 20px;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
}
.custom-spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 10px;
}
</style>

View File

@ -1,5 +1,16 @@
<template>
<view>
<!-- <div v-if="showPrompt" class="prompt">{{ promptMessage }}</div> -->
<!-- 添加新的加载效果 -->
<div v-if="showPrompt" class="custom-loading-overlay">
<div class="custom-loading-content">
<div class="custom-spinner"></div>
<p>{{ promptMessage }}</p>
</div>
</div>
<view class="btn-area">
<view @click="startVeri">开始识别</view>
<view @click="stopVeri">停止识别</view>
@ -9,14 +20,13 @@
<h4>
待出库数{{ waitOutNum }}
</h4>
<h4
style="margin-left: 15rpx;"
>
<h4 style="margin-left: 15rpx;">
识别设备数{{ veriDeviceNum }}
</h4>
</view>
<view class="table-container" v-show="tableData.length != 0">
<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据" @selection-change="selectionChange">
<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
@selection-change="selectionChange">
<uni-tr>
<uni-th align="center">类型</uni-th>
<uni-th align="center">规格</uni-th>
@ -106,7 +116,9 @@
value: '3'
}
],
showLoading: false
showLoading: false,
showPrompt: false, //
promptMessage: '' //
}
},
methods: {
@ -120,7 +132,7 @@
})
console.log(that.selectedIndexs);
},
openPop () {
openPop() {
let that = this
if (this.selectedIndexs.length == 0) {
uni.showToast({
@ -158,7 +170,8 @@
// backStatus: that.fixVal,
// manageType: item['manageType'],
// createBy: uni.getStorageSync('userInfo').userid,
maId: item['maId']
maId: item['maId'],
manageType:0
}
})
console.log(that.subList);
@ -185,7 +198,7 @@
}
}
},
confirmDevice () {
confirmDevice() {
let that = this
if (that.fixVal == '') {
uni.showToast({
@ -210,10 +223,10 @@
}
console.log(param);
//
}
},
fixChange (e) {
fixChange(e) {
let that = this
that.subList = []
for (let i = 0; i < that.selectedIndexs.length; i++) {
@ -249,42 +262,61 @@
console.log(that.subList);
}
}, */
startVeri () {
startVeri() {
let that = this
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.showLoading = true
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.fetchMaterialOutStore.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.showLoading = false
that.veriDeviceNum = that.veriDeviceNum + res.data.data.length
for (let i = 0; i < res.data.data.length; i++) {
that.tableData.push(res.data.data[i])
that.showPrompt = true;
that.promptMessage = '识别中,请稍候...';
// Toast
setTimeout(() => {
let b = rfidMod.initUHF()
console.log(b);
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.showLoading = true
that.showPrompt = false; //
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.fetchMaterialOutStore.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.showLoading = false
that.veriDeviceNum = that.veriDeviceNum + res.data
.data
.length
if (res.data.data.length > 0) {
for (let i = 0; i < res.data.data.length; i++) {
that.tableData.push(res.data.data[i])
}
} else {
uni.showToast({
icon: 'none',
title: "未找到相关信息"
})
}
}
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showPrompt = false; //
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
}, 1000)
},
stopVeri () {
stopVeri() {
let endVeri = rfidMod.closeRfid()
console.log(endVeri);
if (endVeri.code == 1001) {
@ -292,9 +324,14 @@
icon: 'none',
title: endVeri.res
})
} else {
uni.showToast({
icon: 'none',
title: endVeri.res
})
}
},
closePopup1 () {
closePopup1() {
this.fixVal = ''
this.$refs.popup1.close()
}
@ -314,13 +351,14 @@
</script>
<style lang="scss">
.btn-area{
.btn-area {
width: 90%;
margin: 20rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
view{
view {
width: 30%;
box-sizing: border-box;
padding: 15rpx;
@ -332,26 +370,31 @@
color: #fff;
font-size: 14px;
}
view:last-child{
view:last-child {
background-color: #70B603;
}
}
.number{
.number {
width: 90%;
margin: 20rpx auto;
display: flex;
align-items: center;
h4{
h4 {
font-weight: normal;
font-size: 12px;
display: flex;
align-items: center;
}
}
.table-container{
.table-container {
width: 90%;
margin: 20rpx auto;
}
.popup1 {
width: 80vw;
height: 40vh;
@ -359,7 +402,7 @@
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top {
width: 100%;
height: 5vh;
@ -369,14 +412,14 @@
justify-content: space-between;
align-items: center;
}
.select-area {
width: 85%;
margin: 40rpx auto;
display: flex;
justify-content: space-around;
align-items: center;
/* view {
box-sizing: border-box;
font-size: 14px;
@ -385,13 +428,13 @@
border-radius: 20rpx;
} */
}
.ipt-area {
width: 85%;
margin: 40rpx auto;
}
.btn{
.btn {
width: 60%;
margin: 2vh auto;
box-sizing: border-box;
@ -404,4 +447,37 @@
background-color: #169BD5;
}
}
</style>
//
.custom-loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.custom-loading-content {
background-color: white;
padding: 20px;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
}
.custom-spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 10px;
}
</style>

View File

@ -1,5 +1,15 @@
<template>
<view>
<!-- <div v-if="showPrompt" class="prompt">{{ promptMessage }}</div> -->
<!-- 添加新的加载效果 -->
<div v-if="showPrompt" class="custom-loading-overlay">
<div class="custom-loading-content">
<div class="custom-spinner"></div>
<p>{{ promptMessage }}</p>
</div>
</div>
<view class="btn-area">
<view @click="startVeri">开始识别</view>
<view @click="stopVeri">停止识别</view>
@ -9,14 +19,13 @@
<h4>
待出库数{{ waitOutNum }}
</h4>
<h4
style="margin-left: 15rpx;"
>
<h4 style="margin-left: 15rpx;">
识别设备数{{ veriDeviceNum }}
</h4>
</view>
<view class="table-container" v-show="tableData.length != 0">
<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据" @selection-change="selectionChange">
<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
@selection-change="selectionChange">
<uni-tr>
<uni-th align="center">类型</uni-th>
<uni-th align="center">规格</uni-th>
@ -106,7 +115,9 @@
value: '3'
}
],
showLoading: false
showLoading: false,
showPrompt: false, //
promptMessage: '' //
}
},
methods: {
@ -120,7 +131,7 @@
})
console.log(that.selectedIndexs);
},
openPop () {
openPop() {
if (this.selectedIndexs.length == 0) {
uni.showToast({
icon: 'none',
@ -130,8 +141,10 @@
this.$refs.popup1.open()
}
},
confirmDevice () {
confirmDevice() {
let that = this
console.log(that.subList)
console.log(that.sendTypeId)
let ifAllRight = that.subList.some(item => {
return item.typeId != that.sendTypeId
})
@ -191,7 +204,7 @@
})
}
},
fixChange (e) {
fixChange(e) {
let that = this
that.subList = []
for (let i = 0; i < that.selectedIndexs.length; i++) {
@ -227,42 +240,60 @@
console.log(that.subList);
}
}, */
startVeri () {
startVeri() {
let that = this
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.showLoading = true
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.backMaterialReceive.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.showLoading = false
that.veriDeviceNum = that.veriDeviceNum + res.data.data.length
for (let i = 0; i < res.data.data.length; i++) {
that.tableData.push(res.data.data[i])
that.showPrompt = true;
that.promptMessage = '识别中,请稍候...';
// Toast
setTimeout(() => {
let b = rfidMod.initUHF()
console.log(b);
let goVeri = rfidMod.redTag()
console.log(goVeri);
if (goVeri.code == 1001) {
that.showLoading = true
that.showPrompt = false; //
uni.showToast({
icon: 'none',
title: '识别成功',
success: () => {
//
that.$api.backMaterialReceive.searchRfid({
rfidCode: goVeri.res
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.showLoading = false
that.veriDeviceNum = that.veriDeviceNum + res.data.data
.length
if (res.data.data.length > 0) {
for (let i = 0; i < res.data.data.length; i++) {
that.tableData.push(res.data.data[i])
}
} else {
uni.showToast({
icon: 'none',
title: "未找到相关信息"
})
}
}
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
}).catch(err => {
console.log(err);
})
}
})
} else if (goVeri.code == 1000) {
that.showPrompt = false; //
that.showLoading = false
uni.showToast({
icon: 'none',
title: '获取设备信息失败,请重新扫描!'
})
}
}, 1000)
},
stopVeri () {
stopVeri() {
let endVeri = rfidMod.closeRfid()
console.log(endVeri);
if (endVeri.code == 1001) {
@ -270,9 +301,14 @@
icon: 'none',
title: endVeri.res
})
} else {
uni.showToast({
icon: 'none',
title: endVeri.res
})
}
},
closePopup1 () {
closePopup1() {
this.fixVal = ''
this.$refs.popup1.close()
}
@ -292,13 +328,14 @@
</script>
<style lang="scss">
.btn-area{
.btn-area {
width: 90%;
margin: 20rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
view{
view {
width: 30%;
box-sizing: border-box;
padding: 15rpx;
@ -310,26 +347,31 @@
color: #fff;
font-size: 14px;
}
view:last-child{
view:last-child {
background-color: #70B603;
}
}
.number{
.number {
width: 90%;
margin: 20rpx auto;
display: flex;
align-items: center;
h4{
h4 {
font-weight: normal;
font-size: 12px;
display: flex;
align-items: center;
}
}
.table-container{
.table-container {
width: 90%;
margin: 20rpx auto;
}
.popup1 {
width: 80vw;
height: 30vh;
@ -337,7 +379,7 @@
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top {
width: 100%;
height: 5vh;
@ -347,14 +389,14 @@
justify-content: space-between;
align-items: center;
}
.select-area {
width: 85%;
margin: 40rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
/* view {
box-sizing: border-box;
font-size: 14px;
@ -363,13 +405,13 @@
border-radius: 20rpx;
} */
}
.ipt-area {
width: 85%;
margin: 40rpx auto;
}
.btn{
.btn {
width: 60%;
margin: 2vh auto;
box-sizing: border-box;
@ -382,4 +424,37 @@
background-color: #169BD5;
}
}
</style>
//
.custom-loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.custom-loading-content {
background-color: white;
padding: 20px;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
}
.custom-spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 10px;
}
</style>

View File

@ -72,8 +72,8 @@
uni.removeStorageSync("token");
uni.removeStorageSync("userInfo");
uni.reLaunch({
// url: "/pages/login/login",
url: "/pages/nwLogin/index",
url: "/pages/login/login",
// url: "/pages/nwLogin/index",
});
}
},

View File

@ -89,11 +89,12 @@
url: "exitExam",
isShow: "*:*:*",
},
/* {
{
name: 'RFID绑定',
pic: '/static/rfidBinding.png',
url: 'rfidBinding'
}, */
url: 'rfidBinding',
isShow: "*:*:*",
},
{
name: "二维码绑定",
pic: "/static/qrcodeBinding.png",

View File

@ -25,16 +25,16 @@ const router = createRouter({
},
},
// 重庆登录页
// {
// path: "/pages/login/login",
// name: "login",
// },
// 南网登陆页
{
path: "/pages/nwLogin/index",
path: "/pages/login/login",
name: "login",
},
// 南网登陆页
// {
// path: "/pages/nwLogin/index",
// name: "login",
// },
{
path: "/pages/fetchMaterial/fetchMaterial",
name: "fetchMaterial",