|
|
|
@ -3,7 +3,7 @@ |
|
|
|
<!-- 查询条件 --> |
|
|
|
<el-form :inline="true" label-position="top" class="search-form-inline"> |
|
|
|
<div class="search-row"> |
|
|
|
<el-form-item label="进仓编号" class="search-item"> |
|
|
|
<el-form-item label="LOGISTICS ID" class="search-item"> |
|
|
|
<el-input v-model="searchData.flexId" style="width: 150px" @keyup.enter.native="getMainData"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="search-item"> |
|
|
|
@ -32,7 +32,7 @@ |
|
|
|
style="margin-top: 0px; width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
prop="flexId" |
|
|
|
label="物流单号" |
|
|
|
label="LOGISTICS ID" |
|
|
|
min-width="160" |
|
|
|
show-overflow-tooltip /> |
|
|
|
<el-table-column |
|
|
|
@ -55,6 +55,16 @@ |
|
|
|
label="已出货数量" |
|
|
|
width="120" |
|
|
|
align="center" /> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
width="90" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a class="customer-a" @click="openEditDialog(scope.row)">编辑 </a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<!-- 分页插件 --> |
|
|
|
@ -129,22 +139,35 @@ |
|
|
|
@getBaseData="getBaseData"> |
|
|
|
</Chooselist> |
|
|
|
|
|
|
|
<!-- 新增物流弹窗 --> |
|
|
|
<el-dialog title="新增物流" :visible.sync="addDialogVisible" width="1200px" append-to-body :close-on-click-modal="false" v-drag class="add-logistics-dialog"> |
|
|
|
<!-- 新增/编辑物流弹窗 --> |
|
|
|
<el-dialog :title="dialogMode === 'edit' ? '编辑物流' : '新增物流'" :visible.sync="addDialogVisible" width="1200px" append-to-body :close-on-click-modal="false" v-drag class="add-logistics-dialog"> |
|
|
|
<el-form :inline="true" label-position="top" size="small" class="add-form"> |
|
|
|
<el-form-item label="物流单号"> |
|
|
|
<el-input v-model="addForm.flexId" style="width: 180px" @blur="handleAddFormBlur"/> |
|
|
|
<com-po-order-customer-picker :site="$store.state.user.site" v-model="addForm.customer" :disabled="dialogMode === 'edit'" embedded /> |
|
|
|
<el-form-item> |
|
|
|
<template slot="label"> |
|
|
|
<a v-if="dialogMode === 'edit'" href="#" @click.prevent="openChangeFlexIdDialog">LOGISTICS ID</a> |
|
|
|
<span v-else>LOGISTICS ID</span> |
|
|
|
</template> |
|
|
|
<el-input v-model="addForm.flexId" style="width: 180px" :disabled="dialogMode === 'edit'" @blur="handleAddFormBlur"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label"><a href="#" @click="openAddSupplierChoose">供应商编码</a></span> |
|
|
|
<el-input v-model="addForm.supplierNo" style="width: 150px" @blur="handleAddFormBlur"/> |
|
|
|
<template slot="label"> |
|
|
|
<a v-if="dialogMode === 'add'" href="#" @click="openAddSupplierChoose">供应商编码</a> |
|
|
|
<span v-else>供应商编码</span> |
|
|
|
</template> |
|
|
|
<el-input v-model="addForm.supplierNo" style="width: 150px" :disabled="dialogMode === 'edit'" @blur="handleAddFormBlur"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="供应商名称"> |
|
|
|
<el-input v-model="addForm.supplierName" style="width: 360px" readonly/> |
|
|
|
<el-input v-model="addForm.supplierName" style="width: 360px" disabled/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="dialogMode === 'edit'" label="Telex_Release"> |
|
|
|
<el-select v-model="telexRelease" size="small" style="width: 120px" @change="telexDirty = true"> |
|
|
|
<el-option v-for="item in yesNoTextOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div style="margin-bottom: 8px; text-align: left"> |
|
|
|
<el-button type="primary" size="small" @click="openAvailableDialog">新增</el-button> |
|
|
|
<el-button type="primary" size="small" @click="openAvailableDialog">增加</el-button> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:data="addPoList" |
|
|
|
@ -168,14 +191,52 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="shipVia" label="Method" min-width="110" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="shippedQty" label="Qty Shipped" width="110" align="center" /> |
|
|
|
<el-table-column v-if="dialogMode === 'edit'" label="操作" width="80" header-align="center" align="center" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a class="customer-a" @click="handleRemovePo(scope.row)">移除 </a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="addDialogVisible = false" type="primary">关闭</el-button> |
|
|
|
<el-button v-if="dialogMode === 'edit'" type="primary" :loading="editSaving" @click="saveEditAll">保存</el-button> |
|
|
|
<el-button @click="addDialogVisible = false">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 修改物流单号弹窗 --> |
|
|
|
<el-dialog title="修改物流单号" :visible.sync="changeFlexIdDialogVisible" width="420px" append-to-body :close-on-click-modal="false"> |
|
|
|
<el-form label-position="top" size="small"> |
|
|
|
<el-form-item label="当前物流单号"> |
|
|
|
<el-input :value="addForm.flexId" readonly/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="新物流单号"> |
|
|
|
<el-input v-model="newFlexIdInput" placeholder="请输入新的物流单号"/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="confirmChangeFlexId">确认</el-button> |
|
|
|
<el-button @click="changeFlexIdDialogVisible = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 选择PO弹窗 --> |
|
|
|
<el-dialog title="选择PO" :visible.sync="availableDialogVisible" width="70%" append-to-body :close-on-click-modal="false" v-drag> |
|
|
|
<el-form :inline="true" size="small" style="margin-bottom: 4px"> |
|
|
|
<el-form-item label="PO"> |
|
|
|
<el-input v-model="availableSearch.po" clearable style="width: 160px" @keyup.enter.native="searchAvailablePo"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="Item"> |
|
|
|
<el-input v-model="availableSearch.item" clearable style="width: 160px" @keyup.enter.native="searchAvailablePo"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="Method"> |
|
|
|
<el-select v-model="availableSearch.method" clearable placeholder="请选择" style="width: 140px"> |
|
|
|
<el-option v-for="item in methodOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="searchAvailablePo">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
ref="availableTable" |
|
|
|
:data="availablePoList" |
|
|
|
@ -212,13 +273,15 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import LogisticsAttachmentTab from './com_logisticsAttachmentTab.vue' |
|
|
|
import { searchLogistics, getPoList, getAvailablePoList, updateLogisticsPo } from '@/api/npcIqc/npcIqc.js' |
|
|
|
import ComPoOrderCustomerPicker from '@/views/modules/order/com_poOrder_CustomerPicker.vue' |
|
|
|
import { searchLogistics, getPoList, getAvailablePoList, updateLogisticsPo, removeLogisticsPo, updateTelexRelease, changeLogisticsFlexId } from '@/api/npcIqc/npcIqc.js' |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
import excel from '@/utils/excel-util.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
LogisticsAttachmentTab, |
|
|
|
ComPoOrderCustomerPicker, |
|
|
|
Chooselist |
|
|
|
}, |
|
|
|
data () { |
|
|
|
@ -246,22 +309,55 @@ export default { |
|
|
|
targetField: '', |
|
|
|
// 供应商选择回调目标:'search' 主查询 | 'add' 新增弹窗 |
|
|
|
supplierChooseTarget: 'search', |
|
|
|
// 新增/编辑物流弹窗模式:'add' 新增 | 'edit' 编辑 |
|
|
|
dialogMode: 'add', |
|
|
|
// 新增物流相关 |
|
|
|
addDialogVisible: false, |
|
|
|
addForm: { |
|
|
|
flexId: '', |
|
|
|
supplierNo: '', |
|
|
|
supplierName: '' |
|
|
|
supplierName: '', |
|
|
|
customer: '' |
|
|
|
}, |
|
|
|
addPoList: [], |
|
|
|
addPoLoading: false, |
|
|
|
// 新增物流弹窗内表格高度(填满弹窗固定高度的剩余空间) |
|
|
|
addPoTableHeight: 430, |
|
|
|
// 编辑界面 Telex_Release 下拉(库内存 Yes/No 全拼) |
|
|
|
telexRelease: 'No', |
|
|
|
yesNoTextOptions: [ |
|
|
|
{ label: 'Yes', value: 'Yes' }, |
|
|
|
{ label: 'No', value: 'No' } |
|
|
|
], |
|
|
|
// 编辑界面本次暂存(未保存)的新增/移除订单号,点"保存"才写库 |
|
|
|
pendingAddOrderNos: [], |
|
|
|
pendingRemoveOrderNos: [], |
|
|
|
// 编辑界面 Telex 是否被用户改动(未改动则保存时不写库,避免默认值误重置) |
|
|
|
telexDirty: false, |
|
|
|
// 编辑界面物流单号暂存:originalFlexId=进入时数据库值,flexIdDirty=是否已改动(点保存才写库) |
|
|
|
originalFlexId: '', |
|
|
|
flexIdDirty: false, |
|
|
|
editSaving: false, |
|
|
|
// 修改物流单号弹窗 |
|
|
|
changeFlexIdDialogVisible: false, |
|
|
|
newFlexIdInput: '', |
|
|
|
// 选择PO弹窗相关 |
|
|
|
availableDialogVisible: false, |
|
|
|
availablePoList: [], |
|
|
|
availableLoading: false, |
|
|
|
availableSelection: [] |
|
|
|
availableSelection: [], |
|
|
|
// 选择PO弹窗筛选条件(PO/Item/Method) |
|
|
|
availableSearch: { |
|
|
|
po: '', |
|
|
|
item: '', |
|
|
|
method: '' |
|
|
|
}, |
|
|
|
// Method 下拉选项(与 poOrder 运输方式口径一致) |
|
|
|
methodOptions: [ |
|
|
|
{ label: '海运 SEA', value: 'SEA' }, |
|
|
|
{ label: '空运 AIR', value: 'AIR' }, |
|
|
|
{ label: '陆运 ROAD', value: 'ROAD' } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
@ -385,9 +481,39 @@ export default { |
|
|
|
|
|
|
|
// 打开新增物流弹窗 |
|
|
|
openAddDialog () { |
|
|
|
this.addForm = { flexId: '', supplierNo: '', supplierName: '' } |
|
|
|
this.dialogMode = 'add' |
|
|
|
this.addForm = { flexId: '', supplierNo: '', supplierName: '', customer: '' } |
|
|
|
this.addPoList = [] |
|
|
|
this.telexRelease = 'No' |
|
|
|
this.availableSearch = { po: '', item: '', method: '' } |
|
|
|
this.addDialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开编辑物流弹窗(从主表行进入,字段锁定) |
|
|
|
openEditDialog (row) { |
|
|
|
if (!row || !row.flexId) { |
|
|
|
this.$message.warning('该行无物流单号,无法编辑') |
|
|
|
return |
|
|
|
} |
|
|
|
this.dialogMode = 'edit' |
|
|
|
this.addForm = { |
|
|
|
flexId: row.flexId, |
|
|
|
supplierNo: row.supplierNo || '', |
|
|
|
supplierName: row.supplierName || '', |
|
|
|
customer: '' |
|
|
|
} |
|
|
|
this.addPoList = [] |
|
|
|
this.telexRelease = 'No' |
|
|
|
this.telexDirty = false |
|
|
|
this.pendingAddOrderNos = [] |
|
|
|
this.pendingRemoveOrderNos = [] |
|
|
|
this.originalFlexId = row.flexId |
|
|
|
this.flexIdDirty = false |
|
|
|
this.editSaving = false |
|
|
|
this.availableSearch = { po: '', item: '', method: '' } |
|
|
|
this.addDialogVisible = true |
|
|
|
// 打开即加载该物流单号+供应商下已关联的PO |
|
|
|
this.loadAddPoList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 供应商编码选择(新增弹窗专用,复用 Chooselist) |
|
|
|
@ -424,6 +550,10 @@ export default { |
|
|
|
} else { |
|
|
|
this.addPoList = [] |
|
|
|
} |
|
|
|
// 编辑界面:Customer 从已关联的PO锁定带出(不可编辑) |
|
|
|
if (this.dialogMode === 'edit') { |
|
|
|
this.addForm.customer = (this.addPoList[0] && this.addPoList[0].ccustomer) || '' |
|
|
|
} |
|
|
|
this.addPoLoading = false |
|
|
|
}).catch(() => { |
|
|
|
this.addPoList = [] |
|
|
|
@ -433,8 +563,12 @@ export default { |
|
|
|
|
|
|
|
// 打开选择PO弹窗 |
|
|
|
openAvailableDialog () { |
|
|
|
if (!this.addForm.customer) { |
|
|
|
this.$message.warning('请先选择Customer') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.addForm.flexId || !this.addForm.supplierNo) { |
|
|
|
this.$message.warning('请先填写物流单号和供应商编码') |
|
|
|
this.$message.warning('请先填写LOGISTICS ID和供应商编码') |
|
|
|
return |
|
|
|
} |
|
|
|
this.availableSelection = [] |
|
|
|
@ -448,7 +582,11 @@ export default { |
|
|
|
const params = { |
|
|
|
flexId: this.addForm.flexId, |
|
|
|
supplierNo: this.addForm.supplierNo, |
|
|
|
customer: this.addForm.customer || '', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
po: this.availableSearch.po || '', |
|
|
|
item: this.availableSearch.item || '', |
|
|
|
method: this.availableSearch.method || '', |
|
|
|
page: 1, |
|
|
|
limit: 1000 |
|
|
|
} |
|
|
|
@ -465,17 +603,40 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择PO弹窗查询(PO/Item/Method) |
|
|
|
searchAvailablePo () { |
|
|
|
this.loadAvailablePoList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择PO多选变化 |
|
|
|
handleAvailableSelectionChange (val) { |
|
|
|
this.availableSelection = val |
|
|
|
}, |
|
|
|
|
|
|
|
// 保存选中的PO:更新其 c_flexid 并刷新第一个弹窗 |
|
|
|
// 保存选中的PO:新增模式立即写库;编辑模式仅前端暂存(点底部"保存"才写库) |
|
|
|
saveAvailablePo () { |
|
|
|
if (!this.availableSelection.length) { |
|
|
|
this.$message.warning('请至少选择一条PO') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.dialogMode === 'edit') { |
|
|
|
// 编辑模式:只改前端 addPoList,不碰数据库 |
|
|
|
this.availableSelection.forEach(row => { |
|
|
|
if (!this.addPoList.some(exist => exist.orderNo === row.orderNo)) { |
|
|
|
this.addPoList.push(row) |
|
|
|
} |
|
|
|
// 若之前暂存过移除,则抵消 |
|
|
|
const rmIdx = this.pendingRemoveOrderNos.indexOf(row.orderNo) |
|
|
|
if (rmIdx !== -1) this.pendingRemoveOrderNos.splice(rmIdx, 1) |
|
|
|
// 记录待新增 |
|
|
|
if (this.pendingAddOrderNos.indexOf(row.orderNo) === -1) { |
|
|
|
this.pendingAddOrderNos.push(row.orderNo) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.availableDialogVisible = false |
|
|
|
this.$message.success('已添加,点击底部"保存"后生效') |
|
|
|
return |
|
|
|
} |
|
|
|
const params = { |
|
|
|
flexId: this.addForm.flexId, |
|
|
|
supplierNo: this.addForm.supplierNo, |
|
|
|
@ -497,6 +658,142 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 移除:将该PO订单的 c_flexid 置空、Telex 重置为 No(按 order_no 整单) |
|
|
|
handleRemovePo (row) { |
|
|
|
if (!this.addForm.flexId) { |
|
|
|
this.$message.warning('请先填写LOGISTICS ID') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm(`确认将订单 ${row.orderRef1 || row.orderNo} 从该物流单号移除?移除后其 Telex_Release 将重置为 No。`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
if (this.dialogMode === 'edit') { |
|
|
|
// 编辑模式:只改前端,不碰数据库 |
|
|
|
const idx = this.addPoList.findIndex(r => r.orderNo === row.orderNo) |
|
|
|
if (idx !== -1) this.addPoList.splice(idx, 1) |
|
|
|
const addIdx = this.pendingAddOrderNos.indexOf(row.orderNo) |
|
|
|
if (addIdx !== -1) { |
|
|
|
// 本次暂存新增又移除 → 直接抵消,不需写库 |
|
|
|
this.pendingAddOrderNos.splice(addIdx, 1) |
|
|
|
} else if (this.pendingRemoveOrderNos.indexOf(row.orderNo) === -1) { |
|
|
|
// 数据库已有的 → 记录为待移除 |
|
|
|
this.pendingRemoveOrderNos.push(row.orderNo) |
|
|
|
} |
|
|
|
this.$message.success('已移除,点击底部"保存"后生效') |
|
|
|
return |
|
|
|
} |
|
|
|
const params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
flexId: this.addForm.flexId, |
|
|
|
supplierNo: this.addForm.supplierNo, |
|
|
|
orderNoList: [row.orderNo] |
|
|
|
} |
|
|
|
removeLogisticsPo(params).then(({ data }) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.$message.success('移除成功') |
|
|
|
this.loadAddPoList() |
|
|
|
this.getMainData() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '移除失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('移除失败') |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 编辑界面:点击底部"保存"才一次性提交本次所有暂存改动(移除→改单号→新增→Telex) |
|
|
|
saveEditAll () { |
|
|
|
if (!this.addForm.flexId) { |
|
|
|
this.$message.warning('缺少物流单号') |
|
|
|
return |
|
|
|
} |
|
|
|
const site = this.$store.state.user.site |
|
|
|
const supplierNo = this.addForm.supplierNo |
|
|
|
const oldFlexId = this.originalFlexId // 数据库当前值 |
|
|
|
const newFlexId = this.addForm.flexId // 可能已暂存修改 |
|
|
|
const flexIdChanged = this.flexIdDirty && newFlexId !== oldFlexId |
|
|
|
const removeList = this.pendingRemoveOrderNos.slice() |
|
|
|
const addList = this.pendingAddOrderNos.slice() |
|
|
|
const commitTelex = this.telexDirty |
|
|
|
if (!removeList.length && !addList.length && !commitTelex && !flexIdChanged) { |
|
|
|
// 无任何改动:直接关闭弹窗(不写库),避免点了“没反应” |
|
|
|
this.addDialogVisible = false |
|
|
|
return |
|
|
|
} |
|
|
|
this.editSaving = true |
|
|
|
let chain = Promise.resolve() |
|
|
|
// 1. 移除:仍按数据库原物流单号(oldFlexId)解除(此时尚未迁移) |
|
|
|
if (removeList.length) { |
|
|
|
chain = chain.then(() => removeLogisticsPo({ site, flexId: oldFlexId, supplierNo, orderNoList: removeList }).then(({ data }) => { |
|
|
|
if (data.code !== 0) throw new Error(data.msg || '移除失败') |
|
|
|
})) |
|
|
|
} |
|
|
|
// 2. 物流单号变更:整组 old→new |
|
|
|
if (flexIdChanged) { |
|
|
|
chain = chain.then(() => changeLogisticsFlexId({ site, flexId: oldFlexId, supplierNo, newFlexId }).then(({ data }) => { |
|
|
|
if (data.code !== 0) throw new Error(data.msg || '物流单号修改失败') |
|
|
|
})) |
|
|
|
} |
|
|
|
// 3. 新增:绑定到最终物流单号(newFlexId) |
|
|
|
if (addList.length) { |
|
|
|
chain = chain.then(() => updateLogisticsPo({ site, flexId: newFlexId, supplierNo, orderNoList: addList }).then(({ data }) => { |
|
|
|
if (data.code !== 0) throw new Error(data.msg || '绑定失败') |
|
|
|
})) |
|
|
|
} |
|
|
|
// 4. Telex:按最终物流单号批量刷新 |
|
|
|
if (commitTelex) { |
|
|
|
chain = chain.then(() => updateTelexRelease({ site, flexId: newFlexId, supplierNo, telexRelease: this.telexRelease }).then(({ data }) => { |
|
|
|
if (data.code !== 0) throw new Error(data.msg || 'Telex_Release 保存失败') |
|
|
|
})) |
|
|
|
} |
|
|
|
chain.then(() => { |
|
|
|
this.$message.success('保存成功') |
|
|
|
this.pendingAddOrderNos = [] |
|
|
|
this.pendingRemoveOrderNos = [] |
|
|
|
this.telexDirty = false |
|
|
|
this.flexIdDirty = false |
|
|
|
this.originalFlexId = newFlexId |
|
|
|
this.addDialogVisible = false |
|
|
|
this.getMainData() |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error((err && err.message) || '保存失败') |
|
|
|
// 部分提交可能已生效,回退前端显示为库中实际值,避免新旧单号不一致 |
|
|
|
this.addForm.flexId = this.originalFlexId |
|
|
|
this.flexIdDirty = false |
|
|
|
this.loadAddPoList() |
|
|
|
this.getMainData() |
|
|
|
}).finally(() => { |
|
|
|
this.editSaving = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开修改物流单号弹窗 |
|
|
|
openChangeFlexIdDialog () { |
|
|
|
this.newFlexIdInput = this.addForm.flexId |
|
|
|
this.changeFlexIdDialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 确认修改物流单号:编辑界面仅前端暂存,点底部"保存"才写库 |
|
|
|
confirmChangeFlexId () { |
|
|
|
const newVal = (this.newFlexIdInput || '').trim() |
|
|
|
if (!newVal) { |
|
|
|
this.$message.warning('新物流单号不能为空') |
|
|
|
return |
|
|
|
} |
|
|
|
if (newVal === this.addForm.flexId) { |
|
|
|
this.changeFlexIdDialogVisible = false |
|
|
|
return |
|
|
|
} |
|
|
|
// 只改前端显示值(锁定输入框会跟着变),标记待改,不动数据库 |
|
|
|
this.addForm.flexId = newVal |
|
|
|
this.flexIdDirty = true |
|
|
|
this.changeFlexIdDialogVisible = false |
|
|
|
this.$message.success('已修改,点击底部"保存"后生效') |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载PO清单 |
|
|
|
loadPoList () { |
|
|
|
if (!this.currentRow.flexId) { |
|
|
|
@ -653,7 +950,7 @@ export default { |
|
|
|
|
|
|
|
// 定义导出列配置 |
|
|
|
const columnMapping = [ |
|
|
|
{ columnProp: 'flexId', columnLabel: '进仓编号' }, |
|
|
|
{ columnProp: 'flexId', columnLabel: 'LOGISTICS ID' }, |
|
|
|
{ columnProp: 'supplierNo', columnLabel: '供应商编码' }, |
|
|
|
{ columnProp: 'supplierName', columnLabel: '供应商名称' }, |
|
|
|
{ columnProp: 'poCount', columnLabel: 'PO数量' }, |
|
|
|
|