物料出库

This commit is contained in:
chenjianan
2019-06-04 15:16:41 +08:00
parent b68621185b
commit d77a06e03f
2 changed files with 26 additions and 15 deletions

View File

@@ -174,7 +174,7 @@
</el-select>
</el-form-item>
<el-form-item label="出库数量" prop="outNumber" label-width="100px" size="small">
<el-input-number v-model="form1.outNumber" :min="0.01" :precision="2" size="small" placeholder="出库数量" style="width: 200px"/>
<el-input-number v-model="form1.outNumber" :min="0.01" :max="form1.outNumberMax" :precision="2" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库人" prop="personValue" label-width="100px">
<el-select v-model="form1.personValue" :disabled="true" size="small" style="width: 200px;margin-right:10px">
@@ -210,7 +210,7 @@
</template>
<script>
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore } from '@/api/Inventory/MaterialOut'
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord } from '@/api/Inventory/MaterialOut'
import { mapGetters } from 'vuex'
export default {
name: 'MaterialOut',
@@ -230,6 +230,7 @@ export default {
machineValue: '',
groupNumValue: '',
outNumber: '',
outNumberMax: '', // 出库最大值
personValue: ''
},
form2: {
@@ -237,7 +238,6 @@ export default {
reason: '',
物料流水号: '',
基本件流水号: '',
仓库流水号: '',
货位流水号: ''
},
rules1: {
@@ -335,9 +335,9 @@ export default {
},
// 查看领料单明细相关的物料货位数量
clickListDetail(row) {
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = '', this.parchasePartNum = '') : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = '') : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = '') : this.parchasePartNum
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null) : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null) : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null) : this.parchasePartNum
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
@@ -346,7 +346,6 @@ export default {
this.StockNumberTable = res.data
})
} else if (this.basePartNum) {
console.log(this.basePartNum)
searchStockNumber2(this.basePartNum).then(res => {
this.StockNumberTable = res.data
})
@@ -354,13 +353,12 @@ export default {
},
// 出库
outStore(row) {
console.log(this.form1.machineValue, this.form1.groupNumValue, row, this.id)
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.machineValue = this.machineValue
this.locationNum = row.货位流水号
this.form1.outNumber = this.outNumber
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 = ''
@@ -381,8 +379,7 @@ export default {
this.$refs['form1'].validate((valid) => {
if (valid) {
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
// 物料流水号,货位流水号,出库数量 => 掉货位物料数
console.log(this.materialNum, this.locationNum)
// 物料流水号,货位流水号,出库数量 => 掉货位物料数
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
@@ -405,7 +402,6 @@ export default {
this.form2.reason = ''
this.form2.物料流水号 = row.物料流水号
this.form2.基本件流水号 = row.基本件流水号
this.form2.仓库流水号 = row.仓库流水号
this.form2.货位流水号 = row.货位流水号
this.dialogFormVisible2 = true
},
@@ -413,9 +409,12 @@ export default {
submitErrorRecord() {
this.$refs['form2'].validate((valid) => {
if (valid) {
console.log(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.仓库流水号, this.form2.货位流水号)
this.dialogFormVisible2 = false
this.$message.success('记录成功')
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
}