|
@@ -1,4 +1,4 @@
|
|
|
-import { warehouseList } from '@/api/warehouse'
|
|
|
+import { queryAuthWarehouse, warehouseAllList } from '@/api/warehouse'
|
|
|
const warehouse = {
|
|
|
template: `
|
|
|
<a-select
|
|
@@ -19,6 +19,10 @@ const warehouse = {
|
|
|
type: [String, Array],
|
|
|
defatut: ''
|
|
|
},
|
|
|
+ isPermission: {// false无权限 true有权限
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
id: {
|
|
|
type: String,
|
|
|
default: ''
|
|
@@ -65,9 +69,13 @@ const warehouse = {
|
|
|
},
|
|
|
// 获取仓库列表
|
|
|
getWarehouse () {
|
|
|
- warehouseList({ pageNo: 1, pageSize: 1000 }).then(res => {
|
|
|
+ const ajaxName = this.isPermission ? queryAuthWarehouse : warehouseAllList
|
|
|
+ ajaxName({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.warehouseData = res.data.list
|
|
|
+ if (res.data && res.data.length <= 1) {
|
|
|
+
|
|
|
+ }
|
|
|
+ this.warehouseData = res.data
|
|
|
} else {
|
|
|
this.warehouseData = []
|
|
|
}
|