出库加密

This commit is contained in:
bryan sun
2019-12-13 09:14:26 +08:00
parent 7b21901e25
commit 03b3dbbb0f
5 changed files with 216 additions and 57 deletions

View File

@@ -137,7 +137,7 @@
</div>
</el-card>
<!--零件出库对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="项目" prop="ProjectValue" label-width="100px">
<el-select v-model="form.ProjectValue" filterable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()">
@@ -169,12 +169,33 @@
<!--:value="item.value"/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="领料部门" prop="department" label-width="100px" size="small">
<el-input v-model="form.department" size="small" placeholder="领料部门" style="width: 200px"/>
<!-- <el-form-item label="领料部门" prop="department" label-width="100px" size="small">-->
<!-- <el-input v-model="form.department" size="small" placeholder="领料部门" style="width: 200px"/>-->
<!-- </el-form-item>-->
<el-form-item label="部门" prop="部门" label-width="100px" size="small">
<el-select v-model="form.department" placeholder="请选择部门" size="small" clearable style="width: 200px;" @change="selectLeaders">
<el-option
v-for="item in departments"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="领料人" prop="DirectNote" label-width="100px">
<el-input v-model="form.DirectNote" size="small" placeholder="请输入领料人" style="width: 200px"/>
<el-form-item label="领料人" prop="领料人" label-width="100px" size="small">
<el-select v-model="form.DirectNote" placeholder="请选择领料人" size="small" clearable style="width: 200px;">
<el-option
v-for="item in DirectNotes"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="人员编号" prop="DirectNoteCode" label-width="100px">
<el-input v-model="form.DirectNoteCode" size="small" placeholder="请输入人员编号" style="width: 200px"/>
</el-form-item>
<!-- <el-form-item label="领料人" prop="DirectNote" label-width="100px">-->
<!-- <el-input v-model="form.DirectNote" size="small" placeholder="请输入领料人" style="width: 200px"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
@@ -185,7 +206,7 @@
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPart, searchPeople, outlinePartOut, outRecord } from '@/api/Inventory/OfflinePartOut'
import { initProject, searchmachine, searchTeam, searchPart, searchPeople, outlinePartOut, outRecord, selectdepartment, selectleaders } from '@/api/Inventory/OfflinePartOut'
import { mapGetters } from 'vuex'
export default {
data() {
@@ -208,13 +229,15 @@ export default {
MachineValue: '',
GroupNumValue: '',
department: '',
DirectNumber: '',
DirectNumber: 1,
PeopleValue: '',
DirectNote: ''
DirectNote: '',
DirectNoteCode: ''
},
rules: { // 表单验证规则
ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }],
MachineValue: [{ required: true, message: '请选择机床', trigger: 'blur' }],
DirectNoteCode: [{ required: true, message: '请输入人员编号', trigger: 'blur' }],
// GroupNumValue: [{ required: true, message: '请选择分组', trigger: 'blur' }],
DirectNumber: [
{ required: true, message: '请输入数量', trigger: 'blur' },
@@ -240,6 +263,10 @@ export default {
materialSpec: '', // 物料规格
materialModel: '', // 物料型号
离线合同明细流水号: '',
departments: [],
DirectNotes: [],
department111: '', // 部门参数中间变量
DirectNote111: '', // 人员参数中间变量
组件零件基本件流水号: ''
}
},
@@ -263,6 +290,27 @@ export default {
getpeopleid() {
this.PeopleNumber = this.id
},
selectDepartment() {
selectdepartment().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.departments.push({
label: response.data[i].部门名称,
value: response.data[i].考核部门编号
})
}
})
},
selectLeaders() {
this.DirectNotes = []
selectleaders(this.form.department).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.DirectNotes.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
searchMachine() { // 查询机床
this.Machine = []
this.form.MachineValue = ''
@@ -347,19 +395,22 @@ export default {
},
// 打开表单
parOut(row) {
this.form.department = '装配车间'
this.form.DirectNoteCode = ''
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
this.离线合同明细流水号 = row.离线合同明细流水号
this.组件零件基本件流水号 = row.组件零件基本件流水号
this.departments = []
this.DirectNotes = []
this.selectLeaders()
this.selectDepartment()
this.dialogFormVisible = true
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNumber = 1
this.form.DirectNumberx = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
},
searchPeopleData() { // 查询人员
@@ -379,21 +430,36 @@ export default {
} else {
this.$refs['form'].validate((valid) => {
if (valid) {
outlinePartOut(this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber, this.离线合同明细流水号, this.组件零件基本件流水号, this.form.department).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchTable1()
// 物料流水号查
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
} else {
this.$message.error('零件出库失败')
if (Number(this.form.DirectNoteCode) === Number(this.form.DirectNote)) {
for (let i = 0; i < this.departments.length; i++) {
if (this.form.department === this.departments[i].value) {
this.department111 = this.departments[i].label
}
}
})
for (let i = 0; i < this.DirectNotes.length; i++) {
if (this.form.DirectNote === this.DirectNotes[i].value) {
this.DirectNote111 = this.DirectNotes[i].label
}
}
console.log(this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.DirectNote111, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber, this.离线合同明细流水号, this.组件零件基本件流水号, this.department111, 121221)
outlinePartOut(this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.DirectNote111, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber, this.离线合同明细流水号, this.组件零件基本件流水号, this.department111).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchTable1()
// 物料流水号查
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
} else {
this.$message.error('零件出库失败')
}
})
} else {
this.$message.error('人员编号错误')
}
} else {
console.log('error submit!!')
return false