售后导入
This commit is contained in:
@@ -4,9 +4,9 @@ VITE_NODE_ENV=development
|
|||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||||
# VITE_BASE_URL='http://114.215.207.150:48080'
|
# VITE_BASE_URL='http://114.215.207.150:48080'
|
||||||
# VITE_BASE_URL='http://localhost:48080'
|
VITE_BASE_URL='http://localhost:48080'
|
||||||
|
|
||||||
# 高德地图key密钥
|
# 高德地图key密钥
|
||||||
# 1寻驾
|
# 1寻驾
|
||||||
|
|||||||
@@ -37,3 +37,12 @@ export const cancelApplyAfterSale = async (data) => {
|
|||||||
export const getAfterSaleDetail = async (params) => {
|
export const getAfterSaleDetail = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/get', params })
|
return await request.get({ url: '/admin-api/crm/sign-after-sale/get', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导入
|
||||||
|
export const importAfterSales = async (data) => {
|
||||||
|
return await request.upload({ url: '/admin-api/crm/sign-after-sale/importAfterSales', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getAfterSalesTemplate = async () => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/sign-after-sale/get-import-template' })
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ const service: AxiosInstance = axios.create({
|
|||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config: InternalAxiosRequestConfig) => {
|
(config: InternalAxiosRequestConfig) => {
|
||||||
if (config.url?.startsWith('/out-api')) {
|
if (config.url?.startsWith('/out-api')) {
|
||||||
debugger
|
|
||||||
config.baseURL = ''
|
config.baseURL = ''
|
||||||
}
|
}
|
||||||
// 是否需要设置 token
|
// 是否需要设置 token
|
||||||
|
|||||||
@@ -113,6 +113,20 @@
|
|||||||
<el-button @click="batchAudit" v-hasPermi="['clue:order:after-sale-batch-audit']">
|
<el-button @click="batchAudit" v-hasPermi="['clue:order:after-sale-batch-audit']">
|
||||||
批量审核
|
批量审核
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button @click="downloadTemplateFile"> 下载模板 </el-button>
|
||||||
|
<el-upload
|
||||||
|
ref="salaryFile"
|
||||||
|
action="#"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-file-list="false"
|
||||||
|
style="margin-left: 10px; height: 32px"
|
||||||
|
:before-upload="fileBeforeUpload"
|
||||||
|
:http-request="afterSalesUpload"
|
||||||
|
:disabled="uploading"
|
||||||
|
>
|
||||||
|
<el-button type="primary"> 导入 </el-button>
|
||||||
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -237,6 +251,7 @@ import DialogBatchAudit from './DialogBatchAudit.vue'
|
|||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
|
||||||
const afterSaleAuditDialog = ref()
|
const afterSaleAuditDialog = ref()
|
||||||
|
|
||||||
@@ -333,6 +348,38 @@ function handleAudit(row) {
|
|||||||
afterSaleAuditDialog.value.open(row)
|
afterSaleAuditDialog.value.open(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function downloadTemplateFile() {
|
||||||
|
let data = await AfterSaleApi.getAfterSalesTemplate()
|
||||||
|
download.excel(data, '售后模板.xls')
|
||||||
|
}
|
||||||
|
|
||||||
|
const fileBeforeUpload = (file) => {
|
||||||
|
let format = '.' + file.name.split('.')[1]
|
||||||
|
if (!['.xls', '.xlsx'].includes(format)) {
|
||||||
|
message.error(`请上传指定格式".xls,.xlsx"文件`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let isRightSize = file.size / 1024 / 1024 < 20
|
||||||
|
if (!isRightSize) {
|
||||||
|
message.error('文件大小超过 20MB')
|
||||||
|
}
|
||||||
|
return isRightSize
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploading = ref(false)
|
||||||
|
async function afterSalesUpload(data) {
|
||||||
|
uploading.value = true
|
||||||
|
const fd = new FormData()
|
||||||
|
fd.append('file', data.file)
|
||||||
|
try {
|
||||||
|
await AfterSaleApi.importAfterSales(fd)
|
||||||
|
message.success('导入成功')
|
||||||
|
} finally {
|
||||||
|
uploading.value = false
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const areaOptions = ref([])
|
const areaOptions = ref([])
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
// 区域
|
// 区域
|
||||||
|
|||||||
@@ -225,7 +225,6 @@ async function getList() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
let params = { ...removeNullField(searchForm.value) }
|
let params = { ...removeNullField(searchForm.value) }
|
||||||
|
|
||||||
const data = await getClueRemarkPage(params)
|
const data = await getClueRemarkPage(params)
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
|
|||||||
Reference in New Issue
Block a user