This commit is contained in:
caoqianming 2025-06-12 08:48:41 +08:00
commit b48e263cd6
6 changed files with 377 additions and 310 deletions

BIN
public/img/bx/gx_blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
public/img/bx/gx_green.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
public/img/bx/gx_purple.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
public/img/bx/gx_yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -1,117 +1,83 @@
<template> <template>
<div class="widgets-home" ref="main"> <div>
<div class="widgets-content"> <div class="retangleWrap">
<div class="retangleWrap retangleWrapTop"> <div class="retangleImg">
<div class="retangle retangleImg"> <div class="card_title">未完成生产计划</div>
<div class="companyName">玻纤生产管理</div> <div class="card_body">
<div class="companyDesc"> <div class="card_body_num">{{ number_tasktodo }}</div>
公司秉承善用资源服务建设的核心理念践行材料创造美 <div class="card_body_line"></div>
</div> <div class="card_body_img">
<div class="companyDesc"> <div class="card_body_img_box">
好世界的企业使命坚持创新绩效和谐责任的核心价 <el-icon class="card_body_icon"><el-icon-list/></el-icon>
</div> </div>
<div class="companyDesc"> </div>
值观努力成长为具有创新精神和全球视野的光芯材料领先企业 </div>
</div> </div>
<img class="topCardImg" src="img/topCard.png" /> <div class="retangleImg">
<div class="card_title">未提交的日志</div>
<div class="card_body">
<div class="card_body_num">{{ number_mlogtoSubmit }}</div>
<div class="card_body_line"></div>
<div class="card_body_img">
<div class="card_body_img_box">
<el-icon class="card_body_icon"><el-icon-list/></el-icon>
</div>
</div>
</div>
</div>
<div class="retangleImg">
<div class="card_title">未接收的物料</div>
<div class="card_body">
<div class="card_body_num">{{ number_materialRecive }}</div>
<div class="card_body_line"></div>
<div class="card_body_img">
<div class="card_body_img_box">
<el-icon class="card_body_icon"><el-icon-list/></el-icon>
</div>
</div>
</div>
</div>
<div class="retangleImg">
<div class="card_title">未完成的物料批次</div>
<div class="card_body">
<div class="card_body_num">{{ number_materialTodo }}</div>
<div class="card_body_line"></div>
<div class="card_body_img">
<div class="card_body_img_box">
<el-icon class="card_body_icon"><el-icon-list/></el-icon>
</div>
</div>
</div>
</div> </div>
</div> </div>
<el-row>
<el-col :span="8">
<div class="retangleWrap"> <div class="retangleWrap">
<div class="retangleContainer"> <div class="retangleContainer">
<div class="retangleTitle"> <div class="retangleTitle">
<div class="title">设备列表</div> <div class="title">本月生产统计</div>
<el-select v-model="mgroupName" placeholder="请选择工段" @change="mgroupChange">
<el-option
v-for="item in mgroups"
:key="item.name"
:label="item.name"
:value="item.name"
/>
</el-select>
</div> </div>
<div class="retangleTable"> <div class="retangleTable">
<el-table <scEcharts height="285px" v-if="chart0Visible" :width="'100%'" :option="option1"></scEcharts>
:data="tableDataEq"
style="width: 100%; height: 285px"
>
<el-table-column prop="name" label="设备名称"/>
<el-table-column prop="number" label="设备编号"/>
<el-table-column prop="model" label="设备型号"/>
<el-table-column prop="belong_dept_name" label="所属部门"/>
</el-table>
</div> </div>
</div> </div>
</div> </div>
</el-col>
<el-col :span="8">
<div class="retangleWrap" style="padding: 25px 0 0 0;">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">车间物料</div>
</div>
<div class="retangleTable">
<el-table
:data="tableDataIn"
style="width: 100%; height: 285px"
>
<el-table-column prop="material_name" label="物料名称" min-width="120"/>
<el-table-column prop="mgroup_name" label="所属工段" min-width="60"/>
<el-table-column prop="count" label="数量" min-width="60"/>
</el-table>
</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="retangleWrap"> <div class="retangleWrap">
<div class="retangleContainer"> <div class="retangleContainer">
<div class="retangleTitle"> <div class="retangleTitle">
<div class="title">半成品库存统计</div> <div class="title">本月工段生产统计</div>
</div> </div>
<div class="retangleTable"> <div class="retangleTable">
<el-table <scEcharts height="285px" :width="'100%'" :option="option2"></scEcharts>
:data="tableDataOut"
style="width: 100%; height: 285px"
>
<el-table-column prop="name" label="物料名称"/>
<el-table-column prop="model" label="型号"/>
<el-table-column prop="specification" label="规格"/>
<el-table-column prop="count" label="数量"/>
</el-table>
</div> </div>
</div> </div>
</div> </div>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<div class="retangleWrap" style="padding: 25px 0 0 20px;">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">成品库存统计</div>
</div>
<div class="retangleTable">
<el-table
:data="tableData"
style="width: 100%; height: 285px"
>
<el-table-column prop="name" label="物料名称"/>
<el-table-column prop="model" label="型号"/>
<el-table-column prop="specification" label="规格"/>
<el-table-column prop="count" label="数量"/>
</el-table>
</div>
</div>
</div>
</el-col>
<el-col :span="15">
<div class="retangleWrap">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">生产统计</div>
</div>
<div class="retangleTable">
<scEcharts height="285px" :width="'100%'" :option="option"></scEcharts>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -119,12 +85,13 @@ import * as echarts from "echarts";
export default { export default {
data() { data() {
return { return {
tableData: [], number_tasktodo: 0,
tableDataIn: [], number_mlogtoSubmit: 0,
tableDataEq: [], number_materialRecive: 0,
tableDataOut: [], number_materialTodo: 0,
materialType: 20, xAxisData: [],
option: { option1: {
color: ['rgb(128, 255, 165)', 'rgb(0, 221, 255)'],
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
@ -135,17 +102,98 @@ export default {
}, },
}, },
grid: { grid: {
top: "5%", top: "10%",
left: "1%", left: "1%",
right: "1%", right: "1%",
bottom: "5%", bottom: "5%",
containLabel: true, containLabel: true,
}, },
legend: {
top: 0,
right: 5,
data: ["生产数","合格数"],
},
xAxis: { xAxis: {
type: "category", type: "category",
axisLabel: { axisLabel: {
// show: false, // X // show: false, // X
}, },
boundaryGap: false,
data: [1,2,3,4,5,6,7,8,9,10],
},
yAxis: {
type: "value",
axisLabel: {
show: false, // X
},
},
series: [
{
name: "生产数",
type: "line",
smooth: true,
showSymbol: false,//
lineStyle: {
color: "rgb(128, 255, 165)",
},
areaStyle: {
opacity: 0.5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0,color: "rgb(128, 255, 165)",},
{offset: 1,color: "rgb(1, 191, 236)",}]),
},
emphasis: {
focus: "series",
},
data: [],
},
{
name: "合格数",
type: "line",
smooth: true,
showSymbol: false,//
lineStyle: {
color:"rgb(0, 221, 255)"
},
areaStyle: {
opacity: 0.5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0,color: "rgb(0, 221, 255)",},
{offset: 1,color: "rgb(77, 119, 255)",}]),
},
emphasis: {
focus: "series",
},
data: [],
}
],
},
option2: {
color: [ 'rgb(116, 21, 219)', 'rgb(255, 0, 135)'],
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
label: {
backgroundColor: "#6a7985",
},
},
},
grid: {
top: "10%",
left: "1%",
right: "1%",
bottom: "5%",
containLabel: true,
},
legend: {
top: 0,
right: 5,
data: ["计划数", "生产数"],
},
xAxis: {
type: "category",
boundaryGap: false,
data: [], data: [],
}, },
yAxis: { yAxis: {
@ -154,103 +202,249 @@ export default {
show: false, // X show: false, // X
}, },
}, },
series: { series: [
data: [], {
type: "bar", name: "计划数",
barMaxWidth: 30, type: "line",
smooth: true,
showSymbol: false,//
lineStyle: {
color: "rgb(116, 21, 219)",
},
areaStyle: {
opacity: 0.5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0,color: "rgb(55, 162, 255)",},
{offset: 1,color: "rgb(116, 21, 219)",}]),
},
emphasis: { emphasis: {
focus: "series", focus: "series",
}, },
label: { data: [],
show: true,
position: "top",
color: "#000",
}, },
itemStyle: { {
borderRadius: [5, 5, 0, 0], name: "生产数",
normal: { color: "rgb(20, 141, 255)" }, type: "line",
smooth: true,
showSymbol: false,//
lineStyle: {
color:"rgb(255, 0, 135)"
}, },
areaStyle: {
opacity: 0.5,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0,color: "rgb(255, 0, 135)",},
{offset: 1,color: "rgb(135, 0, 157)",}]),
}, },
emphasis: {
focus: "series",
}, },
data: [],
}
],
},
mgroups:[],
mgroupsId:'',
start_date:'',
end_date:'',
mgroupName:'',
chart0Visible: true,
chart1Visible: true,
}; };
}, },
mounted() { mounted() {
this.$emit("on-mounted"); let that = this;
// var myDate = new Date();
this.getEquipmentList(); let year = myDate.getFullYear();
// let month = myDate.getMonth() + 1;
this.getMaterialInList(); let day = myDate.getDate();
// that.year_s = year;
this.getMaterialOutList(); that.month_s = month;
// that.day_s = day;
this.getMaterialList(); let days = day>10?day:'0'+day;
// let months = month>10?month:'0'+month;
// this.getMtaskLists(); that.start_date = year + '-' + months + '-01';
that.end_date = year + '-' + months + '-' + days;
let xAxisData = [];
for (let i = 0; i < 31; i++) {
let dindex = i + 1;
xAxisData.push(dindex + "日");
}
that.option1.xAxis.data = xAxisData;
that.option2.xAxis.data = xAxisData;
that.xAxisData = xAxisData;
let userInfo = this.$TOOL.data.get("USER_INFO");
this.deptId = userInfo.belong_dept;
this.deptName = userInfo.belong_dept_name;
that.getMgroups();
//
that.taskToDo();
//
that.mlogToSubmit();
//
that.materialRecive();
//
// that.materialTodo();
}, },
methods: { methods: {
// Class getMgroups(){
bindClass(rate) { let that = this;
let classInfo = { that.number_materialTodo = 0;
socketDom: true, that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then(res=>{
redColor: false, that.mgroupName = res[0].name;
greenColor: true, that.mgroups = res;
}; that.mlogComplete();
if (rate > 0) { if(res.length > 0){
classInfo.greenColor = true; res.forEach(item=>{
} else if (rate < 0) { that.mgroupsId += item.id + ',';
classInfo.redColor = true; //
that.materialTodo(item.id);
})
} }
return classInfo; })
}, },
// taskToDo() {
getEquipmentList(){
let that = this; let that = this;
that.$API.em.equipment.list.req({ page: 0, type: 10 }).then((res) => { let params = {state: 20,mgroup__belong_dept: that.deptId,page_size:1};
that.tableDataEq = res; that.$API.pm.mtask.list.req(params).then((res) => {
that.number_tasktodo =res.count;
}); });
}, },
// mlogToSubmit(){
getMaterialInList(){
let that = this; let that = this;
that.$API.wpm.wmaterial.list.req({ page: 0, material__type: '20',count__gte:1 }).then((res) => { let params = {submit_time__isnull: true,mgroup__belong_dept__name__in: that.deptName,page_size:1};
that.tableDataIn = res; that.$API.wpm.mlog.list.req(params).then((res) => {
that.number_mlogtoSubmit =res.count;
}); });
}, },
// materialRecive(){
getMaterialOutList(){
let that = this; let that = this;
that.$API.mtm.material.list.req({ page: 0, material__type: 20,count__gt:0 }).then((res) => { that.number_materialRecive = 0;
that.tableDataOut = res; let params = {submit_time__isnull: true,recive_dept: that.deptId,page_size:1};
that.$API.wpm.handover.list.req(params).then((res) => {
that.number_materialRecive=res.count;
}); });
}, },
// materialTodo(mgroupId){
getMaterialList() {
let that = this; let that = this;
that.$API.mtm.material.list.req({ page: 0, material__type: 10,count__gt:0 }).then((res) => { let params = {tag: 'todo',page_size:1,mgroup: mgroupId};
that.tableData = res; that.$API.wpm.wmaterial.list.req(params).then((res) => {
that.number_materialTodo+=res.count;
});
},
mlogComplete(){
let that = this;
let params = {
// query:{start_date:that.start_date,end_date:that.end_date,mgroup_name:that.mgroupName},
query:{start_date:'2025-05-01',end_date:'2025-05-31',mgroup_name:that.mgroupName},
};
let data0 = [],data1 = [];
this.$API.bi.dataset.exec.req("lineDay_m2", params).then((res) => {
that.chart0Visible=false;
if(res.data2.ds0&&res.data2.ds0.length>0){
res.data2.ds0.forEach(item=>{
let index = item.-1;
data0[index] = item.生产数;
data1[index] = item.合格数;
})
}
that.option1.series[0].data = data0;
that.option1.series[1].data = data1;
that.chart0Visible=true;
});
},
mgroupChange(){
let that = this;
that.mlogComplete();
},
//
mgroupStatistics(){
let that = this;
let params = {
query:{start_date:that.start_date,end_date:that.end_date,mgroup_name:that.mgroupName},
};
let data0 = [],data1 = [];
this.$API.bi.dataset.exec.req("lineDay_m2", params).then((res) => {
if(res.data2.ds0&&res.data2.ds0.length>0){
}
that.option2.series[0].data = data0;
that.option2.series[1].data = data1;
}); });
}, },
//
getMtaskLists(){},
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.retangleWrap { .retangleWrap {
width: 100%; width: 100%;
display: flex;
box-sizing: border-box;
padding: 25px 20px 0 20px; padding: 25px 20px 0 20px;
box-sizing: border-box; justify-content: space-between;
} }
.retangle { .retangleImg {
width: 100%; width: 24%;
border-radius: 15px; height: 188px;
box-sizing: border-box; color: #ffffff;
position: relative; border-radius: 10px;
background: #ffffff; background-size: cover;
background-image: url("/public/img/bx/gx_blue.png");
}
.retangleImg:nth-child(2){
background-image: url("/public/img/bx/gx_yellow.png");
}
.retangleImg:nth-child(3){
background-image: url("/public/img/bx/gx_green.png");
}
.retangleImg:nth-child(4){
background-image: url("/public/img/bx/gx_purple.png");
}
.card_title {
height: 60px;
line-height: 60px;
font-size: 20px;
font-weight: 500;
padding-left: 1em;
border-bottom: 2px solid rgba(255, 255, 255, .3);
}
.card_body{
display: flex;
}
.card_body_num{
width: 50%;
height: 120px;
line-height: 120px;
font-size: 40px;
text-align: center;
}
.card_body_line{
width: 2px;
height: 50px;
margin-top: 33px;
background: rgba(255, 255, 255, .3);
}
.card_body_img{
width: 50%;
font-size: 40px;
text-align: center;
}
.card_body_img_box{
width: 80px;
height: 80px;
margin-top: 20px;
border-radius: 10px;
line-height: 100px;
display: inline-block;
border: 1px solid rgba(255, 255, 255, .6);
background:rgba(255,255,255,.2);
}
.card_body_icon{
font-size: 60px;
} }
.retangleContainer { .retangleContainer {
width: 100%; width: 100%;
border-radius: 15px; border-radius: 10px;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
background: #ffffff; background: #ffffff;
@ -271,138 +465,11 @@ export default {
.retangleTable { .retangleTable {
padding: 20px 24px 24px 24px padding: 20px 24px 24px 24px
} }
.radios_group {
color: rgb(122, 121, 121);
size: 12px;
font-weight: 290;
line-height: 22px;
height: 23px;
}
.retangleImg {
height: 188px;
color: #ffffff;
padding-left: 43px;
background: linear-gradient(
180deg,
rgb(58, 149, 255),
rgb(27, 92, 255) 100%
);
}
.companyName {
padding-top: 28px;
font-size: 24px;
line-height: 28px;
padding-bottom: 23px;
}
.companyDesc {
padding-left: 4px;
font-size: 14px;
line-height: 20px;
}
.topCardImg {
height: 188px;
position: absolute;
right: 10px;
top: 0;
}
.countRetangle {
height: 180px;
padding-top: 20px;
box-sizing: border-box;
}
.countItem {
width: 20%;
padding-left: 24px;
display: inline-block;
box-sizing: border-box;
border-right: 1px solid #eeeeee;
}
.countItem:last-child {
border-right: 0;
}
.countname {
font-size: 14px;
line-height: 22px;
color: rgba(94, 94, 94);
}
.countnum {
font-size: 30px;
padding-bottom: 11px;
line-height: 38px;
}
.countrate {
line-height: 20px;
color: rgba(0, 0, 0, 0.45);
}
.redColor {
color: rgb(255, 73, 87);
}
.greenColor {
color: rgb(71, 201, 58);
}
.middleRetangle {
border-radius: 2px;
position: relative;
box-sizing: border-box;
}
.middleItem {
width: 25%;
padding-left: 34px;
display: inline-block;
box-sizing: border-box;
}
.middleItem:first-child {
border-right: 1px solid #eeeeee;
}
.bottomRetangle {
padding: 20px 0;
box-sizing: border-box;
background: #ffffff;
}
.warningHead {
display: flex;
justify-content: space-between;
padding: 0 24px;
}
.warningHeadText {
font-size: 16px;
font-weight: 400;
line-height: 24px;
}
.warningTableHead {
display: flex;
height: 35px;
line-height: 35px;
font-size: 18spx;
padding: 0 24px;
}
.warningTbleBody {
padding: 0 24px;
height: 276px;
overflow-y: scroll;
}
.warningFlex1 {
flex: 1;
}
.warningNumberStyle {
color: red;
font-weight: bold;
text-align: right;
}
</style> </style>

View File

@ -516,7 +516,7 @@ export default {
} }
that.hideAdd = that.isSubmit; that.hideAdd = that.isSubmit;
if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){ if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
that.getNewNumber(); // that.getNewNumber();
} }
that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.currentDate = this.$TOOL.dateFormat2(new Date()); that.currentDate = this.$TOOL.dateFormat2(new Date());