Commit aaa1adfc authored by limengyang's avatar limengyang

feat(lmy):0402优化

parent 53e45829
import { tmallabHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';
enum Api {
List = '/system/productNegotiated/getList',
BrandList = '/regionalSpotManage/commit',
GetStatus = '/system/opsProduct/IsOpsSupplier',
List = '/system/opsProduct/getList',
GroupList = '/system/opsProduct/getTypeList',
BrandList = '/system/supplierBrandQualification/getApproveList',
ProductList = '/system/productNegotiated/getProductList',
GetAreaList = '/system/opsProduct/getAreaList',
OpsAddProduct = '/system/opsProduct/opsAddProduct',
GetGhsAreaList = '/system/opsProduct/getGhsAreaList',
......@@ -16,71 +20,95 @@ enum Api {
/**
* @description: 区域现货管理列表
*/
export const regionalSpotManageListApi = (data) =>
tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message'});
export const regionalSpotManageGetStatusApi = () => tmallabHttp.post({ url: Api.GetStatus });
/**
* @description: 区域现货管理列表
*/
export const regionalSpotManageListApi = (data) =>
tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message' });
/**
* @description: 获取品牌列表
*/
export const regionalSpotManageBrandListApi = (data) =>
tmallabHttp.post({ url: Api.BrandList,data }, { errorMessageMode: 'message'});
export const regionalSpotManageBrandListApi = (data) =>
tmallabHttp.post({ url: Api.BrandList, data });
/**
* @description: 获取分组列表
*/
export const regionalSpotManageGroupListApi = (data) =>
tmallabHttp.post({ url: Api.GroupList, data });
/**
* @description: 获取左边穿梭框商品列表
*/
export const regionalSpotManageProductListApi = (data) =>
tmallabHttp.post({ url: Api.ProductList, data });
/**
* @description: 获取现货区域列表
*/
export const regionalSpotManageGetAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetAreaList,data },{ errorMessageMode: 'message' });
export const regionalSpotManageGetAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetAreaList, data });
/**
* @description: 新增商品接口
*/
export const regionalSpotManageOpsAddProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsAddProduct, data },{ errorMessageMode: 'message' });
export const regionalSpotManageOpsAddProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsAddProduct, data }, { errorMessageMode: 'message' });
/**
* @description: 获取已开通区域
*/
export const regionalSpotManageGetGhsAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetGhsAreaList, data },{ errorMessageMode: 'message' });
tmallabHttp.post({ url: Api.GetGhsAreaList, data });
/**
* @description: 单条/批量删除
*/
export const regionalSpotManageOpsDeleteProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsDeleteProduct, data },{ errorMessageMode: 'message' });
export const regionalSpotManageOpsDeleteProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsDeleteProduct, data }, { errorMessageMode: 'message' });
/**
* @description: 增加区域
*/
export const regionalSpotManageOpsEditProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsEditProduct, data },{ errorMessageMode: 'message' });
export const regionalSpotManageOpsEditProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsEditProduct, data }, { errorMessageMode: 'message' });
/**
* @description: 批量上传
*/
export const regionalSpotManageUploadOpsProductApi = (data) =>
tmallabHttp.post({ url: Api.UploadOpsProduct, data },{ errorMessageMode: 'message' });
tmallabHttp.post(
{
url: Api.UploadOpsProduct,
data,
headers: { 'Content-Type': ContentTypeEnum.FORM_DATA },
},
{ errorMessageMode: 'message' },
);
/**
* @description: 任务中心获取列表
*/
export const taskCenterQueryListApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data },{ errorMessageMode: 'message' });
export const taskCenterQueryListApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data }, { errorMessageMode: 'message' });
/**
* @description: 撤销
*/
export const taskCenterRevokeExcelUploadApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data },{ errorMessageMode: 'message' });
export const taskCenterRevokeExcelUploadApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data }, { errorMessageMode: 'message' });
/**
* @description: 任务中心获取列表--平台商品批量页签
*/
export const platformProBatchGetListApi = (data) =>
tmallabHttp.post({ url: Api.PlatformProBatchList, data },{ errorMessageMode: 'message' });
tmallabHttp.post({ url: Api.PlatformProBatchList, data }, { errorMessageMode: 'message' });
/**
* @description: 任务中心获取列表--平台商品批量页签--操作记录详情
*/
export const platformProBatchGetDetailApi = (data) =>
tmallabHttp.post({ url: Api.PlatformProBatchGetDetail, data },{ errorMessageMode: 'message' });
tmallabHttp.post({ url: Api.PlatformProBatchGetDetail, data }, { errorMessageMode: 'message' });
......@@ -69,5 +69,5 @@ span.anticon:not(.app-iconify) {
margin-left: 24px;
}
.ant-modal-body {
margin-top: 20px;
padding: 20px !important;
}
......@@ -41,7 +41,7 @@ async function bootstrap() {
app.use(Antd);
app.mount('#app');
app.use(Antd)
app.use(Antd);
}
bootstrap();
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
const config = import.meta.env
import {
taskCenterQueryListApi,
} from '/@/api/regionalSpotManage';
onMounted(async () => {
getList()
});
let list = ref<any[]>([])
let listLoading = ref(false)
const downLoad = (url) => {
window.open(config.VITE_GLOB_API_URL + '/system/' + url, '_blank')
}
const getList = async () => {
listLoading.value = true
const res = await taskCenterQueryListApi({type:1})
if (res.code === 20000) {
list.value = res.data
} else {
list.value = []
}
listLoading.value = false
}
</script>
<template>
<div>
<a-button @click="getList" type="primary">刷新数据</a-button>
</div>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="操作时间" align="center" :width="100">
<template v-slot="{record}">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="类型" align="center" :width="100">
<template v-slot="{record}">
{{ record.type }}
</template>
</a-table-column>
<a-table-column title="导出状态" align="center" :width="100">
<template v-slot="{record}">
<p>{{ record.status == 0 ? '待进行 ': (record.status == 1 ? '进行中' : '已完成') }}</p>
</template>
</a-table-column>
<a-table-column title="数据量" align="center" :width="100">
<template v-slot="{record}">
{{ record.successNum }}
</template>
</a-table-column>
<a-table-column title="操作人" align="center" :width="100">
<template v-slot="{record}">
{{ record.createName }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}">
<Button v-if="record.fileUrl" type="link" @click="downLoad(record.fileUrl)">下载文件</Button>
<span v-else>——</span>
</template>
</a-table-column>
</a-table>
</template>
<style lang="less" scoped>
</style>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
const config = import.meta.env;
import { taskCenterQueryListApi } from '/@/api/regionalSpotManage';
onMounted(async () => {
getList();
});
let list = ref<any[]>([]);
let listLoading = ref(false);
const downLoad = (url) => {
window.open(config.VITE_GLOB_API_URL + '/system/' + url, '_blank');
};
const getList = async () => {
listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 1 });
if (res.success) {
list.value = res.data;
} else {
list.value = [];
}
listLoading.value = false;
};
</script>
<template>
<div>
<a-button @click="getList" type="primary">刷新数据</a-button>
</div>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="操作时间" align="center" :width="100">
<template #default="{ record }">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="类型" align="center" :width="100">
<template #default="{ record }">
{{ record.type }}
</template>
</a-table-column>
<a-table-column title="导出状态" align="center" :width="100">
<template #default="{ record }">
<p>{{ record.status == 0 ? '待进行 ' : record.status == 1 ? '进行中' : '已完成' }}</p>
</template>
</a-table-column>
<a-table-column title="数据量" align="center" :width="100">
<template #default="{ record }">
{{ record.successNum }}
</template>
</a-table-column>
<a-table-column title="操作人" align="center" :width="100">
<template #default="{ record }">
{{ record.createName }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template #default="{ record }">
<Button v-if="record.fileUrl" type="link" @click="downLoad(record.fileUrl)"
>下载文件</Button
>
<span v-else>——</span>
</template>
</a-table-column>
</a-table>
</template>
<style lang="less" scoped></style>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { message } from 'ant-design-vue';
const config = import.meta.env;
import {
taskCenterQueryListApi,
taskCenterRevokeExcelUploadApi,
} from '/@/api/regionalSpotManage';
onMounted(async () => {
getList();
});
let list = ref<any[]>([]);
let listLoading = ref(false);
const downLoad = (url) => {
window.open(config.VITE_GLOB_API_URL + '/system/excelFile/' + url, '_blank');
};
const downloadFail = (record) => {
if (record.failNum === 0) return;
let href =
config.VITE_GLOB_API_URL +
'/excel/excelNew/fail/download?sysid=' +
record.sysid +
'&type=' +
record.type.slice(2, 6);
window.open(href, 'blank');
};
const cancel = async (record) => {
const param = ref<{ [key: string]: any }>({
sysid: record.sysid,
});
const res = await taskCenterRevokeExcelUploadApi(param.value);
if (res.code === 20000) {
message.success('操作成功');
getList();
} else {
message.error(res.message);
}
};
const getList = async () => {
listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 0 });
if (res.code === 20000) {
list.value = res.data;
} else {
list.value = [];
}
listLoading.value = false;
};
</script>
<template>
<div>
<a-button @click="getList" type="primary">刷新数据</a-button>
</div>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="操作时间" align="center" :width="100">
<template #default="{ record }">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="类型" align="center" :width="100">
<template #default="{ record }">
{{ record.type }}
</template>
</a-table-column>
<a-table-column title="状态" align="center" :width="100">
<template #default="{ record }">
<p>{{
record.isRevoke
? '已撤销'
: record.status == 0
? '待进行'
: record.status == 1
? '进行中'
: '已完成'
}}</p>
</template>
</a-table-column>
<a-table-column title="操作数据" align="center" :width="100">
<template #default="{ record }">
{{ record.sproductNumpec }}
</template>
</a-table-column>
<a-table-column title="成功数据" align="center" :width="100">
<template #default="{ record }">
{{ record.successNum }}
</template>
</a-table-column>
<a-table-column title="错误数据" align="center" :width="100">
<template #default="{ record }">
{{ record.failNum }}
</template>
</a-table-column>
<a-table-column title="操作人" align="center" :width="100">
<template #default="{ record }">
{{ record.createName }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template #default="{ record }">
<Button type="link" @click="downLoad(record.fileUrl)">下载源文件</Button>
<Button type="link" v-if="record.failNum" @click="downloadFail(record)"
>下载错误数据</Button
>
<Button type="link" v-if="record.status == 0 && !record.isRevoke" @click="cancel(record)"
>撤销</Button
>
</template>
</a-table-column>
</a-table>
</template>
<style lang="less" scoped></style>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { message } from 'ant-design-vue';
const config = import.meta.env;
import {
taskCenterQueryListApi,
taskCenterRevokeExcelUploadApi,
} from '/@/api/regionalSpotManage';
onMounted(async () => {
getList();
});
let list = ref<any[]>([]);
let listLoading = ref(false);
const downLoad = (url) => {
window.open(config.VITE_GLOB_API_URL + '/system/excelFile/' + url, '_blank');
};
const downloadFail = (record) => {
if (record.failNum === 0) return;
let href =
config.VITE_GLOB_API_URL +
'/excel/excelNew/fail/download?sysid=' +
record.sysid +
'&type=' +
record.type.slice(2, 6);
window.open(href, 'blank');
};
const cancel = async (record) => {
const param = ref<{ [key: string]: any }>({
sysid: record.sysid,
});
const res = await taskCenterRevokeExcelUploadApi(param.value);
if (res.success) {
message.success('操作成功');
getList();
} else {
message.error(res.message);
}
};
const getList = async () => {
listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 0 });
if (res.success) {
list.value = res.data;
} else {
list.value = [];
}
listLoading.value = false;
};
</script>
<template>
<div>
<a-button @click="getList" type="primary">刷新数据</a-button>
</div>
<a-table
:data-source="list"
:loading="listLoading"
bordered
:rowKey="(record) => record.sysid"
style="margin-top: 15px"
>
<a-table-column title="操作时间" align="center" :width="100">
<template #default="{ record }">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="类型" align="center" :width="100">
<template #default="{ record }">
{{ record.type }}
</template>
</a-table-column>
<a-table-column title="状态" align="center" :width="100">
<template #default="{ record }">
<p>{{
record.isRevoke
? '已撤销'
: record.status == 0
? '待进行'
: record.status == 1
? '进行中'
: '已完成'
}}</p>
</template>
</a-table-column>
<a-table-column title="操作数据" align="center" :width="100">
<template #default="{ record }">
{{ record.sproductNumpec }}
</template>
</a-table-column>
<a-table-column title="成功数据" align="center" :width="100">
<template #default="{ record }">
{{ record.successNum }}
</template>
</a-table-column>
<a-table-column title="错误数据" align="center" :width="100">
<template #default="{ record }">
{{ record.failNum }}
</template>
</a-table-column>
<a-table-column title="操作人" align="center" :width="100">
<template #default="{ record }">
{{ record.createName }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template #default="{ record }">
<Button type="link" @click="downLoad(record.fileUrl)">下载源文件</Button>
<Button type="link" v-if="record.failNum" @click="downloadFail(record)"
>下载错误数据</Button
>
<Button type="link" v-if="record.status == 0 && !record.isRevoke" @click="cancel(record)"
>撤销</Button
>
</template>
</a-table-column>
</a-table>
</template>
<style lang="less" scoped></style>
<script lang="ts" setup>
import ManageList from './components/list.vue';
</script>
<template>
<ManageList />
</template>
<style lang="less" scoped>
</style>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { regionalSpotManageGetStatusApi } from '/@/api/regionalSpotManage';
import ManageList from './components/list.vue';
const show = ref(false);
const loading = ref(false);
onMounted(async () => {
loading.value = true;
const res = await regionalSpotManageGetStatusApi().catch(() => (loading.value = false));
if (res.success) {
show.value = true;
}
loading.value = false;
});
</script>
<template>
<div>
<ManageList />
<!-- <a-spin v-if="loading" style="height: 150px; width: 100%; line-height: 150px" />
<ManageList v-if="show && !loading" />
<div v-if="!show && !loading" class="status">
<img src="../../assets/images/logo.png" alt="" srcset="" />
</div> -->
</div>
</template>
<style lang="less" scoped>
.status {
height: 100vh;
img {
width: 100%;
height: 100vh;
object-fit: contain;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment