备料单导出

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' import request from '@/utils/request'
// 查询已分配零件 // 查询零件
export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) { export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({ return request({
url: '', 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) { export function edit(num1) {
return request({ return request({
url: '', url: '',

View File

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