diff --git a/component/public/errorshow.vue b/component/public/errorshow.vue new file mode 100644 index 0000000..40390d8 --- /dev/null +++ b/component/public/errorshow.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/component/public/toastPlugin.js b/component/public/toastPlugin.js new file mode 100644 index 0000000..5068518 --- /dev/null +++ b/component/public/toastPlugin.js @@ -0,0 +1,127 @@ +// // src/plugins/toastPlugin.js +// import { createApp, reactive, h } from 'vue' +// import ToastHost from './errorshow.vue' // 路径按项目调整 + +// const defaultOpt = { +// title: '', +// duration: 1500, +// type: 'text', // 'text' | 'dialog' +// mask: true, +// maskClosable: true, +// success: null, +// complete: null +// } + +// function createToastService() { +// const state = reactive({ +// show: false, +// title: '', +// duration: defaultOpt.duration, +// type: defaultOpt.type, +// mask: defaultOpt.mask, +// maskClosable: defaultOpt.maskClosable, +// success: null, +// complete: null, +// _timer: null, +// // dialog 专用(可扩展) +// confirmText: '确定', +// cancelText: '取消' +// }) + +// function clearTimer() { +// if (state._timer) { +// clearTimeout(state._timer) +// state._timer = null +// } +// } + +// function showToast(options = {}) { +// const opt = Object.assign({}, defaultOpt, options) +// clearTimer() +// state.title = opt.title == null ? '' : String(opt.title) +// state.duration = Number(opt.duration) || defaultOpt.duration +// state.type = opt.type +// state.mask = !!opt.mask +// state.maskClosable = opt.maskClosable !== undefined ? !!opt.maskClosable : true +// state.success = typeof opt.success === 'function' ? opt.success : null +// state.complete = typeof opt.complete === 'function' ? opt.complete : null +// state.confirmText = opt.confirmText || '确定' +// state.cancelText = opt.cancelText || '取消' +// state.show = true + +// return new Promise((resolve) => { +// if (state.type === 'text') { +// state._timer = setTimeout(() => { +// hideToast() +// if (state.complete) try { state.complete() } catch(e){/*ignore*/} +// resolve() +// }, state.duration) +// } else { +// // dialog 不自动关闭,等待按键或 maskClosable +// // 但为了安全可以选择不自动超时 +// // resolve 将在按钮或 mask 关闭时调用 +// } +// }) +// } + +// function hideToast(by = 'complete') { +// clearTimer() +// state.show = false +// // 执行回调 +// if (by === 'success' && state.success) { +// try { state.success() } catch(e) {} +// } +// if (state.complete) { +// try { state.complete() } catch(e) {} +// } +// // 清理 +// state.success = null +// state.complete = null +// state.title = '' +// state.type = defaultOpt.type +// } + +// // dialog 按钮触发 +// function onConfirm() { +// hideToast('success') +// } +// function onCancel() { +// hideToast('complete') +// } + +// return { +// state, +// showToast, +// hideToast, +// onConfirm, +// onCancel +// } +// } + +// // 插件安装函数 +// export default { +// install: (app, options = {}) => { +// const service = createToastService() + +// // programmatically mount the host component once +// const container = document.createElement('div') +// document.body.appendChild(container) +// const toastApp = createApp({ +// render() { +// return h(ToastHost, { service }) +// } +// }) +// toastApp.mount(container) + +// // 全局方法 +// app.config.globalProperties.$errorshow = service.showToast +// // 兼容直接使用 window.uni.showToast +// if (typeof window !== 'undefined') { +// window.uni = window.uni || {} +// window.uni.$errorshow = service.showToast +// } + +// // 可选:返回 service 以便调试 +// app.provide('toastService', service) +// } +// } diff --git a/main.js b/main.js index 99dab25..89207aa 100644 --- a/main.js +++ b/main.js @@ -19,6 +19,7 @@ import { createSSRApp } from 'vue' import donghua from '@/component/public/donghua.vue' +// import errorshow from '@/component/public/toastPlugin.js' import tanchuang from '@/pages/procurement/components/tanchuang.vue'; // import arrowkeys from '@/component/public/newgame/arrowkeys.vue' export function createApp() { @@ -28,6 +29,7 @@ export function createApp() { app.use(uView) app.component('donghua', donghua) app.component('tanchuang', tanchuang) + // app.component('arrowkeys', arrowkeys) return { app diff --git a/pages/Warehouse/picking.vue b/pages/Warehouse/picking.vue index 7a064e7..2b4d519 100644 --- a/pages/Warehouse/picking.vue +++ b/pages/Warehouse/picking.vue @@ -3,7 +3,7 @@ + @click="moreindex=-1; topbuttontarget=-1;openjianhuo=false;opengaijia=false;opendata=false;opencgr=false;opengys=false;albumlist=[]"> @@ -107,8 +107,8 @@ - - AC + + 清零 0 @@ -314,15 +314,15 @@ - - AC + + 清零 0 - - AE + + @@ -568,11 +568,11 @@ - {{ v.jhTime?.slice(0,10).replace(/-/g, '.') }} + {{ Number(v.status)<1 ? "": v.jhTime?.slice(0,10).replace(/-/g, '.') }} - + @@ -581,7 +581,7 @@ 拣货 - {{ "[ " + v.jhBy + " ]" }} + {{ Number(v.status)<1 ? "":"[ " + v.jhBy + " ]" }} @@ -593,8 +593,7 @@ - @@ -920,7 +919,8 @@ - + {{showvalue.wlName}} @@ -999,8 +999,7 @@ --> -