1.出入磅添加定时任务同步按钮

This commit is contained in:
ptt 2025-07-09 10:24:31 +08:00
parent 1b53d243c9
commit 6204f2e621
1 changed files with 36 additions and 13 deletions

View File

@ -76,6 +76,8 @@
<!-- <el-button type="primary" size="mini" @click="handleStopTimer">停止/启动获取</el-button>-->
<el-button type="primary" size="mini" @click="getwghqty" :disabled="this.queryParams.carno =='' || this.queryParams.carno == null || this.activeTab != 'weighingRequest'">称毛重</el-button>
<el-button type="primary" size="mini" @click="getempqty" :disabled="this.queryParams.carno =='' || this.queryParams.carno == null">称皮重</el-button>
<el-button type="primary" size="mini" @click="synchronizeData">同步</el-button>
</el-form-item>
</el-form>
@ -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)] || [];
}
},
mounted() {
//
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() {
},
beforeDestroy() {
//
if (this.weightTimer) {
clearInterval(this.weightTimer);
this.weightTimer = null;
}
}
},
}
</script>