This commit is contained in:
gyq 2024-09-27 15:51:37 +08:00
parent 89da9cc1fc
commit 41fa886d23
2 changed files with 26 additions and 5 deletions

View File

@ -332,7 +332,7 @@
</div> --> </div> -->
</el-form-item> </el-form-item>
<template v-if="form.typeEnum != 'group'"> <template v-if="form.typeEnum != 'group'">
<el-form-item label="上架区域"> <!-- <el-form-item label="上架区域">
<div class="shop_type_box"> <div class="shop_type_box">
<div class="item" :class="{ active: form.isShowCash }" @click="areaChange('isShowCash')"> <div class="item" :class="{ active: form.isShowCash }" @click="areaChange('isShowCash')">
<div class="s_title">收银台</div> <div class="s_title">收银台</div>
@ -347,11 +347,17 @@
</div> </div>
</div> </div>
</div> </div>
</el-form-item> -->
<el-form-item label="上架">
<el-switch v-model="form.isGrounding" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="库存开关"> <el-form-item label="库存开关">
<el-switch v-model="form.isStock" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="form.isStock" :active-value="1" :inactive-value="0"></el-switch>
<div class="tips">关闭则不计算出入库数据</div> <div class="tips">关闭则不计算出入库数据</div>
</el-form-item> </el-form-item>
<el-form-item label="设为推荐">
<el-switch v-model="form.isHot" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="库存数量" v-if="form.isStock"> <el-form-item label="库存数量" v-if="form.isStock">
<el-input-number @change="priceFormat(form, 'stockNumber')" @blur="priceFormat(form, 'stockNumber')" <el-input-number @change="priceFormat(form, 'stockNumber')" @blur="priceFormat(form, 'stockNumber')"
v-model="form.stockNumber" controls-position="right"></el-input-number> v-model="form.stockNumber" controls-position="right"></el-input-number>
@ -511,7 +517,9 @@ export default {
refundPolicy: "", refundPolicy: "",
usageRules: "", usageRules: "",
}, },
stockNumber: 0 stockNumber: 0,
isHot: 1,
isGrounding: 1
}, },
imgList: [], imgList: [],
rules: { rules: {

View File

@ -91,7 +91,7 @@
</div> </div>
</div> </div>
<div class="head-container" id="table_drag"> <div class="head-container" id="table_drag">
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id" <el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="key"
:tree-props="{ children: 'skuList', hasChildren: 'hasChildren' }"> :tree-props="{ children: 'skuList', hasChildren: 'hasChildren' }">
<el-table-column width="50px"></el-table-column> <el-table-column width="50px"></el-table-column>
<el-table-column label="商品信息"> <el-table-column label="商品信息">
@ -134,7 +134,8 @@
<template v-slot="scope"> <template v-slot="scope">
<div class="cons_wrap" v-if="scope.row.typeEnum"> <div class="cons_wrap" v-if="scope.row.typeEnum">
<div v-if="scope.row.conInfos && scope.row.conInfos.length"> <div v-if="scope.row.conInfos && scope.row.conInfos.length">
<span v-for="item in scope.row.conInfos" :key="item.id">{{ item.conName }}</span> <el-button type="text" v-for="item in scope.row.conInfos" :key="item.id"
@click="showBindCons(scope.row)">{{ item.conName }}</el-button>
</div> </div>
<el-button type="text" @click="showBindCons(scope.row)"> <el-button type="text" @click="showBindCons(scope.row)">
绑定 绑定
@ -206,7 +207,7 @@
<el-dialog :title="editorEumn[editorForm.key]" :visible.sync="editorVisable" :show-close="false" width="300px"> <el-dialog :title="editorEumn[editorForm.key]" :visible.sync="editorVisable" :show-close="false" width="300px">
<el-form :model="editorForm"> <el-form :model="editorForm">
<el-form-item> <el-form-item>
<el-input-number v-model="editorForm.value" /> <el-input-number v-model="editorForm.value" :min="0" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -311,6 +312,8 @@ export default {
this.editorConfirmChange() this.editorConfirmChange()
} }
this.getTableData()
}, },
changeGrounding(event, row, key) { changeGrounding(event, row, key) {
this.editorForm.key = key this.editorForm.key = key
@ -436,6 +439,16 @@ export default {
shopId: localStorage.getItem('shopId'), shopId: localStorage.getItem('shopId'),
sort: this.tableData.sort sort: this.tableData.sort
}) })
res.content.map(item => {
item.key = item.id
item.skuList.map(val => {
val.key = `${item.id}-${val.id}`
})
})
console.log(res);
this.tableData.loading = false this.tableData.loading = false
this.tableData.data = res.content this.tableData.data = res.content
this.tableData.total = res.totalElements this.tableData.total = res.totalElements