备料单导出

This commit is contained in:
zhangdingyu
2018-12-13 19:41:31 +08:00
parent 51af7ad203
commit 4ae8311181
2 changed files with 38 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询已分配零件
// 查询零件
export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({
url: '',
@@ -13,7 +13,19 @@ export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
}
})
}
// 查询已分配零件
// 查询零件工艺
export function searchtable2(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_备料打印_查询工序信息',
param: '工艺计划流水号=' + num1
}
})
}
// 更改打印状态
export function edit(num1) {
return request({
url: '',

View File

@@ -6,7 +6,7 @@
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<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="downLoad('BL');searchTable();edit()">导出备料单</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="downLoad('BL');edit()">导出备料单</el-button>
</el-row>
</el-card>
@@ -51,24 +51,24 @@
</div>
</el-card>
<table id="BL" border cellspacing="0px" style="table-layout: fixed; width: 900px;display: none">
<table id="BL" border cellspacing="0px" style="table-layout: fixed; width: 600px;display: none">
<colgroup>
<col style="width: 200px">
<col style="width: 200px">
<col style="width: 500px">
<col style="width: 100px">
<col style="width: 150px">
<col style="width: 450px">
</colgroup>
<tr>
<th>GAOJING</th>
<th colspan="2"><span style="font-weight:bold">备料单</span></th>
</tr>
<tr>
<td>零件名称</td>
<td>零件图号</td>
<td>备料</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>{{ list.零件图号 }}</td>
<td align="center">{{ list.零件图号 }}</td>
<td>{{ list.工艺要求 }}</td>
</tr>
</table>
@@ -77,7 +77,7 @@
</template>
<script>
import { searchtable, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { searchtable, searchtable2, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
export default {
data() {
@@ -86,6 +86,7 @@ export default {
partName: '',
all: false,
loading: false,
Data: [],
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
@@ -106,15 +107,23 @@ export default {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, 0, this.pageCurrent, this.pageSize).then(response => {
console.log(response.data)
if (response.data.total === 0) {
this.loading = false
} else {
this.tableData = response.data.rows
this.Data = 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].零件图号,
工艺要求: response.data[i].工艺要求
})
})
this.loading = false
}
})
},
handleSelectionChange(val) {
@@ -130,6 +139,7 @@ export default {
if (this.tableData2.length === 0) {
this.$message.warning('暂无数据')
} else {
this.searchTable()
getExplorer()
method5(tableid)
Cleanup()