Commit c40bc3c7 authored by Marcus's avatar Marcus
parent a0e8aa30
......@@ -181,6 +181,15 @@ export function orderWarehouseInUpdateLabel(data){
})
}
// 入仓修改储位
export function saveOrUpdateOrderLocation(data){
return request({
url: '/order/order-warehouse-in/save-or-update-order-location',
method: 'post',
data
})
}
// 获取入仓修改审批单详情-审批使用
export function getWarehouseUpdateApprovalInfo(id) {
return request({
......
......@@ -64,7 +64,8 @@
</template>
<script>
import { getByWarehouseId } from '@/api/ecw/warehouseArea'
import {getByWarehouseId} from '@/api/ecw/warehouseArea'
import {saveOrUpdateOrderLocation} from "@/api/ecw/order"
export default {
name: 'WarehouseAreaDialog',
......@@ -82,6 +83,11 @@ export default {
warehouseId: {
type: Number,
default: undefined
},
// 是否入仓修改
isEditing: {
type: Boolean,
default: false
}
},
......@@ -102,26 +108,6 @@ export default {
visible(val) {
if (val) {
this.opened = true
if (this.area.length === 0) getByWarehouseId({cityId: this.cityId,warehouseId: this.warehouseId }).then(r => {
const area = r.data
area.forEach(e => {
// 仓库
e.children?.forEach(f => {
// 区域
f.selected = false
if(f.positionList) f.positionList.forEach(g => {
// 位置
g.selected = false
g.children?.forEach(k => {
// 子位置
k.selected = false
})
})
})
})
this.area = area
})
} else {
}
},
......@@ -134,9 +120,45 @@ export default {
},
methods: {
updateArea(){
this.initArea()
},
initArea(){
return getByWarehouseId({ cityId: this.cityId, warehouseId: this.warehouseId }).then(r => {
const area = r.data
area.forEach(e => {
// 仓库
e.children?.forEach(f => {
// 区域
f.selected = this.isSelected(e.id, f.id)
if(f.positionList) f.positionList.forEach(g => {
// 位置
g.selected = this.isSelected(e.id, f.id, g.id)
g.children?.forEach(k => {
// 子位置
k.selected = this.isSelected(e.id, f.id, k.id)
})
})
})
})
this.area = area
})
},
// 用于储位回显选中
isSelected(warehouse, area, position = 0){
return !!this.value.find(e => warehouse === e.wareId && area === e.areaId && position === e.locationId)
},
handleSubmit() {
this.$emit('input', this.inputValue)
this.opened = false
if (this.isEditing) {
this.$nextTick(() => {
saveOrUpdateOrderLocation({
"orderId": this.orderId,
"orderLocationCreateReqVOList": this.inputValue
})
})
}
},
handleClose() {},
handleSelectWarehouse(warehouse) {
......@@ -146,7 +168,6 @@ export default {
return
} else if(this.activeWarehouseId !== warehouse.id) {
this.activeWarehouseId = warehouse.id
console.log(this.inputValue.find(e => e.areaId === warehouse.id), warehouse.id)
if (this.inputValue.find(e => e.areaId === warehouse.id)){
return
}
......@@ -202,7 +223,6 @@ export default {
},
mounted() {
console.log('area dialog mounted')
},
computed: {
......
......@@ -54,6 +54,9 @@ export default {
warehouseId: this.$attrs.shipmentObj.startWarehouseId,
};
},
mounted() {
this.$refs.area.updateArea()
},
methods: {
getTotlContent,
// 打开储位
......
......@@ -147,7 +147,7 @@
</el-form>
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList"
:order-id="orderId" :warehouse-id="warehouseId"></warehouse-area-dialog>
:order-id="orderId" :warehouse-id="warehouseId" :is-editing="isEdit"></warehouse-area-dialog>
<edit-dialog :title="title" :order-id="order.orderId" :visible.sync="warehousingVisible" :warehousing="warehousing" :edit="isEdit"></edit-dialog>
......@@ -226,7 +226,12 @@ export default {
this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data.reverse())
getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data)
listByOrderId({ orderId: this.orderId }).then(r => this.form.orderLocationCreateReqVOList = r.data)
listByOrderId({ orderId: this.orderId }).then(r => {
this.form.orderLocationCreateReqVOList = r.data
this.$nextTick(() => {
this.$refs.area.updateArea()
})
})
}
getCurrencyList().then(res => this.currencyList = res.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