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