修改商品绑定耗材选

择商品和耗材的弹窗设置最大高度
This commit is contained in:
YeMingfei666 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>
<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-item>
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
@ -213,6 +213,10 @@ export default {
</script>
<style scoped lang="scss">
.head-container{
max-height: 60vh;
overflow-y: scroll;
}
.shop_info {
display: flex;
align-items: center;

View File

@ -1,6 +1,6 @@
<template>
<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="head-container">
<el-form :model="query" inline>
@ -93,6 +93,10 @@
};
</script>
<style scoped>
.head-container{
max-height: 60vh;
overflow-y: scroll;
}
.cursor-pointer{
cursor: pointer;
color: #1890ff;

View File

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