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

This commit is contained in:
duan
2024-08-27 16:38:21 +08:00
5 changed files with 135 additions and 111 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()">
<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>
@@ -93,6 +93,9 @@ export default {
}
},
methods: {
reset(){
this.$refs.table.clearSelection()
},
onInput: _.debounce(function (event) {//防抖请求
this.getTableData()
}, 500),
@@ -210,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

@@ -94,8 +94,11 @@
</el-table-column>
<el-table-column label="所属商品" width="220">
<template v-slot="scope">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="库存数量" prop="stockNumber">
@@ -858,6 +861,13 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .goods-list .el-button--text span{
display: block;
text-align: left;
}
::v-deep .goods-list .el-button--text{
white-space: break-spaces;
}
.color-success {
color: #67c23a;
cursor: pointer;

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>

View File

@@ -1405,15 +1405,17 @@ export default {
});
},
"goods.query.productId": function (newval) {
console.log(newval);
if (newval === "") {
this.goods.list = this.$goodsData.records || [];
if(!this.$goodsData){
return
}
if (newval == "") {
this.goods.list = this.$goodsData || [];
} else {
const newarr = this.$goodsData.records.filter((v) =>
const newarr = this.$goodsData.filter((v) =>
v.name.includes(newval.trim())
);
this.search.list = newarr;
this.goods.list = newarr.length ? newarr : this.$goodsData.records;
this.goods.list = newarr.length ? newarr : this.$goodsData;
}
},
},