物料出库
This commit is contained in:
@@ -95,3 +95,15 @@ export function submitOutStore(...params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 出库
|
||||||
|
export function errorRecord(...params) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '2',
|
||||||
|
name: '库存管理_物料出库_异常记录_增加数据',
|
||||||
|
param: `异常数量=${params[0]}&异常原因=${params[1]}&物料流水号=${params[2]}&基本件流水号=${params[3]}&货位流水号=${params[4]}}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="出库数量" prop="outNumber" label-width="100px" size="small">
|
<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>
|
||||||
<el-form-item label="出库人" prop="personValue" label-width="100px">
|
<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">
|
<el-select v-model="form1.personValue" :disabled="true" size="small" style="width: 200px;margin-right:10px">
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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'
|
import { mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterialOut',
|
name: 'MaterialOut',
|
||||||
@@ -230,6 +230,7 @@ export default {
|
|||||||
machineValue: '',
|
machineValue: '',
|
||||||
groupNumValue: '',
|
groupNumValue: '',
|
||||||
outNumber: '',
|
outNumber: '',
|
||||||
|
outNumberMax: '', // 出库最大值
|
||||||
personValue: ''
|
personValue: ''
|
||||||
},
|
},
|
||||||
form2: {
|
form2: {
|
||||||
@@ -237,7 +238,6 @@ export default {
|
|||||||
reason: '',
|
reason: '',
|
||||||
物料流水号: '',
|
物料流水号: '',
|
||||||
基本件流水号: '',
|
基本件流水号: '',
|
||||||
仓库流水号: '',
|
|
||||||
货位流水号: ''
|
货位流水号: ''
|
||||||
},
|
},
|
||||||
rules1: {
|
rules1: {
|
||||||
@@ -335,9 +335,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 查看领料单明细相关的物料货位数量
|
// 查看领料单明细相关的物料货位数量
|
||||||
clickListDetail(row) {
|
clickListDetail(row) {
|
||||||
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = '', this.parchasePartNum = '') : this.basePartNum
|
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null) : this.basePartNum
|
||||||
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = '') : this.materialNum
|
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null) : this.materialNum
|
||||||
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = '') : this.parchasePartNum
|
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null) : this.parchasePartNum
|
||||||
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
|
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
|
||||||
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
|
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
|
||||||
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
|
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
|
||||||
@@ -346,7 +346,6 @@ export default {
|
|||||||
this.StockNumberTable = res.data
|
this.StockNumberTable = res.data
|
||||||
})
|
})
|
||||||
} else if (this.basePartNum) {
|
} else if (this.basePartNum) {
|
||||||
console.log(this.basePartNum)
|
|
||||||
searchStockNumber2(this.basePartNum).then(res => {
|
searchStockNumber2(this.basePartNum).then(res => {
|
||||||
this.StockNumberTable = res.data
|
this.StockNumberTable = res.data
|
||||||
})
|
})
|
||||||
@@ -354,13 +353,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 出库
|
// 出库
|
||||||
outStore(row) {
|
outStore(row) {
|
||||||
console.log(this.form1.machineValue, this.form1.groupNumValue, row, this.id)
|
|
||||||
if (this.$refs['form1'] !== undefined) {
|
if (this.$refs['form1'] !== undefined) {
|
||||||
this.$refs['form1'].resetFields()
|
this.$refs['form1'].resetFields()
|
||||||
}
|
}
|
||||||
this.form1.machineValue = this.machineValue
|
this.form1.machineValue = this.machineValue
|
||||||
this.locationNum = row.货位流水号
|
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.form1.personValue = Number(this.id)
|
||||||
this.group = []
|
this.group = []
|
||||||
this.form1.groupNumValue = ''
|
this.form1.groupNumValue = ''
|
||||||
@@ -381,8 +379,7 @@ export default {
|
|||||||
this.$refs['form1'].validate((valid) => {
|
this.$refs['form1'].validate((valid) => {
|
||||||
if (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 => {
|
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.$message.success('出库成功')
|
this.$message.success('出库成功')
|
||||||
@@ -405,7 +402,6 @@ export default {
|
|||||||
this.form2.reason = ''
|
this.form2.reason = ''
|
||||||
this.form2.物料流水号 = row.物料流水号
|
this.form2.物料流水号 = row.物料流水号
|
||||||
this.form2.基本件流水号 = row.基本件流水号
|
this.form2.基本件流水号 = row.基本件流水号
|
||||||
this.form2.仓库流水号 = row.仓库流水号
|
|
||||||
this.form2.货位流水号 = row.货位流水号
|
this.form2.货位流水号 = row.货位流水号
|
||||||
this.dialogFormVisible2 = true
|
this.dialogFormVisible2 = true
|
||||||
},
|
},
|
||||||
@@ -413,9 +409,12 @@ export default {
|
|||||||
submitErrorRecord() {
|
submitErrorRecord() {
|
||||||
this.$refs['form2'].validate((valid) => {
|
this.$refs['form2'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.仓库流水号, this.form2.货位流水号)
|
errorRecord(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.货位流水号).then(response => {
|
||||||
this.dialogFormVisible2 = false
|
if (response.data[0].result === '1') {
|
||||||
this.$message.success('记录成功')
|
this.$message.success('记录成功')
|
||||||
|
this.dialogFormVisible2 = false
|
||||||
|
} else { this.$message.error('操作失败') }
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user