优化入库

This commit is contained in:
duan 2024-06-26 16:04:53 +08:00
parent f9ae277ca8
commit 5e283bb804
2 changed files with 19 additions and 7 deletions

View File

@ -90,14 +90,14 @@
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
@change="e => { scope.row.costPrice = e }"></el-input-number>
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
<div class="tips">成本价{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
<div class="tips">入库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -202,7 +202,13 @@ export default {
this.tbShopPurveyorGet()
},
methods: {
modifyPrice() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = zong
},
//
submitHandle() {
this.$refs.queryForm.validate(async valid => {
@ -210,7 +216,6 @@ export default {
try {
this.queryFormLoading = true
this.queryForm.list = this.tableData.list
console.log(this.queryForm,'调试costPrice')
await tbProductStockOperateOutAndOn(this.queryForm)
this.queryFormLoading = false
this.showResult = true

View File

@ -89,15 +89,15 @@
</el-table-column>
<el-table-column label="进价">
<template v-slot="scope">
<!-- <el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number> -->
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
<div class="tips">成本价{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
<div class="tips">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -202,6 +202,13 @@ export default {
this.tbShopPurveyorGet()
},
methods: {
modifyPrice() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = zong
},
//
submitHandle() {
this.$refs.queryForm.validate(async valid => {