300 lines
8.8 KiB
Vue
Executable File
300 lines
8.8 KiB
Vue
Executable File
<template>
|
|
<view class="page">
|
|
<opsoft-dialog-notice
|
|
:dialogNoticeShow="showDialog"
|
|
:dialogNoticeType="dialogNoticeType"
|
|
:dialogNoticeTitle="dialogNoticeTitle"
|
|
:dialogNoticeContent="dialogNoticeContent"
|
|
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
|
|
>
|
|
</opsoft-dialog-notice>
|
|
<view class="head">
|
|
<view class="search">
|
|
<text class="search-title">内屏条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder="录入内屏条码" placeholder-class="placeholder-class-input"
|
|
v-model="innerBarcode" @confirm="innerBarcodeConfirm" :focus="innerBarcodeFocus"></input>
|
|
</view>
|
|
<image class="search-img" src="../../../static/img/scan-blue.png" @click="barcodeScan('innerBarcodeScan')"></image>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">中包装条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder="录入中包装条码" placeholder-class="placeholder-class-input"
|
|
v-model="middleBarcode" @confirm="middleBarcodeConfirm" :focus="middleBarcodeFocus"></input>
|
|
</view>
|
|
<image class="search-img" src="../../../static/img/scan-blue.png" @click="barcodeScan('middleBarcodeScan')"></image>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">外包装条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder="录入外包装条码" placeholder-class="placeholder-class-input"
|
|
v-model="outsideBarcode" @confirm="outsideBarcodeConfirm" :focus="outsideBarcodeFocus"></input>
|
|
</view>
|
|
<image class="search-img" src="../../../static/img/scan-blue.png" @click="barcodeScan('outsideBarcodeScan')"></image>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="head">
|
|
<view class="search">
|
|
<text class="search-title">内屏条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="innerBarcodeShow" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">中包装条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="middleBarcodeShow" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">外包装条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="outsideBarcodeShow" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="table">
|
|
<z-table :tableData='detailTableData' :columns='detailColumns'/>
|
|
</view>
|
|
<view class="submitBtn" @click="submit">提交</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import Vue from 'vue';
|
|
import zTable from "../../../components/z-table/z-table.vue";
|
|
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
|
|
import errorStrUntil from '@/common/errorStrUntil.js';
|
|
import {
|
|
mapState,
|
|
mapMutations
|
|
} from 'vuex';
|
|
|
|
export default {
|
|
components: {
|
|
zTable,
|
|
opsoftDialogNotice
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
dialogNoticeContent:'',
|
|
dialogNoticeTitle:'',
|
|
dialogNoticeType:'',
|
|
showDialog:false,
|
|
|
|
innerBarcode:'',
|
|
middleBarcode:'',
|
|
outsideBarcode:'',
|
|
innerBarcodeFocus:false,
|
|
middleBarcodeFocus:false,
|
|
outsideBarcodeFocus:false,
|
|
|
|
innerBarcodeShow:'',
|
|
middleBarcodeShow:'',
|
|
outsideBarcodeShow:'',
|
|
|
|
detailTableData:[],
|
|
detailColumns: [
|
|
{ title: "内屏条码", key: "Inner", width: 350, formatNum: false },
|
|
{ title: "中包装条码", key: "Middle", width: 350, formatNum: false },
|
|
{ title: "外包装条码", key: "Outer", width: 350, formatNum: false }],
|
|
|
|
}
|
|
},
|
|
|
|
onLoad() {
|
|
this.innerBarFocus();
|
|
},
|
|
computed: {},
|
|
|
|
methods: {
|
|
dialogNoticeConfirmClick(){
|
|
this.showDialog = false;
|
|
},
|
|
dialogNoticeProps(err,type){
|
|
err = errorStrUntil.handle(err);
|
|
this.showDialog = true;
|
|
this.dialogNoticeType = 'error';
|
|
this.dialogNoticeTitle = '异常提示';
|
|
if(type=='success'){
|
|
this.dialogNoticeType = 'success';
|
|
this.dialogNoticeTitle = '执行成功';
|
|
}
|
|
this.dialogNoticeContent = err;
|
|
},
|
|
barcodeScan(barcodeType){
|
|
let _self = this;
|
|
uni.scanCode({
|
|
success:function(result){
|
|
if(barcodeType=='innerBarcodeScan'){
|
|
_self.innerBarcode = result.result;
|
|
_self.innerBarcodeConfirm();
|
|
}
|
|
if(barcodeType=='middleBarcodeScan'){
|
|
_self.middleBarcode = result.result;
|
|
_self.middleBarcodeConfirm();
|
|
}
|
|
if(barcodeType=='outsideBarcodeScan'){
|
|
_self.outsideBarcode = result.result;
|
|
_self.outsideBarcodeConfirm();
|
|
}
|
|
}
|
|
})
|
|
|
|
},
|
|
innerBarcodeConfirm(){
|
|
let _self = this;
|
|
|
|
this.midBarFocus();
|
|
},
|
|
|
|
middleBarcodeConfirm(){
|
|
let _self = this;
|
|
|
|
this.outBarFocus();
|
|
},
|
|
|
|
outsideBarcodeConfirm(){
|
|
let _self = this;
|
|
let requestParams = {
|
|
"Inner":this.innerBarcode,
|
|
"Middle":this.middleBarcode,
|
|
"Outer":this.outsideBarcode
|
|
}
|
|
uni.showLoading({
|
|
title:"加载中",
|
|
mask:true
|
|
})
|
|
this.$request.post('/ProductBarcodeCheck/CheckBarcode',requestParams).then(res => {
|
|
uni.hideLoading();
|
|
this.innerBarcodeShow = this.innerBarcode;
|
|
this.middleBarcodeShow = this.middleBarcode;
|
|
this.outsideBarcodeShow = this.outsideBarcode;
|
|
|
|
let arr = {
|
|
Inner:this.innerBarcodeShow,
|
|
Middle:this.middleBarcodeShow,
|
|
Outer:this.outsideBarcodeShow
|
|
}
|
|
this.detailTableData.push(arr);
|
|
|
|
this.innerBarcode = '';
|
|
this.middleBarcode = '';
|
|
this.outsideBarcode = '';
|
|
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.dialogNoticeProps(err,'error')
|
|
});
|
|
|
|
|
|
this.innerBarFocus();
|
|
},
|
|
|
|
submit(){
|
|
let _self = this;
|
|
if(!this.innerBarcode){
|
|
uni.showToast({
|
|
title:'内屏条码不能为空',
|
|
icon:'none'
|
|
})
|
|
return
|
|
}
|
|
|
|
if(!this.outsideBarcode){
|
|
uni.showToast({
|
|
title:'外包装条码不能为空',
|
|
icon:'none'
|
|
})
|
|
return
|
|
}
|
|
|
|
if(!this.detailTableData||this.detailTableData.length==0){
|
|
uni.showToast({
|
|
title:'提交信息为空',
|
|
icon:'none'
|
|
})
|
|
return
|
|
}
|
|
let requestParams = this.detailTableData
|
|
this.$request.post('/ProductBarcodeCheck/SubmitSave',requestParams).then(res => {
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title:'提交成功',
|
|
icon:'none'
|
|
})
|
|
this.clearUp()
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.dialogNoticeProps(err,'error')
|
|
});
|
|
|
|
this.innerBarFocus();
|
|
|
|
},
|
|
clearUp(){
|
|
let _self = this;
|
|
|
|
this.innerBarcode = '';
|
|
this.middleBarcode = '';
|
|
this.outsideBarcode = '';
|
|
|
|
this.innerBarcodeShow = '';
|
|
this.middleBarcodeShow = '';
|
|
this.outsideBarcodeShow = '';
|
|
this.detailTableData = [];
|
|
},
|
|
innerBarFocus(){
|
|
let _self = this;
|
|
this.innerBarcodeFocus = false;
|
|
this.middleBarcodeFocus = false;
|
|
this.outsideBarcodeFocus = false;
|
|
this.$nextTick(function(){
|
|
_self.innerBarcodeFocus = true;
|
|
_self.middleBarcodeFocus = false;
|
|
_self.outsideBarcodeFocus = false;
|
|
})
|
|
},
|
|
midBarFocus(){
|
|
let _self = this;
|
|
this.innerBarcodeFocus = false;
|
|
this.middleBarcodeFocus = false;
|
|
this.outsideBarcodeFocus = false;
|
|
this.$nextTick(function(){
|
|
_self.innerBarcodeFocus = false;
|
|
_self.middleBarcodeFocus = true;
|
|
_self.outsideBarcodeFocus = false;
|
|
})
|
|
},
|
|
outBarFocus(){
|
|
let _self = this;
|
|
this.innerBarcodeFocus = false;
|
|
this.middleBarcodeFocus = false;
|
|
this.outsideBarcodeFocus = false;
|
|
this.$nextTick(function(){
|
|
_self.innerBarcodeFocus = false;
|
|
_self.middleBarcodeFocus = false;
|
|
_self.outsideBarcodeFocus = true;
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.search{padding: 10rpx 0;margin: 0 0;border-bottom: 1px solid #f9f9f9;}
|
|
.search-title{text-align: start;}
|
|
.search-img{height: 28rpx;width: 28rpx;margin-top: 20rpx;}
|
|
.active-input{position: relative;width: 100%;padding-right: 32rpx;padding-left: 40rpx;}
|
|
.placeholder-class-input{font-size: 30rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #cacaca;}
|
|
.table{margin-top: 16rpx;margin-right: 32rpx;margin-left: 32rpx;margin-bottom: 100rpx;}
|
|
.submitBtn{width: 100%;height: 80rpx;line-height: 80rpx;font-size: 32rpx;font-family: MicrosoftYaHei;color: #FFFFFF;
|
|
text-align: center;background-color: #007BFF;border-radius: unset;position: fixed;left: 0;bottom: 0;
|
|
}
|
|
</style> |