diff --git a/components/common/tui-utils/tui-utils.js b/components/common/tui-utils/tui-utils.js index 974bd3d..df07b5f 100644 --- a/components/common/tui-utils/tui-utils.js +++ b/components/common/tui-utils/tui-utils.js @@ -332,3 +332,21 @@ export default { debounce: utils.debounce, throttle: utils.throttle } +// 👇 新增:补充具名导出(关键步骤) +export const { + trim, + trimAll, + replaceAll, + formatNumber, + formatMoney, + formatDate, + rgbToHex, + hexToRGB, + unique, + distinctArray, + getDateTimeSlot, + getUrlParam, + getUUID, + debounce, + throttle // 单独导出 throttle 方法 +} = utils; \ No newline at end of file diff --git a/pages/work/daily/inspection/add.vue b/pages/work/daily/inspection/add.vue index d18be73..e7bf225 100644 --- a/pages/work/daily/inspection/add.vue +++ b/pages/work/daily/inspection/add.vue @@ -48,7 +48,9 @@ export default { }, // 提交记录 onSubmit() { - this.$refs.form.validate(this.formData, rules).then(res => { + // 关键:如果正在加载中(请求未完成),直接拦截后续点击 + if (this.isLoading) return; + this.$refs.form.validate(this.formData, rules).then(res => { if (!res.isPass) { uni.$tui.toast(res.errorMsg) return @@ -60,17 +62,19 @@ export default { this.isLoading = true apiInspectionAdd({data:{...this.formData}}).then(res => { uni.$tui.toast('提交成功') - const pages = getCurrentPages() - const beforePage = pages[pages.length - 2] - const id = this.id - setTimeout(() => { - uni.navigateBack({ - success () { - // 刷新页面数据 - beforePage.$vm.getInspectionInfo(id) - } - }) - }, 1500) + uni.navigateBack() + + // const pages = getCurrentPages() + // const beforePage = pages[pages.length - 2] + // const id = this.id + // setTimeout(() => { + // uni.navigateBack({ + // success () { + // // 刷新页面数据 + // beforePage.$vm.getInspectionInfo(id) + // } + // }) + // }, 1500) }).finally(() => { this.isLoading = false }) diff --git a/pages/work/daily/inspection/record.vue b/pages/work/daily/inspection/record.vue index 3ef6fc0..91c3400 100644 --- a/pages/work/daily/inspection/record.vue +++ b/pages/work/daily/inspection/record.vue @@ -1,6 +1,6 @@