Files
GX.O3.WMS/APK/APP_O3/pages/views/STK_BARCODESMERGE/STK_BARCODESMERGE.vue
T

1211 lines
32 KiB
Vue
Executable File

<template>
<view class="content">
<opsoft-dialog-notice
:dialogNoticeShow="showDialog"
:dialogNoticeType="dialogNoticeType"
:dialogNoticeTitle="dialogNoticeTitle"
:dialogNoticeContent="dialogNoticeContent"
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
>
</opsoft-dialog-notice>
<view class="content-head">
<view class="header-top" style="margin: 0;">
<view class="header-top-organzie" style="">
<text class="header-row-title-class">当前组织</text>
<view class="header-top-organzie-select">
<picker @change="orgChange" :value="index" :range="orgArry" range-key="FNAME" style="width: 100%;">
<view class="header-top-organzie-content">{{orgArry[index].FNAME}}</view>
</picker>
</view>
<image class="header-top-organzie-img" src="@/static/login/icon-pull.png"/>
</view>
<view class="header-top-date">
<view class="header-top-data-select" @click="creatDatePicker()">{{creatlist[0].detail}}</view>
<!-- <image class="" src="@/static/login/icon-pull.png" style="height: 32rpx;width: 32rpx;padding-left: 10rpx;position: absolute;right: 0;"></image> -->
<date-time-picker ref='creatTime' :indicatorStyle='indicatorStyle' :type='type' :datestring='dateString'
@change='creatTimeChange'>
</date-time-picker>
</view>
</view>
<view class="barcode">
<view class="text-barcode">条&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</view>
<view class="input-barcode">
<input type="text" v-model="fBarCodeNO" @confirm="getBarCodeInfo()" :focus="barCodeFocus" cursor="1"/>
</view>
<image src="../../../static/img/scan-blue.png"
v-show="showScan" @click="scan('barCodeScan')"></image>
</view>
<view class="type-select-box" v-if="printSwitch || bluetoothSwitch">
<p>是否自动打印</p>
<view class="tool-box">
<checkbox-group @change="printCbChange">
<checkbox class="head-checkbox" :checked="isPrinted" />
</checkbox-group>
</view>
</view>
</view>
<view style="height: 32rpx;" />
<view class="separate" />
<view class="lists">
<view @tap="showScannedTab()" :class="[selectScannedTabFlag?'btn-change':'btn']">合并界面</view>
<view class="lists-line" />
<view @tap="showBarcodeTab()" :class="[selectBarcodeTabFlag?'btn-change':'btn']">已合并界面</view>
<view class="lists-line" v-if="bluetoothSwitch || printSwitch" />
<view @tap="showPrintTab()" :class="[selectPrintTabFlag?'btn-change':'btn']" v-if="printSwitch">打印设置</view>
<view class="lists-line" v-if="bluetoothSwitch && printSwitch" />
<view @tap="showBluePrintTab()" :class="[selectBluePrintTabFlag?'btn-change':'btn']" v-if="bluetoothSwitch">蓝牙设置</view>
</view>
<view class="table" v-show="selectScannedTabFlag">
<view class="z-table">
<z-table :tableData='scannedTableData' :columns='scannedColumns' emptyText='设置了showLoading=false才会看到我' showSelect
@onSelect='tableSelect'></z-table>
</view>
<view class="type-select-box-del" v-if="!showResult">
<view @click="del()" style="color: #FFFFFF;border-radius: unset; background: #F76260;height: 80rpx;
line-height: 80rpx; text-align: center;font-size: 32rpx;">
删除
</view>
</view>
<view class="type-select-box-commit" v-if="showResult">
<view style="color: #FFFFFF;border-radius: unset;font-size: 32rpx;height: 80rpx;line-height: 80rpx; text-align: center;"
:style="{'background-color': (!isCommitBtnDisable ? '#4662FF' : '#808080')}"
@click="commitBtnClick()" :disabled="isCommitBtnDisable">
提交
</view>
</view>
</view>
<view class="table" v-show="selectBarcodeTabFlag">
<view class="z-table">
<z-table :tableData='barcodeTableData' :columns='barcodeColumns'
emptyText='设置了showLoading=false才会看到我' showSelect @onSelect='barcodeSelect'></z-table>
<button class="button-class" @tap="printBarcode()" :disabled="printList.length == 0"
:style="{'background-color': (printList.length == 0 ? '#808080' : '')}" v-if="printSwitch">普通打印</button>
<button class="button-class" @tap="bluePrintBarcode()" :disabled="printList.length == 0"
:style="{'background-color': (printList.length == 0 ? '#808080' : '')}" v-if="bluetoothSwitch">蓝牙打印</button>
</view>
</view>
<view v-show="selectPrintTabFlag">
<NetworkPrintTab prgkey="STK_BARCODESMERGE" :printInfo="newBarCodeNO" ref="networkPrintTab"
:orgId="orgFItemID" :baseUrl="baseUrl"/>
</view>
<view v-show="selectBluePrintTabFlag">
<BluetoothPrintTab ref="bluetoothPrintTab" :currentTranType = 'currentTranType'/>
</view>
</view>
</template>
<script>
import {
mapState,
mapMutations
} from 'vuex';
import BluetoothPrintTab from '@/components/bluetooth-print-tab/bluetooth-print-tab.vue';
import NetworkPrintTab from '@/components/network-print-tab/network-print-tab.vue';
import DateTimePicker from '@/components/bory-dateTimePickerWithOutTime/bory-dateTimePickerWithOutTime.vue';
const macAddress = require('../../../common/MacAddress.js');
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
import errorStrUntil from '@/common/errorStrUntil.js';
let _self;
export default {
components: {
BluetoothPrintTab,
NetworkPrintTab,
DateTimePicker,
opsoftDialogNotice
},
data() {
return {
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
// 日期选择
dateString: '',
type: 'date',
creatlist: [{
type: 'date',
detail: '选择开始时间'
}],
curDate: '',
dbAlise:'',
userName:'',
isChangedOrg:false,
showScan:true,
currentTranType:'STK_BARCODESMERGE',
showCashTips:false,
loadCash:false,
pageCashInfo: new Object(),
barcodeExistList:[],
isShowOrg:true,
orgArry:[{name:"请选择组织", key:"", FName:""}],
orgFItemID:'',
index:0,
showResult:true,
btnStyleChangeScan:true,
btnStyleChangePrint:false,
isCommitBtnDisable:false,
currentBillType: 4,
showYesShow: true,
showinp: false,
splitQty: null,
// FSecQty:"",
// FCoefficient:"",
scannedTableData: [],
selectedList: [],
fBarCodeNO: null,
//已扫描
scannedColumns: [ { title: "条码", key: "fNumber", width: 350, formatNum: false },
{ title: "物料代码", key: "fItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "fItemName", width: 350, formatNum: false },
{ title: "批号", key: "fBatchNO", width: 350, formatNum: false },
{ title: "数量", key: "fQty", width: 250 },
{ title: "规格", key: "fSize", width: 250, formatNum: false },
{ title: "型号", key: "fModel", width: 250, formatNum: false},
{ title: "单位", key: "fUnitName", width: 250, formatNum: false}],
commitDataList: [],
barCodeFocus:true,
newBarCodeNO: "",
selectScannedTabFlag: true,
selectPrintTabFlag: false,
selectBluePrintTabFlag: false,
baseUrl: '',
selectBarcodeTabFlag: false,
barcodeTableData: [],
barcodeColumns: [ { title: "条码", key: "barcode", width: 400, formatNum: false },
{ title: "状态", key: "status", width: 300, formatNum: false }, ],
printList: [],
isPrinted: true,
printSwitch: false,
bluetoothSwitch: false,
systemParameter: null,
}
},
onBackPress(options) {
uni.redirectTo({
url: '../../tabbar/apply/apply'
});
return true;
},
onLoad() {
let _self = this;
this.dbAlise = uni.getStorageSync("dbAlise");
this.userName = uni.getStorageSync("userName");
_self.getOrgList();
_self.baseUrl = uni.getStorageSync('RequestUrl');
_self.systemParameter = uni.getStorageSync('systemParameter');
_self.printSwitch = _self.systemParameter.printSwitch;
_self.bluetoothSwitch = _self.systemParameter.bluetoothSwitch;
if (!_self.printSwitch && !_self.bluetoothSwitch) {
_self.isPrinted = false;
}
_self.judgeCash();
//当前时间
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.creatlist[0].detail = this.curDate;
},
computed: {
indicatorStyle() {
return {
background: 'rgba(255,0,0,.2)',
height: '40px',
};
},
barcodeRule() {
console.log(this.sysParameters);
if (this.sysParameters) {
if (this.sysParameters.hasOwnProperty("BarcodeRuleForVerification")) {
let rule = this.sysParameters["BarcodeRuleForVerification"];
if (rule) {
return rule;
}
}
}
return "";
},
...mapState(["sysParameters", 'userInfo'])
},
onReady() {
if(this.$refs.bluetoothPrintTab){
this.$refs.bluetoothPrintTab.orgId = this.orgFItemID;
}
},
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;
},
//日期切换
creatDatePicker() {
this.type = 'date';
this.$refs['creatTime'].show();
},
creatTimeChange(value) {
let item = this.creatlist[0];
item['detail'] = value;
},
scan:function(e){
let _self = this;
let currentScanType = e;
uni.scanCode({
success:function(res){
if(currentScanType == 'barCodeScan'){
_self.fBarCodeNO = res.result;
_self.getBarCodeInfo();
}
}
})
},
loadByCash:function(){
let _self = this;
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
let cashValue;
if(!this.isChangedOrg){
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
}else{
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
}
this.orgFItemID = cashValue.otherInfo.orgFItemID;
this.scannedTableData = cashValue.scannedTableData;
this.commitDataList = cashValue.commitDataList;
// this.fBarCodeNO = cashValue.otherInfo.fBarCodeNO;
this.isPrinted = cashValue.isPrinted;
this.barcodeTableData = cashValue.barcodeTableData;
this.commitDataList = cashValue.commitDataList;
this.orgArry.forEach(
function(el,index){
let currentOrgid = el.FINTERID;
let result = (currentOrgid == _self.orgFItemID);
if (result) {
_self.index = index;
el.FNAME = el.FNAME?el.FNAME:'无';
}
}
);
},
//组织
getOrgList:function(){
let _self = this;
let orgInfo = uni.getStorageSync('orgInfo');
if(orgInfo && orgInfo.length > 0) {
let defaultOrgInfo = uni.getStorageSync('defaultOrgInfo');
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if(!isOpenDefaultOrg){
this.orgFItemID = orgInfo[0].FINTERID;
}else{
if(defaultOrgInfo){
this.orgFItemID = defaultOrgInfo.FINTERID;
}else{
this.orgFItemID = orgInfo[0].FINTERID;
}
}
this.orgArry = orgInfo;
this.orgArry.forEach(
function(el,index){
let currentOrgid = el.FINTERID;
let result = (currentOrgid == _self.orgFItemID);
if(result){
_self.index = index;
el.FNAME = el.FNAME?el.FNAME:'无';
}
}
);
} else {
this.orgArry = [{name:"请选择组织", key:"", FNAME:"当前无组织"}];
this.index = 0;
}
},
orgChange:function(e){
this.isChangedOrg = true;
this.index = e.target.value;
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if(!this.orgArry[this.index].FINTERID) {
this.orgFItemID = "";
}
else {
this.orgFItemID = this.orgArry[this.index].FINTERID;
if(isOpenDefaultOrg){
uni.setStorageSync('defaultOrgInfo',this.orgArry[this.index]);
}
}
let cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID)
if(cashValue){
this.loadByCash()
}else{
this.orgChangedClear();
}
this.$refs.bluetoothPrintTab.orgId = this.orgFItemID;
this.$forceUpdate();
},
orgChangedClear:function(){
this.fBarCodeNO = "";
this.showResult = true;
this.scannedTableData = [];
this.barcodeTableData = [];
this.commitDataList = [];
this.$forceUpdate();
},
getBarCodeInfo: function() {
let _self = this;
if (!this.fBarCodeNO) {
uni.showToast({
icon: "none",
title: "请输入条码",
duration: 3500,
})
return false;
}
this.fBarCodeNO = this.fBarCodeNO.toUpperCase();
let isFail = this.checkBarcodeNumber(this.fBarCodeNO);
if (isFail) {
uni.showToast({
icon: "none",
title: "请输入正确的条码",
duration: 3500,
})
return false;
}
let existFlag = false;
this.scannedTableData.forEach(
function(el){
if(el.fNumber == _self.fBarCodeNO) {
existFlag = true;
}
}
);
if(existFlag) {
uni.showToast({
icon: "none",
title: "输入条码已存在,请重新输入",
duration: 3500,
})
return false;
}
let requestParams = {
"barcode": this.fBarCodeNO,
"billType": this.currentBillType,
"orgId":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/Barcode/GetBarcodeInfo',{
params:requestParams
}).then(res => {
uni.hideLoading();
let data = res;
let rowData = {
fNumber: data.FBARCODE,
fItemNumber: data.FMATERIALNUMBER?data.FMATERIALNUMBER:'-',
fItemName: data.FMATERIALNAME,
fBatchNO: data.FLOT?data.FLOT:'-',
fQty: data.FQTY,
fUnitName: data.FUNITNAME,
fSize: data.FSPECIFICATION,
fModel: data.FSPECIFICATION,
fAuxPropName: data.FAUXPROPID?data.FAUXPROPID:'-',
fKFPeriod: data.FKFDATE?data.FKFDATE:'-',
FSecQty: data.FSecQty,
FBASEQTY:data.FBASEQTY,
FBASEUNITID:data.FBASEUNITID,
FSTOCKSTATUSID:data.FSTOCKSTATUSID,
FUSEFULDATE:data.FUSEFULDATE
};
if(this.scannedTableData.length>0) {
if(!(rowData.fItemNumber == this.scannedTableData[0].fItemNumber
&& rowData.fBatchNO == this.scannedTableData[0].fBatchNO
&& rowData.fAuxPropName == this.scannedTableData[0].fAuxPropName
&& rowData.fKFPeriod == this.scannedTableData[0].fKFPeriod)) {
uni.showToast({
icon: "none",
title: "条码的物料代码,批号,辅助属性,保质期需要一致才能合并",
duration: 3500,
});
return false;
}
if(rowData.FSTOCKSTATUSID != this.scannedTableData[0].FSTOCKSTATUSID||
rowData.FUSEFULDATE != this.scannedTableData[0].FUSEFULDATE){
uni.showToast({
icon: "none",
title: "条码的库存状态,有效期一致才能合并",
duration: 3500,
});
return false;
}
}
this.scannedTableData.push(rowData);
let lastSaveOrgid = this.orgFItemID; //最后一次条码录入成功后(条码进入已扫描列表)的组织ID
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid',lastSaveOrgid);
this.saveCash();
this.fBarCodeNO = "";
this.showBarcodeCursor();
this.$forceUpdate();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
commitBtnClick: function() {
let _self = this;
if (this.isCommitBtnDisable) {
return;
}
this.isCommitBtnDisable = true;
if (this.scannedTableData.length <= 0) {
uni.showToast({
icon:'none',
title: "无提交数据",
duration: 2500,
});
this.isCommitBtnDisable = false;
return false;
}
this.commitDataList = [];
this.scannedTableData.forEach(
function(el) {
let rowData = {
"Barcode" : el.fNumber,
"Qty" : el.fQty,
"BaseQty":el.FBASEQTY?el.FBASEQTY:0,
// "FCoefficient":el.FCoefficient
}
_self.commitDataList.push(rowData);
}
);
if (this.commitDataList.length <= 1){
uni.showToast({
icon:'none',
title: "单个条码无需合并",
duration: 2500,
});
return;
}
let requestParams = {
"MergeInfo": this.commitDataList,
// "orgid":this.orgFItemID
"TranType": this.currentTranType.toUpperCase()
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/Barcode/MergeBarcode',requestParams).then(res => {
this.isCommitBtnDisable = false;
uni.hideLoading();
if (res) {
uni.showModal({
showCancel: false,
content: '条码合并成功,新条码:' + res,
confirmText: '确定',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
});
this.scannedTableData.forEach(
function(el) {
let addFlag = true;
_self.barcodeTableData.forEach(
function(item) {
if (item.barcode == el.fNumber) {
addFlag = false;
}
}
);
if (addFlag) {
let obj = {barcode:el.fNumber, status:'合并前'};
_self.barcodeTableData.push(obj);
}
}
);
let obj = {barcode:res, status:'合并后'};
_self.barcodeTableData.push(obj);
this.commitDataList = new Array();
this.scannedTableData = new Array();
this.newBarCodeNO = res;
this.showBarcodeCursor();
if (this.isPrinted) {
let tempArray = [];
tempArray.push(res);
if (this.printSwitch) {
this.printBarcode(tempArray);
}
if (!this.printSwitch && this.bluetoothSwitch) {
this.bluePrintBarcode(tempArray);
}
}
}
else {
this.dialogNoticeProps('合并失败','error')
}
uni.removeStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
uni.removeStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
})
.catch(err => {
this.isCommitBtnDisable = false;
this.commitDataList = new Array();
this.dialogNoticeProps(err,'error')
uni.hideLoading();
});;
},
showScannedTab: function() {
this.selectPrintTabFlag = false;
this.selectScannedTabFlag = true;
this.selectBarcodeTabFlag = false;
this.selectBluePrintTabFlag = false;
},
showBarcodeTab: function() {
this.selectPrintTabFlag = false;
this.selectScannedTabFlag = false;
this.selectBarcodeTabFlag = true;
this.selectBluePrintTabFlag = false;
},
showPrintTab: function() {
this.selectScannedTabFlag = false;
this.selectBarcodeTabFlag = false;
this.selectPrintTabFlag = true;
this.selectBluePrintTabFlag = false;
},
showBluePrintTab: function() {
this.selectScannedTabFlag = false;
this.selectBarcodeTabFlag = false;
this.selectPrintTabFlag = false;
this.selectBluePrintTabFlag = true;
},
tableSelect: function(selected) {
if(selected.length > 0){
this.showResult = false;
}else{
this.showResult = true;
}
if (selected.length > 0 && selected.length > this.selectedList.length) {
let index = selected[selected.length-1];
let barcode = this.scannedTableData[index].fNumber;
// if (barcode) {
// uni.showToast({
// title: "您选择了条码:" + barcode,
// icon: 'none'
// })
// }
}
this.selectedList = selected;
},
barcodeSelect: function(selected) {
let _self = this;
this.printList.splice(0, this.printList.length);
selected.forEach(
function(item){
_self.printList.push(_self.barcodeTableData[item].barcode);
}
);
},
printBarcode(printListPa) {
let localList = this.printList;
if (printListPa) {
localList = printListPa;
}
this.$refs.networkPrintTab.printBarcode(localList);
},
bluePrintBarcode(bluePrintListPa) {
if (this.$store.state.blueConnectedFlag) {
// if(true) {
let localList = this.printList;
if (bluePrintListPa) {
localList = bluePrintListPa;
}
this.$refs.bluetoothPrintTab.bluePrintBarcode(localList);
localList = null;
}
else {
uni.showToast({
icon: "none",
title: "请先连接蓝牙!",
duration: 3500,
});
}
},
printCbChange:function() {
this.isPrinted = !this.isPrinted;
this.$forceUpdate();
this.saveCash();
},
del: function(e) {
let _self = this;
uni.vibrateShort({
success: function() {
console.log('success');
}
});
if (this.selectedList.length == 0) {
uni.showToast({
icon: "none",
title: "无删除数据"
})
//_self.showStarCousM();
return false;
}
uni.showModal({
title: '提示',
content: '确定删除数据吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
_self.scannedTableData = _self.scannedTableData.filter(
function(el, index){
return !_self.selectedList.includes(index);
}
)
uni.showToast({
icon: 'none',
title: '删除成功'
});
_self.showResult = true;
if(_self.scannedTableData.length==0){
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid','');
}
this.saveCash();
} else if (res.cancel) {
//_self.showStarCousM();
}
},
fail: () => {},
complete: () => {}
});
},
checkBarcodeNumber: function(barcodeNumber) {
if (!barcodeNumber) {
return true;
}
let ruleNoSpace = this.barcodeRule.replace(/\s*/g, "");
if (!ruleNoSpace) {
return false;
}
if (ruleNoSpace.length === 0) {
return false;
}
let rules = ruleNoSpace.split("|");
//最小长度|最大长度|起始字符|结束字符|包含字符(字符之间可以已逗号隔开)
if (rules[0]) {
if (barcodeNumber.length < Number.parseInt(rules[0])) {
return true;
}
}
if (rules[1]) {
if (barcodeNumber.length > Number.parseInt(rules[1])) {
return true;
}
}
if (rules[2]) {
let header = barcodeNumber.substr(0, 1);
let ruleChart2 = rules[2].split(",")
if (ruleChart2) {
if (ruleChart2.length > 0) {
let filterChart2 = ruleChart2.filter(
function(myChar) {
return myChar == header;
}
)
if (!filterChart2) {
return true;
}
if (filterChart2.length === 0) {
return true;
}
}
}
}
if (rules[3]) {
let end = barcodeNumber.substr(-1, 1);
let ruleChart3 = rules[3].split(",");
if (ruleChart3) {
if (ruleChart3.length > 0) {
let filterChart3 = ruleChart3.filter(
function(myChar) {
return myChar == end;
}
)
if (!filterChart3) {
return true;
}
if (filterChart3.length === 0) {
return true;
}
}
}
}
if (rules[4]) {
let myBarcodeNumber = barcodeNumber;
if (rules[2]) {
myBarcodeNumber = myBarcodeNumber.substr(1, myBarcodeNumber.length - 1);
}
if (rules[3]) {
myBarcodeNumber = myBarcodeNumber.substr(0, myBarcodeNumber.length - 1);
}
let ruleChart4 = rules[4].split(",");
if (ruleChart4) {
if (ruleChart4.length > 0) {
ruleChart4.forEach(
function(myChar) {
myBarcodeNumber = myBarcodeNumber.replace(new RegExp(myChar, "gm"), "");
}
);
if (myBarcodeNumber) {
if (myBarcodeNumber.length > 0) {
return true;
}
}
}
}
}
return false;
},
showBarcodeCursor:function(){
let _self = this;
setTimeout(
function(){
_self.barCodeFocus = true;
},
100
);
},
backBtnClick: function() {
uni.reLaunch({
url: '/pages/apply/moreapply/moreapply'
})
},
saveCash:function(){
let _self = this;
let otherInfo = {"currentTranType":this.currentTranType,
"orgFItemID":this.orgFItemID,
"dbAlise":this.dbAlise,
"userName":this.userName,
"fBarCodeNO":this.fBarCodeNO
};
this.pageCashInfo.scannedTableData = this.scannedTableData;
this.pageCashInfo.commitDataList = this.commitDataList;
this.pageCashInfo.barcodeTableData = this.barcodeTableData;
this.pageCashInfo.isPrinted = this.isPrinted
this.pageCashInfo.commitDataList = this.commitDataList;
this.pageCashInfo.otherInfo = otherInfo;
uni.setStorageSync('pageCash'+_self.dbAlise+_self.userName+_self.currentTranType+_self.orgFItemID,this.pageCashInfo);
},
judgeCash:function(){
let _self = this;
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
let cashValue;
if(!this.isChangedOrg){
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
}else{
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
}
if(cashValue.commitDataList){
uni.showModal({
content:'存在未提交数据是否加载',
success: function (res) {
if (res.confirm) {
_self.loadByCash();
}
else if (res.cancel) {
console.log('点击取消')
}
}
})
}
},
...mapMutations(['updateCacheByStorage'])
}
}
</script>
<style>
.content{
padding-left:0;
padding-right: 0;
}
.content-head{
/* height: 120rpx; */
margin-left: 32rpx;
margin-right: 32rpx;
}
.header-row-class-organzie{
display: flex;
justify-content: flex-end;
align-items: center;
/* padding-right: 50rpx; */
}
.header-row-title-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.head-row-content-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.img-organzie{
height: 32rpx;
width: 32rpx;
margin-left: 24rpx;
}
.barcode{
display: flex;
width: 100%;
height: 60rpx;
line-height: 60rpx;
margin-top: 8rpx;
align-items: center;
}
.barcode image{
height: 40rpx;
width: 40rpx;
position: fixed;
right: 40rpx;
}
.text-barcode{
width: 128rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 32rpx;
font-family:MicrosoftYaHei;
color:rgba(102,102,102,1);
}
.input-barcode{
margin-left: 24rpx;
width: 100%;
}
.input-barcode input{
height: 60rpx;
border-radius:10rpx;
border:2rpx solid rgba(216,216,216,1);
padding-left: 24rpx;
font-size: 28rpx;
font-family: MicrosoftYaHei;
}
.print-input{
height: 60rpx;
line-height: 60rpx;
border-radius:4px;
border:1px solid #c0c4cc;
margin-top: 16rpx;
}
.separate{
width: 100%;
height: 16rpx;
background-color:#F5F5F5;
}
.lists {
display: flex;
align-items: center;
/* height: 80rpx; */
/* margin-top: 32rpx; */
margin-left: 32rpx;
margin-right: 32rpx;
}
.lists-line{
border-left-width:1.5px;
border-left-color: #E5E5E5;
border-left-style: solid;
height:40rpx;
flex-grow: 0;
flex-shrink: 0;
}
.btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#666666;
}
.btn-change{
position: relative;
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#4662FF;
}
.btn-change::after{
position: absolute;
content: " ";
width: 2rem;
height: 0.12rem;
background: #4662FF;
bottom: -0.1rem;
left: 50%;
transform: translateX(-50%);
}
.show-print{
margin-top: 32rpx;
margin-left: 32rpx;
margin-right: 32rpx;
}
.trP{
height:36rpx;
font-size:28rpx;
font-family:Helvetica;
color:rgba(51,51,51,1);
line-height:36rpx;
}
.trM{
width:120rpx;
height:36rpx;
font-size:28rpx;
font-family:Helvetica;
color:rgba(51,51,51,1);
line-height:36rpx;
margin-top: 24rpx;
}
.kc{
height:80rpx;
line-height:80rpx;
border-radius:4rpx;
font-size:32rpx;
font-family:Helvetica;
color:rgba(102,102,102,1);
background:rgba(240,240,240,1);
margin-top: 32rpx;
}
.table{
/* position: relative; */
/* height: 780rpx; */
margin-top: 32rpx;
margin-right: 32rpx;
margin-left: 32rpx;
}
.type-select-box-del{
position: fixed;
height:80rpx;
width: 100%;
bottom: 0rpx;
left: 0;
}
.type-select-box-commit{
position: fixed;
height:80rpx;
width: 100%;
bottom: 0rpx;
left: 0;
}
.alter{
position: fixed;
left: 0;
right: 0;
top:0;
bottom: 0;
background-color: #333333;
opacity: 0.5;
}
.err{
position: fixed;
left: 100rpx;
right: 100rpx;
top: 400rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
opacity: 1;
z-index: 5;
}
.errTitle{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
// border-bottom: 2rpx solid #3D3D3D;
}
.errList{
width: 100%;
margin-left: 16rpx;
margin-right: 16rpx;
}
.errDetails{
width: 90%;
font-size: 26rpx;
color: #3D3D3D;
text-align: center;
}
.errConfirm{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
}
.cash-btn{
display: flex;
}
.cashConfirm{
height: 80rpx;
line-height: 80rpx;
width: 50%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
border-right: 2rpx solid #3B4144;
}
.cashCancel{
height: 80rpx;
line-height: 80rpx;
width: 50%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
}
.tool-box{
padding-left: 24rpx;
/* margin-right: 24rpx; */
}
.head-checkbox{
transform:scale(0.75);
/* width:20px;
height:20px;
background:rgba(70,98,255,1);
border-radius:2px;
margin-left: 12px; */
}
.type-select-box {
display: flex;
width: 100%;
/* margin-top: 48rpx; */
line-height: 60rpx;
margin-top: 8rpx;
align-items: center;
font-size: 32rpx;
font-family:MicrosoftYaHei;
color:rgba(102,102,102,1);
}
.button-class{
height:80rpx;
line-height:80rpx;
border-radius:4rpx;
font-size:32rpx;
margin-top: 32rpx;
background-color: #4662FF;
color: #FFFFFF!important;
}
</style>