Merge branch 'dev' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dev

This commit is contained in:
duan 2024-07-23 10:16:10 +08:00
commit 6f15f226ee
2 changed files with 99 additions and 36 deletions

View File

@ -113,14 +113,15 @@
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal()"></el-input-number>
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
@change="consCountTotal()"></el-input-number>
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips">入库前{{ scope.row.number }}{{ scope.row.conUnit }}
</div>
</template>
@ -150,7 +151,7 @@
<template v-slot="scope">
<div class="name_wrap">
<span class="name">{{ scope.row.name }}</span>
<span v-if="scope.row.specSnap" >({{ scope.row.specSnap }})</span>
<span v-if="scope.row.specSnap">({{ scope.row.specSnap }})</span>
<!-- <el-tag type="info" v-if="scope.row.specSnap" size="mini">{{ scope.row.specSnap }}</el-tag> -->
</div>
</template>
@ -158,14 +159,15 @@
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
@change="modifyPrice($event, scope.row, 'costPrice')"></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 => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
<el-input-number v-model="scope.row.number" :min="0" :step="1" step-strictly
controls-position="right"
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
<div class="tips">入库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -305,20 +307,50 @@ export default {
this.queryForm.type = type
},
//
consCountTotal() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
consCountTotal(cvalue, row, key1, key2 = undefined) {
if (cvalue == undefined) {
setTimeout(() => {
row[key1] = 0
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
}, 10)
} else {
row[key1] = cvalue
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
}
},
//
modifyPrice() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = formatDecimal(zong)
modifyPrice(cvalue, row, key1, key2 = undefined) {
if (cvalue == undefined) {
setTimeout(() => {
row[key1] = 0
row[key2] = 0
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = formatDecimal(zong)
}, 10)
} else {
row[key1] = cvalue
row[key2] = cvalue
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = formatDecimal(zong)
}
},
//
submitHandle() {

View File

@ -110,14 +110,15 @@
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal()"></el-input-number>
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
@change="consCountTotal()"></el-input-number>
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips">出库前{{ scope.row.number }}{{ scope.row.conUnit }}</div>
</template>
</el-table-column>
@ -153,14 +154,14 @@
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
@change="modifyPrice($event, scope.row, 'costPrice')"></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 => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
<div class="tips">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -299,20 +300,50 @@ export default {
this.queryForm.type = type
},
//
consCountTotal() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
consCountTotal(cvalue, row, key1, key2 = undefined) {
if (cvalue == undefined) {
setTimeout(() => {
row[key1] = 0
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
}, 10)
} else {
row[key1] = cvalue
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
this.queryForm.totalAmount = formatDecimal(zong)
}
},
//
modifyPrice() {
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = zong
modifyPrice(cvalue, row, key1, key2 = undefined) {
if (cvalue == undefined) {
setTimeout(() => {
row[key1] = 0
row[key2] = 0
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = formatDecimal(zong)
}, 10)
} else {
row[key1] = cvalue
row[key2] = cvalue
let zong = 0
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
this.queryForm.totalAmount = formatDecimal(zong)
}
},
//
submitHandle() {