This commit is contained in:
chenjianan
2019-01-29 15:29:23 +08:00
parent 547be03325
commit f2601e7c4e
2 changed files with 150 additions and 143 deletions

View File

@@ -36,13 +36,14 @@ export function searchTeam(machineNumber) {
})
}
// 初始化物料
export function searchPart() {
export function searchPart(data1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_离线外购件_出库查询'
name: '库存管理_离线外购件_出库查询',
param: '离线合同编号=' + data1
}
})
}

View File

@@ -1,5 +1,10 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">离线合同编号</span>
<el-input v-model="offlineContract" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPurchasePartinfo()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
@@ -152,156 +157,157 @@
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPart, searchPeople, outlinePartOut, outRecord } from '@/api/Inventory/OfflinePartOut'
import { mapGetters } from 'vuex'
export default {
data() {
return {
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
People: [],
PeopleValue: '',
dialogFormVisible: false,
form: {
ProjectValue: '',
DirectNumber: '',
DirectNote: ''
},
rules: { // 表单验证规则
ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }],
DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }],
DirectNote: [{ required: true, message: '请输入直达件备注', trigger: 'change' }]
},
contractNumber: '',
locateNumber: '',
materialNumber: '',
PeopleNumber: '',
tableDataOut: [],
listLoading: '',
listLoading1: '',
partnumber: ''
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchPurchasePartinfo()
this.fetchData()
this.searchPeopleData()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
import { initProject, searchmachine, searchTeam, searchPart, searchPeople, outlinePartOut, outRecord } from '@/api/Inventory/OfflinePartOut'
import { mapGetters } from 'vuex'
export default {
data() {
return {
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
People: [],
PeopleValue: '',
dialogFormVisible: false,
form: {
ProjectValue: '',
DirectNumber: '',
DirectNote: ''
},
rules: { // 表单验证规则
ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }],
DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }],
DirectNote: [{ required: true, message: '请输入直达件备注', trigger: 'change' }]
},
contractNumber: '',
locateNumber: '',
materialNumber: '',
PeopleNumber: '',
tableDataOut: [],
listLoading: '',
listLoading1: '',
partnumber: '',
offlineContract: null // 离线合同编号
}
searchmachine(this.ProjectValue_check, this.form.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchPurchasePartinfo()
this.fetchData()
this.searchPeopleData()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
})
},
searchGroupList() { // 查询组号
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组件名称,
value: response.data[i].组件流水号
})
}
})
},
// 离线件查询
searchPurchasePartinfo() {
this.listLoading = true
this.tableDataBasic = []
searchPart().then(response => {
this.tableDataBasic = response.data
this.listLoading = false
})
},
// 离线记录查询
searchoutRecord(row) {
this.contractNumber = row.离线合同明细流水号
this.listLoading1 = true
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
})
},
// 打开表单
parOut(row) {
this.form = []
this.MachineValue = ''
this.GroupNumValue = ''
this.dialogFormVisible = true
this.contractNumber = row.离线合同明细流水号
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
this.searchoutRecord()
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNumberx = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
},
searchPeopleData() { // 查询人员
searchPeople(this.token).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
// 离线外购件出库
addDirectPartm() {
if (this.partnumber < this.form.DirectNumber) {
this.$message.error('请正确输入数量')
} else {
outlinePartOut(this.contractNumber, this.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.MachineValue, this.GroupNumValue, this.materialNumber, this.PeopleNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchPurchasePartinfo()
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
searchmachine(this.ProjectValue_check, this.form.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
} else {
this.$message.error('零件出库失败')
}
})
},
searchGroupList() { // 查询组号
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组件名称,
value: response.data[i].组件流水号
})
}
})
},
// 离线件查询
searchPurchasePartinfo() {
this.listLoading = true
this.tableDataBasic = []
searchPart(this.offlineContract).then(response => {
this.tableDataBasic = response.data
this.listLoading = false
})
},
// 离线记录查询
searchoutRecord(row) {
this.contractNumber = row.离线合同明细流水号
this.listLoading1 = true
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
})
},
// 打开表单
parOut(row) {
this.form = []
this.MachineValue = ''
this.GroupNumValue = ''
this.dialogFormVisible = true
this.contractNumber = row.离线合同明细流水号
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
this.searchoutRecord()
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNumberx = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
},
searchPeopleData() { // 查询人员
searchPeople(this.token).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
// 离线外购件出库
addDirectPartm() {
if (this.partnumber < this.form.DirectNumber) {
this.$message.error('请正确输入数量')
} else {
outlinePartOut(this.contractNumber, this.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.MachineValue, this.GroupNumValue, this.materialNumber, this.PeopleNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchPurchasePartinfo()
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
})
} else {
this.$message.error('零件出库失败')
}
})
this.dialogFormVisible = false
}
}
}
}
}
</script>
<style scoped>