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

This commit is contained in:
duan 2024-08-09 11:17:21 +08:00
commit 2292bd6b82
2 changed files with 40 additions and 6 deletions

View File

@ -95,7 +95,8 @@
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button> <el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
</el-form-item> --> </el-form-item> -->
<el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync" <el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync"
:value-key="inTabValue == 'goods' ? 'name' : 'conName'" :placeholder="inTabValue == 'goods'?'商品搜索':'耗材搜索'" @select="handleSelect" :value-key="inTabValue == 'goods' ? 'name' : 'conName'"
:placeholder="inTabValue == 'goods' ? '商品搜索' : '耗材搜索'" @select="handleSelect"
style="width: 500px;"></el-autocomplete> style="width: 500px;"></el-autocomplete>
</el-form> </el-form>
</div> </div>
@ -145,7 +146,8 @@
</el-table-column> --> </el-table-column> -->
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" @click="tableData.list.splice(scope.$index, 1),consCountTotal($event, scope.row, 'stockNumber')">删除</el-button> <el-button type="text"
@click="tableData.list.splice(scope.$index, 1), spliceclick()">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -189,7 +191,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" @click="tableData.list.splice(scope.$index, 1),consCountTotal($event, scope.row, 'stockNumber')">删除</el-button> <el-button type="text"
@click="tableData.list.splice(scope.$index, 1), spliceclick()">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -346,6 +349,20 @@ export default {
this.selectConsumable([item]) this.selectConsumable([item])
} }
}, },
//
spliceclick() {
var zong = 0
if (this.inTabValue == 'goods') {
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
} else {
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
}
this.queryForm.totalAmount = formatDecimal(zong)
},
// //
selectShop(res) { selectShop(res) {
let arr = [] let arr = []

View File

@ -95,7 +95,8 @@
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button> <el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
</el-form-item> --> </el-form-item> -->
<el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync" <el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync"
:value-key="inTabValue == 'goods' ? 'name' : 'conName'" :placeholder="inTabValue == 'goods'?'商品搜索':'耗材搜索'" @select="handleSelect" :value-key="inTabValue == 'goods' ? 'name' : 'conName'"
:placeholder="inTabValue == 'goods' ? '商品搜索' : '耗材搜索'" @select="handleSelect"
style="width: 500px;"></el-autocomplete> style="width: 500px;"></el-autocomplete>
</el-form> </el-form>
@ -142,7 +143,8 @@
</el-table-column> --> </el-table-column> -->
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" @click="tableData.list.splice(scope.$index, 1),consCountTotal($event, scope.row, 'stockNumber')">删除</el-button> <el-button type="text"
@click="tableData.list.splice(scope.$index, 1), spliceclick()">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -184,7 +186,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" @click="tableData.list.splice(scope.$index, 1),consCountTotal($event, scope.row, 'stockNumber')">删除</el-button> <el-button type="text"
@click=" tableData.list.splice(scope.$index, 1), spliceclick()">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -348,6 +351,20 @@ export default {
this.resetHandle() this.resetHandle()
this.queryForm.type = type this.queryForm.type = type
}, },
//
spliceclick() {
var zong = 0
if (this.inTabValue == 'goods') {
this.tableData.list.forEach(ele => {
zong += ele.costPrice * ele.number
})
} else {
this.tableData.list.forEach(ele => {
zong += ele.price * ele.stockNumber
})
}
this.queryForm.totalAmount = formatDecimal(zong)
},
// //
consCountTotal(cvalue, row, key1, key2 = undefined) { consCountTotal(cvalue, row, key1, key2 = undefined) {
if (cvalue == undefined) { if (cvalue == undefined) {