From 0eb5f0487a56c325551bfb15ac3f4ff35714b15a Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周六, 22 6月 2024 15:05:36 +0800
Subject: [PATCH] 2
---
yiqi_pda/pages/outBound/index.vue | 181 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 146 insertions(+), 35 deletions(-)
diff --git a/yiqi_pda/pages/outBound/index.vue b/yiqi_pda/pages/outBound/index.vue
index ba4e80d..0601564 100644
--- a/yiqi_pda/pages/outBound/index.vue
+++ b/yiqi_pda/pages/outBound/index.vue
@@ -1,19 +1,22 @@
<template>
<default-header-page-layout ref="page" title="鍑哄簱鎵ц">
+
<view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
<action-user-row />
+ <scan-input-form-item :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" :label="baseTitile"
+ :msg="msg" :msg-type="msgType" @search="onSearchContainter" @clear="onClearContainter" />
<view class="with-action-user-row-page-content">
- <scan-input-form-item :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" label="OP80鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�" :msg="msg" :msg-type="msgType"
- @search="onSearchContainter" @clear="onClearContainter" />
-
- <Content @deleteData="deleteData" :workPieceData="workPieceData" />
+
+
+ <Content @deleteData="deleteData" :workPieceData="workPieceData" />
</view>
- <modalPwd @reflesh="reflesh" ref="pwdRef"/>
+ <modalPwd @reflesh="reflesh" ref="pwdRef" />
</view>
<template v-slot:footer>
<view class="bottom-btns-row">
<view class="btn-frame right-btn-frame">
- <u-button :disabled="workPieceData.length<1" type="primary" text="纭鍑哄簱" @click="outBoundConfirm"></u-button>
+ <u-button :disabled="workPieceData.length<1" type="primary" text="纭鍑哄簱"
+ @click="outBoundConfirm"></u-button>
</view>
</view>
</template>
@@ -26,6 +29,7 @@
import ScanInputFormItem from './modules/ScanInputFormItem.vue'
import Content from './modules/content.vue'
import modalPwd from './modules/modalPwd.vue'
+ import Vue from 'vue'
import {
parseDic,
$alert,
@@ -33,9 +37,12 @@
} from '@/static/js/utils/index.js'
import {
getWorkPieceByOP80NewCode,
- outBoundWorkPiece
+ outBoundWorkPiece,
+ getOutBoundWorkPieceInfoCount
} from '@/api/outBound/index.js'
- import {listbycode} from '@/api/common/index.js'
+ import {
+ listbycode
+ } from '@/api/common/index.js'
export default {
name: 'baseInPage',
components: {
@@ -47,39 +54,92 @@
},
data() {
return {
+ barHeight: '',
+ ckNumToday: "0", //浠婂ぉ鎬诲嚭搴撴暟
+ baseTitile: '鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�', //鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�
+ title: '',
pageBodyHeight: 0,
initInterVal: null,
+ myInterval: null,
msg: '',
msgType: 'error',
OP80NewCode: '',
- workPieceData:[],
+ workPieceData: [],
workPieceStatus: [],
- inputFocus:true,
+ inputFocus: true,
// codeLength:1
}
},
onLoad() {
+ var _this = this;
+ _this._getOutBoundWorkPieceInfoCount();
+ this.myInterval = setInterval(function() {
+ _this._getOutBoundWorkPieceInfoCount();
+ }, 1000 * 10);
+ //this.myInterval=setInterval(this.myFun(), 3000);
},
methods: {
// 鑾峰彇宸ヤ欢淇℃伅
+ async _getOutBoundWorkPieceInfoCount(OP80NewCode) {
+ try {
+ let {
+ data
+ } = await getOutBoundWorkPieceInfoCount(null)
+ this.ckNumToday = data;
+ } catch (e) {}
+ this.setMsg();
+ },
+ // 鑾峰彇宸ヤ欢淇℃伅
async onSearchContainter(OP80NewCode) {
+ // if (OP80NewCode.length > 22) {
+ // this.initFocus(100);
+
+ // uni.showToast({
+ // title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘',
+ // icon: 'error',
+ // duration: 2000,
+ // mask: true
+ // });
+ // return;
+ // }
+ this.inputFocus = false
const param = {
OP80NewCode: OP80NewCode
}
- try{
- let {data}=await getWorkPieceByOP80NewCode(param)
- if(!this.workPieceData.some(item=>item.workPieceID==data.workPieceID)) {
+ try {
+ let {
+ data
+ } = await getWorkPieceByOP80NewCode(param)
+ if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) {
+ data.addTime = new Date();
this.workPieceData.push(data)
}
- console.log(this.workPieceData,'dsts');
- this.inputFocus=false
- setTimeout(()=>{
- this.inputFocus=true
- },100)
- }catch(e){
+ //椤哄簭璋冭浆锛屾帓搴�
+ this.workPieceData.sort((a, b) => b.addTime - a.addTime);
+
+ this.initFocus(100);
+ //console.log(this.workPieceData,'dsts');
+ // setTimeout(()=>{
+ // this.OP80NewCode = '' ;//姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
+ // this.inputFocus=true
+ // },100)
+ } catch (e) {
+ //debugger
+ this.initFocus(100);
//TODO handle the exception
console.log(e);
}
+ //this.msg = " 鎵爜鏁�:"+this.workPieceData.length+" 浠婃棩鍑哄簱鏁�:";
+ this.setMsg();
+ },
+ setMsg() {
+ this.msg = " 鎵爜鏁�:" + this.workPieceData.length + " 浠婃棩鍑哄簱鏁�:" + this.ckNumToday;
+ },
+ initFocus(num) {
+ setTimeout(() => {
+ this.OP80NewCode = ''; //姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆�
+ this.inputFocus = true
+ }, num)
},
// 鑾峰彇鎵爜闀垮害
// async listbycode(){
@@ -90,40 +150,45 @@
// //TODO handle the exception
// console.log(e);
// }
-
+
// },
onClearContainter() {
this.OP80NewCode = ''
},
- deleteData(opt){
- this.workPieceData=this.workPieceData.filter(item=>item.workPieceID!=opt.workPieceID)
+ deleteData(opt) {
+ this.workPieceData = this.workPieceData.filter(item => item.workPieceID != opt.workPieceID)
+ this.setMsg();
},
- reflesh(){
+ reflesh() {
this.OP80NewCode = ''
- this.workPieceData=[]
+ this.workPieceData = []
},
- outBoundConfirm(){
+ outBoundConfirm() {
// 瀛樺湪闈炴垚鍝�
- const flag=this.workPieceData.some(item=>item.workPieceState!=10)
- if(flag) {
+ const flag = this.workPieceData.some(item => item.workPieceState != 10)
+ if (flag) {
uni.showModal({
- title:'鎻愮ず',
- content:'褰撳墠宸ヤ欢瀛樺湪闈炴垚鍝侊紝纭畾寮哄埗鍑哄簱鍚楋紵',
- success:(value)=>{
- const {confirm,cancel}=value
- if(confirm) {
+ title: '鎻愮ず',
+ content: '褰撳墠宸ヤ欢瀛樺湪闈炴垚鍝侊紝纭畾寮哄埗鍑哄簱鍚楋紵',
+ success: (value) => {
+ const {
+ confirm,
+ cancel
+ } = value
+ if (confirm) {
this.$refs.pwdRef.showModal(this.workPieceData)
}
}
})
- }else{
+ } else {
this.$refs.pwdRef.showModal(this.workPieceData)
}
-
+
},
/* 椤甸潰鍒濆鍖栬幏鍙栭〉闈ody楂樺害鐨勫畾鏃跺櫒 */
startInitInterval(callback) {
this.initInterVal = setInterval(() => {
+ //console.log('bbb')
if (this.pageBodyHeight) {
this.clearInitInterval()
callback && callback()
@@ -135,25 +200,71 @@
/* 娓呴櫎瀹氭椂鍣� */
clearInitInterval() {
try {
+ //alert('鎵ц');
clearInterval(this.initInterVal)
this.initInterVal = null
} catch (e) {
//TODO handle the exception
}
},
+ clearInitInterval2() {
+ try {
+ clearInterval(this.myInterval)
+ this.myInterval = null
+ } catch (e) {
+ //TODO handle the exception
+ }
+ },
comfirmUpdate() {
this.$refs.pwdRef.showModal(this.barDetail);
+ },
+ myFun() {
+ console.log('aaaa')
}
},
onReady() {
+ this.setMsg();
+
this.startInitInterval(() => {
/* 椤甸潰鍒濆鍖栧悗闇�瑕佹墽琛岀殑浠g爜鍦ㄨ繖杈硅皟鐢� */
// this.listbycode()
+
})
},
+ mounted() {
+ // 璁剧疆fixed瀹氫綅
+ //this.barHeight = Vue.prototype.CustomBar || 45
+ this.barHeight = Vue.prototype.CustomBar
+ },
onUnload() {
+ //alert(11); 椤甸潰绂诲紑鏃�
this.clearInitInterval()
- }
+ this.clearInitInterval2();
+ },
+ //鐩戝惉鍘熺敓杩斿洖閿�
+ onBackPress(e) {
+ // 姝ゅ涓�瀹氳return涓簍rue锛屽惁鍒欓〉闈笉浼氳繑鍥炲埌鎸囧畾璺緞
+ if (1 != 1) {
+ return false //鍙繑鍥�
+ } else {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鏄惁纭杩斿洖锛�',
+ showCancel: true,
+ cancelColor: '#333333',
+ success: (res => {
+ if (res.confirm) {
+ uni.redirectTo({
+ url: '/pages/home/index'
+ })
+ } else if (res.cancel) {
+
+ }
+ })
+ });
+ return true
+ }
+ },
}
</script>
--
Gitblit v1.9.3