追溯制品加工过程

This commit is contained in:
bryan sun
2019-10-28 13:51:54 +08:00
parent 4e538ba9f3
commit 4360f4ab54
3 changed files with 409 additions and 1 deletions

View File

@@ -0,0 +1,62 @@
import request from '@/utils/request'
// 机床名称
export function getMachines() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_机床名称_根据机床查询',
param: '是否传递=2=int&考核状态=6=int&工艺任务分配状态=2=int&定额任务分配状态=2=int&单件是否外协=1=int'
}
})
}
// 获取组号
export function getGroups(stepNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_组件名称_查询数据_查询所有组',
param: '机床流水号=' + stepNumber + '=int'
}
})
}
export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_横向赋值新建存储过程_新',
param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 获取组号
export function gettabledata1(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_加工进度查询_查询_New',
param: '工艺计划流水号=' + num + '=int'
}
})
}
// 编辑完成时间
export function editdata(processSerialNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_加工进度查询_查询',
param: '工艺计划流水号=' + processSerialNumber + '=int'
}
})
}

View File

@@ -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.0.110:8411/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.0.110:8002/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间
})
export default service

View File

@@ -0,0 +1,346 @@
<template>
<div class="app-container">
<el-card>
<!-- <el-button :disabled="isShow" type="info" size="small" style="margin: 0px 10px;" @click="EditData">补录完成日期</el-button>-->
<el-select v-model="Machine" filterable clearable size="small" style="margin:0px 10px 0px 10px;width: 180px;" placeholder="机床号" @change="getGroup">
<el-option
v-for="item in Machines"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.value2 }}</div>
</el-option>
</el-select>
<el-select v-model="Group" size="small" clearable placeholder="组号" style="margin:0px 10px;width: 120px;" @change="getTableData">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 180px;margin:0px 10px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
</el-card>
<el-row>
<el-col style="width: 630px">
<el-card>
<el-table
:data="tableData1"
loading="loading"
class="table"
style="max-height: 830px"
highlight-current-row
empty-text=" "
border>
<el-table-column type="index" label="序号" width="50"/>
<el-table-column align="center" label="工艺名" width="90">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="序间质检" width="90">
<template slot-scope="scope">
{{ scope.row.序间质检 }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数" width="90">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作者" width="90">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column align="center" label="排产日期" width="95">
<template slot-scope="scope">
{{ scope.row.排产日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="完成日期" width="100">
<template slot-scope="scope">
{{ scope.row.完成日期 }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col style="width: 930px">
<el-card>
<el-table
:data="tableData"
:row-class-name="tableRowClassName"
loading="loading"
class="table"
highlight-current-row
border
height="800"
@current-change="getCurrentRow">
<el-table-column type="index" label="序号" width="65">
<template slot-scope="scope">
<el-radio :label="scope.row.序号" v-model="radio"/>
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" show-overflow-tooltip width="200">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" show-overflow-tooltip width="140">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工数" width="80">
<template slot-scope="scope">
{{ scope.row.加工数 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划数" width="80">
<template slot-scope="scope">
{{ scope.row.投产数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工完成" width="110">
<template slot-scope="scope">
{{ scope.row.完成日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划完成" width="110">
<template slot-scope="scope">
{{ scope.row.计划结束时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="用户名称" show-overflow-tooltip width="110">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[100, 200, 300, 400]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { getMachines, getGroups, getTable, gettabledata1 } from '@/api/ManufacturingCenter/ProcessingStatusNew'
import Cookie from 'js-cookie'
export default {
data() {
return {
Machine: '', // 机床号
Machines: [],
Group: '', // 组号
Groups: [],
number: '', // 零件图号
tableData: [], // 工序表
loading: '',
checkbox_Machine: '', // 机床
checkbox_Group: '', // 分组
checkbox_number: '',
pageCurrent: 1,
pageSize: 100,
total: 0,
tableData1: [], // 工序表
radio: '',
completeTime: '', // 完成时间
row1: [],
isShow: true,
processSerialNumber: '', // 工序流水号
startTime: '', // 开始时间
endTime: ''
}
},
created() {
this.getMachine()
},
methods: {
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
if (Cookie.get('group') !== undefined) {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.getTableData()
this.Group = parseInt(Cookie.get('group'))
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
} else {
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
}
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
this.getTableData()
}
}, // 获取组号
getGroup() {
this.Group = ''
this.Groups = []
getGroups(this.Machine).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Groups.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
this.Group = response.data[0].组件流水号
})
this.getTableData()
}, // 按条件查询
getTableData() {
this.tableData = []
this.Loading = true
if (this.Machine === '') {
this.checkbox_Machine = 0
} else {
this.checkbox_Machine = 1
}
if (this.Group === '') {
this.checkbox_Group = 0
} else {
this.checkbox_Group = 1
}
if (this.number === '') {
this.checkbox_number = 0
} else {
this.checkbox_number = 1
}
getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
// while (response.data.rows[i].机加工实际完成时间.indexOf('-') >= 0) {
// response.data.rows[i].机加工实际完成时间 = (response.data.rows[i].机加工实际完成时间.replace('-', '/'))
// }
// while (response.data.rows[i].机加工结束时间.indexOf('-') >= 0) {
// response.data.rows[i].机加工结束时间 = (response.data.rows[i].机加工结束时间.replace('-', '/'))
// }
this.tableData.push({
工艺计划流水号: response.data.rows[i].工艺计划流水号,
序号: response.data.rows[i].序号,
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
加工数: response.data.rows[i].完成数量, // MES里采集 现在没有
投产数量: response.data.rows[i].批次数量,
// 完成日期: response.data.rows[i].完成日期,
完成日期: response.data.rows[i].机加工实际完成时间 ? response.data.rows[i].机加工实际完成时间.split(' ')[0] : '', // 排产时间
计划结束时间: response.data.rows[i].机加工结束时间 ? response.data.rows[i].机加工结束时间.split(' ')[0] : '',
// 计划结束时间: response.data.rows[i].计划结束时间,
客户名称: response.data.rows[i].客户名称 // 客户名
})
}
}
this.total = response.data.total
this.loading = false
})
}, // 获取工序表
getCurrentRow(row) {
// this.radio = row.序号
this.radio = true
this.tableData1 = []
gettabledata1(row.工艺计划流水号).then(response => {
console.log(response, 909090)
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
// while (response.data[i].计划日期.indexOf('-') >= 0) {
// response.data[i].计划日期 = (response.data[i].计划日期.replace('-', '/'))
// }
// while (response.data[i].工序完成日期.indexOf('-') >= 0) {
// response.data[i].工序完成日期 = (response.data[i].工序完成日期.replace('-', '/'))
// }
this.tableData1.push({
工艺名称: response.data[i].工艺名称,
序间质检: response.data[i].质检结果,
排产日期: response.data[i].计划日期 ? response.data[i].计划日期.split(' ')[0] : '',
// 排产日期: response.data[i].计划日期,
完成日期: response.data[i].工序完成日期 ? response.data[i].工序完成日期.split(' ')[0] : '',
操作者: response.data[i].操作者,
不合格数量: response.data[i].不合格数量,
质检数量: response.data[i].数量
})
}
}
})
}, // 补加完成日期
// EditData() {
// editdata(this.processSerialNumber).then(response => {
// if (response.data.result === '1') {
// this.$message.success('编辑成功')
// } else {
// this.$message.error('编辑失败')
// }
// })
// },
// getRow(row) {
// console.log(this.completeTime)
// this.completeTime = row.完成日期
// this.processSerialNumber = row.工序流水号
// if (this.completeTime === null) {
// this.isShow = false
// } else {
// this.isShow = true
// }
// },
tableRowClassName({ row, rowIndex }) {
// row.index = rowIndex
// if (row.完成日期 === '') {
return 'CJPClingjianjinxing'
// }
},
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.getTableData()
}
}
}
</script>
<style>
.CJPClingjianjinxing{
background: #9bd7fc !important;
}
</style>