提交
This commit is contained in:
1 parent
2716c2b6f8
commit
f3693be913
140 files changed
+799199
-11262
No files matched your search
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<div class="detail-actions">
|
||||
<el-button
|
||||
v-if="detailContract?.status === 'draft'"
|
||||
v-if="isContractEditableStatus(detailContract?.status)"
|
||||
class="btn-ghost"
|
||||
@click="handleDetailEdit"
|
||||
>
|
||||
@@ -850,7 +850,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, defineAsyncComponent, nextTick } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { isFrameworkContractType } from '../contractType'
|
||||
import { isFrameworkContractType, isContractEditableStatus, getContractReeditConfirmMessage } from '../contractType'
|
||||
import {
|
||||
CircleCheck,
|
||||
CircleClose,
|
||||
@@ -1244,12 +1244,20 @@ const handleDetailDrawerClose = () => {
|
||||
};
|
||||
|
||||
/** 详情抽屉 - 编辑 */
|
||||
const handleDetailEdit = () => {
|
||||
const handleDetailEdit = async () => {
|
||||
if (!detailContract.value?.id) return
|
||||
if (detailContract.value.status !== 'draft') {
|
||||
$modal.msgWarning('只能修改草稿状态的合同')
|
||||
if (!isContractEditableStatus(detailContract.value.status)) {
|
||||
$modal.msgWarning('仅草稿、审批中或已审批(未执行)的合同才能修改')
|
||||
return
|
||||
}
|
||||
const confirmMsg = getContractReeditConfirmMessage(detailContract.value.status)
|
||||
if (confirmMsg) {
|
||||
try {
|
||||
await $modal.confirm(confirmMsg)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
visible.value = false
|
||||
formDialogEditId.value = detailContract.value.id
|
||||
formDialogVisible.value = true
|
||||
|
||||
@@ -10,3 +10,26 @@ export type FrameworkContractType = (typeof FRAMEWORK_CONTRACT_TYPES)[number]
|
||||
export function isFrameworkContractType(type?: string | null): boolean {
|
||||
return FRAMEWORK_CONTRACT_TYPES.includes((type || '').trim() as FrameworkContractType)
|
||||
}
|
||||
|
||||
/** 允许打开编辑的合同状态(保存后回草稿) */
|
||||
export const CONTRACT_EDITABLE_STATUSES = ['draft', 'approving', 'approved'] as const
|
||||
|
||||
export type ContractEditableStatus = (typeof CONTRACT_EDITABLE_STATUSES)[number]
|
||||
|
||||
export function isContractEditableStatus(status?: string | null): boolean {
|
||||
return CONTRACT_EDITABLE_STATUSES.includes(
|
||||
(status || '').trim() as ContractEditableStatus
|
||||
)
|
||||
}
|
||||
|
||||
/** 审批中 / 已审批打开编辑前的确认文案;草稿返回 null(无需确认) */
|
||||
export function getContractReeditConfirmMessage(status?: string | null): string | null {
|
||||
const s = (status || '').trim()
|
||||
if (s === 'approving') {
|
||||
return '编辑保存后将作废当前审批流,合同变回草稿,需重新提交审批'
|
||||
}
|
||||
if (s === 'approved') {
|
||||
return '编辑保存后合同将变回草稿,需重新提交审批'
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleEdit"
|
||||
v-if="contract?.status === 'draft'"
|
||||
v-if="isContractEditableStatus(contract?.status)"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>修改
|
||||
</el-button>
|
||||
@@ -1033,7 +1033,7 @@ import ImagePreview from '@/components/ImagePreview/index.vue';
|
||||
import TinyMceEditor from '@/components/TinyMceEditor/index.vue';
|
||||
import { getOpportunity } from '@/api/crm/opportunity';
|
||||
import { getQuote } from '@/api/crm/quote';
|
||||
import { isFrameworkContractType } from './contractType';
|
||||
import { isFrameworkContractType, isContractEditableStatus, getContractReeditConfirmMessage } from './contractType';
|
||||
import {
|
||||
parseCrmAttachmentField,
|
||||
resolveCrmAttachmentFiles,
|
||||
@@ -1296,12 +1296,24 @@ const goBack = () => {
|
||||
};
|
||||
|
||||
/** 编辑 */
|
||||
const handleEdit = () => {
|
||||
const handleEdit = async () => {
|
||||
if (!isContractEditableStatus(contract.value?.status)) {
|
||||
$modal.msgWarning('仅草稿、审批中或已审批(未执行)的合同才能修改')
|
||||
return
|
||||
}
|
||||
const confirmMsg = getContractReeditConfirmMessage(contract.value?.status)
|
||||
if (confirmMsg) {
|
||||
try {
|
||||
await $modal.confirm(confirmMsg)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
router.push({
|
||||
path: '/crm/contract/form',
|
||||
query: { id: contract.value?.id }
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除合同 */
|
||||
const handleDelete = async () => {
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
:disabled="single || selectedRows[0]?.status !== 'draft'"
|
||||
:disabled="single || !isContractEditableStatus(selectedRows[0]?.status)"
|
||||
@click="handleUpdate()"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
@@ -516,6 +516,7 @@ import { $modal } from '@/utils/modal'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { filterDeletableByCreator, allRowsDeletableByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
|
||||
import { isContractEditableStatus, getContractReeditConfirmMessage } from './contractType'
|
||||
import ApprovalDialog from './components/ApprovalDialog.vue'
|
||||
import ExecuteDialog from './components/ExecuteDialog.vue'
|
||||
import InvalidDialog from './components/InvalidDialog.vue'
|
||||
@@ -1003,24 +1004,32 @@ const handleAdd = () => {
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = (row?: ContractVO) => {
|
||||
const handleUpdate = async (row?: ContractVO) => {
|
||||
if (!row && ids.value.length !== 1) {
|
||||
$modal.msgWarning('请选择一条数据进行修改');
|
||||
return;
|
||||
$modal.msgWarning('请选择一条数据进行修改')
|
||||
return
|
||||
}
|
||||
const targetRow = row || contractList.value[contractList.value.findIndex((item) => item.id === ids.value[0])];
|
||||
const targetRow =
|
||||
row || contractList.value[contractList.value.findIndex((item) => item.id === ids.value[0])]
|
||||
if (!targetRow) {
|
||||
$modal.msgWarning('未找到选中的数据');
|
||||
return;
|
||||
$modal.msgWarning('未找到选中的数据')
|
||||
return
|
||||
}
|
||||
// 检查状态,只能修改草稿状态的合同
|
||||
if (targetRow.status !== 'draft') {
|
||||
$modal.msgWarning('只能修改草稿状态的合同');
|
||||
return;
|
||||
if (!isContractEditableStatus(targetRow.status)) {
|
||||
$modal.msgWarning('仅草稿、审批中或已审批(未执行)的合同才能修改')
|
||||
return
|
||||
}
|
||||
const confirmMsg = getContractReeditConfirmMessage(targetRow.status)
|
||||
if (confirmMsg) {
|
||||
try {
|
||||
await $modal.confirm(confirmMsg)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
formDialogEditId.value = targetRow.id
|
||||
formDialogVisible.value = true
|
||||
};
|
||||
}
|
||||
|
||||
/** 表单对话框保存/提交成功回调 */
|
||||
const handleFormSuccess = () => {
|
||||
|
||||
@@ -546,11 +546,12 @@
|
||||
fullSpan: false
|
||||
},
|
||||
{
|
||||
label: '注意事项',
|
||||
value: editForm.value?.pickupNotes || '—',
|
||||
label: '取货联系方式',
|
||||
value: editForm.value?.pickupContact || '—',
|
||||
long: false,
|
||||
fullSpan: false
|
||||
}
|
||||
},
|
||||
{ label: '注意事项', value: editForm.value?.pickupNotes || '—', span: 'full' }
|
||||
])
|
||||
|
||||
const deliveryViewFields = computed<ViewField[]>(() => [
|
||||
@@ -560,17 +561,18 @@
|
||||
span: 'full'
|
||||
},
|
||||
{
|
||||
label: '送达时间',
|
||||
label: '送货时间',
|
||||
value: formatDisplayDate(editForm.value?.deliveryTime),
|
||||
long: false,
|
||||
fullSpan: false
|
||||
},
|
||||
{
|
||||
label: '注意事项',
|
||||
value: editForm.value?.destinationNotes || '—',
|
||||
label: '送货联系方式',
|
||||
value: editForm.value?.deliveryContact || '—',
|
||||
long: false,
|
||||
fullSpan: false
|
||||
}
|
||||
},
|
||||
{ label: '注意事项', value: editForm.value?.destinationNotes || '—', span: 'full' }
|
||||
])
|
||||
const pagination = reactive({ page: 1, pageSize: 20, total: 0 })
|
||||
const searchForm = reactive<PlIoOrderQuery>({
|
||||
|
||||
@@ -4,7 +4,16 @@
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="运输公司">
|
||||
<el-select v-model="searchForm.carrierId" placeholder="全部" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.carrierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -309,8 +318,8 @@ import {
|
||||
RefreshLeft,
|
||||
Search
|
||||
} from '@element-plus/icons-vue'
|
||||
import { carrierApi, freightApi, type Carrier, type FreightSettlement } from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import { usePlRemoteCarrierOptions } from '@/composables/usePlRemoteOptions'
|
||||
import { canDeleteByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
|
||||
import PlFreightApprovalDialog from '@/components/business/pl-freight-approval-dialog/index.vue'
|
||||
import PlFreightSettlementFormDialog from '@/components/business/pl-freight-settlement-form-dialog/index.vue'
|
||||
@@ -345,7 +354,15 @@ const {
|
||||
|
||||
const loading = ref(false)
|
||||
const cancelLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const {
|
||||
list: carrierList,
|
||||
loading: carrierSelectLoading,
|
||||
search: searchCarriers,
|
||||
onFocus: onCarrierSelectFocus
|
||||
} = usePlRemoteCarrierOptions({
|
||||
getSelectedId: () => searchForm.carrierId,
|
||||
listParams: { status: '1' }
|
||||
})
|
||||
const settlementList = ref<FreightSettlement[]>([])
|
||||
const selectedRows = ref<FreightSettlement[]>([])
|
||||
const viewingRow = ref<FreightSettlement | null>(null)
|
||||
@@ -421,12 +438,7 @@ function handleQuickSearchClear() {
|
||||
}
|
||||
|
||||
async function loadCarrierList() {
|
||||
try {
|
||||
const res = await carrierApi.list({ status: '1', page: 1, pageSize: 100 })
|
||||
carrierList.value = pickBxList(res)
|
||||
} catch {
|
||||
carrierList.value = []
|
||||
}
|
||||
await searchCarriers('')
|
||||
}
|
||||
|
||||
function handlePageChange() {
|
||||
|
||||
@@ -4,7 +4,16 @@
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="运输公司">
|
||||
<el-select v-model="searchForm.carrierId" placeholder="全部" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.carrierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -49,7 +58,7 @@
|
||||
<div class="list-toolbar-row">
|
||||
<ListQuickSearchInput
|
||||
v-model="quickSearchKeyword"
|
||||
placeholder="计划编号/客户/车牌"
|
||||
placeholder="计划编号/客户/车牌/承运商"
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
@@ -144,7 +153,7 @@
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('transportCompany')"
|
||||
prop="transportCompany"
|
||||
label="运输公司"
|
||||
label="承运商"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
@@ -197,9 +206,10 @@ import ListToolbarEndActions from '@/components/business/list-toolbar-end-action
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { DocumentAdd, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { carrierApi, freightApi, vehicleApi, type Carrier, type UnsettledPlanItem, type Vehicle } from '@/api/pl'
|
||||
import { freightApi, vehicleApi, type UnsettledPlanItem, type Vehicle } from '@/api/pl'
|
||||
import { usePlRemoteCarrierOptions } from '@/composables/usePlRemoteOptions'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { pickBxList, pickBxPageResult } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import PlPlanViewDialog from '@/components/business/pl-plan-view-dialog/index.vue'
|
||||
import { getPlanTypeLabel, getPlanTypeTagType } from '@/views/pl/freight/freight-status'
|
||||
import { buildVehicleTrailerLookup, formatPlVehiclePlateDisplay } from '@/utils/pl-display'
|
||||
@@ -213,7 +223,7 @@ const listColumnDefs = [
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'partnerName', label: '客户/供应商' },
|
||||
{ prop: 'licensePlate', label: '车牌号' },
|
||||
{ prop: 'transportCompany', label: '运输公司' },
|
||||
{ prop: 'transportCompany', label: '承运商' },
|
||||
{ prop: 'freightAmount', label: '运费(元)' },
|
||||
{ prop: 'archiveTime', label: '归档时间' }
|
||||
]
|
||||
@@ -228,7 +238,15 @@ const {
|
||||
|
||||
const loading = ref(false)
|
||||
const createLoading = ref(false)
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const {
|
||||
list: carrierList,
|
||||
loading: carrierSelectLoading,
|
||||
search: searchCarriers,
|
||||
onFocus: onCarrierSelectFocus
|
||||
} = usePlRemoteCarrierOptions({
|
||||
getSelectedId: () => searchForm.carrierId,
|
||||
listParams: { status: '1' }
|
||||
})
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
const planList = ref<UnsettledPlanItem[]>([])
|
||||
@@ -302,12 +320,7 @@ function handleQuickSearchClear() {
|
||||
}
|
||||
|
||||
async function loadCarrierList() {
|
||||
try {
|
||||
const res = await carrierApi.list({ status: '1', page: 1, pageSize: 100 })
|
||||
carrierList.value = pickBxList(res)
|
||||
} catch {
|
||||
carrierList.value = []
|
||||
}
|
||||
await searchCarriers('')
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
<h2 class="title-bar-heading">危化品证上传</h2>
|
||||
</div>
|
||||
|
||||
<PlPlanTypeTabs v-model="activePlanTypeTab" @change="handlePlanTypeTabChange" />
|
||||
<PlPlanTypeTabs
|
||||
v-model="activePlanTypeTab"
|
||||
:tabs="PL_PLAN_CERT_TABS"
|
||||
@change="handlePlanTypeTabChange"
|
||||
/>
|
||||
|
||||
<!-- 筛选区 -->
|
||||
<div class="filter-block">
|
||||
@@ -179,6 +183,41 @@
|
||||
min-width="120"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="客户名称"
|
||||
min-width="240"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('planType')"
|
||||
prop="planType"
|
||||
label="单据类型"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlanTypeTagType(row.planType)" size="small">
|
||||
{{ getPlanTypeLabel(row.planType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('hazardCertReady')"
|
||||
label="证书齐备"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getHazardCertReadyTagType(row)" size="small">
|
||||
{{ getHazardCertReadyLabel(row) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productName')"
|
||||
label="产品名称"
|
||||
@@ -238,41 +277,6 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('customerName')"
|
||||
prop="customerName"
|
||||
label="客户名称"
|
||||
min-width="240"
|
||||
align="left"
|
||||
header-align="left"
|
||||
class-name="col-name-wrap"
|
||||
label-class-name="col-name-wrap"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('planType')"
|
||||
prop="planType"
|
||||
label="单据类型"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlanTypeTagType(row.planType)" size="small">
|
||||
{{ getPlanTypeLabel(row.planType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('hazardCertReady')"
|
||||
label="证书齐备"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getHazardCertReadyTagType(row)" size="small">
|
||||
{{ getHazardCertReadyLabel(row) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('followStatus')"
|
||||
prop="followStatus"
|
||||
@@ -409,9 +413,10 @@ import {
|
||||
getPlPlanFollowStatusLabel,
|
||||
getPlPlanFollowStatusTagType,
|
||||
normalizePlPersonnelSummaryDisplay,
|
||||
PL_PLAN_CERT_TABS,
|
||||
PL_PLAN_FOLLOW_STATUS_OPTIONS,
|
||||
plPlanTypeTabToFilter,
|
||||
type PlPlanTypeTab
|
||||
plPlanCertTabToFilters,
|
||||
type PlPlanCertTab
|
||||
} from '@/utils/pl-display'
|
||||
import { syncViewRowFromFlatList } from '@/utils/view-dialog-refresh'
|
||||
import { refreshMenuBadges } from '@/utils/menu-badge-registry'
|
||||
@@ -430,14 +435,14 @@ const planList = ref<Plan[]>([])
|
||||
|
||||
const listColumnDefs = [
|
||||
{ prop: 'planDate', label: '计划日期' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'hazardCertReady', label: '证书齐备' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'productSpec', label: '型号/规格' },
|
||||
{ prop: 'productQty', label: '数量' },
|
||||
{ prop: 'productUnit', label: '单位' },
|
||||
{ prop: 'planAttachments', label: '计划附件' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'planType', label: '单据类型' },
|
||||
{ prop: 'hazardCertReady', label: '证书齐备' },
|
||||
{ prop: 'followStatus', label: '跟进状态' },
|
||||
{ prop: 'licensePlate', label: '车牌号' },
|
||||
{ prop: 'personnelSummary', label: '人员' },
|
||||
@@ -457,13 +462,14 @@ const viewingPlan = ref<Plan | null>(null)
|
||||
const selectedPlan = computed(() => (selectedRows.value.length === 1 ? selectedRows.value[0] : null))
|
||||
const dateRange = ref<string[]>([])
|
||||
const quickSearch = ref('')
|
||||
const activePlanTypeTab = ref<PlPlanTypeTab>('all')
|
||||
const activePlanTypeTab = ref<PlPlanCertTab>('all')
|
||||
|
||||
const searchForm = reactive({
|
||||
planNo: '',
|
||||
planType: '',
|
||||
followStatus: '',
|
||||
customerName: ''
|
||||
customerName: '',
|
||||
certUploadStatus: '' as string
|
||||
})
|
||||
|
||||
const pagination = reactive({
|
||||
@@ -494,6 +500,8 @@ async function fetchData() {
|
||||
customerName: keyword ? undefined : searchForm.customerName || undefined,
|
||||
planDateFrom: dateRange.value?.[0] || undefined,
|
||||
planDateTo: dateRange.value?.[1] || undefined,
|
||||
hasHazardProduct: 1,
|
||||
certUploadStatus: searchForm.certUploadStatus || undefined,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
})
|
||||
@@ -510,8 +518,10 @@ function handleSearch() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function handlePlanTypeTabChange(tab: PlPlanTypeTab) {
|
||||
searchForm.planType = plPlanTypeTabToFilter(tab)
|
||||
function handlePlanTypeTabChange(tab: PlPlanCertTab | string) {
|
||||
const filters = plPlanCertTabToFilters(tab as PlPlanCertTab)
|
||||
searchForm.planType = filters.planType
|
||||
searchForm.certUploadStatus = filters.certUploadStatus || ''
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
@@ -522,6 +532,7 @@ function handleReset() {
|
||||
searchForm.planType = ''
|
||||
searchForm.followStatus = ''
|
||||
searchForm.customerName = ''
|
||||
searchForm.certUploadStatus = ''
|
||||
quickSearch.value = ''
|
||||
resetDateShortcut()
|
||||
pagination.page = 1
|
||||
@@ -665,6 +676,7 @@ useDbInstantSearch(
|
||||
planType: searchForm.planType,
|
||||
followStatus: searchForm.followStatus,
|
||||
customerName: searchForm.customerName,
|
||||
certUploadStatus: searchForm.certUploadStatus,
|
||||
dateRange: dateRange.value
|
||||
}),
|
||||
() => {
|
||||
|
||||
@@ -35,6 +35,23 @@
|
||||
v-model="searchForm.customerName"
|
||||
placeholder="搜索客户名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称">
|
||||
<el-input
|
||||
v-model="searchForm.productName"
|
||||
placeholder="搜索产品名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号">
|
||||
<el-input
|
||||
v-model="searchForm.licensePlate"
|
||||
placeholder="搜索车牌号"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期">
|
||||
@@ -74,7 +91,7 @@
|
||||
/>
|
||||
<ListQuickSearchInput
|
||||
v-model="quickSearch"
|
||||
placeholder="计划编号/客户名称"
|
||||
placeholder="计划编号/客户名称/产品名称/车牌号"
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
@@ -241,18 +258,19 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="spec" />
|
||||
<PlPlanListProductCell :products="row.products" field="model" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productQty')"
|
||||
label="数量"
|
||||
min-width="90"
|
||||
align="right"
|
||||
header-align="right"
|
||||
v-if="isColumnVisible('productPackageSpec')"
|
||||
label="包装规格"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="qty" />
|
||||
<PlPlanListProductCell :products="row.products" field="packageSpec" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -266,6 +284,28 @@
|
||||
<PlPlanListProductCell :products="row.products" field="unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productPlanQty')"
|
||||
label="计划数量"
|
||||
min-width="100"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="planQty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('productActualQty')"
|
||||
label="实际数量"
|
||||
min-width="100"
|
||||
align="right"
|
||||
header-align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<PlPlanListProductCell :products="row.products" field="actualQty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('planAttachments')"
|
||||
label="计划附件"
|
||||
@@ -502,8 +542,10 @@ const listColumnDefs = [
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'productSpec', label: '型号/规格' },
|
||||
{ prop: 'productQty', label: '数量' },
|
||||
{ prop: 'productPackageSpec', label: '包装规格' },
|
||||
{ prop: 'productUnit', label: '单位' },
|
||||
{ prop: 'productPlanQty', label: '计划数量' },
|
||||
{ prop: 'productActualQty', label: '实际数量' },
|
||||
{ prop: 'planAttachments', label: '计划附件' },
|
||||
{ prop: 'licensePlate', label: '车牌号' },
|
||||
{ prop: 'personnelSummary', label: '人员' },
|
||||
@@ -516,7 +558,7 @@ const {
|
||||
isIndeterminate,
|
||||
isColumnVisible,
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-plan-list-columns', listColumnDefs)
|
||||
} = usePersistedListColumns('pl-plan-list-columns-v2', listColumnDefs)
|
||||
|
||||
const selectedRows = ref<Plan[]>([])
|
||||
const viewingPlan = ref<Plan | null>(null)
|
||||
@@ -597,7 +639,9 @@ const searchForm = reactive({
|
||||
planNo: '',
|
||||
planType: '',
|
||||
followStatus: '',
|
||||
customerName: ''
|
||||
customerName: '',
|
||||
productName: '',
|
||||
licensePlate: ''
|
||||
})
|
||||
|
||||
const pagination = reactive({
|
||||
@@ -627,6 +671,8 @@ async function fetchData() {
|
||||
planType: searchForm.planType || undefined,
|
||||
followStatus: searchForm.followStatus || undefined,
|
||||
customerName: keyword ? undefined : searchForm.customerName || undefined,
|
||||
productName: keyword ? undefined : searchForm.productName || undefined,
|
||||
licensePlate: keyword ? undefined : searchForm.licensePlate || undefined,
|
||||
planDateFrom: dateRange.value?.[0] || undefined,
|
||||
planDateTo: dateRange.value?.[1] || undefined,
|
||||
page: pagination.page,
|
||||
@@ -657,6 +703,8 @@ function handleReset() {
|
||||
searchForm.planType = ''
|
||||
searchForm.followStatus = ''
|
||||
searchForm.customerName = ''
|
||||
searchForm.productName = ''
|
||||
searchForm.licensePlate = ''
|
||||
quickSearch.value = ''
|
||||
resetDateShortcut()
|
||||
pagination.page = 1
|
||||
@@ -666,6 +714,8 @@ function handleReset() {
|
||||
function handleQuickSearch() {
|
||||
searchForm.planNo = ''
|
||||
searchForm.customerName = ''
|
||||
searchForm.productName = ''
|
||||
searchForm.licensePlate = ''
|
||||
pagination.page = 1
|
||||
fetchData()
|
||||
}
|
||||
@@ -908,6 +958,8 @@ useDbInstantSearch(
|
||||
planType: searchForm.planType,
|
||||
followStatus: searchForm.followStatus,
|
||||
customerName: searchForm.customerName,
|
||||
productName: searchForm.productName,
|
||||
licensePlate: searchForm.licensePlate,
|
||||
dateRange: dateRange.value
|
||||
}),
|
||||
() => {
|
||||
|
||||
@@ -25,7 +25,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="承运商">
|
||||
<el-select v-model="searchForm.carrierId" placeholder="全部" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.carrierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -258,7 +267,16 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="承运商" prop="carrierId">
|
||||
<el-select v-model="formData.carrierId" placeholder="请选择承运商" filterable>
|
||||
<el-select
|
||||
v-model="formData.carrierId"
|
||||
placeholder="请选择承运商"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -309,7 +327,11 @@
|
||||
v-model="row.personnelId"
|
||||
placeholder="请选择人员"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
:remote-method="searchPersonnel"
|
||||
:loading="personnelSelectLoading"
|
||||
@focus="onPersonnelSelectFocus"
|
||||
@change="(id: string | undefined) => handlePersonnelSelect(row, id)"
|
||||
>
|
||||
<el-option
|
||||
@@ -441,8 +463,6 @@ import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { Check, Close, Delete, Edit, Plus, RefreshLeft, Search, Van } from '@element-plus/icons-vue'
|
||||
import {
|
||||
vehicleApi,
|
||||
personnelApi,
|
||||
carrierApi,
|
||||
type Vehicle,
|
||||
type VehicleDetail,
|
||||
type VehiclePersonnelRow,
|
||||
@@ -451,6 +471,10 @@ import {
|
||||
type Personnel,
|
||||
type Carrier
|
||||
} from '@/api/pl'
|
||||
import {
|
||||
usePlRemoteCarrierOptions,
|
||||
usePlRemotePersonnelOptions
|
||||
} from '@/composables/usePlRemoteOptions'
|
||||
import PlVehicleCertPartTabs from '@/components/business/pl-vehicle-cert-part-tabs/index.vue'
|
||||
import PlVehicleCertPersonnelTabs from '@/components/business/pl-vehicle-cert-personnel-tabs/index.vue'
|
||||
import PlVehicleCertBadges from '@/components/business/pl-vehicle-cert-badges/index.vue'
|
||||
@@ -462,7 +486,7 @@ import SystemViewDialog, {
|
||||
import { loadPersonnelWithCerts } from '@/composables/usePlVehicleViewDetail'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { useListMediaActive } from '@/composables/useListMediaActive'
|
||||
import { pickBxData, pickBxList, pickBxPageResult } from '@/utils/http/bx'
|
||||
import { pickBxData, pickBxPageResult } from '@/utils/http/bx'
|
||||
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import {
|
||||
@@ -500,7 +524,15 @@ const quickSearchKeyword = ref('')
|
||||
const submitLoading = ref(false)
|
||||
const dialogLoading = ref(false)
|
||||
const vehicleList = ref<Vehicle[]>([])
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const {
|
||||
list: carrierList,
|
||||
loading: carrierSelectLoading,
|
||||
search: searchCarriers,
|
||||
onFocus: onCarrierSelectFocus,
|
||||
ensureById: ensureSelectedCarrierOption
|
||||
} = usePlRemoteCarrierOptions({
|
||||
getSelectedId: () => formData.carrierId || searchForm.carrierId
|
||||
})
|
||||
|
||||
const listColumnDefs = [
|
||||
{ prop: 'photoUrls', label: '照片' },
|
||||
@@ -521,7 +553,18 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-self-vehicle-list-columns-v3', listColumnDefs)
|
||||
|
||||
const personnelOptions = ref<Personnel[]>([])
|
||||
const {
|
||||
list: personnelOptions,
|
||||
loading: personnelSelectLoading,
|
||||
search: searchPersonnel,
|
||||
onFocus: onPersonnelSelectFocus,
|
||||
invalidate: invalidatePersonnelOptions
|
||||
} = usePlRemotePersonnelOptions({
|
||||
listParams: () => ({
|
||||
status: '1',
|
||||
personnelAffiliation: 'self'
|
||||
})
|
||||
})
|
||||
const selectedRows = ref<Vehicle[]>([])
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
@@ -728,13 +771,12 @@ function resolvePersonnelRows(rows: VehiclePersonnelRow[]) {
|
||||
}
|
||||
|
||||
async function loadPersonnelOptions() {
|
||||
const res = await personnelApi.list({ status: '1', pageSize: 100, personnelAffiliation: 'self' })
|
||||
personnelOptions.value = pickBxList<Personnel>(res)
|
||||
invalidatePersonnelOptions()
|
||||
await searchPersonnel('')
|
||||
}
|
||||
|
||||
async function loadCarrierOptions() {
|
||||
const res = await carrierApi.list({ page: 1, pageSize: 100 })
|
||||
carrierList.value = pickBxList<Carrier>(res)
|
||||
await searchCarriers('')
|
||||
}
|
||||
|
||||
function handleAddPersonnel() {
|
||||
@@ -971,6 +1013,9 @@ async function handleEdit(row: Vehicle) {
|
||||
remark: detail.remark,
|
||||
photoUrls: detail.photoUrls || ''
|
||||
})
|
||||
if (formData.carrierId) {
|
||||
await ensureSelectedCarrierOption(formData.carrierId)
|
||||
}
|
||||
personnelList.value = resolvePersonnelRows(
|
||||
(detail.personnelList || []).map(p => ({
|
||||
...p,
|
||||
|
||||
@@ -259,20 +259,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
filterable
|
||||
placeholder="请选择车牌"
|
||||
style="width: 100%"
|
||||
@change="handleLicensePlateChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vehicleOptions"
|
||||
:key="item.id"
|
||||
:label="item.licensePlate"
|
||||
:value="item.licensePlate"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="维保类型" prop="maintenanceType">
|
||||
<el-select
|
||||
@@ -389,9 +380,11 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleMaintenanceApply
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -549,8 +542,14 @@ async function loadUserOptions() {
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const res = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(res)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const res = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(res)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function showMaintenanceReminders(licensePlate: string) {
|
||||
|
||||
@@ -322,20 +322,11 @@
|
||||
</el-form-item>
|
||||
<template v-if="dialogMode === 'supplement'">
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
filterable
|
||||
placeholder="请选择车牌"
|
||||
style="width: 100%"
|
||||
@change="handleLicensePlateChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vehicleOptions"
|
||||
:key="item.id"
|
||||
:label="item.licensePlate"
|
||||
:value="item.licensePlate"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="处理日期" prop="processDate">
|
||||
@@ -427,8 +418,10 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleMaintenanceProcessBoardItem
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -620,8 +613,14 @@ async function loadUserOptions() {
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const res = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(res)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const res = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(res)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function showMaintenanceReminders(licensePlate: string) {
|
||||
|
||||
@@ -240,9 +240,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select v-model="formData.licensePlate" filterable placeholder="请选择车牌" style="width: 100%">
|
||||
<el-option v-for="item in vehicleOptions" :key="item.id" :label="item.licensePlate" :value="item.licensePlate" />
|
||||
</el-select>
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
placeholder="请选择车牌"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值类型" prop="rechargeType">
|
||||
<el-select v-model="formData.rechargeType" placeholder="请选择" style="width: 100%">
|
||||
@@ -328,9 +329,11 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleRechargeApply
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -479,8 +482,14 @@ async function loadUserOptions() {
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const res = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(res)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const res = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(res)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
@@ -324,19 +324,10 @@
|
||||
</el-form-item>
|
||||
<template v-if="dialogMode === 'supplement'">
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
filterable
|
||||
placeholder="请选择车牌"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vehicleOptions"
|
||||
:key="item.id"
|
||||
:label="item.licensePlate"
|
||||
:value="item.licensePlate"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值类型" prop="rechargeType">
|
||||
<el-select v-model="formData.rechargeType" placeholder="请选择" style="width: 100%">
|
||||
@@ -439,8 +430,10 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleRechargeDisburseBoardItem
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -599,8 +592,14 @@ const viewSections = computed<ViewSection[]>(() => {
|
||||
})
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const vehicles = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(vehicles)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const vehicles = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(vehicles)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
@@ -244,9 +244,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select v-model="formData.licensePlate" filterable placeholder="请选择车牌" style="width: 100%">
|
||||
<el-option v-for="item in vehicleOptions" :key="item.id" :label="item.licensePlate" :value="item.licensePlate" />
|
||||
</el-select>
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
placeholder="请选择车牌"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请时间" prop="applyDate">
|
||||
<el-date-picker v-model="formData.applyDate" type="date" value-format="YYYY-MM-DD" style="width: 100%" />
|
||||
@@ -344,9 +345,11 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleUreaApply
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -499,8 +502,14 @@ async function loadUserOptions() {
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const res = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(res)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const res = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(res)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
@@ -300,19 +300,10 @@
|
||||
</el-form-item>
|
||||
<template v-if="dialogMode === 'supplement'">
|
||||
<el-form-item label="车牌号" prop="licensePlate">
|
||||
<el-select
|
||||
<PlVehicleSelect
|
||||
v-model="formData.licensePlate"
|
||||
filterable
|
||||
placeholder="请选择车牌"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vehicleOptions"
|
||||
:key="item.id"
|
||||
:label="item.licensePlate"
|
||||
:value="item.licensePlate"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="发放时间" prop="disburseDate">
|
||||
@@ -396,9 +387,11 @@ import {
|
||||
type Vehicle,
|
||||
type VehicleUreaDisburseBoardItem
|
||||
} from '@/api/pl'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlVehicleSelect from '@/components/business/pl/PlVehicleSelect.vue'
|
||||
import SystemViewDialog, { type ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import {
|
||||
@@ -583,8 +576,14 @@ async function loadUserOptions() {
|
||||
}
|
||||
|
||||
async function loadVehicleOptions() {
|
||||
const vehicles = await vehicleApi.list({ page: 1, pageSize: 100 })
|
||||
vehicleOptions.value = pickBxList(vehicles)
|
||||
try {
|
||||
vehicleOptions.value = await fetchAllPagedRecords<Vehicle>(async (page, pageSize) => {
|
||||
const vehicles = await vehicleApi.list({ page, pageSize })
|
||||
return pickBxPageResult<Vehicle>(vehicles)
|
||||
})
|
||||
} catch {
|
||||
vehicleOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
@@ -19,7 +19,16 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="承运商">
|
||||
<el-select v-model="searchForm.carrierId" placeholder="全部" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.carrierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -266,7 +275,16 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="承运商" prop="carrierId">
|
||||
<el-select v-model="formData.carrierId" placeholder="请选择承运商" filterable clearable>
|
||||
<el-select
|
||||
v-model="formData.carrierId"
|
||||
placeholder="请选择承运商"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
:remote-method="searchCarriers"
|
||||
:loading="carrierSelectLoading"
|
||||
@focus="onCarrierSelectFocus"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in carrierList"
|
||||
:key="c.id"
|
||||
@@ -318,7 +336,11 @@
|
||||
v-model="row.personnelId"
|
||||
placeholder="请选择人员"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
:remote-method="searchPersonnel"
|
||||
:loading="personnelSelectLoading"
|
||||
@focus="onPersonnelSelectFocus"
|
||||
@change="(id: string | undefined) => handlePersonnelSelect(row, id)"
|
||||
>
|
||||
<el-option
|
||||
@@ -459,7 +481,6 @@ import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { Check, Close, Delete, DocumentCopy, Edit, Plus, RefreshLeft, Search, Van } from '@element-plus/icons-vue'
|
||||
import {
|
||||
vehicleApi,
|
||||
carrierApi,
|
||||
personnelApi,
|
||||
type Vehicle,
|
||||
type VehicleDetail,
|
||||
@@ -469,6 +490,10 @@ import {
|
||||
type Carrier,
|
||||
type Personnel
|
||||
} from '@/api/pl'
|
||||
import {
|
||||
usePlRemoteCarrierOptions,
|
||||
usePlRemotePersonnelOptions
|
||||
} from '@/composables/usePlRemoteOptions'
|
||||
import PlVehicleCertPartTabs from '@/components/business/pl-vehicle-cert-part-tabs/index.vue'
|
||||
import PlVehicleCertPersonnelTabs from '@/components/business/pl-vehicle-cert-personnel-tabs/index.vue'
|
||||
import PlVehicleCertBadges from '@/components/business/pl-vehicle-cert-badges/index.vue'
|
||||
@@ -480,7 +505,7 @@ import SystemViewDialog, {
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { useListMediaActive } from '@/composables/useListMediaActive'
|
||||
import { pickBxData, pickBxList, pickBxPageResult } from '@/utils/http/bx'
|
||||
import { pickBxData, pickBxPageResult } from '@/utils/http/bx'
|
||||
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatPlVehiclePlateDisplay, normalizePlPersonnelSummaryDisplay } from '@/utils/pl-display'
|
||||
@@ -511,7 +536,15 @@ const dialogLoading = ref(false)
|
||||
/** 编辑回填中:跳过 vehicleType watch,避免证书被 ensure 覆盖清空 */
|
||||
const hydratingEdit = ref(false)
|
||||
const vehicleList = ref<Vehicle[]>([])
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const {
|
||||
list: carrierList,
|
||||
loading: carrierSelectLoading,
|
||||
search: searchCarriers,
|
||||
onFocus: onCarrierSelectFocus,
|
||||
ensureById: ensureSelectedCarrierOption
|
||||
} = usePlRemoteCarrierOptions({
|
||||
getSelectedId: () => formData.carrierId || searchForm.carrierId
|
||||
})
|
||||
|
||||
const listColumnDefs = [
|
||||
{ prop: 'photoUrls', label: '照片' },
|
||||
@@ -532,7 +565,23 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-vehicle-list-columns-v3', listColumnDefs)
|
||||
|
||||
const personnelOptions = ref<Personnel[]>([])
|
||||
const {
|
||||
list: personnelOptions,
|
||||
loading: personnelSelectLoading,
|
||||
search: searchPersonnel,
|
||||
onFocus: onPersonnelSelectFocus,
|
||||
invalidate: invalidatePersonnelOptions
|
||||
} = usePlRemotePersonnelOptions({
|
||||
listParams: () => ({
|
||||
status: '1',
|
||||
personnelAffiliation:
|
||||
formData.vehicleType === 'carrier'
|
||||
? 'carrier'
|
||||
: formData.vehicleType === 'self'
|
||||
? 'self'
|
||||
: undefined
|
||||
})
|
||||
})
|
||||
const selectedRows = ref<Vehicle[]>([])
|
||||
const dialogVisible = ref(false)
|
||||
const pasteVisible = ref(false)
|
||||
@@ -772,19 +821,12 @@ function resolvePersonnelRows(rows: VehiclePersonnelRow[]) {
|
||||
}
|
||||
|
||||
async function loadPersonnelOptions() {
|
||||
const affiliation =
|
||||
formData.vehicleType === 'carrier' ? 'carrier' : formData.vehicleType === 'self' ? 'self' : undefined
|
||||
const res = await personnelApi.list({
|
||||
status: '1',
|
||||
pageSize: 100,
|
||||
personnelAffiliation: affiliation
|
||||
})
|
||||
personnelOptions.value = pickBxList<Personnel>(res)
|
||||
invalidatePersonnelOptions()
|
||||
await searchPersonnel('')
|
||||
}
|
||||
|
||||
async function loadCarrierOptions() {
|
||||
const res = await carrierApi.list({ page: 1, pageSize: 100 })
|
||||
carrierList.value = pickBxList<Carrier>(res)
|
||||
await searchCarriers('')
|
||||
}
|
||||
|
||||
function handleAddPersonnel() {
|
||||
@@ -1019,6 +1061,9 @@ async function handleEdit(row: Vehicle) {
|
||||
remark: detail.remark,
|
||||
photoUrls: detail.photoUrls || ''
|
||||
})
|
||||
if (formData.carrierId) {
|
||||
await ensureSelectedCarrierOption(formData.carrierId)
|
||||
}
|
||||
personnelList.value = resolvePersonnelRows(
|
||||
(detail.personnelList || []).map(p => ({
|
||||
...p,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<van-loading v-if="loading" vertical class="page-loading">加载中...</van-loading>
|
||||
<van-empty v-else-if="errorMessage" :description="errorMessage" />
|
||||
<van-empty v-else-if="page?.archived" description="运输计划已归档完成" />
|
||||
<template v-else-if="page">
|
||||
<van-notice-bar
|
||||
v-if="isReadOnly"
|
||||
@@ -48,6 +49,7 @@
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="取货时间" :value="formatDateTime(page.pickupTime)" />
|
||||
<van-cell title="取货联系方式" :value="page.pickupContact || '—'" class="multiline-cell" />
|
||||
<van-cell title="注意事项" :value="page.pickupNotes || '—'" class="multiline-cell" />
|
||||
</van-cell-group>
|
||||
|
||||
@@ -69,7 +71,8 @@
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="送达时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell title="送货时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell title="送货联系方式" :value="page.deliveryContact || '—'" class="multiline-cell" />
|
||||
<van-cell title="注意事项" :value="page.destinationNotes || '—'" class="multiline-cell" />
|
||||
</van-cell-group>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<van-loading v-if="loading" vertical class="page-loading">加载中...</van-loading>
|
||||
<van-empty v-else-if="errorMessage" :description="errorMessage" />
|
||||
<van-empty v-else-if="page?.voided" description="运输计划已作废" />
|
||||
<van-empty v-else-if="page?.archived" description="运输计划已归档完成" />
|
||||
<template v-else-if="page">
|
||||
<van-cell-group inset class="section-card">
|
||||
<van-cell title="业务类型" :value="page.businessType || '—'" />
|
||||
@@ -35,6 +36,11 @@
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="取货时间" :value="formatDateTime(page.pickupTime)" />
|
||||
<van-cell
|
||||
title="取货联系方式"
|
||||
:value="page.pickupContact || '—'"
|
||||
class="multiline-cell"
|
||||
/>
|
||||
<van-cell
|
||||
title="注意事项"
|
||||
:value="page.pickupNotes || '—'"
|
||||
@@ -60,7 +66,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="送达时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell title="送货时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell
|
||||
title="送货联系方式"
|
||||
:value="page.deliveryContact || '—'"
|
||||
class="multiline-cell"
|
||||
/>
|
||||
<van-cell
|
||||
title="注意事项"
|
||||
:value="page.destinationNotes || '—'"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<van-loading v-if="loading" vertical class="page-loading">加载中...</van-loading>
|
||||
<van-empty v-else-if="errorMessage" :description="errorMessage" />
|
||||
<van-empty v-else-if="page?.planVoided" description="运输计划已作废" />
|
||||
<van-empty v-else-if="page?.planArchived" description="运输计划已归档完成" />
|
||||
<template v-else-if="page">
|
||||
<van-cell-group inset class="section-card">
|
||||
<van-cell title="计划编号" :value="page.planNo" />
|
||||
@@ -47,6 +48,11 @@
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="取货时间" :value="formatDateTime(page.pickupTime)" />
|
||||
<van-cell
|
||||
title="取货联系方式"
|
||||
:value="page.pickupContact || '—'"
|
||||
class="multiline-cell"
|
||||
/>
|
||||
<van-cell
|
||||
title="注意事项"
|
||||
:value="page.pickupNotes || '—'"
|
||||
@@ -72,7 +78,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="送达时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell title="送货时间" :value="formatDateTime(page.deliveryTime)" />
|
||||
<van-cell
|
||||
title="送货联系方式"
|
||||
:value="page.deliveryContact || '—'"
|
||||
class="multiline-cell"
|
||||
/>
|
||||
<van-cell
|
||||
title="注意事项"
|
||||
:value="page.destinationNotes || '—'"
|
||||
|
||||
Reference in new issue
Block a user