Commit 75db1059 authored by chicheng's avatar chicheng

详情页确认后,返回主页扫码框清空并选中

parent f792d0e7
......@@ -117,9 +117,10 @@ import i18n from '../../lang/index'
.then(res => {
if (res.success) {
this.$u.toast(i18n.t('提交成功'));
setTimeout(()=> {
this.goMypage('pages/forcheck/forcheckMain')
}, 200)
setTimeout(() => {
uni.$emit('forcheckSubmitSuccess');
this.goMypage('pages/forcheck/forcheckMain');
}, 200);
}
})
}
......
......@@ -56,6 +56,7 @@ import i18n from '../../lang/index'
isFocus: false,
wxparams: "",
loading: false,
pendingRefocus: false,
daohuoForm: {
cc001: "3701",
cc002: ""
......@@ -66,13 +67,38 @@ import i18n from '../../lang/index'
},
}
},
onLoad() {
uni.$on('forcheckSubmitSuccess', this.onForcheckSubmitSuccess);
},
onUnload() {
uni.$off('forcheckSubmitSuccess', this.onForcheckSubmitSuccess);
},
onShow() {
if (this.pendingRefocus) {
this.pendingRefocus = false;
this.resetFormInput();
}
},
created() {
this.$nextTick(() => {
this.isFocus = true;
uni.hideKeyboard()
});
this.focusOrderNoInput();
},
methods: {
onForcheckSubmitSuccess() {
this.pendingRefocus = true;
},
resetFormInput() {
this.daohuoForm.cc002 = '';
this.focusOrderNoInput();
},
focusOrderNoInput() {
this.isFocus = false;
this.$nextTick(() => {
setTimeout(() => {
this.isFocus = true;
uni.hideKeyboard();
}, 200);
});
},
inputCC(e){
if(e && e.detail.value) {
if(e.detail.value.includes("-")){
......@@ -99,6 +125,7 @@ import i18n from '../../lang/index'
this.loading = false;
if (res.success) {
if (res.data) {
this.isFocus = false;
uni.navigateTo({
url: '/pages/forcheck/Info?info=' + encodeURIComponent(JSON.stringify(res.data))
});
......
......@@ -152,9 +152,10 @@ import i18n from '../../lang/index'
.then(res => {
if (res.success) {
this.$u.toast(i18n.t('提交成功'));
setTimeout(()=> {
this.goMypage('pages/forcreate/Main')
}, 200)
setTimeout(() => {
uni.$emit('forcreateSubmitSuccess');
this.goMypage('pages/forcreate/Main');
}, 200);
}
})
}
......
......@@ -56,6 +56,7 @@ import i18n from '../../lang/index'
wxparams: "",
loading: false,
isFocus: false,
pendingRefocus: false,
daohuoForm: {
cc001: "3701",
cc002: ""
......@@ -66,13 +67,38 @@ import i18n from '../../lang/index'
},
}
},
onLoad() {
uni.$on('forcreateSubmitSuccess', this.onForcreateSubmitSuccess);
},
onUnload() {
uni.$off('forcreateSubmitSuccess', this.onForcreateSubmitSuccess);
},
onShow() {
if (this.pendingRefocus) {
this.pendingRefocus = false;
this.resetFormInput();
}
},
created() {
this.$nextTick(() => {
this.isFocus = true;
uni.hideKeyboard()
});
this.focusOrderNoInput();
},
methods: {
onForcreateSubmitSuccess() {
this.pendingRefocus = true;
},
resetFormInput() {
this.daohuoForm.cc002 = '';
this.focusOrderNoInput();
},
focusOrderNoInput() {
this.isFocus = false;
this.$nextTick(() => {
setTimeout(() => {
this.isFocus = true;
uni.hideKeyboard();
}, 200);
});
},
inputCC(e){
if(e && e.detail.value) {
if(e.detail.value.includes("-")){
......@@ -100,6 +126,7 @@ import i18n from '../../lang/index'
if (res.success) {
if (res.data) {
if(!res.data.purths || res.data.purths.length === 0) return this.$u.toast(i18n.t('到货单已经完成入库'));
this.isFocus = false;
uni.navigateTo({
url: '/pages/forcreate/Info?info=' + encodeURIComponent(JSON.stringify(res.data))
});
......
......@@ -226,9 +226,10 @@ import i18n from '../../lang/index'
.then(res => {
if (res.success) {
this.$u.toast(i18n.t('提交成功'));
setTimeout(()=> {
this.goMypage('pages/moctcforcreate/Main')
}, 200)
setTimeout(() => {
uni.$emit('moctcForCreateSubmitSuccess');
this.goMypage('pages/moctcforcreate/Main');
}, 200);
}
})
}
......
......@@ -56,6 +56,7 @@ export default {
show: true,
wxparams: "",
loading: false,
pendingRefocus: false,
daohuoForm: {
ta001: "510",
ta002: ""
......@@ -66,13 +67,38 @@ export default {
},
}
},
onLoad() {
uni.$on('moctcForCreateSubmitSuccess', this.onMoctcSubmitSuccess);
},
onUnload() {
uni.$off('moctcForCreateSubmitSuccess', this.onMoctcSubmitSuccess);
},
onShow() {
if (this.pendingRefocus) {
this.pendingRefocus = false;
this.resetFormInput();
}
},
created() {
this.$nextTick(() => {
this.isFocus = true;
uni.hideKeyboard()
});
this.focusOrderNoInput();
},
methods: {
onMoctcSubmitSuccess() {
this.pendingRefocus = true;
},
resetFormInput() {
this.daohuoForm.ta002 = '';
this.focusOrderNoInput();
},
focusOrderNoInput() {
this.isFocus = false;
this.$nextTick(() => {
setTimeout(() => {
this.isFocus = true;
uni.hideKeyboard();
}, 200);
});
},
inputCC(e){
if(e && e.detail.value) {
if(e.detail.value.includes("-")){
......@@ -100,6 +126,7 @@ export default {
if (res.success) {
if (res.data) {
if(!res.data.moctes || res.data.moctes.length === 0) return this.$u.toast(i18n.t('工单已经完成领料'));
this.isFocus = false;
uni.navigateTo({
url: '/pages/moctcforcreate/Info?info=' + encodeURIComponent(JSON.stringify(res.data))
});
......
......@@ -41,16 +41,38 @@ export default {
bgSrc: require('@/static/images/qrcode.png'),
wxparams: '',
isFocus: false,
isDisabled: false
isDisabled: false,
pendingRefocus: false
};
},
onLoad() {
uni.$on('saleckSubmitSuccess', this.onSaleckSubmitSuccess);
},
onUnload() {
uni.$off('saleckSubmitSuccess', this.onSaleckSubmitSuccess);
},
onShow() {
if (this.pendingRefocus) {
this.pendingRefocus = false;
this.wxparams = '';
this.focusScanInput();
}
},
created() {
this.$nextTick(() => {
this.isFocus = true;
uni.hideKeyboard()
});
this.focusScanInput();
},
methods: {
onSaleckSubmitSuccess() {
this.pendingRefocus = true;
},
focusScanInput() {
this.isFocus = false;
this.$nextTick(() => {
setTimeout(() => {
this.isFocus = true;
}, 200);
});
},
handleConfirm(e) {
e && this.getPlnr(e);
// uni.navigateTo({
......@@ -64,6 +86,7 @@ export default {
})
.then(({data, errorMessage}) => {
if (data && data.applyNo) {
this.isFocus = false;
uni.navigateTo({
url: `/pages/saleck/saleckList?order=${VBELN}`
});
......
......@@ -173,10 +173,10 @@ export default {
}).then(res => {
if (res.success) {
this.$u.toast(i18n.t('提交成功'))
setTimeout(()=>{
setTimeout(() => {
uni.$emit('saleckSubmitSuccess')
uni.navigateBack()
}, 300)
}
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment