This commit is contained in:
zhangdingyu
2019-03-22 16:40:03 +08:00
2 changed files with 58 additions and 56 deletions

View File

@@ -12,14 +12,14 @@ export function initProject() {
}) })
} }
// 机床查询 // 机床查询
export function searchmachine(check, num) { export function searchmachine(num) {
return request({ return request({
url: '', url: '',
method: 'post', method: 'post',
data: { data: {
type: '1', type: '1',
name: 'PDM_机床名称_查询数据', name: 'PDM_机床名称_查询数据',
param: '项目流水号_check=' + check + '&项目流水号=' + num param: '项目流水号_check=1&项目流水号=' + num
} }
}) })
} }

View File

@@ -66,21 +66,6 @@
<el-card> <el-card>
<el-table v-loading="listLoading1" :data="tableDataOut" size="mini" border style="width: 100%;" height="250"> <el-table v-loading="listLoading1" :data="tableDataOut" size="mini" border style="width: 100%;" height="250">
<el-table-column label="序号" align="center" type="index" width="50"/> <el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="项目名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="80"> <el-table-column label="物料名称" align="center" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.物料名称 }} {{ scope.row.物料名称 }}
@@ -106,6 +91,21 @@
{{ scope.row.出库时间 }} {{ scope.row.出库时间 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="80"> <el-table-column label="备注" align="center" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.备注 }} {{ scope.row.备注 }}
@@ -116,8 +116,8 @@
<!--零件出库对话框--> <!--零件出库对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px"> <el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left"> <el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="项目" prop="TotalContractAmount" label-width="100px"> <el-form-item label="项目" prop="ProjectValue" label-width="100px">
<el-select v-model="form.ProjectValue" filterable clearable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()"> <el-select v-model="form.ProjectValue" filterable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option <el-option
v-for="item in Project" v-for="item in Project"
:key="item.value" :key="item.value"
@@ -125,8 +125,8 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="机床" prop="TotalContractAmount" label-width="100px"> <el-form-item label="机床" prop="MachineValue" label-width="100px">
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroupList()"> <el-select v-model="form.MachineValue" filterable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option <el-option
v-for="item in Machine" v-for="item in Machine"
:key="item.value" :key="item.value"
@@ -134,8 +134,8 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分组" prop="TotalContractAmount" label-width="100px"> <el-form-item label="分组" prop="GroupNumValue" label-width="100px">
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="分组" style="width: 200px;margin-right:10px"> <el-select v-model="form.GroupNumValue" filterable clearable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
<el-option <el-option
v-for="item in GroupNum" v-for="item in GroupNum"
:key="item.value" :key="item.value"
@@ -143,11 +143,11 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small"> <el-form-item label="出库数量" prop="DirectNumber" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="出库数量" style="width: 200px"/> <el-input v-model="form.DirectNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item> </el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px"> <el-form-item label="出库人" prop="PeopleValue" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px"> <el-select v-model="form.PeopleValue" :disabled="true" size="small" style="width: 200px;margin-right:10px">
<el-option <el-option
v-for="item in People" v-for="item in People"
:key="item.value" :key="item.value"
@@ -155,7 +155,7 @@
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" label-width="100px"> <el-form-item label="备注" label-width="100px">
<el-input v-model="form.DirectNote" size="small" placeholder="请输入备注" style="width: 200px"/> <el-input v-model="form.DirectNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -174,26 +174,23 @@ export default {
data() { data() {
return { return {
Project: [], Project: [],
ProjectValue_check: 1,
MachineValue: '',
Machine: [], Machine: [],
MachineValue_check: 1,
GroupNumValue: '',
GroupNumValue_check: 1,
GroupNum: [], GroupNum: [],
tableDataBasic: [], tableDataBasic: [],
People: [], People: [],
PeopleValue: '',
dialogFormVisible: false, dialogFormVisible: false,
form: { form: {
ProjectValue: '', ProjectValue: '',
MachineValue: '',
GroupNumValue: '',
DirectNumber: '', DirectNumber: '',
PeopleValue: '',
DirectNote: '' DirectNote: ''
}, },
rules: { // 表单验证规则 rules: { // 表单验证规则
ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }], ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }],
DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }], MachineValue: [{ required: true, message: '请选择机床', trigger: 'blur' }],
DirectNote: [{ required: true, message: '请输入直达件备注', trigger: 'change' }] DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }]
}, },
contractNumber: '', contractNumber: '',
locateNumber: '', locateNumber: '',
@@ -232,14 +229,11 @@ export default {
this.PeopleNumber = this.id this.PeopleNumber = this.id
}, },
searchMachine() { // 查询机床 searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
this.Machine = [] this.Machine = []
this.MachineValue = '' this.form.MachineValue = ''
this.GroupNum = [] this.GroupNum = []
this.GroupNumValue = '' this.form.GroupNumValue = ''
searchmachine(this.ProjectValue_check, this.form.ProjectValue).then(response => { searchmachine(this.form.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.Machine.push({ this.Machine.push({
label: response.data[i].机床图号, label: response.data[i].机床图号,
@@ -250,8 +244,8 @@ export default {
}, },
searchGroupList() { // 查询组号 searchGroupList() { // 查询组号
this.GroupNum = [] this.GroupNum = []
this.GroupNumValue = '' this.form.GroupNumValue = ''
searchTeam(this.MachineValue).then(response => { searchTeam(this.form.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({ this.GroupNum.push({
label: response.data[i].组号, label: response.data[i].组号,
@@ -269,7 +263,6 @@ export default {
this.materialSpec ? check2 = 1 : check2 = 0 this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0 this.materialModel ? check3 = 1 : check3 = 0
searchPart(check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.pageCurrent1, this.pageSize1).then(response => { searchPart(check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.pageCurrent1, this.pageSize1).then(response => {
console.log(response.data)
this.tableDataBasic = response.data.rows this.tableDataBasic = response.data.rows
this.total1 = response.data.total this.total1 = response.data.total
this.listLoading = false this.listLoading = false
@@ -295,9 +288,12 @@ export default {
}, },
// 打开表单 // 打开表单
parOut(row) { parOut(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form = {} this.form = {}
this.MachineValue = '' this.form.MachineValue = ''
this.GroupNumValue = '' this.form.GroupNumValue = ''
this.dialogFormVisible = true this.dialogFormVisible = true
this.contractNumber = row.离线合同明细流水号 this.contractNumber = row.离线合同明细流水号
this.locateNumber = row.货位流水号 this.locateNumber = row.货位流水号
@@ -326,20 +322,26 @@ export default {
if (this.partnumber < this.form.DirectNumber) { if (this.partnumber < this.form.DirectNumber) {
this.$message.error('请正确输入数量') this.$message.error('请正确输入数量')
} else { } 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 => { this.$refs['form'].validate((valid) => {
if (response.data[0].result === '1') { if (valid) {
this.$message.success('零件出库成功') outlinePartOut(this.contractNumber, this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber).then(response => {
this.dialogFormVisible = false if (response.data[0].result === '1') {
this.searchTable1() this.$message.success('零件出库成功')
outRecord(this.contractNumber).then(response => { this.dialogFormVisible = false
this.tableDataOut = response.data this.searchTable1()
this.listLoading1 = false outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
})
} else {
this.$message.error('零件出库失败')
}
}) })
} else { } else {
this.$message.error('零件出库失败') console.log('error submit!!')
return false
} }
}) })
this.dialogFormVisible = false
} }
} }
} }