This commit is contained in:
yuhawu 2025-08-25 09:48:12 +08:00
parent 830e78e376
commit 263a27c6a4
17 changed files with 2049 additions and 2034 deletions

View File

@ -15,3 +15,6 @@ export { userLoginApi } from './modules/userLogin'
export { priceTemplateApi } from './modules/priceTemplate'
export { filterSetApi } from './modules/filterSet'
export { shopGoodsPublishedApi } from './modules/shopGoodsPublished'
// 导出店铺订单接口
export * as shopOrderApi from './modules/shopOrder'

View File

@ -28,6 +28,11 @@ export function setupResponseInterceptors(instance) {
return response;
}
// 如果是获取图片接口,直接返回字符串数据
if (config.url && config.url.includes('/zhishu/image/getImage')) {
return data;
}
// 对于普通的JSON响应进行业务逻辑检查
if (data.code != 200) {
const error = new Error(data.message || '业务逻辑错误');

View File

@ -4,7 +4,7 @@ const ImageApi = {
/**
* 获取商品标准类目接口
*/
getImage: (data) => instance.get('/zhishu/image/getImage', data),
getImage: (params) => instance.get('/zhishu/image/getImage', { params }),
/**
* 用户上传图片接口

View File

@ -65,7 +65,13 @@ const depotApi = {
* @param {Number|String} id - 二级货架ID
* @returns {Promise} - 请求Promise
*/
getFreightByShelveId: (id) => instance.get(`/depot/freight/${id}`)
getFreightByShelveId: (id) => instance.get(`/depot/freight/${id}`),
/**
* 获取仓库名称列表
* @returns {Promise} - 请求Promise
*/
getDepotNameList: () => instance.get('/depot/nameList')
}
// 导出模块

View File

@ -9,9 +9,15 @@ export const getProvinces = () => {
return instance.get('/district/provinces');
};
// 获取运费信息
export const getFreInfo = (templateId) => {
return instance.get(`/district/freInfo/${templateId}`);
};
// 为了向后兼容,也导出整个对象
export const districtApi = {
getProvinces,
getFreInfo
};
export default districtApi;

View File

@ -57,6 +57,11 @@ export const updateSyncOrderStatus = (id, isSynOrder) => {
});
};
// 加密URL方法
export const encrypUrlMenthod = (data) => {
return instance.post('/shop/encrypUrl', data);
};
// 为了向后兼容,也导出整个对象
export const shopApi = {
getShopList,
@ -66,5 +71,6 @@ export const shopApi = {
updateShop,
deleteShop,
batchDeleteShop,
updateSyncOrderStatus
updateSyncOrderStatus,
encrypUrlMenthod
};

View File

@ -92,7 +92,17 @@ const taskApi = {
// 中心图书接口
centerBooks: (jsonStr) => instance.post('/task/centerBooks', `jsonStr=${jsonStr}`, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}),
// 获取重复数据
getRepeatData: (shopId, pageNum, pageSize) => instance.get(`/task/getRepeatData?shopId=${shopId}&pageNum=${pageNum}&pageSize=${pageSize}`),
// 根据任务类型查询任务状态
selectTaskStatusByTaskType: (shopId, taskType) => instance.get(`/task/selectTaskStatusByTaskType?shopId=${shopId}&taskType=${taskType}`),
// 获取店铺任务总数
getShopTaskAllNum: (shopId, taskType) => instance.get(`/task/getShopTaskAllNum?shopId=${shopId}&taskType=${taskType}`),
};
// 导出模块

View File

@ -1,10 +1,14 @@
import RefreshButton from './RefreshButton.vue'
import ActionBar from './ActionBar.vue'
import RightToolbar from './RightToolbar.vue'
import Pagination from './Pagination.vue'
// 全局组件列表
const components = [
RefreshButton,
ActionBar
ActionBar,
RightToolbar,
Pagination
]
// 全局注册方法

View File

@ -79,6 +79,14 @@ const menuData = shallowRef([
{
title: '价格模板',
path: '/shop/priceTemplate'
},
{
title: '发布商品数据',
path: '/shop/shopPublishedData'
},,
{
title: '店铺商品',
path: '/shop/pddGoods'
}
]
},
@ -111,6 +119,10 @@ const menuData = shallowRef([
title: '已发布书品管理',
path: '/book/shopGoodsPublished'
// permission: 'book:shopGoodsPublished:view'
},
{
title: '书品导入任务列表',
path: '/book/excelTask'
}
]
},
@ -130,6 +142,18 @@ const menuData = shallowRef([
}
]
},
{
title: '订单中心',
path: '/order',
icon: Box,
children: [
{
title: '订单信息',
path: '/order/shopOrder'
//
}
]
},
{
title: '工具管理',
path: '/tools',
@ -154,6 +178,10 @@ const menuData = shallowRef([
{
title: '违规列表',
path: '/examine/violation/list'
},
{
title: '图书审核管理',
path: '/bookAudit'
}
]
},
@ -192,6 +220,16 @@ const menuData = shallowRef([
}
]
},
{
title: '申请入驻',
path: '/audit',
children: [
{
title: '审核',
path: '/audit/audit',
}
]
},
{
title: '升级完整版',
path: '/NewUser',

View File

@ -82,6 +82,11 @@ const routes = [{
component: () => import('@/views/Examine/Violation/List.vue'),
meta: { title: '违规列表' }
},
{
path: '/bookAudit',
component: () => import('@/views/bookAudit/index.vue'),
meta: { title: '图书审核管理' }
},
// 日志管理
{
path: '/log/runningLog/list',
@ -153,6 +158,31 @@ const routes = [{
path: '/purse/userRecharge',
component: () => import('@/views/UserRecharge/index.vue'),
meta: { title: '用户充值' }
},
{
path: '/shop/shopPublishedData',
component: () => import('@/views/onlineProducts/index.vue'),
meta: { title: '发布商品数据' }
},
{
path: '/order/shopOrder',
component: () => import('@/views/shopOrder/index.vue'),
meta: { title: '订单信息' }
},
{
path: '/book/excelTask',
component: () => import('@/views/excelTask/index.vue'),
meta: { title: '书品导入任务列表' }
},
{
path: '/audit/audit',
component: () => import('@/views/Audit/index.vue'),
meta: { title: '审核' }
},
{
path: '/shop/pddGoods',
component: () => import('@/views/pddGoods/index.vue'),
meta: { title: '店铺商品' }
}
]

View File

@ -175,7 +175,10 @@
</div>
</template>
<script setup name="ShopGoodsPublished">
<script setup>
defineOptions({
name: 'ShopGoodsPublished'
})
import { getShopGoodsPublishedList, deleteShopGoodsPublished } from '@/api/modules/shopGoodsPublished'
import { getListShop } from '@/api/modules/shop'
import { ref, reactive, onMounted } from 'vue'

View File

@ -248,7 +248,10 @@
</div>
</template>
<script setup name="Task">
<script setup>
defineOptions({
name: 'Task'
})
import { taskApi } from '@/api/modules/task.js';
import { pddApi } from '@/api/modules/pdd.js';
import { shopApi } from '@/api/modules/shop.js';

View File

@ -173,7 +173,10 @@
</div>
</template>
<script setup name="UserRecharge">
<script setup>
defineOptions({
name: 'UserRecharge'
})
import { ref, reactive, onMounted, getCurrentInstance, toRefs } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { userRechargeApi } from '@/api/modules/userRecharge.js'

View File

@ -237,7 +237,10 @@
</template>
<script setup name="Logistics">
<script setup>
defineOptions({
name: 'Logistics'
})
import { ref, reactive, computed, onMounted, toRefs } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'

View File

@ -1,12 +1,14 @@
<template>
<div class="p-2">
<transition enter-active-class="animate__animated animate__fadeInDown" leave-active-class="animate__animated animate__fadeOutUp">
<transition enter-active-class="animate__animated animate__fadeInDown"
leave-active-class="animate__animated animate__fadeOutUp">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="店铺" prop="shopId">
<el-select v-model="queryParams.shopId" placeholder="请选择店铺">
<el-option v-for="item in shopList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in shopList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="商家编码" prop="itemNumber">
@ -25,7 +27,8 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['zhishu:shopGoodsPublished:remove']">删除</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
v-hasPermi="['zhishu:shopGoodsPublished:remove']">删除</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -35,13 +38,8 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="图示" align="center" prop="bookPic" :show-overflow-tooltip="true">
<template #default="{ row }">
<el-image
style="width: 50px;height: 50px"
:src="row.bookPic"
fit="scale-down"
:preview-src-list="[row.bookPic]"
preview-teleported
>
<el-image style="width: 50px;height: 50px" :src="row.bookPic" fit="scale-down"
:preview-src-list="[row.bookPic]" preview-teleported>
<template #error>
<div class="image-slot">
暂无
@ -55,23 +53,14 @@
<el-table-column label="线上商品名称" align="left" prop="goodsName" :show-overflow-tooltip="true">
<template #default="{ row }">
<div class="truncate-cell">
<el-link
v-if="row.shopType === 1"
type="primary"
:href="`https://mobile.yangkeduo.com/goods.html?goods_id=${row.onlineId}`"
target="_blank"
:underline="false"
>
<el-link v-if="row.shopType === 1" type="primary"
:href="`https://mobile.yangkeduo.com/goods.html?goods_id=${row.onlineId}`" target="_blank"
:underline="false">
{{ row.goodsName }}
</el-link>
<el-link
v-else-if="row.shopType === 2"
type="primary"
:href="`https://book.kongfz.com/${row.mallId}/${row.onlineId}`"
target="_blank"
:underline="false"
>
<el-link v-else-if="row.shopType === 2" type="primary"
:href="`https://book.kongfz.com/${row.mallId}/${row.onlineId}`" target="_blank" :underline="false">
{{ row.goodsName }}
</el-link>
</div>
@ -91,17 +80,21 @@
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
</template>
<script setup name="ShopGoodsPublished">
import { getShopGoodsPublishedList, deleteShopGoodsPublished } from '@/api/modules/shopGoodsPublished';
import { getListShop } from '@/api/zhishu/shop';
<script setup>
defineOptions({
name: 'ShopGoodsPublished'
})
// import { getShopGoodsPublishedList, deleteShopGoodsPublished } from '@/api/modules/shopGoodsPublished';
import { shopGoodsPublishedApi } from '@/api/modules/shopGoodsPublished';
import { getListShop } from '@/api/modules/shop';
import { ref, reactive, toRefs, onMounted } from 'vue';
import { depotNameList } from '@/api/zhishu/shelves';
import { ElMessage, ElMessageBox } from 'element-plus';
//
@ -166,8 +159,8 @@
const getList = async () => {
loading.value = true;
try {
const res = await getShopGoodsPublishedList(queryParams.value);
shopGoodsPublishedList.value = res.data.rows || res.rows || [];
const res = await shopGoodsPublishedApi.getShopGoodsPublishedList(queryParams.value);
shopGoodsPublishedList.value = res.data.list|| [];
total.value = res.data.total || res.total || 0;
} catch (error) {
console.error('获取列表失败:', error);
@ -177,25 +170,6 @@
}
}
const depotList = ref([]);
const selectedId = ref(null);
const handleDepotChange = (val) => {
queryParams.value.depotId = val?.id || null;
}
const loadData = async () => {
loading.value = true;
try {
const res = await depotNameList();
depotList.value = res.rows || [];
} catch (error) {
console.error('加载数据失败:', error);
} finally {
loading.value = false;
}
}
const conditionCodeTypes = [
{ value: '1', label: '一品' },
{ value: '2', label: '二品' },
@ -242,7 +216,7 @@
type: 'warning'
});
await deleteShopGoodsPublished(_ids);
await shopGoodsPublishedApi.deleteShopGoodsPublished(_ids);
ElMessage.success("删除成功");
await getList();
} catch (error) {
@ -279,8 +253,7 @@
onMounted(() => {
getList();
loadData();
getShopList();
// getShopList();
});
</script>

View File

@ -74,7 +74,7 @@
<div class="login-url">
<p class="url-label">后台管理系统地址</p>
<div class="url-box">
<span class="url-text">https://erp.buzhiyushu.cn/</span>
<a class="url-text" href="https://erp.buzhiyushu.cn/" target="_blank" rel="noopener noreferrer">https://erp.buzhiyushu.cn/</a>
<el-button type="primary" size="small" @click="copyLoginUrl" class="copy-btn">
复制链接
</el-button>

View File

@ -1,5 +1,6 @@
<template>
<div class="p-2">
<transition enter-active-class="animate__animated animate__fadeInDown" leave-active-class="animate__animated animate__fadeOutUp">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
@ -16,11 +17,9 @@
<el-input v-model="queryParams.originalArtNo" placeholder="请输入原始货号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="ISBN" prop="isbn">
<el-input v-model="queryParams.isbn" style="width: 300px" placeholder="请输入ISBN" clearable
@keyup.enter="handleQuery">
<el-input v-model="queryParams.isbn" style="width: 300px" placeholder="请输入ISBN" clearable @keyup.enter="handleQuery">
<template #append>
<el-select v-model="isIsbnChange" clearable placeholder="有无ISBN" style="width: 110px"
@change="handleLocationTypeChange">
<el-select v-model="isIsbnChange" clearable placeholder="有无ISBN" style="width: 110px" @change="handleLocationTypeChange">
<el-option v-for="item in isbnSelect" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</template>
@ -28,22 +27,49 @@
</el-form-item>
<el-form-item label="品相" prop="conditionCode">
<!-- <el-input v-model="queryParams.conditionCode" placeholder="请输入品相" clearable @keyup.enter="handleQuery" />-->
<el-select v-model="queryParams.conditionCode" filterable placeholder="请选择品相" style="width: 240px">
<el-option v-for="item in t_condition_code" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="queryParams.conditionCode"
filterable
placeholder="请选择品相"
style="width: 240px"
>
<el-option
v-for="item in t_condition_code"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="书图片" prop="bookPic">
<el-select v-model="queryParams.IsBookPicNull" placeholder="请选择图片状态" clearable filterable
@change="handleQuery">
<el-option label="有图片" value="1" :title="'book_pic字段不为空的记录'" />
<el-option label="无图片" value="0" :title="'book_pic字段为空的记录'" />
<el-select
v-model="queryParams.IsBookPicNull"
placeholder="请选择图片状态"
clearable
filterable
@change="handleQuery"
>
<el-option
label="有图片"
value="1"
:title="'book_pic字段不为空的记录'"
/>
<el-option
label="无图片"
value="0"
:title="'book_pic字段为空的记录'"
/>
</el-select>
</el-form-item>
<el-form-item label="商品售价" prop="price">
<div class="condition-filter">
<!-- 选择运算符 -->
<el-select v-model="Min1Price" placeholder="运算符" style="width: 100px; margin-right: 10px;">
<el-select
v-model="Min1Price"
placeholder="运算符"
style="width: 100px; margin-right: 10px;"
>
<el-option label="大于" value=">"></el-option>
<el-option label="大于等于" value=">="></el-option>
<el-option label="等于" value="="></el-option>
@ -51,7 +77,12 @@
<el-option label="小于等于" value="<="></el-option>
</el-select>
<!-- 输入数值 -->
<el-input-number v-model="Max1Price" :min="0" :max="10000000" controls-position="right"></el-input-number>
<el-input-number
v-model="Max1Price"
:min="0"
:max="10000000"
controls-position="right"
></el-input-number>
</div>
</el-form-item>
<!-- <el-form-item label="商品售价" prop="price">-->
@ -91,7 +122,11 @@
<el-form-item label="库存" prop="price">
<div class="condition-filter">
<!-- 选择运算符 -->
<el-select v-model="Min2Inventory" placeholder="运算符" style="width: 100px; margin-right: 10px;">
<el-select
v-model="Min2Inventory"
placeholder="运算符"
style="width: 100px; margin-right: 10px;"
>
<el-option label="大于" value=">"></el-option>
<el-option label="大于等于" value=">="></el-option>
<el-option label="等于" value="="></el-option>
@ -99,8 +134,12 @@
<el-option label="小于等于" value="<="></el-option>
</el-select>
<!-- 输入数值 -->
<el-input-number v-model="Max2Inventory" :min="0" :max="10000000"
controls-position="right"></el-input-number>
<el-input-number
v-model="Max2Inventory"
:min="0"
:max="10000000"
controls-position="right"
></el-input-number>
</div>
</el-form-item>
@ -127,8 +166,8 @@
</el-form-item>
<el-form-item label="发货地" prop="address">
<el-select v-model="deliveryId" value-key="id" placeholder="请选择发货地" :reserve-keyword="false" clearable
filterable :loading="loading" @update:model-value="handleDistChange">
<el-select v-model="deliveryId" value-key="id" placeholder="请选择发货地" :reserve-keyword="false"
clearable filterable :loading="loading" @update:model-value="handleDistChange">
<el-option v-for="item in districtList" :key="item.id" :label="item.name" :value="item" />
</el-select>
</el-form-item>
@ -140,55 +179,59 @@
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain @click="handleAdd" v-hasPermi="['zhishu:shopGoods:add']">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['zhishu:shopGoods:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain :disabled="single" @click="handleUpdate()"
v-hasPermi="['zhishu:shopGoods:edit']">修改</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['zhishu:shopGoods:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain :disabled="multiple" @click="handleDelete()"
v-hasPermi="['zhishu:shopGoods:remove']" disabled="true">删除</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['zhishu:shopGoods:remove']" disabled="true">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain @click="handleExport"
v-hasPermi="['zhishu:shopGoods:export']">导出</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['zhishu:shopGoods:export']">导出</el-button>
</el-col>
<!-- 导出模板按钮-->
<el-col :span="1.5">
<el-button type="warning" plain @click="handleDownload">导出模板</el-button>
<el-button type="warning" plain icon="Histogram" @click="handleDownload">导出模板</el-button>
</el-col>
<!-- 导出模板按钮-->
<!-- 重写导入按钮-->
<el-col :span="1.5">
<el-button type="primary" plain @click="dialogVisible = true">导入</el-button>
<el-button type="primary" plain icon="Upload" @click="dialogVisible = true">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain @click="goodsAddBtn()" :disabled="multiple"
v-hasPermi="['zhishu:shopGoods:goodsAdd']">发布</el-button>
<el-button type="primary" plain icon="Upload" @click="goodsAddBtn()" :disabled="multiple" v-hasPermi="['zhishu:shopGoods:goodsAdd']">发布</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain @click="handleUpdateCargo()" :disabled="multiple"
v-hasPermi="['zhishu:shopGoods:batchUpdateCargo']">批量修改货区</el-button>
<el-button type="primary" plain icon="Edit" @click="handleUpdateCargo()" :disabled="multiple" v-hasPermi="['zhishu:shopGoods:batchUpdateCargo']">批量修改货区</el-button>
</el-col>
<el-upload ref="uploadRef" class="upload-demo" accept=".xlsx, .xls" :headers="headers"
:action="`${uploadAction}?depotId=${selectedDepotId}`" :on-success="onSuccess" :on-error="onError"
:limit="3" :data="uploadForm.data">
<el-upload
ref="uploadRef"
class="upload-demo"
accept=".xlsx, .xls"
:headers="headers"
:action="`${uploadAction}?depotId=${selectedDepotId}`"
:on-success ="onSuccess"
:on-error ="onError"
:limit="3"
:data="uploadForm.data"
>
</el-upload>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="shopGoodsList" @selection-change="handleSelectionChange"
@expand-change="handleExpandChange">
<el-table v-loading="loading" :data="shopGoodsList" @selection-change="handleSelectionChange" @expand-change="handleExpandChange" >
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="expand">
<template #default="{ row }">
@ -199,18 +242,10 @@
<el-table-column label="用户名" prop="userName" />
<el-table-column label="操作类型" prop="type">
<template #default="scope">
<span v-if="scope.row.type === 1">手动修改</span>
<span v-else-if="scope.row.type === 2">订单减扣</span>
<span v-else-if="scope.row.type === 3">退单添加</span>
<span v-else-if="scope.row.type === 4">小程序上书</span>
<span v-else>未知操作</span>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="createdTime">
<template #default="scope">
{{ formatDateTime(scope.row.createdTime) }}
<dict-tag :options="t_stock_type" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="操作时间" prop="createTime" />
</el-table>
</template>
</el-table-column>
@ -226,8 +261,14 @@
<el-table-column label="商品编号" align="left" prop="itemNumber" width="110" />
<el-table-column label="缩略图" align="left" prop="goodsName" width="70" :show-overflow-tooltip="true" >
<template #default="{ row }">
<el-image style="width: 30px;height: 30px" :src="row.bookPic" fit="scale-down"
:preview-src-list="[currentPreviewImg]" preview-teleported @click="handlePreview(row.bookPic)">
<el-image
style="width: 30px;height: 30px"
:src="row.bookPic"
fit="scale-down"
:preview-src-list="[currentPreviewImg]"
preview-teleported
@click="handlePreview(row.bookPic)"
>
<template #error>
<div class="image-slot">
暂无
@ -300,27 +341,27 @@
<el-table-column label="库存" align="left" prop="inventory" width="60"/>
<el-table-column label="入库时间" align="left" prop="createdTime" :show-overflow-tooltip="true" width="150">
<el-table-column label="入库时间" align="left" prop="createTime" :show-overflow-tooltip="true">
<template #default="{ row }">
<div class="truncate-cell"> <!-- 文本截断容器 -->
{{ formatDateTime(row.createdTime) }}
{{ row.createTime }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)"
v-hasPermi="['zhishu:shopGoods:edit']">修改</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)"
v-hasPermi="['zhishu:shopGoods:remove']">删除</el-button>
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['zhishu:shopGoods:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['zhishu:shopGoods:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination v-show="total > 0" :current-page="queryParams.pageNum" :page-size="queryParams.pageSize"
:page-sizes="[10, 20, 30, 50]" :total="total" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 删除商品信息对话框 -->
@ -351,11 +392,8 @@
<!-- 第一组字段 -->
<el-col :span="12">
<el-form-item label="一级货区名称" prop="depotIds" label-width="110">
<el-select v-model="selectedId" :disabled="!dialog.isAdd" value-key="id" placeholder="请选择一级货区"
:reserve-keyword="false" :get-option-key="getOptionKey" clearable filterable style="width: 100%"
:loading="loading" @update:model-value="handleDepotChange">
<el-option v-for="item in depotList" :key="item.id" :label="item.name + '' + item.unit"
:disabled="!dialog.isAdd" :value="item" />
<el-select v-model="selectedId" :disabled="!dialog.isAdd" value-key="id" placeholder="请选择一级货区" :reserve-keyword="false" :get-option-key="getOptionKey" clearable filterable style="width: 100%" :loading="loading" @update:model-value="handleDepotChange">
<el-option v-for="item in depotList" :key="item.id" :label="item.name+''+item.unit" :disabled="!dialog.isAdd" :value="item" />
</el-select>
</el-form-item>
</el-col>
@ -367,11 +405,8 @@
<!-- 第十组字段 -->
<el-col :span="12">
<el-form-item label="品相" prop="conditionCode" >
<el-select v-model="conditionCodeId" :disabled="!dialog.isAdd" value-key="value" placeholder="请选择品相"
:reserve-keyword="false" clearable filterable style="width: 100%" :loading="loading"
@update:model-value="handleconditionCodeChange">
<el-option v-for="item in conditionCodeTypes" :key="item.value" :label="item.label"
:value="item.label" :disabled="!dialog.isAdd" />
<el-select v-model="conditionCodeId" :disabled="!dialog.isAdd" value-key="id" placeholder="请选择品相" :reserve-keyword="false" :get-option-key="getOptionKey" clearable filterable style="width: 100%" :loading="loading" @update:model-value="handleconditionCodeChange">
<el-option v-for="item in conditionCodeTypes" :key="item.value" :label="item.label" :value="item.label" :disabled="!dialog.isAdd"/>
</el-select>
</el-form-item>
</el-col>
@ -421,8 +456,13 @@
</el-col>
<el-col :span="12">
<el-form-item label="出版时间" prop="publicationTime">
<el-date-picker v-model="form.publicationTime" type="datetime" placeholder="选择日期时间"
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
<el-date-picker
v-model="form.publicationTime"
type="datetime"
placeholder="选择日期时间"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
<!-- 第五组字段 -->
@ -501,11 +541,16 @@
<!-- 右侧图片上传区域 -->
<el-col :span="12">
<el-card shadow="hover" header="商品图片上传">
<el-upload list-type="picture-card" :limit="10" :file-list="[]" :action="uploadiMage" accept=".jpg,.png"
:on-success="handleSuccess" :before-upload="beforeUpload">
<el-icon>
<Plus />
</el-icon>
<el-upload
list-type="picture-card"
:limit="10"
:file-list="[]"
:action="uploadiMage"
accept=".jpg,.png"
:on-success="handleSuccess"
:before-upload="beforeUpload"
>
<el-icon><Plus /></el-icon>
<div>点击上传</div>
</el-upload>
<!-- 独立展示区可选 -->
@ -514,17 +559,23 @@
<h4>已上传图片 {{ fileList.length }} </h4>
<div class="image-grid" v-if="fileList.length" >
<div v-for="(file, index) in fileList" :key="file.uid" class="grid-item">
<el-image :src="file.url" fit="cover" :preview-src-list="previewList" :initial-index="index">
<el-image
:src="file.url"
fit="cover"
:preview-src-list="previewList"
:initial-index="index">
<template #placeholder>
<div class="image-loading">加载中...</div>
</template>
</el-image>
<div class="meta-info">
<span class="file-name">{{ file.name }}</span>
<el-button size="mini" type="danger" @click="removeFile(index)" circle>
<el-icon>
<Delete />
</el-icon>
<el-button
size="mini"
type="danger"
@click="removeFile(index)"
circle>
<el-icon><Delete /></el-icon>
</el-button>
</div>
</div>
@ -545,11 +596,18 @@
</el-dialog>
<!-- 导入弹窗事件-->
<el-dialog v-model="dialogVisible" title="选择货区" width="30%" @close="dialogVisible = false">
<el-dialog v-model="dialogVisible"
title = "选择货区"
width = "30%"
@close="dialogVisible=false">
<el-form ref="shelvesFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="一级货区名称" prop="depotId" label-width="100">
<el-select v-model="selectedId" value-key="id" placeholder="请选择一级货区" :reserve-keyword="false"
:get-option-key="getOptionKey" clearable filterable style="width: 100%" :loading="loading">
<el-select v-model="selectedId"
value-key="id" placeholder="请选择一级货区"
:reserve-keyword="false"
:get-option-key="getOptionKey"
clearable filterable style="width: 100%"
:loading="loading">
<el-option v-for="item in depotList" :key="item.id" :label="item.name+''+item.unit" :value="item" />
</el-select>
</el-form-item>
@ -568,7 +626,12 @@
<el-form-item label="孔夫子:" prop="shopIds" label-width="100px" style="width: 100%">
<!-- 孔夫子整行 -->
<el-checkbox-group v-model="formShops.shopIds" style="flex: 1;">
<el-checkbox v-for="item in kfzShopList" :key="item.value" :label="item.value" style="margin-right: 15px;">
<el-checkbox
v-for="item in kfzShopList"
:key="item.value"
:label="item.value"
style="margin-right: 15px;"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
@ -576,7 +639,12 @@
<el-form-item label="拼多多:" prop="shopIds" label-width="100px" style="width: 100%">
<!-- 拼多多整行 -->
<el-checkbox-group v-model="formShops.shopIds" style="flex: 1;">
<el-checkbox v-for="item in pddShopList" :key="item.value" :label="item.value" style="margin-right: 15px;">
<el-checkbox
v-for="item in pddShopList"
:key="item.value"
:label="item.value"
style="margin-right: 15px;"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
@ -669,9 +737,7 @@ import {
} from '@/api/modules/shopGoods.js';
import { getListShop } from '@/api/modules/shop.js';
import { depotApi } from '@/api/modules/depot.js';
import { getDepotNameList, getShelvesNameList, getFreightNameList } from '@/api/modules/shelves.js';
import { getProvinces } from '@/api/modules/district.js';
import { getLogistics } from '@/api/modules/logistics.js';
import { getFreInfo, getProvinces } from '@/api/modules/district.js';
import { ElMessage, ElMessageBox } from 'element-plus';
import { Plus } from '@element-plus/icons-vue';
@ -693,22 +759,7 @@ const shopGoodsFormRef = ref();
// proxy
const t_stock_type = ref([]);
const t_condition_code = ref([
{ value: 'A', label: '一品' },
{ value: 'B', label: '二品' },
{ value: 'C', label: '三品' },
{ value: 'D', label: '四品' },
{ value: 'E', label: '五品' },
{ value: 'F', label: '六品' },
{ value: 'G', label: '六五品' },
{ value: 'H', label: '七品' },
{ value: 'I', label: '七五品' },
{ value: 'J', label: '八品' },
{ value: 'K', label: '八五品' },
{ value: 'L', label: '九品' },
{ value: 'M', label: '九五品' },
{ value: 'N', label: '全新' }
]);
const t_condition_code = ref([]);
const dialog = reactive({
visible: false,
@ -774,32 +825,30 @@ const props = {
let nodes = [];
if (level === 0) {
//
const res = await getDepotNameList();
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getDepotList();
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: false,
})) : [];
}));
} else if (level === 1) {
//
const res = await getShelvesNameList(value);
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getShelvesByDepotId(value);
// APIID
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: false,
})) : [];
}));
} else if (level === 2) {
//
const res = await getFreightNameList(value);
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getFreightByShelveId(value); // APIID
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: true
})) : [];
}));
}
resolve(nodes);
} catch (error) {
@ -831,10 +880,7 @@ const PricingMethod = ref('')
const shippingPop = async (row) => {
// id
if (row.templateId != null) {
try {
const res = await getLogistics(row.templateId);
console.log('物流模板数据:', res);
const res = await getFreInfo(row.templateId);
//
const pricingMethodMap = {
0: 'weight',
@ -842,31 +888,13 @@ const shippingPop = async (row) => {
2: 'piece',
3: 'custom'
};
//
const logisticsData = res.data || res;
PricingMethod.value = pricingMethodMap[logisticsData.pricingMethod] || 'weight';
PricingMethod.value = pricingMethodMap[res.pricingMethod];
//
if (logisticsData.shippingRange) {
try {
const parsedData = JSON.parse(logisticsData.shippingRange);
deliveryRanges.value = transformData(parsedData);
console.log('转换后的运送范围:', deliveryRanges.value);
} catch (parseError) {
console.error('解析运送范围失败:', parseError);
ElMessage.error('运送范围数据格式错误');
return;
}
} else {
deliveryRanges.value = [];
}
if (res.shippingRange != null) {
const parsedData = JSON.parse(res.shippingRange);
deliveryRanges.value = transformData(parsedData)
} else { }
freightDialog.visible = true;
} catch (error) {
console.error('获取物流模板失败:', error);
ElMessage.error('获取运费模板失败');
}
} else {
ElMessage.warning("该商品无运费模版")
}
@ -887,6 +915,9 @@ const transformData = (dataRange) => {
return result;
}
// proxy
const is_query_all_goods = ref([]);
const is_join_distribution = ref([]);
//
const chageNumber = async () => {
@ -957,10 +988,9 @@ const triggerFileSelect = () => {
const loadData = async () => {
loading.value = true
try {
const res = await getDepotNameList()
depotList.value = res.data || res.rows || res || []
const res = await depotApi.getDepotList()
depotList.value = res.rows || res.data
} catch (error) {
console.error('加载仓库数据失败:', error)
} finally {
loading.value = false
}
@ -1034,31 +1064,25 @@ const conditionCodeId = ref(null)
//
const conditionCodeTypes = [
{ value: 'A', label: '一品' },
{ value: 'B', label: '二品' },
{ value: 'C', label: '三品' },
{ value: 'D', label: '四品' },
{ value: 'E', label: '五品' },
{ value: 'F', label: '六品' },
{ value: 'G', label: '六五品' },
{ value: 'H', label: '七品' },
{ value: 'I', label: '七五品' },
{ value: 'J', label: '八品' },
{ value: 'K', label: '八五品' },
{ value: 'L', label: '九品' },
{ value: 'M', label: '九五品' },
{ value: 'N', label: '全新' }
{ value: '1', label: '一品' },
{ value: '2', label: '二品' },
{ value: '3', label: '三品' },
{ value: '4', label: '四品' },
{ value: '5', label: '五品' },
{ value: '6', label: '六品' },
{ value: '6.5', label: '六五品' },
{ value: '7', label: '七品' },
{ value: '7.5', label: '七五品' },
{ value: '8', label: '八品' },
{ value: '8.5', label: '八五品' },
{ value: '9', label: '九品' },
{ value: '9.5', label: '九五品' },
{ value: '10', label: '全新' }
];
const handleconditionCodeChange = async (val) => {
//
const reverseConditionMap = {
'一品': 'A', '二品': 'B', '三品': 'C', '四品': 'D', '五品': 'E',
'六品': 'F', '六五品': 'G', '七品': 'H', '七五品': 'I', '八品': 'J',
'八五品': 'K', '九品': 'L', '九五品': 'M', '全新': 'N'
};
form.value.conditionCode = reverseConditionMap[val] || val;
form.value.conditionCode = val;
}
const publicationTime = ref('2025-04-26 15:30:00') //
@ -1268,41 +1292,42 @@ const propsCargo = {
let nodes = [];
if (level === 0) {
// - 使API
const res = await getDepotNameList();
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getDepotList();
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: false,
})) : [];
disabled: true
}));
} else if (level === 1) {
// - 使API
const res = await getShelvesNameList(value);
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getShelvesByDepotId(value);
// APIID
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: false,
})) : [];
disabled: true
}));
} else if (level === 2) {
// - 使API
const res = await getFreightNameList(value);
const dataList = res.data || res.rows || res || [];
nodes = Array.isArray(dataList) ? dataList.map(item => ({
// ID
const res = await depotApi.getFreightByShelveId(value); // APIID
nodes = (res.data || res.rows || []).map(item => ({
value: item.id,
label: `${item.name}${item.unit || ''}`,
leaf: true
})) : [];
}));
}
resolve(nodes);
} catch (error) {
console.error('加载批量修改货区级联数据失败:', error);
console.error('加载级联数据失败:', error);
resolve([]); //
}
};
//
setTimeout(fetchData, 30);
setTimeout(fetchData, 50);
},
}
@ -1323,11 +1348,8 @@ const getList = async () => {
}
const res = await getShopGoodsList(queryParams.value);
//
const responseData = res.data || res;
const dataList = responseData?.list || responseData?.rows || [];
shopGoodsList.value = Array.isArray(dataList) ? dataList : [];
total.value = responseData?.total || 0;
shopGoodsList.value = res.data?.rows || res.data || [];
total.value = res.data?.total || 0;
loading.value = false;
}
@ -1408,66 +1430,23 @@ const handleUpdate = async (row) => {
reset();
const _id = row?.id || ids.value[0]
const res = await getShopGoodsDetail(_id);
// -
//
selectedId.value = {
name: res.data.depotName,
id: res.data.depotId,
unit: '' // unit
id: res.data.depotId
}
//
form.value.id = res.data.id;
form.value.fixPrice = res.data.fixPrice / 100;
form.value.productId = res.data.productId;//
form.value.inventory = res.data.inventory;
form.value.itemNumber = res.data.itemNumber;
form.value.goodsName = res.data.goodsName;
form.value.isbn = res.data.isbn;
form.value.productId = res.data.productId;
form.value.inventory = res.data.inventory;
form.value.price = res.data.price / 100;
form.value.remark = res.data.remark;
// -
form.value.price = res.data.price ? (res.data.price / 100).toFixed(2) : '';
form.value.fixPrice = res.data.fixPrice ? (res.data.fixPrice / 100).toFixed(2) : '';
// -
const conditionMap = {
'A': '一品', 'B': '二品', 'C': '三品', 'D': '四品', 'E': '五品',
'F': '六品', 'G': '六五品', 'H': '七品', 'I': '七五品', 'J': '八品',
'K': '八五品', 'L': '九品', 'M': '九五品', 'N': '全新'
};
const conditionText = conditionMap[res.data.conditionCode] || res.data.conditionCode;
conditionCodeId.value = conditionText;
form.value.conditionCode = res.data.conditionCode; //
//
if (res.data.bookPic) {
const imageUrls = res.data.bookPic.split(',').filter(url => url.trim());
fileList.value = imageUrls.map((url, index) => ({
uid: Date.now() + index,
name: `image_${index + 1}.jpg`,
url: url.trim(),
status: 'success'
}));
form.value.bookPic = res.data.bookPic;
}
//
form.value.booksNumber = res.data.booksNumber;
form.value.pages = res.data.pages;
form.value.isPackage = res.data.isPackage?.toString() || '1';
form.value.publicationName = res.data.publicationName;
form.value.publicationTime = res.data.publicationTime;
form.value.author = res.data.author;
form.value.region = res.data.region;
form.value.translator = res.data.translator;
form.value.editor = res.data.editor;
form.value.booklets = res.data.booklets;
form.value.wordCount = res.data.wordCount;
form.value.bindType = res.data.bindType;
form.value.packing = res.data.packing?.toString() || '1';
form.value.isbn = res.data.isbn;
dialog.visible = true;
conditionCodeId.value = res.data.conditionCode;
form.value.conditionCode = res.data.conditionCode;
form.value.id = res.data.id;
dialog.isAdd = false;
dialog.title = "修改商品信息";
}
@ -1480,20 +1459,11 @@ const submitForm = () => {
const price = parseFloat(form.value.price) || 0;
const fixPrice = parseFloat(form.value.fixPrice) || 0;
//
const letterToChineseMap = {
'A': '一品', 'B': '二品', 'C': '三品', 'D': '四品', 'E': '五品',
'F': '六品', 'G': '六五品', 'H': '七品', 'I': '七五品', 'J': '八品',
'K': '八五品', 'L': '九品', 'M': '九五品', 'N': '全新'
};
const submitData = {
...form.value,
price: price * 100,
fixPrice: fixPrice * 100,
conditionCode: letterToChineseMap[form.value.conditionCode] || form.value.conditionCode
fixPrice: fixPrice * 100
};
if (form.value.id) {
form.value.depotId = selectedId.value.id;
form.value.price = price;
@ -1655,50 +1625,6 @@ const getDistrict = async () => {
districtList.value = res.data;
};
//
const formatDateTime = (timestamp) => {
if (!timestamp) return '-';
// (: 20250524171507)
let dateStr = timestamp.toString();
if (dateStr.length === 14) {
// : YYYYMMDDHHMMSS
const year = dateStr.substring(0, 4);
const month = dateStr.substring(4, 6);
const day = dateStr.substring(6, 8);
const hour = dateStr.substring(8, 10);
const minute = dateStr.substring(10, 12);
const second = dateStr.substring(12, 14);
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
//
const date = new Date(timestamp);
if (isNaN(date.getTime())) return '-';
return date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
});
};
//
const handleSizeChange = (val) => {
queryParams.value.pageSize = val;
queryParams.value.pageNum = 1;
getList();
};
//
const handleCurrentChange = (val) => {
queryParams.value.pageNum = val;
getList();
};
onMounted(() => {
getList();
loadData();
@ -1715,7 +1641,6 @@ onMounted(() => {
overflow: hidden;
text-overflow: ellipsis;
}
.dual-column-preview {
margin-top: 20px;
padding: 12px;
@ -1767,7 +1692,6 @@ onMounted(() => {
.image-loading {
@apply w-full h-full flex items-center justify-center text-sm text-gray-400;
}
.image-slot {
display: flex;
justify-content: center;
@ -1778,7 +1702,6 @@ onMounted(() => {
color: var(--el-text-color-secondary);
font-size: 10px;
}
/* 全局样式 */
/* 表头样式 */
/*:deep .el-table .nested-table {*/
@ -1788,13 +1711,12 @@ onMounted(() => {
background-color: var(--el-color-info-light-3) !important;
color: #000000 !important;
}
:deep .el-table .nested-table td {
background-color: var(--el-color-info-light-5);
color: #000000;
}
:deep(.el-radio__label) {
font-size: 24px;
}
</style>