Commit 66d8aa5e authored by 黄卓's avatar 黄卓

选择储位,缺少储位回显

parent c0db04e0
...@@ -61,14 +61,14 @@ export default { ...@@ -61,14 +61,14 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
value: String value: Array,
orderId: Number
}, },
data() { data() {
return { return {
opened: false, opened: false,
orderId: '',
area: [], area: [],
activeName: '0', activeName: '0',
selectedWarehouse: [], selectedWarehouse: [],
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$emit('input', this.selected.join(',')) this.$emit('input', this.inputValue)
this.opened = false this.opened = false
}, },
handleClose() {}, handleClose() {},
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
}, },
computed: { computed: {
// code array
selected() { selected() {
const result = [] const result = []
...@@ -178,15 +179,50 @@ export default { ...@@ -178,15 +179,50 @@ export default {
if (f.selected) result.push(f.code) if (f.selected) result.push(f.code)
f.positionList.forEach(g => { f.positionList.forEach(g => {
// 位置 // 位置
if (g.selected) result.push(k.code)
g.children.forEach(k => { g.children.forEach(k => {
// 子位置 // 子位置
if (k.selected) result.push(k.code) if (k.selected) result.push(k.code)
}) })
}) })
}) })
}) })
return result
},
inputValue(){
const result = []
this.area.forEach(e => {
// 仓库
e.children.forEach(f => {
// 区域
if (f.selected) result.push({
orderId: this.orderId,
wareId: f.pid,
areaId: f.id
})
else f.positionList.forEach(g => {
// 位置
if (g.selected) result.push({
orderId: this.orderId,
wareId: g.domainId,
areaId: g.areaId,
locationId: g.id
})
else g.children.forEach(k => {
// 子位置
if (k.selected) result.push({
orderId: this.orderId,
wareId: k.domainId,
areaId: k.areaId,
locationId: k.id
})
})
})
})
})
return result return result
} }
} }
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<order-base-info :order="order"></order-base-info> <order-base-info :order="order"></order-base-info>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<span>储位:{{ locationName }}</span><el-button type="primary" size="mini" @click="areaVisible = true" style="margin-left: 15px">选择</el-button> <span>储位:{{ ($refs.area ? $refs.area.selected : []).join(',') }}</span>
<el-button type="primary" size="mini" @click="areaVisible = true" style="margin-left: 15px">选择</el-button>
</div> </div>
<h2>货物信息</h2> <h2>货物信息</h2>
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
</div> </div>
</el-form> </el-form>
<warehouse-area-dialog :visible.sync="areaVisible" v-model="locationName"></warehouse-area-dialog> <warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList" :order-id="orderId"></warehouse-area-dialog>
<edit-dialog :visible.sync="warehousingVisible" :warehousing="warehousing"></edit-dialog> <edit-dialog :visible.sync="warehousingVisible" :warehousing="warehousing"></edit-dialog>
...@@ -140,7 +141,7 @@ export default { ...@@ -140,7 +141,7 @@ export default {
mounted() { mounted() {
if(this.$route.query.id){ if(this.$route.query.id){
this.orderId = this.$route.query.id this.orderId = parseInt(this.$route.query.id || undefined)
getOrder(this.orderId).then(r => this.order = r.data) getOrder(this.orderId).then(r => this.order = r.data)
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data) getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data) getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data)
...@@ -153,7 +154,6 @@ export default { ...@@ -153,7 +154,6 @@ export default {
DICT_TYPE, DICT_TYPE,
areaVisible: false, areaVisible: false,
finishVisible: false, finishVisible: false,
locationName: '',
warehousingVisible: false, warehousingVisible: false,
form: { form: {
orderSpecialNeedReceivableReqVoList: [] orderSpecialNeedReceivableReqVoList: []
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
handleSubmit() { handleSubmit() {
orderWarehouseInFinish({ orderWarehouseInFinish({
orderSpecialNeedReceivableReqVoList: this.form.orderSpecialNeedReceivableReqVoList, orderSpecialNeedReceivableReqVoList: this.form.orderSpecialNeedReceivableReqVoList,
"locationName": this.locationName, "orderLocationCreateReqVOList": this.form.orderLocationCreateReqVOList,
"orderId": this.order.orderId "orderId": this.order.orderId
}).then(r => { }).then(r => {
if (r.data) { if (r.data) {
......
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