采购件查询分页金工页面
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
</el-select>
|
||||
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 170px;margin:0px 10px;"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
|
||||
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
|
||||
</el-card>
|
||||
<el-row>
|
||||
<el-col style="width: 37%">
|
||||
@@ -210,7 +211,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit } from '@/api/ManufacturingCenter/ProcessingStatusNew'
|
||||
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, getExport } from '@/api/ManufacturingCenter/ProcessingStatusNew'
|
||||
import Cookie from 'js-cookie'
|
||||
|
||||
export default {
|
||||
@@ -264,6 +265,33 @@ export default {
|
||||
this.getTable9()
|
||||
},
|
||||
methods: {
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
exportExcel() {
|
||||
if (!this.Machine) {
|
||||
this.$message.warning('请选择机床')
|
||||
return
|
||||
}
|
||||
getExport(this.Machine).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'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getMachine() {
|
||||
if (Cookie.get('machineValue') !== undefined) {
|
||||
this.Machine = ''
|
||||
|
||||
Reference in New Issue
Block a user