Commit c40bc3c7 authored by Marcus's avatar Marcus
parent a0e8aa30
...@@ -181,6 +181,15 @@ export function orderWarehouseInUpdateLabel(data){ ...@@ -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) { export function getWarehouseUpdateApprovalInfo(id) {
return request({ return request({
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
</template> </template>
<script> <script>
import { getByWarehouseId } from '@/api/ecw/warehouseArea' import {getByWarehouseId} from '@/api/ecw/warehouseArea'
import {saveOrUpdateOrderLocation} from "@/api/ecw/order"
export default { export default {
name: 'WarehouseAreaDialog', name: 'WarehouseAreaDialog',
...@@ -82,6 +83,11 @@ export default { ...@@ -82,6 +83,11 @@ export default {
warehouseId: { warehouseId: {
type: Number, type: Number,
default: undefined default: undefined
},
// 是否入仓修改
isEditing: {
type: Boolean,
default: false
} }
}, },
...@@ -102,26 +108,6 @@ export default { ...@@ -102,26 +108,6 @@ export default {
visible(val) { visible(val) {
if (val) { if (val) {
this.opened = true 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 { } else {
} }
}, },
...@@ -134,9 +120,45 @@ export default { ...@@ -134,9 +120,45 @@ export default {
}, },
methods: { 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() { handleSubmit() {
this.$emit('input', this.inputValue) this.$emit('input', this.inputValue)
this.opened = false this.opened = false
if (this.isEditing) {
this.$nextTick(() => {
saveOrUpdateOrderLocation({
"orderId": this.orderId,
"orderLocationCreateReqVOList": this.inputValue
})
})
}
}, },
handleClose() {}, handleClose() {},
handleSelectWarehouse(warehouse) { handleSelectWarehouse(warehouse) {
...@@ -146,7 +168,6 @@ export default { ...@@ -146,7 +168,6 @@ export default {
return return
} else if(this.activeWarehouseId !== warehouse.id) { } else if(this.activeWarehouseId !== warehouse.id) {
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)){ if (this.inputValue.find(e => e.areaId === warehouse.id)){
return return
} }
...@@ -202,7 +223,6 @@ export default { ...@@ -202,7 +223,6 @@ export default {
}, },
mounted() { mounted() {
console.log('area dialog mounted')
}, },
computed: { computed: {
......
...@@ -54,6 +54,9 @@ export default { ...@@ -54,6 +54,9 @@ export default {
warehouseId: this.$attrs.shipmentObj.startWarehouseId, warehouseId: this.$attrs.shipmentObj.startWarehouseId,
}; };
}, },
mounted() {
this.$refs.area.updateArea()
},
methods: { methods: {
getTotlContent, getTotlContent,
// 打开储位 // 打开储位
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</el-form> </el-form>
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList" <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> <edit-dialog :title="title" :order-id="order.orderId" :visible.sync="warehousingVisible" :warehousing="warehousing" :edit="isEdit"></edit-dialog>
...@@ -226,7 +226,12 @@ export default { ...@@ -226,7 +226,12 @@ export default {
this.getOrder() this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data.reverse()) getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data.reverse())
getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data) 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) 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