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,116 +1,82 @@
<template>
<div class="widgets-home" ref="main">
<div class="widgets-content">
<div class="retangleWrap retangleWrapTop">
<div class="retangle retangleImg">
<div class="companyName">玻纤生产管理</div>
<div class="companyDesc">
公司秉承善用资源服务建设的核心理念践行材料创造美
<div>
<div class="retangleWrap">
<div class="retangleImg">
<div class="card_title">未完成生产计划</div>
<div class="card_body">
<div class="card_body_num">{{ number_tasktodo }}</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 class="companyDesc">
好世界的企业使命坚持创新绩效和谐责任的核心价
</div>
<div class="companyDesc">
值观努力成长为具有创新精神和全球视野的光芯材料领先企业
</div>
<img class="topCardImg" src="img/topCard.png" />
</div>
</div>
<el-row>
<el-col :span="8">
<div class="retangleWrap">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">设备列表</div>
</div>
<div class="retangleTable">
<el-table
: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 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>
</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>
<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>
</el-col>
<el-col :span="8">
<div class="retangleWrap">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">半成品库存统计</div>
</div>
<div class="retangleTable">
<el-table
: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 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>
</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>
<div class="retangleWrap">
<div class="retangleContainer">
<div class="retangleTitle">
<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 class="retangleTable">
<scEcharts height="285px" v-if="chart0Visible" :width="'100%'" :option="option1"></scEcharts>
</div>
</div>
</div>
<div class="retangleWrap">
<div class="retangleContainer">
<div class="retangleTitle">
<div class="title">本月工段生产统计</div>
</div>
<div class="retangleTable">
<scEcharts height="285px" :width="'100%'" :option="option2"></scEcharts>
</div>
</div>
</div>
</div>
</template>
@ -119,12 +85,13 @@ import * as echarts from "echarts";
export default {
data() {
return {
tableData: [],
tableDataIn: [],
tableDataEq: [],
tableDataOut: [],
materialType: 20,
option: {
number_tasktodo: 0,
number_mlogtoSubmit: 0,
number_materialRecive: 0,
number_materialTodo: 0,
xAxisData: [],
option1: {
color: ['rgb(128, 255, 165)', 'rgb(0, 221, 255)'],
tooltip: {
trigger: "axis",
axisPointer: {
@ -135,18 +102,24 @@ export default {
},
},
grid: {
top: "5%",
top: "10%",
left: "1%",
right: "1%",
bottom: "5%",
containLabel: true,
},
legend: {
top: 0,
right: 5,
data: ["生产数","合格数"],
},
xAxis: {
type: "category",
axisLabel: {
// show: false, // X
},
data: [],
boundaryGap: false,
data: [1,2,3,4,5,6,7,8,9,10],
},
yAxis: {
type: "value",
@ -154,103 +127,324 @@ export default {
show: false, // X
},
},
series: {
data: [],
type: "bar",
barMaxWidth: 30,
emphasis: {
focus: "series",
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: [],
},
label: {
show: true,
position: "top",
color: "#000",
},
itemStyle: {
borderRadius: [5, 5, 0, 0],
normal: { color: "rgb(20, 141, 255)" },
{
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: [],
},
yAxis: {
type: "value",
axisLabel: {
show: false, // X
},
},
series: [
{
name: "计划数",
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: {
focus: "series",
},
data: [],
},
{
name: "生产数",
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() {
this.$emit("on-mounted");
//
this.getEquipmentList();
//
this.getMaterialInList();
//
this.getMaterialOutList();
//
this.getMaterialList();
//
// this.getMtaskLists();
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth() + 1;
let day = myDate.getDate();
that.year_s = year;
that.month_s = month;
that.day_s = day;
let days = day>10?day:'0'+day;
let months = month>10?month:'0'+month;
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: {
// Class
bindClass(rate) {
let classInfo = {
socketDom: true,
redColor: false,
greenColor: true,
getMgroups(){
let that = this;
that.number_materialTodo = 0;
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then(res=>{
that.mgroupName = res[0].name;
that.mgroups = res;
that.mlogComplete();
if(res.length > 0){
res.forEach(item=>{
that.mgroupsId += item.id + ',';
//
that.materialTodo(item.id);
})
}
})
},
taskToDo() {
let that = this;
let params = {state: 20,mgroup__belong_dept: that.deptId,page_size:1};
that.$API.pm.mtask.list.req(params).then((res) => {
that.number_tasktodo =res.count;
});
},
mlogToSubmit(){
let that = this;
let params = {submit_time__isnull: true,mgroup__belong_dept__name__in: that.deptName,page_size:1};
that.$API.wpm.mlog.list.req(params).then((res) => {
that.number_mlogtoSubmit =res.count;
});
},
materialRecive(){
let that = this;
that.number_materialRecive = 0;
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){
let that = this;
let params = {tag: 'todo',page_size:1,mgroup: mgroupId};
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},
};
if (rate > 0) {
classInfo.greenColor = true;
} else if (rate < 0) {
classInfo.redColor = true;
}
return classInfo;
},
//
getEquipmentList(){
let that = this;
that.$API.em.equipment.list.req({ page: 0, type: 10 }).then((res) => {
that.tableDataEq = res;
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;
});
},
//
getMaterialInList(){
mgroupChange(){
let that = this;
that.$API.wpm.wmaterial.list.req({ page: 0, material__type: '20',count__gte:1 }).then((res) => {
that.tableDataIn = res;
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;
});
},
//
getMaterialOutList(){
let that = this;
that.$API.mtm.material.list.req({ page: 0, material__type: 20,count__gt:0 }).then((res) => {
that.tableDataOut = res;
});
},
//
getMaterialList() {
let that = this;
that.$API.mtm.material.list.req({ page: 0, material__type: 10,count__gt:0 }).then((res) => {
that.tableData = res;
});
},
//
getMtaskLists(){},
},
};
</script>
<style scoped lang="scss">
.retangleWrap {
width: 100%;
display: flex;
box-sizing: border-box;
padding: 25px 20px 0 20px;
box-sizing: border-box;
justify-content: space-between;
}
.retangle {
width: 100%;
border-radius: 15px;
box-sizing: border-box;
position: relative;
background: #ffffff;
.retangleImg {
width: 24%;
height: 188px;
color: #ffffff;
border-radius: 10px;
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 {
width: 100%;
border-radius: 15px;
border-radius: 10px;
box-sizing: border-box;
position: relative;
background: #ffffff;
@ -271,138 +465,11 @@ export default {
.retangleTable {
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>

View File

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