|
|
|
@ -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() { |
|
|
|
// 区域 |
|
|
|
// 区域 |
|
|
|
|