This commit is contained in:
liushuai
2019-10-30 12:56:43 +08:00
parent d1939c0e42
commit f7a889e3d6
11 changed files with 397 additions and 719 deletions

View File

@@ -1,196 +1,114 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<div style="margin-top: 8px;margin-bottom: 8px">
<span style="margin: 5px">领料单编号:</span>
<el-input v-model="pickingListNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchList()">查询</el-button>
<el-button size="small" type="warning" style="float: right;margin-right: 10px" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="审批未通过===true" size="small" type="primary" style="float: right" @click="inputPassword()">领料确认</el-button>
</div>
<h4 style="margin-top:0">领料单</h4>
<el-table :data="pickListTable1" stripe highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickList">
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="领料单编号" prop="领料单编号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" min-width="200" >
<template slot-scope="scope">
{{ scope.row.操作日期.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="领料人" prop="姓名" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="领料单备注" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.领料单备注 }}
</template>
</el-table-column>
<el-table-column label="审批" align="center" min-width="80">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否审批)===0" type="warning" size="small">未审批</el-tag>
<el-tag v-else type="success" size="small">已审批</el-tag>
</template>
</el-table-column>
</el-table>
<el-row>
<el-col style="width:calc(100% - 600px)">
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
</el-col>
</el-row>
<el-row style="margin: 0;">
<el-col style="width: 300px">
<h4>领料单明细{{ pickingListNumberShow }}</h4>
</el-col>
<el-col style="float:left;width: 200px;margin-top:15px">
<el-button :disabled="SELECTION.length===0" size="small" type="warning" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="SELECTION.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
</el-col>
</el-row>
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="400" @selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" type="selection" align="center" width="55"/>
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="名称" prop="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" prop="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.图号或型号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" prop="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规格 || '—' }}
</template>
</el-table-column>
<el-table-column label="机床图号" prop="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="总数量" align="center" min-width="40">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="备件数量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column label="货位存量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="已领数量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" width="200">
<template slot-scope="scope">
<el-input-number v-model="scope.row.出库数量" size="mini"/>
</template>
</el-table-column>
<el-table-column v-if="true" label="备料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否备料确认)===1" size="mini" type="success">已备料</el-tag>
<el-tag v-else type="warning" size="mini">未备料</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领料</el-tag>
<el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未领完</el-tag>
<el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领料</el-tag>
</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" width="100" fixed="right">-->
<!--<template slot-scope="scope">-->
<!--<el-button :disabled="Number(scope.row.出库数量)<=0" size="mini" icon="el-icon-back" plain type="primary" @click="sendBack(scope.row)">归还</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
</el-card>
<!--<el-card>-->
<!--<el-row>-->
<!--<el-col :span="12">-->
<!--<h4 style="margin-top:0">物料货位数量信息</h4>-->
<!--</el-col>-->
<!--<el-col :span="12">-->
<!--占用数量{{ 占用数量 }}-->
<!--</el-col>-->
<!--</el-row>-->
<!--<el-table :data="StockNumberTable" border stripe style="width: 100%;" size="mini" height="300" show-summary>-->
<!--<el-table-column label="序号" align="center" type="index" width="50"/>-->
<!--<el-table-column label="名称" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料名称 || scope.row.零件名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="图号或型号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="规格" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料规格 || scope.row.规格 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="仓库名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.仓库名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位存量" align="center" min-width="70" prop="货位存量">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位存量 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="机床图号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.机床图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="组号" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.组号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="操作" align="center" width="200px">-->
<!--<template slot-scope="scope" align="center">-->
<!--<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>-->
<!--<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>--><!--</el-card>-->
<div style="width: 26%;float: left;margin-right: 16px">
<el-card>
<el-table :data="pickListTable1" :row-class-name="tableRowClassName" class="shenpi" highlight-current-row border size="mini" width="100%" height="730px" @row-click="clickList">
<el-table-column prop="领料单编号" label="领料单编号" align="center" min-width="100px">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
<el-table-column label="领料人" prop="领料人" align="center" min-width="90px">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="备注" prop="备注" align="center" min-width="130px">
<template slot-scope="scope">
{{ scope.row.领料单备注 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:left;margin: 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
</el-card>
</div>
<div style="width: 72.5%;float: left">
<el-card>
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="780">
<el-table-column label="名称" prop="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" prop="图号或型号" align="center" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" prop="规格" align="center" min-width="200" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.规格 || '—' }}
</template>
</el-table-column>
<el-table-column label="机床图号" prop="机床图号" align="center" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="领用数" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="备件数" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column label="库存数" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="已领数" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column label="出库数" align="center" min-width="120">
<template slot-scope="scope">
<el-input-number :disabled="Number(scope.row.总数量) <= Number(scope.row.出库数量1)" v-model="scope.row.出库数量" size="mini" style="width: 100%"/>
</template>
</el-table-column>
<el-table-column v-if="true" label="备料确认" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否备料确认)===1" size="mini" type="success">已备料</el-tag>
<el-tag v-else type="warning" size="mini">未备料</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领料</el-tag>
<el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未领完</el-tag>
<el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领料</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="物料出库" center width="380px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
@@ -312,7 +230,7 @@
</template>
<script>
import { sendBack, initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, updateRemark, errorRecord, searchStockNumber3, initOutType, pickingSubmit } from '@/api/Inventory/MaterialOut'
import { sendBack, initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, submitOutStore, initOutType } from '@/api/Inventory/MaterialOut'
import { mapGetters } from 'vuex'
import request from '@/utils/request'
export default {
@@ -326,7 +244,7 @@ export default {
pickingListNumberShow: '',
pickListTable1: [],
pageCurrent3: 1,
pageSize3: 20,
pageSize3: 40,
total3: 0,
pickListTable2: [],
StockNumberTable: [],
@@ -474,22 +392,12 @@ export default {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogFormVisible4 = false
this.clickListDetail()
this.clickList()
} else {
this.$message.error('操作失败')
}
})
},
UpdateRemark(row) {
updateRemark(row.领料单明细流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
}
})
},
// 备料确认
prepareConfirm() {
this.$confirm('是否备料确认?', '提示', {
@@ -528,45 +436,6 @@ export default {
console.log(row)
return ((Number(row.总数量) <= Number(row.出库数量1))) === false
},
// 提交领料确认
pickConfirm() {
this.$confirm('是否领料确认?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单明细 set 是否领料确认 = 1 where 领料单明细流水号 in (${this.multipleSelection})`
}
}
pickingSubmit(this.pickingPersonNum, this.form3.password).then(res => {
if (res.data[0].result === 'success') {
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogFormVisible3 = false
this.clickList()
} else {
this.$message.error('操作失败')
}
})
} else if (res.data[0].result === 'error') {
this.$message.error('密码错误')
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 初始化数据
fetchData() {
this.person = []
@@ -648,6 +517,13 @@ export default {
console.log(this.pickListTable2, 111)
})
},
tableRowClassName({ row }) {
if (parseInt(row.是否审批) === 1) {
return 'shenpi-row'
} else {
return ''
}
},
// 多选
handleSelectionChange(val) {
console.log(val)
@@ -655,16 +531,18 @@ export default {
},
// 提交领料确认
pickConfirm1() {
for (let i = 0; i < this.SELECTION.length; i++) {
this.multipleSelection.push(this.SELECTION[i].领料单明细流水号)
this.basePartNum.push(this.SELECTION[i].基本件流水号)
this.materialNum.push(this.SELECTION[i].物料流水号)
this.parchasePartNum.push(this.SELECTION[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.SELECTION[i].请购单明细流水号)
this.groupNumValue.push(this.SELECTION[i].组件流水号)
this.machineValue.push(this.SELECTION[i].机床流水号)
this.offlineNum.push(this.SELECTION[i].离线采购件流水号)
this.outNumber.push(this.SELECTION[i].出库数量)
for (let i = 0; i < this.pickListTable2.length; i++) {
if (this.pickListTable2[i].出库数量 !== 0) {
this.multipleSelection.push(this.pickListTable2[i].领料单明细流水号)
this.basePartNum.push(this.pickListTable2[i].基本件流水号)
this.materialNum.push(this.pickListTable2[i].物料流水号)
this.parchasePartNum.push(this.pickListTable2[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.pickListTable2[i].请购单明细流水号)
this.groupNumValue.push(this.pickListTable2[i].组件流水号)
this.machineValue.push(this.pickListTable2[i].机床流水号)
this.offlineNum.push(this.pickListTable2[i].离线采购件流水号)
this.outNumber.push(this.pickListTable2[i].出库数量)
}
}
submitOutStore(this.multipleSelection, this.basePartNum, this.materialNum, this.parchasePartNum, this.purchaseBillNum, this.groupNumValue, this.machineValue, this.outNumber, this.id, this.form3.password, this.form3.outTypeValue, this.pickingListNum, this.offlineNum).then(response => {
if (response.data[0].result === '1') {
@@ -684,53 +562,6 @@ export default {
} else { this.$message.error('操作失败') }
})
},
// 查看领料单明细相关的物料货位数量
clickListDetail(row) {
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = null) : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.purchaseBillNum
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
if (this.materialNum) {
searchStockNumber1(this.materialNum).then(res => {
this.StockNumberTable = res.data
})
} else if (this.basePartNum) {
searchStockNumber2(this.basePartNum).then(res => {
this.StockNumberTable = res.data
})
} else if (this.purchaseBillNum) {
searchStockNumber3(this.purchaseBillNum).then(res => {
this.StockNumberTable = res.data
})
}
},
// 出库
outStore(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.machineValue = this.machineValue
this.inventoryNum = row.仓库流水号
this.locationNum = row.货位流水号
this.outNumber > row.货位存量 ? (this.form1.outNumber = row.货位存量, this.form1.outNumberMax = row.货位存量) : (this.form1.outNumber = this.outNumber, this.form1.outNumberMax = this.outNumber) // 货位存量和领料数量对比取小
this.form1.personValue = Number(this.id)
this.group = []
this.form1.groupNumValue = ''
searchgroup(this.form1.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
label: response.data[i].组号,
value: Number(response.data[i].组件流水号)
})
}
}).then(() => {
this.form1.groupNumValue = this.groupNumValue
this.dialogFormVisible1 = true
})
},
// 提交出库
submitOutStore() {
this.$refs['form1'].validate((valid) => {
@@ -741,7 +572,6 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible1 = false
this.clickListDetail()
this.clickList()
} else { this.$message.error('操作失败') }
})
@@ -749,33 +579,6 @@ export default {
return false
}
})
},
// 异常记录
errorRecord(row) {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.form2.errorNumber = ''
this.form2.reason = ''
this.form2.物料流水号 = row.物料流水号
this.form2.基本件流水号 = row.基本件流水号
this.form2.货位流水号 = row.货位流水号
this.dialogFormVisible2 = true
},
// 提交异常记录
submitErrorRecord() {
this.$refs['form2'].validate((valid) => {
if (valid) {
errorRecord(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.货位流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('记录成功')
this.dialogFormVisible2 = false
} else { this.$message.error('操作失败') }
})
} else {
return false
}
})
}
}
}
@@ -795,3 +598,8 @@ export default {
margin: 0
}
</style>
<style>
.el-table .shenpi-row {
background: #9BD7FC !important;
}
</style>