From 6204f2e621a61172187f8ebeda02d2535dd7cc56 Mon Sep 17 00:00:00 2001 From: ptt <2403326863@qq.com> Date: Wed, 9 Jul 2025 10:24:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=87=BA=E5=85=A5=E7=A3=85=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=90=8C=E6=AD=A5=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/outinpound/index.vue | 49 ++++++++++++++----- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue b/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue index 6fbed17..bf189b0 100644 --- a/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue +++ b/ruoyi-ui/src/views/measurement/operation/outinpound/index.vue @@ -76,6 +76,8 @@ 称毛重 称皮重 + 同步 + @@ -497,6 +499,7 @@ import {mulToString,mulToArray} from "@/api/tool/util.js" import { getSearchSelectData } from "@/api/tool/gen.js"; //引入searchData组件 import {selectConfigs} from "@/components/SearchSelect/searchdata.js"; +import { listJob, runJob} from "@/api/monitor/job"; export default { name: "Outinpound", components: {SearchSelect}, @@ -545,6 +548,15 @@ export default { weightTimer: null, // 存储定时器ID // 表单参数 form: {}, + //定时任务参数 + TaskQueryParams: { + pageNum: 1, + pageSize: 10, + jobName: null, + invokeTarget: 'apiTask.getOAData()', + jobGroup: undefined, + status: undefined + }, tabs: [ { name: 'weighingRequest', label: '过磅申请' }, { name: 'tareRequest', label: '过皮申请' }, @@ -1096,20 +1108,31 @@ export default { getOptionsByKey(key) { const cfg = this.searchData.selectConfigs.find(c => c.key === key); return this.searchData.optionsMap[this.buildCacheKey(cfg)] || []; + }, + //同步定时任务 + synchronizeData(){ + this.loading = true; + listJob(this.TaskQueryParams).then(response => { + let row = response.rows[0]; + runJob(row.jobId, row.jobGroup).then(response =>{ + this.$modal.msgSuccess("执行成功,同步详情可在定时任务日志查看"); + this.loading = false; + }) + }); + }, + }, + mounted() { + // 组件挂载后启动定时器,每秒执行一次 + // this.weightTimer = setInterval(() => { + // this.handleGetweight(); + // }, 1000); + }, + beforeDestroy() { + // 组件销毁前清除定时器 + if (this.weightTimer) { + clearInterval(this.weightTimer); + this.weightTimer = null; } }, -mounted() { - // 组件挂载后启动定时器,每秒执行一次 - // this.weightTimer = setInterval(() => { - // this.handleGetweight(); - // }, 1000); -}, -beforeDestroy() { - // 组件销毁前清除定时器 - if (this.weightTimer) { - clearInterval(this.weightTimer); - this.weightTimer = null; - } -} }