备料单导出
This commit is contained in:
27
src/api/ManufacturingCenter/CreatePreparationBill.js
Normal file
27
src/api/ManufacturingCenter/CreatePreparationBill.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询已分配零件
|
||||
export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料零件查询',
|
||||
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料打印_check=' + num3 + '&备料打印=' + num4,
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询已分配零件
|
||||
export function edit(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理工艺_备料单导出_状态更改',
|
||||
param: '工艺计划流水号=' + num1
|
||||
}
|
||||
})
|
||||
}
|
||||
154
src/views/ManufacturingCenter/CreatePreparationBill/index.vue
Normal file
154
src/views/ManufacturingCenter/CreatePreparationBill/index.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>零件图号:</span>
|
||||
<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-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-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column label="打印状态" width="100" align="center">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<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="280px">
|
||||
<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>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<table id="BL" border cellspacing="0px" style="table-layout: fixed; width: 900px;display: none">
|
||||
<colgroup>
|
||||
<col style="width: 200px">
|
||||
<col style="width: 200px">
|
||||
<col style="width: 500px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th>GAOJING</th>
|
||||
<th colspan="2"><span style="font-weight:bold">备料单</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>零件名称</td>
|
||||
<td>零件图号</td>
|
||||
<td>备料</td>
|
||||
</tr>
|
||||
<tr v-for="(list, index) in tableData2" :key="index">
|
||||
<td align="center"> {{ list.零件名称 }}</td>
|
||||
<td>{{ list.零件图号 }}</td>
|
||||
<td>{{ list.工艺要求 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchtable, edit } from '@/api/ManufacturingCenter/CreatePreparationBill'
|
||||
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData2: [],
|
||||
partName: '',
|
||||
all: false,
|
||||
loading: false,
|
||||
tableData: [], // 表格数据
|
||||
total: null, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
// 查询表格数据
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
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 => {
|
||||
console.log(response.data)
|
||||
if (response.data.total === 0) {
|
||||
this.loading = false
|
||||
} else {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
}
|
||||
}).then(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.tableData2 = []
|
||||
this.tableData2 = val
|
||||
},
|
||||
edit() {
|
||||
for (let i = 0; i < this.tableData2.length; i++) {
|
||||
edit(this.tableData2[i].工艺计划流水号)
|
||||
}
|
||||
},
|
||||
downLoad(tableid) {
|
||||
if (this.tableData2.length === 0) {
|
||||
this.$message.warning('暂无数据')
|
||||
} else {
|
||||
getExplorer()
|
||||
method5(tableid)
|
||||
Cleanup()
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -329,12 +329,12 @@
|
||||
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="calculatingPrice">计算价格</el-button>
|
||||
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="confirmPrice">确定价格</el-button>
|
||||
<el-button type="success" size="mini" icon="el-icon-success" style="margin-left:10px;margin-top: 15px" @click="Deal">成交</el-button>
|
||||
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 15px" @click="downLoadCjn('cjn')">导出外协加工任务单</el-button>
|
||||
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 15px" @click="downLoadRWD('RWD')">导出外协加工任务单</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-show="card">
|
||||
<table id="cjn" cellspacing="0px" align="center" width="100%" style="">
|
||||
<table id="RWD" cellspacing="0px" align="center" width="100%" style="">
|
||||
<tbody id="1">
|
||||
<tr>
|
||||
<td colspan="4" style="text-align: left;font-size: 30px;font-weight: bold">GAOJING</td>
|
||||
@@ -717,7 +717,7 @@ export default {
|
||||
}
|
||||
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
|
||||
this.大写金额 = convertCurrency(this.总计)
|
||||
// cjn end
|
||||
// RWD end
|
||||
if (response.data.length === 0) {
|
||||
this.loading = false
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ export default {
|
||||
if (response.data.length === 0) {
|
||||
this.loading = false
|
||||
}
|
||||
// cjn end
|
||||
// RWD end
|
||||
if (response.data.length === 0) {
|
||||
this.loading = false
|
||||
}
|
||||
@@ -1140,7 +1140,7 @@ export default {
|
||||
}
|
||||
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
|
||||
this.大写金额 = convertCurrency(this.总计)
|
||||
// cjn end
|
||||
// RWD end
|
||||
if (response.data.length === 0) {
|
||||
this.loading = false
|
||||
}
|
||||
@@ -1533,7 +1533,7 @@ export default {
|
||||
this.$message.warning('请选择订单')
|
||||
}
|
||||
},
|
||||
downLoadCjn(tableid) {
|
||||
downLoadRWD(tableid) {
|
||||
if (this.List3.length === 0) {
|
||||
this.$message.warning('暂无数据')
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user