This commit is contained in:
liushuai
2020-04-13 18:28:15 +08:00
parent 37d1a82b07
commit 4e0826cfd5
16 changed files with 1188 additions and 401 deletions

View File

@@ -0,0 +1,228 @@
<template>
<div class="app-container">
<el-card style="width: 1000px;margin: 0px 0px 5px 0px">
<el-row style="margin-bottom:10px;margin-top: 10px">
<el-select v-model="machineValue" filterable placeholder="机床图号" size="small" clearable style="width: 180px" @change="machineChange">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-select v-model="groupValue" placeholder="组号" size="small" style="width: 90px;margin-left: 10px" clearable filterable>
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="name" placeholder="名称图号规格领料人" clearable size="small" style="width:165px;margin-left: 10px" @keyup.enter.native="pageCurrent1=1;pageSize1=100;searchRecord()"/>
<!--<el-input v-model="model" placeholder="图号或型号" clearable size="small" style="width:150px;margin-left: 10px" />-->
<!--<el-input v-model="spec" placeholder="规格" clearable size="small" style="width:150px;margin: 0px 10px" />-->
<el-date-picker
v-model="outTime"
type="daterange"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:240px;margin-left: 10px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 20px" plain @click="pageCurrent1=1;pageSize1=100;searchRecord()">查询</el-button>
<el-button :loading="loading_export" type="success" icon="el-icon-bottom" plain size="small" style="margin-left: 15px" @click="exportExcel()">导出</el-button>
</el-row>
<el-row v-show="false" style="margin-bottom:10px">
<el-date-picker
v-model="outTime"
type="daterange"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:250px;margin-left: 0px"
start-placeholder="开始时间"
end-placeholder="结束时间"/>
</el-row>
</el-card>
<el-card style="width: 1000px">
<el-table :data="tableData" border stripe size="mini" height="700">
<el-table-column label="名称" align="center" width="180" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" width="180" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" width="270" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" width="90" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="领料人" align="center" width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.领料人 }}
</template>
</el-table-column>
<el-table-column label="出库时间" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.出库时间 ? scope.row.出库时间.split(' ')[0] : '-' }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { initMachineProject, searchGroup, searchRecord } from '@/api/Inventory/PurchaseOutRecord'
export default {
name: 'PurchaseOutRecord',
data() {
return {
loading_export: false,
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
name: '',
spec: '',
model: '',
tableData: [],
pageSize1: 100,
pageCurrent1: 1,
total1: 0,
outTime: '' // 出库时间
}
},
watch: {
groupValue() {
this.searchRecord()
}
},
created() {
this.fetchData()
},
mounted() {
this.searchRecord()
},
methods: {
// EXCEL 导出
// 姜福壮
async exportExcel() {
this.loading_export = true
let check1, check2, check3, check4, check5, check6, check7
this.projectValue ? check1 = 1 : check1 = 0
this.machineValue ? check2 = 1 : check2 = 0
this.groupValue ? check3 = 1 : check3 = 0
this.name ? check4 = 1 : check4 = 0
this.spec ? check5 = 1 : check5 = 0
this.model ? check6 = 1 : check6 = 0
this.outTime ? check7 = 1 : (check7 = 0, this.outTime = '')
var param = []
param[0] = ['项目流水号_check', check1]
param[1] = ['项目流水号', this.projectValue]
param[2] = ['机床流水号_check', check2]
param[3] = ['机床流水号', this.machineValue]
param[4] = ['组件流水号_check', check3]
param[5] = ['组件流水号', this.groupValue]
param[6] = ['名称_check', check4]
param[7] = ['名称', this.name]
param[8] = ['规格_check', check5]
param[9] = ['规格', this.spec]
param[10] = ['图号或型号_check', check6]
param[11] = ['图号或型号', this.model]
param[12] = ['出库时间_check', check7]
param[13] = ['出库开始时间', this.outTime[0]]
param[14] = ['出库结束时间', this.outTime[1]]
var Data = this.CreateData('2001', '报表_采购部仓库_出库记录_查询', param)
await this.exportExcel_NPOI(Data)
setTimeout(() => {
this.loading_export = false
}, 5000)
},
fetchData() {
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
},
machineChange() {
this.group = []
this.groupValue = ''
searchGroup(this.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
value: response.data[i].组件流水号,
label: response.data[i].组号
})
}
if (response.data.length > 0) {
this.groupValue = this.group[0].value
}
})
},
searchRecord() {
let check1, check2, check3, check4, check5, check6, check7
this.projectValue ? check1 = 1 : check1 = 0
this.machineValue ? check2 = 1 : check2 = 0
this.groupValue ? check3 = 1 : check3 = 0
this.name ? check4 = 1 : check4 = 0
this.spec ? check5 = 1 : check5 = 0
this.model ? check6 = 1 : check6 = 0
this.outTime ? check7 = 1 : (check7 = 0, this.outTime = '')
searchRecord(check1, this.projectValue, check2, this.machineValue, check3, this.groupValue, check4, this.name, check5, this.spec, check6, this.model, check7, this.outTime[0], this.outTime[1], this.pageCurrent1, this.pageSize1).then(res => {
this.tableData = res.data.rows
this.total1 = res.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchRecord()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchRecord()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -29,7 +29,7 @@
</el-row>
</el-card>
<el-card>
<el-table :data="tableData" style="width: 1120px" height="580" stripe size="mini" border @selection-change="handleSelectionChange">
<el-table :data="tableData" style="width: 1020px" height="580" stripe size="mini" border @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="45"/>
@@ -54,11 +54,6 @@
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="入库时间" width="100px">
<template slot-scope="scope">
{{ scope.row.入库时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="库存数量" width="90px">
<template slot-scope="scope">
{{ scope.row.出库数量1 }}
@@ -97,7 +92,7 @@
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="出库信息" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form ref="form" :model="form" :rules="rules" label-position="right">
<el-form-item label="部门" prop="部门" label-width="100px" size="small">
<!-- <el-input v-model="form.department" size="small" placeholder="请输入人员编号" style="width: 200px"/>-->
<el-select v-model="form.department" placeholder="请选择部门" size="small" clearable style="width: 200px;" @change="selectLeaders">
@@ -185,7 +180,6 @@ export default {
组号: response.data.rows[i].组号,
零件图号: response.data.rows[i].零件图号,
零件名称: response.data.rows[i].零件名称,
入库时间: response.data.rows[i].入库时间,
已出库数量: Number(response.data.rows[i].出库数量),
入库数量: Number(response.data.rows[i].入库数量),
工艺计划流水号: response.data.rows[i].工艺计划流水号,