Browse Source

Merge remote-tracking branch 'origin/master'

master
常熟吴彦祖 3 weeks ago
parent
commit
8d64e55f9f
  1. 3
      src/api/order/poOrder.js
  2. 49
      src/views/modules/inspection/inspectionRequestList.vue
  3. 69
      src/views/modules/order/poOrder.vue
  4. 55
      src/views/modules/port/portTransit.vue

3
src/api/order/poOrder.js

@ -16,6 +16,9 @@ export const deletePoDetail = (data) => createAPI(`/pODetail/delete`, 'post', da
//批量更新 //批量更新
export const batchUpdatePoDetail = (data) => createAPI(`/pODetail/batchUpdatePoDetail`, 'post', data) export const batchUpdatePoDetail = (data) => createAPI(`/pODetail/batchUpdatePoDetail`, 'post', data)
/** 编辑模式同步运输周期:按行内港口/运输方式重取 ori_transit_cycle 并连带重算相关日期 */
export const syncOriTransitCycle = (data) => createAPI(`/pODetail/syncOriTransitCycle`, 'post', data)
/** 关闭 PO 订单行(status → 已关闭) */ /** 关闭 PO 订单行(status → 已关闭) */
export const closePoDetail = (data) => createAPI(`/pODetail/closePoDetail`, 'post', data) export const closePoDetail = (data) => createAPI(`/pODetail/closePoDetail`, 'post', data)

49
src/views/modules/inspection/inspectionRequestList.vue

@ -407,9 +407,12 @@
<el-table-column prop="shipMethod" label="运输方式" header-align="center" align="center" width="100"> <el-table-column prop="shipMethod" label="运输方式" header-align="center" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%; box-sizing: border-box;"> <el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%; box-sizing: border-box;">
<el-option label="空运" value="空运"></el-option>
<el-option label="海运" value="海运"></el-option>
<el-option label="陆运" value="陆运"></el-option>
<el-option
v-for="opt in shipMethodOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -473,9 +476,12 @@
<el-table-column label="运输方式" header-align="center" align="center" width="120"> <el-table-column label="运输方式" header-align="center" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-if="editPoEditMode" v-model="scope.row.shipMothod" placeholder="请选择" size="mini" style="width: 100%;"> <el-select v-if="editPoEditMode" v-model="scope.row.shipMothod" placeholder="请选择" size="mini" style="width: 100%;">
<el-option label="空运" value="空运"></el-option>
<el-option label="海运" value="海运"></el-option>
<el-option label="陆运" value="陆运"></el-option>
<el-option
v-for="opt in shipMethodOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select> </el-select>
<span v-else>{{ scope.row.shipMothod }}</span> <span v-else>{{ scope.row.shipMothod }}</span>
</template> </template>
@ -919,9 +925,12 @@
<el-table-column label="运输方式" header-align="center" align="center" width="120"> <el-table-column label="运输方式" header-align="center" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%;"> <el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%;">
<el-option label="空运" value="空运"></el-option>
<el-option label="海运" value="海运"></el-option>
<el-option label="陆运" value="陆运"></el-option>
<el-option
v-for="opt in shipMethodOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -1124,6 +1133,7 @@ import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachment
import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue' import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue'
import { fetchSupplierDetail } from '@/utils/supplierChooselistHelper' import { fetchSupplierDetail } from '@/utils/supplierChooselistHelper'
import excel from '@/utils/excel-util.js' import excel from '@/utils/excel-util.js'
import { listActiveShipMethods } from '@/api/port/portTransit.js'
export default { export default {
props: { props: {
@ -1161,6 +1171,7 @@ export default {
currentRow: {}, currentRow: {},
tagNo: '', tagNo: '',
searchType: '', searchType: '',
shipMethodOptions: [],
// 供应商模式上下文:来自 /sys/user/info(user.supplierNo / user.supplierName) // 供应商模式上下文:来自 /sys/user/info(user.supplierNo / user.supplierName)
currentSupplierNo: '', currentSupplierNo: '',
currentSupplierName: '', currentSupplierName: '',
@ -1701,12 +1712,32 @@ export default {
removeMainTableResizeListener () { removeMainTableResizeListener () {
window.removeEventListener('resize', this.handleMainTableResize) window.removeEventListener('resize', this.handleMainTableResize)
}, },
/**
* 加载启用的运输方式下拉选项。
* 数据来源:POST /portTransitCycle/shipMethodList(仅 active=Y)
* 以 methodDesc 作为选项 label 与 value,与订单/港口周期表存储的运输方式描述保持一致。
*/
loadShipMethodOptions () {
return listActiveShipMethods().then(({ data }) => {
if (data && data.code === 0) {
this.shipMethodOptions = (data.rows || []).map(item => ({
label: item.methodDesc,
value: item.methodDesc
}))
} else {
this.shipMethodOptions = []
}
}).catch(() => {
this.shipMethodOptions = []
})
},
/** /**
* 页面初始化入口: * 页面初始化入口:
* - 通用模式:直接查询; * - 通用模式:直接查询;
* - 供应商模式:先加载当前用户供应商信息,再按供应商过滤查询。 * - 供应商模式:先加载当前用户供应商信息,再按供应商过滤查询。
*/ */
async initPageData () { async initPageData () {
this.loadShipMethodOptions()
if (!this.isSupplierPageMode) { if (!this.isSupplierPageMode) {
this.getMainData() this.getMainData()
return return

69
src/views/modules/order/poOrder.vue

@ -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']
@ -3965,7 +3977,7 @@ export default {
return return
} }
if (tag === 2019) {
if (tag === 532) {
const via = data.method_desc || data.methodDesc || data.shipVia || '' const via = data.method_desc || data.methodDesc || data.shipVia || ''
if (ctx === 'add') { if (ctx === 'add') {
this.addForm.shipVia = via this.addForm.shipVia = via
@ -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 || ''
@ -4927,7 +4984,7 @@ export default {
}) })
}, },
// 新增 schema 中若展示运输方式(ship_via / S_Method),则默认填充为海运
// 新增 schema 中若展示运输方式(ship_via / S_Method),则默认填充为 Ocean
applyAddDefaultShipViaBySchema (targetForm) { applyAddDefaultShipViaBySchema (targetForm) {
if (!targetForm || !Array.isArray(this.addFormSchemaFields) || !this.addFormSchemaFields.length) { if (!targetForm || !Array.isArray(this.addFormSchemaFields) || !this.addFormSchemaFields.length) {
return return
@ -4942,7 +4999,7 @@ export default {
} }
const current = targetForm[prop] const current = targetForm[prop]
if (current === undefined || current === null || String(current).trim() === '') { if (current === undefined || current === null || String(current).trim() === '') {
this.$set(targetForm, prop, '海运')
this.$set(targetForm, prop, 'Ocean')
} }
}, },
@ -5298,7 +5355,7 @@ export default {
}, },
openAddShipViaSelect (target = 'master') { openAddShipViaSelect (target = 'master') {
const context = target === 'detail' ? 'addDetail' : 'add' const context = target === 'detail' ? 'addDetail' : 'add'
this.openEamList(2019, '', '', context, 'shipVia')
this.openEamList(532, '', '', context, 'shipVia')
}, },
buildMergedAddDetailForm (detailRow) { buildMergedAddDetailForm (detailRow) {
@ -5438,7 +5495,7 @@ export default {
openShipViaSelect (row) { openShipViaSelect (row) {
this.currentShipViaRow = row this.currentShipViaRow = row
this.openEamList(2019, '', '', 'row', 'shipVia')
this.openEamList(532, '', '', 'row', 'shipVia')
}, },
/** /**

55
src/views/modules/port/portTransit.vue

@ -95,7 +95,7 @@
</el-form> </el-form>
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="table-area">
<div class="table-area" >
<div class="table-title" style="font-size: 13px; font-weight: 450; color: #606266;">运输周期</div> <div class="table-title" style="font-size: 13px; font-weight: 450; color: #606266;">运输周期</div>
<el-table <el-table
@ -122,7 +122,7 @@
align="center" align="center"
width="239" width="239"
> >
<template slot-scope="scope">
<template slot-scope="scope" class="rq">
<input <input
v-model.number="scope.row.transitDays" v-model.number="scope.row.transitDays"
type="number" type="number"
@ -180,23 +180,30 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="luyun" prop="luyun"
label="陆运周期"
label="Land Transit"
align="center" align="center"
width="150">
width="140">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="haiyun" prop="haiyun"
label="海运周期"
label="Ocean Transit"
align="center" align="center"
width="150">
width="140">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="kongyun" prop="kongyun"
label="空运周期"
label="Air Transit"
align="center" align="center"
width="160">
width="140">
</el-table-column>
<el-table-column
prop="express"
label="Express Transit"
align="center"
width="150">
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -249,9 +256,10 @@ export default {
}, },
// 运输周期列表 // 运输周期列表
transportList: [ transportList: [
{ shipMethod: '陆运', transitDays: 0 },
{ shipMethod: '海运', transitDays: 0 },
{ shipMethod: '空运', transitDays: 0 }
{ shipMethod: 'Land', transitDays: 0 },
{ shipMethod: 'Ocean', transitDays: 0 },
{ shipMethod: 'Air', transitDays: 0 },
{ shipMethod: 'Express', transitDays: 0 }
], ],
formRules: { formRules: {
departureName: [{ required: true, message: '请输入始发港名称', trigger: 'blur' }], departureName: [{ required: true, message: '请输入始发港名称', trigger: 'blur' }],
@ -267,9 +275,10 @@ export default {
{ columnProp: 'departureName', headerAlign: 'center', align: 'left', columnLabel: '始发港', columnWidth: 150, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true }, { columnProp: 'departureName', headerAlign: 'center', align: 'left', columnLabel: '始发港', columnWidth: 150, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'destination', headerAlign: 'center', align: 'left', columnLabel: '目的港口ID', columnWidth: 120, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true }, { columnProp: 'destination', headerAlign: 'center', align: 'left', columnLabel: '目的港口ID', columnWidth: 120, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'destinationName', headerAlign: 'center', align: 'left', columnLabel: '目的港口名称', columnWidth: 150, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true }, { columnProp: 'destinationName', headerAlign: 'center', align: 'left', columnLabel: '目的港口名称', columnWidth: 150, fixed: '', columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'luyun', headerAlign: 'center', align: 'center', columnLabel: '陆运周期', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true },
{ columnProp: 'haiyun', headerAlign: 'center', align: 'center', columnLabel: '海运周期', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true },
{ columnProp: 'kongyun', headerAlign: 'center', align: 'center', columnLabel: '空运周期', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true }
{ columnProp: 'luyun', headerAlign: 'center', align: 'center', columnLabel: 'Land Transit', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true },
{ columnProp: 'haiyun', headerAlign: 'center', align: 'center', columnLabel: 'Ocean Transit', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true },
{ columnProp: 'kongyun', headerAlign: 'center', align: 'center', columnLabel: 'Air Transit', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true },
{ columnProp: 'express', headerAlign: 'center', align: 'center', columnLabel: 'Express Transit', columnWidth: 120, fixed: '', columnHidden: false, columnSortable: true, showOverflowTooltip: true }
] ]
} }
}, },
@ -373,9 +382,10 @@ export default {
} }
// 重置运输周期列表 // 重置运输周期列表
this.transportList = [ this.transportList = [
{ shipMethod: '陆运', transitDays: 0 },
{ shipMethod: '海运', transitDays: 0 },
{ shipMethod: '空运', transitDays: 0 }
{ shipMethod: 'Land', transitDays: 0 },
{ shipMethod: 'Ocean', transitDays: 0 },
{ shipMethod: 'Air', transitDays: 0 },
{ shipMethod: 'Express', transitDays: 0 }
] ]
this.dialogVisible = true this.dialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -422,18 +432,21 @@ export default {
destination: this.formData.destination, destination: this.formData.destination,
luyun: null, luyun: null,
haiyun: null, haiyun: null,
kongyun: null
kongyun: null,
express: null
} }
this.transportList.forEach(item => { this.transportList.forEach(item => {
if (item.transitDays === null || item.transitDays === '') return if (item.transitDays === null || item.transitDays === '') return
if (item.shipMethod === '陆运') {
if (item.shipMethod === 'Land') {
result.luyun = Number(item.transitDays) result.luyun = Number(item.transitDays)
} else if (item.shipMethod === '海运') {
} else if (item.shipMethod === 'Ocean') {
result.haiyun = Number(item.transitDays) result.haiyun = Number(item.transitDays)
} else if (item.shipMethod === '空运') {
} else if (item.shipMethod === 'Air') {
result.kongyun = Number(item.transitDays) result.kongyun = Number(item.transitDays)
} else if (item.shipMethod === 'Express') {
result.express = Number(item.transitDays)
} }
}) })

Loading…
Cancel
Save