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',
......@@ -13,74 +17,98 @@ enum Api {
PlatformProBatchGetDetail = '/system/logNegotiationProductOperate/getList',
}
/**
* @description: 区域现货管理列表
*/
export const regionalSpotManageGetStatusApi = () => tmallabHttp.post({ url: Api.GetStatus });
/**
* @description: 区域现货管理列表
*/
export const regionalSpotManageListApi = (data) =>
tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message'});
tmallabHttp.post({ url: Api.List, data }, { errorMessageMode: 'message' });
/**
* @description: 获取品牌列表
*/
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: 获取现货区域列表
*/
export const regionalSpotManageGetAreaListApi = (data) =>
tmallabHttp.post({ url: Api.GetAreaList,data },{ errorMessageMode: 'message' });
tmallabHttp.post({ url: Api.GetAreaList, data });
/**
* @description: 新增商品接口
*/
export const regionalSpotManageOpsAddProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsAddProduct, data },{ errorMessageMode: 'message' });
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' });
tmallabHttp.post({ url: Api.OpsDeleteProduct, data }, { errorMessageMode: 'message' });
/**
* @description: 增加区域
*/
export const regionalSpotManageOpsEditProductApi = (data) =>
tmallabHttp.post({ url: Api.OpsEditProduct, data },{ errorMessageMode: 'message' });
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' });
tmallabHttp.post({ url: Api.RevokeExcelUpload, data }, { errorMessageMode: 'message' });
/**
* @description: 撤销
*/
export const taskCenterRevokeExcelUploadApi = (data) =>
tmallabHttp.post({ url: Api.RevokeExcelUpload, data },{ errorMessageMode: 'message' });
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();
......@@ -6,18 +6,19 @@
const emit = defineEmits(['close']);
import {
regionalSpotManageBrandListApi,
regionalSpotManageProductListApi,
regionalSpotManageGetAreaListApi,
regionalSpotManageOpsAddProductApi,
} from '/@/api/regionalSpotManage';
import { getAuthCache } from '/@/utils/auth';
const userInfo: any = getAuthCache('USER__INFO__');
const ghsCode = userInfo.supplier.ghsCode;
let searchBrand = ref('');
let searchItemNo = ref('');
let searchBrandList = ref<any[]>([]);
const searchBrand = ref('');
const searchItemNo = ref('');
const searchBrandList = ref<any[]>([]);
const handleSearch = async (value) => {
const res = await regionalSpotManageBrandListApi({ brand: value });
if (res.code === 20000) {
if (res.success) {
searchBrandList.value = res.data;
} else {
searchBrandList.value = [];
......@@ -26,11 +27,11 @@
const closeModal = () => {
emit('close', false);
};
const leftLoading = ref(false);
const leftData = ref<any[]>([]);
const leftColumns = [
{
title: '商品名称',
dataIndex: 'productName',
key: 'productName',
width: '25%',
align: 'center',
......@@ -58,53 +59,29 @@
getLeftData();
},
});
const getLeftData = () => {
leftData.value = [
{
productName: '测试产品1',
brand: '测试品牌1',
goodsNo: '213651',
spec: '100ml',
sysid: '1',
},
{
productName: '测试产品2',
brand: '测试品牌2',
goodsNo: '213652',
spec: '100ml',
sysid: '2',
},
{
productName: '测试产品3',
brand: '测试品牌3',
goodsNo: '213653',
spec: '100ml',
sysid: '3',
},
{
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,
},
];
const reset = () => {
searchBrand.value = '';
searchItemNo.value = '';
pagination.value.current = 1;
getLeftData();
};
const getLeftData = async () => {
const param = {
pageIndex: pagination.value.current,
pageSize: pagination.value.pageSize,
ghsCode: ghsCode,
productName: '',
brand: searchBrand.value,
goodsNo: searchItemNo.value,
};
leftLoading.value = true;
const res = await regionalSpotManageProductListApi(param);
if (res.success) {
leftData.value = res.data;
} else {
leftData.value = [];
}
leftLoading.value = false;
if (rightData.value.length > 0) {
for (let i = 0; i < rightData.value.length; i++) {
if (
......@@ -125,8 +102,8 @@
leftData.value = [...leftData.value];
pagination.value.total = leftData.value.length;
};
let selectedRowKeys = ref<any[]>([]);
let selectedRows = ref<any[]>([]);
const selectedRowKeys = ref<any[]>([]);
const selectedRows = ref<any[]>([]);
const rowSelection = computed(() => {
return {
selectedRowKeys: selectedRowKeys.value,
......@@ -140,7 +117,6 @@
};
});
const toRight = () => {
console.log(selectedRows.value);
let arr = JSON.parse(JSON.stringify(selectedRows.value));
rightData.value = [...arr, ...rightData.value];
for (let i = 0; i < selectedRows.value.length; i++) {
......@@ -227,14 +203,14 @@
const rowClassName = () => {
return 'table-back';
};
let loading = ref(false);
let addressLoading = ref(false);
const loading = ref(false);
const addressLoading = ref(false);
const goNext = async () => {
if (!rightData.value.length) return message.error('请先选择商品');
addressVisible.value = true;
addressLoading.value = true;
const res = await regionalSpotManageGetAreaListApi({});
if (res.code === 20000) {
if (res.success) {
areaList.value = res.data;
} else {
areaList.value = [];
......@@ -245,53 +221,16 @@
const confirmLoading = ref(false);
const addressVisible = ref(false);
const checkboxValue = ref([]);
const areaList = ref<any[]>([
{
id: '0',
provinceId: '0',
province: '北京市',
cityId: 0,
city: '市辖区',
creator: '',
creationTime: '',
},
{
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: '',
},
]);
interface AreaIds {
city?: string;
cityId?: number;
creationTime?: string;
creator?: string;
id?: number;
province?: string;
provinceId?: number;
}
const areaList = ref<AreaIds[]>([]);
const handleCancel = () => {
addressVisibleClose();
};
......@@ -316,14 +255,13 @@
ghscode: ghsCode,
};
});
param.value.areas = checkboxValue.value.join;
console.log(param.value);
param.value.areas = checkboxValue.value;
confirmLoading.value = true;
const res = await regionalSpotManageOpsAddProductApi(param.value);
if (res.code === 20000) {
if (res.success) {
message.success('新增成功');
addressVisibleClose();
emit('close', false);
emit('close', false, 'refresh');
} else {
message.error(res.message);
}
......@@ -359,11 +297,11 @@
>
<a-select-option
v-for="item in searchBrandList"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.brand"
:label="item.brand"
:value="item.brand"
>
{{ item.label }}
{{ item.brand }}
</a-select-option>
</a-select>
<span style="margin-left: 15px">货号:</span>
......@@ -373,7 +311,7 @@
placeholder="请输入货号"
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>
</div>
<div class="main">
......@@ -392,13 +330,13 @@
:rowKey="(record) => record.brand + record.goodsNo + record.spec"
:scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName"
:loading="loading"
:loading="leftLoading"
>
<!-- <template #bodyCell="{ column, record }">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'productName'">
<span>{{ record.chineseName ? record.chineseName : record.englishName }}</span>
</template>
</template> -->
</template>
</a-table>
</div>
</div>
......@@ -440,7 +378,13 @@
:scroll="{ x: false, y: 280 }"
:rowClassName="rowClassName"
: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>
......@@ -472,7 +416,7 @@
<a-checkbox-group v-model:value="checkboxValue" style="width: 100%">
<a-row>
<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-row>
</a-checkbox-group>
......
<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
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 = []
list.value = [];
}
listLoading.value = false
}
listLoading.value = false;
};
</script>
<template>
......@@ -36,39 +34,39 @@ 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.status == 0 ? '待进行 ': (record.status == 1 ? '进行中' : '已完成') }}</p>
<template #default="{ 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}">
<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.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>
<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>
<style lang="less" scoped></style>
......@@ -29,7 +29,7 @@
sysid: record.sysid,
});
const res = await taskCenterRevokeExcelUploadApi(param.value);
if (res.code === 20000) {
if (res.success) {
message.success('操作成功');
getList();
} else {
......@@ -39,7 +39,7 @@
const getList = async () => {
listLoading.value = true;
const res = await taskCenterQueryListApi({ type: 0 });
if (res.code === 20000) {
if (res.success) {
list.value = res.data;
} else {
list.value = [];
......
<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>
<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