修复耗材绑定有限打开多规格后单规格样式错乱问题
This commit is contained in:
parent
a3e6c066a3
commit
acf055ee72
|
|
@ -17,10 +17,9 @@
|
||||||
<div class="name">商品名:{{ goodsDetail.name }}</div>
|
<div class="name">商品名:{{ goodsDetail.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 绑定到商品 -->
|
<!-- 绑定到商品 -->
|
||||||
<el-table :data="tableData.cons" v-if="type == 1">
|
<el-table :data="tableData.cons" border v-show="type == 1">
|
||||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||||
<el-table-column label="规格名称" prop="specSnap" v-if="type == 2"></el-table-column>
|
<el-table-column label="耗材名称" prop="conInfoId">
|
||||||
<el-table-column label="耗材名称">
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-select v-model="scope.row.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
|
<el-select v-model="scope.row.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
|
||||||
:remote-method="remoteMethod" :loading="loading" @change="selectionChange($event, scope.row)">
|
:remote-method="remoteMethod" :loading="loading" @change="selectionChange($event, scope.row)">
|
||||||
|
|
@ -31,18 +30,18 @@
|
||||||
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单位">
|
<el-table-column label="单位" prop="conUnit">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span v-if="scope.row.conInfoId">{{ scope.row.conUnit }}</span>
|
<span v-if="scope.row.conInfoId">{{ scope.row.conUnit }}</span>
|
||||||
<span v-else>请选择耗材</span>
|
<span v-else>请选择耗材</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="使用数量">
|
<el-table-column label="使用数量" prop="surplusStock">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number v-model="scope.row.surplusStock" :min="0" />
|
<el-input-number v-model="scope.row.surplusStock" :min="0" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100px">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="table_btn_wrap">
|
<div class="table_btn_wrap">
|
||||||
<div class="btn sub" @click="tableData.cons.splice(scope.$index, 1)">
|
<div class="btn sub" @click="tableData.cons.splice(scope.$index, 1)">
|
||||||
|
|
@ -56,7 +55,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 绑定到规格 -->
|
<!-- 绑定到规格 -->
|
||||||
<el-table :data="tableData.cons" border v-if="type == 2">
|
<el-table :data="tableData.cons" border v-show="type == 2">
|
||||||
<el-table-column label="序号" type="index" width="100"></el-table-column>
|
<el-table-column label="序号" type="index" width="100"></el-table-column>
|
||||||
<el-table-column label="规格名称" prop="specSnap"></el-table-column>
|
<el-table-column label="规格名称" prop="specSnap"></el-table-column>
|
||||||
<el-table-column label="耗材" width="600">
|
<el-table-column label="耗材" width="600">
|
||||||
|
|
@ -94,7 +93,7 @@
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
||||||
<div class="table_btn_wrap">
|
<div class="table_btn_wrap t">
|
||||||
<div class="btn sub" v-if="index > 0" @click="scope.row.consList.splice(index, 1)">
|
<div class="btn sub" v-if="index > 0" @click="scope.row.consList.splice(index, 1)">
|
||||||
<i class="el-icon-remove-outline"></i>
|
<i class="el-icon-remove-outline"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -105,39 +104,6 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <template v-slot="scope">
|
|
||||||
<div class="cons_list_wrap">
|
|
||||||
<div class="row" v-for="(item, index) in scope.row.consList" :key="index">
|
|
||||||
<div class="item">
|
|
||||||
<el-select v-model="item.conInfoId" filterable remote reserve-keyword
|
|
||||||
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading"
|
|
||||||
@change="skuSelectionChange($event, item)">
|
|
||||||
<el-option v-for="item in options" :key="item.consId" :label="item.conName"
|
|
||||||
:value="item.consId">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<span v-if="item.conInfoId">{{ item.conUnit }}</span>
|
|
||||||
<span v-else>请选择耗材</span>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<el-input-number v-model="item.surplusStock" :min="0" />
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<div class="table_btn_wrap">
|
|
||||||
<div class="btn sub" v-if="index > 0" @click="scope.row.consList.splice(index, 1)">
|
|
||||||
<i class="el-icon-remove-outline"></i>
|
|
||||||
</div>
|
|
||||||
<div class="btn add" @click="skuCreateItem(scope.$index)">
|
|
||||||
<i class="el-icon-circle-plus-outline"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template> -->
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
|
|
@ -345,8 +311,6 @@ export default {
|
||||||
this.tableData.cons.push(item)
|
this.tableData.cons.push(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.goodsDetail.conInfos.length) {
|
if (this.goodsDetail.conInfos.length) {
|
||||||
this.tableData.cons.map(val => {
|
this.tableData.cons.map(val => {
|
||||||
this.goodsDetail.conInfos.map(item => {
|
this.goodsDetail.conInfos.map(item => {
|
||||||
|
|
@ -364,10 +328,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 生成新关系项
|
// 生成新商品绑定耗材关系项
|
||||||
createItem(val) {
|
createItem(val) {
|
||||||
if (this.type == 1) {
|
|
||||||
|
|
||||||
let item = {}
|
let item = {}
|
||||||
|
|
||||||
item.id = ''
|
item.id = ''
|
||||||
|
|
@ -381,30 +343,6 @@ export default {
|
||||||
item.status = 1
|
item.status = 1
|
||||||
|
|
||||||
this.tableData.cons.push(item)
|
this.tableData.cons.push(item)
|
||||||
} else {
|
|
||||||
let item = {}
|
|
||||||
|
|
||||||
item.id = ''
|
|
||||||
item.shopId = localStorage.getItem('shopId')
|
|
||||||
item.productId = this.goodsDetail.id
|
|
||||||
item.productSkuId = val.productSkuId
|
|
||||||
item.conInfoId = ''
|
|
||||||
item.name = ''
|
|
||||||
item.conUnit = ''
|
|
||||||
item.surplusStock = 0
|
|
||||||
item.status = 1
|
|
||||||
item.specSnap = val.specSnap
|
|
||||||
item.consList = [
|
|
||||||
{
|
|
||||||
conInfoId: '',
|
|
||||||
name: '',
|
|
||||||
conUnit: '',
|
|
||||||
surplusStock: 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
this.tableData.cons.push(item)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 规格生成新关系项
|
// 规格生成新关系项
|
||||||
skuCreateItem($index) {
|
skuCreateItem($index) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue