增加导入附件的查看记录
This commit is contained in:
@@ -277,3 +277,12 @@ export async function downloadChargeWeightTemplate(data, filename) {
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
|
||||
/** 批量修改计费重导入附件记录 */
|
||||
export function listChargeWeightImportAttachments(query) {
|
||||
return request({
|
||||
url: '/price/billing/bill/chargeWeight/import/attachments',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
<span class="err-text">{{ detail.errorMessage }}</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div v-if="failRows.length" class="json-panel">
|
||||
<div class="json-panel__head"><span>失败明细(共 {{ failRows.length }} 单)</span></div>
|
||||
<el-table :data="failRows" border size="small" max-height="280" class="fail-table">
|
||||
<el-table-column label="订单号" prop="orderId" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="转单号" prop="transferOrderId" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="错误信息" prop="errorMessage" min-width="220" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="json-panel">
|
||||
<div class="json-panel__head"><span>请求报文</span></div>
|
||||
<pre class="code-pre">{{ formatJson(detail.requestJson) }}</pre>
|
||||
@@ -74,7 +82,7 @@ const searchColumns = [
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{ label: '操作', prop: 'actionName', width: 120, slot: 'actionName' },
|
||||
{ label: '操作', prop: 'actionName', width: 150, slot: 'actionName' },
|
||||
{ label: '业务ID', prop: 'bizId', minWidth: 180, showOverflowTooltip: true },
|
||||
{ label: '状态', prop: 'status', align: 'center', width: 90, slot: 'status' },
|
||||
{ label: '写入时间', prop: 'updateTime', align: 'center', width: 170 },
|
||||
@@ -93,12 +101,41 @@ function parseReq(row) {
|
||||
function actionLabel(row) {
|
||||
const action = parseReq(row).action
|
||||
if (action === 'FILTER') return '筛选同步'
|
||||
if (action === 'FILTER_DONE') return '筛选完成'
|
||||
if (action === 'SELECTED') return '同步选中'
|
||||
if (action === 'FILTER_DONE') {
|
||||
return row.status === 'FAIL' ? '筛选完成(有失败)' : '筛选完成'
|
||||
}
|
||||
if (action === 'SELECTED') {
|
||||
return row.status === 'FAIL' ? '同步选中(有失败)' : '同步选中'
|
||||
}
|
||||
if (action === 'ONE') return '单条同步'
|
||||
if (action === 'ONE_FAIL') return '同步失败'
|
||||
return action || '-'
|
||||
}
|
||||
|
||||
const failRows = computed(() => {
|
||||
if (!detail.value) return []
|
||||
const resp = parseResp(detail.value)
|
||||
if (Array.isArray(resp.failDetails) && resp.failDetails.length) {
|
||||
return resp.failDetails
|
||||
}
|
||||
if (Array.isArray(resp.details) && resp.details.length) {
|
||||
return resp.details.filter(d => {
|
||||
const st = d && d.successStatus
|
||||
return st && String(st).toUpperCase() !== 'SUCCESS'
|
||||
})
|
||||
}
|
||||
return []
|
||||
})
|
||||
|
||||
function parseResp(row) {
|
||||
if (!row || !row.responseJson) return {}
|
||||
try {
|
||||
return typeof row.responseJson === 'object' ? row.responseJson : JSON.parse(row.responseJson)
|
||||
} catch (e) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
function queryList(params) {
|
||||
return listOrderSourceSyncLog(params)
|
||||
}
|
||||
@@ -143,6 +180,9 @@ defineExpose({ open })
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.fail-table {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.code-pre {
|
||||
margin: 0;
|
||||
padding: 10px 12px;
|
||||
|
||||
@@ -95,6 +95,15 @@
|
||||
@click="openChargeWeightImport"
|
||||
>批量修改计费重</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Document"
|
||||
v-hasPermi="['price:billing:chargeWeightEdit']"
|
||||
@click="openChargeWeightImportAttach"
|
||||
>导入记录</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<template #col-action="{ row }">
|
||||
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
|
||||
@@ -151,6 +160,7 @@
|
||||
<div class="cw-fill-hint">勾选后下载模板会写入筛选结果的订单号、客户代码;人工修改计费重列留空待填</div>
|
||||
</template>
|
||||
</excel-import-dialog>
|
||||
<charge-weight-import-attach-drawer ref="cwImportAttachRef" />
|
||||
<el-dialog
|
||||
v-model="cwImportProgressVisible"
|
||||
title="正在导入修改计费重"
|
||||
@@ -181,6 +191,7 @@ import BillDetail from './components/BillDetail.vue'
|
||||
import BatchAddIncomeFeeDialog from './components/BatchAddIncomeFeeDialog.vue'
|
||||
import EditChargeWeightDialog from './components/EditChargeWeightDialog.vue'
|
||||
import ExcelImportDialog from '@/components/ExcelImportDialog'
|
||||
import ChargeWeightImportAttachDrawer from './components/ChargeWeightImportAttachDrawer.vue'
|
||||
|
||||
// 订单号下拉远程搜索:返回匹配的订单号列表(最多 20 条)
|
||||
function searchOrderNoOptions(keyword) {
|
||||
@@ -218,6 +229,7 @@ const refundingKey = ref(null)
|
||||
const editCwOpen = ref(false)
|
||||
const editCwRow = ref(null)
|
||||
const chargeWeightImportRef = ref()
|
||||
const cwImportAttachRef = ref()
|
||||
const chargeWeightImportDesc = [
|
||||
'模板列:订单号、客户、人工修改计费重(kg)',
|
||||
'客户可填名称或代码,须与订单客户一致',
|
||||
@@ -440,6 +452,10 @@ async function downloadChargeWeightImportTemplate() {
|
||||
await downloadChargeWeightTemplate(payload)
|
||||
}
|
||||
|
||||
function openChargeWeightImportAttach() {
|
||||
cwImportAttachRef.value?.open?.()
|
||||
}
|
||||
|
||||
function openChargeWeightImport() {
|
||||
cwFillByFilter.value = false
|
||||
chargeWeightImportRef.value?.open?.()
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<el-drawer v-model="visible" size="860px" :title="drawerTitle" append-to-body destroy-on-close>
|
||||
<basic-table
|
||||
v-if="visible"
|
||||
:columns="columns"
|
||||
:search-columns="searchColumns"
|
||||
:query="queryList"
|
||||
row-key="attachmentId"
|
||||
:page-size="10"
|
||||
:selection="false"
|
||||
:show-add="false"
|
||||
>
|
||||
<template #col-fileSize="{ row }">
|
||||
{{ formatSize(row.fileSize) }}
|
||||
</template>
|
||||
<template #col-action="{ row }">
|
||||
<el-button link type="primary" :disabled="!row.filePath" @click="handleDownload(row)">下载</el-button>
|
||||
</template>
|
||||
</basic-table>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { listChargeWeightImportAttachments } from '@/api/price/billing'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const visible = ref(false)
|
||||
const drawerTitle = '批量修改计费重导入记录'
|
||||
|
||||
const searchColumns = [
|
||||
{ label: '文件名', prop: 'fileName', component: 'input', placeholder: '文件名', width: '200px' },
|
||||
{ label: '上传人', prop: 'createBy', component: 'input', placeholder: '上传人', width: '140px' }
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{ label: '文件名称', prop: 'fileName', minWidth: 220, showOverflowTooltip: true },
|
||||
{ label: '任务ID', prop: 'bizId', minWidth: 180, showOverflowTooltip: true },
|
||||
{ label: '大小', prop: 'fileSize', width: 100, align: 'right', slot: 'fileSize' },
|
||||
{ label: '上传人', prop: 'createBy', width: 110, align: 'center', showOverflowTooltip: true },
|
||||
{ label: '上传时间', prop: 'createTime', width: 170, align: 'center' },
|
||||
{ label: '操作', prop: 'action', width: 90, align: 'center', fixed: 'right', slot: 'action', showInToolbar: false }
|
||||
]
|
||||
|
||||
function queryList(params) {
|
||||
return listChargeWeightImportAttachments(params)
|
||||
}
|
||||
|
||||
function formatSize(bytes) {
|
||||
const n = Number(bytes)
|
||||
if (!n || n < 0) return '-'
|
||||
if (n < 1024) return n + ' B'
|
||||
if (n < 1024 * 1024) return (n / 1024).toFixed(1) + ' KB'
|
||||
return (n / (1024 * 1024)).toFixed(2) + ' MB'
|
||||
}
|
||||
|
||||
function handleDownload(row) {
|
||||
if (!row || !row.filePath) {
|
||||
proxy.$modal.msgWarning('文件路径不存在')
|
||||
return
|
||||
}
|
||||
proxy.$download.resource(row.filePath)
|
||||
}
|
||||
|
||||
function open() {
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
Reference in New Issue
Block a user