加工进度查询
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
type="date"
|
||||
placeholder="选择日期"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
|
||||
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
@@ -309,7 +310,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getNames, getMachines, getGroups, getTable, getTable2 } from '@/api/ManufacturingCenter/ProcessingStatus'
|
||||
import { getNames, getMachines, getGroups, getTable, getTable2, getExport } from '@/api/ManufacturingCenter/ProcessingStatus'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -384,6 +385,33 @@ export default {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
exportExcel() {
|
||||
if (!this.Group) {
|
||||
this.$message.warning('请选择分组')
|
||||
return
|
||||
}
|
||||
getExport(this.Group).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'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
// 查询供应商名称
|
||||
fetchData() {
|
||||
this.projects = []
|
||||
|
||||
Reference in New Issue
Block a user