排产代码提交

dev-scheduling
zhangdi 12 hours ago
parent 40648601c7
commit 7280f8c9bb
  1. 124
      src/views/productionSchedulingPlan/schedulingDashboard/index.vue
  2. 35
      src/views/productionSchedulingPlan/statisticalAnalysis/index.vue

@ -5,7 +5,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="维度:">
<el-select v-model="formLabelAlign.type" placeholder="请选择">
<el-select v-model="formLabelAlign.type" placeholder="请选择" @change="typeChange">
<el-option label="车间订单" value="1"> </el-option>
<el-option label="班组" value="2"> </el-option>
<el-option label="设备" value="3"> </el-option>
@ -19,20 +19,31 @@
</el-col>
<el-col :span="6" v-if="formLabelAlign.type == '2'">
<el-form-item label="班组:">
<el-input v-model="formLabelAlign.teamame" placeholder="请输入"></el-input>
<!-- <el-select v-model="formLabelAlign.teamame" placeholder="请选择">
<el-option label="班组1" value="1"> </el-option>
<el-option label="班组2" value="2"> </el-option>
</el-select> -->
<!-- <el-input v-model="formLabelAlign.teamame" placeholder="请输入"></el-input> -->
<el-select v-model="formLabelAlign.teamName" filterable placeholder="请选择">
<el-option
v-for="(item, index) in selectTeamOptions"
:label="item"
:value="item"
:key="index"
>
</el-option>
<!-- <el-option label="班组2" value="2"> </el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formLabelAlign.type == '3'">
<el-form-item label="设备:">
<el-input v-model="formLabelAlign.equipName" placeholder="请输入"></el-input>
<!-- <el-select v-model="formLabelAlign.equipName" placeholder="请选择">
<el-option label="设备1" value="1"> </el-option>
<el-option label="设备2" value="2"> </el-option>
</el-select> -->
<!-- <el-input v-model="formLabelAlign.equipName" placeholder="请输入"></el-input> -->
<el-select v-model="formLabelAlign.equipName" filterable placeholder="请选择">
<el-option
v-for="(item, index) in selectEquipOptions"
:label="item"
:value="item"
:key="index"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
@ -252,19 +263,19 @@
<span class="label">零件号</span>
<span class="value">{{ tooltipData.partCode || '-' }}</span>
</li>
<li class="detail-item">
<li class="detail-item">
<span class="label">流程卡号</span>
<span class="value">{{ tooltipData.cardNo || '-' }}</span>
</li>
<li class="detail-item">
<li class="detail-item">
<span class="label">批次号</span>
<span class="value">{{ tooltipData.batchNo || '-' }}</span>
</li>
<li class="detail-item">
<li class="detail-item">
<span class="label">当前工序</span>
<span class="value">{{ tooltipData.currentProcessName || '-' }}</span>
</li>
<li class="detail-item">
<li class="detail-item">
<span class="label">数量</span>
<span class="value">{{ tooltipData.makeQty || '-' }}</span>
</li>
@ -293,7 +304,6 @@
<i v-if="tooltipData.planStatus == '3'">报工完成</i>
<i v-if="tooltipData.planStatus == '5'">已完成</i>
<i v-if="tooltipData.planStatus == '6'">已返工</i>
</el-tag>
<el-tag v-if="searchType == '2' || searchType == '3'" :type="tooltipData.status">
<i v-if="tooltipData.orderStatus == '1'">未开始</i>
@ -311,7 +321,7 @@
</template>
<script>
import { getData } from '@/api/productionSchedulingPlan/scheduling';
import { getData, selectEquip, selectTeam } from '@/api/productionSchedulingPlan/scheduling';
export default {
name: 'GanttChart',
data() {
@ -341,6 +351,8 @@ export default {
tooltipY: 0,
baseRowHeight: 36, //
rowHeights: {}, //
selectTeamOptions: [], //
selectEquipOptions: [], //
};
},
computed: {
@ -366,13 +378,29 @@ export default {
this.searchType = this.formLabelAlign.type;
this.formLabelAlign.startTime = new Date().toISOString().substr(0, 10);
this.getData();
this.getSelectTeam();
},
methods: {
typeChange(){
this.formLabelAlign.teamName = ''
this.formLabelAlign.equipName = ''
this.formLabelAlign.woCode = ''
},
getData() {
getData(this.formLabelAlign).then(res => {
this.processData(res.data.data);
});
},
getSelectEquip() {
selectEquip().then(res => {
this.selectEquipOptions = res.data.data;
});
},
getSelectTeam() {
selectTeam().then(res => {
this.selectTeamOptions = res.data.data;
});
},
processData(rawData) {
const tasks = [];
const workOrders = Object.keys(rawData);
@ -519,40 +547,40 @@ export default {
//
showTooltip(e, task, device) {
this.tooltipData = { ...task, device };
this.tooltipVisible = true; // tooltip便
this.$nextTick(() => {
const tooltipEl = document.querySelector('.tooltip');
if (!tooltipEl) return; //
const tooltipWidth = tooltipEl.offsetWidth;
const tooltipHeight = tooltipEl.offsetHeight;
const padding = 5; // tooltip
const mouseOffsetX = 8; // 10px8px
const mouseOffsetY = 8; // 10px8px
//
let x = e.pageX + mouseOffsetX;
let y = e.pageY + mouseOffsetY;
//
if (x + tooltipWidth > document.documentElement.clientWidth) {
x = e.pageX - tooltipWidth - mouseOffsetX;
}
this.tooltipData = { ...task, device };
this.tooltipVisible = true; // tooltip便
this.$nextTick(() => {
const tooltipEl = document.querySelector('.tooltip');
if (!tooltipEl) return; //
const tooltipWidth = tooltipEl.offsetWidth;
const tooltipHeight = tooltipEl.offsetHeight;
const padding = 5; // tooltip
const mouseOffsetX = 8; // 10px8px
const mouseOffsetY = 8; // 10px8px
//
let x = e.pageX + mouseOffsetX;
let y = e.pageY + mouseOffsetY;
//
if (x + tooltipWidth > document.documentElement.clientWidth) {
x = e.pageX - tooltipWidth - mouseOffsetX;
}
//
if (y + tooltipHeight > document.documentElement.clientHeight) {
y = e.pageY - tooltipHeight - mouseOffsetY;
}
//
if (y + tooltipHeight > document.documentElement.clientHeight) {
y = e.pageY - tooltipHeight - mouseOffsetY;
}
//
x = Math.max(padding, x);
y = Math.max(padding, y);
//
x = Math.max(padding, x);
y = Math.max(padding, y);
this.tooltipX = x;
this.tooltipY = y;
});
this.tooltipX = x;
this.tooltipY = y;
});
},
hideTooltip() {
this.tooltipVisible = false;

@ -19,9 +19,7 @@
>
<template #menu-left> </template>
<template #menu-right> </template>
<template #schedulingRate="{ row }">
{{row.schedulingRate}}%
</template>
<template #schedulingRate="{ row }"> {{ row.schedulingRate }}% </template>
</avue-crud>
</basic-container>
</template>
@ -153,7 +151,7 @@ export default {
sums[index] = all;
} else if (prop == 'schedulingRate') {
// sums[index] = all / values.length + '%' || 0;
sums[index] = ((sums[3]/sums[2])*100).toFixed(2)+ '%' || 0
sums[index] = ((sums[3] / sums[2]) * 100).toFixed(2) + '%' || 0;
}
} else {
if (index == 0) {
@ -172,7 +170,7 @@ export default {
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
@ -188,22 +186,27 @@ export default {
},
onLoad(page, params = {}) {
console.log(9999999,!!params.cycledate,(!!params.cycledate)&&params.cycledate.lenght>0)
console.log(9999999, !!params.cycledate, !!params.cycledate && params.cycledate.lenght > 0);
this.loading = true;
this.data = [];
if(!!params.cycledate){
this.query.startTime=params.cycledate[0]
this.query.endTime=params.cycledate[1]
if (!!params.cycledate) {
this.query.startTime = params.cycledate[0];
this.query.endTime = params.cycledate[1];
}
schedulingCount(this.query).then(
res => {
this.data = res.data.data;
this.loading = false;
this.page.total = res.data.data.total;
}
);
schedulingCount(this.query).then(res => {
this.data = res.data.data;
this.loading = false;
this.page.total = res.data.data.total;
});
},
},
mounted() {},
};
</script>
<style lang="scss" scoped>
:deep(.el-button--primary) {
background-color: #284c89 !important;
color: #fff;
}
</style>

Loading…
Cancel
Save