1.出入磅添加定时任务同步按钮
This commit is contained in:
parent
1b53d243c9
commit
6204f2e621
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue