家里的样式

This commit is contained in:
zhangdingyu
2019-09-18 09:34:02 +08:00
commit 02d1678fff
681 changed files with 133918 additions and 0 deletions

View File

@@ -0,0 +1,710 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineNumber"
: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="groupNumberValue" placeholder="组号" size="small" clearable>
<el-option
v-for="item in groupNumber"
: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="pageCurrent0=1;pageSize0=20;pageCurrent1=1;pageSize1=20;pageCurrent2=1;pageSize2=20;searchTable()">查询</el-button>
</div>
<el-tabs v-model="PartType" type="card" @tab-click="searchTable()">
<el-tab-pane label="标准件" name="标准件">
<el-table ref="multipleTable" :data="tableData0" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column align="center" label="机床图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" min-width="80px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="型号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料型号 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="200px">
<template slot-scope="scope">
{{ scope.row.物料规格 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="单台机床数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.单台机床数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="总数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备件数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
:current-page="pageCurrent0"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize0"
:total="total0"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange0"
@current-change="handleCurrentChange0"/>
</div>
</el-tab-pane>
<el-tab-pane label="外购件" name="外购件">
<el-table ref="multipleTable" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column align="center" label="机床图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" min-width="80px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="型号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.物料型号 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="200px">
<template slot-scope="scope">
{{ scope.row.物料规格 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="总数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备件数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件" name="基本件">
<el-table ref="multipleTable" :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column align="center" label="机床图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" min-width="80px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="100px">
<template slot-scope="scope">
{{ scope.row.规格 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="材料" min-width="100px">
<template slot-scope="scope">
{{ scope.row.材料 || '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="总数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="备件数量" min-width="100px">
<template slot-scope="scope">
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="margin-top:10px;display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-tab-pane>
</el-tabs>
</el-card>
<el-card>
<div slot="header">
<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="searchList()">查询</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" style="margin: 0 0 0 10px" @click="createList()">创建</el-button>
<el-button size="small" type="primary" icon="el-icon-bottom" style="margin: 0 0 0 10px" @click="selectInto()">选入</el-button>
</div>
<h4 style="margin-top:0">领料单</h4>
<el-table :data="pickListTable1" highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickList">
<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.操作日期.split(' ')[0] }}
</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="90">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否审批)===1" type="success">已审批</el-tag>
<el-tag v-else type="warning">未审批</el-tag>
</template>
</el-table-column>
<!--<el-table-column label="领回确认" align="center" min-width="80">-->
<!--<template slot-scope="scope">-->
<!--<el-tag v-if="Number(scope.row.是否启用)===1" type="warning">未确认</el-tag>-->
<!--<el-tag v-else type="success">已确认</el-tag>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="操作" align="center" width="230px">
<template slot-scope="scope" align="center">
<!--<el-button v-if="Number(token)===21 || Number(token)===36" :disabled="Number(scope.row.是否审批)===0 || Number(scope.row.是否启用)===0" size="mini" type="primary" @click="checkList(scope.row)">确认领回</el-button>-->
<el-button :disabled="Number(scope.row.是否启用)===0" size="mini" type="danger" icon="el-icon-delete" @click="dropList(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;margin: 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<h4>领料单明细{{ pickingListNumberShow }}</h4>
<el-table :data="pickListTable2" border style="width: 100%;" size="mini" height="300">
<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">
{{ 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="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 v-if="true" label="备料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否备料确认)===1" type="success" size="mini">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" type="success" size="mini">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button :disabled="!!scope.row.是否出库 || Number(scope.row.是否领料确认)===1" size="mini" type="danger" icon="el-icon-delete" @click="dropListDetail(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogFormVisible1" title="创建领料单" center width="380px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
<el-form-item label="领料人" prop="领料人流水号" label-width="100px" size="small">
<el-select v-model="form1.领料人流水号" placeholder="请选择" size="small" clearable filterable>
<el-option
v-for="item in pickPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="领料单备注" prop="领料单备注" label-width="100px">
<el-input v-model="form1.领料单备注" size="small" placeholder="备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1=false">取消</el-button>
<el-button type="primary" @click="submitCreateList()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initPickPerson, initMachineProject, searchgroup, searchTable, searchList, createList, dropList, selectIntoList, searchListDetail, dropListDetail } from '@/api/Inventory/CreatePickingList'
import request from '@/utils/request'
import { mapGetters } from 'vuex'
export default {
name: 'CreatePickingList',
data() {
return {
PartType: '基本件',
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
groupNumber: [],
tableData0: [],
tableData1: [],
tableData2: [],
pageCurrent0: 1,
pageSize0: 20,
total0: 0,
pageCurrent1: 1,
pageSize1: 20,
total1: 0,
pageCurrent2: 1,
pageSize2: 20,
total2: 0,
pickListTable1: [],
pageCurrent3: 1,
pageSize3: 20,
total3: 0,
pickListTable2: [],
dialogFormVisible1: false,
form1: {
领料人流水号: '',
领料单备注: ''
},
rules1: {
领料人流水号: [{ required: true, message: '请选择领料人' }]
},
pickPerson: [],
pickingListNumber: '', // 领料单编号
pickingListNumberShow: '', // 领料单编号
pickingListNum: '', // 领料单流水号
multipleSelection: []
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
mounted() {
this.fetchData()
this.searchTable()
this.searchList()
},
methods: {
// 审批通过
approvalPass(row) {
this.$confirm('是否审批通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单 set 是否审批 = 1 where 领料单流水号 = ${row.领料单流水号}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.pickingListNumber = ''
this.searchList()
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 初始化数据
fetchData() {
initPickPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pickPerson.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
},
// 根据机床查分组
machineChange() {
this.groupNumberValue = ''
this.groupNumber = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNumber.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 查三表
searchTable() {
this.multipleSelection = []
if (this.PartType === '标准件') {
this.searchTable0()
} else if (this.PartType === '外购件') {
this.searchTable1()
} else if (this.PartType === '基本件') {
this.searchTable2()
}
},
// 标准件
searchTable0() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1).then(response => {
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
},
// 外购件
searchTable1() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
// 基本件
searchTable2() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, 3).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange0(val) {
this.pageSize0 = val
this.pageCurrent0 = 1
this.searchTable0()
},
handleCurrentChange0(val) {
this.pageCurrent0 = val
this.searchTable0()
},
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()
},
// 查询领料单列表
searchList() {
let check, isElectrical
this.pickingListNumber ? check = 1 : check = 0
Number(this.token) === 37 || Number(this.token) === 36 || Number(this.token) === 35 ? isElectrical = 1 : isElectrical = 0 // 35电工 36电气部长 37电气副部长
searchList(this.pageCurrent3, this.pageSize3, check, this.pickingListNumber, isElectrical).then(response => {
this.pickListTable1 = response.data.rows
this.total3 = response.data.total
})
},
handleSizeChange3(val) {
this.pageSize3 = val
this.pageCurrent3 = 1
this.searchList()
},
handleCurrentChange3(val) {
this.pageCurrent3 = val
this.searchList()
},
// 创建领料单
createList() {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.领料人流水号 = ''
this.form1.领料单备注 = ''
this.dialogFormVisible1 = true
},
// 提交创建领料单
submitCreateList() {
let isElectrical
Number(this.token) === 37 || Number(this.token) === 36 || Number(this.token) === 35 ? isElectrical = 1 : isElectrical = 0 // 35电工 36电气部长 37电气副部长
createList(this.form1.领料人流水号, this.form1.领料单备注, isElectrical).then(response => {
if (response.data[0].result === '1') {
this.$message.success('创建成功')
this.dialogFormVisible1 = false
this.searchList()
} else { this.$message.error('操作失败') }
})
},
// 确认领料单
checkList(row) {
this.$confirm('是否确认领回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单 set 是否启用 = 0 where 领料单流水号 = ${row.领料单流水号}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.pickingListNumber = ''
this.searchList()
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 删除领料单
dropList(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropList(row.领料单流水号).then(response => {
if (Number(response.data[0].result) === 1) {
this.$message.success('删除成功')
this.searchList()
} else {
this.$message.error('数据占用')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = val
},
// 选入
selectInto() {
const basePartGroup = []
const purchasePartGroup = []
this.multipleSelection.map(v => {
v.基本件流水号 ? basePartGroup.push(v.基本件流水号) : purchasePartGroup.push(v.标准件和外购件流水号)
})
if (basePartGroup.length === 0 && purchasePartGroup.length === 0) {
this.$message.warning('请勾选零件')
return
}
if (!this.pickingListNum || !this.pickingListNumberShow) {
this.$message.warning('请选择领料单')
return
}
if (basePartGroup.length) { // 基本件
selectIntoList(basePartGroup, null, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable()
this.clickList()
} else { this.$message.error('操作失败') }
})
} else { // 标准件外购件
selectIntoList(null, purchasePartGroup, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable()
this.clickList()
} else { this.$message.error('操作失败') }
})
}
},
// 查看领料单明细
clickList(row) {
console.log(row)
row ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
row ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
searchListDetail(this.pickingListNum).then(res => {
this.pickListTable2 = res.data
})
},
// 删除领料单明细
dropListDetail(row) {
console.log(row)
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropListDetail(row.领料单明细流水号).then(response => {
if (Number(response.data[0].result) === 1) {
this.$message.success('删除成功')
this.clickList()
} 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;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,459 @@
<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
size="mini"
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="mini" type="primary" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="addDirect(scope.row)">直达</el-button>
<el-button size="mini" 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
size="mini"
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="form.getPeople" 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="form.getPeople" 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,
projectNumber: '', // 项目流水号
machineNumber: '', // 机床流水号
teamNumber: '', // 组件流水号
materialName: '', // 物料名称
materialtype: '', // 物料型号
materialMode: '', // 物料规格
partPicture: '', // 零件图号
directPartNumber: '',
teamBasicPart: ''
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchPeopleData()
this.searchContractData()
this.getpeopleid()
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
this.Machine = []
this.ProjectValue ? this.ProjectValue_check = 1 : 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() { // 查询组号
this.GroupNum = []
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() { // 查询人员
this.People = []
searchPeople(this.token).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: Number(response.data[i].人员编号)
})
}
console.log(this.People)
})
console.log(this.token, 88)
console.log(this.People, 99)
},
searchContractData() { // 查询合同
this.Contract = []
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 = []
this.ProjectValue ? this.ProjectValue_check = 1 : this.ProjectValue_check = 0
this.MachineValue ? this.MachineValue_check = 1 : this.MachineValue_check = 0
this.GroupNumValue ? this.GroupNumValue_check = 1 : this.GroupNumValue_check = 0
this.ContractValue ? this.ContractValue_check = 1 : 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
})
},
// 查询直达件记录
searchDirect(row) {
this.purchaseContractNumber = row.采购合同明细流水号
this.listLoading = true
searchDirectRec(this.purchaseContractNumber).then(response => {
this.directRecord = response.data
this.listLoading = false
})
},
// 打开直达件表单
addDirect(row) {
console.log(row)
this.PeopleValue = ''
this.form = {}
this.dialogFormVisible = true
this.materialNum = row.物料流水号
this.purchaseContractNumber = row.采购合同明细流水号
this.teamPart = row.组件零件流水号
this.teamBasicPart = row.组件零件基本件流水号
this.projectNumber = row.项目流水号
this.machineNumber = row.机床流水号
this.teamNumber = row.组件流水号
this.materialName = row.物料名称
this.materialtype = row.物料型号
this.materialMode = row.物料规格
this.partPicture = row.零件图号
},
// 打开直达件编辑表单
changeDirect(row) {
console.log(row)
this.dialogFormVisible1 = true
this.directPartNumber = row.直达件流水号
this.form.DirectNumber = row.到货数量
this.form.getPeople = parseInt(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() {
addDirectPart(this.form.DirectNumber, this.purchaseContractNumber, this.PeopleNumber, this.form.getPeople, this.form.DirectNumber, this.teamPart, this.teamBasicPart, this.projectNumber, this.machineNumber, this.teamNumber, this.materialName, this.form.DirectNote, this.materialtype, this.materialMode, this.partPicture).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,570 @@
<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%;"
size="mini"
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 :disabled="scope.row.是否禁用" size="mini" type="warning" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="selecting(scope.row)">交换</el-button>
<el-button :disabled="scope.row.是否禁用" size="mini" 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>
<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-row>
<el-col :span="11">
<div>
<el-table
:data="tableData1"
border
size="mini"
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="mini" type="primary" icon="el-icon-edit" @click="total = 0;pageSize = 10;pageList = 1;exchange('form')" >交换</el-button>
</div>
</el-col>
<el-col :span="11">
<div>
<el-table
:data="tableData2"
border
size="mini"
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-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataExchange"
border
size="mini"
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 :disabled="scope.row.是否禁用" size="small" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button :disabled="scope.row.是否禁用" 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>
<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-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="ExchangeNumber" 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="ExchangeNumberx" label-width="100px">
<el-input v-model="form.ExchangeNumberx" size="small" placeholder="请输入交换数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领料单" prop="PickingListNumber" label-width="100px">
<el-select v-model="PickingListNumber" filterable clearable size="small" placeholder="领料单号" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in PickingList"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="ExchangeNote" 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>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPurchasePart, addExchangepart, searchExchangePart, dropExchangeList, editExchangeList, searchList1 } from '@/api/Inventory/ExchangePart'
import { mapGetters } from 'vuex'
export default {
data() {
return {
count1: 0,
count2: 0, // 清表单验证计数器
ProjectValue: '',
Project: [],
ProjectValue_check: 0,
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: 'blur' }]
},
PageCurrent: 1,
PageSize: 10,
total: null,
PageCurrent1: 1,
PageSize1: 10,
total1: null,
listLoading: '',
listLoading1: '',
exchangeListNumber: '',
eTeamPartNumber: '',
title: '',
PickingListNumber: '',
PickingList: []
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.fetchData()
this.getpeopleid()
this.getExchangeTable()
this.searchPickingList()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
},
searchMachine() {
this.MachineValue = ''
this.Machine = []
this.GroupNumValue = ''
this.GroupNum = []
if (this.ProjectValue !== '') {
this.ProjectValue_check = 1
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].机床流水号
})
}
})
} else {
this.ProjectValue_check = 0
}
},
searchGroupList() {
this.GroupNumValue = ''
this.GroupNum = []
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].组件流水号
})
}
})
},
searchPickingList() {
searchList1().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.PickingList.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.total = response.data.total
const data = response.data.rows
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].组件零件基本件流水号 === '0') {
response.data.rows[i].零件类型 = response.data.rows[i].零件类型代码
response.data.rows[i].类型名称 = response.data.rows[i].外购件类型
}
}
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].组件零件流水号 === '0') {
response.data.rows[i].物料名称 = response.data.rows[i].零件名称
response.data.rows[i].项目名称 = response.data.rows[i].基本件项目名称
response.data.rows[i].机床图号 = response.data.rows[i].基本件机床图号
response.data.rows[i].组号 = response.data.rows[i].基本件组号
response.data.rows[i].项目流水号 = response.data.rows[i].基本件项目流水号
response.data.rows[i].机床流水号 = response.data.rows[i].基本件机床流水号
response.data.rows[i].组件流水号 = response.data.rows[i].基本件组件流水号
}
}
for (let i = 0; i < data.length; i++) {
data[i].是否交换 === '1' || data[i].是否交换 === '2' ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataPurchase = data
})
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 => {
const data = response.data.rows
for (let i = 0; i < data.length; i++) {
data[i].审批通过 === '1' || data[i].审批通过 === '2' ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataExchange = data
this.total1 = response.data.total
this.listLoading1 = false
})
},
handleSizeChange1(val) {
this.PageCurrent1 = 1
this.PageSize1 = val
this.getExchangeTable()
},
handleCurrentChange1(val) {
this.PageCurrent1 = val
this.getExchangeTable()
},
// 选择领料单
chooseListinfor(row) {
this.pickingListNumberx = row.领料单流水号
this.searchListDetailt()
},
// 增加交换件
addListDetailinfor(form) {
this.$refs[form].validate((valid) => {
if (valid) {
addExchangepart(this.form.ExchangeNumber, this.tableData1[0].采购合同明细流水号, this.tableData2[0].采购合同明细流水号, this.tableData1[0].物料名称, this.tableData2[0].物料名称, this.tableData1[0].项目流水号, this.tableData2[0].项目流水号, this.tableData1[0].机床流水号, this.tableData2[0].机床流水号, this.tableData1[0].组件流水号, this.tableData2[0].组件流水号, this.tableData1[0].货位流水号, this.tableData2[0].货位流水号, this.form.ExchangeNumberx, this.picikingPeople, this.form.ExchangeNote, this.PickingListNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
} else { this.$message.error('增加失败') }
}).then(() => {
this.dialogFormVisible = false
this.PageCurrent1 = 1
this.getExchangeTable()
this.searchPartinfo()
})
}
})
},
// 打开交换表单
exchange(form) {
if (this.tableData1.length === 0) {
this.$message.error('请选择交换件')
} else if (this.tableData2.length === 0) {
this.$message.error('请选择交换件')
} else {
this.count1 = this.count1 + 1
if (this.count1 !== 1) {
this.$refs[form].resetFields()
}
this.title = '交换'
this.form.ExchangeNumber = ''
this.form.ExchangeNumberx = ''
this.form.ExchangeNote = ''
this.dialogFormVisible = true
}
},
// 重置表单
callOff(formName) {
this.form.ExchangeNumber = ''
this.form.ExchangeNumberx = ''
this.form.ExchangeNote = ''
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 选中零件交换
selecting(row) {
const arr = new Array(row)
this.tableData1 = arr
},
// 选中被零件交换
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).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.dialogFormVisible = false
this.PageCurrent1 = 1
this.getExchangeTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit(row) {
this.exchangeListNumber = row.交换单流水号
this.form.ExchangeNumber = row.交换单编号
this.form.ExchangeNumberx = row.交换数量
this.PickingListNumber = parseInt(row.领料单流水号)
this.form.ExchangeNote = row.备注
this.title = '编辑'
this.dialogFormVisible = true
},
submitEdit() {
this.editTable(editExchangeList, [this.exchangeListNumber, this.form.ExchangeNumber, this.form.ExchangeNumberx, this.PickingListNumber, this.form.ExchangeNote], 'form', function() { this.getExchangeTable(); this.dialogFormVisible = false })
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,19 @@
// 导出Excel方法表格id不加扩展名的文件名sheet名
export function exportExcelMethod(tableId, fileName, sheetName) {
tableToExcel(tableId, fileName, sheetName)
}
const tableToExcel = (function() {
const uri = 'data:application/vnd.ms-excel;base64,'
// 设置导出表格的单元格默认高度/宽度/边框样式/字体颜色/背景颜色/居中网页显示表格宽度建议1240tr/td视情况而定
const template = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 1px solid #000000;width:100px;text-align: center;color: #000000;} th {border: 1px solid #000000;width:100px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
const format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p] }) }
return function(table, filename, sheetname) {
if (!table.nodeType) table = document.getElementById(table)
const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML }
const aTag = document.createElement('a')
aTag.href = uri + base64(format(template, ctx))
aTag.download = filename
aTag.click()
}
})()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,315 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">零件图号</span>
<el-input v-model="Partpaint" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="getCraftNumber()">查询</el-button>
<el-button size="small" type="danger" icon="el-icon-remove-outline" style="margin: 0 0 0 10px" @click="Empty()">清空</el-button>
<el-button type="primary" size="small" class="el-icon-success" style="margin: 0 0 0 10px" @click="Innumber">入库</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading" :data="tableDataNum" border size="mini" 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">
{{ tableDataNum[scope.$index].plannumber }}
</template>
</el-table-column>
<el-table-column label="入库数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="tableDataNum[scope.$index].innumber" clearable size="mini"/>
</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="mini" 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="mini" 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="mini"/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" align="center">
<template slot-scope="scope">
<el-button
:disabled="scope.row.是否禁用"
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, searchPartNumber, CraftNumber } from '@/api/Inventory/Inboundscanning'
import { mapGetters } from 'vuex'
import { wsuri, name } from '@/utils/request'
export default {
data() {
return {
ace: 0,
a: '',
tableData: [],
partNumber: [],
listLoading: false,
craftplannumber: '',
radio2: 3,
PeopleNumber: '',
inventoryName: [], // 仓库名称下拉框
inventoryNumber: '',
locateName: [], // 货位名称下拉框
locateNumber: '',
Partpaint: '',
tableDataNum: []
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.initWebpack()
this.getpeopleid()
this.Getinvent()
},
methods: {
// 移除
handleDelete(index, row) {
this.tableDataNum.splice(index, 1)
this.tableData.splice(index, 1)
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
// 初始化websocket
initWebpack() {
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.partNumber = this.partNumber.slice(1)
this.getPaint(this.partNumber)
},
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
// 根据图号查流水号并查表1
getCraftNumber() {
this.partNumber = []
CraftNumber(this.Partpaint).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNumber.push(
response.data[i].工艺计划流水号
)
}
}).then(() => {
this.getscantable()
})
},
// 扫描并获取图号并查表1
getPaint() {
searchPartNumber(this.partNumber).then(response => {
this.Partpaint = response.data[0].零件图号
return this.Partpaint
}).then(() => {
this.getCraftNumber()
})
// this.getscantable()
},
// 根据流水号查询
getscantable() {
// this.tableData = []
if (this.partNumber.length === 0) {
this.$notify({
title: '警告',
message: '请输入正确的零件图号',
type: 'warning'
})
} else {
this.listLoading = true
searchTable(this.partNumber).then(response => {
if (response.data.length === 0) {
this.listLoading = false
this.$notify({
title: '警告',
message: '该零件未加工完成',
type: 'warning'
})
} else {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].考核状态 === 8) {
this.listLoading = false
this.$notify({
title: '警告',
message: 'P' + response.data[i].工艺计划流水号 + '已入库',
type: 'warning'
})
} else if (response.data[i].考核状态 === 9) {
this.listLoading = false
this.$notify({
title: '警告',
message: 'P' + response.data[i].工艺计划流水号 + '已出库',
type: 'warning'
})
} else if (response.data[i].考核状态 === 7) {
this.listLoading = false
this.tableData.push({
plannumber: response.data[i].剩余数量,
innumber: response.data[i].入库数量,
capture: '',
note: '',
工艺计划流水号: response.data[i].工艺计划流水号,
项目名称: response.data[i].项目名称,
机床图号: response.data[i].机床图号,
零件图号: response.data[i].零件图号
})
const hash = {} // 一个新数组data为你需要去重的数组newData用于接收去重后的数组, curVal.去重条件
this.tableDataNum = this.tableData.reduce((preVal, curVal) => {
hash[curVal.工艺计划流水号] ? '' : hash[curVal.工艺计划流水号] = true && preVal.push({
工艺计划流水号: curVal.工艺计划流水号,
项目名称: curVal.项目名称,
机床图号: curVal.机床图号,
零件图号: curVal.零件图号,
plannumber: curVal.plannumber,
innumber: curVal.innumber,
capture: '',
note: ''
})
return preVal
}, [])
}
}
}
}).then(() => {
this.listLoading = false
})
}
},
// 修改入库
Innumber() {
this.$confirm('此操作将不可逆转,且如果入库数量大于计划数量,则全部入库,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.locateNumber === '') {
this.$message.error('请选择货位')
} else {
for (let i = 0; i < this.tableDataNum.length; i++) {
if (Number(this.tableDataNum[i].innumber) === 0) {
this.$message.error('请输入正确数量')
} else {
if (this.tableDataNum[i].innumber > this.tableDataNum[i].plannumber) {
this.tableDataNum[i].innumber = this.tableDataNum[i].plannumber
}
insertOne(this.tableDataNum[i].工艺计划流水号, this.tableDataNum[i].innumber, this.PeopleNumber, this.tableDataNum[i].capture, this.inventoryNumber, this.locateNumber, this.tableDataNum[i].note).then(response => {
if (response.data[0].result === '1') {
this.$message({
type: 'success',
message: '零件入库成功!'
})
this.Empty()
} else {
this.$message({
type: 'error',
message: '零件入库失败!'
})
}
})
}
}
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消入库'
})
})
},
// 清空
Empty() {
this.tableData = []
this.tableDataNum = []
this.Partpaint = ''
},
// 仓库查询
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,403 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<el-row style="margin-bottom:-10px!important;">
<el-col style="width: 250px">
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable style="margin-bottom: 10px;"/>
</el-col>
<el-col style="width: 250px">
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" style="margin-bottom: 10px;" clearable/>
</el-col>
<el-col style="width: 250px">
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" style="margin-bottom: 10px;" clearable/>
</el-col>
<el-col style="width: 250px">
<span>仓库名称:</span>
<el-select v-model="inventoryNameValue" style="margin-bottom: 10px;" size="small" clearable @change="getLocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 250px">
<span>货位名称:</span>
<el-select v-model="locateNameValue" style="margin-bottom: 10px;" size="small" clearable>
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 170px">
<el-button type="success" icon="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;searchMaterial()">查询</el-button>
<el-button type="primary" icon="el-icon-edit" size="small" @click="addMaterial()">新增</el-button>
</el-col>
</el-row>
</div>
<el-table :data="tableData1" border style="max-height: 500px;" height="500px" size="mini" show-summary>
<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="150">
<template slot-scope="scope">
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="物料来源" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.物料来源 }}
</template>
</el-table-column>
<el-table-column label="仓库" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="货位存量" align="center" width="180" prop="货位存量">
<template slot-scope="scope">
<template v-if="scope.row.changeValue">
<el-input-number v-model="scope.row.货位存量" :min="0" :precision="2" controls-position="right" size="mini" style="width: 90px"/>
<el-button class="cancel-btn" size="mini" type="warning" @click="cancelEdit(scope.row)">取消</el-button>
</template>
<span v-else>{{ scope.row.货位存量 }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button v-if="scope.row.changeValue" type="mini" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" icon="el-icon-edit" size="mini" @click="scope.row.changeValue=!scope.row.changeValue">编辑</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, 50]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog :visible.sync="dialogVisible" title="新增" center style="min-height: 300px" width="880px">
<el-row>
<el-col style="width: 240px">
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable style="margin-bottom: 10px;"/>
</el-col>
<el-col style="width: 240px">
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" style="margin-bottom: 10px;" clearable/>
</el-col>
<el-col style="width: 240px">
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" style="margin-bottom: 10px;" clearable/>
</el-col>
<el-col style="width: 80px">
<el-button type="success" icon="el-icon-search" size="small" @click="pageCurrent01=1;pageSize01=10;searchMaterial01()">查询</el-button>
</el-col>
</el-row>
<el-table :data="tableData01" border highlight-current-row height="300" size="mini" style="margin-bottom: 10px" @row-click="selectMaterial">
<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="200">
<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">
<el-pagination
:current-page="pageCurrent01"
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="pageSize01"
:total="total01"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange01"
@current-change="handleCurrentChange01"/>
</div><hr>
<el-row>
<el-col style="width: 210px">
<span>仓库:</span>
<el-select v-model="inventoryNameValue" style="margin-bottom: 10px;" size="small" clearable @change="getLocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 210px">
<span>货位:</span>
<el-select v-model="locateNameValue" style="margin-bottom: 10px;" size="small" clearable>
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width: 210px">
<span>货位存量:</span>
<el-input-number v-model="localNumber" :min="0" :precision="2" placeholder="物料名称" size="small" clearable style="margin-bottom: 10px;"/>
</el-col>
<el-col style="width: 180px">
<span>是否为滞货:</span>
<el-checkbox v-model="isBacklog" size="small" label="滞货件" border style="border: 1px solid rgb(49,56,72)"/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible=false">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import request from '@/utils/request'
export default {
data() {
return {
materialName: '',
materialSpec: '',
materialModel: '',
inventoryNameValue: '',
inventoryName: [],
locateNameValue: '',
locateName: [],
tableData1: [],
pageCurrent: 1,
pageSize: 10,
total: 0,
dialogVisible: false,
tableData01: [],
pageCurrent01: 1,
pageSize01: 10,
total01: 0,
localNumber: '',
materialValue: '',
isBacklog: false
}
},
computed: {
...mapGetters([
'id' // 人员编号
])
},
mounted() {
this.initData()
this.searchMaterial()
},
methods: {
// 初始化数据
initData() {
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_仓库查询'
}
}
request(param).then(res => {
for (let i = 0; i < res.data.length; i++) {
this.inventoryName.push({
label: res.data[i].仓库名称,
value: res.data[i].仓库流水号
})
}
})
},
// 根据仓库查货位
getLocate() {
this.locateName = []
this.locateNameValue = ''
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_查询数据',
param: `仓库流水号=${this.inventoryNameValue}`
}
}
request(param).then(res => {
for (let i = 0; i < res.data.length; i++) {
this.locateName.push({
label: res.data[i].货位名称,
value: res.data[i].货位流水号
})
}
})
},
// 根据条件查物料货位数量
searchMaterial() {
let check1, check2, check3, check4, check5
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
this.inventoryNameValue ? check4 = 1 : check4 = 0
this.locateNameValue ? check5 = 1 : check5 = 0
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: `库存管理_库存盘点_物料货位数量_查询数据`,
param: `物料名称_check=${check1}&物料名称=${this.materialName}&物料规格_check=${check2}&物料规格=${this.materialSpec}&物料型号_check=${check3}&物料型号=${this.materialModel}&仓库流水号_check=${check4}&仓库流水号=${this.inventoryNameValue}&货位流水号_check=${check5}&货位流水号=${this.locateNameValue}`,
Pagination: this.pageCurrent + '&' + this.pageSize
}
}
request(param).then(res => {
this.tableData1 = res.data.rows
this.tableData1.map(v => {
this.$set(v, 'changeValue', false)
v.原货位存量 = v.货位存量
return v
})
this.total = res.data.total
})
},
// 分页
handleSizeChange(val) {
this.pageSize = val
this.pageCurrent = 1
this.searchMaterial()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchMaterial()
},
// 取消设置
cancelEdit(row) {
row.货位存量 = row.原货位存量
row.changeValue = false
this.$message('取消修改')
},
// 确认设置
confirmEdit(row) {
Number(row.货位存量) ? row.货位存量 = Number(row.货位存量) : row.货位存量 = 0
const param = {
url: '',
method: 'post',
data: {
type: '2',
name: `库存管理_库存盘点_物料货位数量_修改数据`,
param: `货位存量=${row.货位存量}&物料流水号=${row.物料流水号}&货位流水号=${row.货位流水号}&物料来源=${row.物料来源}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
row.changeValue = false
} else {
this.$message.error('操作失败')
}
})
},
// 新增物料货位数量
addMaterial() {
this.dialogVisible = true
},
// 选择物料
selectMaterial(row) {
this.materialValue = row.物料流水号
},
// 确认新增物料货位数量
submitAdd() {
const param = {
url: '',
method: 'post',
data: {
type: '2',
name: `库存管理_库存盘点_物料货位数量_增加数据`,
param: `物料流水号=${this.materialValue}&货位流水号=${this.locateNameValue}&货位存量=${this.localNumber}&是否为滞货=${Number(this.isBacklog)}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogVisible = false
} else {
this.$message.error('操作失败')
}
})
},
// 查物料
searchMaterial01() {
let check1, check2, check3
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: `库存管理_物料主文件_基本_查询数据_分页`,
param: `物料名称_check=${check1}&物料名称=${this.materialName}&物料规格_check=${check2}&物料规格=${this.materialSpec}&物料型号_check=${check3}&物料型号=${this.materialModel}&PageCurrent=${this.pageCurrent01}=int&PageSize=${this.pageSize01}=int&PageCount=1=int=output&ItemCount=1=int=output`
}
}
request(param).then(res => {
this.tableData01 = res.data.result
this.total01 = Number(res.data.output[0].ItemCount)
})
},
// 分页
handleSizeChange01(val) {
this.pageSize01 = val
this.pageCurrent01 = 1
this.searchMaterial01()
},
handleCurrentChange01(val) {
this.pageCurrent01 = val
this.searchMaterial01()
}
}
}
</script>
<style scoped>
.el-select{
width:165px
}
.el-input{
width:165px
}
</style>

View File

@@ -0,0 +1,599 @@
<template>
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<el-button size="small" type="primary" icon="el-icon-circle-plus-outline" style="margin: 0 0 0 10px" @click="ADD()">新建仓库</el-button>
</div>
<el-table :data="tableData" border size="mini" style="width: 100%;max-height: 300px" height="300" @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="仓库描述" min-width="180" align="center">
<template slot-scope="scope">
{{ scope.row.仓库描述 }}
</template>
</el-table-column>
<el-table-column label="地址" min-width="180" 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="180" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" width="300" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
icon="el-icon-edit"
type="primary"
@click="handleEdit(scope.$index, scope.row, 'form')">修改</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" type="primary" icon="el-icon-circle-plus-outline" style="margin: 0 0 0 10px" @click="ADDLocate()">增加货位</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table v-loading="listLoading" :data="tableData2" border size="mini" style="width: 100%;max-height: 300px" height="300">
<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 align="center" label="二维码" width="150">
<template slot-scope="scope">
<canvas :id="canvas[scope.$index]" class="code"/>
</template>
</el-table-column>
<el-table-column label="操作" width="200px" align="center">
<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 width="450px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" 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"
clearable
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"
clearable
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"
clearable
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"
clearable
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系人" prop="ContactpeopleValue">
<el-select v-model="form.ContactpeopleValue" clearable filterable size="small" placeholder="联系人" style="width: 200px;margin-right:10px">
<el-option
v-for="item in Contactpeople"
: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"
clearable
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-select v-model="form2.永久" clearable filterable placeholder="请选择" size="small" style="width: 200px;margin-right:10px">
<el-option
v-for="item in options"
: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="不可用量">
<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'
import QRCode from 'qrcode'
import { mapGetters } from 'vuex'
export default {
data() {
return {
Contactpeople: [], // 联系人
count2: 0, // 清表单验证计数器
tableData: [],
tableData2: [],
wareHouse: '',
dialogFormVisible: false, // 仓库表单
temp: '',
form: {
WarehouseNumber: '', // 仓库编号
WarehouseName: '', // 仓库名称
WarehouseDescription: '', // 仓库描述
Address: '', // 地址
ContactpeopleValue: '',
Note: '' // 备注
},
rules: { // 表单验证规则
WarehouseNumber: [{ required: true, message: '请输入仓库编号', trigger: 'blur' }],
ContactpeopleValue: [{ 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: [],
canvas: [],
options: [{
value: '1',
label: '是'
}, {
value: '0',
label: '否'
}],
role: ''
}
},
computed: {
...mapGetters([
'token'
])
},
created() {
this.getTable()
this.getpeopleid()
},
methods: {
// 获取人员编号
getpeopleid() {
this.role = this.token
this.searchPeopleData()
},
// 查询仓库
getTable() {
this.tableData = []
this.listLoading = true
initWarehouse().then(response => {
this.listLoading = false
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].备注,
人员编号: response.data[i].人员编号
})
}
})
},
getWarehouse(row) {
this.wareHouse = row.仓库流水号
this.getLocate()
},
searchPeopleData() { // 查询人员
this.Contactpeople = []
searchPeople(this.role).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Contactpeople.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getLocate() {
this.tableData2 = []
searchLocate(this.wareHouse).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
this.canvas.push(response.data[i].货位流水号.toString())
this.tableData2.push({
货位流水号: response.data[i].货位流水号,
货位名称: response.data[i].货位名称,
工作中心: response.data[i].工作中心,
永久: response.data[i].永久,
不可用量: response.data[i].不可用量,
仓库名称: response.data[i].仓库名称
})
}
return data
}).then(res => {
for (let i = 0; i < res.length; i++) {
QRCode.toCanvas(document.getElementById(this.canvas[i]), res[i].货位流水号.toString(), function(error) {
if (error) console.error(error)
console.log('success!')
})
}
this.tableData2 = res
})
},
// 点击增加仓库
ADD() {
this.form = []
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.ContactpeopleValue = ''
this.form.Note = ''
this.temp = ''
} else if (this.temp === 2) {
this.chaEdit()
this.temp = ''
}
}
})
},
// 执行增加仓库
addTableData() {
addWarehouse(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.ContactpeopleValue, this.form.Note).then(response => {
console.log(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.ContactpeopleValue, this.form.Note)
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.ContactpeopleValue = ''
this.form.Note = ''
} else {
this.$message.error('添加失败')
}
this.getTable()
})
},
// 编辑
handleEdit(index, row, formName) {
this.temp = 2
this.dialogFormVisible = true
this.form.WarehouseNumber = row.仓库编号
this.form.WarehouseName = row.仓库名称
this.form.WarehouseDescription = row.仓库描述
this.form.Address = row.地址
this.form.ContactpeopleValue = 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.ContactpeopleValue, this.form.Note).then(response => {
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.dialogFormVisible = false
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) {
this.form = {}
this.form2.ContractNumberValue = ''
this.form2.EntryName = ''
this.form2.TotalContractAmount = ''
this.form.PaymentPhaseValue = 1
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 点击增加货位
ADDLocate() {
this.form2 = []
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('删除失败')
}
})
})
},
useqrcode() {
// 生成的二维码内容,可以添加变量
this.QueryDetail = this.num
var canvas = document.getElementById('canvas')
QRCode.toCanvas(canvas, this.QueryDetail, function(error) {
if (error) console.error(error)
console.log('success!')
})
},
// 重置表单
callLocateOff(formName) {
this.form2 = {}
this.form2.货位名称 = ''
this.form2.工作中心 = ''
this.form2.仓库流水号 = ''
this.form.永久 = ''
this.form.不可用量 = ''
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
}
}
}
</script>
<style scoped>
.code{
width:120px!important;
height: auto!important;
}
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,826 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<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="searchList()">查询</el-button>
</div>
<h4 style="margin-top:0">领料单</h4>
<el-table :data="pickListTable1" highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickList">
<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.操作日期.split(' ')[0] }}
</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-tag v-if="Number(scope.row.是否审批)===0" type="warning" size="small">未审批</el-tag>
<el-tag v-else type="success" size="small">已审批</el-tag>
</template>
</el-table-column>
</el-table>
<el-row style="margin: 0;">
<el-col style="width: 300px">
<h4 style="margin-right: 100px;">领料单明细{{ pickingListNumberShow }}</h4>
</el-col>
<el-col style="width: 300px;margin-top:15px">
<el-button :disabled="multipleSelection.length===0" size="small" type="primary" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="multipleSelection.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
</el-col>
<el-col style="width:calc(100% - 600px)">
<div class="block" style="float:right;margin: 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
</el-col>
</el-row>
<el-table :data="pickListTable2" highlight-current-row border style="width: 100%;" size="mini" height="400" @row-click="clickListDetail" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<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">
{{ 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="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 v-if="true" label="备料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否备料确认)===1" size="mini" type="success">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" size="mini" type="success">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button :disabled="Number(scope.row.出库数量)<=0" size="mini" icon="el-icon-back" type="primary" @click="sendBack(scope.row)">归还</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-row>
<el-col :span="12">
<h4 style="margin-top:0">物料货位数量信息</h4>
</el-col>
<el-col :span="12">
占用数量{{ 占用数量 }}
</el-col>
</el-row>
<el-table :data="StockNumberTable" border style="width: 100%;" size="mini" height="300" show-summary>
<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.物料名称 || scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 || 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="70" prop="货位存量">
<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" width="200px">
<template slot-scope="scope" align="center">
<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>
<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogFormVisible1" title="物料出库" center width="380px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
<el-form-item label="机床" prop="machineValue" label-width="100px">
<el-select v-model="form1.machineValue" :disabled="true" filterable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroup()">
<el-option
v-for="item in machine"
: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">&nbsp;&nbsp;{{ item.name }}</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="分组" prop="groupNumValue" label-width="100px">
<el-select v-model="form1.groupNumValue" :disabled="true" filterable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="出库数量" prop="outNumber" label-width="100px" size="small">
<el-input-number v-model="form1.outNumber" :min="0.01" :max="form1.outNumberMax" :precision="2" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="出库人" prop="personValue" label-width="100px">
<el-select v-model="form1.personValue" :disabled="true" size="small" style="width: 200px;margin-right:10px">
<el-option
v-for="item in person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="出库类别" prop="outTypeValue" label-width="100px">
<el-select v-model="form1.outTypeValue" size="small" placeholder="出库类别" style="width: 200px;margin-right:10px">
<el-option
v-for="item in outType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1=false">取消</el-button>
<el-button type="primary" @click="submitOutStore()">确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="异常记录" center width="380px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left">
<el-form-item label="异常数量" prop="errorNumber" label-width="100px" size="small">
<el-input v-model="form2.errorNumber" size="small" placeholder="异常数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="异常原因" prop="reason" label-width="100px">
<el-input v-model="form2.reason" size="small" placeholder="异常原因" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2=false">取消</el-button>
<el-button type="primary" @click="submitErrorRecord()"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="领料确认" center width="380px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left">
<el-form-item label="领料人" prop="personName" label-width="100px" size="small">
<el-input v-model="form3.personName" readonly size="small" placeholder="领料人" style="width: 200px"/>
</el-form-item>
<el-form-item label="密码" prop="password" label-width="100px" size="small">
<el-input v-model="form3.password" size="small" placeholder="密码" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3=false">取消</el-button>
<el-button type="primary" @click="pickConfirm()"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible4" title="归还" center width="380px">
<el-form ref="form4" :model="form4" :rules="rules4" label-position="left">
<el-form-item label="仓库" prop="仓库流水号" label-width="100px" size="small">
<el-select v-model="form4.仓库流水号" placeholder="仓库名称" @change="getLocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="货位" prop="货位流水号" label-width="100px" size="small">
<el-select v-model="form4.货位流水号" placeholder="货位名称">
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="归还数量" prop="归还数量" label-width="100px" size="small">
<el-input-number :min="0" :max="最大归还量" v-model="form4.归还数量" size="small" placeholder="归还数量" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4=false">取消</el-button>
<el-button type="primary" @click="submitSendBack()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { sendBack, initPickPerson, initMachineProject, searchgroup, searchList, searchListDetail, searchStockNumber1, searchStockNumber2, submitOutStore, errorRecord, searchStockNumber3, initOutType, pickingSubmit } from '@/api/Inventory/MaterialOut'
import { mapGetters } from 'vuex'
import request from '@/utils/request'
export default {
name: 'MaterialOut',
data() {
return {
multipleSelection: [],
pickingListNum: '', // 领料单流水号
pickingPersonNum: '', // 领料人流水号
pickingListNumber: '',
pickingListNumberShow: '',
pickListTable1: [],
pageCurrent3: 1,
pageSize3: 20,
total3: 0,
pickListTable2: [],
StockNumberTable: [],
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
outType: [],
form1: {
machineValue: '',
groupNumValue: '',
outNumber: '',
outNumberMax: '', // 出库最大值
personValue: '',
outTypeValue: '' // 出库类别
},
form2: {
errorNumber: '',
reason: '',
物料流水号: '',
基本件流水号: '',
货位流水号: ''
},
form3: {
personName: '',
password: ''
},
form4: {
仓库流水号: '',
货位流水号: '',
归还数量: ''
},
rules1: {
machineValue: [{ required: true, message: '请选择' }],
groupNumValue: [{ required: true, message: '请选择' }],
outNumber: [{ required: true, message: '请输入' }],
personValue: [{ required: true, message: '请输入' }],
outTypeValue: [{ required: true, message: '请选择' }] // 出库类别
},
rules2: {
errorNumber: [{ required: true, message: '请输入' }],
reason: [{ required: true, message: '请输入' }]
},
rules3: {
password: [{ required: true, message: '请输入' }]
},
rules4: {
仓库流水号: [{ required: true, message: '请输入' }],
货位流水号: [{ required: true, message: '请输入' }],
归还数量: [{ required: true, message: '请输入' }]
},
machine: [],
group: [],
person: [],
materialNum: '', // 中间变量物料流水号
machineValue: '', // 中间变量机床流水号
groupNumValue: '', // 中间变量组件流水号
basePartNum: '', // 中间变量基本件流水号
purchaseBillNum: '', // 中间变量请购单明细流水号
parchasePartNum: '', // 中间变量标准件和外购件流水号
inventoryNum: '', // 中间变量仓库流水号
locationNum: '', // 中间变量货位流水号
outNumber: 0, // 中间变量出库数量
inventoryName: [],
locateName: [],
物料流水号: '',
基本件流水号: '',
标准件和外购件流水号: '',
领料单流水号: '',
请购单明细流水号: '',
最大归还量: '',
审批未通过: true,
占用数量: 0
}
},
computed: {
...mapGetters([
'id'
])
},
mounted() {
this.fetchData()
this.searchList()
this.getHouse()
},
methods: {
// 获取仓库
async getHouse() {
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_仓库查询'
}
}
request(param).then(res => {
for (let i = 0; i < res.data.length; i++) {
this.inventoryName.push({
label: res.data[i].仓库名称,
value: res.data[i].仓库流水号
})
}
})
},
// 获取货位
async getLocate() {
this.locateName = []
this.form4.货位流水号 = ''
const param = {
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_查询数据',
param: `仓库流水号=${this.form4.仓库流水号}`
}
}
request(param).then(res => {
for (let i = 0; i < res.data.length; i++) {
this.locateName.push({
label: res.data[i].货位名称,
value: res.data[i].货位流水号
})
}
})
},
// 归还
sendBack(row) {
this.dialogFormVisible4 = true
this.物料流水号 = row.物料流水号
this.基本件流水号 = row.基本件流水号
this.标准件和外购件流水号 = row.标准件和外购件流水号
this.请购单明细流水号 = row.请购单明细流水号
this.领料单流水号 = row.领料单流水号
this.最大归还量 = row.出库数量
},
// 提交归还
submitSendBack() {
sendBack(this.form4.货位流水号, this.物料流水号, this.form4.归还数量, this.id, this.基本件流水号, this.标准件和外购件流水号, this.请购单明细流水号, this.form4.仓库流水号, this.领料单流水号).then(res => {
console.log(res)
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogFormVisible4 = false
this.clickListDetail()
this.clickList()
} else {
this.$message.error('操作失败')
}
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = []
val.map(v => {
this.multipleSelection.push(v.领料单明细流水号)
})
},
// 备料确认
prepareConfirm() {
this.$confirm('是否备料确认?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单明细 set 是否备料确认 = 1 where 领料单明细流水号 in (${this.multipleSelection})`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.clickList()
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 领料确认
inputPassword() {
this.dialogFormVisible3 = true
},
// 提交领料确认
pickConfirm() {
this.$confirm('是否领料确认?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单明细 set 是否领料确认 = 1 where 领料单明细流水号 in (${this.multipleSelection})`
}
}
pickingSubmit(this.pickingPersonNum, this.form3.password).then(res => {
if (res.data[0].result === 'success') {
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.dialogFormVisible3 = false
this.clickList()
} else {
this.$message.error('操作失败')
}
})
} else if (res.data[0].result === 'error') {
this.$message.error('密码错误')
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 初始化数据
fetchData() {
this.person = []
initPickPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
this.machine = []
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
initOutType().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.outType.push({
label: response.data[i].出库类别名称,
value: response.data[i].出库类别流水号
})
}
})
},
// 查询组号
searchGroup() {
this.group = []
this.form1.groupNumValue = ''
searchgroup(this.form1.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
label: response.data[i].组号,
value: Number(response.data[i].组件流水号)
})
}
})
},
// 查询领料单列表
searchList() {
let check
this.pickingListNumber ? check = 1 : check = 0
searchList(this.pageCurrent3, this.pageSize3, check, this.pickingListNumber).then(response => {
this.pickListTable1 = response.data.rows
this.total3 = response.data.total
})
},
handleSizeChange3(val) {
this.pageSize3 = val
this.pageCurrent3 = 1
this.searchList()
},
handleCurrentChange3(val) {
this.pageCurrent3 = val
this.searchList()
},
// 查看领料单明细
clickList(row) {
row && Number(row.是否审批) ? this.审批未通过 = false : this.审批未通过 = true
row && row.领料单流水号 ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
row && row.人员编号 ? this.pickingPersonNum = row.人员编号 : this.pickingListNum
row && row.领料单编号 ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
row && row.姓名 ? this.form3.personName = row.姓名 : this.form3.personName
searchListDetail(this.pickingListNum).then(res => {
this.pickListTable2 = res.data
})
},
// 查看领料单明细相关的物料货位数量
clickListDetail(row) {
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = null) : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.parchasePartNum
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
if (this.materialNum) {
searchStockNumber1(this.materialNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 物料名称
,物料规格
,物料型号
,sum(零件数量 * 机床数量) as 占用数量
,PDM_零件明细表_标准件和外购件.物料流水号
from PDM_零件明细表_标准件和外购件
inner join PDM_组件名称 on PDM_零件明细表_标准件和外购件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料主文件_基本.物料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_标准件和外购件.标准件和外购件流水号 = 车间装配管理_领料单明细.标准件和外购件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and PDM_零件明细表_标准件和外购件.物料流水号 = ${this.materialNum}
group by 物料名称
,物料规格
,物料型号
,PDM_零件明细表_标准件和外购件.物料流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.basePartNum) {
searchStockNumber2(this.basePartNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 零件名称,零件图号,规格,材料,sum(零件数量 * 机床数量) as 占用数量,PDM_零件明细表_基本件.基本件流水号
from PDM_零件明细表_基本件 inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join PDM_零件明细表_材料 on PDM_零件明细表_基本件.材料流水号 = PDM_零件明细表_材料.材料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_基本件.基本件流水号 = 车间装配管理_领料单明细.基本件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and 车间装配管理_领料单明细.基本件流水号 = ${this.basePartNum}
group by 零件名称,零件图号,规格,材料,PDM_零件明细表_基本件.基本件流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.purchaseBillNum) {
searchStockNumber3(this.purchaseBillNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select
库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_基本件_查询视图
inner join PDM_零件明细表_基本件 on 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号 = PDM_零件明细表_基本件.基本件流水号
inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
union
select
库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号 as 零件图号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称 as 零件名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格 as 规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_标准件和外购件_查询视图
inner join PDM_零件明细表_标准件和外购件 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
inner join PDM_组件名称 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号 = 库存管理_物料主文件_基本.物料流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
}
},
// 出库
outStore(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.machineValue = this.machineValue
this.inventoryNum = row.仓库流水号
this.locationNum = row.货位流水号
this.outNumber > row.货位存量 ? (this.form1.outNumber = row.货位存量, this.form1.outNumberMax = row.货位存量) : (this.form1.outNumber = this.outNumber, this.form1.outNumberMax = this.outNumber) // 货位存量和领料数量对比取小
this.form1.personValue = Number(this.id)
this.group = []
this.form1.groupNumValue = ''
searchgroup(this.form1.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
label: response.data[i].组号,
value: Number(response.data[i].组件流水号)
})
}
}).then(() => {
this.form1.groupNumValue = this.groupNumValue
this.dialogFormVisible1 = true
})
},
// 提交出库
submitOutStore() {
this.$refs['form1'].validate((valid) => {
if (valid) {
// 出库数量,出库人,基本件流水号/标准件和外购件流水号 => 记录到一个新表
// 物料流水号,货位流水号,出库数量 => 减掉货位物料数
submitOutStore(this.materialNum, this.locationNum, this.form1.outNumber, this.form1.personValue, this.basePartNum, this.parchasePartNum, this.purchaseBillNum, this.pickingListNum, this.pickingPersonNum, this.inventoryNum, this.form1.outTypeValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible1 = false
this.clickListDetail()
this.clickList()
} else { this.$message.error('操作失败') }
})
} else {
return false
}
})
},
// 异常记录
errorRecord(row) {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.form2.errorNumber = ''
this.form2.reason = ''
this.form2.物料流水号 = row.物料流水号
this.form2.基本件流水号 = row.基本件流水号
this.form2.货位流水号 = row.货位流水号
this.dialogFormVisible2 = true
},
// 提交异常记录
submitErrorRecord() {
this.$refs['form2'].validate((valid) => {
if (valid) {
errorRecord(this.form2.errorNumber, this.form2.reason, this.form2.物料流水号, this.form2.基本件流水号, this.form2.货位流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('记录成功')
this.dialogFormVisible2 = false
} else { this.$message.error('操作失败') }
})
} else {
return false
}
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,414 @@
<template>
<div class="app-container">
<el-card>
<el-row style="margin-bottom: 10px">
<span>物料名称</span>
<el-input v-model="materialName" placeholder="物料名称" clearable size="small"/>
<span>物料规格</span>
<el-input v-model="materialSpec" placeholder="物料规格" clearable size="small"/>
</el-row>
<span>物料型号</span>
<el-input v-model="materialModel" placeholder="物料型号" clearable size="small"/>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading" :data="tableDataBasic" size="mini" border style="width: 100%;" height="440">
<el-table-column label="序号" align="center" type="index" width="50"/>
<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="120">
<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="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="250">
<template slot-scope="scope" align="center">
<el-button size="mini" type="success" icon="el-icon-search" @click="pageCurrent2=1;pageSize2=10;total2=0;searchoutRecord(scope.row)">查看领用情况</el-button>
<el-button :disabled="Number(scope.row.货位存量)===0" size="mini" type="primary" icon="el-icon-sort-up" @click="parOut(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>
<el-table v-loading="listLoading1" :data="tableDataOut" size="mini" border style="width: 100%;" height="250">
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="物料名称" align="center" 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="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="80">
<template slot-scope="scope">
{{ scope.row.出库人姓名 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="140">
<template slot-scope="scope">
{{ scope.row.备注 }}
</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="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</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="ProjectValue" label-width="100px">
<el-select v-model="form.ProjectValue" filterable 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="MachineValue" label-width="100px">
<el-select v-model="form.MachineValue" filterable 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="GroupNumValue" label-width="100px">
<el-select v-model="form.GroupNumValue" filterable 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="DirectNumber" 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="PeopleValue" label-width="100px">
<el-select v-model="form.PeopleValue" :disabled="true" size="small" style="width: 200px;margin-right:10px">
<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="DirectNote" label-width="100px">
<el-input v-model="form.DirectNote" size="small" placeholder="请输入领料人" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="addDirectPartm()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchPart, searchPeople, outlinePartOut, outRecord } from '@/api/Inventory/OfflinePartOut'
import { mapGetters } from 'vuex'
export default {
data() {
const checkNum = (rule, value, callback) => {
if (value <= 0) {
callback(new Error('请输入正整数'))
} else {
callback()
}
}
return {
Project: [],
Machine: [],
GroupNum: [],
tableDataBasic: [],
People: [],
dialogFormVisible: false,
form: {
ProjectValue: '',
MachineValue: '',
GroupNumValue: '',
DirectNumber: '',
PeopleValue: '',
DirectNote: ''
},
rules: { // 表单验证规则
ProjectValue: [{ required: true, message: '请选择项目', trigger: 'blur' }],
MachineValue: [{ required: true, message: '请选择机床', trigger: 'blur' }],
// GroupNumValue: [{ required: true, message: '请选择分组', trigger: 'blur' }],
DirectNumber: [
{ required: true, message: '请输入数量', trigger: 'blur' },
{ validator: checkNum, trigger: 'blur' }
],
DirectNote: [{ required: true, message: '请输入领料人', trigger: 'blur' }]
},
locateNumber: '',
materialNumber: '',
PeopleNumber: '',
tableDataOut: [],
listLoading: '',
listLoading1: '',
partnumber: '',
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
materialName: '', // 物料名称
materialSpec: '', // 物料规格
materialModel: '', // 物料型号
离线合同明细流水号: ''
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable1()
this.fetchData()
this.searchPeopleData()
this.getpeopleid()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
// 获取人员编号
getpeopleid() {
this.PeopleNumber = this.id
},
searchMachine() { // 查询机床
this.Machine = []
this.form.MachineValue = ''
this.GroupNum = []
this.form.GroupNumValue = ''
searchmachine(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() { // 查询组号
this.GroupNum = []
this.form.GroupNumValue = ''
searchTeam(this.form.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组号,
value: Number(response.data[i].组件流水号)
})
}
})
},
// 离线件查询
searchTable1() {
this.listLoading = true
this.tableDataBasic = []
let check1, check2, check3
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
searchPart(check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.pageCurrent1, this.pageSize1).then(response => {
this.tableDataBasic = response.data.rows
this.total1 = response.data.total
this.listLoading = false
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
// 离线记录查询
searchoutRecord(row) {
// 物料流水号查
this.materialNumber = row.物料流水号
this.listLoading1 = true
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.listLoading1 = true
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.listLoading1 = true
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
},
// 打开表单
parOut(row) {
this.dialogFormVisible = true
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
this.离线合同明细流水号 = row.离线合同明细流水号
},
// 重置表单
callOff() {
this.form.DirectNumber = ''
this.form.DirectNumberx = ''
this.form.DirectNote = ''
this.dialogFormVisible = false
},
searchPeopleData() { // 查询人员
searchPeople(this.token).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.People.push({
label: response.data[i].姓名,
value: response.data[i].考勤编号
})
}
})
},
// 离线外购件出库
addDirectPartm() {
if (Number(this.partnumber) < Number(this.form.DirectNumber)) {
this.$message.error('请正确输入数量')
} else {
this.$refs['form'].validate((valid) => {
if (valid) {
outlinePartOut(this.form.PeopleValue, this.form.DirectNumber, this.locateNumber, this.form.DirectNote, this.form.ProjectValue, this.form.MachineValue, this.form.GroupNumValue, this.materialNumber, this.PeopleNumber, this.离线合同明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchTable1()
// 物料流水号查
outRecord(this.materialNumber, this.pageCurrent2, this.pageSize2).then(response => {
this.tableDataOut = response.data.rows
this.total2 = response.data.total
this.listLoading1 = false
})
} else {
this.$message.error('零件出库失败')
}
})
} else {
console.log('error submit!!')
return false
}
})
}
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
</style>

View File

@@ -0,0 +1,619 @@
<template>
<div class="app-container">
<el-card>
<span>物料名称:</span>
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
<span>库存状态:</span>
<el-select v-model="inventoryStateValue" placeholder="库存状态" size="small" clearable>
<el-option
v-for="item in inventoryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>仓库:</span>
<el-select v-model="purchaseStateValue" placeholder="仓库" size="small">
<el-option
v-for="item in purchaseState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table
v-loading="loading1"
:data="tableData1"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="库存状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="parseInt(scope.row.库存是否不足)===1" type="danger" size="small">不足</el-tag>
<el-tag v-else type="success" size="small">充足</el-tag>
</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="物料型号" min-width="200" 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="供货商" min-width="100" 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="安全库存量" min-width="100" align="center">
<template slot-scope="scope">
<template v-if="scope.row.changeSafeValue">
<el-input v-model="scope.row.安全库存量" class="edit-input" size="mini"/>
<el-button class="cancel-btn" size="mini" icon="el-icon-refresh" type="warning" @click="cancelEdit(scope.row)">取消</el-button>
</template>
<span v-else>{{ scope.row.安全库存量 }}</span>
</template>
</el-table-column>
<el-table-column label="设置" min-width="100" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.changeSafeValue" type="mini" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button
v-else
type="primary"
size="mini"
icon="el-icon-edit"
@click="scope.row.changeSafeValue=!scope.row.changeSafeValue">设置</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-input v-model="purchasecard" placeholder="请购单号" size="small" clearable/>
<span>仓库:</span>
<el-select v-model="HouseNumber" placeholder="请选择仓库" size="small" @change="searchDemo();payMethodChange()">
<el-option
v-for="item in House"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="addTableData">创建离线请购单</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
</el-card>
<el-card>
<el-table v-loading="" :data="tableData2" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
<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="250">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="请购时间" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.请购时间.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="280" fixed="right">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.离线合同状态) === 1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)">作废</el-button>
<el-button type="warning" size="mini" icon="el-icon-download" @click="exportCard(scope.row)">导出</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
<el-button style="margin-left:500px;" type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">传递</el-button>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" 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="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">
{{ 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="200">
<template slot-scope="scope">
{{ scope.row.物料类别 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="100">
<template slot-scope="scope">
<el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisibleExport" center style="min-height: 300px" width="60%">
<el-card>
<div id="print">
<div style="text-align: center">
<h2> 线 </h2>
<hr>
<table class="tgClass" style="table-layout: fixed; width: 820px;margin: auto">
<colgroup>
<col style="width: 73px">
<col style="width: 78px">
<col style="width: 84px">
<col style="width: 88px">
<col style="width: 94px">
<col style="width: 80px">
</colgroup>
<tr>
<td class="tg-s268">请购单号:</td>
<td class="tg-0lax" style=" text-align: left">{{ inbondCard[0] }}</td>
<td class="tg-0lax">请购人:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[1] }}</td>
</tr>
<tr>
<td class="tg-0lax">仓库名称:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[2] }}</td>
<td class="tg-0lax">请购时间:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[3] }}</td>
</tr>
</table>
<div style="margin-top: 10px">
<table class="tg" style="table-layout: fixed; width: 820px; margin: auto">
<tr>
<th class="tg-c3ow">物料名称</th>
<th class="tg-c3ow">物料规格</th>
<th class="tg-c3ow">物料型号</th>
<th class="tg-c3ow">物料品种</th>
<th class="tg-c3ow">物料类别</th>
<th class="tg-c3ow">数量</th>
</tr>
<tr v-for="(list, index) in tableData3" :key="index">
<td class="tg-c3ow">{{ list.物料名称 }}</td>
<td class="tg-c3ow">{{ list.物料规格 }}</td>
<td class="tg-c3ow">{{ list.物料型号 }}</td>
<td class="tg-c3ow">{{ list.物料品种 }}</td>
<td class="tg-c3ow">{{ list.物料类别 }}</td>
<td class="tg-c3ow">{{ list.数量 }}</td>
</tr>
</table>
</div>
</div>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisibleExport=false">取消</el-button>
<el-button type="primary" size="small" @click="printCard">打印</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchRequestCard, initWarehouse, addRequestCard, searchInventoryNum, SeeDetail, addRequestCardDetail, deleteRequest, deleteRequestDetail, alterNumber, setSafeValue } from '@/api/Inventory/OfflinePurchase'
import { mapGetters } from 'vuex'
import $ from 'jquery'
export default {
data() {
return {
purchasecard: '',
purchasecard_check: 1,
loading1: false,
title2: '',
purchaseStateValue: 2, // 采购状态 全部
purchaseState: [
{
label: '未采购',
value: 1
}, {
label: '全部',
value: 2
}
],
check1: 0,
check2: 0,
check3: 0,
check4: 0,
materialName: '',
inventoryStateValue: '', // 库存状态
inventoryStateValue_check: 1,
inventoryState: [
{
label: '充足',
value: 2
},
{
label: '不足',
value: 1
}
],
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
offlineContractNum: '', // 离线合同流水号
offlineContract: '', // 离线合同号
supplierName0: '', // 供应商名称(外面的)
supplierName: '', // 供应商名称
payMethod: [], // 付款方式
payTime: [], // 付款时间节点
tableData2: [],
total2: 0,
pageCurrent2: 1,
pageSize2: 10,
dialogVisible1: false,
form1: {},
tableData01: [],
dialogVisible2: false,
tableData3: [],
textArea: '请选择',
materielGroup: [], // 物料流水号组
partGroup: [], // 离线合同明细流水号组
numGroup: [], // 数量组
priceGroup: [], // 单价组
totalPrice: 0, // 合同总额
tableData4: [], // 合同模板
stipulateArrivalTime: '', // 规定到货时间
payMethodName: '', // 付款方式名称
paramRow: '', // 参数row
disable2: true,
disable3: true,
disable4: true,
purchasecardnumber: '', // 请购单流水号
disable: false, // 其他的禁用
House: [],
HouseNumber: '',
dialogVisibleExport: false, // 导出表单
inbondCard: [] // 导出表格表头
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id' // 人员编号
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
initWarehouse().then(response => { // 初始化仓库
console.log(response)
for (let i = 0; i < response.data.length; i++) {
this.House.push({
label: response.data[i].仓库名称,
value: response.data[i].仓库流水号
})
}
})
},
// 查询离线物料请购单
searchTable2() {
if (this.purchasecard === '') {
this.purchasecard_check = 0
} else {
this.purchasecard_check = 1
}
searchRequestCard(this.pageCurrent2, this.pageSize2, this.purchasecard_check, this.purchasecard).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
// 查询离线物料请购单明细
searchTable3(row) {
this.purchasecardnumber = row.离线请购单流水号
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
},
// 查询离线物料数量
searchTable1() {
if (this.materialName === '') {
this.materialName_check = 0
}
if (this.inventoryStateValue === '') {
this.inventoryStateValue_check = 0
}
searchInventoryNum(this.pageCurrent1, this.pageSize1, this.materialName_check, this.materialName, this.inventoryStateValue_check, this.inventoryStateValue).then(response => {
this.tableData1 = response.data.rows
this.tableData1.map(v => {
this.$set(v, 'changeSafeValue', false)
v.原安全库存量 = v.安全库存量
return v
})
this.total1 = response.data.total
})
},
handleSizeChange1(val) { // 离线请购单列表分页
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChange1(val) { // 离线请购单列表分页
this.pageCurrent1 = val
this.searchTable1()
},
handleSizeChange2(val) { // 离线请购单列表分页
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) { // 离线请购单列表分页
this.pageCurrent2 = val
this.searchTable2()
},
// 增加请购单
addTableData() {
if (this.HouseNumber === '') {
this.$message.error('请选择仓库')
} else {
console.log(this.id, this.HouseNumber)
addRequestCard(this.id, this.HouseNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
}
},
handleSelectionChange(val) {
this.materielGroup = []
for (let i = 0; i < val.length; i++) {
this.materielGroup.push(val[i].物料流水号)
}
},
addMateriel() { // 将物料选入离线合同
if (this.purchasecardnumber === '') {
this.$message.error('请选择请购单')
} else {
addRequestCardDetail(this.purchasecardnumber, this.materielGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else {
this.$message.error('选入失败')
}
})
}
},
deleteOfflineContract(row) { // 删除请购单
this.$confirm('确定删除该请购单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRequest(row.离线请购单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
deleteMateriel(row) { // 删除请购单明细
this.$confirm('确定移除该物料?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRequestDetail(row.离线请购单明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移除成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('移除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消作废'
})
})
},
cancelEdit(row) { // 取消设置
row.安全库存量 = row.原安全库存量
row.changeSafeValue = false
this.$message('取消修改')
},
confirmEdit(row) { // 确认设置
Number(row.安全库存量) ? row.安全库存量 = Number(row.安全库存量) : row.安全库存量 = 0
setSafeValue(row.物料流水号, parseInt(row.安全库存量)).then(response => {
if (response.data[0].result === '1') {
row.changeSafeValue = false
this.$message.success('设置成功')
this.searchTable1()
} else {
this.$message.error('设置失败')
}
})
},
exportCard(row) {
this.dialogVisibleExport = true
this.inbondCard[0] = row.请购单编号
this.inbondCard[1] = row.姓名
this.inbondCard[2] = row.仓库名称
this.inbondCard[3] = row.请购时间.split(' ')[0]
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
},
// 打印请购单
printCard() {
const htmlNode = $('#print').html() // #print为需要打印的dom节点id
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
printNode.remove()
},
// 传递请购单
doneRequestCard() {
this.$confirm('确定传递请购单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.partGroup = []
this.numGroup = []
for (let i = 0; i < this.tableData3.length; i++) {
this.partGroup.push(this.tableData3[i].离线请购单明细流水号)
this.numGroup.push(this.tableData3[i].数量)
}
alterNumber(this.partGroup, this.numGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('请购单生成成功')
this.searchTable2()
SeeDetail(this.purchasecardnumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('请购单生成失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
.searchForm .el-form-item{
margin-bottom: 5px;
}
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 5px;
}
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg .tg-c3ow{border-color:inherit;text-align:center;vertical-align:top}
</style>

View File

@@ -0,0 +1,181 @@
<template>
<div class="app-container">
<el-card>
<span>机床号:</span>
<el-select v-model="Machine" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="机床号" @change="getGroup()">
<el-option
v-for="item in Machines"
: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.value2 }}</div>
</el-option>
</el-select>
<span>组号:</span>
<el-select v-model="Group" size="small" clearable placeholder="组号" style="margin-top:10px;width: 180px;">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件图号:</span>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 180px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading1" :data="tableData1" class="table" border height="650">
<el-table-column
label="序号"
align="center"
width="50"
type="index"/>
<el-table-column align="center" label="零件名称" width="150px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="出库数量" width="120px">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床图号" width="120px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" width="120px">
<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>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-if="!listLoading1"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>
import { getMachines, getGroups, getTable } from '@/api/Inventory/OutPartSelect'
export default {
data() {
return {
Machine: '',
Machines: [],
Group: '',
Groups: [],
number: '',
checkbox_Machine: false,
checkbox_Group: false,
checkbox_number: false,
tableData1: [],
listLoading1: false,
total: 0, // 总条数
pageSize: 10,
pageCurrent: 1
}
},
created() {
this.getMachine()
this.getTableData()
},
methods: {
getMachine() {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
},
getGroup() {
this.Group = ''
this.Groups = []
getGroups(this.Machine).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Groups.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 按条件查询
getTableData() {
this.listLoading1 = true
if (this.Machine === '') {
this.checkbox_Machine = 0
} else {
this.checkbox_Machine = 1
}
if (this.Group === '') {
this.checkbox_Group = 0
} else {
this.checkbox_Group = 1
}
if (this.number === '') {
this.checkbox_number = 0
} else {
this.checkbox_number = 1
}
this.tableData1 = []
getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.listLoading1 = false
} else {
this.tableData1 = response.data.rows
this.total = response.data.total
this.listLoading1 = false
}
})
},
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.getTableData()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,419 @@
<template>
<div class="app-container">
<el-card>
<span>领料单编号:</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="pageCurrent1=1;pageSize1=10;total1=0;searchListinfor()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading" :data="tableData1" highlight-current-row border size="mini" style="width: 100%;" height="300" @row-click = "chooseListinfor">
<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.领料时间 ? scope.row.领料时间.split(' ')[0] : '—' }}
</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>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="listLoading1" :data="tableDataPicking" size="mini" border style="width: 100%;" height="400">
<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="200">
<template slot-scope="scope">
{{ scope.row.零件图号 || scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="200">
<template slot-scope="scope">
{{ scope.row.规格 || scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="领用数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
<el-table-column label="仓库" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位" align="center" 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" width="100">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button :disabled="!!scope.row.是否出库" size="mini" type="danger" icon="el-icon-back" @click="ErrorpartOut(scope.row)">异常</el-button>
<el-button :disabled="!!scope.row.是否出库" size="mini" type="primary" icon="el-icon-back" @click="partOut(scope.row)">出库</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-table v-loading="listLoading1" :data="tableDataExchange" border size="mini" 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">
{{ 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="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.是否禁用" size="mini" type="primary" icon="el-icon-back" style="margin: 0 0 0 0px" @click="execExchangePartOut(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.ErrorNumber" size="small" placeholder="异常数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="异常原因" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.Reason" 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="submitEdit()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { searchList, searchListDetail, PurchasePart, BasicPart, WorkShopPart, ErrorOut, ExchangeOut, ExchangePartOut,
backlogPart } from '@/api/Inventory/PartOut'
import { mapGetters } from 'vuex'
export default {
data() {
return {
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
ProjectValue: ' ',
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
tableDataPurchase: [],
tableData1: [],
tableDataPicking: [], // 领料单明细表格
listNumber: '',
pickingListNumber: null, // 领料单编号
pickingListNumber_check: 1,
pickingListNumberx: '', // 领料单流水号
picikingPeople: '', // 领料人流水号
partProjectNumber: '', // 项目流水号
partProjectName: '', // 项目名称
partMachineNumber: '', // 机床流水号
partMachineName: '', // 机床名称
partGroupNumber: '', // 分组流水号
partGroupName: '', // 分组名称
OutNumber: '', // 出库数量
outNote: '', // 出库备注
getpicikingPeople: '', // 领料人
listLoading: '',
listLoading1: '',
rules: { // 表单验证规则
Normalnumber: [{ required: true, message: '请输入正常数量', trigger: 'blur' }],
ErrorNumber: [{ required: true, message: '请输入异常数量', trigger: 'blur' }],
Reason: [{ required: true, message: '请选择领用人', trigger: 'blur' }]
},
form: {
Normalnumber: '',
ErrorNumber: '',
Reason: ''
},
dialogFormVisible: false,
projectnumber: '',
machinenumber: '',
teamnumber: '',
tableDataExchange: [], // 交换件列表
purchaseDeatileNumber: '', // 采购合同明细流水号
askPurchaseNumber: '', // 请购单明细流水号
craftnumber: '', // 工艺计划流水号
partType: '', // 零件类型
locatenumber: '',
partName: '' // 名称
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
this.getpeopleid()
this.searchListinfor()
},
methods: {
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchListinfor()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchListinfor()
},
// 获取人员编号
getpeopleid() {
this.picikingPeople = this.id
},
// 查询领料单
searchListinfor() {
this.pickingListNumber ? this.pickingListNumber_check = 1 : this.pickingListNumber_check = 0
this.listLoading = true
searchList(this.pickingListNumber_check, this.pickingListNumber, this.pageCurrent1, this.pageSize1).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.listLoading = false
})
},
// 选择领料单
chooseListinfor(row) {
console.log(row, 99)
this.pickingListNumberx = row.领料单流水号
this.getpicikingPeople = row.领料人流水号
this.searchListDetailt()
this.searchExchange()
},
// 查询领料单明细
searchListDetailt() {
this.listLoading1 = true
searchListDetail(this.pickingListNumberx).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].是否出库 === '1' ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataPicking = data
console.log(this.tableDataPicking)
this.listLoading1 = false
})
},
// 查询交换单
searchExchange() {
ExchangeOut(this.pickingListNumberx).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].是否出库 === 1 ? data[i].是否禁用 = true : data[i].是否禁用 = false
}
this.tableDataExchange = data
})
},
// 出库
partOut(row) {
console.log(row.出库类型, row.领料单明细流水号, row.出库数量, row.滞货物料与货位对照流水号)
this.$confirm('确认出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (row.出库类型 === 4) { // 滞货件
backlogPart(row.领料单明细流水号, row.出库数量, row.滞货物料与货位对照流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.searchListDetailt()
} else { this.$message.error('出库失败') }
})
} else if (row.出库类型 === 3) { // 车间采购件
WorkShopPart(row.领料单明细流水号, row.请购单明细流水号, this.getpicikingPeople, row.出库数量, row.货位流水号, row.物料与货位对照流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.searchListDetailt()
} else { this.$message.error('出库失败') }
})
} else if (row.出库类型 === 2) { // 采购件
PurchasePart(row.领料单明细流水号, row.采购合同明细流水号, this.getpicikingPeople, row.出库数量, row.货位流水号, row.物料与货位对照流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.searchListDetailt()
} else { this.$message.error('出库失败') }
})
} else { // 自制件
console.log(row.领料单明细流水号, row.工艺计划流水号, row.出库数量, row.收件信息ID, this.getpicikingPeople, row.备注)
BasicPart(row.领料单明细流水号, row.工艺计划流水号, row.出库数量, row.收件信息ID, this.getpicikingPeople, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.searchListDetailt()
} else { this.$message.error('出库失败') }
})
}
}).catch(() => {
this.$message('已取消操作')
})
},
ErrorpartOut(row) {
this.dialogFormVisible = true
this.projectnumber = row.项目流水号
this.machinenumber = row.机床流水号
this.teamnumber = row.组件流水号
this.purchaseDeatileNumber = row.采购合同明细流水号
this.askPurchaseNumber = row.请购单明细流水号
this.craftnumber = row.工艺计划流水号
this.locatenumber = row.货位流水号
this.partType = row.零件类型
this.partName = row.名称
},
callOff() {
this.form = []
this.dialogFormVisible = false
},
execExchangePartOut(row) {
ExchangePartOut(row.交换单流水号, row.被交换件采购合同明细流水号, row.申请人, row.交换数量, row.被交换货位流水号, row.备注).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible = false
this.form = []
} else {
this.$message.error('出库失败')
}
})
},
submitEdit() {
ErrorOut(this.projectnumber, this.machinenumber, this.teamnumber, this.partName, this.picikingPeople, this.purchaseDeatileNumber, this.askPurchaseNumber, this.craftnumber, this.locatenumber, this.form.ErrorNumber, this.form.Reason, this.partType).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.dialogFormVisible = false
this.form = []
} else {
this.$message.error('添加失败')
}
})
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,739 @@
<template>
<div class="app-container">
<el-card>
<el-radio-group
v-model="radio"
size="small"
style="margin: 10px;"
@change="BasicShow()">
<el-radio v-model="radio" :label="1" >修改记录</el-radio>
<el-radio v-model="radio" :label="2" style="margin-left: 2px" >异常记录</el-radio>
</el-radio-group>
<span style="margin-left: 20px">项目名称:</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
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent=1;pageSize=10;total=0;getAlterRecord()">查询</el-button>
</el-card>
<el-card v-show="altershow">
<el-table
v-loading="loading"
:data="tableData1"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="项目名称" min-width="100" 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="组号" min-width="100" 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="数量" min-width="100" 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="记录人" min-width="100" 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.修改日期 ? scope.row.修改日期.split(' ')[0] : '' }}
</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="零件类型" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.类型名称 }}
</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="pageSize"
:total="total"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card v-show="errorshow">
<el-table
v-loading="loading2"
:data="tableData2"
border
style="width: 100%;max-height: 300px;"
height="300px"
size="mini"
@selection-change="handleSelectionChange2">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="项目名称" min-width="100" 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="组号" min-width="100" 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="异常数量" min-width="100" 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="仓库" min-width="100" 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.记录时间 ? scope.row.记录时间.split(' ')[0] : '' }}
</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>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<el-card>
<span>补投单号:</span>
<el-input v-model="repleacecard" placeholder="补投单号" size="small" clearable style="width: 200px"/>
<span>仓库:</span>
<el-select v-model="HouseNumber" placeholder="请选择仓库" size="small" @change="searchDemo();payMethodChange()">
<el-option
v-for="item in House"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent3=1;pageSize3=10;total3=0;getReplacement()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="addCard">创建补投单</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="submitCardDetail">选入物料</el-button>
</el-card>
<el-card>
<el-table v-loading="loading3" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable4">
<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="250">
<template slot-scope="scope">
{{ scope.row.补投时间 ? 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" width="280" fixed="right">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.离线合同状态) === 1" type="danger" size="mini" icon="el-icon-delete" @click="deleteOfflineContract(scope.row)">作废</el-button>
<el-button type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard(scope.row)">导出</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 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-table v-loading="loading4" :data="tableData4" border style="max-height: 300px;" 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="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">
{{ 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">
<el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteDetail(scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisibleExport" center style="min-height: 300px" width="60%">
<el-card>
<div id="print">
<div style="text-align: center">
<h2> </h2>
<hr>
<table class="tgClass" style="table-layout: fixed; width: 820px;margin: auto">
<colgroup>
<col style="width: 120px">
<col style="width: 250px">
<col style="width: 110px">
<col style="width: 100px">
<col style="width: 120px">
<col style="width: 120px">
</colgroup>
<tr>
<td class="tg-s268">补投单编号:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[0] }}</td>
<td class="tg-0lax">姓名:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[1] }}</td>
</tr>
<tr>
<td class="tg-0lax">补投时间:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[2] }}</td>
<td class="tg-0lax">仓库名称:</td>
<td class="tg-0lax" style="text-align: left">{{ inbondCard[3] }}</td>
</tr>
</table>
</div>
<div style="margin-top: 10px">
<table class="tg" style="table-layout: fixed; width: 820px; margin: auto">
<colgroup>
<col style="width: 74px">
<col style="width: 78px">
<col style="width: 84px">
<col style="width: 88px">
<col style="width: 94px">
<col style="width: 80px">
</colgroup>
<tr>
<th class="tg-c3ow">项目名称</th>
<th class="tg-c3ow">机床图号</th>
<th class="tg-c3ow">组号</th>
<th class="tg-c3ow">名称</th>
<th class="tg-c3ow">数量</th>
<th class="tg-c3ow">类型</th>
</tr>
<tr v-for="(list, index) in tableData4" :key="index">
<td class="tg-c3ow">{{ list.项目名称 }}</td>
<td class="tg-c3ow">{{ list.机床图号 }}</td>
<td class="tg-c3ow">{{ list.组号 }}</td>
<td class="tg-c3ow">{{ list.名称 }}</td>
<td class="tg-c3ow">{{ list.数量 }}</td>
<td class="tg-c3ow">{{ list.类型名称 }}</td>
</tr>
</table>
</div>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisibleExport=false">取消</el-button>
<el-button type="primary" size="small" @click="printCard">打印</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { initProject, searchmachine, searchTeam, searchAlterRecord, searchErrorRecord, searchReplacementCard, addReplacementCard, initWarehouse, addCardDetail, searchCardDetail, deleteReplacementCard, deleteCardDetail } from '@/api/Inventory/PartsReplacement'
import { mapGetters } from 'vuex'
import $ from 'jquery'
export default {
data() {
return {
ProjectValue: '',
Project: [],
MachineValue: '',
Machine: [],
GroupNumValue: '',
GroupNum: '',
tableData1: [],
tableData2: [],
tableData3: [],
tableData4: [],
loading: false,
loading2: false,
loading3: false,
loading4: false,
pageCurrent: 1,
pageSize: 10,
total: 0,
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
pageCurrent3: 1,
pageSize3: 10,
total3: 0,
ProjectValue_check: '',
MachineValue_check: '',
GroupNumValue_check: '',
repleacecard: '',
repleacecard_check: '',
people: '',
HouseNumber: '',
House: [],
radio: '',
altershow: true,
errorshow: false,
projectGroup: [],
machineGroup: [],
partGroup: [],
nameGroup: [],
numberGroup: [],
locateGroup: [],
partType: [],
reasonGroup: [],
cardNumber: '',
inbondCard: [], // 补投单
dialogVisibleExport: false // 导出表单
}
},
computed: {
...mapGetters([
'id' // 人员编号
])
},
created() {
this.fetchData()
this.getpeopleid()
this.getHouse()
},
methods: {
// 获取人员编号
getpeopleid() {
this.people = this.id
},
getHouse() {
initWarehouse().then(response => { // 初始化仓库
console.log(response)
for (let i = 0; i < response.data.length; i++) {
this.House.push({
label: response.data[i].仓库名称,
value: response.data[i].仓库流水号
})
}
})
},
handleSelectionChange(val) {
this.projectGroup = []
this.machineGroup = []
this.partGroup = []
this.nameGroup = []
this.numberGroup = []
this.locateGroup = []
this.partType = []
this.reasonGroup = []
for (let i = 0; i < val.length; i++) {
this.projectGroup.push(val[i].项目流水号)
this.machineGroup.push(val[i].机床流水号)
this.partGroup.push(val[i].组件流水号)
this.nameGroup.push(val[i].名称)
this.numberGroup.push(val[i].数量)
this.locateGroup.push(val[i].货位流水号)
this.partType.push(val[i].零件类型)
this.reasonGroup.push(val[i].原因)
}
},
handleSelectionChange2(val) {
this.projectGroup = []
this.machineGroup = []
this.partGroup = []
this.nameGroup = []
this.numberGroup = []
this.locateGroup = []
this.partType = []
this.reasonGroup = []
for (let i = 0; i < val.length; i++) {
this.projectGroup.push(val[i].项目流水号)
this.machineGroup.push(val[i].机床流水号)
this.partGroup.push(val[i].组件流水号)
this.nameGroup.push(val[i].名称)
this.numberGroup.push(val[i].异常数量)
this.locateGroup.push(val[i].货位流水号)
this.partType.push(val[i].零件类型)
this.reasonGroup.push(val[i].异常原因)
}
},
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
},
searchMachine() { // 查询机床
this.Machine = []
this.GroupNum = []
this.MachineValue = ''
this.GroupNumValue = ''
console.log(this.ProjectValue)
if (this.ProjectValue !== '') {
searchmachine(1, 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() { // 查询组号
this.GroupNum = []
this.GroupNumValue = ''
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].组件流水号
})
}
})
},
// 查询修改记录
getAlterRecord() {
this.loading = true
this.tableData1 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
} else {
this.ProjectValue_check = 1
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
} else {
this.MachineValue_check = 1
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
} else {
this.GroupNumValue_check = 1
}
searchAlterRecord(this.pageCurrent, this.pageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableData1 = response.data.rows
this.total = response.data.total
this.loading = false
})
this.getErrorRecord()
},
// 查询异常记录
getErrorRecord() {
this.loading2 = true
this.tableData2 = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
} else {
this.ProjectValue_check = 1
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
} else {
this.MachineValue_check = 1
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
} else {
this.GroupNumValue_check = 1
}
searchErrorRecord(this.pageCurrent2, this.pageSize2, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
this.loading2 = false
})
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.getAlterRecord()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.getAlterRecord()
},
handleSizeChange2(val) {
this.PageCurrent2 = 1
this.PageSize2 = val
this.getErrorRecord()
},
handleCurrentChange2(val) {
this.PageCurrent2 = val
this.getErrorRecord()
},
handleSizeChange3(val) {
this.PageCurrent3 = 1
this.PageSize3 = val
this.getReplacement()
},
handleCurrentChange3(val) {
this.PageCurrent3 = val
this.getReplacement()
},
// 查询补投单
getReplacement() {
this.loading3 = true
this.tableData3 = []
if (this.repleacecard === '') {
this.repleacecard_check = 0
} else {
this.repleacecard_check = 1
}
searchReplacementCard(this.pageCurrent3, this.pageSize3, this.repleacecard_check, this.repleacecard).then(response => {
this.tableData3 = response.data.rows
this.total3 = response.data.total
this.loading3 = false
})
},
addCard() {
if (this.HouseNumber === '') {
this.$message.error('请选择仓库')
} else {
addReplacementCard(this.people, this.HouseNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.getReplacement()
} else {
this.$message.error('删除失败')
}
})
}
},
BasicShow() {
if (this.radio === 1) {
this.altershow = true
this.errorshow = false
} else if (this.radio === 2) {
this.altershow = false
this.errorshow = true
}
},
searchTable4(row) {
this.cardNumber = row.补投单流水号
this.getdetail()
},
submitCardDetail() {
if (this.cardNumber === '') {
this.$message.error('请选择领料单')
} else {
addCardDetail(this.cardNumber, this.projectGroup, this.machineGroup, this.partGroup, this.nameGroup, this.numberGroup, this.locateGroup, this.partType, this.reasonGroup, this.CardDetail).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.searchTable4()
} else {
this.$message.error('增加失败')
}
})
}
},
// 查询补投单明细
getdetail() {
this.loading4 = true
searchCardDetail(this.cardNumber).then(response => {
this.tableData4 = response.data
this.loading4 = false
})
},
// 删除补投单
deleteOfflineContract(row) { // 删除请购单
this.$confirm('确定删除该补投单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteReplacementCard(row.补投单流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getReplacement()
} else {
this.$message.error('数据占用')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 删除补投单明细
deleteDetail(row) {
this.$confirm('确定删除该补投单明细?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteCardDetail(row.补投单明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.getdetail()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
doneRequestCard(row) {
this.dialogVisibleExport = true
this.cardNumber = row.补投单流水号
this.inbondCard[0] = row.补投单编号
this.inbondCard[1] = row.姓名
this.inbondCard[2] = row.补投时间.split(' ')[0]
this.inbondCard[3] = row.仓库名称
searchCardDetail(this.cardNumber).then(response => {
this.tableData4 = response.data
})
},
// 打印请购单
printCard() {
const htmlNode = $('#print').html() // #print为需要打印的dom节点id
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
printNode.remove()
}
}
}
</script>
<style scoped>
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
.tg .tg-c3ow{border-color:inherit;text-align:center;vertical-align:top}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,481 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<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="searchList()">查询</el-button>
</div>
<h4 style="margin-top:0">领料单</h4>
<el-table :data="pickListTable1" highlight-current-row border style="width: 100%;" size="mini" height="300" @row-click="clickList">
<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.操作日期.split(' ')[0] }}
</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="90">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否审批)===1" type="success">已审批</el-tag>
<el-tag v-if="Number(scope.row.是否审批)===0 && Number(token)!==21 && Number(token)!==36 && Number(token)!==37" type="warning">未审批</el-tag>
<el-button v-if="Number(scope.row.是否审批)===0 && (Number(token)===21 || Number(token)===36 || Number(token)===37)" size="mini" type="primary" plain icon="el-icon-check" @click="approvalPass(scope.row)">审批</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;margin: 10px 0;">
<el-pagination
:current-page="pageCurrent3"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize3"
:total="total3"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"/>
</div>
<h4>领料单明细{{ pickingListNumberShow }}</h4>
<el-table :data="pickListTable2" border style="width: 100%;" size="mini" height="300">
<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">
{{ 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="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 v-if="true" label="备料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否备料确认)===1" type="success" size="mini">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" type="success" size="mini">已确认</el-tag>
<el-tag v-else type="warning" size="mini">未确认</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { initPickPerson, initMachineProject, searchgroup, searchTable, searchList, createList, dropList, selectIntoList, searchListDetail, dropListDetail } from '@/api/Inventory/CreatePickingList'
import request from '@/utils/request'
import { mapGetters } from 'vuex'
export default {
name: 'PickingListApproval',
data() {
return {
PartType: '基本件',
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
groupNumber: [],
tableData0: [],
tableData1: [],
tableData2: [],
pageCurrent0: 1,
pageSize0: 20,
total0: 0,
pageCurrent1: 1,
pageSize1: 20,
total1: 0,
pageCurrent2: 1,
pageSize2: 20,
total2: 0,
pickListTable1: [],
pageCurrent3: 1,
pageSize3: 20,
total3: 0,
pickListTable2: [],
dialogFormVisible1: false,
form1: {
领料人流水号: '',
领料单备注: ''
},
rules1: {
领料人流水号: [{ required: true, message: '请选择领料人' }]
},
pickPerson: [],
pickingListNumber: '', // 领料单编号
pickingListNumberShow: '', // 领料单编号
pickingListNum: '', // 领料单流水号
multipleSelection: []
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
mounted() {
this.fetchData()
this.searchTable()
this.searchList()
},
methods: {
// 审批通过
approvalPass(row) {
this.$confirm('是否审批通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单 set 是否审批 = 1 where 领料单流水号 = ${row.领料单流水号}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.pickingListNumber = ''
this.searchList()
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 初始化数据
fetchData() {
initPickPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pickPerson.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machineNumber.push({
label: response.data[i].机床图号,
name: response.data[i].项目名称,
value: response.data[i].机床流水号
})
}
})
},
// 根据机床查分组
machineChange() {
this.groupNumberValue = ''
this.groupNumber = []
searchgroup(this.machineNumberValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.groupNumber.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 查三表
searchTable() {
this.multipleSelection = []
if (this.PartType === '标准件') {
this.searchTable0()
} else if (this.PartType === '外购件') {
this.searchTable1()
} else if (this.PartType === '基本件') {
this.searchTable2()
}
},
// 标准件
searchTable0() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1).then(response => {
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
},
// 外购件
searchTable1() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
// 基本件
searchTable2() {
let check1, check2
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, 3).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
handleSizeChange0(val) {
this.pageSize0 = val
this.pageCurrent0 = 1
this.searchTable0()
},
handleCurrentChange0(val) {
this.pageCurrent0 = val
this.searchTable0()
},
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()
},
// 查询领料单列表
searchList() {
let check, isElectrical
this.pickingListNumber ? check = 1 : check = 0
Number(this.token) === 37 || Number(this.token) === 36 || Number(this.token) === 35 ? isElectrical = 1 : isElectrical = 0 // 35电工 36电气部长 37电气副部长
searchList(this.pageCurrent3, this.pageSize3, check, this.pickingListNumber, isElectrical).then(response => {
this.pickListTable1 = response.data.rows
this.total3 = response.data.total
})
},
handleSizeChange3(val) {
this.pageSize3 = val
this.pageCurrent3 = 1
this.searchList()
},
handleCurrentChange3(val) {
this.pageCurrent3 = val
this.searchList()
},
// 创建领料单
createList() {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.领料人流水号 = ''
this.form1.领料单备注 = ''
this.dialogFormVisible1 = true
},
// 提交创建领料单
submitCreateList() {
let isElectrical
Number(this.token) === 37 || Number(this.token) === 36 || Number(this.token) === 35 ? isElectrical = 1 : isElectrical = 0 // 35电工 36电气部长 37电气副部长
createList(this.form1.领料人流水号, this.form1.领料单备注, isElectrical).then(response => {
if (response.data[0].result === '1') {
this.$message.success('创建成功')
this.dialogFormVisible1 = false
this.searchList()
} else { this.$message.error('操作失败') }
})
},
// 确认领料单
checkList(row) {
this.$confirm('是否确认领回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = {
url: '',
method: 'post',
data: {
type: '4',
name: `update 车间装配管理_领料单 set 是否启用 = 0 where 领料单流水号 = ${row.领料单流水号}`
}
}
request(param).then(res => {
if (res.data[0].result === '1') {
this.$message.success('操作成功')
this.pickingListNumber = ''
this.searchList()
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
// 删除领料单
dropList(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropList(row.领料单流水号).then(response => {
if (Number(response.data[0].result) === 1) {
this.$message.success('删除成功')
this.searchList()
} else {
this.$message.error('数据占用')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = val
},
// 选入
selectInto() {
const basePartGroup = []
const purchasePartGroup = []
this.multipleSelection.map(v => {
v.基本件流水号 ? basePartGroup.push(v.基本件流水号) : purchasePartGroup.push(v.标准件和外购件流水号)
})
if (basePartGroup.length === 0 && purchasePartGroup.length === 0) {
this.$message.warning('请勾选零件')
return
}
if (!this.pickingListNum || !this.pickingListNumberShow) {
this.$message.warning('请选择领料单')
return
}
if (basePartGroup.length) { // 基本件
selectIntoList(basePartGroup, null, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable()
this.clickList()
} else { this.$message.error('操作失败') }
})
} else { // 标准件外购件
selectIntoList(null, purchasePartGroup, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('操作成功')
this.searchTable()
this.clickList()
} else { this.$message.error('操作失败') }
})
}
},
// 查看领料单明细
clickList(row) {
console.log(row)
row ? this.pickingListNum = row.领料单流水号 : this.pickingListNum
row ? this.pickingListNumberShow = row.领料单编号 : this.pickingListNumberShow
searchListDetail(this.pickingListNum).then(res => {
this.pickListTable2 = res.data
})
},
// 删除领料单明细
dropListDetail(row) {
console.log(row)
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dropListDetail(row.领料单明细流水号).then(response => {
if (Number(response.data[0].result) === 1) {
this.$message.success('删除成功')
this.clickList()
} 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;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -0,0 +1,259 @@
<template>
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<el-row style="margin-bottom:10px">
<el-col style="width:250px">
<span>项目名称:</span>
<el-select v-model="projectValue" style="width:150px" placeholder="请选择" size="small" clearable filterable @change="projectChange">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width:250px">
<span>机床图号:</span>
<el-select v-model="machineValue" style="width:150px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-select v-model="groupValue" style="width:150px" placeholder="请选择" size="small" clearable filterable>
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
</el-row>
<el-row style="margin-bottom:10px">
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="name" clearable size="small" style="width:150px" />
</el-col>
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="spec" clearable size="small" style="width:150px" />
</el-col>
<span>图号或型号:</span>
<el-input v-model="model" clearable size="small" style="width:150px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="searchRecord()">查询</el-button>
</el-row>
</div>
<h4 style="margin-top: 0">采购合同件</h4>
<el-table :data="tableData1" border size="mini" style="width: 100%;" height="400">
<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="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="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>
<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>
<h4>离线合同件</h4>
<el-table :data="tableData2" border size="mini" style="width: 100%;" height="400">
<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="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="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>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize2"
:total="total2"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</div>
</template>
<script>
import { initProject, searchMachine, searchGroup, searchRecord1, searchRecord2 } from '@/api/Inventory/PurchaseInRecord'
export default {
name: 'PurchaseInRecord',
data() {
return {
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
name: '',
spec: '',
model: '',
tableData1: [],
tableData2: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
pageSize2: 10,
pageCurrent2: 1,
total2: 0
}
},
mounted() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
this.searchRecord()
},
methods: {
projectChange() {
this.machine = []
this.machineValue = ''
this.group = []
this.groupValue = ''
searchMachine(this.projectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
value: response.data[i].机床流水号,
label: response.data[i].机床图号
})
}
})
},
machineChange() {
this.group = []
this.groupValue = ''
searchGroup(this.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
value: response.data[i].组件流水号,
label: response.data[i].组号
})
}
})
},
searchRecord() {
this.pageCurrent1 = 1
this.pageSize1 = 10
this.searchRecord1()
this.pageCurrent2 = 1
this.pageSize2 = 10
this.searchRecord2()
},
searchRecord1() {
let check1, check2, check3, check4, check5, check6
this.projectValue ? check1 = 1 : check1 = 0
this.machineValue ? check2 = 1 : check2 = 0
this.groupValue ? check3 = 1 : check3 = 0
this.name ? check4 = 1 : check4 = 0
this.spec ? check5 = 1 : check5 = 0
this.model ? check6 = 1 : check6 = 0
searchRecord1(check1, this.projectValue, check2, this.machineValue, check3, this.groupValue, check4, this.name, check5, this.spec, check6, this.model, this.pageCurrent1, this.pageSize1).then(res => {
this.tableData1 = res.data.rows
this.total1 = res.data.total
})
},
searchRecord2() {
let check4, check5, check6
this.name ? check4 = 1 : check4 = 0
this.spec ? check5 = 1 : check5 = 0
this.model ? check6 = 1 : check6 = 0
searchRecord2(check4, this.name, check5, this.spec, check6, this.model, this.pageCurrent2, this.pageSize2).then(res => {
this.tableData2 = res.data.rows
this.total2 = res.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchRecord1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchRecord1()
},
handleSizeChange2(val) {
this.pageSize2 = val
this.pageCurrent2 = 1
this.searchRecord2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchRecord2()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,200 @@
<template>
<div class="app-container">
<el-card>
<div slot="header" class="clearfix">
<el-row style="margin-bottom:10px">
<el-col style="width:250px">
<span>项目名称:</span>
<el-select v-model="projectValue" style="width:150px" placeholder="请选择" size="small" clearable filterable @change="projectChange">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width:250px">
<span>机床图号:</span>
<el-select v-model="machineValue" style="width:150px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-select v-model="groupValue" style="width:150px" placeholder="请选择" size="small" clearable filterable>
<el-option
v-for="item in group"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
</el-row>
<el-row style="margin-bottom:10px">
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="name" clearable size="small" style="width:150px" />
</el-col>
<el-col style="width:250px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="spec" clearable size="small" style="width:150px" />
</el-col>
<el-col style="width:250px">
<span>图号或型号:</span>
<el-input v-model="model" clearable size="small" style="width:150px" />
</el-col>
</el-row>
<el-row>
<span>出库时间:</span>
<el-date-picker
v-model="outTime"
type="daterange"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="~"
style="width:250px"
start-placeholder=""
end-placeholder=""/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageCurrent1=1;pageSize1=10;searchRecord()">查询</el-button>
</el-row>
</div>
<el-table :data="tableData" border size="mini" style="width: 100%;" height="600">
<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="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="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>
<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 { initProject, searchMachine, searchGroup, searchRecord } from '@/api/Inventory/PurchaseOutRecord'
export default {
name: 'PurchaseOutRecord',
data() {
return {
projectValue: '', // 项目名称
project: [],
machineValue: '',
machine: [],
groupValue: '',
group: [],
name: '',
spec: '',
model: '',
tableData: [],
pageSize1: 10,
pageCurrent1: 1,
total1: 0,
outTime: '' // 出库时间
}
},
mounted() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
this.searchRecord()
},
methods: {
projectChange() {
this.machine = []
this.machineValue = ''
this.group = []
this.groupValue = ''
searchMachine(this.projectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
value: response.data[i].机床流水号,
label: response.data[i].机床图号
})
}
})
},
machineChange() {
this.group = []
this.groupValue = ''
searchGroup(this.machineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.group.push({
value: response.data[i].组件流水号,
label: response.data[i].组号
})
}
})
},
searchRecord() {
let check1, check2, check3, check4, check5, check6, check7
this.projectValue ? check1 = 1 : check1 = 0
this.machineValue ? check2 = 1 : check2 = 0
this.groupValue ? check3 = 1 : check3 = 0
this.name ? check4 = 1 : check4 = 0
this.spec ? check5 = 1 : check5 = 0
this.model ? check6 = 1 : check6 = 0
this.outTime ? check7 = 1 : check7 = 0
searchRecord(check1, this.projectValue, check2, this.machineValue, check3, this.groupValue, check4, this.name, check5, this.spec, check6, this.model, check7, this.outTime[0] || '', this.outTime[1] || '', this.pageCurrent1, this.pageSize1).then(res => {
this.tableData = res.data.rows
this.total1 = res.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchRecord()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchRecord()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 15px;
}
span{
margin: 10px 0 10px 10px;
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<div class="app-container">
<el-card>
<span>机床号:</span>
<el-select v-model="Machine" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="机床号" @change="getGroup()">
<el-option
v-for="item in Machines"
: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.value2 }}</div>
</el-option>
</el-select>
<span>组号:</span>
<el-select v-model="Group" size="small" clearable placeholder="组号" style="margin-top:10px;width: 180px;">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>零件图号:</span>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 180px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="getTableData();pageCurrent=1;pageSize=10;total = 0">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading1" :data="tableData1" class="table" border height="650">
<el-table-column
label="序号"
align="center"
width="50"
type="index"/>
<el-table-column align="center" label="零件名称" width="150px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="入库数量" width="120px">
<template slot-scope="scope">
{{ scope.row.入库数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="机床图号" width="120px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="组号" width="120px">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column align="center" label="仓库名称" width="120px">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="货位名称" width="120px">
<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>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-if="!listLoading1"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</div>
</template>
<script>
import { getMachines, getGroups, getTable } from '@/api/Inventory/StockInquiry'
export default {
data() {
return {
Machine: '',
Machines: [],
Group: '',
Groups: [],
number: '',
checkbox_Machine: false,
checkbox_Group: false,
checkbox_number: false,
tableData1: [],
listLoading1: false,
total: 0, // 总条数
pageSize: 10,
pageCurrent: 1
}
},
created() {
this.getMachine()
this.getTableData()
},
methods: {
getMachine() {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
},
getGroup() {
this.Group = ''
this.Groups = []
getGroups(this.Machine).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Groups.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
})
},
// 按条件查询
getTableData() {
this.listLoading1 = true
if (this.Machine === '') {
this.checkbox_Machine = 0
} else {
this.checkbox_Machine = 1
}
if (this.Group === '') {
this.checkbox_Group = 0
} else {
this.checkbox_Group = 1
}
if (this.number === '') {
this.checkbox_number = 0
} else {
this.checkbox_number = 1
}
this.tableData1 = []
getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.listLoading1 = false
} else {
this.tableData1 = response.data.rows
this.total = response.data.total
this.listLoading1 = false
}
})
},
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.getTableData()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,123 @@
<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="subPartName" 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
size="mini"
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="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: [],
check1: 0,
check2: 0,
substituteNumber: '', // 替换单编号
subPartName: '', // 替换件名称
listLoading: '',
subList: '',
locateNumber: '',
subNumber: ''
}
},
methods: {
// 替换单查询
getSubstitutedCard() {
this.listloading = true
this.substituteNumber ? this.check1 = 1 : this.check1 = 0
this.subPartName ? this.check2 = 1 : this.check2 = 0
searchSubstitutedCard(this.check1, this.substituteNumber, this.check2, this.subPartName).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,545 @@
<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"
size = "mini"
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="mini" 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>
<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-row>
<el-col :span="11">
<div>
<el-table
v-loading="listLoading"
:data="tableData1"
border
style="width: 100%;"
size = "mini"
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 25px">
<el-button size="small" type="warning" icon="el-icon-edit" @click="addSub()" >替换件</el-button>
</div>
<div style="margin: 10px 29px">
<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
size = "mini"
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>
</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" height="600px">
<el-form :rules="rules" label-position="left">
<el-form-item label="物料名称" prop="ContractNumberValue" label-width="150px" size="mini">
<el-input v-model="materialName" size="small" placeholder="物料名称" style="width: 200px"/>
<el-button type="primary" size = "mini" @click="getSubstituted()">查询</el-button>
</el-form-item>
<el-table
:data="tableDataSub"
border
size = "mini"
style="width: 100%;"
height="200px">
<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="mini" 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 size = "mini" @click="callOff('form')">取消</el-button>
<el-button size = "mini" type="primary" @click="chooseSub()"> </el-button>
</div>
</el-dialog>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataExchange"
border
size = "mini"
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="mini" type="primary" icon="el-icon-edit" style="margin: 0 0 0 0px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="mini" 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: '',
PageCurrent: 1,
PageSize: 10,
total: null,
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: '',
materialName: '',
materialName_check: 0
}
},
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() {
this.MachineValue = ''
this.Machine = []
this.GroupNumValue = ''
this.GroupNum = []
if (this.ProjectValue !== '') {
this.ProjectValue_check = 1
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].机床流水号
})
}
})
} else {
this.ProjectValue_check = 0
}
},
searchGroupList() { // 查询组号
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].组件名称,
value: response.data[i].组件流水号
})
}
})
},
// 被替换件查询
searchPartinfo() {
this.tableDataPurchase = []
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
} else {
this.ProjectValue_check = 1
}
if (this.MachineValue === '') {
this.MachineValue_check = 0
} else {
this.MachineValue_check = 1
}
if (this.GroupNumValue === '') {
this.GroupNumValue_check = 0
} else {
this.GroupNumValue_check = 1
}
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 => {
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].组件零件基本件流水号 === '0') {
response.data.rows[i].零件类型 = response.data.rows[i].零件类型代码
response.data.rows[i].类型名称 = response.data.rows[i].外购件类型
}
}
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].组件零件流水号 === '0') {
response.data.rows[i].物料名称 = response.data.rows[i].零件名称
response.data.rows[i].项目名称 = response.data.rows[i].基本件项目名称
response.data.rows[i].机床图号 = response.data.rows[i].基本件机床图号
response.data.rows[i].组号 = response.data.rows[i].基本件组号
response.data.rows[i].项目流水号 = response.data.rows[i].基本件项目流水号
response.data.rows[i].机床流水号 = response.data.rows[i].基本件机床流水号
response.data.rows[i].组件流水号 = response.data.rows[i].基本件组件流水号
}
}
this.tableDataPurchase = response.data.rows
this.listLoading = false
})
},
// 重置表单
callOff() {
this.dialogFormVisible = false
this.dialogFormVisible2 = false
},
addSub() {
this.dialogFormVisible2 = true
},
// 被替换件查询
getSubstituted() {
if (this.materialName === '') {
this.materialName_check = 0
} else {
this.materialName_check = 1
}
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.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 })
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.searchPartinfo()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.searchPartinfo()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,270 @@
<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
:disabled="scope.row.是否禁用"
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 if (response.data[0].剩余数量 === 0) {
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(() => {
if (this.locateNumber === '') {
this.$message.error('请选择货位')
} else {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].innumber === '0') {
this.$message.error('请输入正确数量')
} else {
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>