商品列表、组合商品的新增、编辑添加权限控制

This commit is contained in:
DESKTOP-8FGKA8Q\chunfen 2024-09-07 16:55:06 +08:00
parent 3410958449
commit c62829b1ad
3 changed files with 16 additions and 16 deletions

View File

@ -23,12 +23,12 @@
:on-error="uploadError" style="display:inline-block;margin: 0 15px 0 0;"> :on-error="uploadError" style="display:inline-block;margin: 0 15px 0 0;">
<el-button type="warning" icon="el-icon-upload2">组合商品导入</el-button> <el-button type="warning" icon="el-icon-upload2">组合商品导入</el-button>
</el-upload> </el-upload>
<el-button type="primary" plain @click="addGoodsCombination" icon="el-icon-plus">新增组合商品</el-button> <el-button type="primary" plain @click="addGoodsCombination" icon="el-icon-plus" v-if="is_admin">新增组合商品</el-button>
</div> </div>
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border <el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }"> style="width: 100%" row-key="id" :tree-props="{ children: 'children' }">
<el-table-column label="商品信息" width="400"> <el-table-column label="商品信息" width="400" class-name="flex">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="commodityimg"> <div class="commodityimg">
<img :src="scope.row.img_url" class="Img" /> <img :src="scope.row.img_url" class="Img" />
@ -40,8 +40,8 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="组合数量"></el-table-column> <el-table-column prop="num" label="组合数量" align="center"></el-table-column>
<el-table-column label="剩余库存"> <el-table-column label="剩余库存" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!scope.row.children">{{ scope.row.stock }}</span> <span v-if="!scope.row.children">{{ scope.row.stock }}</span>
</template> </template>
@ -65,9 +65,9 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
<!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column> --> <!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column> -->
<el-table-column sortable prop="sale_stock" label="可售库存"></el-table-column> <el-table-column sortable prop="sale_stock" label="可售库存" align="center"></el-table-column>
<el-table-column prop="status" label="状态"></el-table-column> <el-table-column prop="status" label="状态" align="center"></el-table-column>
<el-table-column label="操作" width="130"> <el-table-column label="操作" width="130" align="center" v-if="is_admin">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button> <el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
<!-- <el-button type="text" @click="handleDelete(scope.row.id)">删除</el-button> --> <!-- <el-button type="text" @click="handleDelete(scope.row.id)">删除</el-button> -->
@ -148,6 +148,7 @@
}] }]
}, },
skus: [], skus: [],
is_admin: false,
remoteLoading: false remoteLoading: false
} }
}, },
@ -170,6 +171,7 @@
this.Paginationdata = res.data.meta this.Paginationdata = res.data.meta
this.currentPage = res.data.meta.current_page this.currentPage = res.data.meta.current_page
this.per_page = parseInt(res.data.meta.per_page) this.per_page = parseInt(res.data.meta.per_page)
this.is_admin = res.data.manage && res.data.manage.is_admin
this.loading = false this.loading = false
}) })
}, },
@ -293,11 +295,6 @@
float: right; float: right;
} }
::v-deep .cell {
display: flex;
align-items: center;
}
.commodityimg { .commodityimg {
width: 59px; width: 59px;
height: 59px; height: 59px;
@ -306,12 +303,14 @@
display: block; display: block;
margin-right: 12px; margin-right: 12px;
} }
.Img { .Img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
::v-deep .flex .cell{
display: flex;
align-items: center;
}
::v-deep .btn11 { ::v-deep .btn11 {
padding: 0; padding: 0;
width: 14px; width: 14px;

View File

@ -554,7 +554,7 @@
chooseList: [], chooseList: [],
showUpdate: false, showUpdate: false,
commitLoading: false, commitLoading: false,
is_admin: localStorage.getItem('roleName') == '超级管理员' || localStorage.getItem('roleName') == '系统管理员', is_admin: false,
showAdd: false, showAdd: false,
showEdit: false, showEdit: false,
curId: 0 curId: 0
@ -599,6 +599,7 @@
this.sku_code = { this.sku_code = {
sku_code: this.shopsData sku_code: this.shopsData
} }
this.is_admin = res.data.manage && res.data.manage.is_admin
this.loading = false this.loading = false
}) })
}, },

View File

@ -83,7 +83,7 @@
<el-button type="primary" @click="handleChoose">筛选</el-button> <el-button type="primary" @click="handleChoose">筛选</el-button>
<el-button plain @click="handleReChoose">重置筛选</el-button> <el-button plain @click="handleReChoose">重置筛选</el-button>
</el-form-item> </el-form-item>
<!-- <el-button type="primary" @click="print">打印</el-button> --> <el-button type="primary" @click="print">打印</el-button>
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button> <el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
</el-form> </el-form>
</el-card> </el-card>