给客户和仓库增加权限控制
This commit is contained in:
@@ -139,6 +139,7 @@ const checkFunction = (params)=>getAction("/function/checkIsNameExist",params);
|
|||||||
const addSystemConfig = (params)=>postAction("/systemConfig/add",params);
|
const addSystemConfig = (params)=>postAction("/systemConfig/add",params);
|
||||||
const editSystemConfig = (params)=>putAction("/systemConfig/update",params);
|
const editSystemConfig = (params)=>putAction("/systemConfig/update",params);
|
||||||
const checkSystemConfig = (params)=>getAction("/systemConfig/checkIsNameExist",params);
|
const checkSystemConfig = (params)=>getAction("/systemConfig/checkIsNameExist",params);
|
||||||
|
const getCurrentSystemConfig = (params)=>getAction("/systemConfig/getCurrentInfo",params);
|
||||||
//用户|角色|模块关系
|
//用户|角色|模块关系
|
||||||
const addUserBusiness = (params)=>postAction("/userBusiness/add",params);
|
const addUserBusiness = (params)=>postAction("/userBusiness/add",params);
|
||||||
const editUserBusiness = (params)=>putAction("/userBusiness/update",params);
|
const editUserBusiness = (params)=>putAction("/userBusiness/update",params);
|
||||||
@@ -254,6 +255,7 @@ export {
|
|||||||
addSystemConfig,
|
addSystemConfig,
|
||||||
editSystemConfig,
|
editSystemConfig,
|
||||||
checkSystemConfig,
|
checkSystemConfig,
|
||||||
|
getCurrentSystemConfig,
|
||||||
addUserBusiness,
|
addUserBusiness,
|
||||||
editUserBusiness,
|
editUserBusiness,
|
||||||
checkUserBusiness,
|
checkUserBusiness,
|
||||||
|
|||||||
@@ -260,9 +260,9 @@
|
|||||||
},
|
},
|
||||||
getDepotList() {
|
getDepotList() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getAction('/depot/findDepotByUserId?UBType=UserDepot&UBKeyId=').then((res) => {
|
getAction('/depot/findDepotByCurrentUser').then((res) => {
|
||||||
if (res) {
|
if(res.code === 200){
|
||||||
that.depotList = res
|
that.depotList = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -111,13 +111,14 @@ export const BillModalMixin = {
|
|||||||
},
|
},
|
||||||
initDepot() {
|
initDepot() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getAction('/depot/findDepotByUserId?UBType=UserDepot&UBKeyId=').then((res) => {
|
getAction('/depot/findDepotByCurrentUser').then((res) => {
|
||||||
if (res) {
|
if(res.code === 200){
|
||||||
for(let i=0; i<res.length; i++) {
|
let arr = res.data
|
||||||
|
for(let i=0; i<arr.length; i++) {
|
||||||
let depotInfo = {};
|
let depotInfo = {};
|
||||||
depotInfo.value = res[i].id+'' //注意-此处value必须为字符串格式
|
depotInfo.value = arr[i].id+'' //注意-此处value必须为字符串格式
|
||||||
depotInfo.text = res[i].depotName
|
depotInfo.text = arr[i].depotName
|
||||||
depotInfo.title = res[i].depotName
|
depotInfo.title = arr[i].depotName
|
||||||
for(let item of that.materialTable.columns){
|
for(let item of that.materialTable.columns){
|
||||||
if(item.key == 'depotId' || item.key == 'anotherDepotId') {
|
if(item.key == 'depotId' || item.key == 'anotherDepotId') {
|
||||||
item.options.push(depotInfo)
|
item.options.push(depotInfo)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -169,15 +169,9 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -155,15 +155,9 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -137,15 +137,9 @@
|
|||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -169,15 +169,9 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -155,15 +155,9 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
v-model="queryParam.depotId">
|
v-model="queryParam.depotId">
|
||||||
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
<a-select-option v-for="(depot,index) in depotList" :value="depot.id">
|
||||||
{{ depot.name }}
|
{{ depot.depotName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -114,15 +114,9 @@
|
|||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
getDepotData() {
|
getDepotData() {
|
||||||
getAction('/depot/getAllList').then((res)=>{
|
getAction('/depot/findDepotByCurrentUser').then((res)=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let arr=res.data;
|
this.depotList = res.data;
|
||||||
for(let i=0;i<arr.length;i++){
|
|
||||||
let obj={};
|
|
||||||
obj.id=arr[i].id;
|
|
||||||
obj.name=arr[i].name;
|
|
||||||
this.depotList.push(obj);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.info(res.data);
|
this.$message.info(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,10 +53,10 @@
|
|||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
@change="handleTableChange">
|
@change="handleTableChange">
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<a @click="btnSetDepot(record)">分配仓库</a>
|
<a v-if="depotFlag === '1'" @click="btnSetDepot(record)">分配仓库</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider v-if="depotFlag === '1'" type="vertical" />
|
||||||
<a @click="btnSetCustomer(record)">分配客户</a>
|
<a v-if="customerFlag === '1'" @click="btnSetCustomer(record)">分配客户</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider v-if="customerFlag === '1'" type="vertical" />
|
||||||
<a @click="handleEdit(record)">编辑</a>
|
<a @click="handleEdit(record)">编辑</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||||
@@ -81,6 +81,7 @@
|
|||||||
import UserDepotModal from './modules/UserDepotModal'
|
import UserDepotModal from './modules/UserDepotModal'
|
||||||
import UserCustomerModal from './modules/UserCustomerModal'
|
import UserCustomerModal from './modules/UserCustomerModal'
|
||||||
import {postAction} from '@/api/manage';
|
import {postAction} from '@/api/manage';
|
||||||
|
import {getCurrentSystemConfig} from '@/api/api'
|
||||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||||
import JInput from '@/components/jeecg/JInput'
|
import JInput from '@/components/jeecg/JInput'
|
||||||
export default {
|
export default {
|
||||||
@@ -95,6 +96,8 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
|
depotFlag: '0',
|
||||||
|
customerFlag: '0',
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '#',
|
title: '#',
|
||||||
@@ -129,7 +132,30 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
this.getSystemConfig()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getSystemConfig() {
|
||||||
|
getCurrentSystemConfig().then((res) => {
|
||||||
|
if(res.code === 200){
|
||||||
|
let systemConfig = res.data
|
||||||
|
this.depotFlag = systemConfig.depotFlag
|
||||||
|
this.customerFlag = systemConfig.customerFlag
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchQuery() {
|
||||||
|
this.loadData(1);
|
||||||
|
this.getSystemConfig();
|
||||||
|
},
|
||||||
|
searchReset() {
|
||||||
|
this.queryParam = {}
|
||||||
|
this.loadData(1);
|
||||||
|
this.getSystemConfig();
|
||||||
|
},
|
||||||
handleReset(id) {
|
handleReset(id) {
|
||||||
let that = this;
|
let that = this;
|
||||||
postAction(that.url.resetPwd, {id: id}).then((res) => {
|
postAction(that.url.resetPwd, {id: id}).then((res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user