|
@@ -3,8 +3,8 @@
|
|
|
<Card style="width:100%" :bordered="false" :dis-hover="true" v-show="!addShow && !editShow">
|
|
|
<p slot="title">供应商列表</p>
|
|
|
<div slot="extra">
|
|
|
- <Button @click="newGys">新增供应商</Button>
|
|
|
- <Button @click="exportList">导出明细</Button>
|
|
|
+ <Button @click="newGys" v-if="buttonShow.add">新增供应商</Button>
|
|
|
+ <Button @click="exportList" v-if="buttonShow.export">导出明细</Button>
|
|
|
<!-- <Button @click="editShow = true">测试----编辑</Button> -->
|
|
|
</div>
|
|
|
<Row :gutter="10" style="margin-bottom: 10px">
|
|
@@ -83,8 +83,16 @@
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="action">
|
|
|
<div>
|
|
|
- <a href="javascript:;" @click="editRow(row.gpId, row.gpInfoType)">编辑</a>
|
|
|
- <a v-if="row.gpInfoType == 1" href="javascript:;" @click="deleteRow(row.gpId)">删除</a>
|
|
|
+ <a
|
|
|
+ href="javascript:;"
|
|
|
+ v-if="buttonShow.edit"
|
|
|
+ @click="editRow(row.gpId, row.gpInfoType)"
|
|
|
+ >编辑</a>
|
|
|
+ <a
|
|
|
+ v-if="buttonShow.delete && row.gpInfoType == 1"
|
|
|
+ href="javascript:;"
|
|
|
+ @click="deleteRow(row.gpId)"
|
|
|
+ >删除</a>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Table>
|
|
@@ -121,9 +129,11 @@ import {
|
|
|
getDictInfoList,
|
|
|
exportGoodProviderInfo,
|
|
|
getJobList,
|
|
|
- getAreaList
|
|
|
+ getAreaList,
|
|
|
+ getUserButtons
|
|
|
} from "@/service/getData";
|
|
|
export default {
|
|
|
+ name: "supply",
|
|
|
components: {
|
|
|
supplyAdd,
|
|
|
supplyEdit
|
|
@@ -142,6 +152,15 @@ export default {
|
|
|
resizeHeight: 100,
|
|
|
resizeWidth: 100,
|
|
|
handleWidth: 100,
|
|
|
+ buttonShow: {
|
|
|
+ add: false,
|
|
|
+ edit: false,
|
|
|
+ delete: false,
|
|
|
+ export: false,
|
|
|
+ addPrice: false,
|
|
|
+ deletePrice: false,
|
|
|
+ editPrice: false
|
|
|
+ },
|
|
|
// 查询参数
|
|
|
searchForm: {
|
|
|
ssqy: [], //所属区域
|
|
@@ -233,6 +252,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getTableData();
|
|
|
+ this.getUserAuth();
|
|
|
getAreaList(localStorage.user_id).then(res => {
|
|
|
this.ssqyList = res.items;
|
|
|
});
|
|
@@ -251,6 +271,35 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取按钮权限
|
|
|
+ getUserAuth() {
|
|
|
+ //获取用户在当前页面的权限
|
|
|
+ var self = this;
|
|
|
+ let menuId = sessionStorage.getItem("refresh_child_id");
|
|
|
+ let userForm = {
|
|
|
+ userId: localStorage.user_id,
|
|
|
+ menuId: menuId
|
|
|
+ };
|
|
|
+ let buttons = [
|
|
|
+ "add",
|
|
|
+ "edit",
|
|
|
+ "delete",
|
|
|
+ "export",
|
|
|
+ "addPrice",
|
|
|
+ "deletePrice",
|
|
|
+ "editPrice"
|
|
|
+ ];
|
|
|
+ getUserButtons(userForm).then(result => {
|
|
|
+ if (result.resultCode == "200") {
|
|
|
+ result.data.forEach(item => {
|
|
|
+ // item.code
|
|
|
+ if (buttons.includes(item.code)) {
|
|
|
+ self.buttonShow[item.code] = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
goDetail(row, index) {
|
|
|
// this.editRow(row.gpId, row.gpInfoType,false)
|
|
|
this.editRow(row.gpId, row.gpInfoType);
|