Commit aaa1adfc authored by limengyang's avatar limengyang

feat(lmy):0402优化

parent 53e45829
import { tmallabHttp } from '/@/utils/http/axios'; import { tmallabHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';
enum Api { enum Api {
List = '/system/productNegotiated/getList', GetStatus = '/system/opsProduct/IsOpsSupplier',
BrandList = '/regionalSpotManage/commit', List = '/system/opsProduct/getList',
GroupList = '/system/opsProduct/getTypeList',
BrandList = '/system/supplierBrandQualification/getApproveList',
ProductList = '/system/productNegotiated/getProductList',
GetAreaList = '/system/opsProduct/getAreaList', GetAreaList = '/system/opsProduct/getAreaList',
OpsAddProduct = '/system/opsProduct/opsAddProduct', OpsAddProduct = '/system/opsProduct/opsAddProduct',
GetGhsAreaList = '/system/opsProduct/getGhsAreaList', GetGhsAreaList = '/system/opsProduct/getGhsAreaList',
...@@ -13,74 +17,98 @@ enum Api { ...@@ -13,74 +17,98 @@ enum Api {
PlatformProBatchGetDetail = '/system/logNegotiationProductOperate/getList', PlatformProBatchGetDetail = '/system/logNegotiationProductOperate/getList',
} }
/**
* @description: 区域现货管理列表
*/
export const regionalSpotManageGetStatusApi = () => tmallabHttp.post({ url: Api.GetStatus });
/** /**
* @description: 区域现货管理列表 * @description: 区域现货管理列表
*/ */
export const regionalSpotManageListApi = (data) => export const regionalSpotManageListApi = (data) =>
tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message'}); tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message' });
/** /**
* @description: 获取品牌列表 * @description: 获取品牌列表
*/ */
export const regionalSpotManageBrandListApi = (data) => export const regionalSpotManageBrandListApi = (data) =>
tmallabHttp.post({ url: Api.BrandList,data }, { errorMessageMode: 'message'}); 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: 获取现货区域列表 * @description: 获取现货区域列表
*/ */
export const regionalSpotManageGetAreaListApi = (data) => export const regionalSpotManageGetAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetAreaList,data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.GetAreaList, data });
/** /**
* @description: 新增商品接口 * @description: 新增商品接口
*/ */
export const regionalSpotManageOpsAddProductApi = (data) => export const regionalSpotManageOpsAddProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsAddProduct, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.OpsAddProduct, data }, { errorMessageMode: 'message' });
/** /**
* @description: 获取已开通区域 * @description: 获取已开通区域
*/ */
export const regionalSpotManageGetGhsAreaListApi = (data) => export const regionalSpotManageGetGhsAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetGhsAreaList, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.GetGhsAreaList, data });
/** /**
* @description: 单条/批量删除 * @description: 单条/批量删除
*/ */
export const regionalSpotManageOpsDeleteProductApi = (data) => export const regionalSpotManageOpsDeleteProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsDeleteProduct, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.OpsDeleteProduct, data }, { errorMessageMode: 'message' });
/** /**
* @description: 增加区域 * @description: 增加区域
*/ */
export const regionalSpotManageOpsEditProductApi = (data) => export const regionalSpotManageOpsEditProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsEditProduct, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.OpsEditProduct, data }, { errorMessageMode: 'message' });
/** /**
* @description: 批量上传 * @description: 批量上传
*/ */
export const regionalSpotManageUploadOpsProductApi = (data) => 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: 任务中心获取列表 * @description: 任务中心获取列表
*/ */
export const taskCenterQueryListApi = (data) => export const taskCenterQueryListApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.RevokeExcelUpload, data }, { errorMessageMode: 'message' });
/** /**
* @description: 撤销 * @description: 撤销
*/ */
export const taskCenterRevokeExcelUploadApi = (data) => export const taskCenterRevokeExcelUploadApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.RevokeExcelUpload, data }, { errorMessageMode: 'message' });
/** /**
* @description: 任务中心获取列表--平台商品批量页签 * @description: 任务中心获取列表--平台商品批量页签
*/ */
export const platformProBatchGetListApi = (data) => export const platformProBatchGetListApi = (data) =>
tmallabHttp.post({ url: Api.PlatformProBatchList, data },{ errorMessageMode: 'message' }); tmallabHttp.post({ url: Api.PlatformProBatchList, data }, { errorMessageMode: 'message' });
/** /**
* @description: 任务中心获取列表--平台商品批量页签--操作记录详情 * @description: 任务中心获取列表--平台商品批量页签--操作记录详情
*/ */
export const platformProBatchGetDetailApi = (data) => 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) { ...@@ -69,5 +69,5 @@ span.anticon:not(.app-iconify) {
margin-left: 24px; margin-left: 24px;
} }
.ant-modal-body { .ant-modal-body {
margin-top: 20px; padding: 20px !important;
} }
...@@ -41,7 +41,7 @@ async function bootstrap() { ...@@ -41,7 +41,7 @@ async function bootstrap() {
app.use(Antd); app.use(Antd);
app.mount('#app'); app.mount('#app');
app.use(Antd) app.use(Antd);
} }
bootstrap(); bootstrap();
...@@ -6,18 +6,19 @@ ...@@ -6,18 +6,19 @@
const emit = defineEmits(['close']); const emit = defineEmits(['close']);
import { import {
regionalSpotManageBrandListApi, regionalSpotManageBrandListApi,
regionalSpotManageProductListApi,
regionalSpotManageGetAreaListApi, regionalSpotManageGetAreaListApi,
regionalSpotManageOpsAddProductApi, regionalSpotManageOpsAddProductApi,
} from '/@/api/regionalSpotManage'; } from '/@/api/regionalSpotManage';
import { getAuthCache } from '/@/utils/auth'; import { getAuthCache } from '/@/utils/auth';
const userInfo: any = getAuthCache('USER__INFO__'); const userInfo: any = getAuthCache('USER__INFO__');
const ghsCode = userInfo.supplier.ghsCode; const ghsCode = userInfo.supplier.ghsCode;
let searchBrand = ref(''); const searchBrand = ref('');
let searchItemNo = ref(''); const searchItemNo = ref('');
let searchBrandList = ref<any[]>([]); const searchBrandList = ref<any[]>([]);
const handleSearch = async (value) => { const handleSearch = async (value) => {
const res = await regionalSpotManageBrandListApi({ brand: value }); const res = await regionalSpotManageBrandListApi({ brand: value });
if (res.code === 20000) { if (res.success) {
searchBrandList.value = res.data; searchBrandList.value = res.data;
} else { } else {
searchBrandList.value = []; searchBrandList.value = [];
...@@ -26,11 +27,11 @@ ...@@ -26,11 +27,11 @@
const closeModal = () => { const closeModal = () => {
emit('close', false); emit('close', false);
}; };
const leftLoading = ref(false);
const leftData = ref<any[]>([]); const leftData = ref<any[]>([]);
const leftColumns = [ const leftColumns = [
{ {
title: '商品名称', title: '商品名称',
dataIndex: 'productName',
key: 'productName', key: 'productName',
width: '25%', width: '25%',
align: 'center', align: 'center',
...@@ -58,53 +59,29 @@ ...@@ -58,53 +59,29 @@
getLeftData(); getLeftData();
}, },
}); });
const getLeftData = () => { const reset = () => {
leftData.value = [ searchBrand.value = '';
{ searchItemNo.value = '';
productName: '测试产品1', pagination.value.current = 1;
brand: '测试品牌1', getLeftData();
goodsNo: '213651', };
spec: '100ml', const getLeftData = async () => {
sysid: '1', const param = {
}, pageIndex: pagination.value.current,
{ pageSize: pagination.value.pageSize,
productName: '测试产品2', ghsCode: ghsCode,
brand: '测试品牌2', productName: '',
goodsNo: '213652', brand: searchBrand.value,
spec: '100ml', goodsNo: searchItemNo.value,
sysid: '2', };
}, leftLoading.value = true;
{ const res = await regionalSpotManageProductListApi(param);
productName: '测试产品3', if (res.success) {
brand: '测试品牌3', leftData.value = res.data;
goodsNo: '213653', } else {
spec: '100ml', leftData.value = [];
sysid: '3', }
}, leftLoading.value = false;
{
productName: '测试产品4',
brand: '测试品牌4',
goodsNo: '213654',
spec: '100ml',
sysid: '4',
},
{
productName: '测试产品5',
brand: '测试品牌5',
goodsNo: '213655',
spec: '100ml',
sysid: '5',
choice: true,
},
{
productName: '测试产品6',
brand: '测试品牌6',
goodsNo: '213656',
spec: '100ml',
sysid: '6',
choice: true,
},
];
if (rightData.value.length > 0) { if (rightData.value.length > 0) {
for (let i = 0; i < rightData.value.length; i++) { for (let i = 0; i < rightData.value.length; i++) {
if ( if (
...@@ -125,8 +102,8 @@ ...@@ -125,8 +102,8 @@
leftData.value = [...leftData.value]; leftData.value = [...leftData.value];
pagination.value.total = leftData.value.length; pagination.value.total = leftData.value.length;
}; };
let selectedRowKeys = ref<any[]>([]); const selectedRowKeys = ref<any[]>([]);
let selectedRows = ref<any[]>([]); const selectedRows = ref<any[]>([]);
const rowSelection = computed(() => { const rowSelection = computed(() => {
return { return {
selectedRowKeys: selectedRowKeys.value, selectedRowKeys: selectedRowKeys.value,
...@@ -140,7 +117,6 @@ ...@@ -140,7 +117,6 @@
}; };
}); });
const toRight = () => { const toRight = () => {
console.log(selectedRows.value);
let arr = JSON.parse(JSON.stringify(selectedRows.value)); let arr = JSON.parse(JSON.stringify(selectedRows.value));
rightData.value = [...arr, ...rightData.value]; rightData.value = [...arr, ...rightData.value];
for (let i = 0; i < selectedRows.value.length; i++) { for (let i = 0; i < selectedRows.value.length; i++) {
...@@ -227,14 +203,14 @@ ...@@ -227,14 +203,14 @@
const rowClassName = () => { const rowClassName = () => {
return 'table-back'; return 'table-back';
}; };
let loading = ref(false); const loading = ref(false);
let addressLoading = ref(false); const addressLoading = ref(false);
const goNext = async () => { const goNext = async () => {
if (!rightData.value.length) return message.error('请先选择商品'); if (!rightData.value.length) return message.error('请先选择商品');
addressVisible.value = true; addressVisible.value = true;
addressLoading.value = true; addressLoading.value = true;
const res = await regionalSpotManageGetAreaListApi({}); const res = await regionalSpotManageGetAreaListApi({});
if (res.code === 20000) { if (res.success) {
areaList.value = res.data; areaList.value = res.data;
} else { } else {
areaList.value = []; areaList.value = [];
...@@ -245,53 +221,16 @@ ...@@ -245,53 +221,16 @@
const confirmLoading = ref(false); const confirmLoading = ref(false);
const addressVisible = ref(false); const addressVisible = ref(false);
const checkboxValue = ref([]); const checkboxValue = ref([]);
const areaList = ref<any[]>([ interface AreaIds {
{ city?: string;
id: '0', cityId?: number;
provinceId: '0', creationTime?: string;
province: '北京市', creator?: string;
cityId: 0, id?: number;
city: '市辖区', province?: string;
creator: '', provinceId?: number;
creationTime: '', }
}, const areaList = ref<AreaIds[]>([]);
{
id: '1',
provinceId: '1',
province: '河北省',
cityId: 1,
city: '保定市',
creator: '',
creationTime: '',
},
{
id: '2',
provinceId: '2',
province: '河北省',
cityId: 2,
city: '石家庄市',
creator: '',
creationTime: '',
},
{
id: '3',
provinceId: '3',
province: '河北省',
cityId: 3,
city: '秦皇岛市',
creator: '',
creationTime: '',
},
{
id: '4',
provinceId: '4',
province: '河北省',
cityId: 3,
city: '承德市',
creator: '',
creationTime: '',
},
]);
const handleCancel = () => { const handleCancel = () => {
addressVisibleClose(); addressVisibleClose();
}; };
...@@ -316,14 +255,13 @@ ...@@ -316,14 +255,13 @@
ghscode: ghsCode, ghscode: ghsCode,
}; };
}); });
param.value.areas = checkboxValue.value.join; param.value.areas = checkboxValue.value;
console.log(param.value);
confirmLoading.value = true; confirmLoading.value = true;
const res = await regionalSpotManageOpsAddProductApi(param.value); const res = await regionalSpotManageOpsAddProductApi(param.value);
if (res.code === 20000) { if (res.success) {
message.success('新增成功'); message.success('新增成功');
addressVisibleClose(); addressVisibleClose();
emit('close', false); emit('close', false, 'refresh');
} else { } else {
message.error(res.message); message.error(res.message);
} }
...@@ -359,11 +297,11 @@ ...@@ -359,11 +297,11 @@
> >
<a-select-option <a-select-option
v-for="item in searchBrandList" v-for="item in searchBrandList"
:key="item.value" :key="item.brand"
:label="item.label" :label="item.brand"
:value="item.value" :value="item.brand"
> >
{{ item.label }} {{ item.brand }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<span style="margin-left: 15px">货号:</span> <span style="margin-left: 15px">货号:</span>
...@@ -373,7 +311,7 @@ ...@@ -373,7 +311,7 @@
placeholder="请输入货号" placeholder="请输入货号"
style="width: 200px" style="width: 200px"
/> />
<Button style="margin-left: 10px">重置</Button> <Button @click="reset" style="margin-left: 10px">重置</Button>
<Button @click="getLeftData" type="primary" style="margin-left: 10px">查询</Button> <Button @click="getLeftData" type="primary" style="margin-left: 10px">查询</Button>
</div> </div>
<div class="main"> <div class="main">
...@@ -392,13 +330,13 @@ ...@@ -392,13 +330,13 @@
:rowKey="(record) => record.brand + record.goodsNo + record.spec" :rowKey="(record) => record.brand + record.goodsNo + record.spec"
:scroll="{ x: false, y: 280 }" :scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName" :rowClassName="rowClassName"
:loading="loading" :loading="leftLoading"
> >
<!-- <template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'productName'"> <template v-if="column.key === 'productName'">
<span>{{ record.chineseName ? record.chineseName : record.englishName }}</span> <span>{{ record.chineseName ? record.chineseName : record.englishName }}</span>
</template> </template>
</template> --> </template>
</a-table> </a-table>
</div> </div>
</div> </div>
...@@ -440,7 +378,13 @@ ...@@ -440,7 +378,13 @@
:scroll="{ x: false, y: 280 }" :scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName" :rowClassName="rowClassName"
:row-selection="rightRowSelection" :row-selection="rightRowSelection"
/> >
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'productName'">
<span>{{ record.chineseName ? record.chineseName : record.englishName }}</span>
</template>
</template>
</a-table>
</div> </div>
</div> </div>
</div> </div>
...@@ -472,7 +416,7 @@ ...@@ -472,7 +416,7 @@
<a-checkbox-group v-model:value="checkboxValue" style="width: 100%"> <a-checkbox-group v-model:value="checkboxValue" style="width: 100%">
<a-row> <a-row>
<a-col :span="6" v-for="(item, index) in areaList" :key="index"> <a-col :span="6" v-for="(item, index) in areaList" :key="index">
<a-checkbox :value="item.id">{{ item.province }}-{{ item.city }}</a-checkbox> <a-checkbox :value="item.cityId">{{ item.province }}-{{ item.city }}</a-checkbox>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
......
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
const config = import.meta.env const config = import.meta.env;
import { import { taskCenterQueryListApi } from '/@/api/regionalSpotManage';
taskCenterQueryListApi, onMounted(async () => {
} from '/@/api/regionalSpotManage'; getList();
onMounted(async () => { });
getList() let list = ref<any[]>([]);
}); let listLoading = ref(false);
let list = ref<any[]>([]) const downLoad = (url) => {
let listLoading = ref(false) window.open(config.VITE_GLOB_API_URL + '/system/' + url, '_blank');
const downLoad = (url) => { };
window.open(config.VITE_GLOB_API_URL + '/system/' + url, '_blank') const getList = async () => {
} listLoading.value = true;
const getList = async () => { const res = await taskCenterQueryListApi({ type: 1 });
listLoading.value = true if (res.success) {
const res = await taskCenterQueryListApi({type:1}) list.value = res.data;
if (res.code === 20000) {
list.value = res.data
} else { } else {
list.value = [] list.value = [];
} }
listLoading.value = false listLoading.value = false;
} };
</script> </script>
<template> <template>
...@@ -36,39 +34,39 @@ const getList = async () => { ...@@ -36,39 +34,39 @@ const getList = async () => {
style="margin-top: 15px" style="margin-top: 15px"
> >
<a-table-column title="操作时间" align="center" :width="100"> <a-table-column title="操作时间" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="类型" align="center" :width="100"> <a-table-column title="类型" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.type }} {{ record.type }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="导出状态" align="center" :width="100"> <a-table-column title="导出状态" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
<p>{{ record.status == 0 ? '待进行 ': (record.status == 1 ? '进行中' : '已完成') }}</p> <p>{{ record.status == 0 ? '待进行 ' : record.status == 1 ? '进行中' : '已完成' }}</p>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="数据量" align="center" :width="100"> <a-table-column title="数据量" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.successNum }} {{ record.successNum }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作人" align="center" :width="100"> <a-table-column title="操作人" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createName }} {{ record.createName }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作" align="center" :width="200"> <a-table-column title="操作" align="center" :width="200">
<template v-slot="{record}"> <template #default="{ record }">
<Button v-if="record.fileUrl" type="link" @click="downLoad(record.fileUrl)">下载文件</Button> <Button v-if="record.fileUrl" type="link" @click="downLoad(record.fileUrl)"
>下载文件</Button
>
<span v-else>——</span> <span v-else>——</span>
</template> </template>
</a-table-column> </a-table-column>
</a-table> </a-table>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
import { getAuthCache } from '/@/utils/auth'; import { getAuthCache } from '/@/utils/auth';
import { import {
regionalSpotManageBrandListApi, regionalSpotManageBrandListApi,
regionalSpotManageGroupListApi,
regionalSpotManageListApi, regionalSpotManageListApi,
regionalSpotManageGetAreaListApi, regionalSpotManageGetAreaListApi,
regionalSpotManageGetGhsAreaListApi, regionalSpotManageGetGhsAreaListApi,
...@@ -32,36 +33,40 @@ ...@@ -32,36 +33,40 @@
onMounted(async () => { onMounted(async () => {
getList(); getList();
getAllAreaList(); getAllAreaList();
getGroupOption();
}); });
const searchForm = ref<{ const searchForm = ref<{
brandList: any; brands: any;
goodsNo: any; goodsNo: any;
areaIds: any; areaIds: any;
types: any; types: any;
}>({ }>({
brandList: [], brands: [],
goodsNo: '', goodsNo: '',
areaIds: [], areaIds: [],
types: [], types: [],
}); });
const areaIdsOption = ref([ interface AreaIds {
{ label: '区域1', value: '区域1' }, city?: string;
{ label: '区域2', value: '区域2' }, cityId?: number;
]); creationTime?: string;
const typesOption = ref([ creator?: string;
{ label: '组1', value: '组1' }, id?: number;
{ label: '组2', value: '组2' }, province?: string;
]); provinceId?: number;
let searchBrandList = ref<any[]>([]); }
const areaIdsOption = ref<AreaIds[]>([]);
const typesOption = ref([]);
const searchBrandList = ref<any[]>([]);
const handleSearch = async (value) => { const handleSearch = async (value) => {
const res = await regionalSpotManageBrandListApi({ brand: value }); const res = await regionalSpotManageBrandListApi({ brand: value });
if (res.code === 20000) { if (res.success) {
searchBrandList.value = res.data; searchBrandList.value = res.data;
} else { } else {
searchBrandList.value = []; searchBrandList.value = [];
} }
}; };
let listLoading = ref(false); const listLoading = ref(false);
const pagination = ref({ const pagination = ref({
pageSize: 10, pageSize: 10,
current: 1, current: 1,
...@@ -93,7 +98,7 @@ ...@@ -93,7 +98,7 @@
param.value.types = param.value.types ? param.value.types : []; param.value.types = param.value.types ? param.value.types : [];
listLoading.value = true; listLoading.value = true;
const res = await regionalSpotManageListApi(param.value); const res = await regionalSpotManageListApi(param.value);
if (res.code === 20000) { if (res.success) {
list.value = res.data; list.value = res.data;
pagination.value.total = res.data[0].total; pagination.value.total = res.data[0].total;
} else { } else {
...@@ -101,47 +106,32 @@ ...@@ -101,47 +106,32 @@
pagination.value.total = 0; pagination.value.total = 0;
} }
listLoading.value = false; listLoading.value = false;
list.value = [
{
productName: '测试商品',
brand: '测试品牌',
goodsNo: '45641',
spec: '100ml',
productStatus: '上架',
sysid: '1',
},
{
productName: 'ffff',
brand: 'fff',
goodsNo: 'fff',
spec: 'ff',
productStatus: '上架',
sysid: '2',
},
];
}; };
const onRset = () => { const onRset = () => {
searchForm.value.brandList = []; searchForm.value.brands = [];
searchForm.value.goodsNo = ''; searchForm.value.goodsNo = '';
searchForm.value.areaIds = []; searchForm.value.areaIds = [];
searchForm.value.types = []; searchForm.value.types = [];
getList(); getList();
}; };
const onSearch = () => { const onSearch = () => {
pagination.value.pageSize = 1; pagination.value.current = 1;
getList(); getList();
}; };
let showModal = ref(false); const showModal = ref(false);
const addProduct = () => { const addProduct = () => {
showModal.value = true; showModal.value = true;
}; };
// 关闭新增商品弹窗 // 关闭新增商品弹窗
const closeVisible = (val) => { const closeVisible = (val, action) => {
showModal.value = val; showModal.value = val;
if (action) {
onSearch();
}
}; };
let curItem = ref<{ [key: string]: any }>({}); const curItem = ref<{ [key: string]: any }>({});
// =========查看区域现货 statr =========== // =========查看区域现货 statr ===========
const loading1 = ref(false); const loading1 = ref(false);
...@@ -160,7 +150,6 @@ ...@@ -160,7 +150,6 @@
}, },
], ],
}); });
console.log(param.value);
loading1.value = true; loading1.value = true;
const result = await getAreaList(param.value); const result = await getAreaList(param.value);
regionalSpotGoods.value = result; regionalSpotGoods.value = result;
...@@ -168,7 +157,7 @@ ...@@ -168,7 +157,7 @@
}; };
const getAreaList = async (param) => { const getAreaList = async (param) => {
const res = await regionalSpotManageGetGhsAreaListApi(param); const res = await regionalSpotManageGetGhsAreaListApi(param);
if (res.code === 20000) { if (res.success) {
return res.data; return res.data;
} else { } else {
return []; return [];
...@@ -176,16 +165,16 @@ ...@@ -176,16 +165,16 @@
}; };
// ==========查看区域现货 end ============= // ==========查看区域现货 end =============
let selectedRowKeys = ref([]); const selectedRowKeys = ref([]);
let selectedRows = ref<any[]>([]); const selectedRows = ref<any[]>([]);
const onSelectChange = (Keys, Rows) => { const onSelectChange = (Keys, Rows) => {
selectedRowKeys.value = Keys; selectedRowKeys.value = Keys;
selectedRows.value = Rows; selectedRows.value = Rows;
}; };
// ===============增加区域 start======================= // ===============增加区域 start=======================
let addVisible = ref(false); const addVisible = ref(false);
let addAreaLoading = ref(false); const addAreaLoading = ref(false);
let addCheckboxValue = ref(['0']); const addCheckboxValue = ref<number[]>([]);
const addArea = async (row) => { const addArea = async (row) => {
curItem.value = row; curItem.value = row;
addVisible.value = true; addVisible.value = true;
...@@ -202,10 +191,10 @@ ...@@ -202,10 +191,10 @@
}); });
const result = await getAreaList(param.value); const result = await getAreaList(param.value);
delAreaList.value = result; delAreaList.value = result;
const curArr = delAreaList.value.map((it) => it.id); const curArr = delAreaList.value.map((it) => it.cityCode);
for (const k of allAreaList.value) { for (const k of allAreaList.value) {
if (curArr.includes(k.id)) { if (curArr.includes(k.cityId)) {
addCheckboxValue.value.push(k.id); addCheckboxValue.value.push(k.cityId);
k.disabled = true; k.disabled = true;
} }
} }
...@@ -215,7 +204,7 @@ ...@@ -215,7 +204,7 @@
addVisible.value = false; addVisible.value = false;
addCheckboxValue.value = []; addCheckboxValue.value = [];
}; };
let confirmAddLoading = ref(false); const confirmAddLoading = ref(false);
const confirmAddArea = async () => { const confirmAddArea = async () => {
const param = ref<{ [key: string]: any }>({ const param = ref<{ [key: string]: any }>({
products: [ products: [
...@@ -226,12 +215,13 @@ ...@@ -226,12 +215,13 @@
ghscode: ghsCode, ghscode: ghsCode,
}, },
], ],
areas: addCheckboxValue.value.join, areas: addCheckboxValue.value,
}); });
confirmAddLoading.value = true; confirmAddLoading.value = true;
const res = await regionalSpotManageOpsEditProductApi(param.value); const res = await regionalSpotManageOpsEditProductApi(param.value);
if (res.success) { if (res.success) {
message.success('添加区域成功'); message.success('添加区域成功');
addVisibleCancel();
} else { } else {
message.error(res.message); message.error(res.message);
} }
...@@ -240,31 +230,12 @@ ...@@ -240,31 +230,12 @@
// ===============增加区域 end======================= // ===============增加区域 end=======================
// ================区域现货商品删除 start===================== // ================区域现货商品删除 start=====================
let delVisible = ref(false); const delVisible = ref(false);
let delLoading = ref(false); const delLoading = ref(false);
let deleteNum = ref(0); const deleteNum = ref(0);
let radioValue = ref(1); const radioValue = ref(1);
let delAreaList = ref<any[]>([ const delAreaList = ref<any[]>([]); //已添加的区域
{ const delCheckboxValue = ref([]);
id: '0',
provinceId: '0',
province: '北京市',
cityId: 0,
city: '市辖区',
creator: '',
creationTime: '',
},
{
id: '1',
provinceId: '1',
province: '河北省',
cityId: 1,
city: '保定市',
creator: '',
creationTime: '',
},
]); //已添加的区域
let delCheckboxValue = ref([]);
const del = async (val) => { const del = async (val) => {
curItem.value = val; curItem.value = val;
deleteNum.value = 1; deleteNum.value = 1;
...@@ -279,11 +250,12 @@ ...@@ -279,11 +250,12 @@
}, },
], ],
}); });
console.log(param.value); delLoading.value = true;
// delLoading.value = true const res = await getAreaList(param.value);
// const result = await getAreaList(param.value) if (res) {
// delAreaList.value = result delAreaList.value = res;
// delLoading.value = false }
delLoading.value = false;
}; };
const delVisibleCancel = () => { const delVisibleCancel = () => {
delVisible.value = false; delVisible.value = false;
...@@ -292,8 +264,9 @@ ...@@ -292,8 +264,9 @@
delCheckboxValue.value = []; delCheckboxValue.value = [];
isBatchDel.value = false; isBatchDel.value = false;
}; };
let delConfirLoading = ref(false); const delConfirLoading = ref(false);
const confirmDel = async () => { const confirmDel = async () => {
if (!delAreaList.value.length) return message.error('暂无可删除区域');
if (radioValue.value === 2 && !delCheckboxValue.value.length) if (radioValue.value === 2 && !delCheckboxValue.value.length)
return message.error('请选择需要删除的现货区域'); return message.error('请选择需要删除的现货区域');
const param = ref<{ [key: string]: any }>({ const param = ref<{ [key: string]: any }>({
...@@ -322,7 +295,7 @@ ...@@ -322,7 +295,7 @@
} }
if (radioValue.value === 1) { if (radioValue.value === 1) {
param.value.isAll = true; param.value.isAll = true;
param.value.areas = delAreaList.value.map((v) => v.id); param.value.areas = delAreaList.value.map((v) => v.cityCode);
} else if (radioValue.value === 2) { } else if (radioValue.value === 2) {
param.value.areas = delCheckboxValue.value; param.value.areas = delCheckboxValue.value;
} }
...@@ -336,8 +309,8 @@ ...@@ -336,8 +309,8 @@
delConfirLoading.value = false; delConfirLoading.value = false;
}; };
// 批量删除 // 批量删除
let isBatchDel = ref(false); const isBatchDel = ref(false);
const batchDel = () => { const batchDel = async () => {
if (!selectedRowKeys.value.length) return message.error('请勾选商品'); if (!selectedRowKeys.value.length) return message.error('请勾选商品');
isBatchDel.value = true; isBatchDel.value = true;
deleteNum.value = selectedRows.value.length; deleteNum.value = selectedRows.value.length;
...@@ -353,73 +326,36 @@ ...@@ -353,73 +326,36 @@
ghscode: ghsCode, ghscode: ghsCode,
}; };
}); });
// delLoading.value = true delLoading.value = true;
// const result = await getAreaList(param.value) const res = await getAreaList(param.value);
// delAreaList.value = result if (res.success) {
// delLoading.value = false delAreaList.value = res.data;
}
delLoading.value = false;
}; };
// ================区域现货商品删除 end===================== // ================区域现货商品删除 end=====================
let allAreaList = ref<any[]>([ const allAreaList = ref<any[]>([]);
{
id: '0',
provinceId: '0',
province: '北京市',
cityId: 0,
city: '市辖区',
creator: '',
creationTime: '',
disabled: true,
},
{
id: '1',
provinceId: '1',
province: '河北省',
cityId: 1,
city: '保定市',
creator: '',
creationTime: '',
},
{
id: '2',
provinceId: '2',
province: '河北省',
cityId: 2,
city: '石家庄市',
creator: '',
creationTime: '',
},
{
id: '3',
provinceId: '3',
province: '河北省',
cityId: 3,
city: '秦皇岛市',
creator: '',
creationTime: '',
},
{
id: '4',
provinceId: '4',
province: '河北省',
cityId: 3,
city: '承德市',
creator: '',
creationTime: '',
},
]);
const getAllAreaList = async () => { const getAllAreaList = async () => {
const res = await regionalSpotManageGetAreaListApi({}); const res = await regionalSpotManageGetAreaListApi({});
if (res.success) { if (res.success) {
allAreaList.value = res.data; allAreaList.value = res.data;
areaIdsOption.value = JSON.parse(JSON.stringify(res.data));
} else { } else {
allAreaList.value = []; allAreaList.value = [];
} }
}; };
const getGroupOption = async () => {
const res = await regionalSpotManageGroupListApi({});
if (res.success) {
typesOption.value = res.data;
} else {
typesOption.value = [];
}
};
// =====================批量导入 start======================= // =====================批量导入 start=======================
let productExcelList = ref<any[]>([]); const productExcelList = ref<any[]>([]);
let importVisible = ref(false); const importVisible = ref(false);
const impotrCheckboxValue = ref([]); const impotrCheckboxValue = ref([]);
const batchImport = () => { const batchImport = () => {
importVisible.value = true; importVisible.value = true;
...@@ -456,10 +392,10 @@ ...@@ -456,10 +392,10 @@
const param: FormData = new FormData(); const param: FormData = new FormData();
param.append('ghsCode', ghsCode); param.append('ghsCode', ghsCode);
param.append('file', productExcelList.value[0]); param.append('file', productExcelList.value[0]);
param.append('areaIds', impotrCheckboxValue.value.join(',')); param.append('areaIds', impotrCheckboxValue.value as any);
importLoading.value = true; importLoading.value = true;
const res = await regionalSpotManageUploadOpsProductApi(param); const res = await regionalSpotManageUploadOpsProductApi(param);
if (res.code === 20000) { if (res.success) {
message.success('批量导入成功'); message.success('批量导入成功');
} else { } else {
message.error(res.message); message.error(res.message);
...@@ -474,7 +410,7 @@ ...@@ -474,7 +410,7 @@
// =====================批量导入 end======================= // =====================批量导入 end=======================
const goTaskCenter = () => { const goTaskCenter = () => {
router.push({ router.push({
path: '/taskCenter', path: '/product/taskCenter',
}); });
}; };
</script> </script>
...@@ -491,9 +427,9 @@ ...@@ -491,9 +427,9 @@
<Row :gutter="20"> <Row :gutter="20">
<Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24"> <Col :xxl="4" :xl="6" :lg="8" :sm="12" :xs="24">
<FormItem label="品牌名称" name="brandList"> <FormItem label="品牌名称" name="brandList">
<!-- <Input v-model:value="searchForm.brandList" allow-clear placeholder="请输入品牌名称" /> --> <!-- <Input v-model:value="searchForm.brands" allow-clear placeholder="请输入品牌名称" /> -->
<a-select <a-select
v-model:value="searchForm.brandList" v-model:value="searchForm.brands"
show-search show-search
mode="multiple" mode="multiple"
placeholder="请输入品牌名称" placeholder="请输入品牌名称"
...@@ -502,15 +438,16 @@ ...@@ -502,15 +438,16 @@
:show-arrow="false" :show-arrow="false"
:filter-option="false" :filter-option="false"
:not-found-content="null" :not-found-content="null"
:maxTagCount="1"
@search="handleSearch" @search="handleSearch"
> >
<a-select-option <a-select-option
v-for="item in searchBrandList" v-for="item in searchBrandList"
:key="item.value" :key="item.brand"
:label="item.label" :label="item.brand"
:value="item.value" :value="item.brand"
> >
{{ item.label }} {{ item.brand }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</FormItem> </FormItem>
...@@ -527,13 +464,14 @@ ...@@ -527,13 +464,14 @@
allowClear allowClear
mode="multiple" mode="multiple"
placeholder="请选择现货区域" placeholder="请选择现货区域"
:maxTagCount="1"
style="width: 100%" style="width: 100%"
> >
<SelectOption <SelectOption
v-for="(item, index) in areaIdsOption" v-for="(item, index) in areaIdsOption"
:key="index" :key="index"
:value="item.value" :value="item.cityId"
>{{ item.label }}</SelectOption >{{ item.province }}-{{ item.city }}</SelectOption
> >
</Select> </Select>
</FormItem> </FormItem>
...@@ -545,14 +483,12 @@ ...@@ -545,14 +483,12 @@
allowClear allowClear
mode="multiple" mode="multiple"
placeholder="请选择商品分组" placeholder="请选择商品分组"
:maxTagCount="1"
style="width: 100%" style="width: 100%"
> >
<SelectOption <SelectOption v-for="(item, index) in typesOption" :key="index" :value="item">{{
v-for="(item, index) in typesOption" item
:key="index" }}</SelectOption>
:value="item.value"
>{{ item.label }}</SelectOption
>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
...@@ -573,7 +509,7 @@ ...@@ -573,7 +509,7 @@
:loading="listLoading" :loading="listLoading"
bordered bordered
:pagination="pagination" :pagination="pagination"
:rowKey="(record) => record.sysid" :rowKey="(record) => record.brand + record.goodsNo + record.spec"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, onChange: onSelectChange,
...@@ -582,32 +518,32 @@ ...@@ -582,32 +518,32 @@
style="margin-top: 15px" style="margin-top: 15px"
> >
<a-table-column title="商品名称" align="center" :width="100"> <a-table-column title="商品名称" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.productName }} {{ record.productName }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="品牌" align="center" :width="100"> <a-table-column title="品牌" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.brand }} {{ record.brand }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="货号" align="center" :width="100"> <a-table-column title="货号" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.goodsNo }} {{ record.goodsNo }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="规格" align="center" :width="100"> <a-table-column title="规格" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.spec }} {{ record.spec }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="当前现货区域" align="center" :width="100"> <a-table-column title="当前现货区域" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
<Button type="link" @click="viewCurrent(record)">查看区域现货</Button> <Button type="link" @click="viewCurrent(record)">查看区域现货</Button>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="上架状态" align="center" :width="100"> <a-table-column title="上架状态" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.productStatus }} {{ record.productStatus }}
</template> </template>
</a-table-column> </a-table-column>
...@@ -629,7 +565,7 @@ ...@@ -629,7 +565,7 @@
:maskClosable="false" :maskClosable="false"
okText="提交" okText="提交"
> >
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div> <div>商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div> <div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div> <div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div> <div>商品规格:{{ curItem.spec }}</div>
...@@ -642,15 +578,15 @@ ...@@ -642,15 +578,15 @@
style="margin-top: 15px" style="margin-top: 15px"
> >
<a-table-column title="区域" align="center" :width="100"> <a-table-column title="区域" align="center" :width="100">
<template v-slot="{ record }"> {{ record.provinceName }}-{{ record.cityName }} </template> <template #default="{ record }">{{ record.provinceName }}-{{ record.cityName }}</template>
</a-table-column> </a-table-column>
<a-table-column title="添加时间" align="center" :width="100"> <a-table-column title="添加时间" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="添加人" align="center" :width="100"> <a-table-column title="添加人" align="center" :width="100">
<template v-slot="{ record }"> <template #default="{ record }">
{{ record.createName }} {{ record.createName }}
</template> </template>
</a-table-column> </a-table-column>
...@@ -685,7 +621,9 @@ ...@@ -685,7 +621,9 @@
> >
<a-row> <a-row>
<a-col :span="6" v-for="(item, index) in delAreaList" :key="index"> <a-col :span="6" v-for="(item, index) in delAreaList" :key="index">
<a-checkbox :value="item.id">{{ item.province }}-{{ item.city }}</a-checkbox> <a-checkbox :value="item.cityCode"
>{{ item.provinceName }}-{{ item.cityName }}</a-checkbox
>
</a-col> </a-col>
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
...@@ -702,7 +640,7 @@ ...@@ -702,7 +640,7 @@
okText="提交" okText="提交"
:confirmLoading="confirmAddLoading" :confirmLoading="confirmAddLoading"
> >
<div style="margin-top: -35px">商品名称:{{ curItem.productName }}</div> <div>商品名称:{{ curItem.productName }}</div>
<div>商品品牌:{{ curItem.brand }}</div> <div>商品品牌:{{ curItem.brand }}</div>
<div>商品货号:{{ curItem.goodsNo }}</div> <div>商品货号:{{ curItem.goodsNo }}</div>
<div>商品规格:{{ curItem.spec }}</div> <div>商品规格:{{ curItem.spec }}</div>
...@@ -710,7 +648,7 @@ ...@@ -710,7 +648,7 @@
<a-checkbox-group v-model:value="addCheckboxValue" style="width: 100%"> <a-checkbox-group v-model:value="addCheckboxValue" style="width: 100%">
<a-row> <a-row>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index"> <a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled" <a-checkbox :value="item.cityId" :disabled="item.disabled"
>{{ item.province }}-{{ item.city }}</a-checkbox >{{ item.province }}-{{ item.city }}</a-checkbox
> >
</a-col> </a-col>
...@@ -755,7 +693,7 @@ ...@@ -755,7 +693,7 @@
<a-checkbox-group v-model:value="impotrCheckboxValue" style="width: 100%"> <a-checkbox-group v-model:value="impotrCheckboxValue" style="width: 100%">
<a-row> <a-row>
<a-col :span="6" v-for="(item, index) in allAreaList" :key="index"> <a-col :span="6" v-for="(item, index) in allAreaList" :key="index">
<a-checkbox :value="item.id" :disabled="item.disabled" <a-checkbox :value="item.cityId" :disabled="item.disabled"
>{{ item.province }}-{{ item.city }}</a-checkbox >{{ item.province }}-{{ item.city }}</a-checkbox
> >
</a-col> </a-col>
......
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { import {
platformProBatchGetListApi, platformProBatchGetListApi,
platformProBatchGetDetailApi platformProBatchGetDetailApi,
} from '/@/api/regionalSpotManage'; } from '/@/api/regionalSpotManage';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
onMounted(async () => { onMounted(async () => {
getList() getList();
}); });
let list = ref<any[]>([ let list = ref<any[]>([]);
{ let listLoading = ref(false);
createTime: '2024/12/12 12:22:22', const pagination = ref({
operateModule: '平台商品管理-议价商品',
type: '批量导入议价商品',
operateNum: 8882,
successNum: 8882,
failNum: 0,
operateName: '赵欣雨'
}
])
let listLoading = ref(false)
const pagination = ref({
pageSize: 10, pageSize: 10,
current: 1, current: 1,
total: 0, total: 0,
showTotal: total => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
hideOnSinglePage: false, hideOnSinglePage: false,
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
pageSizeOptions: ['10', '20', '30', '50', '100'], pageSizeOptions: ['10', '20', '30', '50', '100'],
onChange: (current) => { onChange: (current) => {
pagination.value.current = current pagination.value.current = current;
getList() getList();
}, },
onShowSizeChange: (size) => { onShowSizeChange: (size) => {
pagination.value.pageSize = size pagination.value.pageSize = size;
getList() getList();
} },
}) });
const search = () => { const search = () => {
pagination.value.current = 1 pagination.value.current = 1;
getList() getList();
} };
const getList = async () => { const getList = async () => {
const param = ref<{ [key: string]: any }>({ const param = ref<{ [key: string]: any }>({
currentPage: pagination.value.current, currentPage: pagination.value.current,
pageSize: pagination.value.pageSize pageSize: pagination.value.pageSize,
}) });
listLoading.value = true listLoading.value = true;
const res = await platformProBatchGetListApi(param) const res = await platformProBatchGetListApi(param);
if (res.code === 20000) { if (res.success) {
list.value = res.data list.value = res.data;
pagination.value.total = res.data[0].total pagination.value.total = res.data[0].total;
} else { } else {
list.value = [] list.value = [];
pagination.value.total = 0 pagination.value.total = 0;
} }
listLoading.value = false listLoading.value = false;
} };
let curItem = ref<{ [key: string]: any }>({}); let curItem = ref<{ [key: string]: any }>({});
let visible = ref(false) let visible = ref(false);
let operationList = ref<any[]>([]) let operationList = ref<any[]>([]);
let detailLoading = ref(false) let detailLoading = ref(false);
const viewRecord = (item) => { const viewRecord = (item) => {
curItem.value = item curItem.value = item;
visible.value = true visible.value = true;
getDetails(item) getDetails(item);
} };
const getDetails = async (item) => { const getDetails = async (item) => {
const param = ref<{ [key: string]: any }>({ const param = ref<{ [key: string]: any }>({
sysid: item.sysid, sysid: item.sysid,
type: '' type: '',
}) });
detailLoading.value = true detailLoading.value = true;
const res = await platformProBatchGetDetailApi(param) const res = await platformProBatchGetDetailApi(param);
if (res.code === 20000) { if (res.success) {
operationList.value = res.data operationList.value = res.data;
} else { } else {
operationList.value = [] operationList.value = [];
} }
detailLoading.value = false detailLoading.value = false;
} };
// =================导出======================== // =================导出========================
let exportLoading = ref(false) let exportLoading = ref(false);
const exportExcel = async () => { const exportExcel = async () => {
handleDownload([ handleDownload([
{ {
"brand": "生工", brand: '生工',
"category": "", category: '',
"createTime": "2024-03-29 14:42:35", createTime: '2024-03-29 14:42:35',
"discount": null, discount: null,
"expirationDate": null, expirationDate: null,
"failReason": "该商品在商品目录不存在;", failReason: '该商品在商品目录不存在;',
"identificationType": "商品议价", identificationType: '商品议价',
"itemNo": "G508013-0001", itemNo: 'G508013-0001',
"negotiationPrice": 5000, negotiationPrice: 5000,
"operateSysid": 13877, operateSysid: 13877,
"platforms": [ platforms: ['北京协和医院'],
"北京协和医院" productName: '微孔板迷你离心机,500~3000 rpm',
], spec: '1 /PK',
"productName": "微孔板迷你离心机,500~3000 rpm", status: false,
"spec": "1 /PK", sysid: 83466873,
"status": false, total: 32,
"sysid": 83466873, type: 2,
"total": 32, },
"type": 2 ]);
}
])
const param = ref<{ [key: string]: any }>({ const param = ref<{ [key: string]: any }>({
sysid: curItem.value.sysid, sysid: curItem.value.sysid,
type: '' type: '',
}) });
exportLoading.value = true exportLoading.value = true;
const res = await platformProBatchGetDetailApi(param) const res = await platformProBatchGetDetailApi(param);
if (res.code === 20000) { if (res.success) {
handleDownload(res.data) handleDownload(res.data);
} else { } else {
message.error('暂无数据') message.error('暂无数据');
} }
exportLoading.value = false exportLoading.value = false;
} };
const handleDownload = (list) => { const handleDownload = (list) => {
import('/@/vendor/Export2Excel').then(excel => { import('/@/vendor/Export2Excel').then((excel) => {
let tHeader = ['商品名称', '品牌', '货号', '包装规格', '平台', '状态', '失败原因', '执行时间'] let tHeader = [
let filterVal = ['productName', 'brand', 'itemNo', 'spec', 'platforms', 'status', 'failReason', 'createTime'] '商品名称',
list.forEach(item => { '品牌',
if(item.status) { '货号',
item.status = '成功' '包装规格',
'平台',
'状态',
'失败原因',
'执行时间',
];
let filterVal = [
'productName',
'brand',
'itemNo',
'spec',
'platforms',
'status',
'failReason',
'createTime',
];
list.forEach((item) => {
if (item.status) {
item.status = '成功';
} else { } else {
item.status = '失败' item.status = '失败';
} }
if(item.platforms) { if (item.platforms) {
item.platforms = item.platforms.join(',') item.platforms = item.platforms.join(',');
} else { } else {
item.platforms = '' item.platforms = '';
} }
}); });
const data = formatJson(filterVal, list) const data = formatJson(filterVal, list);
excel.export_json_to_excel({ excel.export_json_to_excel({
header: tHeader as any, header: tHeader as any,
data: data as any, data: data as any,
...@@ -145,15 +151,17 @@ const handleDownload = (list) => { ...@@ -145,15 +151,17 @@ const handleDownload = (list) => {
autoWidth: true as any, autoWidth: true as any,
bookType: 'xlsx' as any, bookType: 'xlsx' as any,
XlsWidth: null as any, XlsWidth: null as any,
searchList: [] as any searchList: [] as any,
}) });
}) });
} };
const formatJson = (filterVal, jsonData) => { const formatJson = (filterVal, jsonData) => {
return jsonData.map(v => filterVal.map(j => { return jsonData.map((v) =>
return v[j] filterVal.map((j) => {
})) return v[j];
} }),
);
};
</script> </script>
<template> <template>
...@@ -169,45 +177,53 @@ const formatJson = (filterVal, jsonData) => { ...@@ -169,45 +177,53 @@ const formatJson = (filterVal, jsonData) => {
style="margin-top: 15px" style="margin-top: 15px"
> >
<a-table-column title="操作时间" align="center" :width="100"> <a-table-column title="操作时间" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="功能模块" align="center" :width="100"> <a-table-column title="功能模块" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.operateModule }} {{ record.operateModule }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="类型" align="center" :width="100"> <a-table-column title="类型" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.type }} {{ record.type }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作数量" align="center" :width="100"> <a-table-column title="操作数量" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
<a-button v-if="record.operateNum" type="link" @click="viewRecord(record)">{{ record.operateNum }}</a-button> <a-button v-if="record.operateNum" type="link" @click="viewRecord(record)">{{
record.operateNum
}}</a-button>
<span v-else>/</span> <span v-else>/</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="解析成功数量" align="center" :width="100"> <a-table-column title="解析成功数量" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
<span v-if="record.successNum">{{ record.successNum }}</span> <span v-if="record.successNum">{{ record.successNum }}</span>
<span v-else>/</span> <span v-else>/</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="解析失败数量" align="center" :width="100"> <a-table-column title="解析失败数量" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
<span v-if="record.failNum">{{ record.failNum }}</span> <span v-if="record.failNum">{{ record.failNum }}</span>
<span v-else>/</span> <span v-else>/</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="操作人" align="center" :width="100"> <a-table-column title="操作人" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.operateName }} {{ record.operateName }}
</template> </template>
</a-table-column> </a-table-column>
</a-table> </a-table>
<a-modal v-model:visible="visible" title="操作记录详情" :width="1200" :maskClosable="false" :keyboard="false"> <a-modal
v-model:visible="visible"
title="操作记录详情"
:width="1200"
:maskClosable="false"
:keyboard="false"
>
<template #footer> <template #footer>
<a-button type="primary" :loading="exportLoading" @click="exportExcel">导出数据</a-button> <a-button type="primary" :loading="exportLoading" @click="exportExcel">导出数据</a-button>
</template> </template>
...@@ -219,43 +235,47 @@ const formatJson = (filterVal, jsonData) => { ...@@ -219,43 +235,47 @@ const formatJson = (filterVal, jsonData) => {
style="margin-top: -15px" style="margin-top: -15px"
> >
<a-table-column title="商品名称" align="center" :width="100"> <a-table-column title="商品名称" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.productName }} {{ record.productName }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="品牌" align="center" :width="100"> <a-table-column title="品牌" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.brand }} {{ record.brand }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="货号" align="center" :width="100"> <a-table-column title="货号" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.itemNo }} {{ record.itemNo }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="包装规格" align="center" :width="100"> <a-table-column title="包装规格" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.spec }} {{ record.spec }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="平台" align="center" :width="150"> <a-table-column title="平台" align="center" :width="150">
<template v-slot="{record}"> <template #default="{ record }">
<span v-if="record.platforms && record.platforms.length > 1" :title="record.platforms.join(',')">{{ record.platforms[0] + '...' }}</span> <span
v-if="record.platforms && record.platforms.length > 1"
:title="record.platforms.join(',')"
>{{ record.platforms[0] + '...' }}</span
>
<span v-else>{{ record.platforms ? record.platforms[0] : '' }}</span> <span v-else>{{ record.platforms ? record.platforms[0] : '' }}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="状态" align="center" :width="100"> <a-table-column title="状态" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.status ? '成功' : '失败' }} {{ record.status ? '成功' : '失败' }}
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="失败原因" :width="150"> <a-table-column title="失败原因" :width="150">
<template v-slot="{record}"> <template #default="{ record }">
<span class="opinionClass" :title="record.failReason">{{ record.failReason }}</span> <span class="opinionClass" :title="record.failReason">{{ record.failReason }}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="执行时间" align="center" :width="100"> <a-table-column title="执行时间" align="center" :width="100">
<template v-slot="{record}"> <template #default="{ record }">
{{ record.createTime }} {{ record.createTime }}
</template> </template>
</a-table-column> </a-table-column>
...@@ -264,12 +284,12 @@ const formatJson = (filterVal, jsonData) => { ...@@ -264,12 +284,12 @@ const formatJson = (filterVal, jsonData) => {
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>
.opinionClass { .opinionClass {
word-break: break-all; word-break: break-all;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
overflow: hidden; overflow: hidden;
} }
</style> </style>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
sysid: record.sysid, sysid: record.sysid,
}); });
const res = await taskCenterRevokeExcelUploadApi(param.value); const res = await taskCenterRevokeExcelUploadApi(param.value);
if (res.code === 20000) { if (res.success) {
message.success('操作成功'); message.success('操作成功');
getList(); getList();
} else { } else {
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
const getList = async () => { const getList = async () => {
listLoading.value = true; listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 0 }); const res = await taskCenterQueryListApi({ type: 0 });
if (res.code === 20000) { if (res.success) {
list.value = res.data; list.value = res.data;
} else { } else {
list.value = []; list.value = [];
......
<script lang="ts" setup> <script lang="ts" setup>
import ManageList from './components/list.vue'; 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> </script>
<template> <template>
<div>
<ManageList /> <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> </template>
<style lang="less" scoped> <style lang="less" scoped>
.status {
height: 100vh;
img {
width: 100%;
height: 100vh;
object-fit: contain;
}
}
</style> </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