feat(pl): 增加百链充值类型,并保留计划产品与证件上传时间。
充值单号按类型使用 ETC、YK、SX、BL 前缀;更换装货客户清空产品时不抹掉已有计划产品;运输证件列表展示上传时间。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
af8d4d90fa
commit
cc5cf78bcd
21 files changed
+274
-97
No files matched your search
@@ -9,8 +9,12 @@
|
||||
v-model="keyword"
|
||||
placeholder="编号"
|
||||
@search="search"
|
||||
@clear="search" /><label class="cert-expiry-switch" @click.prevent="expiringSoon = !expiringSoon"
|
||||
><el-switch :model-value="expiringSoon" /><span>近7日到期({{ expiringCount }}个)</span></label
|
||||
@clear="search" /><label
|
||||
class="cert-expiry-switch"
|
||||
@click.prevent="expiringSoon = !expiringSoon"
|
||||
><el-switch :model-value="expiringSoon" /><span
|
||||
>近7日到期({{ expiringCount }}个)</span
|
||||
></label
|
||||
><span class="list-toolbar-selected">共 {{ filteredRows.length }} 张</span
|
||||
><el-button v-if="canEdit" class="btn-main" type="primary" @click="edit()"
|
||||
><el-icon><Plus /></el-icon>新增证件</el-button
|
||||
@@ -41,7 +45,7 @@
|
||||
:key="column.prop"
|
||||
:prop="column.prop"
|
||||
:label="column.label"
|
||||
:min-width="column.type === 'text' ? 190 : 140"
|
||||
:min-width="column.prop === 'createTime' ? 170 : column.type === 'text' ? 190 : 140"
|
||||
><template #header
|
||||
><div class="col-header-with-filter"
|
||||
><span class="col-header-with-filter__label">{{ column.label }}</span>
|
||||
@@ -70,10 +74,15 @@
|
||||
><span v-else-if="column.type === 'number'">{{
|
||||
qtyText(row[column.prop], row.quantityUnit)
|
||||
}}</span
|
||||
><el-tag v-else-if="column.prop === 'expiryAlert' && expiryText(row)" type="danger" size="small">{{
|
||||
expiryText(row)
|
||||
}}</el-tag
|
||||
><el-tag
|
||||
v-else-if="column.prop === 'expiryAlert' && expiryText(row)"
|
||||
type="danger"
|
||||
size="small"
|
||||
>{{ expiryText(row) }}</el-tag
|
||||
><span v-else-if="column.prop === 'expiryAlert'">—</span
|
||||
><span v-else-if="column.prop === 'createTime'">{{
|
||||
formatDateTime(row.createTime) || '—'
|
||||
}}</span
|
||||
><span v-else>{{ row[column.prop] || '—' }}</span></template
|
||||
></el-table-column
|
||||
><el-table-column label="操作" min-width="320" fixed="right"
|
||||
@@ -266,7 +275,10 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<p
|
||||
v-if="group.fields.some((field) => field[0] === 'vehicleNumbersJson') && lockedPlates.length"
|
||||
v-if="
|
||||
group.fields.some((field) => field[0] === 'vehicleNumbersJson') &&
|
||||
lockedPlates.length
|
||||
"
|
||||
class="form-tip"
|
||||
>
|
||||
已有车号不能删除,只能追加。保存后证件仍可安排运输。
|
||||
@@ -397,49 +409,51 @@
|
||||
type="danger"
|
||||
title="移除引用"
|
||||
aria-label="移除引用"
|
||||
:disabled="saving || form.referencesEditable === false || referenceRowLocked(row)"
|
||||
:disabled="
|
||||
saving || form.referencesEditable === false || referenceRowLocked(row)
|
||||
"
|
||||
@click="removeReference(index)"
|
||||
><el-icon><Delete /></el-icon
|
||||
></el-button>
|
||||
</header>
|
||||
<div class="form-grid-2 cert-reference-fields">
|
||||
<el-form-item label="引用类型">
|
||||
<el-select
|
||||
v-model="row.referenceType"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
@change="edited.add('purchaseRefs')"
|
||||
>
|
||||
<el-option
|
||||
v-for="(label, value) in refLabels"
|
||||
:key="value"
|
||||
:value="value"
|
||||
:label="label"
|
||||
<el-form-item label="引用类型">
|
||||
<el-select
|
||||
v-model="row.referenceType"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
@change="edited.add('purchaseRefs')"
|
||||
>
|
||||
<el-option
|
||||
v-for="(label, value) in refLabels"
|
||||
:key="value"
|
||||
:value="value"
|
||||
:label="label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="purchasePermitLabel">
|
||||
<el-input
|
||||
v-model="row.referenceNo"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
@input="edited.add('purchaseRefs')"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="purchasePermitLabel">
|
||||
<el-input
|
||||
v-model="row.referenceNo"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
@input="edited.add('purchaseRefs')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对应购买证档案">
|
||||
<el-select
|
||||
v-model="row.purchaseCertId"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
filterable
|
||||
clearable
|
||||
@change="onPurchaseArchiveChange(row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in purchases"
|
||||
:key="c.id"
|
||||
:value="c.id"
|
||||
:label="c.certNo"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="对应购买证档案">
|
||||
<el-select
|
||||
v-model="row.purchaseCertId"
|
||||
:disabled="saving || referenceRowLocked(row)"
|
||||
filterable
|
||||
clearable
|
||||
@change="onPurchaseArchiveChange(row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="c in purchases"
|
||||
:key="c.id"
|
||||
:value="c.id"
|
||||
:label="c.certNo"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
@@ -595,18 +609,11 @@
|
||||
|
||||
import QuotaHistoryDialog from './QuotaHistoryDialog.vue'
|
||||
const historyDialog = ref<InstanceType<typeof QuotaHistoryDialog>>()
|
||||
import {
|
||||
Check,
|
||||
Close,
|
||||
Connection,
|
||||
Delete,
|
||||
Document,
|
||||
Edit,
|
||||
Plus
|
||||
} from '@element-plus/icons-vue'
|
||||
import { Check, Close, Connection, Delete, Document, Edit, Plus } from '@element-plus/icons-vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { getProductUnitLabel } from '@/utils/crm-product-display'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { randomOperationId } from '@/utils/random-id'
|
||||
import { fetchGetMenuCodes } from '@/api/auth'
|
||||
import {
|
||||
@@ -1131,9 +1138,7 @@
|
||||
return row?.certType === 'transport' || row?.certType === 'purchase' ? row.certType : kind.value
|
||||
}
|
||||
function plateList(value: unknown) {
|
||||
return Array.isArray(value)
|
||||
? value.map((item) => String(item).trim()).filter(Boolean)
|
||||
: []
|
||||
return Array.isArray(value) ? value.map((item) => String(item).trim()).filter(Boolean) : []
|
||||
}
|
||||
function plateLocked(plate: string) {
|
||||
return lockedPlates.value.includes(plate)
|
||||
@@ -1529,7 +1534,9 @@
|
||||
form.value.contractBindings = next
|
||||
}
|
||||
function referenceRowLocked(row: { id?: string; purchaseCertId?: string | null }) {
|
||||
return form.value.referencesEditable === false && !!row.id && linkedRefIds.value.includes(row.id)
|
||||
return (
|
||||
form.value.referencesEditable === false && !!row.id && linkedRefIds.value.includes(row.id)
|
||||
)
|
||||
}
|
||||
function onPurchaseArchiveChange() {
|
||||
edited.add('purchaseRefs')
|
||||
@@ -1678,10 +1685,17 @@
|
||||
enumOptions: Object.entries(statusLabels).map(([value, label]) => ({ value, label }))
|
||||
},
|
||||
...qtyColumns.map((c) => ({ prop: c.key, label: c.label, type: 'number' as const })),
|
||||
{ prop: 'validTo', label: '有效期限止', type: 'datetime' }
|
||||
{ prop: 'validTo', label: '有效期限止', type: 'datetime' },
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '上传时间',
|
||||
type: 'datetime' as const,
|
||||
getValue: (row: { createTime?: string | null }) =>
|
||||
String(row.createTime || '').replace('T', ' ')
|
||||
}
|
||||
]
|
||||
const { visibleColumns, checkAll, isIndeterminate, resetToDefault } = usePersistedListColumns(
|
||||
'pl-quota-cert-columns-v3',
|
||||
'pl-quota-cert-columns-v4',
|
||||
listColumnDefs
|
||||
)
|
||||
const visibleDefs = computed(() =>
|
||||
@@ -1704,7 +1718,9 @@
|
||||
() => columnRows.value.filter((row) => expiryWarning(row.validTo)).length
|
||||
)
|
||||
const filteredRows = computed(() =>
|
||||
expiringSoon.value ? columnRows.value.filter((row) => expiryWarning(row.validTo)) : columnRows.value
|
||||
expiringSoon.value
|
||||
? columnRows.value.filter((row) => expiryWarning(row.validTo))
|
||||
: columnRows.value
|
||||
)
|
||||
const pageRows = computed(() => filteredRows.value.slice((page.value - 1) * 20, page.value * 20))
|
||||
function search() {
|
||||
|
||||
@@ -3,7 +3,8 @@ import type { ColumnFilterDef } from '@/composables/useClientColumnFilters'
|
||||
const RECHARGE_TYPE_OPTIONS = [
|
||||
{ value: 'etc', label: 'ETC' },
|
||||
{ value: 'fuel', label: '油卡' },
|
||||
{ value: 'shanxia', label: '山峡' }
|
||||
{ value: 'shanxia', label: '山峡' },
|
||||
{ value: 'bailian', label: '百链' }
|
||||
]
|
||||
|
||||
const RECHARGE_STATUS_OPTIONS = [
|
||||
|
||||
@@ -372,6 +372,7 @@
|
||||
<el-option label="ETC" value="etc" />
|
||||
<el-option label="油卡" value="fuel" />
|
||||
<el-option label="山峡" value="shanxia" />
|
||||
<el-option label="百链" value="bailian" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formFuelCard.show.value" label="绑定油卡卡号">
|
||||
@@ -767,7 +768,7 @@ const formData = reactive({
|
||||
applyNo: '',
|
||||
applicantId: '',
|
||||
licensePlate: '',
|
||||
rechargeType: 'etc' as 'etc' | 'fuel' | 'shanxia',
|
||||
rechargeType: 'etc' as 'etc' | 'fuel' | 'shanxia' | 'bailian',
|
||||
applyDate: '',
|
||||
odometerKm: null as number | null,
|
||||
attachmentUrls: '',
|
||||
|
||||
@@ -463,6 +463,7 @@
|
||||
<el-option label="ETC" value="etc" />
|
||||
<el-option label="油卡" value="fuel" />
|
||||
<el-option label="山峡" value="shanxia" />
|
||||
<el-option label="百链" value="bailian" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -779,7 +780,7 @@ const formData = reactive({
|
||||
rechargeOrderNo: '',
|
||||
applyId: '',
|
||||
licensePlate: '',
|
||||
rechargeType: 'etc' as 'etc' | 'fuel' | 'shanxia',
|
||||
rechargeType: 'etc' as 'etc' | 'fuel' | 'shanxia' | 'bailian',
|
||||
rechargeDate: '',
|
||||
cardNo: '',
|
||||
gasStation: '',
|
||||
|
||||
Reference in new issue
Block a user