领用滞货

This commit is contained in:
chenjianan
2019-03-29 18:32:33 +08:00
parent 4c75a41e56
commit 59ec93bf3e
6 changed files with 394 additions and 51 deletions

View File

@@ -1,17 +1,179 @@
<template>
<div class="app-container">
<el-card></el-card>
<el-card>
<div slot="header" class="clearfix">
<span>关联状态</span>
<el-checkbox-group v-model="connectStatus" :min="1" size="small" style="display: inline-block">
<el-checkbox label="0">未关联</el-checkbox>
<el-checkbox label="1">已关联</el-checkbox>
</el-checkbox-group>
<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>
</div>
<h4 style="margin-top: 0">滞货使用情况表</h4>
<el-table :data="tableData1" size="mini" stripe border style="width: 100%;" highlight-current-row height="440" @row-click="searchConnect">
<el-table-column label="关联状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否关联)===1" type="success" size="small">已关联</el-tag>
<el-tag v-else type="info" size="small">未关联</el-tag>
</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="80">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="使用滞货数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.使用滞货数量 }}
</template>
</el-table-column>
<el-table-column label="使用人姓名" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="使用时间" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button :disabled="Number(scope.row.是否关联)===1" size="mini" type="primary" @click="connectBacklog(scope.row)">关联物料</el-button>
</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>
<h4>滞货关联明细</h4>
<el-table :data="tableData2" size="mini" border style="width: 100%;" height="220">
<el-table-column label="序号" align="center" type="index" width="80"/>
<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 props="仓库名称" label="仓库名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="关联数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.关联数量 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :visible.sync="dialogVisible1" title="关联物料" center style="min-height: 300px;" width="900px">
<el-table :data="tableData01" size="mini" border style="width: 100%;" height="220" show-summary @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<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 props="仓库名称" 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" width="120" prop="关联数量">
<template slot-scope="scope">
<el-input-number :min="0" v-model="scope.row.关联数量" size="mini" controls-position="right" style="width: 100%"/>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible1=false">取消</el-button>
<el-button type="primary" size="small" @click="submitConnectBacklog">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {} from '@/api/PurchasingCenter/BacklogGoodsPrepare'
import { searchBacklogUseRecord, searchBacklogLocation, submitConnectBacklog, searchBacklogConnectDetail } from '@/api/PurchasingCenter/BacklogGoodsPrepare'
import { mapGetters } from 'vuex'
export default {
name: 'BacklogGoodsPrepare',
data() {
return {
tableData: []
connectStatus: ['0'],
tableData1: [],
PageCurrent1: 1,
PageSize1: 10,
total1: 0,
tableData2: [],
dialogVisible1: false,
tableData01: [],
multipleSelection: [],
useNumber: '', // 使用数量
useNum: '' // 滞货使用流水号
}
},
computed: {
@@ -21,9 +183,83 @@ export default {
},
mounted() {
this.initData()
this.searchTable1()
},
methods: {
initData() {}
// 初始化数据
initData() {},
// 查询滞货使用记录
searchTable1() {
let status
if (Number(this.connectStatus) === 0) {
status = 0
} else if (Number(this.connectStatus) === 1) {
status = 1
} else {
status = 2
}
searchBacklogUseRecord(this.PageCurrent1, this.PageSize1, status).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
// 查询滞货关联
searchConnect(row) {
searchBacklogConnectDetail(row.滞货使用流水号).then(response => {
this.tableData2 = response.data
})
},
// 关联物料
connectBacklog(row) {
this.dialogVisible1 = true
this.useNumber = row.使用滞货数量
this.useNum = row.滞货使用流水号
searchBacklogLocation(row.物料流水号).then(response => {
this.tableData01 = response.data
this.tableData01.map(v => {
this.$set(v, '关联数量', 0)
return v
})
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = val
},
// 提交关联物料
submitConnectBacklog() {
let sum = 0
const numGroup = []
const materialLocalGroup = []
for (let i = 0; i < this.multipleSelection.length; i++) {
sum += this.multipleSelection[i].关联数量
numGroup.push(this.multipleSelection[i].关联数量)
materialLocalGroup.push(this.multipleSelection[i].物料与货位对照流水号)
}
if (sum === Number(this.useNumber)) {
submitConnectBacklog(this.useNum, materialLocalGroup, numGroup).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('关联成功')
this.searchTable1()
this.dialogVisible1 = false
} else {
this.$message.error('关联失败')
}
})
} else {
this.$message.error('关联数量有误')
}
}
}
}
</script>
@@ -41,4 +277,7 @@ export default {
span{
margin: 10px 0 10px 10px;
}
.el-tag{
margin: 0
}
</style>

View File

@@ -97,14 +97,14 @@
{{ Number(scope.row.使用滞货数量) }}
</template>
</el-table-column>
<el-table-column label="使用滞货" align="center" min-width="130">
<el-table-column label="使用滞货" align="center" min-width="70">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="使用滞货" placement="top-start">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.滞货数量)===0" icon="el-icon-goods" plain type="primary" size="mini" @click="useInventory(scope.row)"/>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="取消使用滞货" placement="top-start">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.使用滞货数量)===0" icon="el-icon-sold-out" plain type="danger" size="mini" @click="cancelUseInventory(scope.row)"/>
</el-tooltip>
<!--<el-tooltip class="item" effect="dark" content="使用滞货" placement="top-start">-->
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.滞货数量)===0" icon="el-icon-goods" plain type="primary" size="mini" @click="useInventory(scope.row)"/>
<!--</el-tooltip>-->
<!--<el-tooltip class="item" effect="dark" content="取消使用滞货" placement="top-start">-->
<!--<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.使用滞货数量)===0" icon="el-icon-sold-out" plain type="danger" size="mini" @click="cancelUseInventory(scope.row)"/>-->
<!--</el-tooltip>-->
</template>
</el-table-column>
<el-table-column label="滞货数量" align="center" min-width="80">
@@ -573,10 +573,10 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="460px">
<el-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="400px">
<span>使用滞货数量:</span>
<el-input-number :min="0" :max="maxUseNumber" v-model="useNumber" controls-position="right"/>
<div style="margin-top: 10px;color: red">注意:若设置待询价物料全部使用滞货,则将不可取消使用滞货</div>
<div style="margin: 10px 0 0 10px;color: red">注意:确定后将不可取消使用滞货</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible4=false">取消</el-button>
<el-button :disabled="Number(useNumber)===0" type="primary" size="small" @click="submitUseInventory">确定</el-button>
@@ -588,7 +588,7 @@
<script>
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, cancelUseInventory } from '@/api/PurchasingCenter/CreateInquirySheet'
submitUseInventory } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
import { exportExcelMethod } from './exportExcel'
@@ -712,7 +712,7 @@ export default {
},
methods: {
submitUseInventory() {
submitUseInventory(this.backlogMaterialNum, this.useNumber, this.backlogGroupPartNum).then(response => {
submitUseInventory(this.backlogMaterialNum, this.useNumber, this.backlogGroupPartNum, this.id).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.searchTable11()
@@ -729,27 +729,27 @@ export default {
this.backlogGroupPartNum = row.组件零件流水号
this.dialogVisible4 = true
},
cancelUseInventory(row) { // 取消使用滞货
console.log(row)
this.backlogMaterialNum = row.物料流水号
this.backlogGroupPartNum = row.组件零件流水号
this.cancelNum = row.使用滞货数量
this.$confirm('确定取消使用滞货?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum)
cancelUseInventory(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum).then(response => {
if (response.data[0].result === '1') {
this.searchTable11()
this.$message.success('操作成功')
} else { this.$message.error('操作失败') }
})
}).catch(() => {
this.$message.info('已取消操作')
})
},
// cancelUseInventory(row) { // 取消使用滞货
// console.log(row)
// this.backlogMaterialNum = row.物料流水号
// this.backlogGroupPartNum = row.组件零件流水号
// this.cancelNum = row.使用滞货数量
// this.$confirm('确定取消使用滞货?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// console.log(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum)
// cancelUseInventory(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum).then(response => {
// if (response.data[0].result === '1') {
// this.searchTable11()
// this.$message.success('操作成功')
// } else { this.$message.error('操作失败') }
// })
// }).catch(() => {
// this.$message.info('已取消操作')
// })
// },
saveOrder() { // 保存询价单
const orderNumGroup = []
const numGroup = []