|
@@ -6,17 +6,17 @@
|
|
|
v-model="visible"
|
|
v-model="visible"
|
|
|
>
|
|
>
|
|
|
<div class="flex mb-2">
|
|
<div class="flex mb-2">
|
|
|
- <div class="text-sm">请先下载'图书基础数据导入模板':</div>
|
|
|
|
|
|
|
+ <div class="text-sm">请先下载'IP 营销书单导入模板':</div>
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="
|
|
@click="
|
|
|
downloadOssLink(
|
|
downloadOssLink(
|
|
|
- 'https://shuhi.oss-cn-qingdao.aliyuncs.com/default/book_info_export_template.xlsx',
|
|
|
|
|
- '图书基础数据导入模板'
|
|
|
|
|
|
|
+ 'https://shuhi.oss-cn-qingdao.aliyuncs.com/default/upsell_book_isbn_template.xlsx',
|
|
|
|
|
+ 'IP 营销书单导入模板'
|
|
|
)
|
|
)
|
|
|
"
|
|
"
|
|
|
link
|
|
link
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- >下载图书基础数据导入模板</el-button
|
|
|
|
|
|
|
+ >下载IP 营销书单导入模板</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -26,10 +26,10 @@
|
|
|
<div class="text-sm">2.导入文件属性值不存在或者超长,会自动过滤掉</div>
|
|
<div class="text-sm">2.导入文件属性值不存在或者超长,会自动过滤掉</div>
|
|
|
<div class="text-sm mb-2">3.导入文件第一行需与模版完全一致</div>
|
|
<div class="text-sm mb-2">3.导入文件第一行需与模版完全一致</div>
|
|
|
|
|
|
|
|
- <el-radio-group v-model="coverImport">
|
|
|
|
|
- <el-radio :value="1">相同ISBN覆盖导入</el-radio>
|
|
|
|
|
- <el-radio :value="0">相同ISBN忽略导入</el-radio>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
|
+ <!-- <el-radio-group v-model="coverImport">
|
|
|
|
|
+ <el-radio :value="1">相同ISBN覆盖导入</el-radio>
|
|
|
|
|
+ <el-radio :value="0">相同ISBN忽略导入</el-radio>
|
|
|
|
|
+ </el-radio-group> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div v-loading="loading" class="user-import-upload">
|
|
<div v-loading="loading" class="user-import-upload">
|
|
|
<el-upload
|
|
<el-upload
|
|
@@ -58,13 +58,9 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, h } from 'vue';
|
|
import { ref, h } from 'vue';
|
|
|
- import { genFileId } from 'element-plus';
|
|
|
|
|
- import { ElMessageBox } from 'element-plus/es';
|
|
|
|
|
- import { EleMessage } from 'ele-admin-plus/es';
|
|
|
|
|
- import { CloudUploadOutlined } from '@/components/icons';
|
|
|
|
|
|
|
+ import { genFileId,ElMessage } from 'element-plus';
|
|
|
import { downloadOssLink } from '@/utils/common';
|
|
import { downloadOssLink } from '@/utils/common';
|
|
|
import request from '@/utils/request';
|
|
import request from '@/utils/request';
|
|
|
-
|
|
|
|
|
const emit = defineEmits(['done']);
|
|
const emit = defineEmits(['done']);
|
|
|
|
|
|
|
|
/** 弹窗是否打开 */
|
|
/** 弹窗是否打开 */
|
|
@@ -89,13 +85,16 @@
|
|
|
async function importBooks(file) {
|
|
async function importBooks(file) {
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
|
formData.append('file', file);
|
|
formData.append('file', file);
|
|
|
- formData.append('coverImport', coverImport.value);
|
|
|
|
|
|
|
+ // formData.append('coverImport', coverImport.value);
|
|
|
|
|
|
|
|
- const res = await request.post('/book/bookInfo/import', formData);
|
|
|
|
|
|
|
+ const res = await request.post('/activity/activityUpsellBook/activity/upsell/book/import', formData);
|
|
|
|
|
+ console.log(res);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
return res.data.msg;
|
|
return res.data.msg;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ ElMessage.error(res.data.msg);
|
|
|
|
|
+ return Promise.reject(new Error(res.data.msg));
|
|
|
}
|
|
}
|
|
|
- return Promise.reject(new Error(res.data.msg));
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 提交 */
|
|
/** 提交 */
|