feat(web-admin): 承运商去审核 UI 并移除安排运输准入拦截
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4eed1183b5
commit
fd62043f71
5 files changed
+9
-173
No files matched your search
@@ -24,13 +24,6 @@
|
||||
<el-option label="已终止" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态">
|
||||
<el-select v-model="searchForm.auditStatus" placeholder="全部" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已通过" value="approved" />
|
||||
<el-option label="已驳回" value="rejected" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions">
|
||||
<div class="filter-actions-end">
|
||||
@@ -67,14 +60,6 @@
|
||||
>
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
:disabled="selectedRows.length !== 1 || !canApproveCarrier(selectedRows[0])"
|
||||
:loading="selectedRows.length === 1 && auditLoadingMap[selectedRows[0].id]"
|
||||
@click="handleToolbarApprove"
|
||||
>
|
||||
<el-icon><Select /></el-icon>审核通过
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
@@ -157,19 +142,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('auditStatus')"
|
||||
label="审核状态"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlCarrierAuditStatusTagType(row.auditStatus)" size="small">
|
||||
{{ getPlCarrierAuditStatusLabel(row.auditStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('qualificationHint')"
|
||||
label="资质提示"
|
||||
@@ -322,14 +294,6 @@
|
||||
<el-button class="btn-main" type="primary" @click="handleEdit(viewingRow)">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canApproveCarrier(viewingRow)"
|
||||
class="btn-ghost"
|
||||
:loading="auditLoadingMap[viewingRow.id]"
|
||||
@click="handleApprove(viewingRow)"
|
||||
>
|
||||
<el-icon><Select /></el-icon>审核通过
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
@@ -345,7 +309,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Check, Close, Delete, Edit, Plus, RefreshLeft, Search, Select } from '@element-plus/icons-vue'
|
||||
import { Check, Close, Delete, Edit, Plus, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { carrierApi, type Carrier } from '@/api/pl'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import PlCarrierViewDialog from '@/components/business/pl-carrier-view-dialog/index.vue'
|
||||
@@ -356,11 +320,6 @@ import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { pickBxPageResult } from '@/utils/http/bx'
|
||||
import { DEFAULT_LIST_PAGE_SIZE } from '@/utils/table/tableConfig'
|
||||
import { canDeleteByCreator, filterDeletableByCreator, allRowsDeletableByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
|
||||
import {
|
||||
getPlCarrierAuditStatusLabel,
|
||||
getPlCarrierAuditStatusTagType
|
||||
} from '@/utils/pl-display'
|
||||
|
||||
const loading = ref(false)
|
||||
const quickSearchKeyword = ref('')
|
||||
|
||||
@@ -368,7 +327,6 @@ const listColumnDefs = [
|
||||
{ prop: 'contactName', label: '联系人' },
|
||||
{ prop: 'contactPhone', label: '联系电话' },
|
||||
{ prop: 'status', label: '合作状态' },
|
||||
{ prop: 'auditStatus', label: '审核状态' },
|
||||
{ prop: 'qualificationHint', label: '资质提示' },
|
||||
{ prop: 'transportAgreementExpireDate', label: '协议有效期' },
|
||||
{ prop: 'remark', label: '备注', defaultVisible: false }
|
||||
@@ -383,7 +341,6 @@ const {
|
||||
} = usePersistedListColumns('pl-carrier-list-columns', listColumnDefs)
|
||||
|
||||
const submitLoading = ref(false)
|
||||
const auditLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const selectedRows = ref<Carrier[]>([])
|
||||
const dialogVisible = ref(false)
|
||||
@@ -400,8 +357,7 @@ const viewDialogRef = ref<InstanceType<typeof PlCarrierViewDialog>>()
|
||||
|
||||
const searchForm = reactive({
|
||||
q: '',
|
||||
status: '',
|
||||
auditStatus: ''
|
||||
status: ''
|
||||
})
|
||||
|
||||
const pagination = reactive({
|
||||
@@ -490,7 +446,6 @@ async function fetchData() {
|
||||
const res = await carrierApi.list({
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
status: searchForm.status || undefined,
|
||||
auditStatus: searchForm.auditStatus || undefined,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
})
|
||||
@@ -513,7 +468,6 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.q = ''
|
||||
searchForm.status = ''
|
||||
searchForm.auditStatus = ''
|
||||
quickSearchKeyword.value = ''
|
||||
selectedRows.value = []
|
||||
pagination.page = 1
|
||||
@@ -540,10 +494,6 @@ function handleSizeChange() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
function canApproveCarrier(row: Carrier) {
|
||||
return row.auditStatus !== 'approved' && row.qualificationComplete
|
||||
}
|
||||
|
||||
function syncViewingRowFromList() {
|
||||
if (!viewingRow.value?.id) return
|
||||
const updated = carrierList.value.find(row => row.id === viewingRow.value!.id)
|
||||
@@ -556,27 +506,6 @@ async function refreshViewIfOpen() {
|
||||
await viewDialogRef.value?.reload()
|
||||
}
|
||||
|
||||
async function handleApprove(row: Carrier) {
|
||||
if (!canApproveCarrier(row)) {
|
||||
ElMessage.warning('承运商资质不完整,无法审核通过')
|
||||
return
|
||||
}
|
||||
await ElMessageBox.confirm(
|
||||
`确认审核通过承运商「${row.carrierName}」?通过后其车辆可用于运输安排。`,
|
||||
'审核确认',
|
||||
{ type: 'info', confirmButtonText: '审核通过', cancelButtonText: '取消' }
|
||||
)
|
||||
auditLoadingMap[row.id] = true
|
||||
try {
|
||||
await carrierApi.approve(row.id)
|
||||
ElMessage.success('审核通过')
|
||||
await fetchData()
|
||||
await refreshViewIfOpen()
|
||||
} finally {
|
||||
auditLoadingMap[row.id] = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSelectionChange(rows: Carrier[]) {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
@@ -589,14 +518,6 @@ function handleToolbarEdit() {
|
||||
handleEdit(selectedRows.value[0])
|
||||
}
|
||||
|
||||
function handleToolbarApprove() {
|
||||
if (selectedRows.value.length !== 1) {
|
||||
ElMessage.warning('请选择一条承运商')
|
||||
return
|
||||
}
|
||||
handleApprove(selectedRows.value[0])
|
||||
}
|
||||
|
||||
function handleToolbarDelete() {
|
||||
if (selectedRows.value.length !== 1) {
|
||||
ElMessage.warning('请选择一条承运商')
|
||||
@@ -707,7 +628,7 @@ async function handleDelete(row: Carrier) {
|
||||
}
|
||||
|
||||
useDbInstantSearch(
|
||||
() => ({ q: searchForm.q, status: searchForm.status, auditStatus: searchForm.auditStatus }),
|
||||
() => ({ q: searchForm.q, status: searchForm.status }),
|
||||
handleSearch
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user