This commit is contained in:
liushuai
2020-04-14 20:17:06 +08:00
parent 958997fa36
commit d40d67c5ca
13 changed files with 819 additions and 374 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card style="width: 1000px;margin: 0px 0px 5px 0px">
<el-card style="width: 1220px;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
@@ -33,7 +33,6 @@
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
@@ -43,24 +42,24 @@
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:250px;margin-left: 0px"
style="width:350px;margin-left: 0px"
start-placeholder="开始时间"
end-placeholder="结束时间"/>
</el-row>
</el-card>
<el-card style="width: 1000px">
<el-card style="width: 1220px">
<el-table :data="tableData" border stripe size="mini" height="700">
<el-table-column label="名称" align="center" width="180" show-overflow-tooltip>
<el-table-column label="名称" align="center" width="160" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" width="180" show-overflow-tooltip>
<el-table-column label="图号或型号" align="center" width="160" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" width="270" show-overflow-tooltip>
<el-table-column label="规格" align="center" width="200" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.规格 }}
</template>
@@ -75,11 +74,31 @@
{{ scope.row.领料人 }}
</template>
</el-table-column>
<el-table-column label="出库时间" align="center" min-width="90">
<el-table-column label="出库时间" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.出库时间 ? scope.row.出库时间.split(' ')[0] : '-' }}
</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" width="90">
<template slot-scope="scope">
{{ scope.row.出库时间 ? scope.row.出库时间.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-right" @click="yesApproval(scope.row)">退货</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -93,25 +112,57 @@
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible" title="补投" center width="300px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="80px" class="demo-ruleForm">
<el-form-item label="退料数量" prop="退料数量">
<el-input-number v-model="form.退料数量" :min="1" :max="outNumber" :step="1" style="width: 140px" size="small" />
</el-form-item>
<el-form-item label="货位名称" prop="货位名称">
<el-select v-model="form.货位名称" style="width: 140px" filterable size="small" placeholder="货位名称">
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :disabled="handleEdit_disable" size="small" type="primary" @click="submit()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initMachineProject, searchGroup, searchRecord } from '@/api/Inventory/PurchaseOutRecord'
import { initMachineProject, searchGroup, searchRecord, initLocateName, submitMaterialReturn } from '@/api/Inventory/MaterialReturn'
import { mapGetters } from 'vuex'
export default {
name: 'PurchaseOutRecord',
data() {
return {
loading_export: false,
handleEdit_disable: false,
dialogFormVisible: false,
form: {
退料数量: '',
货位名称: ''
},
rules: {
货位名称: [{ required: true, message: '请选择货位' }]
},
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
outNumber: '',
materialNumber: '',
basicNumber: '',
name: '',
spec: '',
model: '',
locateName: [],
tableData: [],
pageSize1: 100,
pageCurrent1: 1,
@@ -119,6 +170,12 @@ export default {
outTime: '' // 出库时间
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
watch: {
groupValue() {
this.searchRecord()
@@ -131,40 +188,6 @@ export default {
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++) {
@@ -175,6 +198,14 @@ export default {
})
}
})
initLocateName().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.locateName.push({
label: response.data[i].货位名称,
value: response.data[i].货位流水号
})
}
})
},
machineChange() {
this.group = []
@@ -205,6 +236,28 @@ export default {
this.total1 = res.data.total
})
},
yesApproval(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
this.materialNumber = row.物料流水号
this.basicNumber = row.组件零件基本件流水号
this.outNumber = row.出库数量
},
submit() {
submitMaterialReturn(this.materialNumber, this.basicNumber, this.form.退料数量, this.form.货位名称, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('退料成功')
this.dialogFormVisible = false
this.searchRecord()
this.handleEdit_disable = false
} else {
this.handleEdit_disable = false
this.$message.error('退料失败')
}
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
@@ -225,4 +278,23 @@ export default {
span{
margin: 10px 0 10px 10px;
}
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>