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="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="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="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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
@ -497,6 +499,7 @@ import {mulToString,mulToArray} from "@/api/tool/util.js"
|
||||||
import { getSearchSelectData } from "@/api/tool/gen.js";
|
import { getSearchSelectData } from "@/api/tool/gen.js";
|
||||||
//引入searchData组件
|
//引入searchData组件
|
||||||
import {selectConfigs} from "@/components/SearchSelect/searchdata.js";
|
import {selectConfigs} from "@/components/SearchSelect/searchdata.js";
|
||||||
|
import { listJob, runJob} from "@/api/monitor/job";
|
||||||
export default {
|
export default {
|
||||||
name: "Outinpound",
|
name: "Outinpound",
|
||||||
components: {SearchSelect},
|
components: {SearchSelect},
|
||||||
|
@ -545,6 +548,15 @@ export default {
|
||||||
weightTimer: null, // 存储定时器ID
|
weightTimer: null, // 存储定时器ID
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
//定时任务参数
|
||||||
|
TaskQueryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
jobName: null,
|
||||||
|
invokeTarget: 'apiTask.getOAData()',
|
||||||
|
jobGroup: undefined,
|
||||||
|
status: undefined
|
||||||
|
},
|
||||||
tabs: [
|
tabs: [
|
||||||
{ name: 'weighingRequest', label: '过磅申请' },
|
{ name: 'weighingRequest', label: '过磅申请' },
|
||||||
{ name: 'tareRequest', label: '过皮申请' },
|
{ name: 'tareRequest', label: '过皮申请' },
|
||||||
|
@ -1096,20 +1108,31 @@ export default {
|
||||||
getOptionsByKey(key) {
|
getOptionsByKey(key) {
|
||||||
const cfg = this.searchData.selectConfigs.find(c => c.key === key);
|
const cfg = this.searchData.selectConfigs.find(c => c.key === key);
|
||||||
return this.searchData.optionsMap[this.buildCacheKey(cfg)] || [];
|
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.weightTimer = setInterval(() => {
|
||||||
// this.handleGetweight();
|
// this.handleGetweight();
|
||||||
// }, 1000);
|
// }, 1000);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// 组件销毁前清除定时器
|
// 组件销毁前清除定时器
|
||||||
if (this.weightTimer) {
|
if (this.weightTimer) {
|
||||||
clearInterval(this.weightTimer);
|
clearInterval(this.weightTimer);
|
||||||
this.weightTimer = null;
|
this.weightTimer = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue