This commit is contained in:
chenjianan
2019-07-10 16:46:56 +08:00
7 changed files with 221 additions and 11 deletions

View File

@@ -34,6 +34,17 @@ export function getData2(num, num1, num2) {
}
})
}
export function getData3(num, num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_设备运行情况_查询数据_状态分布图',
param: '工位号=' + num + '&开始时间=' + num1 + '&结束时间=' + num2
}
})
}
// 初始化 人员和工位
export function getMachine() {
return request({

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1525414131085" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6999" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M958.4 241.7c-7.7-35.5-42.7-58.1-78.2-50.4s-58.1 42.7-50.4 78.2c2.1 9.5 6.1 18.1 11.5 25.4L685 537.5c-10-2.8-20.9-3.4-31.8-1C639.1 539.6 627 547 618 557L422.4 429.9c0.7-6.7 0.4-13.6-1.1-20.6-7.7-35.5-42.7-58.1-78.2-50.4s-58.1 42.7-50.4 78.2c2.1 9.5 6.1 18.1 11.6 25.4L147.9 705.1c-10.1-2.9-20.9-3.4-31.9-1-35.5 7.7-58.1 42.7-50.4 78.2s42.7 58.1 78.2 50.4 58.1-42.7 50.4-78.2c-1.9-8.9-5.6-17-10.5-24l157-243.5c9.6 2.4 19.8 2.8 30.1 0.5 12.8-2.8 23.8-9.1 32.5-17.6l198.1 128.5c-0.2 5.4 0.3 10.8 1.5 16.3 7.7 35.5 42.7 58.1 78.2 50.4s58.1-42.7 50.4-78.2c-1.9-8.9-5.6-17-10.5-24l156.9-243.5c9.6 2.5 19.9 2.8 30.2 0.6 35.4-7.7 58-42.8 50.3-78.3z" p-id="7000"></path></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1525412964267" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1444" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M991.252256 445.156522h-72.359435c-7.231944-50.647604-28.935774-101.303209-57.879548-144.710869l50.647605-50.647605c14.471887-14.471887 14.471887-36.175717 0-50.647604l-65.127492-65.119491c-14.471887-14.471887-36.167717-14.471887-50.647604 0l-50.647604 50.647604c-43.407661-28.943774-94.055265-50.647604-144.70287-65.119491V47.207631c0-21.71183-14.471887-36.175717-36.175717-36.175717H470.304326c-21.70383 0-36.167717 14.471887-36.167718 28.943774v72.359434c-50.647604 7.239943-101.303209 28.943774-144.710869 57.887548l-50.647604-50.647604c-14.471887-14.479887-36.175717-14.479887-50.647605 0l-65.119491 65.119491c-14.471887 14.471887-14.471887 36.175717 0 50.647604l50.647604 50.647605c-28.943774 43.407661-50.647604 94.055265-65.119491 144.702869H36.179717C14.475887 430.684635 0.004 445.156522 0.004 459.628409v94.055265c0 21.71183 14.471887 36.175717 28.943774 36.175718h72.359435c7.239943 50.647604 28.943774 101.295209 57.887547 144.710869l-50.647604 50.647604c-14.479887 14.471887-14.479887 36.175717 0 50.647605l65.119491 65.119491c14.471887 14.471887 36.175717 14.471887 50.647605 0l50.647604-50.647604c28.943774 21.71183 57.879548 36.175717 86.823322 43.407661V770.745979c-21.71183-14.471887-43.415661-28.943774-65.119492-50.647605-115.783095-115.767096-108.543152-303.885626 7.223944-412.412778 115.767096-115.775096 296.653682-108.535152 412.420778 7.231944s108.535152 303.885626-7.239944 412.420778c-21.70383 21.71183-43.407661 36.175717-65.119491 50.647604v123.007039c28.943774-7.239943 57.887548-21.71183 86.823322-43.415661l50.647604 50.647604c14.471887 14.479887 36.175717 14.479887 50.647604 0l65.119492-65.119491c14.479887-14.471887 14.479887-36.175717 0-50.647604l-50.647605-50.647604c28.943774-43.407661 50.647604-94.055265 65.127492-144.70287h72.351434c21.71183 0 36.175717-14.471887 36.175718-28.943774V474.100296c7.239943-14.471887-7.231944-28.943774-28.943774-28.943774z m-267.701909 72.351435c0-79.591378-43.415661-144.70287-108.535152-173.654643-7.239943 0-7.239943 0-7.239943 7.239943v115.767096a64.847493 64.847493 0 0 1-65.119491 65.119491h-50.647605a64.847493 64.847493 0 0 1-65.119491-65.119491V351.093257c0-7.239943-7.239943-7.239943-7.239944-7.239943C361.777174 380.037031 325.601456 445.156522 325.601456 510.276013c0 57.879548 28.943774 115.767096 65.119491 151.942813 21.71183 21.71183 36.175717 50.647604 36.175718 86.823322v245.998078c0 14.471887 14.471887 28.943774 28.943774 28.943774h28.943774V734.578261c0-14.479887 7.231944-21.71183 21.70383-28.943774 14.471887 0 28.943774 7.239943 28.943774 21.711831v289.413739h28.943774c14.471887 0 28.943774-14.471887 28.943774-28.943774V756.274092c0-36.175717 14.471887-65.119491 43.415661-86.823322 57.863548-28.935774 86.815322-86.815322 86.815321-151.942813z m0 0" fill="" p-id="1445"></path></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -576,6 +576,7 @@ export default {
if (this.qualityInspectionValue !== '' && this.qualityInspectionValue !== null) { this.check7 = 1 } else { this.check7 = 0 }
if (this.personNum !== '' && this.personNum !== null) { this.check8 = 1 } else { this.check8 = 0 }
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.check5, this.startTime, this.check6, this.endTime, this.check7, this.qualityInspectionValue, this.check8, this.personNum, this.pageCurrent, this.pageSize).then(response => {
console.log(response.data.rows, 111)
this.tableData1 = response.data.rows
this.loading = false
this.total = response.data.total

View File

@@ -129,7 +129,8 @@
</div>
</template>
<script>import { getData, getData1, getData2, getMachine } from '@/api/ManufacturingCenter/EquipmentConditionAnalysis'
<script>import { getData, getData1, getData2, getData3, getMachine } from '@/api/ManufacturingCenter/EquipmentConditionAnalysis'
export default {
data() {
return {
@@ -137,6 +138,7 @@ export default {
MachineValue: '',
MachineValue1: '',
Machine: [],
yAxisValue: [],
Time: '',
date1: '',
date2: '',
@@ -180,6 +182,7 @@ export default {
this.time2 = response.data.rows[0].等待持续时间
this.time3 = response.data.rows[0].停机持续时间
}).then(() => {
this.sendMessage()
this.drawLine1()
})
getData1(this.Time).then(response => {
@@ -193,10 +196,40 @@ export default {
searchData1() {
getData2(this.MachineValue1, this.date1, this.date2).then(response => {
this.table = response.data
console.log(this.table)
console.log(this.table, 222)
}).then(() => {
this.drawLine()
})
if (this.date1 === null || this.date2 === null) {
this.$message.warning('请选择开始时间或结束时间')
} else {
const endYear = parseInt(this.date2.split('-')[0])
const startYear = parseInt(this.date1.split('-')[0])
const endMonth = parseInt(this.date2.split('-')[1])
const startMonth = parseInt(this.date1.split('-')[1])
const endDate = parseInt(this.date2.split('-')[2])
const startDate = parseInt(this.date1.split('-')[2])
let diff
if ((endMonth - startMonth) === 0) {
diff = endDate - startDate
}
if ((endMonth - startMonth) === 1) {
diff = endDate - startDate + 10
}
if ((endMonth - startMonth) > 1 || (endYear - startYear) !== 0) {
diff = 999
}
if (diff > 6) {
this.$message.warning('选择时间区间不得超过6天')
} else {
getData3(this.MachineValue1, this.date1, this.date2).then(response => {
this.table1 = response.data
console.log(this.table1)
}).then(() => {
this.drawLine3()
})
}
}
},
// 绘制图形
drawLine() {
@@ -204,6 +237,7 @@ export default {
const xData = []
const lineData = []
for (let i = 0; i < this.table.length; i++) {
console.log(this.table[i].日期, 1111)
xData.push(this.table[i].日期.split(' ')[0])
lineData.push(this.table[i].利用率.toFixed(2))
}
@@ -332,6 +366,137 @@ export default {
]
})
},
drawLine3() {
const _this = this
_this.data = []
_this.index = 0
_this.yAxisValue = []
for (let i = 0; i < _this.table1.length; i++) { // 取开始结束时间HH-mm取状态日期yyyy-MM-dd持续时间
_this.fixDate = _this.table1[0].日期.substr(0, 10)
_this.table1[i].开始时间 = _this.fixDate + ' ' + _this.table1[i].开始时间.substr(11, 5)
_this.table1[i].结束时间 = _this.fixDate + ' ' + _this.table1[i].结束时间.substr(11, 5)
_this.table1[i].日期 = _this.table1[i].日期.substr(0, 10)
}
if (_this.table1.length === 1) {
_this.data.push({
itemStyle: { normal: { color: _this.table1[0].颜色 }}, // 条形颜色
name: _this.table1[0].状态,
value: [0, _this.table1[0].开始时间, _this.table1[0].结束时间]
})
} else {
for (let i = 0; i < _this.table1.length; i++) {
if (i < _this.table1.length) {
if (i === 0) {
_this.index = 0
_this.yAxisValue.push(_this.table1[i].日期)
} else if (_this.table1[i].日期 !== _this.table1[i - 1].日期) {
_this.index++ // y轴索引
_this.yAxisValue.push(_this.table1[i].日期)
}
}
_this.data.push({
itemStyle: { normal: { color: _this.table1[i].颜色 }}, // 条形颜色
name: _this.table1[i].状态,
value: [parseInt(_this.index), _this.table1[i].开始时间, _this.table1[i].结束时间]
})
}
}
const myChart = _this.$echarts.init(document.getElementById('myChart3'))
myChart.clear()
myChart.setOption({
title: {
left: 'center',
text: '设备状态分布图'
},
color: _this.colors,
tooltip: { // 提示框
formatter(params) {
return params.value[1].substr(11, 5) + '~' + params.value[2].substr(11, 5)
} // 数据的值
},
legend: {
orient: 'vertical',
x: 'left',
data: ['运行', '停机', '等待']
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, { // X轴可调
xAxisIndex: 0,
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}],
grid: { // 绘图网格
left: '3%',
right: '3%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'time',
interval: 1000 * 60 * 60 * 2,
axisLabel: {
formatter(value) {
var date = new Date(value)
return getzf(date.getHours()) + ':' + getzf(date.getMinutes())
function getzf(num) {
if (parseInt(num) < 10) {
num = '0' + num
}
return num
}
}
}
},
yAxis: {
data: _this.yAxisValue
},
series: [
// 用空bar来显示几个图例
{
type: 'custom', renderItem(params, api) { // 开发者自定义的图形元素渲染逻辑,是通过书写 renderItem 函数实现的
var categoryIndex = api.value(0) // 这里使用 api.value(0) 取出当前 dataItem 中第一个维度的数值。
var start = api.coord([api.value(1), categoryIndex]) // 这里使用 api.coord(...) 将数值在当前坐标系中转换成为屏幕上的点的像素值。
var end = api.coord([api.value(2), categoryIndex])
var height = 24 // 柱体宽度
return {
type: 'rect', // 表示这个图形元素是矩形。还可以是 'circle', 'sector', 'polygon' 等等。
shape: _this.$echarts.graphic.clipRectByRect({ // 矩形的位置和大小。
x: start[0],
y: start[1] - height / 1,
width: end[0] - start[0],
height: height * 2
}, { // 当前坐标系的包围盒。
x: params.coordSys.x,
y: params.coordSys.y,
width: params.coordSys.width,
height: params.coordSys.height
}),
style: api.style()
}
},
encode: {
x: [1, 2], // data 中『维度1』和『维度2』对应到 X 轴
y: 0 // data 中『维度0』对应到 Y 轴
},
data: _this.data
}
]
})
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val

View File

@@ -39,34 +39,49 @@
</div>
<el-table v-loading="" :data="tableData2" :summary-method="getSummaries" show-summary border style="width: 100%;min-height: 400px" height="400px" size="mini">
<el-table-column label="序号" align="center" width="80" type="index"/>
<el-table-column label="零件名称" align="center" min-width="120">
<el-table-column label="零件名称" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="120">
<el-table-column label="零件图号" align="center">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" width="100">
<el-table-column label="零件数量" align="center">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="检验数量" align="center" width="100">
<el-table-column label="质检人员" align="center">
<template slot-scope="scope">
{{ scope.row.检验数量 || 0 }}
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center" width="100">
<el-table-column label="检验数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center">
<template slot-scope="scope">
{{ scope.row.不合格数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="检验时间" align="center" min-width="100">
<el-table-column label="不合格原因" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.检验时间 || '—' }}
{{ scope.row.不合格原因文本 }}
</template>
</el-table-column>
<el-table-column label="处理结果" align="center">
<template slot-scope="scope">
{{ scope.row.不合格处理文本 }}
</template>
</el-table-column>
<el-table-column label="检验时间" align="center">
<template slot-scope="scope">
{{ scope.row.操作时间 || '—' }}
</template>
</el-table-column>
<el-table-column label="形位" align="center" width="100">
@@ -195,7 +210,7 @@ export default {
sums[index] = 'N/A'
}
} else if (index === 4) {
const values = data.map(item => Number(item['检验数量']) || 0)
const values = data.map(item => Number(item['数量']) || 0)
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)

View File

@@ -28,6 +28,12 @@
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="sendMessage()">通知</el-button>
</el-card>
<el-card>
@@ -142,6 +148,7 @@
<script>
import { initContract, initBuyer, searchTable1, searchTable2, submitApproval } from '@/api/PurchasingCenter/PurchaseContractReview'
import axios from 'axios'
export default {
data() {
@@ -218,6 +225,15 @@ export default {
}
})
},
// 发送短信
sendMessage() {
axios.get(`http://192.168.1.231:8411/submit/MESSendMessage.ashx?Uid=liuqinghua&Key=liuqinghua123456&smsMob=18340870479,15140619457&smsText=合同审批: 有合同需要您审批【meswork】`).then(data => {
if (data.data === 1) {
this.$message.success('通知成功')
}
console.log(data)
})
},
searchTable1() {
this.tableData2 = []
this.textarea = ``