|
|
@ -23,6 +23,7 @@ |
|
|
{{ editMode ? '确定' : '编辑' }} |
|
|
{{ editMode ? '确定' : '编辑' }} |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button v-if="editMode" style="margin-left: 2px" @click="cancelEditMode">取消</el-button> |
|
|
<el-button v-if="editMode" style="margin-left: 2px" @click="cancelEditMode">取消</el-button> |
|
|
|
|
|
<el-button type="success" plain style="margin-left: 2px" @click="syncOriTransitCycle" v-if="editMode" :disabled="!syncSelection || !syncSelection.length">同步运输周期</el-button> |
|
|
<el-button type="primary" style="margin-left: 2px" @click="openAddDialog" v-if="!editMode">新增</el-button> |
|
|
<el-button type="primary" style="margin-left: 2px" @click="openAddDialog" v-if="!editMode">新增</el-button> |
|
|
<el-button type="primary" plain style="margin-left: 2px" @click="openCurrentRowPriceDialog" v-if="!editMode" :disabled="!currentRow">查看价格表</el-button> |
|
|
<el-button type="primary" plain style="margin-left: 2px" @click="openCurrentRowPriceDialog" v-if="!editMode" :disabled="!currentRow">查看价格表</el-button> |
|
|
<el-button type="warning" plain style="margin-left: 2px" @click="handleSplitToNewPo" v-if="!editMode" :disabled="!currentRow || !canSplitToNewPo(currentRow.status)">拆单到新PO</el-button> |
|
|
<el-button type="warning" plain style="margin-left: 2px" @click="handleSplitToNewPo" v-if="!editMode" :disabled="!currentRow || !canSplitToNewPo(currentRow.status)">拆单到新PO</el-button> |
|
|
@ -30,12 +31,20 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-table |
|
|
<el-table |
|
|
ref="poTable" |
|
|
ref="poTable" |
|
|
|
|
|
:key="editMode ? 'poTable-edit' : 'poTable-view'" |
|
|
:height="height" |
|
|
:height="height" |
|
|
:data="masterRows" |
|
|
:data="masterRows" |
|
|
border |
|
|
border |
|
|
highlight-current-row |
|
|
highlight-current-row |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
@current-change="onTableCurrentChange"> |
|
|
|
|
|
|
|
|
@current-change="onTableCurrentChange" |
|
|
|
|
|
@selection-change="onSyncSelectionChange"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
v-if="editMode" |
|
|
|
|
|
type="selection" |
|
|
|
|
|
fixed="left" |
|
|
|
|
|
width="45"> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-if="!editMode" |
|
|
v-if="!editMode" |
|
|
fixed="left" |
|
|
fixed="left" |
|
|
@ -914,6 +923,7 @@ import { |
|
|
searchPoDetailPage, |
|
|
searchPoDetailPage, |
|
|
searchPoDetailAdvancedPage, |
|
|
searchPoDetailAdvancedPage, |
|
|
batchUpdatePoDetail, |
|
|
batchUpdatePoDetail, |
|
|
|
|
|
syncOriTransitCycle, |
|
|
closePoDetail, |
|
|
closePoDetail, |
|
|
openPoDetail, |
|
|
openPoDetail, |
|
|
issuePoDetail, |
|
|
issuePoDetail, |
|
|
@ -1113,6 +1123,8 @@ export default { |
|
|
// ===== 页面基础状态 ===== |
|
|
// ===== 页面基础状态 ===== |
|
|
loading: false, |
|
|
loading: false, |
|
|
masterRows: [], |
|
|
masterRows: [], |
|
|
|
|
|
// 编辑模式「同步运输周期」勾选行 |
|
|
|
|
|
syncSelection: [], |
|
|
/** |
|
|
/** |
|
|
* 需要单独写编辑 UI 的 columnProp 填在这里,才会走模板里「自定义」分支;不在此数组的仍用默认 select/num/text - rqrq |
|
|
* 需要单独写编辑 UI 的 columnProp 填在这里,才会走模板里「自定义」分支;不在此数组的仍用默认 select/num/text - rqrq |
|
|
* 示例:['mPlanner', 'comments'] |
|
|
* 示例:['mPlanner', 'comments'] |
|
|
@ -4148,6 +4160,51 @@ export default { |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onSyncSelectionChange (rows) { |
|
|
|
|
|
this.syncSelection = rows || [] |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
syncOriTransitCycle () { |
|
|
|
|
|
const rows = this.syncSelection || [] |
|
|
|
|
|
if (!rows.length) { |
|
|
|
|
|
this.$message.warning('请先勾选需要同步的行') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const payload = rows.map(r => ({ |
|
|
|
|
|
site: r.site, |
|
|
|
|
|
orderNo: r.orderNo, |
|
|
|
|
|
itemNo: r.itemNo, |
|
|
|
|
|
customer: r.customer, |
|
|
|
|
|
departure: r.departure, |
|
|
|
|
|
destination: r.destination, |
|
|
|
|
|
shipVia: r.shipVia, |
|
|
|
|
|
wantReceiveDate: r.wantReceiveDate, |
|
|
|
|
|
narrival: r.narrival |
|
|
|
|
|
})) |
|
|
|
|
|
this.$confirm(`将同步 ${rows.length} 行的运输周期与相关日期,确定继续?`, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
syncOriTransitCycle(payload).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
const d = data.data || {} |
|
|
|
|
|
const s = d.summary || {} |
|
|
|
|
|
let msg = `同步完成:成功 ${s.successCount || 0} 条` |
|
|
|
|
|
if (s.unmatchedCount) msg += `,其中 ${s.unmatchedCount} 条未匹配到周期` |
|
|
|
|
|
if (s.skipCount) msg += `,跳过 ${s.skipCount} 条` |
|
|
|
|
|
this.$message.success(msg) |
|
|
|
|
|
this.syncSelection = [] |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error((data && data.msg) || '同步失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.$message.error('同步失败: ' + error.message) |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
formatCodeOptionLabel (code, name) { |
|
|
formatCodeOptionLabel (code, name) { |
|
|
if (!name) { |
|
|
if (!name) { |
|
|
return code || '' |
|
|
return code || '' |
|
|
|