项目计划零件工艺制定

This commit is contained in:
zhangdingyu
2019-02-27 11:01:00 +08:00
parent 542917d55e
commit 43e223a2b5
4 changed files with 222 additions and 127 deletions

View File

@@ -1,6 +1,48 @@
import request from '@/utils/request'
export function getNames() {
export function getProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
}
})
}
export function getCustomerName() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
}
})
}
export function getToolNum() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
}
})
}
export function searchtable(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10, num11, num12, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '项目计划管理_项目总计划_查询数据',
param: `项目流水号_check=` + num1 + '&项目流水号=' + num2 + '&机床流水号_check=' + num3 + '&@机床流水号=' + num4 + '&客户名称_check=' + num5 + '&客户名称=' + num6 + '&签订日期_check=' + num7 + '&签订日期开始时间=' + num8 + '&签订日期结束时间=' + num9 + '&交货期_check=' + num10 + '&交货期开始时间=' + num11 + '&交货期结束时间=' + num12,
Pagination: pageCurrent + '&' + pageSize
}
})
}
export function searchtable2() {
return request({
url: '',
method: 'post',

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="1551162791632" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1213" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M792.9 482.2H405.8c-11.4 0-21.2 9.8-21.2 21.2 0 11.4 9.8 21.2 21.2 21.2h387.1c11.4 0 21.2-9.8 21.2-21.2 0-13-9.8-21.2-21.2-21.2z m0 178.1H405.8c-11.4 0-21.2 9.8-21.2 21.2s9.8 21.2 21.2 21.2h387.1c11.4 0 21.2-9.8 21.2-21.2s-9.8-21.2-21.2-21.2zM904 248.7H626.3l-4.9-13.1c-32.7-91.5-96.4-114.3-143.7-116H118.4c-31 0-55.5 24.5-55.5 53.9v681.1c0 29.4 24.5 53.9 55.5 53.9H904c31 0 55.5-24.5 55.5-53.9v-552c0-29.4-24.5-53.9-55.5-53.9z m-785.6-50.6c0-42.5 14.7-35.9 76.8-35.9h222.1c94.7 0 119.2 21.2 137.2 52.3l13.1 32.7H118.4v-49.1z m788.8 597.7c0 62.1-21.2 63.7-73.5 63.7H191.9c-63.7 0-73.5-4.9-73.5-73.5V299.3h728.4c68.6 0 60.4 26.1 60.4 73.5v423z m-699-329.9h68.6v68.6h-68.6v-68.6z m0 181.3h68.6v68.6h-68.6v-68.6z m0 0" p-id="1214"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -266,7 +266,7 @@
<el-dialog :visible.sync="dialogFormVisible2" title="工艺名称、工艺要求选择" center width="400px">
<el-form ref="form2" :model="form2" label-position="left" label-width="125px" class="demo-ruleForm">
<el-form-item label="工艺名称分类">
<el-select v-model="processNameClassValue" placeholder="分类" size="small" @change="cChange()">
<el-select v-model="processNameClassValue" filterable placeholder="分类" size="small" @change="cChange()">
<el-option
v-for="item in processNameClass"
:key="item.value"
@@ -275,7 +275,7 @@
</el-select>
</el-form-item>
<el-form-item label="工艺名称">
<el-select v-model="processNameValue" placeholder="名称" size="small" @change="nChange()">
<el-select v-model="processNameValue" filterable placeholder="名称" size="small" @change="nChange()">
<el-option
v-for="item in processName"
:key="item.value"

View File

@@ -2,55 +2,140 @@
<div>
<el-card>
<el-row>
<span>零件图号:</span>
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<span>项目名称:</span>
<el-select v-model="projectValue" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="项目名称" @change="typeChange()">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床名称:</span>
<el-select v-model="toolNumValue" clearable filterable size="small" style="margin-bottom:10px;width: 220px" placeholder="机床名称">
<el-option
v-for="item in toolNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>客户名称:</span>
<el-select v-model="CustomerNameValue" clearable filterable size="small" style="margin-bottom:10px;width: 220px" placeholder="客户名称">
<el-option
v-for="item in CustomerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<span>签订日期:</span>
<el-date-picker v-model="time_SignStart" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>~
<el-date-picker v-model="time_SignFinish" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="签订日期" class="time"/>
<span>交货期:</span>
<el-date-picker v-model="time_deliveryStart" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>~
<el-date-picker v-model="time_deliveryFinish" size="small" type="date" style="margin-top:10px;width: 180px" placeholder="交货期" class="time"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<el-checkbox v-model="all" size="mini">查询全部</el-checkbox>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportTable('BL')">导出备料单</el-button>
<el-button type="primary" size="small" icon="el-icon-success" style="margin-left:10px" @click="edit()">导出完成</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="打印状态" width="100" align="center">
<el-table-column min-width="300px" label="项目编号" align="center" width="240px">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">已导出</el-tag>
<el-tag v-else type="warning" size="small">未导出</el-tag>
<template v-if="scope.row.edit">
<el-input v-model="scope.row.项目编号" class="edit-input" size="small"/>
</template>
<span v-else>{{ scope.row.项目编号 }}</span>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
<!--<el-table-column label="项目编号" align="center" width="220px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.项目编号 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="项目名称" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<el-table-column label="机床图号" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="材料" align="center" width="100px">
<el-table-column label="签订日期" align="center">
<template slot-scope="scope">
{{ scope.row.材料 }}
{{ scope.row.合同签订日期 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" width="100px">
<el-table-column label="交货期" align="center">
<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">
<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">
<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">
<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="操作" width="300px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">保存</el-button>
<el-button v-else type="primary" size="small" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
</template>
</el-table-column>
</el-table>
@@ -67,55 +152,25 @@
</div>
</el-card>
<div v-show="false" id="BL">
<table border cellspacing="0px" style="table-layout: fixed; width: 600px;">
<colgroup>
<col style="width: 120px">
<col style="width: 180px">
<col style="width: 110px">
<col style="width: 110px">
<col style="width: 110px">
<col style="width: 450px">
</colgroup>
<tr>
<th colspan="2" height="60px">GAOJING</th>
<th colspan="4" height="60px"><span style="font-weight:bold">备料单</span></th>
</tr>
<tr>
<td align="center">零件名称</td>
<td align="center">零件图号</td>
<td align="center">材料</td>
<td align="center">原材料规格</td>
<td align="center">批次数量</td>
<td align="center">备料</td>
</tr>
<tr v-for="(list, index) in tableData2" :key="index">
<td align="center">{{ list.零件名称 }}</td>
<td align="center">{{ list.零件图号 }}</td>
<td align="center">{{ list.材料 }}</td>
<td align="center">{{ list.原材料规格 }}</td>
<td align="center">{{ list.批次数量 }}</td>
<td>{{ list.工艺要求 }}</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import { searchtable, searchtable2, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { exportExcelMethod } from './exportExcel'
import $ from 'jquery'
import { getProject, getCustomerName, getToolNum, searchtable } from '@/api/ManufacturingCenter/ProjectPlanningManagement'
export default {
data() {
return {
a: 0,
tableData2: [],
partName: '',
all: false,
time_SignStart: '', // 签订开始
time_SignFinish: '', // 签订结束
time_deliveryStart: '', // 交货开始
time_deliveryFinish: '', // 交货结束
projectValue: '',
project: [], // 项目名称
CustomerNameValue: '',
CustomerName: [], // 客户名称
toolNumValue: '',
toolNum: [], // 机床
loading: false,
Data: [],
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
@@ -123,86 +178,83 @@ export default {
}
},
created() {
this.fetchData()
this.getCustomerName()
this.searchTable()
},
methods: {
exportTable() {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
const htmlNode = $('#BL').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
printNode.remove()
}
cancelEdit(row) {
row.title = row.originalTitle
row.edit = false
this.$message({
message: 'The title has been restored to the original value',
type: 'warning'
})
},
confirmEdit(row) {
row.edit = false
row.originalTitle = row.title
this.$message({
message: 'The title has been edited',
type: 'success'
})
},
fetchData() {
this.projectValue = ''
this.project = []
getProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.project.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
getCustomerName() {
this.CustomerNameValue = ''
this.CustomerName = []
getCustomerName().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.CustomerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
typeChange() {
this.toolNumValue = ''
this.toolNum = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, 0, this.pageCurrent, this.pageSize).then(response => {
if (this.projectValue !== '' && this.projectValue !== null) { this.projectValuecheck = 1 } else { this.projectValuecheck = 0 }
if (this.CustomerNameValue !== '' && this.CustomerNameValue !== null) { this.CustomerNameValuecheck = 1 } else { this.CustomerNameValuecheck = 0 }
if (this.toolNumValue !== '' && this.toolNumValue !== null) { this.toolNumValuecheck = 1 } else { this.toolNumValuecheck = 0 }
if (this.time_SignStart !== '' && this.time_SignStart !== null && this.time_SignFinish !== '' && this.time_SignFinish) { this.time_Signcheck = 1 } else { this.time_Signcheck = 0 }
if (this.time_deliveryStart !== '' && this.time_deliveryStart !== null && this.time_deliveryFinish !== '' && this.time_deliveryFinish) { this.time_deliverycheck = 1 } else { this.time_deliverycheck = 0 }
searchtable(this.projectValuecheck, this.projectValue, this.CustomerNameValuecheck, this.CustomerNameValue, this.toolNumValuecheck, this.toolNumValue, this.time_Signcheck, this.time_deliveryStart, this.time_deliveryFinish, this.time_deliverycheck, this.time_deliveryStart, this.time_deliveryFinish, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.Data = response.data.rows
this.tableData = response.data.rows
this.total = response.data.total
}
}).then(() => {
for (let i = 0; i < this.Data.length; i++) {
searchtable2(this.Data[i].工艺计划流水号).then(response => {
this.tableData.push({
工艺计划流水号: this.Data[i].工艺计划流水号,
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料打印: this.Data[i].备料打印,
工艺要求: response.data[0].工艺要求,
材料: this.Data[i].材料,
原材料规格: this.Data[i].原材料规格,
批次数量: this.Data[i].批次数量
})
})
this.loading = false
}
this.loading = false
})
},
handleSelectionChange(val) {
this.tableData2 = []
this.tableData2 = val
},
edit() {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
this.a = 0
for (let i = 0; i < this.tableData2.length; i++) {
edit(this.tableData2[i].工艺计划流水号).then(response => {
this.a += parseInt(response.data[0].result)
if (this.a === this.tableData2.length) {
this.pageSize = 10
this.pageCurrent = 1
this.searchTable()
}
})
}
}
},
downLoad(tableid) {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
exportExcelMethod(tableid, '123', 'asd')
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1