应付配置文件导入保存该文件

This commit is contained in:
liuminghui
2026-11-05 10:31:02 +08:00
parent 51a89b18e1
commit 116b3b74e4
21 changed files with 557 additions and 31 deletions
+27 -3
View File
@@ -24,6 +24,11 @@
</el-col>
</template>
<template #col-sourceFile="{ row }">
<el-button v-if="row.filePath" link type="primary" @click="downloadSource(row)">{{ row.sourceFile }}</el-button>
<span v-else>{{ row.sourceFile || '-' }}</span>
</template>
<template #col-parseStatus="{ row }">
<el-tag :type="statusType(row.parseStatus)" size="small">{{ statusText(row.parseStatus) }}</el-tag>
</template>
@@ -56,7 +61,7 @@
<pay-import-dialog ref="importRef" @saved="tableRef.refresh()" />
<el-drawer v-model="historyVisible" :title="historyTitle" size="860px" destroy-on-close>
<el-drawer v-model="historyVisible" :title="historyTitle" size="980px" destroy-on-close>
<div class="history-bar">
<el-button type="primary" plain :disabled="historyPicked.length !== 2" @click="openCompare">比对所选版本</el-button>
<span>勾选两个版本后比对。历史订单按生效时间取价,不看当前开关。</span>
@@ -64,7 +69,12 @@
<el-table v-loading="historyLoading" :data="historyRows" border size="small" empty-text="还没有价格版本" @selection-change="onHistoryPick">
<el-table-column type="selection" width="42" align="center" />
<el-table-column prop="versionNo" label="版本" width="70" align="center" />
<el-table-column prop="sourceFile" label="来源文件" min-width="160" show-overflow-tooltip />
<el-table-column label="来源文件" min-width="160" show-overflow-tooltip>
<template #default="{ row }">
<el-button v-if="row.filePath" link type="primary" @click="downloadSource(row)">{{ row.sourceFile || '下载源文件' }}</el-button>
<span v-else>{{ row.sourceFile || '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="weightCount" label="重量段" width="80" align="center" />
<el-table-column prop="surchargeCount" label="附加费" width="80" align="center" />
<el-table-column label="生效开始" width="110" align="center">
@@ -88,8 +98,9 @@
/>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<el-table-column label="操作" width="210" align="center">
<template #default="{ row }">
<el-button link type="primary" @click="downloadSource(row)" v-hasPermi="['price:pay:query']">下载</el-button>
<el-button link type="primary" @click="openTermDialog(row)" v-hasPermi="['price:pay:edit']">修改有效期</el-button>
<el-button link type="primary" @click="openDetail(row)" v-hasPermi="['price:pay:query']">查看</el-button>
</template>
@@ -126,6 +137,7 @@
<el-drawer v-model="detailVisible" :title="detailTitle" size="78%" destroy-on-close>
<pay-config-detail v-loading="detailLoading" :product="detail" :editable="editing" />
<template #footer>
<el-button v-if="detail" @click="downloadSource(detail)" v-hasPermi="['price:pay:query']">下载源文件</el-button>
<el-button v-if="!editing" type="primary" @click="editing = true" v-hasPermi="['price:pay:import']">编辑</el-button>
<el-button v-else type="primary" :loading="saving" @click="saveDetail">保存</el-button>
<el-button @click="detailVisible = false">关闭</el-button>
@@ -229,6 +241,18 @@ function currentQuery() {
return query
}
function downloadSource(row) {
const id = row.versionProductId || row.productId
if (!id || !row.filePath) {
proxy.$modal.msgWarning('这一版导入时没有保存源文件,请重新导入后再下载')
return
}
proxy.download('/price/pay/' + id + '/source', {}, row.sourceFile || '价卡.xlsx', {
timeout: 120000,
headers: { repeatSubmit: false }
})
}
function handleExport() {
proxy.download('/price/pay/export', currentQuery(), `应付配置_${Date.now()}.xlsx`)
}