1
This commit is contained in:
@@ -169,11 +169,33 @@ export function delJDOrder(ids) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 导入跟团返现 Excel(multipart,不用统一 request 以免 Content-Type 覆盖) */
|
||||
// 后返表上传记录列表
|
||||
export function listGroupRebateExcelUploads(query) {
|
||||
return request({
|
||||
url: '/system/jdorder/groupRebateUpload/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/** 导入跟团返现 Excel(multipart) */
|
||||
export function importGroupRebateExcel(formData) {
|
||||
return axios
|
||||
.post(process.env.VUE_APP_BASE_API + '/system/jdorder/importGroupRebateExcel', formData, {
|
||||
headers: { Authorization: 'Bearer ' + getToken() }
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 全局 axios.defaults 为 application/json,会覆盖 multipart;必须去掉由浏览器自动带 boundary
|
||||
transformRequest: [
|
||||
(data, headers) => {
|
||||
if (data instanceof FormData) {
|
||||
if (headers && typeof headers.delete === 'function') {
|
||||
headers.delete('Content-Type')
|
||||
} else if (headers) {
|
||||
delete headers['Content-Type']
|
||||
}
|
||||
}
|
||||
return data
|
||||
}
|
||||
]
|
||||
})
|
||||
.then((res) => {
|
||||
const d = res.data
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
<el-button type="warning" size="small" icon="el-icon-sort" @click="handleReverseSyncThirdPartyOrderNo" :loading="reverseSyncLoading" title="从腾讯文档第850行开始,通过物流链接反向匹配订单,将腾讯文档的单号列值写入到订单的第三方单号字段">反向同步第三方单号</el-button>
|
||||
<el-button v-if="!isMobile" type="primary" size="small" icon="el-icon-document-copy" @click="handleBatchCopyExcelText" :disabled="selectedRows.length === 0" title="批量复制选中订单的录单格式(Excel可粘贴)">批量复制录单格式</el-button>
|
||||
<el-button v-if="!isMobile" type="primary" size="small" icon="el-icon-upload2" @click="rebateImportDialogVisible = true" title="上传跟团返现等 Excel,按单号写入后返备注(可多次导入累加)">导入后返表</el-button>
|
||||
<el-button v-if="!isMobile" type="info" size="small" icon="el-icon-folder-opened" @click="openRebateUploadRecordDialog" title="查看历史上传的后返表原件并可重新下载">后返上传记录</el-button>
|
||||
<el-button v-if="!isMobile" type="success" size="small" icon="el-icon-document-copy" @click="handleBatchCopyRebateText" :disabled="selectedRows.length === 0" title="批量复制选中订单的后返录表格式(Excel可粘贴)">批量复制后返录表</el-button>
|
||||
<el-button v-if="!isMobile" type="info" size="small" icon="el-icon-document-copy" @click="handleBatchCopySichuanCommerceText" :disabled="selectedRows.length === 0" title="批量复制选中订单的四川商贸录表格式(日期 型号 数量 地址 价格 备注 是否安排 物流)">四川商贸录表</el-button>
|
||||
</div>
|
||||
@@ -914,11 +915,57 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 后返表上传记录(含重新下载) -->
|
||||
<el-dialog
|
||||
title="后返表上传记录"
|
||||
:visible.sync="rebateUploadRecordDialogVisible"
|
||||
width="960px"
|
||||
append-to-body
|
||||
@open="fetchRebateUploadList"
|
||||
>
|
||||
<el-table v-loading="rebateUploadLoading" :data="rebateUploadList" border size="small" max-height="420">
|
||||
<el-table-column label="ID" prop="id" width="70" />
|
||||
<el-table-column label="文档标题" prop="documentTitle" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="原始文件名" prop="originalFilename" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="大小" width="88" align="right">
|
||||
<template slot-scope="scope">{{ formatUploadFileSize(scope.row.fileSize) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.importStatus === 2" type="success" size="mini">已处理</el-tag>
|
||||
<el-tag v-else type="info" size="mini">未成功</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据行" prop="dataRows" width="72" align="center" />
|
||||
<el-table-column label="更新订单" prop="updatedOrders" width="88" align="center" />
|
||||
<el-table-column label="未匹配" prop="notFoundCount" width="72" align="center" />
|
||||
<el-table-column label="上传人" prop="createBy" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="时间" prop="createTime" width="155" />
|
||||
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="!scope.row.filePath"
|
||||
@click="downloadRebateUploadFile(scope.row)"
|
||||
>下载</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="rebateUploadTotal > 0"
|
||||
:total="rebateUploadTotal"
|
||||
:page.sync="rebateUploadQuery.pageNum"
|
||||
:limit.sync="rebateUploadQuery.pageSize"
|
||||
@pagination="fetchRebateUploadList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listJDOrders, updateJDOrder, delJDOrder, fetchLogisticsManually, batchMarkRebateReceived, generateExcelText, importGroupRebateExcel } from '@/api/system/jdorder'
|
||||
import { listJDOrders, updateJDOrder, delJDOrder, fetchLogisticsManually, batchMarkRebateReceived, generateExcelText, importGroupRebateExcel, listGroupRebateExcelUploads } from '@/api/system/jdorder'
|
||||
import { fillLogisticsByOrderNo, getTokenStatus, getTencentDocAuthUrl, testUserInfo, getAutoWriteConfig, reverseSyncThirdPartyOrderNo } from '@/api/jarvis/tendoc'
|
||||
import { mapGetters } from 'vuex'
|
||||
import ListLayout from '@/components/ListLayout'
|
||||
@@ -973,6 +1020,14 @@ export default {
|
||||
rebateImportDialogVisible: false,
|
||||
rebateImportTitle: '',
|
||||
rebateImportLoading: false,
|
||||
rebateUploadRecordDialogVisible: false,
|
||||
rebateUploadLoading: false,
|
||||
rebateUploadList: [],
|
||||
rebateUploadTotal: 0,
|
||||
rebateUploadQuery: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
// 同步物流对话框
|
||||
syncLogisticsDialogVisible: false,
|
||||
syncLogisticsLoading: false,
|
||||
@@ -1267,8 +1322,12 @@ export default {
|
||||
importGroupRebateExcel(formData)
|
||||
.then((res) => {
|
||||
const data = res.data || {}
|
||||
const msg = data.message || res.msg || '导入完成'
|
||||
const msg = data.message || res.msg || (data.success === false ? '导入未完成' : '导入完成')
|
||||
if (data.success === false) {
|
||||
this.$message.warning(msg)
|
||||
} else {
|
||||
this.$message.success(msg)
|
||||
}
|
||||
const nf = data.notFoundOrderNos
|
||||
if (nf && nf.length) {
|
||||
const sample = nf.slice(0, 30).join(', ')
|
||||
@@ -1289,6 +1348,31 @@ export default {
|
||||
this.rebateImportLoading = false
|
||||
})
|
||||
},
|
||||
openRebateUploadRecordDialog() {
|
||||
this.rebateUploadQuery.pageNum = 1
|
||||
this.rebateUploadRecordDialogVisible = true
|
||||
},
|
||||
fetchRebateUploadList() {
|
||||
this.rebateUploadLoading = true
|
||||
listGroupRebateExcelUploads(this.rebateUploadQuery).then(res => {
|
||||
this.rebateUploadList = res.rows || []
|
||||
this.rebateUploadTotal = res.total || 0
|
||||
}).finally(() => {
|
||||
this.rebateUploadLoading = false
|
||||
})
|
||||
},
|
||||
formatUploadFileSize(n) {
|
||||
if (n == null || n === '') return '-'
|
||||
const x = Number(n)
|
||||
if (Number.isNaN(x) || x < 0) return '-'
|
||||
if (x < 1024) return `${x} B`
|
||||
if (x < 1024 * 1024) return `${(x / 1024).toFixed(1)} KB`
|
||||
return `${(x / 1024 / 1024).toFixed(2)} MB`
|
||||
},
|
||||
downloadRebateUploadFile(row) {
|
||||
const name = row.originalFilename || `rebate_upload_${row.id}.xlsx`
|
||||
this.download(`/system/jdorder/groupRebateUpload/download/${row.id}`, {}, name)
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
|
||||
Reference in New Issue
Block a user