甘特图排产页面

This commit is contained in:
JinLu.Yin 2022-05-16 22:21:31 +08:00
parent f2b2dbc363
commit 4425d6960e
5 changed files with 106 additions and 5 deletions

View File

@ -176,6 +176,20 @@ export const dynamicRoutes = [
} }
] ]
}, },
{
path: '/mes/pro/schedule',
component: Layout,
hidden: true,
permissions: ['mes:pro:schedule:edit'],
children: [
{
path: 'ganttedit',
component: () => import("@/views/mes/pro/schedule/ganttedit"),
name: 'ganttEdit',
meta: {title: '使用甘特图排产',activeMenu: '/mes/pro/schedule'}
}
]
},
{ {
path: '/monitor/job-log', path: '/monitor/job-log',
component: Layout, component: Layout,

View File

@ -0,0 +1,76 @@
<template>
<div class="wrapper">
<div class="container">
<GanttChar class="left-container" ref="ganttChar" optType="edit" :tasks="tasks"></GanttChar>
</div>
</div>
</template>
<script>
import GanttChar from "./ganttx.vue";
import {listGanttTaskList} from "@/api/mes/pro/protask";
export default {
name:'',
components:{GanttChar},
data(){
return {
tasks:{
data: [],
links: []
},
optType:'edit',
//
queryParams: {
workorderCode: null,
workorderName: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
status: null,
},
}
},
created(){
this.getGanttTasks();
},
methods: {
getGanttTasks(){
listGanttTaskList(this.queryParams).then(response =>{
debugger;
this.tasks.data = response.data.data;
this.tasks.links = response.data.links;
this.$refs.ganttChar.reload();
});
},
}
}
</script>
<style scoped>
.wrapper{
height: 700px;
}
.container {
height: 100%;
width: 100%;
}
.left-container {
overflow: hidden;
position: relative;
height: 100%;
}
</style>

View File

@ -17,6 +17,12 @@ export default {
default () { default () {
return {data: [], links: []} return {data: [], links: []}
} }
},
optType: {
type: String,
default (){
return 'view'
}
} }
}, },
@ -60,7 +66,12 @@ export default {
initConfig() { initConfig() {
// 1 // 1
// 1.1 // 1.1
gantt.config.readonly = true; if(this.optType =='view'){
gantt.config.readonly = true;
}else{
gantt.config.readonly = false;
}
// 1.2 // 1.2
gantt.config.duration_unit="hour"; gantt.config.duration_unit="hour";
gantt.config.duration_step=8; gantt.config.duration_step=8;

View File

@ -73,7 +73,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-refresh" circle="" @click="getList"></el-button> <el-button type="primary" icon="el-icon-refresh" circle="" @click="getList"></el-button>
<el-button type="primary" icon="el-icon-edit" circle="" @click="getList"></el-button> <el-button type="primary" icon="el-icon-edit" circle="" @click="handleOpenGantt"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="wrapper"> <div class="wrapper">
@ -351,7 +351,9 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
handleOpenGantt(){
this.$router.push({ path: '/mes/pro/schedule/ganttedit'})
},
getGanttTasks(){ getGanttTasks(){
listGanttTaskList(this.queryParams).then(response =>{ listGanttTaskList(this.queryParams).then(response =>{
debugger; debugger;

View File

@ -347,12 +347,10 @@ export default {
}, `warehouse_${new Date().getTime()}.xlsx`) }, `warehouse_${new Date().getTime()}.xlsx`)
}, },
handleLocation(warehouseId){ handleLocation(warehouseId){
debugger;
this.$router.push({ path: '/mes/wm/location/index', query: { warehouseId: warehouseId || 0 ,optType: this.optType} }) this.$router.push({ path: '/mes/wm/location/index', query: { warehouseId: warehouseId || 0 ,optType: this.optType} })
}, },
// //
handleAutoGenChange(autoGenFlag){ handleAutoGenChange(autoGenFlag){
debugger;
if(autoGenFlag){ if(autoGenFlag){
genCode('WAREHOUSE_CODE').then(response =>{ genCode('WAREHOUSE_CODE').then(response =>{
this.form.warehouseCode = response; this.form.warehouseCode = response;