Browse Source

0505更新

master
ruanqi 4 years ago
parent
commit
ca3f5baaf8
  1. 2
      index.html
  2. 11
      src/api/board.js
  3. 3
      src/router/index.js
  4. 20
      src/views/modules/base/workCenter.vue
  5. 502
      src/views/modules/board/newScheduledBoard.vue
  6. 114
      src/views/modules/production/dailyPlan.vue
  7. 51
      src/views/modules/production/search_schedule.vue
  8. 90
      src/views/newTime.vue
  9. 12
      static/plugins/echarts/echarts.min.js

2
index.html

@ -13,7 +13,7 @@
<link rel="shortcut icon" type="image/x-icon" href="./static/img/favicon.ico">
<script src="./static/config/index.js"></script>
<script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
<script src="./static/plugins/echarts-5.3.1/echarts.min.js"></script>
<script src="./static/plugins/echarts/echarts.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.all.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>

11
src/api/board.js

@ -0,0 +1,11 @@
import {createAPI} from '@/utils/httpRequest.js'
export const getTime=data => createAPI(`board/getTime`, 'post', data);
export const kanKanYouMeiYouDiaoXian=data => createAPI(`board/kanKanYouMeiYouDiaoXian`, 'post', data);
export const getNewScheduledTableData=data => createAPI(`board/getNewScheduledTableData`, 'post', data);
export const getRefreshTime=data => createAPI(`board/getRefreshTime`, 'post', data);
export const getScheduledData=data => createAPI(`board/getScheduledData`, 'post', data);

3
src/router/index.js

@ -19,7 +19,8 @@ const _import = require('./import-' + process.env.NODE_ENV)
// 全局路由(无需嵌套上左右整体布局)
const globalRoutes = [
{ path: '/404', component: _import('common/404'), name: '404', meta: { title: '404未找到' } },
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } }
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } },
{ path: '/scheduleBoard', component: _import('modules/board/newScheduledBoard'), name: 'scheduleBoard', meta: { title: '生产情况看板' } },
]
// 主入口路由(需嵌套上左右整体布局)

20
src/views/modules/base/workCenter.vue

@ -450,7 +450,25 @@
sortLv: 0,
status: true,
fixed: false,
columnWidth: 120
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6029,
serialNumber: '6029TablePartDesc',
tableId: "6029Table",
tableName: "加工中心涉及产品表",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "产品名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 160
},
{
userId: this.$store.state.user.name,

502
src/views/modules/board/newScheduledBoard.vue

@ -0,0 +1,502 @@
<template>
<div class="container">
<div style="width:100%;height: 20%;text-align:center;">
<TimeC></TimeC>
<!-- <div style="font-size: 26px;float: right;color: #ffffff;height: 100%" v-html="clock"></div>-->
<div style="float: left;width: 25%;height: 100%;text-align:center;margin-left: 37% ">
<div style="height: 40%;width: 100%;text-align: center;margin-top: 3%;">
<label style="font-size: 30px;color: #ffffff">派工单完成状况</label>
</div>
<div style="height: 40%;width: 100%;text-align: center;margin-top: 0%;">
<label id="resourceIdName" style="font-size: 24px;color: #fff300"></label>
</div>
</div>
</div>
<div style="width:100%;height: 79%;">
<div style="float: left;height: 100%;width: 35%; ">
<div style="height: 12%;width: 100%;margin-top: 1%">
<div
style="width: 12%;height: 40%;float: left;margin-left: 18%;border-radius: 10px; background-color: #ec6566;"></div>
<div style="width: 25%;height: 50%;float: left;margin-left: 3%;">
<label style="font-size: 16px;color:#ffffff; ">未完工</label>
</div>
<div
style="width: 12%;height: 40%;float: left;margin-left: 1%;border-radius: 10px; background-color: #90ca75;"></div>
<div style="width: 25%;height: 50%;float: left;margin-left: 3%;">
<label style="font-size: 16px;color:#ffffff; ">已完工</label>
</div>
</div>
<div style="height: 88%;width: 100%;">
<div id="pie" style="float:left;margin-left: 0px; margin-top: 0%; width: 100%; height:80%;"></div>
</div>
</div>
<div style="float: left;height: 45%;width: 58%;margin-left:3% " class="board">
<table class="table table-bordered" style="width:100%;font-size:16px;color: #ffffff" id="table">
</table>
<el-table
:height="height"
:data="tableList"
style="width: 100%">
<el-table-column
prop="resourceDesc"
header-align="center"
align="left"
min-width="100"
label="机台名称">
</el-table-column>
<el-table-column
prop="qtyRequire"
header-align="center"
align="left"
min-width="100"
label="排产数量">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="left"
min-width="100"
label="已入库数量">
</el-table-column>
<el-table-column
prop="area"
header-align="center"
align="left"
min-width="100"
label="未入库数量">
</el-table-column>
</el-table>
</div>
<div style="float: left;height: 49%;width: 65%; ">
<div id="main" style="width: 100%;height: 100%;margin-top: 0px"></div>
</div>
</div>
</div>
</template>
<script>
import {getNewScheduledTableData,
getRefreshTime,
getScheduledData
} from '@/api/board.js'
import TimeC from "@/views/newTime.vue"
export default {
name: "newScheduledBoard",
data() {
return {
myChart: null,
number1:0,
number2:0,
option:null,
chartDom:null,
option2:null,
tableList:null,
pieList:null,
barList:null,
resourceId:'',
height:200,
// ip:'',
refreshTime:5,
}
},
components: {
TimeC
},
methods: {
searchData(){
this.getRefresh();
getScheduledData().then(({data}) => {
this.pieList=data.pieList;
this.barList=data.barList;
this.number2=0;
this.draw();
this.draw2()
this.getTableData();
window.setTimeout(() => {
this.getTableData();
}, 1000* Number(this.refreshTime));
window.setTimeout(() => {
this.getTableData();
}, 2000*Number(this.refreshTime));
window.setTimeout(() => {
this.getTableData();
}, 3000*Number(this.refreshTime));
})
},
draw(){
// if (data_temp[i].percentage >= 100) {
if (true) {
var color = '#90ca75';
} else {
var color = '#fff300';
}
if (this.myChart!=null) {
this.myChart.clear()
}
// $("#resourceIdName").html("");
this.option = ({
title: [{
text: '总完成情况' ,
// text: '' + data_temp[i + x].itemNo,
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
// y 'top' ¦ 'bottom' ¦ 'center' ¦ {number}ypx
y: 'bottom',
// itemGappx10
backgroundColor: '#EEE',
//
textStyle: {
fontSize: 20,
fontWeight: 'bolder',
color: '#fff300'
}
},
{
text: this.pieList[0].qtyPercent + '%',
// text: data_temp[i + x].percentage + '%',
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
// y 'top' ¦ 'bottom' ¦ 'center' ¦ {number}ypx
y: 'center',
// itemGappx10
backgroundColor: 'rgba(0,0,0,0)',
//
textStyle: {
fontSize: 20,
fontWeight: 'bolder',
color: color
},
}],
series: [
{
name: '完成数量统计',
type: 'pie', //
radius: ['45%', '75%'], // 55%
data: [ // name value
// {value: data_temp[i + x].approveQty, name: ''},
// {value: data_temp[i + x].unapproveQty, name: ''}
{value: this.pieList[0].qtyReported, name: ''},
{value: this.pieList[0].qtyUnReported, name: ''}
],
color: ['#90ca75', '#ec6566'],
labelLine: {
normal: {
show: false
}
},
label: {
normal: {
position: 'outer', // 'outer' ¦ 'inner'
// formatter: '{a} {b} : {c} ({d}%)' {b}
// {a}series.name {b}series.dataname
// {c}series.datavalue {d}%
formatter: '{b}'
}
}
}
]
});
this.myChart = echarts.init(document.getElementById('pie'));
this.myChart.setOption(this.option);
},
getTableData() {
getNewScheduledTableData(this.number2).then(({data}) => {
this.tableList=data.rows;
})
},
// data(){
// let arr=[]
// let indata={
// t1:''
// }
// arr.push(indata);
// arr.push(indata);
// arr.push(indata);
// let data2 = {"total": arr.length, "rows": arr};
// $('#table').bootstrapTable('load', data2);
// },
draw2(){
if (this.myChart2!=null) {
this.myChart2.clear()
}
this.myChart2 = echarts.init(document.getElementById('main'));
// document.getElementById('main').style.height="300px";
// if(this.option2!=null){
// document.getElementById('main').removeAttribute('_echarts_instance_')
// this.option2 = null
// }
this.option2 = {
color:["#90ca75", "#00a7ff","#ec6566"],
legend: {
textStyle: { //
color: '#fff',
// fontSize: 12
},
},
tooltip: {},
xAxis:[
{
type: 'category',
// data: xAxisData
data: [
{
value: this.getDate(this.barList[6].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[5].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[4].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[3].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[2].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[1].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: this.getDate(this.barList[0].strDate),
textStyle: {
color: '#EEE'
}
},
],
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
},
],
yAxis:[
{
type: 'value',
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
splitLine:{
show:false,
}
},
{
type: 'value',
// min: 0,
// max: 100,
axisLabel: {
formatter: '{value} %'
},
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
// splitLine:{
// show:false,
// }
}
],
series: [
{
'name': '白班产量',
'type': 'bar',
'emphasis': {
focus: 'series'
},
// data: seriesData1
'data': [this.barList[6].num1, this.barList[5].num1, this.barList[4].num1, this.barList[3].num1, this.barList[2].num1, this.barList[1].num1, this.barList[0].num1],
'label':{
show:true,
position:'top',
textStyle: {
color: '#fff300',
fontSize: 11
}
},
},
{
'name': '晚班产量',
'type': 'bar',
'emphasis': {
focus: 'series'
},
// data: seriesData2
'data': [this.barList[6].num2, this.barList[5].num2, this.barList[4].num2, this.barList[3].num2, this.barList[2].num2, this.barList[1].num2, this.barList[0].num2],
'label':{
show:true,
position:'top',
textStyle: {
color: '#fff300',
fontSize: 11
}
},
},
{
'name': '当日完成率',
'type': 'line',
yAxisIndex: 1,
'emphasis': {
focus: 'series'
},
// data: seriesData2
'data': [this.barList[6].num3, this.barList[5].num3, this.barList[4].num3, this.barList[3].num3, this.barList[2].num3, this.barList[1].num3, this.barList[0].num3],
// 'label':{
// show:true,
// position:'top',
// textStyle: {
// color: '#fff300',
// fontSize: 12
// }
// },
},
]
};
this.option2 && this.myChart2.setOption(this.option2);
},
getDate(value) {
var date = value.substring(5, 10);
return date;
},
timeDo(){
let that=this;
$.ajax({
url: "/board/getRefreshTime",
type: "post",
data: {"boardName": 'newScheduledBoard'},
dataType: "json",
success: (data) => {
if (data.rows != "" && data.rows != null) {
that.refreshTime = Number(data.rows);
if(that.refreshTime ==0){
that.refreshTime =5;
}
}else {
that.refreshTime =5;
}
console.log(4000*Number(that.refreshTime))
window.setInterval(() => {
this.searchData();
}, 4000*Number(that.refreshTime));
},
})
},
// getIp(){
// console.log(localStorage.getItem("tvIP"))
// let that=this;
// if (localStorage.getItem("tvIP")==null||localStorage.getItem("tvIP")==""||localStorage.getItem("tvIP")=="192.168.1.130") {
// $.ajax({
// url: "/board/getIpFirst",
// type: "post",
// data: {},
// dataType: "json",
// success: (data) => {
// localStorage.setItem("tvIP", data.row)
// that.ip=localStorage.getItem("tvIP")
// this.tableInit();
// this.timeDo();
// this.searchData();
// }
// }).fail(() => {
// localStorage.setItem("tvIP", "192.168.1.130")
// that.ip=localStorage.getItem("tvIP")
// this.tableInit();
// this.timeDo();
// this.searchData();
// })
// }else {
// that.ip=localStorage.getItem("tvIP")
// this.tableInit();
// this.timeDo();
// this.searchData();
// }
//
// },
getRefresh(){
let that=this;
getRefreshTime("scheduledBoard").then(({data}) => {
if (data.rows != "" && data.rows != null) {
that.refreshTime = Number(data.rows);
if(this.refreshTime ==0){
this.refreshTime =5;
}
}else {
that.refreshTime =5;
}
})
},
},
created(){
this.getRefresh();
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight *0.36;
})
this.getTableData();
this.timeDo();
this.searchData();
}
}
</script>
<<style scoped>
/*.container {*/
/* height: 109%;*/
/*}*/
.board .el-table .cell {
line-height: 20px;
font-size: 20px;
height: 20px;
padding: 0px;
color: yellow;
}
</style>

114
src/views/modules/production/dailyPlan.vue

@ -152,27 +152,6 @@
<a type="text" size="small" @click="scheduledModal(scope.row)">多日排产</a>
</template>
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
align="left"
min-width="100"
label="订单号">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="right"
min-width="60"
label="工序号">
</el-table-column>
<el-table-column
prop="itemDesc"
header-align="center"
align="left"
min-width="200"
label="工序名称">
</el-table-column>
<el-table-column
prop="needDate"
header-align="center"
@ -181,32 +160,32 @@
label="要求完成日期">
</el-table-column>
<el-table-column
prop="partNo"
prop="orderNo"
header-align="center"
align="left"
min-width="100"
label="产品编码">
label="订单号">
</el-table-column>
<el-table-column
prop="customerName"
prop="partNo"
header-align="center"
align="left"
min-width="100"
label="客户名称">
label="产品编码">
</el-table-column>
<el-table-column
prop="custPartNo"
prop="partDesc"
header-align="center"
align="left"
min-width="100"
label="客户产品料号">
label="产成品名称">
</el-table-column>
<el-table-column
prop="partDesc"
prop="customerName"
header-align="center"
align="left"
min-width="100"
label="产成品名称">
label="客户名称">
</el-table-column>
<el-table-column
prop="lotSize"
@ -236,6 +215,48 @@
min-width="80"
label="已报工数量">
</el-table-column>
<el-table-column
prop="enterDate"
header-align="center"
align="left"
min-width="130"
label="营销下单时间">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="left"
min-width="130"
label="生产订单备注">
</el-table-column>
<el-table-column
prop="techInfo"
header-align="center"
align="left"
min-width="130"
label="技术注意事项">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="right"
min-width="60"
label="工序号">
</el-table-column>
<el-table-column
prop="itemDesc"
header-align="center"
align="left"
min-width="200"
label="工序名称">
</el-table-column>
<el-table-column
prop="custPartNo"
header-align="center"
align="left"
min-width="100"
label="客户产品料号">
</el-table-column>
<el-table-column
prop="spec"
header-align="center"
@ -271,13 +292,6 @@
min-width="80"
label="可用机台">
</el-table-column>
<el-table-column
prop="enterDate"
header-align="center"
align="left"
min-width="100"
label="录入日期">
</el-table-column>
<el-table-column
prop="machRunFactor"
header-align="center"
@ -349,20 +363,20 @@
min-width="100"
label="需求日期">
</el-table-column>
<el-table-column
prop="itemNo"
header-align="center"
align="left"
min-width="60"
label="工序号">
</el-table-column>
<el-table-column
prop="itemDesc"
header-align="center"
align="left"
min-width="200"
label="工序名称">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="itemNo"-->
<!-- header-align="center"-->
<!-- align="left"-->
<!-- min-width="60"-->
<!-- label="工序号">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="itemDesc"-->
<!-- header-align="center"-->
<!-- align="left"-->
<!-- min-width="200"-->
<!-- label="工序名称">-->
<!-- </el-table-column>-->
<el-table-column
prop="partNo"
header-align="center"

51
src/views/modules/production/search_schedule.vue

@ -8,7 +8,8 @@
<el-form-item :label="'物料编码:'">
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'机台编号:'">
<el-form-item >
<span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台编号:</a></span>
<el-input v-model="searchData.resourceId" style="width: 110px"></el-input>
</el-form-item>
<el-form-item :label="'计划日期:'">
@ -117,6 +118,7 @@
<el-button type="primary" @click="printModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -131,8 +133,12 @@
printSerialNo,
getScheduleSerialNo,
} from '@/api/production/pallet.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'search_schedule',
components: {
Chooselist
},
data () {
return {
printModalFlag:false,
@ -401,14 +407,14 @@
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceSeqNo',
serialNumber: '5302ProduceScheduledSeqNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "seqNo",
headerAlign: "center",
align: "right",
columnLabel: "次序号",
columnWidth: 80,
columnLabel: "日计划单号",
columnWidth: 100,
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -419,13 +425,13 @@
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceRemark',
serialNumber: '5302ProduceScheduledSeqNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "remark",
columnProp: "scheduledSeqNo",
headerAlign: "center",
align: "left",
columnLabel: "备注",
align: "right",
columnLabel: "次序号",
columnWidth: 80,
columnHidden: false,
columnImage: false,
@ -434,18 +440,17 @@
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceScheduledSeqNo',
serialNumber: '5302ProduceRemark',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "scheduledSeqNo",
columnProp: "remark",
headerAlign: "center",
align: "right",
columnLabel: "日计划单号",
columnWidth: 100,
align: "left",
columnLabel: "备注",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -453,6 +458,7 @@
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
@ -602,6 +608,23 @@
})
},
methods: {
getBaseData(val){
if (this.tagNo === 88){
this.searchData.resourceId = val.ResourceID
}
},
//
getBaseList(val){
this.tagNo = val
this.$nextTick(() => {
let strVal = "";
if (val === 88){
strVal = this.searchData.resourceId
}
this.$refs.baseList.init(val,strVal)
})
},
//excel
createExportData () {

90
src/views/newTime.vue

@ -0,0 +1,90 @@
<template>
<div style="font-size: 26px;float: right;color: #ffffff;height: 100%" v-html="clock"></div>
</template>
<script>
import {getTime,
kanKanYouMeiYouDiaoXian,
} from '@/api/board.js'
export default {
name: 'time',
data() {
return {
clock: null,
status: 1,
stringdate:null,
currentDate:null,
timer:null
}
},
methods: {
getTime() {
getTime().then(({data}) => {
this.stringdate = data.rows
this.timer = window.setInterval(() => {
this.showRealTime()
}, 1000);
})
},
showRealTime() {
if (this.currentDate == null) {
this.currentDate = new Date(this.stringdate);
} else {
this.currentDate = new Date(this.currentDate.getTime() + 1000);
}
var c = this.currentDate;
var year = c.getFullYear();
var month = c.getMonth() + 1;
var date = c.getDate();
var days = new Array("日", "一", "二", "三", "四", "五", "六");
var day = c.getDay();
var hour = (c.getHours() < 10) ? ("0" + c.getHours()) : c.getHours();
var min = (c.getMinutes() < 10) ? ("0" + c.getMinutes()) : c.getMinutes();
var sec = (c.getSeconds() < 10) ? ("0" + c.getSeconds()) : c.getSeconds();
var now = year + "年" + month + "月" + date + "日<br>星期" + days[day] + "<br>" + hour + ":" + min + ":" + sec;
// if (hour>=10 && hour<12 && this.status==1){
if (localStorage.getItem("status")==null){
localStorage.setItem("status",'1')
}
this.status = localStorage.getItem("status")
if (parseInt(hour) ==23 && this.status=='1'){
kanKanYouMeiYouDiaoXian().then(({data}) => {
if(data.success){
localStorage.setItem("status",'2')
location.reload();
}else {
localStorage.setItem("status",'3')
}
})
}
// if ( hour>=12 && this.status==2){
if ( parseInt(hour) ==1 && this.status=='2'){
localStorage.setItem("status",'1')
}
if(this.status=='3' && parseInt(sec) ==59){
kanKanYouMeiYouDiaoXian().then(({data}) => {
if(data.success){
localStorage.setItem("status",'2')
location.reload();
}
})
}
this.clock = now;
},
},
mounted() {
this.getTime();
},
beforeDestroy() {
},
};
</script>
<style scoped>
</style>

12
static/plugins/echarts/echarts.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save