This commit is contained in:
liushuai
2020-03-09 09:28:04 +08:00
parent 6714e10d90
commit 28177e7cd4
23 changed files with 1145 additions and 983 deletions

View File

@@ -10,7 +10,7 @@
:value="item.value"/>
</el-select>
<el-input v-model="partNumber" size="small" placeholder="零件图号" style="width: 180px" clearable/>
<el-select v-model="MaterialsValue" placeholder="请选择备料状态" filterable size="small" style="width: 140px" clearable>
<el-select v-model="MaterialsValue" placeholder="请选择备料状态" filterable size="small" style="width: 140px;margin-left: 10px" clearable>
<el-option
v-for="item in Materials"
:key="item.value"
@@ -30,8 +30,8 @@
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
<el-button type="primary" icon="el-icon-download" size="small" @click="exportExcel()">导出</el-button>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
<el-button type="success" plain icon="el-icon-download" size="small" @click="exportExcel()">导出</el-button>
</div>
</el-card>
<el-card style="width: 100%">
@@ -43,7 +43,7 @@
stripe
size="mini"
style="width: 100%"
height="760"
height="750"
@sort-change="sortChange">
<el-table-column
label="序号"
@@ -51,8 +51,10 @@
type="index"
width="50"/>
<el-table-column
label="备料状态"
label="进程"
align="center"
prop="进程"
sortable="custom"
width="80px">
<template slot-scope="scope">
<span v-if="Number(scope.row.是否到货)===0" type="warning" size="mini">未到</span>
@@ -73,7 +75,7 @@
<el-table-column
label="物料编码"
align="center"
min-width="180px">
width="180px">
<template slot-scope="scope">{{ scope.row.物料编码 }}</template>
</el-table-column>
<el-table-column
@@ -92,12 +94,12 @@
align="center">
<template slot-scope="scope">{{ scope.row.材料 }}</template>
</el-table-column>
<el-table-column label="备料件数" align="center" width="70">
<el-table-column label="备料件数" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.采购数量 }}
</template>
</el-table-column>
<el-table-column label="备料时间" align="center" prop="下单日期" sortable="custom" width="100">
<el-table-column label="备料时间" align="center" prop="下单日期" sortable="custom" width="120">
<template slot-scope="scope">
{{ scope.row.下单日期 ? scope.row.下单日期.split(' ')[0] : '' }}
</template>
@@ -105,7 +107,7 @@
<el-table-column
label="到货件数"
align="center"
width="70">
width="100">
<template slot-scope="scope">{{ scope.row.到货数量 }}</template>
</el-table-column>
<el-table-column
@@ -136,7 +138,7 @@
</template>
<script>
import { searchSupplier, searchTable, searchTablesheet } from '@/api/WorkshopProcurement/OutsourcingMaterialsSearch'
import { searchSupplier, searchTable } from '@/api/WorkshopProcurement/OutsourcingMaterialsSearch'
export default {
name: 'Index',
data() {
@@ -204,31 +206,38 @@ export default {
}))
},
exportExcel() {
let check, check1, check2, check3
this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '')
this.supplierNameValue ? check = 1 : check = 0
this.partNumber ? check1 = 1 : check1 = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check2 = 1
if (this.tableData.length !== 0) {
let check, check1, check2, check3
this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '')
this.supplierNameValue ? check = 1 : check = 0
this.partNumber ? check1 = 1 : check1 = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check2 = 1
} else {
check2 = 0
}
var param = []
param[0] = ['供应商流水号_check', check]
param[1] = ['供应商流水号', this.supplierNameValue]
param[2] = ['零件图号_check', check1]
param[3] = ['零件图号', this.partNumber]
param[4] = ['备料状态_check', check2]
param[5] = ['备料状态', this.MaterialsValue]
param[6] = ['下单时间_check', check3]
if (check3 === 0) {
param[7] = ['开始时间', '']
param[8] = ['结束时间', '']
} else {
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
}
param[9] = ['排序名称', this.ordername]
param[10] = ['排序方式', this.order]
var Data = this.CreateData('2001', '报表_备料管理_外购备料_综合查询数据', param)
this.exportExcel_NPOI(Data)
} else {
check2 = 0
this.$message.warning('暂无数据')
}
searchTablesheet(check, this.supplierNameValue, check1, this.partNumber, check2, this.MaterialsValue, check3, this.dateRange[0], this.dateRange[1], this.ordername, this.order).then(res => {
console.log(res.data, 11)
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() {
searchSupplier(0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '').then(response => {
@@ -251,6 +260,8 @@ export default {
this.ordername = 3
} else if (column.prop === '下单日期') {
this.ordername = 4
} else if (column.prop === '进程') {
this.ordername = 5
} else {
this.ordername = ''
}