采购库存
This commit is contained in:
@@ -185,6 +185,15 @@
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类别" prop="outTypeValue" label-width="100px">
|
||||
<el-select v-model="form1.outTypeValue" size="small" placeholder="出库类别" style="width: 200px;margin-right:10px">
|
||||
<el-option
|
||||
v-for="item in outType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible1=false">取消</el-button>
|
||||
@@ -210,12 +219,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord } from '@/api/Inventory/MaterialOut'
|
||||
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord, searchStockNumber3, initOutType } from '@/api/Inventory/MaterialOut'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'MaterialOut',
|
||||
data() {
|
||||
return {
|
||||
pickingListNum: '', // 领料单流水号
|
||||
pickingPersonNum: '', // 领料人流水号
|
||||
pickingListNumber: '',
|
||||
pickingListNumberShow: '',
|
||||
pickListTable1: [],
|
||||
@@ -226,12 +237,14 @@ export default {
|
||||
StockNumberTable: [],
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
outType: [],
|
||||
form1: {
|
||||
machineValue: '',
|
||||
groupNumValue: '',
|
||||
outNumber: '',
|
||||
outNumberMax: '', // 出库最大值
|
||||
personValue: ''
|
||||
personValue: '',
|
||||
outTypeValue: '' // 出库类别
|
||||
},
|
||||
form2: {
|
||||
errorNumber: '',
|
||||
@@ -244,7 +257,8 @@ export default {
|
||||
machineValue: [{ required: true, message: '请选择' }],
|
||||
groupNumValue: [{ required: true, message: '请选择' }],
|
||||
outNumber: [{ required: true, message: '请输入' }],
|
||||
personValue: [{ required: true, message: '请输入' }]
|
||||
personValue: [{ required: true, message: '请输入' }],
|
||||
outTypeValue: [{ required: true, message: '请选择' }] // 出库类别
|
||||
},
|
||||
rules2: {
|
||||
errorNumber: [{ required: true, message: '请输入' }],
|
||||
@@ -256,8 +270,10 @@ export default {
|
||||
materialNum: '', // 中间变量物料流水号
|
||||
machineValue: '', // 中间变量机床流水号
|
||||
groupNumValue: '', // 中间变量组件流水号
|
||||
basePartNum: '', // 中间变量基本件流水u和
|
||||
basePartNum: '', // 中间变量基本件流水号
|
||||
purchaseBillNum: '', // 中间变量请购单明细流水号
|
||||
parchasePartNum: '', // 中间变量标准件和外购件流水号
|
||||
inventoryNum: '', // 中间变量仓库流水号
|
||||
locationNum: '', // 中间变量货位流水号
|
||||
outNumber: 0 // 中间变量出库数量
|
||||
}
|
||||
@@ -293,6 +309,14 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
initOutType().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.outType.push({
|
||||
label: response.data[i].出库类别名称,
|
||||
value: response.data[i].出库类别流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询组号
|
||||
searchGroup() {
|
||||
@@ -328,6 +352,7 @@ export default {
|
||||
// 查看领料单明细
|
||||
clickList(row) {
|
||||
row && row.领料单流水号 ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
|
||||
row && row.人员编号 ? this.pickingPersonNum = row.人员编号 : this.pickingListNum
|
||||
row && row.领料单编号 ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
|
||||
searchListDetail(this.pickingListNum).then(res => {
|
||||
this.pickListTable2 = res.data
|
||||
@@ -335,9 +360,10 @@ export default {
|
||||
},
|
||||
// 查看领料单明细相关的物料货位数量
|
||||
clickListDetail(row) {
|
||||
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.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.parchasePartNum
|
||||
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
|
||||
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
|
||||
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
|
||||
@@ -349,6 +375,10 @@ export default {
|
||||
searchStockNumber2(this.basePartNum).then(res => {
|
||||
this.StockNumberTable = res.data
|
||||
})
|
||||
} else if (this.purchaseBillNum) {
|
||||
searchStockNumber3(this.purchaseBillNum).then(res => {
|
||||
this.StockNumberTable = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
// 出库
|
||||
@@ -357,6 +387,7 @@ export default {
|
||||
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)
|
||||
@@ -380,7 +411,7 @@ export default {
|
||||
if (valid) {
|
||||
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
|
||||
// 物料流水号,货位流水号,出库数量 => 减掉货位物料数
|
||||
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, this.purchaseBillNum, this.pickingListNum, this.pickingPersonNum, this.inventoryNum, this.form1.outTypeValue).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('出库成功')
|
||||
this.dialogFormVisible1 = false
|
||||
|
||||
Reference in New Issue
Block a user