This commit is contained in:
liushuai
2019-12-23 12:34:00 +08:00
8 changed files with 665 additions and 62 deletions

View File

@@ -33,3 +33,51 @@ export function searchPerson() {
}
})
}
export function search4(num1, num2, num3) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_质检数据分析_查询数据',
param: '时间_check=' + num1 + '&开始时间=' + num2 + '&结束时间=' + num3
}
})
}
export function search5(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: ` SELECT CAST(SUM(CONVERT(float, 持续时间))/CONVERT(float, datediff(SECOND, '${num1}','${num2}')) as decimal(38, 2)) * 100 as 持续时间,工位号
FROM [MES_机加工MES_设备数据采集_工位信息_历史数据表]
where 日期 >= '${num1}' and 日期 <= '${num2}'
group by 工位号`
}
})
}
export function getOPname() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: ` SELECT 设备号 from MES_工作站_设备状态表`
}
})
}
export function search6(num, ceck, num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: ` SELECT CAST(SUM(CONVERT(float, 持续时间))/CONVERT(float, datediff(SECOND, '${num1}','${num2}')) as decimal(38, 2)) * 100 as 持续时间
,DATEPART(mm,日期) as 月份
FROM [MES_机加工MES_设备数据采集_工位信息_历史数据表]
where 持续时间 is not null and 工位号 = '${num}' and 日期 >= '${num1}' and 日期 <= '${num2}'
group by DATEPART(mm,日期)`
}
})
}

View File

@@ -13,15 +13,27 @@ export function getprocedure(processPlan, single) {
})
}
// 查询外协零件
export function searchTable(check, supplierNameValue, check1, MaterialsValue, pageSize, pageCurrent) {
export function searchTable(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, pageSize, pageCurrent) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协零件_查询数据',
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue,
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询外协零件
export function getExport(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, pageSize, pageCurrent) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协零件_查询数据',
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2
}
})
}

View File

@@ -30,7 +30,7 @@ export function searchTable1(...params) {
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后_加供应商',
name: '采购管理_采购部采购_查询物料_分配后_加供应商_新',
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}&物料名称_check=${params[7]}&物料名称=${params[8]}&物料规格_check=${params[9]}&物料规格=${params[10]}&物料型号_check=${params[11]}&物料型号=${params[12]}`,
Pagination: params[4] + '&' + params[5]
}
@@ -43,7 +43,7 @@ export function searchTable2(...params) {
method: 'post',
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_基本件_分配后_加供应商',
name: '采购管理_采购部采购_查询物料_基本件_分配后_加供应商_新',
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件名称_check=${params[6]}&零件名称=${params[7]}&零件规格_check=${params[8]}&零件规格=${params[9]}&零件图号_check=${params[10]}&零件图号=${params[11]}`,
Pagination: params[4] + '&' + params[5]
}

View File

@@ -17,8 +17,8 @@ export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoic
export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement
export const uploadPerson = `http://192.168.1.231:8411/submit/uploadPerson.ashx`
export const uploadOP = `http://192.168.1.231:8411/submit/uploadOP.ashx`
export const url = `http://192.168.1.231:8411/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
export const ExcelDownLoad = 'http://192.168.1.231:8411/submit/downloadFile.ashx' // 导出excel
export const url = `http://192.168.0.104:8079/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
export const ExcelDownLoad = 'http://192.168.0.104:8079/submit/downloadFile.ashx' // 导出excel
// 技术中心程序发布时要更改下面所有的IP到0段
export const ServerIP = `http://192.168.1.231:8411/webpage/file/`
export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231
@@ -26,7 +26,7 @@ export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFil
export const MESUploadFile = `http://192.168.1.231:8411/submit/MESUploadFile.ashx`
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
const service = axios.create({
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.0.104:8079/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间
})
export default service

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-card>
<div style="width: 49.8%; float: left;margin-left: 2px">
<div style="width: 24%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">不合格原因</div>
@@ -38,7 +38,7 @@
</el-table>
</el-card>
</div>
<div style="width: 49.8%; float: right; margin-right: 2px">
<div style="width: 24%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">不合格处理</div>
@@ -68,9 +68,7 @@
</el-table>
</el-card>
</div>
</el-card>
<el-card>
<div style="width: 32.8%; float: left;margin-left: 2px">
<div style="width: 24%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">质检尺寸</div>
@@ -107,37 +105,7 @@
</el-table>
</el-card>
</div>
<div style="width: 32.8%; float: right; margin-right: 6px;margin-left: 6px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">质检外观</div>
</el-row>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin-left:75%;margin-top: 15px" @click="handleAdd4()">增加</el-button>
<el-table :data="tableData3" border style="width: 100%;max-height: 450px;margin-top: 10px" height="350px" stripe highlight-current-row size="mini">
<el-table-column
type="index"
label="序号"
align="center"
width="50"/>
<el-table-column label="质检外观" align="center">
<template slot-scope="scope">
{{ scope.row.质检外观 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="150px">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
plain
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div style="width: 32.8%; float: right; margin-right: 2px">
<div style="width: 24%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">质检形位</div>
@@ -169,7 +137,37 @@
</div>
</el-card>
<el-card>
<div style="width: 35.8%; float: left;margin-left: 2px">
<div style="width: 24%; float: left;margin-right: 4px;">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">质检外观</div>
</el-row>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin-left:75%;margin-top: 15px" @click="handleAdd4()">增加</el-button>
<el-table :data="tableData3" border style="width: 100%;max-height: 450px;margin-top: 10px" height="350px" stripe highlight-current-row size="mini">
<el-table-column
type="index"
label="序号"
align="center"
width="50"/>
<el-table-column label="质检外观" align="center">
<template slot-scope="scope">
{{ scope.row.质检外观 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="150px">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
plain
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div style="width: 24%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">检测项</div>
@@ -199,7 +197,7 @@
</el-table>
</el-card>
</div>
<div style="width: 63.8%; float: left;margin-left: 2px">
<div style="width: 50%; float: left;margin-right: 4px">
<el-card>
<el-row>
<div style="margin-left: 43%;margin-top: 20px;font-weight: bold;font-size: 24px">检测项明细</div>

View File

@@ -26,7 +26,7 @@
<el-col :span="12">
<el-card v-loading="loading2" style="height: 450px">
<span>工人时间段统计</span>
<el-select v-model="nameValue" filterable size="small" placeholder="工位号" style="width: 110px">
<el-select v-model="nameValue" filterable size="small" placeholder="操作者" style="width: 110px">
<el-option
v-for="item in name"
:key="item.value"
@@ -38,12 +38,68 @@
<div v-if="chart2" id="myChart2" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card>
</el-col>
<el-col :span="12">
<el-card v-loading="loading2" style="height: 450px">
<div v-if="chart3" id="myChart3" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col>
<el-card v-loading="loading4" style="height: 550px">
<span>不合格数量统计</span>
<el-date-picker v-model="startTime4" :clearable="false" size="small" type="year" value-format="yyyy" format="yyyy" style="width: 150px" placeholder="选择年"/>
<el-button size="small" type="success" icon="el-icon-search" @click="search4()">查询</el-button>
<div v-if="chart4" id="myChart4" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col>
<el-card v-loading="loading5" style="height: 550px">
<span>设备利用率OEE</span>
<el-date-picker
v-model="startTime5"
value-format="yyyy-MM-dd"
size="small"
style="width: 160px;margin-top: 10px"
type="date"
placeholder="选择日期"/>
<span class="demonstration">~</span>
<el-date-picker
v-model="endTime5"
value-format="yyyy-MM-dd"
size="small"
style="width: 160px"
type="date"
placeholder="选择日期"/>
<el-button size="small" type="success" icon="el-icon-search" @click="search5()">查询</el-button>
<div v-if="chart5" id="myChart5" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col>
<el-card v-loading="loading6" style="height: 550px">
<span>设备利用率OEE</span>
<el-select v-model="opnameValue" filterable size="small" placeholder="工位号" style="width: 110px">
<el-option
v-for="item in opname"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-date-picker v-model="startTime6" :clearable="false" size="small" type="year" value-format="yyyy" format="yyyy" style="width: 150px" placeholder="选择年"/>
<el-button size="small" type="success" icon="el-icon-search" @click="search6()">查询</el-button>
<div v-if="chart6" id="myChart6" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { search1, search2, searchPerson } from '@/api/ManufacturingCenter/ManHourAnalysis'
import { search1, search2, searchPerson, search4, search5, getOPname, search6 } from '@/api/ManufacturingCenter/ManHourAnalysis'
import echarts from 'echarts'
export default {
@@ -59,15 +115,38 @@ export default {
startTime2: '',
chart2: true,
res2: [],
loading2: false // 2
loading2: false, // 2
chart3: true, // 3
startTime4: '',
chart4: true,
res4: [],
loading4: false, // 图表4
startTime5: '2019-12-01',
endTime5: '2019-12-21',
chart5: true,
res5: [],
loading5: false, // 图表5
opnameValue: '',
opname: [],
startTime6: '2019',
chart6: true,
res6: [],
loading6: false // 图表6
}
},
created() {
this.fetchData()
},
mounted() {
this.search1()
this.search2()
this.search4()
this.search5()
},
methods: {
fetchData() {
this.name = []
this.opname = []
searchPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.name.push({
@@ -78,6 +157,16 @@ export default {
}).then(() => {
this.nameValue = this.name[0].value
})
getOPname().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.opname.push({
label: response.data[i].设备号,
value: response.data[i].设备号
})
}
}).then(() => {
this.opnameValue = this.opname[0].value
})
},
// 时间段工时
search1() {
@@ -181,8 +270,11 @@ export default {
this.chart2 = true
}).then(() => {
var myChart2 = echarts.init(document.getElementById('myChart2'))
var myChart3 = echarts.init(document.getElementById('myChart3'))
myChart2.clear()
myChart3.clear()
this.drawLine2(this.res2)
this.drawLine3(this.res2)
})
},
drawLine2(data) {
@@ -255,6 +347,276 @@ export default {
}
]
})
},
drawLine3(data) {
var dataX = []
var lineData1 = []
var lineData2 = []
for (let i = 0; i < data.length; i++) {
dataX.push(data[i].月份)
lineData1.push(data[i].理论加工时间段)
lineData2.push(data[i].实际加工时间段)
}
var myChart3 = echarts.init(document.getElementById('myChart3'))
myChart3.clear()
myChart3.setOption({
legend: {
data: ['理论工时', '实际工时']
},
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
name: '月份',
axisLabel: {
interval: 0,
rotate: 0,
margin: 10
},
data: dataX
},
yAxis: {
type: 'value',
name: 'min',
min: 0,
scale: 'true'
},
series: [
{
name: '理论工时',
data: lineData1,
type: 'line'
},
{
name: '实际工时',
data: lineData2,
type: 'line'
}
]
})
},
search4() {
this.chart4 = false
this.loading4 = true
var check, startTime, endtime
if (this.startTime4) { check = 1 } else { check = 0 }
if (check === 1) {
startTime = this.startTime4 + '-01-01'
endtime = this.startTime4 + '-12-31'
}
search4(check, startTime, endtime).then(response => {
this.res4 = response.data
this.loading4 = false
this.chart4 = true
}).then(() => {
var myChart4 = echarts.init(document.getElementById('myChart4'))
myChart4.clear()
this.drawLine4(this.res4)
})
},
drawLine4(data) {
var dataX = []
var lineData1 = []
for (let i = 0; i < data.length; i++) {
dataX.push(data[i].月份)
lineData1.push(data[i].不合格总数量)
}
var myChart4 = echarts.init(document.getElementById('myChart4'))
myChart4.clear()
myChart4.setOption({
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
name: '月份',
axisLabel: {
interval: 0,
rotate: 0,
margin: 10
},
data: dataX
},
yAxis: {
type: 'value',
name: '不合格数量',
min: 0,
scale: 'true'
},
series: [
{
name: '总数量',
type: 'line',
color: '#67C23A',
label: {
normal: {
show: true,
position: 'inside'
}
},
data: lineData1
}
]
})
},
search5() {
this.chart5 = false
this.loading5 = true
search5(this.startTime5, this.endTime5).then(response => {
this.res5 = response.data
this.loading5 = false
this.chart5 = true
}).then(() => {
var myChart5 = echarts.init(document.getElementById('myChart5'))
myChart5.clear()
this.drawLine5(this.res5)
})
},
drawLine5(data) {
var dataX = []
var lineData1 = []
for (let i = 0; i < data.length; i++) {
dataX.push(data[i].工位号)
lineData1.push(data[i].持续时间)
}
var myChart5 = echarts.init(document.getElementById('myChart5'))
myChart5.clear()
myChart5.setOption({
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
name: '工位号',
axisLabel: {
interval: 0,
rotate: 90,
margin: 10
},
data: dataX
},
yAxis: {
type: 'value',
name: '利用率(%)',
min: 0,
scale: 'true'
},
series: [
{
name: '工位号',
type: 'bar',
color: '#67C23A',
label: {
normal: {
show: true,
position: 'inside'
}
},
data: lineData1
}
]
})
},
search6() {
this.chart6 = false
this.loading6 = true
var check, startTime, endtime
if (this.startTime6) { check = 1 } else { check = 0 }
if (check === 1) {
startTime = this.startTime6 + '-01-01'
endtime = this.startTime6 + '-12-31'
}
search6(this.opnameValue, check, startTime, endtime).then(response => {
this.res6 = response.data
this.loading6 = false
this.chart6 = true
}).then(() => {
var myChart6 = echarts.init(document.getElementById('myChart6'))
myChart6.clear()
this.drawLine6(this.res6)
})
},
drawLine6(data) {
var dataX = []
var lineData1 = []
for (let i = 0; i < data.length; i++) {
dataX.push(data[i].月份)
lineData1.push(data[i].持续时间)
}
var myChart6 = echarts.init(document.getElementById('myChart6'))
myChart6.clear()
myChart6.setOption({
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
name: '月份',
axisLabel: {
interval: 0,
rotate: 0,
margin: 10
},
data: dataX
},
yAxis: {
type: 'value',
name: '利用率(%)',
min: 0,
scale: 'true'
},
series: [
{
name: '工位号',
type: 'bar',
color: '#67C23A',
label: {
normal: {
show: true,
position: 'inside'
}
},
data: lineData1
}
]
})
}
}
}

View File

@@ -3,7 +3,9 @@
<el-card style="width: 65%">
<div style="margin-top: 7px; margin-bottom: 7px">
<span>外协厂家</span>
<el-input v-model="supplierNameValue" size="small" placeholder="外协厂家" style="width: 160px" clearable/>
<el-input v-model="supplierNameValue" size="small" placeholder="外协厂家或零件图号" style="width: 180px" clearable/>
<span>外协日期</span>
<el-date-picker v-model="timer" type="daterange" value-format="yyyy-MM-dd" size="small" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"/>
<span>外协状态</span>
<el-select v-model="MaterialsValue" placeholder="外协状态" filterable size="small" style="width: 100px" clearable>
<el-option
@@ -13,9 +15,10 @@
:value="item.value"/>
</el-select>
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrent = 1;pageSize = 50;getTableData()">查询</el-button>
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
</div>
</el-card>
<el-card style="width: 65%">
<el-card style="width: 70%">
<el-table
v-loading="loading"
:data="tableData"
@@ -79,6 +82,12 @@
width="200">
<template slot-scope="scope">{{ scope.row.表单号 }}</template>
</el-table-column>
<el-table-column
label="外协日期"
align="center"
width="100">
<template slot-scope="scope">{{ scope.row.任务下达日期.substr(0,10) }}</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -96,10 +105,12 @@
<script>
import { searchTable, getprocedure } from '@/api/Outsourcing/OutsourcingPartsQuery'
export default {
name: 'Index',
data() {
return {
timer: '',
supplierNameValue: '',
loading: false,
total: 0,
@@ -114,24 +125,105 @@ export default {
tableData: [],
procedure: [],
pageCurrent: 1,
pageSize: 50
pageSize: 50,
tableData1: []
}
},
created() {
this.getTableData()
},
methods: {
getTableData() {
this.tableData = []
this.loading = true
let check, check1
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
exportExcel() {
this.tableData1 = []
let check, check1, check2
this.supplierNameValue ? check = 1 : check = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check1 = 1
} else {
check1 = 0
}
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, this.pageSize, this.pageCurrent).then(response => {
if (this.timer === null) {
this.timer = ''
}
if (this.timer[1] === undefined || this.timer[0] === undefined || this.timer[1] === null || this.timer[0] === null) {
check2 = 0
} else {
check2 = 1
}
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, check2, this.timer[0], this.timer[1], 100000000, this.pageCurrent).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData1.push({
到货状态: response.data.rows[i].到货状态,
项目名称: response.data.rows[i].项目名称,
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
批次数量: response.data.rows[i].批次数量,
外协厂家名称: response.data.rows[i].外协厂家名称,
表单号: response.data.rows[i].表单号,
工艺计划流水号: response.data.rows[i].工艺计划流水号,
单件是否外协: response.data.rows[i].单件是否外协,
任务下达日期: response.data.rows[i].任务下达日期,
外协工序: ''
})
}
for (let i = 0; i < this.tableData1.length; i++) {
getprocedure(this.tableData1[i].工艺计划流水号, this.tableData1[i].单件是否外协).then(response => {
this.procedure[i] = ''
for (let j = 0; j < response.data.length; j++) {
this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称
}
this.tableData1[i].外协工序 = this.procedure[i]
})
}
}).then(() => {
setTimeout(this.exportExcel1, 500)
})
},
exportExcel1() {
console.log(this.tableData1, 232332)
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['外协状态', '项目名称', '零件图号', '零件名称', '数量', '外协工序', '外协厂家', '外协单号', '外协日期']
const filterVal = ['到货状态', '项目名称', '零件图号', '零件名称', '批次数量', '外协工序', '外协厂家名称', '表单号', '任务下达日期']
const list = this.tableData1
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '外协零件表',
autoWidth: true,
bookType: 'xlsx'
})
})
},
getTableData() {
// console.log(this.timer[0], 1)
// console.log(this.timer[1], 2)
this.tableData = []
this.loading = true
let check, check1, check2
this.supplierNameValue ? check = 1 : check = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check1 = 1
} else {
check1 = 0
}
// this.timer === null ? (check2 = 0, this.timer = '') : check2 = 1
if (this.timer === null) {
this.timer = ''
console.log(this.timer, 123)
}
if (this.timer[1] === undefined || this.timer[0] === undefined || this.timer[1] === null || this.timer[0] === null) {
check2 = 0
} else {
check2 = 1
}
console.log(check2, 4564688)
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, check2, this.timer[0], this.timer[1], this.pageSize, this.pageCurrent).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
到货状态: response.data.rows[i].到货状态,
@@ -143,6 +235,7 @@ export default {
表单号: response.data.rows[i].表单号,
工艺计划流水号: response.data.rows[i].工艺计划流水号,
单件是否外协: response.data.rows[i].单件是否外协,
任务下达日期: response.data.rows[i].任务下达日期,
外协工序: ''
})
}

View File

@@ -77,12 +77,23 @@
</el-table-column>
<el-table-column align="center" label="采购数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
{{ scope.row.采购数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
{{ scope.row.到货数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数量" width="100px">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="到货状态" width="100px">
<template slot-scope="scope">
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
<span v-else>未到货</span>
</template>
</el-table-column>
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="150px" show-overflow-tooltip>
@@ -165,12 +176,23 @@
</el-table-column>
<el-table-column align="center" label="采购数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
{{ scope.row.采购数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
{{ scope.row.到货数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数量" width="100px">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="到货状态" width="100px">
<template slot-scope="scope">
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
<span v-else>未到货</span>
</template>
</el-table-column>
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="150px" show-overflow-tooltip>
@@ -258,14 +280,27 @@
</el-table-column>
<el-table-column align="center" label="采购数量" width="100px">
<template slot-scope="scope">
{{ scope.row.采购数量 }}
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="到货数量" width="100px">
<template slot-scope="scope">
{{ scope.row.到货数量 }}
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数量" width="100px">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="到货状态" width="100px">
<template slot-scope="scope">
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
<span v-else>未到货</span>
</template>
</el-table-column>
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.供应商名称 || '—' }}
@@ -502,7 +537,34 @@ export default {
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
console.log(this.tableData0)
this.tableData0 = response.data.rows
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData0.push({
人员编号: response.data.rows[i].人员编号,
询价状态编号: response.data.rows[i].询价状态编号,
采购状态编号: response.data.rows[i].采购状态编号,
机床图号: response.data.rows[i].机床图号,
组号: response.data.rows[i].组号,
物料名称: response.data.rows[i].物料名称,
物料型号: response.data.rows[i].物料型号,
物料规格: response.data.rows[i].物料规格,
供货商: response.data.rows[i].供货商,
零件数量: response.data.rows[i].零件数量,
数量: response.data.rows[i].数量,
离线采购数量: response.data.rows[i].离线采购数量,
已到货数量: response.data.rows[i].已到货数量,
离线到货数量: response.data.rows[i].离线到货数量,
供应商名称: response.data.rows[i].供应商名称,
离线合同供应商名称: response.data.rows[i].离线合同供应商名称,
采购合同编号: response.data.rows[i].采购合同编号,
离线合同编号: response.data.rows[i].离线合同编号,
备注: response.data.rows[i].备注,
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
不合格数量: response.data.rows[i].不合格数量
})
}
}
this.total0 = response.data.total
})
},
@@ -514,8 +576,36 @@ export default {
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData1.push({
人员编号: response.data.rows[i].人员编号,
询价状态编号: response.data.rows[i].询价状态编号,
采购状态编号: response.data.rows[i].采购状态编号,
机床图号: response.data.rows[i].机床图号,
组号: response.data.rows[i].组号,
物料名称: response.data.rows[i].物料名称,
物料型号: response.data.rows[i].物料型号,
物料规格: response.data.rows[i].物料规格,
供货商: response.data.rows[i].供货商,
零件数量: response.data.rows[i].零件数量,
数量: response.data.rows[i].数量,
离线采购数量: response.data.rows[i].离线采购数量,
已到货数量: response.data.rows[i].已到货数量,
离线到货数量: response.data.rows[i].离线到货数量,
供应商名称: response.data.rows[i].供应商名称,
离线合同供应商名称: response.data.rows[i].离线合同供应商名称,
采购合同编号: response.data.rows[i].采购合同编号,
离线合同编号: response.data.rows[i].离线合同编号,
备注: response.data.rows[i].备注,
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
不合格数量: response.data.rows[i].不合格数量
})
}
}
console.log(response.data.total, this.total1, 898989)
})
},
searchTable2() { // 查询基本件