物料出库
This commit is contained in:
@@ -71,3 +71,15 @@ export function searchStockNumber(...params) {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 出库
|
||||
export function submitOutStore(...params) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '库存管理_物料出库_出库记录_增加数据',
|
||||
param: `出库数量=${params[0]}&出库人流水号=${params[1]}&基本件流水号=${params[2]}&标准件和外购件流水号=${params[3]}`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="领回确认" align="center" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.是否启用)===1" type="warning">未确认</el-tag>
|
||||
<el-tag v-else type="success">已确认</el-tag>
|
||||
<el-tag v-if="Number(scope.row.是否启用)===1" type="warning" size="small">未确认</el-tag>
|
||||
<el-tag v-else type="success" size="small">已确认</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -47,7 +47,7 @@
|
||||
@current-change="handleCurrentChange3"/>
|
||||
</div>
|
||||
<h4>领料单明细:{{ pickingListNumberShow }}</h4>
|
||||
<el-table :data="pickListTable2" highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickListDetail">
|
||||
<el-table :data="pickListTable2" highlight-current-row border style="width: 100%;" size="mini" height="400" @row-click="clickListDetail">
|
||||
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||
<el-table-column label="名称" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
@@ -86,7 +86,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="已领数量" align="center" min-width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备件数量 }}
|
||||
{{ scope.row.出库数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -148,7 +148,7 @@
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="物料出库" center width="380px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
|
||||
<el-form-item label="机床" prop="machineValue" label-width="100px">
|
||||
<el-select v-model="form1.machineValue" filterable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroup()">
|
||||
<el-select v-model="form1.machineValue" :disabled="true" filterable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroup()">
|
||||
<el-option
|
||||
v-for="item in machine"
|
||||
:key="item.value"
|
||||
@@ -160,7 +160,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分组" prop="groupNumValue" label-width="100px">
|
||||
<el-select v-model="form1.groupNumValue" filterable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
|
||||
<el-select v-model="form1.groupNumValue" :disabled="true" filterable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
|
||||
<el-option
|
||||
v-for="item in group"
|
||||
:key="item.value"
|
||||
@@ -208,7 +208,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber } from '@/api/Inventory/MaterialOut'
|
||||
import { initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber, submitOutStore } from '@/api/Inventory/MaterialOut'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'MaterialOut',
|
||||
@@ -233,7 +233,11 @@ export default {
|
||||
},
|
||||
form2: {
|
||||
errorNumber: '',
|
||||
reason: ''
|
||||
reason: '',
|
||||
物料流水号: '',
|
||||
基本件流水号: '',
|
||||
仓库流水号: '',
|
||||
货位流水号: ''
|
||||
},
|
||||
rules1: {
|
||||
machineValue: [{ required: true, message: '请选择' }],
|
||||
@@ -248,7 +252,13 @@ export default {
|
||||
},
|
||||
machine: [],
|
||||
group: [],
|
||||
person: []
|
||||
person: [],
|
||||
materialNum: '', // 中间变量
|
||||
machineValue: '', // 中间变量
|
||||
groupNumValue: '', // 中间变量
|
||||
basePartNum: '', // 中间变量
|
||||
parchasePartNum: '', // 中间变量
|
||||
outNumber: 0 // 中间变量
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -283,6 +293,19 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询组号
|
||||
searchGroup() {
|
||||
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].组件流水号)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询领料单列表
|
||||
searchList() {
|
||||
let check
|
||||
@@ -312,65 +335,79 @@ export default {
|
||||
// 查看领料单明细相关的物料货位数量
|
||||
clickListDetail(row) {
|
||||
console.log(row)
|
||||
if (row.物料流水号) {
|
||||
searchStockNumber(row.物料流水号).then(res => {
|
||||
row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = '', this.parchasePartNum = '') : this.basePartNum
|
||||
row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = '') : this.materialNum
|
||||
row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = '') : this.parchasePartNum
|
||||
this.machineValue = row.机床流水号
|
||||
this.groupNumValue = row.组件流水号
|
||||
this.outNumber = row.总数量
|
||||
if (this.materialNum) {
|
||||
searchStockNumber(this.materialNum).then(res => {
|
||||
this.StockNumberTable = res.data
|
||||
})
|
||||
} else if (row.基本件流水号) {
|
||||
console.log(row.基本件流水号)
|
||||
} else if (this.basePartNum) {
|
||||
console.log(this.basePartNum)
|
||||
}
|
||||
},
|
||||
// 查询组号
|
||||
searchGroup() {
|
||||
// 出库
|
||||
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.group = []
|
||||
this.form1.GroupNumValue = ''
|
||||
searchgroup(this.form1.MachineValue).then(response => {
|
||||
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.form1.outNumber = this.outNumber
|
||||
this.form1.personValue = Number(this.id)
|
||||
this.dialogFormVisible1 = true
|
||||
})
|
||||
},
|
||||
// 出库
|
||||
outStore(row) {
|
||||
console.log(row, this.id)
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
row.机床流水号 ? this.form1.machineValue = row.机床流水号 : this.form1.machineValue = null
|
||||
row.组件流水号 ? this.form1.groupNumValue = row.组件流水号 : this.form1.groupNumValue = null
|
||||
this.form1.outNumber = 0
|
||||
this.form1.personValue = Number(this.id)
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 提交出库
|
||||
submitOutStore() {
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.form1.machineValue, this.form1.groupNumValue, this.form1.outNumber, this.form1.personValue)
|
||||
this.dialogFormVisible1 = false
|
||||
this.$message.success('出库成功')
|
||||
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
|
||||
submitOutStore(this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('出库成功')
|
||||
this.dialogFormVisible1 = false
|
||||
this.clickListDetail()
|
||||
this.clickList()
|
||||
} else { this.$message.error('操作失败') }
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 异常记录
|
||||
errorRecord() {
|
||||
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.form2.货位流水号 = row.货位流水号
|
||||
this.dialogFormVisible2 = true
|
||||
},
|
||||
// 提交异常记录
|
||||
submitErrorRecord() {
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.form2.errorNumber, this.form2.reason)
|
||||
console.log(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.仓库流水号, this.form2.货位流水号)
|
||||
this.dialogFormVisible2 = false
|
||||
this.$message.success('记录成功')
|
||||
} else {
|
||||
|
||||
@@ -214,7 +214,7 @@ export default {
|
||||
fax2: '',
|
||||
postCode2: '',
|
||||
hasTax: '含税',
|
||||
taxRate: 0.16,
|
||||
taxRate: 0.13,
|
||||
preview: false, // 预览
|
||||
demoRadio: '', // 模板radio
|
||||
content: ``, // 合同格式模板
|
||||
|
||||
Reference in New Issue
Block a user