Commit 53e45829 authored by heduo's avatar heduo

Merge branch 'lmy' of http://119.78.67.12/git/root/ops_2024_vue into hd

parents d9605614 50ca4ee0
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import {
message,
} from 'ant-design-vue';
const config = import.meta.env
import {
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) => {
} 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)
sysid: record.sysid,
});
const res = await taskCenterRevokeExcelUploadApi(param.value);
if (res.code === 20000) {
message.success('操作成功')
getList()
message.success('操作成功');
getList();
} else {
message.error(res.message)
message.error(res.message);
}
}
const getList = async () => {
listLoading.value = true
const res = await taskCenterQueryListApi({type:0})
};
const getList = async () => {
listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 0 });
if (res.code === 20000) {
list.value = res.data
list.value = res.data;
} else {
list.value = []
list.value = [];
}
listLoading.value = false
}
listLoading.value = false;
};
</script>
<template>
......@@ -57,50 +60,60 @@ const getList = async () => {
style="margin-top: 15px"
>
<a-table-column title="操作时间" align="center" :width="100">
<template v-slot="{record}">
<template #default="{ record }">
{{ record.createTime }}
</template>
</a-table-column>
<a-table-column title="类型" align="center" :width="100">
<template v-slot="{record}">
<template #default="{ record }">
{{ record.type }}
</template>
</a-table-column>
<a-table-column title="状态" align="center" :width="100">
<template v-slot="{record}">
<p>{{ record.isRevoke ? '已撤销' : record.status == 0 ? '待进行':(record.status == 1 ? '进行中':'已完成') }}</p>
<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 v-slot="{record}">
<template #default="{ record }">
{{ record.sproductNumpec }}
</template>
</a-table-column>
<a-table-column title="成功数据" align="center" :width="100">
<template v-slot="{record}">
<template #default="{ record }">
{{ record.successNum }}
</template>
</a-table-column>
<a-table-column title="错误数据" align="center" :width="100">
<template v-slot="{record}">
<template #default="{ record }">
{{ record.failNum }}
</template>
</a-table-column>
<a-table-column title="操作人" align="center" :width="100">
<template v-slot="{record}">
<template #default="{ record }">
{{ record.createName }}
</template>
</a-table-column>
<a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}">
<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>
<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>
<style lang="less" scoped></style>
<script lang="ts" setup>
import { ref } from 'vue';
import uploadTask from './components/upLoadTask.vue'
import downLoadTask from './components/downLoadTask.vue'
import platformProBatch from './components/platformProBatch.vue'
const activeKey = ref('1')
const callback = (val) => {
activeKey.value = val
}
import { ref } from 'vue';
import uploadTask from './components/upLoadTask.vue';
import downLoadTask from './components/downLoadTask.vue';
import platformProBatch from './components/platformProBatch.vue';
const activeKey = ref('1');
const callback = (val) => {
activeKey.value = val;
};
</script>
<template>
<a-tabs @change="callback" v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="上传任务数据">
<uploadTask v-if="activeKey === '1'"></uploadTask>
<uploadTask v-if="activeKey === '1'" />
</a-tab-pane>
<a-tab-pane key="2" tab="下载任务数据" force-render>
<downLoadTask v-if="activeKey === '2'"></downLoadTask>
<downLoadTask v-if="activeKey === '2'" />
</a-tab-pane>
<a-tab-pane key="3" tab="平台商品批量">
<platformProBatch v-if="activeKey === '3'"></platformProBatch>
<platformProBatch v-if="activeKey === '3'" />
</a-tab-pane>
</a-tabs>
</template>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>
......@@ -52,6 +52,13 @@ declare global {
declare interface WheelEvent {
path?: EventTarget[];
}
interface ImportMeta {
env: {
VITE_GLOB_API_URL?: string;
};
}
interface ImportMetaEnv extends ViteEnv {
__: unknown;
}
......
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