Commit 2d93c663 authored by ylpmty's avatar ylpmty
parents ad478141 56659b71
...@@ -34,6 +34,14 @@ export function getWarehouseArea(id) { ...@@ -34,6 +34,14 @@ export function getWarehouseArea(id) {
}) })
} }
// 获得仓库查询库域
export function getByWarehouseId() {
return request({
url: '/ecw/warehouse-area/getByWarehouseId',
method: 'get'
})
}
// 获得库区库域分页 // 获得库区库域分页
export function getWarehouseAreaPage(query) { export function getWarehouseAreaPage(query) {
return request({ return request({
......
...@@ -26,15 +26,15 @@ export default { ...@@ -26,15 +26,15 @@ export default {
}, },
data(){ data(){
return { return {
index: {}, index: null,
list:[], list:[],
loading: false loading: false
} }
}, },
watch:{ watch:{
index(val){ index(val){
this.$emit('input', val !== null ? this.list[val].id : null) this.$emit('input', val !== null ? this.list[val].id: null)
this.$emit('change', val !== null ? this.list[val] : null) this.$emit('change', val !== null ? this.list[val]: null)
}, },
value(val){ value(val){
this.init() this.init()
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
}, },
methods:{ methods:{
init(){ init(){
if(!this.value) return null if(!this.value) return
let index = this.list.findIndex(item => item.id == this.value) let index = this.list.findIndex(item => item.id == this.value)
if(index < 0){ if(index < 0){
getCustomer(this.value).then(res => { getCustomer(this.value).then(res => {
......
...@@ -34,7 +34,12 @@ ...@@ -34,7 +34,12 @@
import {getCustomerSelect, getCustomerList} from '@/api/ecw/customer' import {getCustomerSelect, getCustomerList} from '@/api/ecw/customer'
export default { export default {
props:{ props:{
value: [Array] value: {
type: Array,
default: () => {
return []
}
}
}, },
data(){ data(){
return { return {
...@@ -60,16 +65,16 @@ export default { ...@@ -60,16 +65,16 @@ export default {
customerIds(val){ customerIds(val){
this.$emit('input', val) this.$emit('input', val)
}, },
value(val, old){ value(val){
if(val.sort().join(',') != old.sort().join(',')){ if(Array.from(new Set(val)).sort().join(',') != Array.from(new Set(this.customerIds)).sort().join(',')){
this.getChoosedList() this.getChoosedList()
} }
} }
}, },
created(){ created(){
if(this.value && this.value.length){ /* if(this.value && this.value.length){
this.getChoosedList() this.getChoosedList()
} } */
this.reLoad() this.reLoad()
}, },
methods:{ methods:{
......
...@@ -44,7 +44,9 @@ export default { ...@@ -44,7 +44,9 @@ export default {
props: { props: {
defaultIds: { defaultIds: {
type: Array, type: Array,
default: [] default: () => {
return []
}
} }
}, },
data() { data() {
......
...@@ -55,6 +55,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { ...@@ -55,6 +55,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
title: route.name, title: route.name,
icon: route.icon icon: route.icon
} }
route.hidden = typeof route.isShowInMenuBar != 'undefined' && (route.isShowInMenuBar == 'false' || !route.isShowInMenuBar)
// 处理 component 属性 // 处理 component 属性
if (route.children) { // 父节点 if (route.children) { // 父节点
// debugger // debugger
......
...@@ -670,7 +670,7 @@ export default { ...@@ -670,7 +670,7 @@ export default {
// 添加的提交 // 添加的提交
createOffer(data).then(response => { createOffer(data).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.$router.replace('offer/index') this.$router.replace('index')
}); });
}); });
}, },
......
<template>
<div>
<el-dialog
title="选择储位"
:visible.sync="opened"
width="600px"
:before-close="handleClose()"
>
<el-tabs v-model="activeName" type="card">
<el-tab-pane :label="item.name" :name="'' + index" v-for="(item, index) in area" :key="index">
<div>
<div style="text-align: center">区域</div>
<div style="background-color: #efefef;padding: 10px 10px 0;border: #dcdcdc solid 1px;border-radius: 2px">
<el-row :gutter="10">
<el-col :span="12" v-for="(warehouse, i) in item.children" :key="i">
<div
class="warehouse-block warehouse-block-selected"
:class="{active: selected.find(domain => domain.pid === warehouse.id)}"
@click="handleSelectWarehouse(warehouse)"
>
{{ warehouse.name }}
</div>
</el-col>
</el-row>
</div>
</div>
<div>
<div style="text-align: center">仓位</div>
</div>
<el-divider></el-divider>
已选择:
<el-divider></el-divider>
</el-tab-pane>
</el-tabs>
<span slot="footer">
<el-button @click="opened = false">关 闭</el-button>
<el-button type="primary" @click="opened = false">提 交</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getByWarehouseId } from '@/api/ecw/warehouseArea'
export default {
name: 'WarehouseAreaDialog',
props: {
visible: {
type: Boolean,
default: false
},
},
data() {
return {
opened: false,
key: 0,
area: [],
activeName: '0',
selected: []
};
},
watch: {
visible(val) {
if (val) {
this.opened = true
} else {
}
},
opened(val) {
if (val) {
} else {
this.$emit('update:visible', false)
}
}
},
methods: {
handleClose() {},
handleSelectWarehouse(warehouse) {
console.log(warehouse)
}
},
mounted() {
if (this.visible) {
this.opened = true
}
getByWarehouseId().then(r => {
this.area = r.data
})
},
}
</script>
<style scoped>
.warehouse-block{
background-color: white;
border-radius: 5px;
height: 42px;
line-height: 42px;
text-align: center;
margin-bottom: 10px;
cursor: pointer;
}
.warehouse-block:hover, .warehouse-block .active{
color: #ffffff;
background-color: #388fe5;
}
.warehouse-block-selected{
border: #388fe5 solid 5px;
}
</style>
...@@ -78,6 +78,11 @@ ...@@ -78,6 +78,11 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-if="form.type == 2">
<el-form-item label="显示菜单" prop="isShowInMenuBar">
<dict-selector v-model="form.isShowInMenuBar" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" form-type="radio" />
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item v-if="form.type != '3'" label="菜单图标"> <el-form-item v-if="form.type != '3'" label="菜单图标">
<el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()"> <el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()">
...@@ -242,6 +247,7 @@ export default { ...@@ -242,6 +247,7 @@ export default {
parentId: 0, parentId: 0,
name: undefined, name: undefined,
icon: undefined, icon: undefined,
isShowInMenuBar: undefined,
type: SystemMenuTypeEnum.DIR, type: SystemMenuTypeEnum.DIR,
sort: undefined, sort: undefined,
status: CommonStatusEnum.ENABLE status: CommonStatusEnum.ENABLE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment