完善定时任务维护
This commit is contained in:
parent
d4a90bdb7d
commit
f0bb390907
@ -221,6 +221,13 @@ export default {
|
|||||||
get: async function (params) {
|
get: async function (params) {
|
||||||
return await http.post(this.url, params);
|
return await http.post(this.url, params);
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
field:{
|
||||||
|
url: `${config.API_URL}/inventory.field.list`,
|
||||||
|
name: "库存列表检索",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url,params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
out:{
|
out:{
|
||||||
@ -230,6 +237,13 @@ export default {
|
|||||||
get: async function (params) {
|
get: async function (params) {
|
||||||
return await http.post(this.url, params);
|
return await http.post(this.url, params);
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
field:{
|
||||||
|
url: `${config.API_URL}/out.stock.field.list`,
|
||||||
|
name: "销售出库清单检索",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url,params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,6 +103,50 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
crontab:{
|
||||||
|
configList:{
|
||||||
|
url: `${config.API_URL}/crontab.config.list`,
|
||||||
|
name: "定时系统配置列表",
|
||||||
|
get: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
list:{
|
||||||
|
url: `${config.API_URL}/crontab.list`,
|
||||||
|
name: "定时任务列表",
|
||||||
|
get: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
add:{
|
||||||
|
url: `${config.API_URL}/crontab.add`,
|
||||||
|
name: "添加配置",
|
||||||
|
post: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
status:{
|
||||||
|
url: `${config.API_URL}/crontab.status`,
|
||||||
|
name: "定时任务状态",
|
||||||
|
post: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
delete:{
|
||||||
|
url: `${config.API_URL}/crontab.delete`,
|
||||||
|
name: "删除配置",
|
||||||
|
post: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
describe:{
|
||||||
|
url: `${config.API_URL}/crontab.describe`,
|
||||||
|
name: "定时任务表达式转换",
|
||||||
|
post: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
bom:{
|
bom:{
|
||||||
list:{
|
list:{
|
||||||
url: `${config.API_URL}/bom.list`,
|
url: `${config.API_URL}/bom.list`,
|
||||||
|
|||||||
17
src/assets/icons/RegularTime.vue
Normal file
17
src/assets/icons/RegularTime.vue
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<template>
|
||||||
|
<svg t="1725431248829" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4597" width="200" height="200">
|
||||||
|
<path d="M448.284444 901.688889H186.823111a64.967111 64.967111 0 0 1-65.024-64.967111V186.88c0-35.896889 29.127111-65.024 65.024-65.024h584.817778c35.953778 0 65.024 29.127111 65.024 65.024v222.378667c23.381333 10.24 44.771556 23.779556 64.967111 39.025777V186.88A129.991111 129.991111 0 0 0 771.754667 56.888889H186.88A129.991111 129.991111 0 0 0 56.888889 186.88v649.841778a129.991111 129.991111 0 0 0 129.991111 129.991111h326.656A327.509333 327.509333 0 0 1 448.284444 901.688889z" p-id="4598"></path>
|
||||||
|
<path d="M721.806222 484.408889a245.304889 245.304889 0 1 0 0 490.666667 245.304889 245.304889 0 0 0 0-490.666667z m0 429.169778a183.921778 183.921778 0 1 1 0-367.786667 183.921778 183.921778 0 0 1 0 367.786667z" p-id="4599"></path>
|
||||||
|
<path d="M824.945778 707.413333h-69.688889v-34.872889a34.872889 34.872889 0 1 0-69.745778 0v69.688889c0 19.285333 15.644444 34.872889 34.872889 34.872889h104.561778a34.872889 34.872889 0 0 0 0-69.688889zM466.488889 218.396444a34.702222 34.702222 0 0 0-48.981333 0L301.340444 334.506667l-46.478222-46.478223a33.450667 33.450667 0 1 0-47.331555 47.331556l64.910222 64.853333c1.479111 2.56 2.616889 5.12 4.835555 7.281778a34.702222 34.702222 0 0 0 26.055112 9.898667 33.564444 33.564444 0 0 0 23.779555-9.841778c0.739556-0.739556 1.137778-1.706667 1.706667-2.616889L466.488889 267.320889a34.588444 34.588444 0 0 0 0-48.924445z m114.517333 59.676445a34.872889 34.872889 0 1 0 0 69.688889h209.066667a34.816 34.816 0 1 0 0-69.688889h-209.066667z m-163.498666 184.32l-116.167112 116.053333-46.478222-46.478222a33.450667 33.450667 0 0 0-47.331555 47.331556l64.910222 64.853333c1.479111 2.56 2.616889 5.12 4.835555 7.281778 7.224889 7.168 16.725333 10.24 26.055112 9.898666a33.450667 33.450667 0 0 0 23.779555-9.784889c0.739556-0.796444 1.137778-1.763556 1.706667-2.673777L466.488889 511.260444a34.702222 34.702222 0 0 0-48.981333-48.924444z" p-id="4600"></path>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "RegularTime"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -27,6 +27,7 @@ export { default as FormXls } from './FormXls.vue'
|
|||||||
export { default as AgentMaintenance } from './AgentMaintenance.vue'
|
export { default as AgentMaintenance } from './AgentMaintenance.vue'
|
||||||
export { default as CostAllocation } from './CostAllocation.vue'
|
export { default as CostAllocation } from './CostAllocation.vue'
|
||||||
export { default as K3Api } from './K3Api.vue'
|
export { default as K3Api } from './K3Api.vue'
|
||||||
|
export { default as RegularTime } from './RegularTime.vue'
|
||||||
export { default as CostSetup } from './CostSetup.vue'
|
export { default as CostSetup } from './CostSetup.vue'
|
||||||
export { default as MaterialSetup } from './MaterialSetup.vue'
|
export { default as MaterialSetup } from './MaterialSetup.vue'
|
||||||
export { default as MaintenanceSetup } from './MaintenanceSetup.vue'
|
export { default as MaintenanceSetup } from './MaintenanceSetup.vue'
|
||||||
|
|||||||
@ -139,11 +139,9 @@ function webSocketOnMessage(msg) {
|
|||||||
global_callback(result);
|
global_callback(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result.data && (result.data.type == -1 || result.data.type == 0 || result.data.type == 8 || result.data.type == 9)) {
|
if (result.data && (result.data.type == -1 || result.data.type == 0 || result.data.type == 9 || result.data.type == 13)) {
|
||||||
if(result.data.type == -1 || result.data.type == 0){
|
if(result.data.type == -1 || result.data.type == 0){
|
||||||
if(result.data && result.data.data.token){
|
if(result.data && result.data.data && result.data.data.token){
|
||||||
console.log(result.data.data.token)
|
|
||||||
// tool.cookie.set("TOKEN", result.data.data.token);
|
|
||||||
let reToken = result.data.data.token.replace(/Bearer /g, "");
|
let reToken = result.data.data.token.replace(/Bearer /g, "");
|
||||||
tool.cookie.set("TOKEN", reToken);
|
tool.cookie.set("TOKEN", reToken);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
|
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增库存</el-button>
|
||||||
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
|
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
|
|||||||
@ -39,10 +39,10 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
pushSettings: defineAsyncComponent(() => import('./setup/computerRoom')),
|
pushSettings: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
password: defineAsyncComponent(() => import('./setup/computerRoom')),
|
|
||||||
upToEnterprise: defineAsyncComponent(() => import('./setup/computerRoom')),
|
upToEnterprise: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
|
password: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
|
regularTime: defineAsyncComponent(() => import('./setup/regularTime')),
|
||||||
account: defineAsyncComponent(() => import('./setup/computerRoom')),
|
account: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
bind: defineAsyncComponent(() => import('./setup/computerRoom')),
|
|
||||||
mail: defineAsyncComponent(() => import('./setup/mail')),
|
mail: defineAsyncComponent(() => import('./setup/mail')),
|
||||||
interface: defineAsyncComponent(() => import('./setup/interface')),
|
interface: defineAsyncComponent(() => import('./setup/interface')),
|
||||||
cost: defineAsyncComponent(() => import('./setup/cost')),
|
cost: defineAsyncComponent(() => import('./setup/cost')),
|
||||||
@ -78,7 +78,13 @@ export default {
|
|||||||
title: "物料成本配置",
|
title: "物料成本配置",
|
||||||
component: "material",
|
component: "material",
|
||||||
actions:'materialCostAdd'
|
actions:'materialCostAdd'
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
icon: "sc-icon-RegularTime",
|
||||||
|
title: "系统定时任务维护",
|
||||||
|
component: "regularTime",
|
||||||
|
actions:'crontabAdd'
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
181
src/views/setting/advanced/setup/regularTime.vue
Normal file
181
src/views/setting/advanced/setup/regularTime.vue
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
<template>
|
||||||
|
<el-container class="mainBox">
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<div class="searchMain">
|
||||||
|
<div class="title">任务信息</div>
|
||||||
|
<el-form ref="form" :size="size" :model="form" label-width="100px">
|
||||||
|
<el-form-item label="任务名称" prop="name">
|
||||||
|
<el-select type="text" v-model="form.name" placeholder="请选择任务名称" style="width: 100%;" @visible-change="getNameList" @change="nameChange">
|
||||||
|
<el-option v-for="(item,index) in setMap.nameList" :key="index" :value="item.name" :label="item.name"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="任务描述" prop="memo">
|
||||||
|
<el-input type="text" v-model="form.memo" placeholder="请输入任务描述" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="定时任务表达式" prop="cron_expression">
|
||||||
|
<el-input type="text" v-model="form.cron_expression" @input="cronExpressionInput" placeholder="请输入定时任务表达式"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="表达式描述" prop="cron_expression_desc">
|
||||||
|
<el-input type="text" v-model="form.cron_expression_desc" placeholder="请输入表达式描述" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="">
|
||||||
|
<el-button :size="size" type="primary" @click="save" :loading="isSave">保存配置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="title">配置列表</div>
|
||||||
|
</div>
|
||||||
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow :hideDo="true" :hidePagination="true">
|
||||||
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
|
<el-table-column width="200" label="任务名称" prop="name"></el-table-column>
|
||||||
|
<el-table-column width="200" label="任务描述" prop="memo"></el-table-column>
|
||||||
|
<el-table-column width="200" label="任务表达式" prop="cron_expression"></el-table-column>
|
||||||
|
<el-table-column label="表达式描述" prop="cron_expression_desc" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column width="100" label="状态" fixed="right" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch :size="size" v-model="scope.row.active_status" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_status" :active-value="true" :inactive-value="false"></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-dropdown>
|
||||||
|
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<div v-auth="'crontabDelete'">
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除配置</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "regularTime",
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
size:'small',
|
||||||
|
isSave:false,
|
||||||
|
setMap:{
|
||||||
|
nameList:[]
|
||||||
|
},
|
||||||
|
form:{
|
||||||
|
memo:"",
|
||||||
|
name:"",
|
||||||
|
cron_expression:"",
|
||||||
|
cron_expression_desc:"",
|
||||||
|
callback:{
|
||||||
|
command:""
|
||||||
|
},
|
||||||
|
type:""
|
||||||
|
},
|
||||||
|
list:{
|
||||||
|
apiObj:this.$API.setup.crontab.list,
|
||||||
|
column:[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async getNameList() {
|
||||||
|
const res = await this.$API.setup.crontab.configList.get()
|
||||||
|
if(res.code == 200){
|
||||||
|
this.setMap.nameList = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nameChange(e){
|
||||||
|
this.setMap.nameList.forEach(item=>{
|
||||||
|
if(item.name == e){
|
||||||
|
this.form.memo = item.memo;
|
||||||
|
this.form.cron_expression = item.cron_expression;
|
||||||
|
this.form.cron_expression_desc = item.cron_expression_desc;
|
||||||
|
this.form.callback = item.callback;
|
||||||
|
this.form.task_type = item.type;
|
||||||
|
|
||||||
|
this.setDescribe();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cronExpressionInput(){
|
||||||
|
this.setDescribe();
|
||||||
|
},
|
||||||
|
// 表达式转换备注
|
||||||
|
async setDescribe() {
|
||||||
|
let params = {
|
||||||
|
cron_expression: this.form.cron_expression
|
||||||
|
}
|
||||||
|
const res = await this.$API.setup.crontab.describe.post(params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.form.cron_expression_desc = res.data.cron_expression;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
save(){
|
||||||
|
this.$refs.form.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.isSave = true;
|
||||||
|
const res = await this.$API.setup.crontab.add.post(this.form);
|
||||||
|
this.isSave = false;
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$refs.table.reload();
|
||||||
|
this.visible = false;
|
||||||
|
this.$message.success("操作成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
table_del(row){
|
||||||
|
this.$confirm(`确定删除 ${row.name} 吗?`, '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
const reqData = {id: row.id};
|
||||||
|
const res = await this.$API.setup.crontab.delete.post(reqData);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$refs.table.refresh()
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
}
|
||||||
|
}).catch(()=>{})
|
||||||
|
},
|
||||||
|
// 状态
|
||||||
|
changeSwitch(val, row) {
|
||||||
|
row.$switch_yx = true;
|
||||||
|
setTimeout(async () => {
|
||||||
|
let params = {
|
||||||
|
id: row.id,
|
||||||
|
status: row.active_status,
|
||||||
|
};
|
||||||
|
const res = await this.$API.setup.crontab.status.post(params);
|
||||||
|
if(res.code !=200){
|
||||||
|
row.active_status = !row.active_status;
|
||||||
|
}
|
||||||
|
delete row.$switch_status;
|
||||||
|
delete row.$switch_yx;
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.el-main.nopadding .searchMain{
|
||||||
|
align-items: flex-start;
|
||||||
|
.title{
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0 0 5px 0;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.searchMain{
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
.el-input{
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user