修改商品绑定耗材选

择商品和耗材的弹窗设置最大高度
This commit is contained in:
2024-08-27 16:22:56 +08:00
parent 1516b84c42
commit 83d0c54717
3 changed files with 114 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()" @close="reset"> <el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()" @close="reset" top="5vh">
<el-form :model="searhForm" inline> <el-form :model="searhForm" inline>
<el-form-item> <el-form-item>
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input> <el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
@@ -213,6 +213,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.head-container{
max-height: 60vh;
overflow-y: scroll;
}
.shop_info { .shop_info {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName"> <el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName" top="5vh">
<div class="app-container"> <div class="app-container">
<!-- <div class="head-container"> <!-- <div class="head-container">
<el-form :model="query" inline> <el-form :model="query" inline>
@@ -93,6 +93,10 @@
}; };
</script> </script>
<style scoped> <style scoped>
.head-container{
max-height: 60vh;
overflow-y: scroll;
}
.cursor-pointer{ .cursor-pointer{
cursor: pointer; cursor: pointer;
color: #1890ff; color: #1890ff;

View File

@@ -144,6 +144,7 @@
:title="dialogtitle" :title="dialogtitle"
:visible.sync="dialogshow" :visible.sync="dialogshow"
width="1000px" width="1000px"
top="5vh"
@close="resetCommodityArr" @close="resetCommodityArr"
> >
<el-form ref="addSelect" :inline="true"> <el-form ref="addSelect" :inline="true">
@@ -153,96 +154,95 @@
</template> </template>
</el-form-item> --> </el-form-item> -->
<template> <template>
<el-table :span-method="objectSpanMethod" :data="commodityArr"> <div class="scroll-box">
<el-table-column prop="name" label="商品名称"> </el-table-column> <el-table :span-method="objectSpanMethod" :data="commodityArr">
<el-table-column label="规格"> <el-table-column prop="name" label="商品名称"> </el-table-column>
<template v-slot="scope"> <el-table-column label="规格">
<!-- 多规格 -->
<template
v-if="
scope.row.typeEnum == '多规格' &&
scope.row.isDistribute == 0
"
>
{{ scope.row.specSnap }}
</template>
<!-- 单规格 -->
<div v-else>
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column label="耗材">
<el-table-column label="耗材信息">
<template v-slot="scope"> <template v-slot="scope">
<div> <!-- 多规格 -->
<div <template
style="margin-bottom: 10px" v-if="
v-for="(haocai, index) in scope.row.haocais" scope.row.typeEnum == '多规格' &&
:key="index" scope.row.isDistribute == 0
> "
<template v-if="haocai.conName"> >
<div>{{ haocai.conName }}</div> {{ scope.row.specSnap }}
</template> </template>
<template v-else> <!-- 单规格 -->
<el-input <div v-else>
disabled {{ scope.row.name }}
v-model="haocai.conName"
style="width: 130px"
placeholder="请选择耗材信息"
></el-input>
</template>
</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位耗材值" width="180"> <el-table-column label="耗材">
<template v-slot="scope"> <el-table-column label="耗材信息">
<div> <template v-slot="scope">
<div <div>
style="margin-bottom: 10px; display: flex" <div
v-for="(haocai, haocaiIndex) in scope.row.haocais" style="margin-bottom: 10px"
:key="haocaiIndex" v-for="(haocai, index) in scope.row.haocais"
> :key="index"
<el-input >
v-model="haocai.surplusStock" <template v-if="haocai.conName">
type="number" <div>{{ haocai.conName }}</div>
placeholder="单位耗材值" </template>
@input="handleKeyUp($event, haocaiIndex)" <template v-else>
></el-input> <el-input
<div style="margin-left: 10px"> disabled
<el-button v-model="haocai.conName"
v-if="scope.row.haocais.length > 1" style="width: 130px"
type="danger" placeholder="请选择耗材信息"
size="mini" ></el-input>
@click=" </template>
delGoodsHaocai(scope.row.haocais, haocaiIndex)
"
icon="el-icon-delete"
circle
></el-button>
</div> </div>
</div> </div>
</div> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="单位耗材值" width="180">
<el-table-column label="操作"> <template v-slot="scope">
<template v-slot="scope"> <div>
<el-button <div
size="mini" style="margin-bottom: 10px; display: flex"
type="primary" v-for="(haocai, haocaiIndex) in scope.row.haocais"
@click="selecthaocai(scope.row)" :key="haocaiIndex"
>去选择耗材信息</el-button >
> <el-input
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)"> v-model="haocai.surplusStock"
type="number"
placeholder="单位耗材值"
@input="handleKeyUp($event, haocaiIndex)"
></el-input>
<div style="margin-left: 10px">
<el-button
v-if="scope.row.haocais.length > 1"
type="danger"
size="mini"
@click="
delGoodsHaocai(scope.row.haocais, haocaiIndex)
"
icon="el-icon-delete"
circle
></el-button>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
<el-button
size="mini"
type="primary"
@click="selecthaocai(scope.row)"
>去选择耗材信息</el-button
>
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
增加耗材 增加耗材
</el-button> --> </el-button> -->
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <!-- <el-table-column label="操作">
<!-- <el-table-column label="操作">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@@ -252,8 +252,8 @@
> >
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
</div>
<!-- <div v-for="(ele, index) in commodityArr" :key="ele.id"> <!-- <div v-for="(ele, index) in commodityArr" :key="ele.id">
<template> <template>
<div> <div>
@@ -312,16 +312,13 @@
</div> --> </div> -->
</template> </template>
<el-form-item
style="display: flex; margin-top: 20px; justify-content: flex-end"
>
<el-button @click="dialogshow = false">取 消</el-button>
<el-button type="primary" @click="submitForm('addSelect')"
>确 定</el-button
>
</el-form-item>
</el-form> </el-form>
<div slot="footer" style="display: flex; justify-content: flex-end">
<el-button @click="dialogshow = false">取 消</el-button>
<el-button type="primary" @click="submitForm('addSelect')"
>确 定</el-button
>
</div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
@@ -414,7 +411,7 @@
<el-table-column label="单位" prop="conUnit" /> <el-table-column label="单位" prop="conUnit" />
<el-table-column label="库存数量" prop="stockNumber"> <el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.balance}} {{ scope.row.balance }}
</template> </template>
</el-table-column> </el-table-column>
@@ -475,7 +472,7 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<shopList ref="shopList" @success="selectShop" /> <shopList ref="shopList" @success="selectShop" />
<bind-haocai ref="bindHaocai"></bind-haocai> <bind-haocai ref="bindHaocai"></bind-haocai>
</div> </div>
</template> </template>
@@ -658,7 +655,7 @@ export default {
let index = -1; let index = -1;
for (let key in haocaiSelectedMap) { for (let key in haocaiSelectedMap) {
const item = haocaiSelectedMap[key]; const item = haocaiSelectedMap[key];
console.log(item) console.log(item);
index++; index++;
this.$set(ele.haocais, index, { this.$set(ele.haocais, index, {
consInfoId: item.consId, consInfoId: item.consId,
@@ -786,11 +783,11 @@ export default {
}, },
// 选择耗材 // 选择耗材
selecthaocai(item) { selecthaocai(item) {
console.log(item) console.log(item);
console.log(haocaiSelectedMap) console.log(haocaiSelectedMap);
this.ALLisDistribute = item; this.ALLisDistribute = item;
this.commodityArr.forEach((ele) => { this.commodityArr.forEach((ele) => {
if (ele.id == this.ALLisDistribute.id && ele.skuId==item.skuId) { if (ele.id == this.ALLisDistribute.id && ele.skuId == item.skuId) {
ele.haocais.map((v) => { ele.haocais.map((v) => {
if (v.conInfoId) { if (v.conInfoId) {
haocaiSelectedMap[v.conInfoId] = v; haocaiSelectedMap[v.conInfoId] = v;
@@ -964,7 +961,7 @@ export default {
async submitForm(formName) { async submitForm(formName) {
if (this.dialogtitle == "编辑") { if (this.dialogtitle == "编辑") {
await puttbProskuCon({ await puttbProskuCon({
...this.surplusStocks ...this.surplusStocks,
}); });
this.$message({ this.$message({
message: "修改成功", message: "修改成功",
@@ -989,8 +986,8 @@ export default {
let newArr = []; let newArr = [];
for (let i of this.commodityArr) { for (let i of this.commodityArr) {
//共享库存 //共享库存
console.log(i.haocais) console.log(i.haocais);
if (i.isDistribute) { if (i.isDistribute) {
for (let k of i.haocais) { for (let k of i.haocais) {
newArr.push({ newArr.push({
@@ -1005,8 +1002,8 @@ export default {
newArr.push({ newArr.push({
consInfoId: k.conInfoId, consInfoId: k.conInfoId,
productId: i.id, productId: i.id,
skuInfos:{ skuInfos: {
...k ...k,
}, },
}); });
} }
@@ -1091,4 +1088,8 @@ export default {
.head-container .filter-item { .head-container .filter-item {
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
.scroll-box {
max-height: 70vh;
overflow-y: scroll;
}
</style> </style>