Commit bc9ae42e by zhangtw

入库添加默认时间

parent 6f03e812
......@@ -583,7 +583,7 @@ export default {
referenceNo: null,
plannedArrivalDate: undefined,
actualArrivalDate: undefined,
inboundDate: null, // 入库日期
inboundDate: this.formatDate(new Date()), // 入库日期
totalPlannedQuantity: null,
totalActualQuantity: null,
totalPackages: null,
......@@ -625,6 +625,14 @@ export default {
this.getList()
},
methods: {
// 日期格式化方法(兼容不同浏览器的日期格式)
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,补0
const day = String(date.getDate()).padStart(2, '0'); // 日期补0
return `${year}-${month}-${day}`;
},
/** 查询入库列表 */
getList() {
this.loading = true
......@@ -739,8 +747,8 @@ export default {
this.form = response.data || {};
// 货主回显
this.form.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId;
// 仓库回显
this.form.warehousesName = response.data.warehousesName || response.data.warehouseId || '-';
// // 仓库回显
// this.form.warehousesName = response.data.warehousesName || response.data.warehouseId || '-';
// 明细行回显(核心:同步仓库/库位名称)
if (this.form.inboundOrderItemsList && this.form.inboundOrderItemsList.length) {
......@@ -750,10 +758,11 @@ export default {
warehousesName: item.warehousesName || item.warehouseId || '-',
// 库位名称/编码兜底
locationName: item.locationName || item.locationCode || item.locationId || '-',
locationCode: item.locationCode || item.locationId || '-'
locationCode: item.locationCode || item.locationId || '-',
orderTypeId: item.orderTypeId || 1
}));
}
console.log(this.form.inboundOrderItemsList)
this.inboundOrderId = id;
// 强制触发子组件的 value 监听(关键)
this.$nextTick(() => {
......@@ -771,7 +780,14 @@ export default {
this.isEditable = false
getInbound(id).then(response => {
// 加载明细数据到详情
this.detailForm = response.data
this.detailForm = response.data;
if(this.detailForm.inboundOrderItemsList && this.detailForm.inboundOrderItemsList.length){
this.detailForm.inboundOrderItemsList = this.detailForm.inboundOrderItemsList.map(item => ({
...item,
orderTypeId: this.detailForm.orderTypeId
}));
}
// 适配货主回显
this.detailForm.ownerName = response.data.ownerName || response.data.ownerCode || response.data.ownerId
this.detailForm.inboundOrderId = id
......@@ -1051,7 +1067,7 @@ export default {
referenceNo: null,
plannedArrivalDate: null,
actualArrivalDate: null,
inboundDate: null,
inboundDate: this.formatDate(new Date()),
totalPlannedQuantity: 0,
totalActualQuantity: 0,
totalPackages: 0,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论