<template>
|
<div>
|
<x-card :bordered="false" v-if="hasPerm('WorkPieceProcess:page')">
|
<div slot="content" class="table-page-search-wrapper">
|
<a-form :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-row :gutter="gutter">
|
<a-col :md="colMd" :sm="colSm">
|
<a-form-item label="工件号">
|
<a-input v-model="queryParam.workPieceID" allow-clear placeholder="请输入工件号" />
|
</a-form-item>
|
</a-col>
|
|
<a-col :md="colMd" :sm="colSm">
|
<a-form-item label="设备名称">
|
<a-select
|
show-search
|
option-filter-prop="children"
|
:filter-option="filterOption"
|
:allowClear="true"
|
style="width: 100%"
|
v-model="queryParam.EquipmentID"
|
placeholder="请选择设备名称"
|
>
|
<a-select-option v-for="item in equitypeData" :key="item.id" :value="item.equipmentId">{{
|
item.equipmentName
|
}}</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
<!-- <a-col :md="colMd" :sm="colSm">
|
<a-form-item label="日期范围">
|
<a-range-picker
|
:placeholder="['开始日期', '结束日期']"
|
format="YYYY-MM"
|
:mode="mode"
|
:value="value"
|
@panelChange="handlePanelChange"></a-range-picker>
|
</a-form-item>
|
</a-col> -->
|
<template v-if="advanced">
|
<a-col :md="colMd" :sm="colSm">
|
<a-form-item label="刀沿数">
|
<a-input-number
|
v-model="queryParam.knifeEdgeNumber"
|
style="width: 100%"
|
allow-clear
|
placeholder="请输入刀沿数"
|
/>
|
</a-form-item>
|
</a-col>
|
</template>
|
<a-col :md="colMd" :sm="colSm">
|
<span class="table-page-search-submitButtons">
|
<a-button type="primary" @click="getData">查询</a-button>
|
<a-button style="margin-left: 8px" @click="resetHandle">重置</a-button>
|
<a @click="toggleAdvanced" style="margin-left: 8px" v-if="flag">
|
{{ advanced ? '收起' : '展开' }}
|
<a-icon :type="advanced ? 'up' : 'down'" />
|
</a>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
</x-card>
|
<!-- 图表部分1 -->
|
<a-card :bordered="false" :bodyStyle="tstyle">
|
<Echarts title="刀具使用分析图" :data="knifeToolLoad"></Echarts>
|
</a-card>
|
<!-- 图标部分2 -->
|
<a-card>
|
<a-table
|
ref="table"
|
:columns="columns"
|
:dataSource="knifeToolList"
|
:pagination="false"
|
:rowKey="(record) => record.id"
|
>
|
</a-table>
|
</a-card>
|
</div>
|
</template>
|
<script>
|
import Echarts from './modules/Echarts.vue'
|
import { XCard } from '@/components'
|
import moment from 'moment'
|
// 获取设备下拉框数据
|
import { getEquipmentName } from '@/api/modular/main/EquipmentBaseInfoManage'
|
import { GetKnifeToolAnalysisInfo } from '@/api/modular/main/YieldAnalysisManage'
|
export default {
|
name: 'KnifeToolUsageAnalysis',
|
components: { Echarts, XCard },
|
data() {
|
return {
|
gutter: 36,
|
colMd: 6,
|
colSm: 18,
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 8 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 15 }
|
},
|
advanced: false, // 高级搜索 展开/关闭
|
flag: false, // 显示隐藏展开按钮
|
// 查询数据
|
queryParam: {},
|
// 设备下拉框数据
|
equitypeData: [],
|
knifeToolLoad: [],
|
knifeToolList: [],
|
columns: [
|
{
|
title: '序号',
|
dataIndex: 'index',
|
key: 'index',
|
align: 'center',
|
customRender: (text, record, index) => `${index + 1}`
|
},
|
{
|
title: '设备编号',
|
align: 'center',
|
sorter: true,
|
dataIndex: 'equipmentID',
|
scopedSlots: { customRender: 'equipmentIDSlots' }
|
},
|
{
|
title: '设备名称',
|
align: 'center',
|
sorter: true,
|
dataIndex: 'equipmentName'
|
},
|
{
|
title: '所属工序',
|
align: 'center',
|
sorter: true,
|
dataIndex: 'workingProcedure'
|
},
|
{
|
title: '刀具Id',
|
ellipsis: true,
|
dataIndex: 'knifeToolID'
|
},
|
{
|
title: '工位',
|
ellipsis: true,
|
dataIndex: 'station'
|
},
|
{
|
title: '上刀时间',
|
ellipsis: true,
|
dataIndex: 'changeStartTime'
|
},
|
{
|
title: '换下时间',
|
ellipsis: true,
|
dataIndex: 'changeEndTime'
|
|
},
|
{
|
title: '计划寿命(件)',
|
ellipsis: true,
|
dataIndex: 'knifeToolLife'
|
},
|
{
|
title: '当前寿命(件)',
|
ellipsis: true,
|
dataIndex: 'currentLife'
|
}
|
],
|
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }
|
}
|
},
|
mounted() {
|
// this.loadData(this.queryParam)
|
this.getEquipmentName()
|
// this.getData()
|
},
|
methods: {
|
/**
|
* 查询参数组装
|
*/
|
switchingDate() {
|
const obj = JSON.parse(JSON.stringify(this.queryParam))
|
return obj
|
},
|
toggleAdvanced() {
|
this.advanced = !this.advanced
|
},
|
// 发起请求获取数据
|
async getData() {
|
try {
|
const { data } = await GetKnifeToolAnalysisInfo(this.queryParam)
|
this.knifeToolLoad = data.knifeToolLoad || []
|
this.knifeToolList = data.knifeToolList || []
|
} catch (error) {
|
console.log(error)
|
}
|
},
|
// 获取设备名称
|
getEquipmentName() {
|
getEquipmentName({ type: 'knifeTool' }).then((res) => {
|
this.equitypeData = res.data
|
})
|
},
|
// 重置按钮
|
resetHandle() {
|
this.queryParam = {}
|
this.getData()
|
},
|
// 设备查询框筛选
|
filterOption(input, option) {
|
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
}
|
}
|
}
|
</script>
|
<style lang="less">
|
.table-operator {
|
margin-bottom: 18px;
|
}
|
|
button {
|
margin-right: 8px;
|
}
|
|
.table {
|
padding: 10px 20px;
|
height: 140px;
|
font-weight: 700;
|
font-size: 16px;
|
color: #000;
|
|
.time,
|
.num {
|
// height: 38px;
|
// line-height: 35px;
|
display: flex;
|
justify-content: space-around;
|
background-color: #f8f8f9;
|
margin-bottom: 2px;
|
|
div {
|
width: 60px;
|
}
|
}
|
|
.num {
|
div {
|
height: 38px;
|
line-height: 35px;
|
}
|
}
|
}
|
</style>
|