Skip to content

Commit

Permalink
通过权限来控制子用户的新增供应商、客户、会员、结算账户等功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jishenghua committed Sep 25, 2024
1 parent 80f9ec4 commit c585ebd
Show file tree
Hide file tree
Showing 22 changed files with 112 additions and 59 deletions.
25 changes: 22 additions & 3 deletions jshERP-web/src/views/bill/mixins/BillModalMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ export const BillModalMixin = {
billStatus: '0',
minWidth: 1100,
isCanCheck: true,
isTenant: false,
quickBtn: {
vendor: false,
customer: false,
member: false,
account: false,
depot: false
},
billPrintFlag: false,
/* 是否显示打印按钮 */
isShowPrintBtn: true,
Expand Down Expand Up @@ -68,8 +74,6 @@ export const BillModalMixin = {
};
},
created () {
let userInfo = Vue.ls.get(USER_INFO)
this.isTenant = userInfo.id === userInfo.tenantId? true:false
let realScreenWidth = window.screen.width
this.width = realScreenWidth<1500?'1200px':'1550px'
this.minWidth = realScreenWidth<1500?1150:1500
Expand Down Expand Up @@ -1020,6 +1024,21 @@ export const BillModalMixin = {
this.billPrintFlag = res.data.platformValue==='1'?true:false
}
})
},
//加载快捷按钮:供应商、客户、会员、结算账户、仓库
initQuickBtn() {
let btnStrList = Vue.ls.get('winBtnStrList') //按钮功能列表 JSON字符串
if (btnStrList) {
for (let i = 0; i < btnStrList.length; i++) {
if (btnStrList[i].btnStr) {
this.quickBtn.vendor = btnStrList[i].url === '/system/vendor'?btnStrList[i].btnStr.indexOf(1)>-1:this.quickBtn.vendor
this.quickBtn.customer = btnStrList[i].url === '/system/customer'?btnStrList[i].btnStr.indexOf(1)>-1:this.quickBtn.customer
this.quickBtn.member = btnStrList[i].url === '/system/member'?btnStrList[i].btnStr.indexOf(1)>-1:this.quickBtn.member
this.quickBtn.account = btnStrList[i].url === '/system/account'?btnStrList[i].btnStr.indexOf(1)>-1:this.quickBtn.account
this.quickBtn.depot = btnStrList[i].url === '/system/depot'?btnStrList[i].btnStr.indexOf(1)>-1:this.quickBtn.depot
}
}
}
}
}
}
5 changes: 3 additions & 2 deletions jshERP-web/src/views/bill/modules/AllocationOutModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -222,6 +222,7 @@
this.initSystemConfig()
this.initDepot()
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
5 changes: 3 additions & 2 deletions jshERP-web/src/views/bill/modules/AssembleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -220,6 +220,7 @@
this.initSystemConfig()
this.initDepot()
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
5 changes: 3 additions & 2 deletions jshERP-web/src/views/bill/modules/DisassembleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -219,6 +219,7 @@
this.initSystemConfig()
this.initDepot()
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
7 changes: 4 additions & 3 deletions jshERP-web/src/views/bill/modules/OtherInModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.vendor" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
Expand Down Expand Up @@ -86,8 +86,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -274,6 +274,7 @@
this.initSupplier(0)
this.initDepot()
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
7 changes: 4 additions & 3 deletions jshERP-web/src/views/bill/modules/OtherOutModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.customer" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
Expand Down Expand Up @@ -86,8 +86,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -274,6 +274,7 @@
this.initCustomer(0)
this.initDepot()
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
1 change: 1 addition & 0 deletions jshERP-web/src/views/bill/modules/PurchaseApplyModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
}
this.initSystemConfig()
this.initPlatform()
this.initQuickBtn()
},
/** 整理成formData */
classifyIntoFormData(allValues) {
Expand Down
9 changes: 5 additions & 4 deletions jshERP-web/src/views/bill/modules/PurchaseBackModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.vendor" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
Expand Down Expand Up @@ -83,8 +83,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -124,7 +124,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -346,6 +346,7 @@
this.initDepot()
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
9 changes: 5 additions & 4 deletions jshERP-web/src/views/bill/modules/PurchaseInModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.vendor" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
Expand Down Expand Up @@ -98,8 +98,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -144,7 +144,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -395,6 +395,7 @@
this.initDepot()
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
5 changes: 3 additions & 2 deletions jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.vendor" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
Expand Down Expand Up @@ -139,7 +139,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -353,6 +353,7 @@
this.initSupplier(0)
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
/** 整理成formData */
classifyIntoFormData(allValues) {
Expand Down
9 changes: 5 additions & 4 deletions jshERP-web/src/views/bill/modules/RetailBackModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.member" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addMember"><a-icon type="plus" /> 新增会员</div>
</div>
<a-select-option v-for="(item,index) in retailList" :key="index" :value="item.id">
Expand Down Expand Up @@ -85,8 +85,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -133,7 +133,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -328,6 +328,7 @@
this.initDepot()
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
9 changes: 5 additions & 4 deletions jshERP-web/src/views/bill/modules/RetailOutModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.member" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addMember"><a-icon type="plus" /> 新增会员</div>
</div>
<a-select-option v-for="(item,index) in retailList" :key="index" :value="item.id">
Expand Down Expand Up @@ -95,8 +95,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -148,7 +148,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -338,6 +338,7 @@
this.initDepot()
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
9 changes: 5 additions & 4 deletions jshERP-web/src/views/bill/modules/SaleBackModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.customer" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
Expand Down Expand Up @@ -83,8 +83,8 @@
<a-icon type="down" @click="handleBatchSetDepot" />
</template>
<template #depotAdd>
<a-divider v-if="isTenant" style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
<a-divider v-if="quickBtn.depot" style="margin: 4px 0;" />
<div v-if="quickBtn.depot" style="padding: 4px 8px; cursor: pointer;" @click="addDepot"><a-icon type="plus" /> 新增仓库</div>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
Expand Down Expand Up @@ -124,7 +124,7 @@
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
<div v-if="quickBtn.account" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
Expand Down Expand Up @@ -354,6 +354,7 @@
this.initDepot()
this.initAccount(0)
this.initPlatform()
this.initQuickBtn()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
Expand Down
Loading

0 comments on commit c585ebd

Please sign in to comment.