This commit is contained in:
zhangdingyu
2020-01-09 16:40:17 +08:00
7 changed files with 93 additions and 61 deletions

View File

@@ -173,7 +173,7 @@ export default {
firstLevel.children = []
for (let j = 0; j < response.data.length; j++) {
firstLevel.children.push({
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].规格 ? response.data[j].规格 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].投产总数量 ? response.data[j].投产总数量 : '') + '..........' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + (response.data[j].零件类型 === 1 ? '' : '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购'),
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].规格 ? response.data[j].规格 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].投产总数量 ? response.data[j].投产总数量 : '') + '..........' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + (response.data[j].零件类型 === 1 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + response.data[j].考核状态名称 : (response.data[j].零件类型 === 2 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0制造采购' : '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购')),
value: response.data[j].工艺计划流水号,
考核状态: response.data[j].考核状态,
采购状态: response.data[j].采购状态,

View File

@@ -506,7 +506,6 @@ import {
readyChange,
TableAddLi1,
TableAddLi,
getPartnames3,
getPartnames4,
modifyRemark,
detailInfo
@@ -1109,38 +1108,21 @@ export default {
searchPartsByMachineGroup() {
this.tableData = []
this.partNum = []
if (this.radio === 1) { // 未编制
this.disabled = false
this.isShow1 = true
this.isShow2 = false
this.checked1 = true
getPartnames3(this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号,
machine: response.data[i].机床图号,
group: response.data[i].组号
})
}
})
} else { // 已编制
this.isShow = true
this.isShow1 = false
this.isShow2 = true
this.disabled = true
this.checked1 = false
getPartnames4(this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号,
machine: response.data[i].机床图号,
group: response.data[i].组号
})
}
})
}
this.isShow = true
this.isShow1 = false
this.isShow2 = true
this.disabled = true
this.checked1 = false
getPartnames4(this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号,
machine: response.data[i].机床图号,
group: response.data[i].组号
})
}
})
},
searchParts() { // 根据条件查零件号
this.tableData = []

View File

@@ -21,9 +21,10 @@
</el-select>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 170px;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-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
</el-card>
<el-row>
<el-col style="width: 40%">
<el-col style="width: 37%">
<el-card>
<el-table
:data="tableData1"
@@ -36,7 +37,7 @@
border
@current-change="getRow">
<el-table-column type="index" label="序号" width="50"/>
<el-table-column align="center" label="工艺名" show-overflow-tooltip width="70">
<el-table-column align="center" label="工艺名" show-overflow-tooltip min-width="70">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
@@ -56,11 +57,11 @@
{{ 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="95">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.排产日期 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="完成日期" width="95">
<template slot-scope="scope">
{{ scope.row.完成日期 }}
@@ -69,7 +70,7 @@
</el-table>
</el-card>
</el-col>
<el-col style="width: 60%">
<el-col style="width: 63%">
<el-card>
<el-table
:data="tableData"
@@ -80,16 +81,16 @@
border
height="630"
@current-change="getCurrentRow">
<el-table-column type="index" align="center" label="号" width="80">
<el-table-column type="index" align="center" label="跟单号" width="140">
<template slot-scope="scope">
<el-radio :label="scope.row.号" v-model="radio"/>
</template>
</el-table-column>
<el-table-column align="center" label="跟单号" width="80">
<template slot-scope="scope">
{{ scope.row.跟单号 }}
<el-radio :label="scope.row.跟单号" v-model="radio"/>
</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="零件图号" show-overflow-tooltip width="200">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -210,7 +211,7 @@
</template>
<script>
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit } from '@/api/ManufacturingCenter/ProcessingStatusNew'
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, getExport } from '@/api/ManufacturingCenter/ProcessingStatusNew'
import Cookie from 'js-cookie'
export default {
@@ -264,6 +265,33 @@ export default {
this.getTable9()
},
methods: {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
exportExcel() {
if (!this.Machine) {
this.$message.warning('请选择机床')
return
}
getExport(this.Machine).then(res => {
console.log(res.data)
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['机床', '组号', '图号及规格', '制品名称', '计划数', '材料', '当前工序名']
const filterVal = ['机床图号', '组号', '零件图号', '零件名称', '投产数量', '材料', '工艺名称']
const list = res.data
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '加工进度表',
autoWidth: true,
bookType: 'xlsx'
})
})
})
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''

View File

@@ -37,7 +37,7 @@
{{ scope.row.设备总工时 }}
</template>
</el-table-column>
<el-table-column label="录入准结工时" align="center" width="100px">
<el-table-column label="录入准结" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.修补准结总工时 }}
</template>
@@ -66,7 +66,7 @@
<el-col :span="15">
<el-card>
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe style="width: 100%;" height="700px" border element-loading-text="拼命加载中">
<el-table-column label="零件图号" align="center" width="140px" show-overflow-tooltip>
<el-table-column label="零件图号" align="center" width="135px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
@@ -96,12 +96,12 @@
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column label="录入准结工时" align="center" width="100px">
<el-table-column label="录入准结" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column label="加工时间" align="center" width="135px">
<el-table-column label="加工时间" align="center" width="115px">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>