技术中心部分修改,添加库存系统

This commit is contained in:
hedekun
2018-11-16 09:08:57 +08:00
parent 666c65dd0f
commit 385816311b
49 changed files with 7923 additions and 7 deletions

View File

@@ -0,0 +1,460 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>采购合同:</span>
<el-select v-model="ContractValue" filterable clearable size="small" placeholder="采购合同" style="width: 200px">
<el-option
v-for="item in Contract"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total = 0;pageSize = 10;pageList = 1;searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataPurchase"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="addDirect(scope.row)">直达</el-button>
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="searchDirect(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="directRecord"
border
style="width: 100%;"
height="200">
<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">
<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">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="changeDirect(scope.row)">编辑</el-button>
<el-button size="small" type="danger" icon="el-icon-delete" style="margin: 0 0 0 0px" @click="dropListinfor(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--新增直达件对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="新增直达件" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="到货数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="到货数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" 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>
<el-button type="primary" @click="addDirectPartm()"> </el-button>
</div>
</el-dialog>
<!--编辑直达件对话框-->
<el-dialog :visible.sync="dialogFormVisible1" title="编辑直达件" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="到货数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="到货数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" 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>
<el-button type="primary" @click="editDirectPartm()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchDirectPart, searchPeople, searchContract, addDirectPart, searchDirectRec, editDirectRec, deleteDirectRec } from '@/api/Inventory/DirectPart'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: '',
Project: [],
ProjectValue_check: 1,
MachineValue: '',
Machine: [],
MachineValue_check: 1,
GroupNumValue: '',
GroupNumValue_check: 1,
GroupNum: [],
tableDataPurchase: [],
form: {
DirectNumber: '',
getPeople: '',
DirectNote: ''
},
PeopleValue: '',
People: [],
Contract: [],
ContractValue: '',
ContractValue_check: 1,
dialogFormVisible: false,
dialogFormVisible1: false,
rules: { // 表单验证规则
DirectNumber: [{ required: true, message: '请输入直达件数量', trigger: 'blur' }],
getPeople: [{ required: true, message: '请选择领用人', trigger: 'blur' }],
DirectNote: [{ required: true, message: '请输入直达件备注', trigger: 'change' }]
},
materialNum: '',
purchaseContractNumber: '',
locate: '',
PeopleNumber: '', // 入库人员流水号
directRecord: [],
teamPart: '',
listLoading: '',
listLoading1: '',
PageCurrent: 1,
PageSize: 10,
total: null,
projectName: '',
machineName: '',
teamName: '',
materialName: '',
contractNumber: '',
directPartNumber: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.searchPeopleData()
this.searchContractData()
this.getpeopleid()
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
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].组件流水号
})
}
})
},
searchPeopleData() { // 查询人员
searchPeople().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
searchContractData() { // 查询合同
searchContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Contract.push({
label: response.data[i].采购合同编号,
value: response.data[i].采购合同流水号
})
}
})
},
searchPartinfo() {
this.tableDataPurchase = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
}
if (this.ContractValue === '') {
this.ContractValue_check = 0
}
this.listLoading = true
searchDirectPart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue, this.ContractValue_check, this.ContractValue).then(response => {
this.tableDataPurchase = response.data.rows
this.total = response.data.total
this.listLoading = false
})
},
// 查询采购合同明细
// searchContractDetailinfo() {
// searchContractDetail(this.ContractValue).then(response => {
// this.tableDataPurchase = response.data
// })
// },
// 查询直达件记录
searchDirect(row) {
this.purchaseContractNumber = row.采购合同明细流水号
this.listLoading = true
searchDirectRec(this.purchaseContractNumber).then(response => {
this.directRecord = response.data
this.listLoading = false
})
},
// 打开直达件表单
addDirect(row) {
this.PeopleValue = ''
this.form = []
console.log(row)
this.dialogFormVisible = true
this.materialNum = row.物料流水号
this.purchaseContractNumber = row.采购合同明细流水号
this.teamPart = row.组件零件流水号
this.projectName = row.项目名称
this.machineName = row.机床名称
this.teamName = row.组件名称
this.materialName = row.物料名称
this.contractNumber = row.采购合同编号
},
// 打开直达件编辑表单
changeDirect(row) {
console.log(row)
this.dialogFormVisible1 = true
this.directPartNumber = row.直达件流水号
this.form.DirectNumber = row.到货数量
this.PeopleValue = row.领用人员流水号
this.form.DirectNote = row.备注
},
// 修改直达件
editDirectPartm() {
editDirectRec(this.directPartNumber, this.form.DirectNumber, this.PeopleValue, this.form.DirectNote).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
})
this.dialogFormVisible = false
this.searchDirect()
} else {
this.$message.error('信息修改失败')
}
})
searchDirectRec(this.purchaseContractNumber).then(response => {
this.directRecord = response.data
this.listLoading = false
})
this.dialogFormVisible1 = false
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.getPeople = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
this.dialogFormVisible1 = false
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
},
// 增加直达件
addDirectPartm() {
console.log(this.materialNum, this.form.DirectNumber, this.locate, this.purchaseContractNumber, this.PeopleNumber, this.PeopleValue, this.form.DirectNumber, this.teamPart, this.form.DirectNote)
addDirectPart(this.materialNum, this.form.DirectNumber, this.locate, this.purchaseContractNumber, this.PeopleNumber, this.PeopleValue, this.form.DirectNumber, this.teamPart, this.projectName, this.machineName, this.teamName, this.materialName, this.contractNumber, this.form.DirectNote).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息添加成功',
type: 'success'
})
this.dialogFormVisible = false
this.searchDirect()
} else {
this.$message.error('信息添加失败')
}
})
this.dialogFormVisible = false
},
// 删除领料单
dropListinfor(row) {
this.directPartNumber = row.直达件流水号
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDirectRec(this.directPartNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
searchDirectRec(this.purchaseContractNumber).then(response => {
this.directRecord = response.data
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,186 @@
<template>
<div class="app-container">
<el-card>
<el-table v-loading="" :data="tableData1" border style="width: 100%;height: 100%;" height="300px" size="mini">
<el-table-column label="交换单编号" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.交换单编号 }}
</template>
</el-table-column>
<el-table-column label="交换件名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.交换件名称 }}
</template>
</el-table-column>
<el-table-column label="被交换件名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.被交换件名称 }}
</template>
</el-table-column>
<el-table-column label="交换数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.交换数量 }}
</template>
</el-table-column>
<el-table-column label="申请人" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="申请时间" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.申请时间 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="审核" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-check" @click="yesApproval(scope.row)">通过</el-button>
<el-button type="danger" size="mini" icon="el-icon-close" @click="noApproval(scope.row)">不通过</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
</div>
</template>
<script>
import { searchExchangePart, approvalExchangepart, disappExchangepart } from '@/api/Inventory/ExchangeApproval'
import { mapGetters } from 'vuex'
export default {
name: '', // 财务审核
data() {
return {
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
pageSize2: 10,
pageCurrent2: 1,
total2: 0,
gridData: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.searchTable1()
},
searchTable1() {
searchExchangePart(this.pageCurrent1, this.pageSize1).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
console.log(response)
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
},
// searchTable02(row) { // 查看详情(请款信息包含的合同)
// searchRequsetFundDetail(row.离线合同请款流水号).then(response => {
// this.gridData = response.data
// })
// },
yesApproval(row) { // 通过审核
this.$confirm('确定审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
approvalExchangepart(row.交换单流水号, row.交换件物料流水号, row.交换件组件零件流水号, row.交换件采购合同明细流水号, row.货位流水号, row.交换数量).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
},
noApproval(row) { // 不通过审核
this.$prompt('请输入不通过原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
disappExchangepart(row.交换单流水号, value).then(response => {
if (response.data[0].result === '1') {
this.$message.success('执行成功')
this.searchTable1()
} else { this.$message.error('执行失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,481 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total = 0;pageSize = 10;pageList = 1;searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataPurchase"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">交换</el-button>
<el-button size="small" type="primary" icon="el-icon-sort-down" style="margin: 0 0 0 0px" @click="selected(scope.row)">被交换</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
<el-card>
<el-row>
<el-col :span="11">
<div>
<el-table
:data="tableData1"
border
style="width: 100%;"
height="100"
>
<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">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col :span="2">
<div style="margin: 10px 15px">
<el-button size="small" type="primary" icon="el-icon-edit" @click="total = 0;pageSize = 10;pageList = 1;exchange()" >交换</el-button>
</div>
</el-col>
<el-col :span="11">
<div>
<el-table
:data="tableData2"
border
style="width: 100%;"
height="100">
<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">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
<!--新增交换件对话框-->
<el-dialog :title="title" :visible.sync="dialogFormVisible" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="交换单编号" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.ExchangeNumber" size="small" placeholder="请输入零件交换单编号" style="width: 200px"/>
</el-form-item>
<el-form-item label="交换数量" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.ExchangeNumberx" size="small" placeholder="请输入交换数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.ExchangeNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button v-show="title==='交换'" type="primary" @click="addListDetailinfor('form')"> </el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataExchange"
border
style="width: 100%;"
height="200">
<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">
<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">
<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="180">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="danger" icon="el-icon-delete" style="margin: 0 0 0 0px" @click="dropListinfor(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, addExchangepart, searchExchangePart, dropExchangeList, editExchangeList } from '@/api/Inventory/ExchangePart'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
tableDataPurchase: [],
tableDataExchange: [],
tableData1: [],
tableData2: [],
tableDataPicking: [], // 领料单明细表格
listNumber: '',
pickingListNumber: null, // 领料单编号
pickingListNumberx: '', // 领料单流水号
picikingPeople: '', // 领料人流水号
partProjectNumber: '', // 项目流水号
partProjectName: '', // 项目名称
partMachineNumber: '', // 机床流水号
partMachineName: '', // 机床名称
partGroupNumber: '', // 分组流水号
partGroupName: '', // 分组名称
OutNumber: '', // 出库数量
outNote: '', // 出库备注
dialogFormVisible: false,
arr: [],
form: {
ExchangeNumber: '', // 交换件编号
ExchangeNumberx: '', // 交换件数量
ExchangeNote: '' // 交换件备注
},
rules: { // 表单验证规则
ExchangeNumber: [{ required: true, message: '请输入交换件编号', trigger: 'blur' }],
ExchangeNumberx: [{ required: true, message: '请输入交换件数量', trigger: 'blur' }],
ExchangeNote: [{ required: true, message: '请输入交换件备注', trigger: 'change' }]
},
PageCurrent: 1,
PageSize: 10,
total: null,
PageCurrent1: 1,
PageSize1: 10,
total1: null,
listLoading: '',
listLoading1: '',
exchangeListNumber: '',
eTeamPartNumber: '',
title: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.fetchData()
this.getpeopleid()
this.getExchangeTable()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
console.log(this.picikingPeople)
},
searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
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].组件流水号
})
}
})
},
searchPartinfo() {
this.tableDataPurchase = []
this.tableDataBasic = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
this.listLoading = true
searchPurchasePart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataPurchase = response.data.rows
console.log(this.tableDataPurchase)
this.total = response.data.total
})
this.listLoading = false
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
},
// 查询交换件
getExchangeTable() {
this.listLoading1 = true
searchExchangePart(this.PageCurrent1, this.PageSize1).then(response => {
this.tableDataExchange = response.data.rows
this.total1 = response.data.total
this.listLoading1 = false
})
},
// 选择领料单
chooseListinfor(row) {
this.pickingListNumberx = row.领料单流水号
console.log(this.pickingListNumberx)
this.searchListDetailt()
},
// 增加交换件
addListDetailinfor() {
addExchangepart(this.form.ExchangeNumber, this.tableData1[0].组件零件流水号, this.tableData1[0].物料流水号, this.tableData1[0].采购合同明细流水号, this.tableData2[0].组件零件流水号, this.tableData1[0].物料名称, this.tableData2[0].物料名称, this.tableData2[0].货位流水号, this.form.ExchangeNumberx, this.picikingPeople, this.form.ExchangeNote).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else { this.$message.error('增加失败') }
})
this.dialogFormVisible = false
this.getExchangeTable()
},
// 打开交换表单
exchange() {
this.title = '交换'
this.dialogFormVisible = true
},
// 重置表单
callOff() {
this.form.ExchangeNumber = ''
this.form.ExchangeNumberx = ''
this.form.ExchangeNote = ''
this.dialogFormVisible = false
},
// 选中零件交换
selecting(row) {
const arr = new Array(row)
this.tableData1 = arr
console.log(this.tableData1)
},
// 选中被零件交换
selected(row) {
const arr = new Array(row)
this.tableData2 = arr
},
// 删除领料单
dropListinfor(row) {
this.exchangeListNumber = row.交换单流水号
this.eTeamPartNumber = row.交换件组件零件流水号
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropExchangeList(this.exchangeListNumber, this.eTeamPartNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getExchangeTable().then(response => {
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit(row) {
this.exchangeListNumber = row.交换单流水号
this.form.ExchangeNumber = row.交换单编号
this.form.ExchangeNumberx = row.交换数量
this.form.ExchangeNote = row.备注
this.title = '编辑'
this.dialogFormVisible = true
},
submitEdit() {
this.editTable(editExchangeList, [this.exchangeListNumber, this.form.ExchangeNumber, this.form.ExchangeNumberx, this.form.ExchangeNote], 'form', function() { this.getExchangeTable(); this.dialogFormVisible = false })
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="app-container">
<el-card>
<span>采购合同编号:</span>
<el-select v-model="ContractValue" filterable clearable size="small" placeholder="采购合同" style="width: 200px">
<el-option
v-for="item in Contract"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span class="demonstration">入库日期</span>
<el-date-picker
v-model="InboundDate"
type="date"
size="small"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>仓库:</span>
<el-select v-model="InventoryValue" filterable clearable size="small" placeholder="仓库" style="width: 200px">
<el-option
v-for="item in Inventory"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
border
style="width: 100%;"
height="400">
<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">
<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.单价 * scope.row.实际到货数量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选入</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchContract, searchInventory, searchInbound } from '@/api/Inventory/InboundCard'
import { mapGetters } from 'vuex'
export default {
data() {
return {
Contract: [],
ContractValue: '',
Inventory: [],
InventoryValue: '',
InboundDate: '',
listLoading: '',
tableData: []
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.searchContractData()
this.searchInventoryData()
},
methods: {
searchContractData() { // 查询合同
searchContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Contract.push({
label: response.data[i].采购合同编号,
value: response.data[i].采购合同流水号
})
}
})
},
searchInventoryData() { // 查询仓库
searchInventory().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Inventory.push({
label: response.data[i].仓库名称,
value: response.data[i].仓库流水号
})
}
})
},
searchPartinfo() {
this.tableData = []
this.listLoading = true
searchInbound(this.ContractValue, this.InboundDate, this.InventoryValue).then(response => {
this.tableData = response.data
this.total = response.data.total
this.listLoading = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,259 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">零件图号</span>
<el-input v-model="partNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="getscantable()">查询</el-button>
<el-button size="small" type="danger" icon="el-icon-remove-outline" style="margin: 0 0 0 10px" @click="Empty()">清空</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
border
style="width: 100%;height: 650px" >
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="项目名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="计划数量" align="center" min-width="100">
<template slot-scope="scope" align="center">
<el-input v-model="tableData[scope.$index].plannumber" readonly size="small"/>
</template>
</el-table-column>
<el-table-column label="入库数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].innumber" clearable size="small"/>
</template>
</el-table-column>
<el-table-column label="仓库" align="center" min-width="100">
<template slot-scope="scope">
<el-select v-model="inventoryNumber" filterable clearable size="small" placeholder="仓库名称" @change="Getlocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="120">
<template slot-scope="scope">
<el-select v-model="locateNumber" filterable clearable size="small" placeholder="货位名称">
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope" align="center">
<el-input v-model="tableData[scope.$index].note" clearable size="small"/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini" class="el-icon-success" @click="Innumber">入库</el-button>
<el-button
size="mini"
type="danger"
class="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable, insertOne, getinventory, getlocate } from '@/api/Inventory/Inboundscanning'
import { mapGetters } from 'vuex'
import { wsuri, name } from '@/utils/request'
import print from '@/vendor/print'
export default {
data() {
return {
ace: 0,
a: '',
tableData: [],
partNumber: '',
listLoading: false,
craftplannumber: '',
radio2: 3,
PeopleNumber: '',
inventoryName: [], // 仓库名称下拉框
inventoryNumber: '',
locateName: [], // 货位名称下拉框
locateNumber: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.initWebpack()
this.getpeopleid()
this.Getinvent()
},
methods: {
handleDelete(index, row) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.tableData.splice(index, 1)
this.$message({
message: '已被成功移除',
type: 'success'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
aaa() {
print('#print')
},
initWebpack() { // 初始化websocket
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onmessage = this.websocketonmessage
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
websocketopen() { // 打开
console.log('WebSocket连接成功')
this.websock.send('{<' + name + '>}')
},
websocketonmessage(msg) { // 数据接收
this.partNumber = msg.data.split('|')[3]
this.getscantable()
},
websocketclose() { // 关闭
console.log('WebSocket关闭')
},
websocketerror() { // 失败
console.log('WebSocket连接失败')
},
// 扫描查询
getscantable() {
if (this.partNumber === '') {
this.$message.error('请输入零件号')
} else {
this.listLoading = true
searchTable(this.partNumber).then(response => {
if (response.data.length === 0) {
this.listLoading = false
this.$message.warning('无此零件')
} else {
for (let i = 0; i < this.tableData.length; i++) {
if (response.data[0].工艺计划流水号 === this.tableData[i].工艺计划流水号) {
this.ace = this.ace + 1
}
}
if (this.ace === 0) {
this.tableData.push({
plannumber: response.data[0].剩余数量,
innumber: response.data[0].入库数量,
capture: '',
note: '',
工艺计划流水号: response.data[0].工艺计划流水号,
项目名称: response.data[0].项目名称,
机床图号: response.data[0].机床图号,
零件图号: response.data[0].零件图号
})
} else {
this.$message.error('此件已在列表中')
}
}
}).then(() => {
this.listLoading = false
this.ace = 0
})
}
},
// 修改入库
Innumber() {
this.$confirm('此操作将不可逆转,且如果入库数量大于计划数量,则全部入库,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].innumber > this.tableData[i].plannumber) {
this.tableData[i].innumber = this.tableData[i].plannumber
}
insertOne(this.tableData[i].工艺计划流水号, this.tableData[i].innumber, this.PeopleNumber, this.tableData[i].capture, this.inventoryNumber, this.locateNumber, this.tableData[i].note).then(response => {
this.$message({
type: 'success',
message: '零件入库成功!'
})
}).then(() => {
this.Empty()
})
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消入库'
})
})
},
// 清空
Empty() {
this.tableData = []
},
// 仓库查询
Getinvent() {
this.getSelect(getinventory, ['仓库名称', '仓库流水号'], 'inventoryName')
},
// 根据项目获取机床
Getlocate() {
this.locateName = []
this.locateNumber = ''
if (this.inventoryNumber) {
this.getSelect(getlocate, ['货位名称', '货位流水号'], 'locateName', this.inventoryNumber)
}
}
}
}
</script>
<style scoped>
.el-card {
margin-bottom: 15px;
}
</style>

View File

@@ -0,0 +1,970 @@
<template>
<div class="app-container">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="基本件" name="first"><el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchBasciPartinfo()">基本件查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataBasic"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="searchBasicPartRecord(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="BasicPartIn"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading2"
:data="BasicPartOut"
border
style="width: 100%;"
height="200">
<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">
<template slot-scope="scope">
{{ scope.row.出库备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-tab-pane label="通用件" name="second">
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total1 = 0;pageSize1 = 10;pageList1 = 1;searchGeneralPartinfo()">通用件查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading3"
:data="tableDataGeneral"
:row-style="tableRowClassName2"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="searchGeneralPartRecord(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading4"
:data="PurchasePartIn"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading5"
:data="PurchasePartOut"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-tab-pane label="外购件" name="third"><el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total2 = 0;pageSize2 = 10;pageList2 = 1;searchPurchasePartinfo()">外购件查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading6"
:data="tableDataPurchase"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="searchPurchasePartRecord(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading7"
:data="PurchasePartIn"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading8"
:data="PurchasePartOut"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<el-tab-pane label="标准件" name="fourth">
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total3 = 0;pageSize3 = 10;pageList3 = 1;searchStandardPartinfo()">标准件查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading9"
:data="tableDataStandard"
:row-style="tableRowClassName1"
border
style="width: 100%;"
height="200">
<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">
<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" width="200px">
<template slot-scope="scope" align="center">
<el-button size="mini" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="standardselecting(scope.row)" >选择</el-button>
<el-button size="mini" type="primary" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="changesafeAmount(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
</el-card>
<!--安全库存量对话框-->
<el-dialog :visible.sync="dialogFormVisible2" title="安全库存量修改" center width="380px">
<el-form ref="form" :model="Project" :rules="rules" label-position="left">
<el-form-item label="安全库存量" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.safeNumber" size="small" placeholder="请输入安全库存量" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="edeitsafeAmount()"> </el-button>
</div>
</el-dialog>
<el-card>
<el-table
v-loading="listLoading10"
:data="StandardPartIn"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading11"
:data="StandardPartOut"
border
style="width: 100%;"
height="200">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, searchBasicPart, searchStandardPart, searchGeneralPart, searchPurchasePartIn, searchPurchasePartOut, searchBasicPartIn, searchBasicPartOut, safeAmount, searchStandardPartIn, searchStandardPartOut } from '@/api/Inventory/InventoryCheck'
export default {
data() {
return {
activeName: 'first',
tableDataBasic: [], // 基本件
BasicPartOut: [], // 基本件出库记录
BasicPartIn: [], // 基本件入库记录,
craftNumber: '',
tableDataGeneral: [], // 通用件
tableDataPurchase: [], // 外购件
PurchasePartOut: [], // 外购件出库记录
PurchasePartIn: [], // 外购件入库记录
tableDataStandard: [], // 标准件
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
ContractDetailValue: '',
TeamPartNumber: '',
form: {
safeNumber: ''
},
rules: { // 表单验证规则
safeNumber: [{ required: true, message: '请输入安全库存量', trigger: 'blur' }]
},
dialogFormVisible2: false,
StandardPartOut: [],
StandardPartIn: [],
GeneralPartIn: [],
GeneralPartOut: [],
listLoading: '',
listLoading1: '',
listLoading2: '',
listLoading3: '',
listLoading4: '',
listLoading5: '',
listLoading6: '',
listLoading7: '',
listLoading8: '',
listLoading9: '',
listLoading10: '',
listLoading11: '',
PageCurrent: 1,
PageSize: 10,
total: null,
PageCurrent1: 1,
PageSize1: 10,
total1: null,
PageCurrent2: 1,
PageSize2: 10,
total2: null,
PageCurrent3: 1,
PageSize3: 10,
total3: null
}
},
created() {
this.fetchData()
},
methods: {
handleClick(tab, event) {
},
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
searchMachine() { // 查询机床
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
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.listLoading6 = true
this.tableDataPurchase = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
searchPurchasePart(this.PageCurrent2, this.PageSize2, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataPurchase = response.data.rows
this.total2 = response.data.total
this.listLoading6 = false
})
this.projectValue = ' '
this.MachineValue = ' '
this.GroupNumValue = ' '
},
// 查询外购件记录
searchPurchasePartRecord(row) {
this.listLoading7 = true
this.listLoading8 = true
this.ContractDetailValue = row.采购合同明细流水号
this.TeamPartNumber = row.组件零件流水号
searchPurchasePartIn(this.ContractDetailValue).then(response => {
this.PurchasePartIn = response.data
this.listLoading7 = false
})
searchPurchasePartOut(this.TeamPartNumber).then(response => {
this.PurchasePartOut = response.data
this.listLoading8 = false
})
},
// 查询标准件
searchStandardPartinfo() {
this.listLoading9 = true
this.tableDataStandard = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
searchStandardPart(this.PageCurrent3, this.PageSize3, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataStandard = response.data.rows
this.total3 = response.data.total
this.listLoading9 = false
console.log(this.tableDataPurchase)
})
this.projectValue = ' '
this.MachineValue = ' '
this.GroupNumValue = ' '
},
standardselecting(row) {
this.contractDeatilNumber = row.采购合同明细流水号
this.steamPartNumber = row.组件零件流水号
this.getStandardPartIn()
this.getStandardPartOut()
},
// 查询标准件入库记录
getStandardPartIn() {
this.listLoading10 = true
searchStandardPartIn(this.contractDeatilNumber).then(response => {
this.StandardPartIn = response.data
this.listLoading10 = false
})
},
// 查询标准件出库记录
getStandardPartOut() {
this.listLoading11 = true
searchStandardPartOut(this.steamPartNumber).then(response => {
this.StandardPartOut = response.data
this.listLoading11 = false
})
},
// 查询通用件
searchGeneralPartinfo() {
this.listLoading3 = true
this.tableDataGeneral = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
searchGeneralPart(this.PageCurrent1, this.PageSize1, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataGeneral = response.data.rows
this.total1 = response.data.total
this.listLoading3 = false
})
this.projectValue = ' '
this.MachineValue = ' '
this.GroupNumValue = ' '
},
// 查询基本件
searchBasciPartinfo() {
this.listLoading = true
this.tableDataBasic = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
searchBasicPart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataBasic = response.data.rows
this.listLoading = false
this.total = response.data.total
})
this.projectValue = ' '
this.MachineValue = ' '
this.GroupNumValue = ' '
},
// 查询基本件记录
searchBasicPartRecord(row) {
this.craftNumber = row.工艺计划流水号
this.listLoading1 = true
this.listLoading2 = true
searchBasicPartIn(this.craftNumber).then(response => {
this.listLoading1 = false
this.BasicPartIn = response.data
})
searchBasicPartOut(this.craftNumber).then(response => {
this.listLoading2 = false
this.BasicPartOut = response.data
})
},
// 查询通用件记录
searchGeneralPartRecord(row) {
this.listLoading4 = true
this.listLoading5 = true
this.craftNumber = row.工艺计划流水号
searchBasicPartIn(this.craftNumber).then(response => {
this.GeneralPartIn = response.data
this.listLoading4 = false
})
searchBasicPartOut(this.craftNumber).then(response => {
this.GeneralPartOut = response.data
this.listLoading5 = false
})
},
changesafeAmount(row) {
this.dialogFormVisible2 = true
this.teamPartNumber = row.组件零件流水号
},
// 修改安全库存量
edeitsafeAmount() {
safeAmount(this.teamPartNumber, this.form.safeNumber).then(response => {
this.dialogFormVisible2 = false
if (response.data[0].result === '1') {
this.$message.success('添加成功')
} else {
this.$message.error('添加失败')
}
this.form = {}
})
},
// 重置表单
callOff(formName) {
this.form = {}
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
},
tableRowClassName1({ row }) {
if (row.安全库存量 > row.库存数量) {
return 'background: #ff6666'
} else {
return ''
}
},
tableRowClassName2({ row }) {
const a = 0
if (a >= row.可出库数量) {
return 'background: #ff6666'
} else {
return ''
}
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
},
handleSizeChange1(val) {
this.PageCurrent1 = 1
this.PageSize1 = val
this.searchPartinfo()
},
handleCurrentChange1(val) {
this.PageCurrent1 = val
this.searchPartinfo()
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
this.PageSize2 = val
this.searchPartinfo()
},
handleCurrentChange2(val) {
this.PageCurrent2 = val
this.searchPartinfo()
},
handleSizeChange3(val) {
this.PageCurrent3 = 1
this.PageSize3 = val
this.searchPartinfo()
},
handleCurrentChange3(val) {
this.PageCurrent3 = val
this.searchPartinfo()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,550 @@
<template>
<div class="app-container">
<el-card>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin: 0 0 0 10px" @click="ADD()">增加</el-button>
</el-card>
<el-card>
<el-table
:data="tableData"
border
style="width: 100%;max-height: 400px"
height="400"
@row-click="getWarehouse">
<el-table-column label="仓库编号" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.仓库编号 }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" width="180">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="仓库描述" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.仓库描述 }}
</template>
</el-table-column>
<el-table-column label="地址" align="center">
<template slot-scope="scope">
{{ scope.row.地址 }}
</template>
</el-table-column>
<el-table-column label="联系人" align="center">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column label="备注" width="180" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column prop="budget" label="领用人" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.领用人 }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
icon="el-icon-edit"
type="primary"
@click="handleEdit(scope.row)">修改</el-button>
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin: 0 0 0 10px" @click="ADDLocate()">增加</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData2"
border
style="width: 100%;max-height: 400px"
height="400">
<el-table-column label="货位名称" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="工作中心" align="center" width="180">
<template slot-scope="scope">
{{ scope.row.工作中心 }}
</template>
</el-table-column>
<el-table-column label="永久" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.永久 }}
</template>
</el-table-column>
<el-table-column label="不可用量" align="center">
<template slot-scope="scope">
{{ scope.row.不可用量 }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
icon="el-icon-edit"
type="primary"
@click="handleLocateEdit(scope.row)">修改</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="locateDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--仓库表单-->
<el-dialog :visible.sync="dialogFormVisible" title="增加仓库" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="仓库编号" prop="WarehouseNumber">
<el-input
v-model="form.WarehouseNumber"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="仓库名称" prop="WarehouseName">
<el-input
v-model="form.WarehouseName"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="仓库描述" prop="WarehouseDescription">
<el-input
v-model="form.WarehouseDescription"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地址" prop="Address">
<el-input
v-model="form.Address"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="Note">
<el-input
v-model="form.Note"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')">确定</el-button>
</div>
</el-dialog>
<!--货位表单-->
<el-dialog :visible.sync="dialogFormVisible2" title="货位" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px" class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="货位名称" prop="货位名称">
<el-input
v-model="form2.货位名称"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工作中心" prop="工作中心">
<el-input
v-model="form2.工作中心"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="永久" prop="永久">
<el-input
v-model="form2.永久"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="不可用量" prop="不可用量">
<el-input
v-model="form2.不可用量"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callLocateOff('form2')">取消</el-button>
<el-button type="primary" @click="Locatesubmit('form2')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initWarehouse, addWarehouse, alterWarehouse, deleteWarehouse, searchLocate, addLocate, alterLocate, deleteLocate, searchPeople } from '@/api/Inventory/InventoryManagement'
export default {
data() {
return {
tableData: [],
tableData2: [],
wareHouse: '',
dialogFormVisible: false, // 仓库表单
temp: '',
form: {
WarehouseNumber: '', // 仓库编号
WarehouseName: '', // 仓库名称
WarehouseDescription: '', // 仓库描述
Address: '', // 地址
Note: '' // 备注
},
rules: { // 表单验证规则
WarehouseNumber: [{ required: true, message: '请输入仓库编号', trigger: 'change' }],
WarehouseName: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
WarehouseDescription: [{ required: true, message: '请输入仓库描述', trigger: 'blur' }],
Address: [{ required: true, message: '请输入地址', trigger: 'blur' }],
Note: [{ required: true, message: '请输入备注', trigger: 'blur' }]
},
dialogFormVisible2: false, // 货位表单
form2: {
货位名称: '',
工作中心: '',
永久: '',
不可用量: ''
},
rules2: { // 表单验证规则
货位名称: [{ required: true, message: '请输入货位名称', trigger: 'change' }],
工作中心: [{ required: true, message: '请输入工作中心', trigger: 'blur' }],
永久: [{ required: true, message: '请输入永久', trigger: 'blur' }],
不可用量: [{ required: true, message: '请输入不可用量', trigger: 'blur' }]
},
HouseNumber: '',
LocateNumber: '',
listLoading: '',
PeopleValue: '',
People: []
}
},
created() {
this.getTable()
this.searchPeopleData()
},
methods: {
// 查询仓库
getTable() {
this.tableData = []
this.listLoading = true
initWarehouse().then(response => {
this.listLoading = false
console.log(response)
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
仓库流水号: response.data[i].仓库流水号,
仓库编号: response.data[i].仓库编号,
仓库名称: response.data[i].仓库名称,
仓库描述: response.data[i].仓库描述,
地址: response.data[i].地址,
联系人: response.data[i].联系人,
备注: response.data[i].备注
})
}
})
},
getWarehouse(row) {
this.wareHouse = row.仓库流水号
this.getLocate()
},
searchPeopleData() { // 查询人员
searchPeople().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
getLocate() {
this.tableData2 = []
searchLocate(this.wareHouse).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData2.push({
货位流水号: response.data[i].货位流水号,
货位名称: response.data[i].货位名称,
工作中心: response.data[i].工作中心,
永久: response.data[i].永久,
不可用量: response.data[i].不可用量,
仓库名称: response.data[i].仓库名称
})
}
})
},
// 点击增加仓库
ADD() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
this.temp = 1
},
// 提交添加或者修改仓库
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.temp === 1) {
this.addTableData()
this.form.WarehouseNumber = ''
this.form.WarehouseName = ''
this.form.WarehouseDescription = ''
this.form.Address = ''
this.form.Contactpeople = ''
this.form.Note = ''
this.temp = null
} else if (this.temp === 2) {
this.chaEdit()
this.temp = null
}
}
})
},
// 执行增加仓库
addTableData() {
addWarehouse(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.PeopleValue, this.form.Note).then(response => {
this.dialogFormVisible = false
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.form.WarehouseNumber = ''
this.form.WarehouseName = ''
this.form.WarehouseDescription = ''
this.form.Address = ''
this.form.Contactpeople = ''
this.form.Note = ''
} else {
this.$message.error('添加失败')
}
this.getTable()
})
},
// 编辑
handleEdit(row) {
this.temp = 2
this.dialogFormVisible = true
this.form.WarehouseNumber = row.仓库编号
this.form.WarehouseName = row.仓库名称
this.form.WarehouseDescription = row.仓库描述
this.form.Address = row.地址
this.form.Contactpeople = row.联系人
this.form.Note = row.备注
this.HouseNumber = row.仓库流水号
},
// 执行修改
chaEdit() {
alterWarehouse(this.HouseNumber, this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.Contactpeople, this.form.Note).then(response => {
this.dialogFormVisible = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.form.WarehouseNumber = ''
this.form.WarehouseName = ''
this.form.WarehouseDescription = ''
this.form.Address = ''
this.form.Contactpeople = ''
this.form.Note = ''
this.getTable()
} else {
this.$message.error('信息更新失败')
}
})
},
// 删除仓库
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteWarehouse(row.仓库流水号).then(response => {
if (response.data[0].result === '1') {
this.getTable()
this.$message.success('删除成功')
} else {
this.$message.error('删除失败')
}
})
})
},
// 重置表单
callOff(formName) {
console.log(1515)
this.form = {}
this.form2.ContractNumberValue = ''
this.form2.EntryName = ''
this.form2.TotalContractAmount = ''
this.form.PaymentPhaseValue = 1
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 点击增加货位
ADDLocate() {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.dialogFormVisible2 = true
this.temp = 1
},
// 提交添加或者修改货位
Locatesubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.temp === 1) {
this.addLocateTable()
this.form2.货位名称 = ''
this.form2.工作中心 = ''
this.form2.仓库流水号 = ''
this.form2.永久 = ''
this.form2.不可用量 = ''
this.temp = null
} else if (this.temp === 2) {
this.LocateEdit()
this.temp = null
}
}
})
},
// 执行增加货位
addLocateTable() {
addLocate(this.form2.货位名称, this.form2.工作中心, this.wareHouse, this.form2.永久, this.form2.不可用量).then(response => {
this.dialogFormVisible2 = false
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.form.货位名称 = ''
this.form.工作中心 = ''
this.form.仓库流水号 = ''
this.form.永久 = ''
this.form.不可用量 = ''
} else {
this.$message.error('添加失败')
}
this.getLocate()
})
},
// 编辑货位
handleLocateEdit(row) {
this.temp = 2
this.form2.货位名称 = row.货位名称
this.form2.工作中心 = row.工作中心
this.form2.仓库流水号 = row.仓库流水号
this.form2.永久 = row.永久
this.form2.不可用量 = row.不可用量
this.LocateNumber = row.货位流水号
this.dialogFormVisible2 = true
},
// 执行修改货位
LocateEdit() {
alterLocate(this.LocateNumber, this.form2.货位名称, this.form2.工作中心, this.form2.仓库流水号, this.form2.永久, this.form2.不可用量).then(response => {
this.dialogFormVisible2 = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.form.货位名称 = ''
this.form.工作中心 = ''
this.form.仓库流水号 = ''
this.form.永久 = ''
this.form.不可用量 = ''
this.getLocate()
} else {
this.$message.error('信息更新失败')
}
})
},
// 删除货位
locateDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLocate(row.货位流水号).then(response => {
if (response.data[0].result === '1') {
this.getLocate()
this.$message.success('删除成功')
} else {
this.$message.error('删除失败')
}
})
})
},
// 重置表单
callLocateOff(formName) {
this.form2 = {}
this.form2.货位名称 = ''
this.form2.工作中心 = ''
this.form2.仓库流水号 = ''
this.form.永久 = ''
this.form.不可用量 = ''
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,296 @@
<template>
<div class="app-container">
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataBasic"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="parOut(scope.row)">出库</el-button>
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="searchoutRecord(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--零件出库对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-form ref="form" :model="Project" :rules="rules" label-position="left">
<el-form-item label="项目" prop="TotalContractAmount" label-width="100px">
<el-select v-model="form.ProjectValue" filterable clearable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="机床" prop="TotalContractAmount" label-width="100px">
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="分组" prop="TotalContractAmount" label-width="100px">
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" 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>
<el-button type="primary" @click="addDirectPartm()"> </el-button>
</div>
</el-dialog>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataOut"
border
style="width: 100%;"
height="200">
<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">
<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>
</el-card>
</div>
</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: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.searchPurchasePartinfo()
this.fetchData()
this.searchPeopleData()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
console.log(1351)
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
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].机床流水号
})
}
})
},
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.searchoutRecord()
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNumberx = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
},
searchPeopleData() { // 查询人员
searchPeople().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
// 离线外购件出库
addDirectPartm() {
console.log(this.contractNumber, this.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.MachineValue, this.GroupNumValue, this.materialNumber, this.PeopleNumber)
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.$notify({
title: '成功',
message: '信息添加成功',
type: 'success'
})
this.dialogFormVisible = false
this.searchDirect()
} else {
this.$message.error('信息添加失败')
}
})
this.dialogFormVisible = false
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,197 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">领料单编号</span>
<el-input v-model="pickingListNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchListinfor()">查询</el-button>
<el-table
v-loading="listLoading"
:data="tableData1"
border
style="width: 100%;"
height="200">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="领料单编号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
<el-table-column label="领料时间" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料时间 }}
</template>
</el-table-column>
<el-table-column label="领料人" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200px">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="chooseListinfor(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading1"
:data="tableDataPicking"
border
style="width: 100%;"
height="200">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="项目名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="组件名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="领用数量" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.货位流水号 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="80">
<template slot-scope="scope">
<el-button size="small" type="primary" icon="el-icon-back" style="margin: 0 0 0 0px" @click="partOut(scope.row)">出库</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchList, searchListDetail, PurchasePart, BasicPart, WorkShopPart } from '@/api/Inventory/PartOut'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
tableDataPurchase: [],
tableData1: [],
tableDataPicking: [], // 领料单明细表格
listNumber: '',
pickingListNumber: null, // 领料单编号
pickingListNumberx: '', // 领料单流水号
picikingPeople: '', // 领料人流水号
partProjectNumber: '', // 项目流水号
partProjectName: '', // 项目名称
partMachineNumber: '', // 机床流水号
partMachineName: '', // 机床名称
partGroupNumber: '', // 分组流水号
partGroupName: '', // 分组名称
OutNumber: '', // 出库数量
outNote: '', // 出库备注
getpicikingPeople: '', // 领料人
listLoading: '',
listLoading1: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.getpeopleid()
},
methods: {
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
console.log(this.picikingPeople)
},
// 查询领料单
searchListinfor() {
this.listLoading = true
searchList(this.pickingListNumber).then(response => {
this.tableData1 = response.data
this.listLoading = false
})
},
// 查询领料单明细
searchListDetailt() {
this.listLoading1 = true
searchListDetail(this.pickingListNumberx).then(response => {
this.tableDataPicking = response.data
this.listLoading1 = false
})
},
// 选择领料单
chooseListinfor(row) {
this.pickingListNumberx = row.领料单流水号
this.getpicikingPeople = row.领料人流水号
console.log(this.pickingListNumberx)
this.searchListDetailt()
},
// 出库
partOut(row) {
console.log(row)
if (row.采购合同明细流水号 !== null) {
WorkShopPart(row.采购合同明细流水号, this.getpicikingPeople, row.出库数量, row.货位流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
} else { this.$message.error('出库失败') }
})
} else if (row.零件类型 === 1 || row.零件类型 === 2) {
PurchasePart(row.组件零件流水号, this.getpicikingPeople, row.出库数量, row.货位流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
} else { this.$message.error('出库失败') }
})
} else {
BasicPart(row.工艺计划流水号, row.出库数量, row.收件信息ID, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
} else { this.$message.error('增加失败') }
})
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,875 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">领料单编号</span>
<el-input v-model="pickingListNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchListinfor()">查询</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" style="margin: 0 0 0 10px" @click="addListinfor()">创建</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" style="margin: 0 0 0 10px" @click="downLoadCjn()">导出</el-button>
<el-table
v-loading="listLoading2"
:data="tableData1"
border
style="width: 100%;"
height="200"
@row-click = "searchListDetailt()">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="领料单编号" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
<el-table-column label="领料时间" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.领料时间 }}
</template>
</el-table-column>
<el-table-column label="领料人" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200px">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="chooseListinfor(scope.row)">选择</el-button>
<el-button size="small" type="danger" icon="el-icon-delete" style="margin: 0 0 0 10px" @click="dropListinfor(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
<el-table
v-loading="listLoading3"
:data="tableDataPicking"
border
style="width: 100%;"
height="200">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="物料名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="组件名称" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.组件名称 }}
</template>
</el-table-column>
<el-table-column label="领用数量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200">
<template slot-scope="scope">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 10px 10px" @click="editListDetailx(scope.row)">编辑</el-button>
<el-button size="small" type="danger" icon="el-icon-delete" style="margin: 0 0 10px 10px" @click="dropListdetail(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataBasic"
border
style="width: 100%;"
height="200">
<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">
<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" align="center">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center" min-width="80">
<template slot-scope="scope" align="center">
{{ scope.row.零件类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="80">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addBasicListDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
<el-table
v-loading="listLoading1"
:data="tableDataPurchase"
border
style="width: 100%;"
height="200">
<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">
<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">
<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" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addListDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table
v-loading="listLoadingx"
:data="tableDataHouse"
border
style="width: 100%;"
height="200">
<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">
<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">
<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" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 10px" @click="addWorkshopDetailinfor(scope.row)">领料</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrentx"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="totalx"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChangex"
@current-change="handleCurrentChangex"/>
</div>
</el-card>
<!--基本件领料对话框-->
<el-dialog :visible.sync="dialogFormVisible1" title="基本件通用件领料" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.OutNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.outNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="addBasicListDetail()"> </el-button>
</div>
</el-dialog>
<!--外购件领料对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="外购件标准件领料" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.OutNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.outNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="execaddListDetail()"> </el-button>
</div>
</el-dialog>
<!--车间采购件领料对话框-->
<el-dialog :visible.sync="dialogFormVisibleWork" title="车间采购件领料" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.OutNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.outNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="addWorkshopListDetail()"> </el-button>
</div>
</el-dialog>
<!--编辑领料明细对话框-->
<el-dialog :visible.sync="dialogFormVisible2" title="领料单明细" center width="380px">
<el-form ref="form2" :model="form2" :rules="rules" label-position="left">
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form2.OutNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form2.outNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form2')">取消</el-button>
<el-button type="primary" @click="submitChannge()"> </el-button>
</div>
</el-dialog>
<!--领料单-->
<!--<el-card v-show="card">-->
<!--<table cellspacing="0px" align="center" id="cjn" width="100%" style="">-->
<!--<tbody id="1">-->
<!--<tr>-->
<!--<td colspan="4" style="text-align: left;font-size: 30px;font-weight: bold">GAOJING</td>-->
<!--<td colspan="24" style="text-align:center;font-size: 30px;font-weight: bold">领料单</td>-->
<!--</tr>-->
<!--<tr class="tbodyHead">-->
<!--<td colspan="2">领料单号:</td>-->
<!--<td colspan="6">{{任务单号}}</td>-->
<!--<td colspan="4">领料日期:</td>-->
<!--<td colspan="4">{{任务下达日期}}</td>-->
<!--<td colspan="3">领料人:</td>-->
<!--<td colspan="9">{{外协厂家}}</td>-->
<!--</tr>-->
<!--<tr id="tableHead">-->
<!--<td style="width: 2%">序号</td>-->
<!--<td colspan="5">物料型号</td>-->
<!--<td colspan="2" style="width: 4%">物料名称</td>-->
<!--<td colspan="2" style="width: 4%">物料规格</td>-->
<!--<td colspan="9" width="30%">数量</td>-->
<!--<td colspan="1">项目名称</td>-->
<!--<td>机床名称</td>-->
<!--<td>组件名称</td>-->
<!--<td>备注</td>-->
<!--</tr>-->
<!--</tbody>-->
<!--</table>-->
<!--</el-card>-->
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, searchBasicPart, searchList, addList, dropList, addListDetail, searchListDetail, dropListDetail, editListDetail, searchHoursePart } from '@/api/Inventory/PickingList'
import { mapGetters } from 'vuex'
// import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
export default {
data() {
return {
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
tableDataPurchase: [],
tableData1: [],
tableDataPicking: [], // 领料单明细表格
listNumber: '',
pickingListNumber: null, // 领料单编号
pickingListNumberx: '', // 领料单流水号
picikingPeople: '', // 领料人流水号
partProjectNumber: '', // 项目流水号
partProjectName: '', // 项目名称
partMachineNumber: '', // 机床流水号
partMachineName: '', // 机床名称
partGroupNumber: '', // 分组流水号
partGroupName: '', // 分组名称
form: {
OutNumber: '', // 出库数量
outNote: '' // 出库备注
},
rules: { // 表单验证规则
OutNumber: [{ required: true, message: '请输入出库数量', trigger: 'blur' }],
outNote: [{ required: true, message: '请输入出库备注', trigger: 'blur' }]
},
form2: {
OutNumber: '', // 出库数量
outNote: '' // 出库备注
},
rules2: { // 表单验证规则
OutNumber: [{ required: true, message: '请输入出库数量', trigger: 'blur' }],
outNote: [{ required: true, message: '请输入出库备注', trigger: 'blur' }]
},
partType: '', // 零件类型
craftplannumber: '', // 工艺计划流水号
receive: '', // 收件信息ID
teamPart: '', // 组件零件流水号
locatenumber: '', // 货位流水号
listLoading: false,
listLoading1: false,
listLoading2: false,
listLoading3: false,
PageCurrent: 1,
PageSize: 10,
total: null,
PageCurrent1: 1,
PageSize1: 10,
total1: null,
PageCurrent2: 1,
PageSize2: 10,
total2: null,
PageCurrent3: 1,
PageSize3: 10,
total3: null,
PageCurrentx: 1,
PageSizex: 10,
totalx: null,
materialName: '',
materialNumber: '',
materialType: '',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
card: true,
pickingListDetail: '',
tableDataHouse: [],
listLoadingx: '',
purchaseDetailNum: '',
dialogFormVisibleWork: false
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.fetchData()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
console.log(this.picikingPeople)
},
searchMachine() { // 查询机床
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
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].组件流水号
})
}
})
},
searchPartinfo() {
this.tableDataPurchase = []
this.tableDataBasic = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
this.listLoading = true
this.listLoading1 = true
this.listLoadingx = true
searchPurchasePart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
console.log(response)
this.tableDataPurchase = response.data.rows
this.listLoading = false
this.total1 = response.data.total
})
searchBasicPart(this.PageCurrent1, this.PageSize1, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataBasic = response.data.rows
this.listLoading1 = false
this.total = response.data.total
console.log(response)
})
searchHoursePart(this.PageCurrentx, this.PageSizex, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataHouse = response.data.rows
this.listLoadingx = false
this.totalx = response.data.total
console.log(response)
})
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
},
handleSizeChange1(val) {
this.PageCurrent1 = 1
this.PageSize1 = val
this.searchPartinfo()
},
handleCurrentChange1(val) {
this.PageCurrent1 = val
this.searchPartinfo()
},
handleSizeChangex(val) {
this.PageCurrentx = 1
this.PageSizex = val
this.searchPartinfo()
},
handleCurrentChangex(val) {
this.PageCurrentx = val
this.searchPartinfo()
},
// 查询领料单
searchListinfor() {
this.listLoading2 = true
searchList(this.PageCurrent2, this.PageSize2, this.pickingListNumber).then(response => {
this.tableData1 = response.data.rows
this.listLoading2 = false
this.total2 = response.data.total
})
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
this.PageSize2 = val
this.searchListinfor()
},
handleCurrentChange2(val) {
this.PageCurrent2 = val
this.searchListinfor()
},
// 查询领料单明细
searchListDetailt() {
this.listLoading3 = true
searchListDetail(this.pickingListNumberx).then(response => {
console.log(response)
this.tableDataPicking = response.data
this.listLoading3 = false
})
},
// 增加领料单
addListinfor() {
addList(this.picikingPeople).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.searchListinfor()
} else {
this.$message.error('增加失败')
}
})
},
// 删除领料单
dropListinfor(row) {
this.pickingListNumberx = row.领料单流水号
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropList(this.pickingListNumberx).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchListinfor()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 删除领料单明细
dropListdetail(row) {
this.pickingListDetail = row.领料单明细流水号
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropListDetail(this.pickingListDetail).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchListDetailt()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 选择领料单
chooseListinfor(row) {
this.pickingListNumberx = row.领料单流水号
},
// 增加基本件领料单明细
addBasicListDetailinfor(row) {
this.form = []
this.partProjectNumber = row.项目流水号
this.partProjectName = row.项目名称
this.partMachineNumber = row.机床流水号
this.partMachineName = row.机床名称
this.partGroupNumber = row.组件流水号
this.partGroupName = row.组件名称
this.partType = row.零件类型
this.craftplannumber = row.工艺计划流水号
this.receive = row.收件信息id
this.teamPart = row.组件零件流水号
this.locatenumber = row.货位流水号
this.materialName = row.零件名称
this.materialNumber = row.零件图号
this.dialogFormVisible1 = true
this.materialName = row.零件名称
this.materialType = row.零件类型名称
this.materialNumber = row.零件图号
console.log(this.receive, 41645)
},
addBasicListDetail() {
if (this.pickingListNumberx === '') {
this.$message.error('请选择领料单')
} if (this.form.OutNumber === '') {
this.$message.error('请输入领用数量')
}
addListDetail(this.pickingListNumberx, this.partProjectNumber, this.partMachineNumber, this.partGroupNumber, this.partProjectName, this.partMachineName, this.partGroupName, this.materialName, this.materialType, this.materialNumber, this.form.OutNumber, this.partType, this.form.outNote, this.craftplannumber, this.receive, this.teamPart, this.locatenumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
this.dialogFormVisible1 = false
this.searchListinfor()
},
// 增加外购件领料单明细
addListDetailinfor(row) {
this.form = []
this.partProjectNumber = row.项目流水号
this.partProjectName = row.项目名称
this.partMachineNumber = row.机床流水号
this.partMachineName = row.机床名称
this.partGroupNumber = row.组件流水号
this.partGroupName = row.组件名称
this.partType = row.零件类型代码
this.craftplannumber = row.工艺计划流水号
this.receive = row.收件信息ID
this.teamPart = row.组件零件流水号
this.locatenumber = row.货位流水号
this.materialName = row.物料名称
this.materialNumber = row.物料型号
this.materialType = row.物料规格
this.dialogFormVisible = true
this.purchaseDetailNum = row.采购合同明细流水号
},
execaddListDetail() {
if (this.pickingListNumberx === '') {
this.$message.error('请选择领料单')
} else if (this.OutNumber === '') {
this.$message.error('请输入领用数量')
} else {
addListDetail(this.pickingListNumberx, this.partProjectNumber, this.partMachineNumber, this.partGroupNumber, this.partProjectName, this.partMachineName, this.partGroupName, this.materialName, this.materialType, this.materialNumber, this.form.OutNumber, this.partType, this.form.outNote, this.craftplannumber, this.receive, this.teamPart, this.locatenumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
}
this.dialogFormVisible = false
this.searchListinfor()
},
// 增加车间采购领料单明细
addWorkshopDetailinfor(row) {
this.form = []
this.partProjectNumber = row.项目流水号
this.partProjectName = row.项目名称
this.partMachineNumber = row.机床流水号
this.partMachineName = row.机床名称
this.partGroupNumber = row.组件流水号
this.partGroupName = row.组件名称
this.partType = row.零件类型
this.receive = row.收件信息ID
this.locatenumber = row.货位流水号
this.materialName = row.物料名称
this.materialNumber = row.物料型号
this.materialType = row.物料规格
this.dialogFormVisibleWork = true
this.purchaseDetailNum = row.采购合同明细流水号
},
addWorkshopListDetail() {
if (this.pickingListNumberx === '') {
this.$message.error('请选择领料单')
} else if (this.OutNumber === '') {
this.$message.error('请输入领用数量')
} else {
addListDetail(this.pickingListNumberx, this.partProjectNumber, this.partMachineNumber, this.partGroupNumber, this.partProjectName, this.partMachineName, this.partGroupName, this.materialName, this.materialType, this.materialNumber, this.form.OutNumber, this.partType, this.form.outNote, this.craftplannumber, this.receive, this.teamPart, this.purchaseDetailNum, this.locatenumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else {
this.$message.error('增加失败')
}
})
}
this.dialogFormVisibleWork = false
this.searchListinfor()
},
// 修改领料单明细
editListDetailx(row) {
this.dialogFormVisible2 = true
this.pickingListDetail = row.领料单明细流水号
},
submitChannge() {
editListDetail(this.pickingListDetail, this.form2.OutNumber, this.form2.outNote).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
} else {
this.$message.error('修改失败')
}
})
this.dialogFormVisible2 = false
this.searchListDetailt()
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
this.dialogFormVisible1 = false
this.dialogFormVisible2 = false
this.dialogFormVisibleWork = false
this.form2.OutNumber = ''
this.form2.outNote = ''
},
// 导出状态
handleDownload() {
searchListDetail(this.pickingListNumberx).then(response => {
return response.data
}).then(data => {
const a = data
require.ensure([], () => {
const { export_json_to_excel } = require('@/vendor/Export2Excel')
const tHeader = ['物料名称', '物料型号', '物料规格', '项目名称', '机床名称', '组件名称', '领用数量', '备注']
const filterVal = ['物料名称', '物料型号', '物料规格', '项目名称', '机床名称', '组件名称', '领用数量', '备注']
const list = a
const data = this.formatJson(filterVal, list)
export_json_to_excel(tHeader, data, '领料单')
})
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
}
// downLoadCjn(tableid) {
// if (this.List3.length === 0) {
// this.$message.warning('暂无数据')
// } else {
// getExplorer()
// method5(tableid)
// Cleanup()
// }
// }
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,103 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">替换单编号</span>
<el-input v-model="substituteNumber" clearable size="small" style="width:200px" />
<span style="margin: 5px">零件图号</span>
<el-input v-model="partNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="getSubstitutedCard()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataExchange"
border
style="width: 100%;"
height="450">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-back" style="margin: 0 0 0 0px" @click="substitutePart(scope.row)">替换件到货</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchSubstitutedCard, SubstitutedCome } from '@/api/Inventory/SubPartCome'
export default {
data() {
return {
tableDataExchange: [],
substituteNumber: '',
partNumber: '',
listLoading: '',
subList: '',
locateNumber: '',
subNumber: ''
}
},
methods: {
// 替换单查询
getSubstitutedCard() {
this.listloading = true
searchSubstitutedCard().then(response => {
this.tableDataExchange = response.data
this.listloading = false
})
},
// 替换件到货
substitutePart(row) {
this.subList = row.替换单流水号
this.locateNumber = row.物料与货位对照流水号
this.subNumber = row.替换数量
SubstitutedCome(this.subList, this.locateNumber, this.subNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('到货替换成功')
} else { this.$message.error('到货替换失败') }
})
this.getSubstitutedCard()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,488 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称:</span>
<el-select v-model="ProjectValue" filterable clearable size="small" placeholder="请选择项目名称" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号:</span>
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床图号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>组号:</span>
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="组号" style="width: 200px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="total = 0;pageSize = 10;pageList = 1;searchPartinfo()">查询</el-button><br>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableDataPurchase"
border
style="width: 100%;"
height="200">
<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">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-sort-down" style="margin: 0 0 0 0px" @click="selecting(scope.row)">替换</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-row>
<el-col :span="11">
<div>
<el-table
v-loading="listLoading"
:data="tableData1"
border
style="width: 100%;"
height="100"
>
<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">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col :span="2">
<div style="margin: 0px 15px">
<el-button size="small" type="warning" icon="el-icon-edit" @click="addSub()" >替换件</el-button>
</div>
<div style="margin: 10px 15px">
<el-button size="small" type="primary" icon="el-icon-edit" @click="exchange()" >替换</el-button>
</div>
</el-col>
<el-col :span="11">
<div>
<el-table
:data="tableData2"
border
style="width: 100%;"
height="100">
<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">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
<!--新增替换件对话框-->
<el-dialog :title="title" :visible.sync="dialogFormVisible" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="替换单编号" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.ExchangeNumber" size="small" placeholder="请输入零件替换单编号" style="width: 200px"/>
</el-form-item>
<el-form-item label="替换数量" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.ExchangeNumberx" size="small" placeholder="请输入替换数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.ExchangeNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button v-show="title==='替换'" type="primary" @click="addListDetailinfor('form')"> </el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div>
</el-dialog>
<!--选择替换件-->
<el-dialog :visible.sync="dialogFormVisible2" title="新增替换件" center width="600px">
<el-form :rules="rules" label-position="left">
<el-form-item label="物料名称" prop="ContractNumberValue" label-width="150px" size="small">
<el-input v-model="form.ExchangeNumber" size="small" placeholder="物料名称" style="width: 200px"/>
<el-button type="primary" @click="getSubstituted()">查询</el-button>
</el-form-item>
<el-table
:data="tableDataSub"
border
style="width: 100%;"
height="100">
<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="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-sort-down" style="margin: 0 0 0 0px" @click="selected(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="chooseSub()"> </el-button>
</div>
</el-dialog>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataExchange"
border
style="width: 100%;"
height="200">
<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">
<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">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<template slot-scope="scope" align="center">
<el-button size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="danger" icon="el-icon-delete" style="margin: 0 0 0 0px" @click="dropListinfor(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, searchSubstituted, addSubstitutepart, searchSubstitutedCard, deleteSubstitutedCard, editSubstitutedCard } from '@/api/Inventory/SubstitutePart'
import { mapGetters } from 'vuex'
export default {
data() {
return {
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataPurchase: [],
tableDataExchange: [],
tableData1: [],
tableData2: [],
listNumber: '',
picikingPeople: '', // 领料人流水号
partProjectNumber: '', // 项目流水号
partProjectName: '', // 项目名称
partMachineNumber: '', // 机床流水号
partMachineName: '', // 机床名称
partGroupNumber: '', // 分组流水号
partGroupName: '', // 分组名称
OutNumber: '', // 出库数量
outNote: '', // 出库备注
dialogFormVisible: false,
dialogFormVisible2: false,
arr: [],
tableDataSub: [],
form: {
ExchangeNumber: '', // 交换件编号
ExchangeNumberx: '', // 交换件数量
ExchangeNote: '' // 交换件备注
},
rules: { // 表单验证规则
ExchangeNumber: [{ required: true, message: '请输入交换件编号', trigger: 'blur' }],
ExchangeNumberx: [{ required: true, message: '请输入交换件数量', trigger: 'blur' }],
ExchangeNote: [{ required: true, message: '请输入交换件备注', trigger: 'change' }]
},
listLoading: '',
listLoading1: '',
substituteListNumber: '',
title: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.fetchData()
this.getSubstitutedCard()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
console.log(this.picikingPeople)
},
searchMachine() { // 查询机床
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
},
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].组件流水号
})
}
})
},
// 被替换件查询
searchPartinfo() {
this.tableDataPurchase = []
if (this.ProjectValue === ' ') {
this.ProjectValue_check = 0
}
if (this.MachineValue === ' ') {
this.MachineValue_check = 0
}
if (this.GroupNumValue === ' ') {
this.GroupNumValue_check = 0
}
this.listLoading = true
searchPurchasePart(this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableDataPurchase = response.data
console.log(this.tableDataPurchase)
this.listLoading = false
})
},
// 重置表单
callOff() {
this.dialogFormVisible = false
this.dialogFormVisible2 = false
},
addSub() {
this.dialogFormVisible2 = true
},
// 被替换件查询
getSubstituted() {
searchSubstituted().then(response => {
this.tableDataSub = response.data
})
},
// 替换单查询
getSubstitutedCard() {
this.listLoading1 = true
searchSubstitutedCard().then(response => {
this.tableDataExchange = response.data
this.listLoading1 = false
})
},
// 选中零件交换
selecting(row) {
const arr = new Array(row)
this.tableData1 = arr
console.log(this.tableData1)
},
// 选中被零件交换
selected(row) {
const arr = new Array(row)
this.tableData2 = arr
},
// 确认选择零件
chooseSub() {
this.dialogFormVisible2 = false
},
// 增加交换件
addListDetailinfor() {
addSubstitutepart(this.tableData2[0].离线合同明细流水号, this.tableData1[0].组件零件流水号, this.form.ExchangeNumber, this.tableData1[0].物料名称, this.tableData2[0].物料名称, this.picikingPeople, this.form.ExchangeNumberx, this.form.ExchangeNote).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else { this.$message.error('增加失败') }
})
this.dialogFormVisible = false
this.getSubstitutedCard()
},
// 打开替换表单
exchange() {
this.form = []
this.dialogFormVisible = true
this.title = '替换'
},
// 删除替换单
dropListinfor(row) {
this.substituteListNumber = row.替换单流水号
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSubstitutedCard(this.substituteListNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getSubstitutedCard().then(response => {
})
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit(row) {
this.substituteListNumber = row.替换单流水号
this.form.ExchangeNumber = row.替换单编号
this.form.ExchangeNumberx = row.替换数量
this.form.ExchangeNote = row.备注
this.title = '编辑'
this.dialogFormVisible = true
},
submitEdit() {
this.editTable(editSubstitutedCard, [this.substituteListNumber, this.form.ExchangeNumber, this.form.ExchangeNumberx, this.form.ExchangeNote], 'form', function() { this.getSubstitutedCard(); this.dialogFormVisible = false })
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,259 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">零件图号</span>
<el-input v-model="partNumber" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="getscantable()">查询</el-button>
<el-button size="small" type="danger" icon="el-icon-remove-outline" style="margin: 0 0 0 10px" @click="Empty()">清空</el-button>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData"
border
style="width: 100%;height: 650px" >
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table-column label="项目名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="计划数量" align="center" min-width="100">
<template slot-scope="scope" align="center">
<el-input v-model="tableData[scope.$index].plannumber" readonly size="small"/>
</template>
</el-table-column>
<el-table-column label="入库数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="tableData[scope.$index].innumber" clearable size="small"/>
</template>
</el-table-column>
<el-table-column label="仓库" align="center" min-width="100">
<template slot-scope="scope">
<el-select v-model="inventoryNumber" filterable clearable size="small" placeholder="仓库名称" @change="Getlocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="120">
<template slot-scope="scope">
<el-select v-model="locateNumber" filterable clearable size="small" placeholder="货位名称">
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope" align="center">
<el-input v-model="tableData[scope.$index].note" clearable size="small"/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150">
<template slot-scope="scope">
<el-button type="primary" size="mini" class="el-icon-success" @click="Innumber">入库</el-button>
<el-button
size="mini"
type="danger"
class="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable, insertOne, getinventory, getlocate } from '@/api/Inventory/Inboundscanning'
import { mapGetters } from 'vuex'
import { wsuri, name } from '@/utils/request'
import print from '@/vendor/print'
export default {
data() {
return {
ace: 0,
a: '',
tableData: [],
partNumber: '',
listLoading: false,
craftplannumber: '',
radio2: 3,
PeopleNumber: '',
inventoryName: [], // 仓库名称下拉框
inventoryNumber: '',
locateName: [], // 货位名称下拉框
locateNumber: ''
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.initWebpack()
this.getpeopleid()
this.Getinvent()
},
methods: {
handleDelete(index, row) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.tableData.splice(index, 1)
this.$message({
message: '已被成功移除',
type: 'success'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
aaa() {
print('#print')
},
initWebpack() { // 初始化websocket
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onmessage = this.websocketonmessage
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
websocketopen() { // 打开
console.log('WebSocket连接成功')
this.websock.send('{<' + name + '>}')
},
websocketonmessage(msg) { // 数据接收
this.partNumber = msg.data.split('|')[3]
this.getscantable()
},
websocketclose() { // 关闭
console.log('WebSocket关闭')
},
websocketerror() { // 失败
console.log('WebSocket连接失败')
},
// 扫描查询
getscantable() {
if (this.partNumber === '') {
this.$message.error('请输入零件号')
} else {
this.listLoading = true
searchTable(this.partNumber).then(response => {
if (response.data.length === 0) {
this.listLoading = false
this.$message.warning('无此零件')
} else {
for (let i = 0; i < this.tableData.length; i++) {
if (response.data[0].工艺计划流水号 === this.tableData[i].工艺计划流水号) {
this.ace = this.ace + 1
}
}
if (this.ace === 0) {
this.tableData.push({
plannumber: response.data[0].剩余数量,
innumber: response.data[0].入库数量,
capture: '',
note: '',
工艺计划流水号: response.data[0].工艺计划流水号,
项目名称: response.data[0].项目名称,
机床图号: response.data[0].机床图号,
零件图号: response.data[0].零件图号
})
} else {
this.$message.error('此件已在列表中')
}
}
}).then(() => {
this.listLoading = false
this.ace = 0
})
}
},
// 修改入库
Innumber() {
this.$confirm('此操作将不可逆转,且如果入库数量大于计划数量,则全部入库,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].innumber > this.tableData[i].plannumber) {
this.tableData[i].innumber = this.tableData[i].plannumber
}
insertOne(this.tableData[i].工艺计划流水号, this.tableData[i].innumber, this.PeopleNumber, this.tableData[i].capture, this.inventoryNumber, this.locateNumber, this.tableData[i].note).then(response => {
this.$message({
type: 'success',
message: '零件入库成功!'
})
}).then(() => {
this.Empty()
})
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消入库'
})
})
},
// 清空
Empty() {
this.tableData = []
},
// 仓库查询
Getinvent() {
this.getSelect(getinventory, ['仓库名称', '仓库流水号'], 'inventoryName')
},
// 根据项目获取机床
Getlocate() {
this.locateName = []
this.locateNumber = ''
if (this.inventoryNumber) {
this.getSelect(getlocate, ['货位名称'], 'locateName', this.inventoryNumber)
}
}
}
}
</script>
<style scoped>
.el-card {
margin-bottom: 15px;
}
</style>

View File

@@ -0,0 +1,230 @@
<template>
<div class="app-container">
<el-card>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading=""
:data="tableData1"
border
highlight-current-row
style="width: 100%;max-height: 250px;"
height="250px"
size="mini"
@row-click="searchTable2">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="250">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="到货情况" align="center" min-width="70">
<template slot-scope="scope">
<el-tag v-if="judge[scope.$index]===1" type="success" size="small">全部到货</el-tag>
<el-tag v-if="judge[scope.$index]===2" type="warning" size="small">即将拖期</el-tag>
<el-tag v-if="judge[scope.$index]===3" type="danger" size="small">已拖期</el-tag>
<el-tag v-if="judge[scope.$index]===4" type="primary" size="small">进度正常</el-tag>
</template>
</el-table-column>
<el-table-column label="到货进度" align="center" min-width="150">
<template slot-scope="scope">
<el-progress
:text-inside="true"
:stroke-width="18"
:percentage="100*(parseInt(scope.row.合同物料到货总数)/parseInt(scope.row.合同物料采购总数)).toFixed(4)"
status="success"/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="" :data="tableData2" stripe border style="width: 100%;max-height: 300px;margin-top: 10px" height="300px" size="mini">
<el-table-column label="采购合同编号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="物料规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="已到货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.总到货数量 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initArrivalStateContact, searchArrivalState, searchArrivalNum } from '@/api/PurchasingCenter/ArrivalStateSearch'
import { mapGetters } from 'vuex'
export default {
name: '', // 项目总价查询
data() {
return {
check1: 0,
check2: 0,
contractNumValue: '',
contractNum: [],
supplierName: '',
tableData1: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
tableData2: [],
now: '',
arrival: [],
judge: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initArrivalStateContact().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
},
searchTable1() {
this.arrival = [] // 规定到货时间数组
this.now = new Date()
this.contractNumValue ? this.check1 = 1 : this.check1 = 0
this.supplierName ? this.check2 = 1 : this.check2 = 0
searchArrivalState(this.pageCurrent1, this.pageSize1, this.check1, this.contractNumValue, this.check2, this.supplierName).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
this.arrival.push(new Date(response.data.rows[i].规定到货时间))
if (parseInt(response.data.rows[i].合同物料到货总数) === parseInt(response.data.rows[i].合同物料采购总数)) {
this.judge[i] = 1
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) > 0 && (this.now - this.arrival[i]) < 86400000) {
this.judge[i] = 2
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) > 86400000) {
this.judge[i] = 3
} else if (parseInt(response.data.rows[i].合同物料到货总数) !== parseInt(response.data.rows[i].合同物料采购总数) && (this.now - this.arrival[i]) < 0) {
this.judge[i] = 4
}
}
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
searchArrivalNum(row.采购合同流水号).then(response => {
this.tableData2 = response.data
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,670 @@
<template>
<div class="app-container">
<el-card>
<span>开始时间:</span>
<el-date-picker
v-model="startDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>结束时间:</span>
<el-date-picker
v-model="endDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>合同号:</span>
<el-input v-model="contractNum" placeholder="合同号" size="small" style="width:180px" clearable/>
<span>采购员:</span>
<el-input
v-model="buyerName"
placeholder="采购员"
size="small"
readonly
clearable
style="width:100px"
@dblclick.native="initBuyer();dialogVisible2=true;submitDisable=true"/>
<span>供应商:</span>
<el-input
v-model="supplierName"
placeholder="供应商"
size="small"
readonly
clearable
style="width:180px"
@dblclick.native="dialogVisible1=true;submitDisable=true"
@clear="emptySupplierDetail"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="loading1" :data="tableData1" size="mini" border style="width: 100%;">
<el-table-column label="采购合同编号" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.规定到货时间 }}
</template>
</el-table-column>
<el-table-column label="供应商" min-width="200" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="总金额" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="采购员" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="本次请款金额" min-width="100" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.本次应请款" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="请款付款情况" width="810" align="center">
<template slot-scope="scope">
<el-table v-show="tableData11[scope.$index].length!==0" :data="tableData11[scope.$index]" size="mini" border style="width: 100%;">
<el-table-column label="次数" min-width="60" align="center" type="index"/>
<el-table-column label="请款金额" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="请款时间" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
<el-table-column label="审核情况内容" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.审核情况内容 }}
</template>
</el-table-column>
<el-table-column label="未通过审核原因" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审核原因 }}
</template>
</el-table-column>
<el-table-column label="审批情况内容" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.审批情况内容 }}
</template>
</el-table-column>
<el-table-column label="未通过审批原因" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.未通过审批原因 }}
</template>
</el-table-column>
<el-table-column label="付款情况" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.付款情况内容 }}
</template>
</el-table-column>
<el-table-column label="未付款原因" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.未付款原因 }}
</template>
</el-table-column>
<el-table-column width="100" align="center">
<template slot-scope="scope">
<el-button
type="danger"
size="mini"
icon=""
@click="cancelRequestFund(scope.row)">取消请款</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column label="请款" min-width="80" align="center" fixed="right">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
icon=""
@click="requestFund(scope.row)">请款</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-card>
<el-card>
<span>请款开始时间:</span>
<el-date-picker
v-model="startRequestDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<span>请款结束时间:</span>
<el-date-picker
v-model="endRequestDate"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="searchRequestTable">查询</el-button>
<el-button
type="warning"
size="small"
icon="el-icon-download"
style="margin-left:10px"
>导出Excel</el-button>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="tableData2" size="mini" border style="width: 100%;min-height:300px" height="300px">
<el-table-column label="采购合同编号" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.规定到货时间 }}
</template>
</el-table-column>
<el-table-column label="实际到货时间" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.实际到货时间 }}
</template>
</el-table-column>
<el-table-column label="供应商" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="总金额" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="欠款金额" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.欠款金额 }}
</template>
</el-table-column>
<el-table-column label="采购员" width="70" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="请款金额" min-width="80" align="center">
<template slot-scope="scope">
{{ scope.row.请款金额 }}
</template>
</el-table-column>
<el-table-column label="请款时间" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.请款时间 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px">
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
<el-row>
<el-col :span="12">
<el-form-item label="供应商名称">
<el-input v-model="supplierName" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企业性质">
<el-input v-model="enterpriseNature" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="货期">
<el-input v-model="goodTime" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册资本">
<el-input v-model="registeredCapital" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="税号">
<el-input v-model="taxNum" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电子邮箱">
<el-input v-model="EMail" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="地址">
<el-input v-model="address" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="账号">
<el-input v-model="account" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="开户行">
<el-input v-model="openingBank" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话号码">
<el-input v-model="phone" size="small"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="传真">
<el-input v-model="fax" size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button
type="success"
size="small"
icon="el-icon-search"
@click="searchSupplier">查询</el-button>
<el-button
:disabled="submitDisable"
type="primary"
size="small"
icon="el-icon-check"
@click="submitSelectSupplier">确定</el-button>
<el-button
type="danger"
size="small"
icon="el-icon-delete"
@click="emptySupplierDetail">清空</el-button>
</el-col>
</el-row>
<el-table :data="tableData01" size="mini" style="width: 97%;max-height: 300px;margin-top:15px" height="200px" border @row-click="showSupplierDetail">
<el-table-column align="center" label="供应商名称" width="200">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="企业性质">
<template slot-scope="scope">
{{ scope.row.企业性质 }}
</template>
</el-table-column>
<el-table-column align="center" label="创立日期">
<template slot-scope="scope">
{{ scope.row.创立日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="注册资本">
<template slot-scope="scope">
{{ scope.row.注册资本 }}
</template>
</el-table-column>
</el-table>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogVisible2" title="采购员选择" center style="min-height: 300px;" width="40%">
<el-table
:data="tableData02"
size="small"
border
style="width: 100%;min-height:300px"
height="300px"
highlight-current-row
@row-click="clickBuyer">
<el-table-column label="考勤编号" align="center">
<template slot-scope="scope">
{{ scope.row.考勤编号 }}
</template>
</el-table-column>
<el-table-column label="姓名" align="center">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="性别" align="center">
<template slot-scope="scope">
{{ scope.row.性别 }}
</template>
</el-table-column>
<el-table-column label="工作岗位" align="center">
<template slot-scope="scope">
{{ scope.row.岗位名称 }}
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button :disabled="submitDisable" type="primary" size="small" icon="el-icon-check" @click="submitSelectBuyer">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchSupplier, searchTable1, requestFund, searchCondition, cancelRequestFund, searchRequestTable, initBuyer } from '@/api/PurchasingCenter/BuyerRequestFund'
import { mapGetters } from 'vuex'
export default {
data() {
return {
tableData02: [],
dialogVisible2: false,
loading2: false,
tableData2: [],
tableData11: [],
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
startDate: '',
endDate: '',
contractNum: '',
buyerName: '',
dialogVisible1: false,
submitDisable: true,
form1: {},
supplierValue: '',
supplierName: '',
enterpriseNature: '',
createDate: '',
registeredCapital: '',
taxNum: '',
EMail: '',
address: '',
account: '',
openingBank: '',
phone: '',
fax: '',
goodTime: '',
supplierCheck1: 0,
supplierCheck2: 0,
supplierCheck3: 0,
supplierCheck4: 0,
supplierCheck5: 0,
supplierCheck6: 0,
supplierCheck7: 0,
supplierCheck8: 0,
supplierCheck9: 0,
supplierCheck10: 0,
supplierCheck11: 0,
supplierCheck12: 0,
tableData01: [],
loading1: false,
tableData1: [],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startRequestDate: '',
endRequestDate: '',
checkRequest: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
methods: {
submitSelectBuyer() { // 确定
this.dialogVisible2 = false
},
clickBuyer(row) { // 点击采购员表某一行
this.submitDisable = false
this.buyerName = row.姓名
},
initBuyer() { // 初始化采购人员
initBuyer().then(response => {
this.tableData02 = response.data
})
},
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
this.createDate ? this.supplierCheck3 = 1 : (this.supplierCheck3 = 0, this.createDate = '')
this.registeredCapital ? this.supplierCheck4 = 1 : (this.supplierCheck4 = 0, this.registeredCapital = '')
this.taxNum ? this.supplierCheck5 = 1 : (this.supplierCheck5 = 0, this.taxNum = '')
this.EMail ? this.supplierCheck6 = 1 : (this.supplierCheck6 = 0, this.EMail = '')
this.address ? this.supplierCheck7 = 1 : (this.supplierCheck7 = 0, this.address = '')
this.account ? this.supplierCheck8 = 1 : (this.supplierCheck8 = 0, this.account = '')
this.openingBank ? this.supplierCheck9 = 1 : (this.supplierCheck9 = 0, this.openingBank = '')
this.phone ? this.supplierCheck10 = 1 : (this.supplierCheck10 = 0, this.phone = '')
this.fax ? this.supplierCheck11 = 1 : (this.supplierCheck11 = 0, this.fax = '')
this.goodTime ? this.supplierCheck12 = 1 : (this.supplierCheck12 = 0, this.goodTime = '')
searchSupplier(this.supplierCheck1, this.supplierName, this.supplierCheck2, this.enterpriseNature, this.supplierCheck3, this.createDate, this.supplierCheck4, this.registeredCapital, this.supplierCheck5, this.taxNum, this.supplierCheck6, this.EMail, this.supplierCheck7, this.address, this.supplierCheck8, this.account, this.supplierCheck9, this.openingBank, this.supplierCheck10, this.phone, this.supplierCheck11, this.fax, this.supplierCheck12, this.goodTime).then(response => {
this.tableData01 = response.data
})
},
submitSelectSupplier() { // 确定选择供应商
this.dialogVisible1 = false
},
emptySupplierDetail() { // 清空
this.submitDisable = true
this.supplierValue = ''
this.supplierName = ''
this.enterpriseNature = ''
this.createDate = ''
this.registeredCapital = ''
this.taxNum = ''
this.EMail = ''
this.address = ''
this.account = ''
this.openingBank = ''
this.phone = ''
this.fax = ''
this.goodTime = ''
},
showSupplierDetail(row) { // 点击供应商表某一行
this.submitDisable = false
this.supplierValue = row.供应商流水号
this.supplierName = row.供应商名称
this.enterpriseNature = row.企业性质
this.createDate = row.创立日期
this.registeredCapital = row.注册资本
this.taxNum = row.税号
this.EMail = row.电子信箱
this.address = row.地址
this.account = row.帐号
this.openingBank = row.开户行
this.phone = row.电话号码
this.fax = row.传真
this.goodTime = row.货期
},
searchTable1() {
this.loading1 = true
this.tableData1 = []
this.startDate && this.endDate ? this.check1 = 1 : this.check1 = 0
this.contractNum ? this.check2 = 1 : this.check2 = 0
this.buyerName ? this.check3 = 1 : this.check3 = 0
this.supplierName ? this.check4 = 1 : this.check4 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startDate, this.endDate, this.check2, this.contractNum, this.check3, this.buyerName, this.check4, this.supplierName).then(response => {
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].规定到货时间 !== null) {
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
}
if (response.data.rows[j].实际到货时间 !== null) {
response.data.rows[j].实际到货时间 = response.data.rows[j].实际到货时间.substring(0, response.data.rows[j].实际到货时间.indexOf(' '))
}
this.tableData11[j] = []
searchCondition(response.data.rows[j].采购合同流水号).then(response0 => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
for (let i = 0; i < response0.data.length; i++) {
if (response0.data[i].请款时间 !== null) {
response0.data[i].请款时间 = response0.data[i].请款时间.substring(0, response0.data[i].请款时间.indexOf(' '))
}
this.tableData11[j].push(response0.data[i])
}
})
}
}).then(() => {
this.loading1 = false
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
requestFund(row) { // 请款
const day1 = new Date()
const day2 = day1.getFullYear() + '-' + (day1.getMonth() + 1) + '-' + day1.getDate()
requestFund(row.采购合同流水号, row.本次应请款, day2, this.id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('请款成功')
this.searchTable1()
this.startRequestDate = ''
this.endRequestDate = ''
this.tableData2 = []
} else { this.$message.error('请款失败') }
})
},
cancelRequestFund(row) { // 取消请款
this.$confirm('确认取消请款吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (parseInt(row.采购科请款流水号) !== 1) {
cancelRequestFund(row.采购科请款流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable1()
this.startRequestDate = ''
this.endRequestDate = ''
this.tableData2 = []
} else { this.$message.error('操作失败') }
})
} else {
this.$message.error('财务已经付款')
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
searchRequestTable() { // 查询请款表
this.loading2 = true
if (this.startRequestDate === '' || this.startRequestDate === null || this.endRequestDate === '' || this.endRequestDate === null) {
this.checkRequest = 0
} else { this.checkRequest = 1 }
searchRequestTable(this.checkRequest, this.startRequestDate, this.endRequestDate).then(response => {
for (let j = 0; j < response.data.length; j++) {
if (response.data[j].规定到货时间 !== null) {
response.data[j].规定到货时间 = response.data[j].规定到货时间.substring(0, response.data[j].规定到货时间.indexOf(' '))
}
if (response.data[j].实际到货时间 !== null) {
response.data[j].实际到货时间 = response.data[j].实际到货时间.substring(0, response.data[j].实际到货时间.indexOf(' '))
}
if (response.data[j].请款时间 !== null) {
response.data[j].请款时间 = response.data[j].请款时间.substring(0, response.data[j].请款时间.indexOf(' '))
}
}
this.tableData2 = response.data
this.loading2 = false
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px!important;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
</style>

View File

@@ -0,0 +1,636 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="12">
<el-card>
<el-row>
<span>时间段:</span>
<el-date-picker
v-model="startEndDate"
style="width:250px"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span>合同号:</span>
<el-select v-model="contractNumValue" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>采购员:</span>
<el-select v-model="personValue" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<span>供应商:</span>
<el-input v-model="supplierName" placeholder="供应商" size="small" clearable style="width:180px"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询新合同</el-button>
<span>变更原因:</span>
<el-input v-model="changeReason" placeholder="变更原因" size="small" clearable style="width:200px"/>
<el-button
type="primary"
size="small"
icon="el-icon-edit-outline"
style="margin-left:10px"
@click="contractChange">合同变更</el-button>
</el-row>
<el-table
v-loading="loading1"
:data="tableData1"
size="mini"
border
style="width: 100%;max-height: 250px;"
height="250px"
highlight-current-row
@row-click="searchTable2">
<el-table-column label="采购合同号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规定到货时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<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="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="deleteContract(scope.row)">作废</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-card>
<table id="01" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">需方</td>
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
<td colspan="1" align="center">合同编号</td>
<td colspan="1" align="center">{{ contract01 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier01 }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="02" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="04">
<tr id="tableHead01" style="height: 40px">
<td colspan="1" align="center">物料名称</td>
<td colspan="1" align="center">物料规格</td>
<td colspan="1" align="center">物料型号</td>
<td colspan="1" align="center">发货天数</td>
<td colspan="1" align="center">数量</td>
<td colspan="1" align="center">单价</td>
<td colspan="1" align="center">总价</td>
</tr>
</tbody>
<tfoot>
<tr style="height: 40px">
<td colspan="6">运费</td>
<td colspan="1" align="center">{{ freight01 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB01 }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount01 }}</td>
</tr>
</tfoot>
</table>
<div id="textarea01"/>
</el-card>
</el-card>
</el-col>
<el-col :span="12">
<el-card>
<el-row>
<span>时间段:</span>
<el-date-picker
v-model="startEndDate3"
style="width:250px"
size="small"
type="daterange"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span>合同号:</span>
<el-select v-model="contractNumValue3" placeholder="合同号" size="small" filterable clearable>
<el-option
v-for="item in contractNum3"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>采购员:</span>
<el-select v-model="personValue3" placeholder="采购员" size="small" style="width: 100px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<span>供应商:</span>
<el-input v-model="supplierName3" placeholder="供应商" size="small" clearable style="width:180px"/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left:10px"
@click="total3=0;pageCurrent3=1;pageSize3=10;searchTable3()">查询旧合同</el-button>
</el-row>
<el-table
v-loading="loading3"
:data="tableData3"
size="mini"
border
style="width: 100%;max-height: 250px;"
height="250px"
highlight-current-row
@row-click="searchTable4">
<el-table-column label="采购合同号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.采购合同编号 }}
</template>
</el-table-column>
<el-table-column label="采购合同名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.采购合同名称 }}
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column label="规定到货时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.规定到货时间 }}
</template>
</el-table-column>
<el-table-column label="采购员" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="总金额" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.总金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.付款方式内容 }}
</template>
</el-table-column>
<el-table-column label="更改标记" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.更改标记 }}
</template>
</el-table-column>
<el-table-column label="合同变更原因" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.合同变更原因 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<el-card>
<table id="11" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">需方</td>
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
<td colspan="1" align="center">合同编号</td>
<td colspan="1" align="center">{{ contract02 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="1" align="center">供方</td>
<td colspan="1" align="center">{{ supplier02 }}</td>
<td colspan="1" align="center">签订地点</td>
<td colspan="1" align="center">江苏盐城</td>
</tr>
</table>
<div> 产品名称型号数量单价品牌</div>
<table id="12" cellspacing="0px" align="center" border width="100%" style="">
<tbody id="14">
<tr id="tableHead02" style="height: 40px">
<td colspan="1" align="center">物料名称</td>
<td colspan="1" align="center">物料规格</td>
<td colspan="1" align="center">物料型号</td>
<td colspan="1" align="center">发货天数</td>
<td colspan="1" align="center">数量</td>
<td colspan="1" align="center">单价</td>
<td colspan="1" align="center">总价</td>
</tr>
</tbody>
<tfoot>
<tr style="height: 40px">
<td colspan="6">运费</td>
<td colspan="1" align="center">{{ freight02 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="6">总价: (人民币){{ RMB02 }}(含0.17增值税) </td>
<td colspan="1" align="center">{{ TotalAmount02 }}</td>
</tr>
</tfoot>
</table>
<div id="textarea02"/>
</el-card>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { initContract, initBuyer, searchTable1, searchTable2, contractChange,
searchChangeContract, initChangeContract, searchTable4, initPayMethod, deleteContract } from '@/api/PurchasingCenter/ContractChange'
export default {
data() {
return {
returns01: [],
contract01: '',
supplier01: '',
freight01: '',
RMB01: '',
TotalAmount01: '',
textarea01: '',
returns02: [],
contract02: '',
supplier02: '',
freight02: '',
RMB02: '',
TotalAmount02: '',
textarea02: '',
check1: 0,
check2: 0,
check3: 0,
check4: 0,
startEndDate: '',
contractNumValue: '',
contractNum: [],
personValue: '',
person: [],
supplierName: '',
supplierValue: '',
total1: 0,
pageCurrent1: 1,
pageSize1: 10,
tableData1: [],
loading1: false,
tableData01: [],
tableData02: [],
submitDisable: true,
dialogVisible2: false,
changeReason: '',
contractValue: '', // 显示表2和变更合同用的变量
tableData3: [],
loading3: false,
total3: 0,
pageCurrent3: 1,
pageSize3: 10,
check31: 0,
check32: 0,
check33: 0,
check34: 0,
check35: 0,
check36: 0,
startEndDate3: '',
contractNumValue3: '',
supplierName3: '',
project3: '',
personValue3: '',
contractNum3: [],
payMethod: [],
payMethodValue: ''
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.contractNum = []
initContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
this.contractNum3 = []
initChangeContract().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNum3.push({
label: response.data[i].采购合同编号,
name: response.data[i].采购合同名称,
value: response.data[i].采购合同流水号
})
}
})
this.payMethod = []
initPayMethod().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.payMethod.push({
label: response.data[i].付款方式内容,
value: response.data[i].付款方式流水号
})
}
})
this.person = []
initBuyer().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
text: response.data[i].姓名,
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
searchTable1() {
this.textarea01 = ''
this.loading1 = true
if (this.startEndDate === '' || this.startEndDate === null || this.startEndDate[0] === '' || this.startEndDate[1] === '') {
this.check1 = 0
this.startEndDate = ''
} else { this.check1 = 1 }
this.contractNumValue ? this.check2 = 1 : this.check2 = 0
this.personValue ? this.check3 = 1 : this.check3 = 0
this.supplierName ? this.check4 = 1 : this.check4 = 0
searchTable1(this.pageCurrent1, this.pageSize1, this.check1, this.startEndDate[0], this.startEndDate[1], this.check2, this.contractNumValue, this.check3, this.personValue, this.check4, this.supplierName).then(response => {
this.loading1 = false
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
this.supplier01 = row.供应商名称
this.contract01 = row.采购合同编号
this.freight01 = parseFloat(row.总金额) - parseFloat(row.总金额_小计)
this.RMB01 = row.总金额_文本
this.TotalAmount01 = row.总金额
this.textarea01 = row.合同文本
document.getElementById('textarea01').innerText = this.textarea01
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns01 = response.data
const children = document.getElementsByClassName('tableData01')
const parent = document.getElementById('04')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns01.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData01')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
document.getElementById('tableHead01').after(tr[i])
}
for (let j = 0; j < this.returns01.length; j++) {
document.getElementsByClassName('tableData01')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData01')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData01')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData01')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData01')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData01')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData01')[j].children[6].innerHTML = response.data[j].金额
}
})
},
contractChange() {
if (this.contractValue) {
contractChange(this.contractValue, this.changeReason).then(response => {
this.contractValue = ''
this.changeReason = ''
if (response.data[0].result === '1') {
this.$message.success('变更成功')
this.searchTable1()
this.contractNumValue = ''
this.contractNumValue3 = ''
this.fetchData()
} else { this.$message.error('变更失败') }
})
} else {
this.$message.error('请先选择合同')
}
},
searchTable3() {
this.textarea02 = ''
this.loading3 = true
if (this.startEndDate3 === '' || this.startEndDate3 === null || this.startEndDate3[0] === '' || this.startEndDate3[1] === '') {
this.check31 = 0
this.startEndDate3 = ''
} else { this.check31 = 1 }
this.contractNumValue3 ? this.check32 = 1 : this.check32 = 0
this.personValue3 ? this.check33 = 1 : this.check33 = 0
this.supplierName3 ? this.check34 = 1 : this.check34 = 0
this.project3 ? this.check35 = 1 : this.check35 = 0
this.payMethodValue ? this.check36 = 1 : this.check36 = 0
searchChangeContract(this.pageCurrent3, this.pageSize3, this.check31, this.startEndDate3[0], this.startEndDate3[1], this.check32, this.contractNumValue3, this.check33, this.personValue3, this.check34, this.supplierName3, this.check35, this.project3, this.check36, this.payMethodValue).then(response => {
this.loading3 = false
console.log(response.data)
for (let j = 0; j < response.data.rows.length; j++) {
if (response.data.rows[j].预到货时间 !== null) {
response.data.rows[j].预到货时间 = response.data.rows[j].预到货时间.substring(0, response.data.rows[j].预到货时间.indexOf(' '))
}
if (response.data.rows[j].规定到货时间 !== null) {
response.data.rows[j].规定到货时间 = response.data.rows[j].规定到货时间.substring(0, response.data.rows[j].规定到货时间.indexOf(' '))
}
if (response.data.rows[j].实际到货时间 !== null) {
response.data.rows[j].实际到货时间 = response.data.rows[j].实际到货时间.substring(0, response.data.rows[j].实际到货时间.indexOf(' '))
}
}
this.tableData3 = response.data.rows
this.total3 = response.data.total
})
},
handleSizeChange3(val) {
this.pageCurrent3 = 1
this.pageSize3 = val
this.searchTable3()
},
handleCurrentChange3(val) {
this.pageCurrent3 = val
this.searchTable3()
},
searchTable4(row) {
this.supplier02 = row.供应商名称
this.contract02 = row.采购合同编号
this.freight02 = parseFloat(row.运费)
this.RMB02 = row.总金额_文本
this.TotalAmount02 = row.总金额
this.textarea02 = row.合同文本
document.getElementById('textarea02').innerText = this.textarea02
this.contractValue = parseInt(row.采购合同变更流水号)
searchTable4(this.contractValue).then(response => {
this.returns02 = response.data
const children = document.getElementsByClassName('tableData02')
const parent = document.getElementById('14')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns02.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData02')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
document.getElementById('tableHead02').after(tr[i])
}
for (let j = 0; j < this.returns02.length; j++) {
document.getElementsByClassName('tableData02')[j].children[0].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData02')[j].children[1].innerHTML = response.data[j].物料规格
document.getElementsByClassName('tableData02')[j].children[2].innerHTML = response.data[j].物料型号
document.getElementsByClassName('tableData02')[j].children[3].innerHTML = response.data[j].发货天数
document.getElementsByClassName('tableData02')[j].children[4].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData02')[j].children[5].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData02')[j].children[6].innerHTML = response.data[j].金额
}
})
},
deleteContract(row) { // 合同作废
this.$confirm('确定作废该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteContract(row.采购合同流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('作废成功')
this.searchTable1()
this.contractNumValue = ''
this.contractNumValue3 = ''
this.fetchData()
} else { this.$message.error('作废失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:200px
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.el-row{
margin-bottom: 10px;
}
</style>

View File

@@ -27,6 +27,15 @@
</div>
</el-card>
<specification-data ref="specificationData" :groups-names="groupsNames" :machine-names="machineNames" :project-name="projectName" @machineChange="machineChange"/>
<el-upload
class="upload-demo"
drag
action="http://localhost:8410/submit/uploadImg.ashx?InvoiceNum=1"
multiple>
<i class="el-icon-upload"/>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</div>
</template>

View File

@@ -272,7 +272,8 @@ export default {
this.total = res.total
})
} else {
const type = this.groupName.indexOf('WG') ? 1 : 2
const type = this.groupName.indexOf('WG') > -1 ? 2 : 1
console.log(type)
this.loadingWB = true
purchasePartsData(this.groupValue, type, this.pageCurrentWB, this.pageSizeWB).then(response => {
this.loadingWB = false