重构菜单

This commit is contained in:
Richie 2025-05-19 14:18:49 +08:00
parent b25103036f
commit d6475ef6bb
4 changed files with 860 additions and 8 deletions

View File

@ -11,7 +11,7 @@
Target Server Version : 80200 Target Server Version : 80200
File Encoding : 65001 File Encoding : 65001
Date: 19/05/2025 13:45:24 Date: 19/05/2025 14:18:18
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -13414,25 +13414,25 @@ CREATE TABLE `sys_menu` (
-- ---------------------------- -- ----------------------------
INSERT INTO `sys_menu` VALUES (1, '订单管理', 0, 10, '/order', 'Layout', '', 1, 0, 'M', '0', '0', '', 'shopping', 'admin', '2023-12-27 15:00:27', 'admin', '2024-08-25 15:45:43', '系统管理目录'); INSERT INTO `sys_menu` VALUES (1, '订单管理', 0, 10, '/order', 'Layout', '', 1, 0, 'M', '0', '0', '', 'shopping', 'admin', '2023-12-27 15:00:27', 'admin', '2024-08-25 15:45:43', '系统管理目录');
INSERT INTO `sys_menu` VALUES (2, '售后管理', 0, 30, '/refund', 'Layout', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2023-12-27 15:00:27', 'admin', '2024-08-25 15:45:54', '至简官网地址'); INSERT INTO `sys_menu` VALUES (2, '售后管理', 0, 30, '/refund', 'Layout', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2023-12-27 15:00:27', 'admin', '2024-08-25 15:45:54', '至简官网地址');
INSERT INTO `sys_menu` VALUES (3, '店铺&平台设置', 0, 80, 'shop', 'Layout', '', 1, 0, 'M', '0', '0', '', 'dict', 'admin', '2023-12-29 13:29:44', 'admin', '2025-03-02 15:53:58', ''); INSERT INTO `sys_menu` VALUES (3, '店铺设置', 0, 9, 'shop', 'Layout', '', 1, 0, 'M', '0', '0', '', 'dict', 'admin', '2023-12-29 13:29:44', 'admin', '2025-05-19 14:12:51', '');
INSERT INTO `sys_menu` VALUES (4, '商品库管理', 0, 1, 'goods', 'Layout', '', 1, 0, 'M', '0', '0', '', 'international', 'admin', '2023-12-29 16:53:03', 'admin', '2025-03-24 10:36:31', ''); INSERT INTO `sys_menu` VALUES (4, '商品库管理', 0, 50, 'goods', 'Layout', '', 1, 0, 'M', '0', '0', '', 'international', 'admin', '2023-12-29 16:53:03', 'admin', '2025-05-19 14:06:53', '');
INSERT INTO `sys_menu` VALUES (5, '系统设置', 0, 99, '/system', 'Layout', '', 1, 0, 'M', '0', '0', '', 'system', 'admin', '2023-12-27 15:00:27', 'admin', '2023-12-29 09:07:42.856856', '系统管理目录'); INSERT INTO `sys_menu` VALUES (5, '系统设置', 0, 99, '/system', 'Layout', '', 1, 0, 'M', '0', '0', '', 'system', 'admin', '2023-12-27 15:00:27', 'admin', '2023-12-29 09:07:42.856856', '系统管理目录');
INSERT INTO `sys_menu` VALUES (100, '订单库', 1, 1, 'order_list', 'order/index', '', 1, 0, 'C', '0', '0', '', 'shopping', 'admin', '2023-12-27 15:00:27', 'admin', '2024-09-15 16:57:59', '用户管理菜单'); INSERT INTO `sys_menu` VALUES (100, '订单库', 1, 1, 'order_list', 'order/index', '', 1, 0, 'C', '0', '0', '', 'shopping', 'admin', '2023-12-27 15:00:27', 'admin', '2024-09-15 16:57:59', '用户管理菜单');
INSERT INTO `sys_menu` VALUES (101, '订单更新日志', 3, 32, 'order_pull_logs', 'order/shopOrder/pull_log', '', 1, 0, 'C', '0', '0', '', 'documentation', 'admin', '2023-12-27 15:00:27', 'admin', '2025-03-24 13:03:46', '角色管理菜单'); INSERT INTO `sys_menu` VALUES (101, '订单拉取日志', 1, 32, 'order_pull_logs', 'order/shopOrder/pull_log', '', 1, 0, 'C', '0', '0', '', 'documentation', 'admin', '2023-12-27 15:00:27', 'admin', '2025-05-19 14:11:59', '角色管理菜单');
INSERT INTO `sys_menu` VALUES (102, '店铺订单管理', 1, 3, 'shop_order_list', 'order/shopOrder/index', '', 1, 0, 'C', '0', '0', '', 'monitor', 'admin', '2023-12-27 15:00:27', 'admin', '2024-04-06 11:18:00', '菜单管理菜单'); INSERT INTO `sys_menu` VALUES (102, '店铺订单管理', 1, 3, 'shop_order_list', 'order/shopOrder/index', '', 1, 0, 'C', '0', '0', '', 'monitor', 'admin', '2023-12-27 15:00:27', 'admin', '2024-04-06 11:18:00', '菜单管理菜单');
INSERT INTO `sys_menu` VALUES (104, '售后中心', 2, 1, 'refund_list', 'refund/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-27 15:00:27', 'admin', '2024-09-15 18:58:16', '岗位管理菜单'); INSERT INTO `sys_menu` VALUES (104, '售后中心', 2, 1, 'refund_list', 'refund/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-27 15:00:27', 'admin', '2024-09-15 18:58:16', '岗位管理菜单');
INSERT INTO `sys_menu` VALUES (105, '售后拉取日志', 3, 36, 'refund_pull_logs', 'refund/shopRefund/pull_log', '', 1, 0, 'C', '0', '0', '', 'dict', 'admin', '2023-12-27 15:00:27', 'admin', '2025-03-24 13:03:54', '字典管理菜单'); INSERT INTO `sys_menu` VALUES (105, '售后拉取日志', 2, 36, 'refund_pull_logs', 'refund/shopRefund/pull_log', '', 1, 0, 'C', '0', '0', '', 'dict', 'admin', '2023-12-27 15:00:27', 'admin', '2025-05-19 14:12:28', '字典管理菜单');
INSERT INTO `sys_menu` VALUES (106, '店铺售后管理', 2, 2, 'shop_refund_list', 'refund/shopRefund/index', '', 1, 0, 'C', '0', '0', '', 'edit', 'admin', '2023-12-27 15:00:27', 'admin', '2024-07-20 11:56:11', '参数设置菜单'); INSERT INTO `sys_menu` VALUES (106, '店铺售后管理', 2, 2, 'shop_refund_list', 'refund/shopRefund/index', '', 1, 0, 'C', '0', '0', '', 'edit', 'admin', '2023-12-27 15:00:27', 'admin', '2024-07-20 11:56:11', '参数设置菜单');
INSERT INTO `sys_menu` VALUES (108, '店铺管理', 3, 1, 'shop_list', 'shop/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-29 09:14:02', 'admin', '2025-03-24 13:03:00', ''); INSERT INTO `sys_menu` VALUES (108, '店铺管理', 3, 1, 'shop_list', 'shop/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-29 09:14:02', 'admin', '2025-03-24 13:03:00', '');
INSERT INTO `sys_menu` VALUES (110, '平台参数设置', 3, 81, 'platform/setting', 'shop/platform/index', '', 1, 0, 'C', '0', '0', '', 'system', 'admin', '2023-12-29 13:32:41', 'admin', '2025-03-24 12:37:26', ''); INSERT INTO `sys_menu` VALUES (110, '店铺参数设置', 3, 81, 'platform/setting', 'shop/platform/index', '', 1, 0, 'C', '0', '0', '', 'system', 'admin', '2023-12-29 13:32:41', 'admin', '2025-05-19 14:08:08', '');
INSERT INTO `sys_menu` VALUES (112, '商品库SKU明细', 4, 10, 'sku_list', 'goods/spec/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-29 16:35:55', 'admin', '2024-09-08 16:14:25', ''); INSERT INTO `sys_menu` VALUES (112, '商品库SKU明细', 4, 10, 'sku_list', 'goods/spec/index', '', 1, 0, 'C', '0', '0', '', 'tree', 'admin', '2023-12-29 16:35:55', 'admin', '2024-09-08 16:14:25', '');
INSERT INTO `sys_menu` VALUES (116, '用户管理', 5, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', '', 'user', 'admin', '2023-12-27 15:00:27', '', '', '用户管理菜单'); INSERT INTO `sys_menu` VALUES (116, '用户管理', 5, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', '', 'user', 'admin', '2023-12-27 15:00:27', '', '', '用户管理菜单');
INSERT INTO `sys_menu` VALUES (117, '菜单管理', 5, 1, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', '', 'user', 'admin', '2023-12-27 15:00:27', '', '', '用户管理菜单'); INSERT INTO `sys_menu` VALUES (117, '菜单管理', 5, 1, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', '', 'user', 'admin', '2023-12-27 15:00:27', '', '', '用户管理菜单');
INSERT INTO `sys_menu` VALUES (2077, '店铺商品管理', 3, 21, 'shop_goods', 'shop/goods/index', NULL, 1, 0, 'C', '0', '0', '', 'shopping', 'admin', '2024-03-28 10:29:59', 'admin', '2025-03-24 12:37:43', ''); INSERT INTO `sys_menu` VALUES (2077, '店铺商品管理', 3, 21, 'shop_goods', 'shop/goods/index', NULL, 1, 0, 'C', '0', '0', '', 'shopping', 'admin', '2024-03-28 10:29:59', 'admin', '2025-03-24 12:37:43', '');
INSERT INTO `sys_menu` VALUES (2078, '添加ERP商品', 4, 99, 'create', 'goods/create', NULL, 1, 0, 'C', '1', '0', '', 'checkbox', 'admin', '2024-03-18 07:59:57', 'admin', '2024-09-07 16:41:46', ''); INSERT INTO `sys_menu` VALUES (2078, '添加ERP商品', 4, 99, 'create', 'goods/create', NULL, 1, 0, 'C', '1', '0', '', 'checkbox', 'admin', '2024-03-18 07:59:57', 'admin', '2024-09-07 16:41:46', '');
INSERT INTO `sys_menu` VALUES (2079, '字典管理', 5, 9, 'dict', 'system/dict/index', NULL, 1, 0, 'C', '0', '0', '', 'dict', 'admin', '2024-03-18 08:43:55', 'admin', '2024-03-18 08:44:08', ''); INSERT INTO `sys_menu` VALUES (2079, '字典管理', 5, 9, 'dict', 'system/dict/index', NULL, 1, 0, 'C', '0', '0', '', 'dict', 'admin', '2024-03-18 08:43:55', 'admin', '2024-03-18 08:44:08', '');
INSERT INTO `sys_menu` VALUES (2084, '快递公司库', 3, 99, 'logistics_companies', 'shipping/logistics/company', NULL, 1, 0, 'C', '1', '0', '', 'code', 'admin', '2024-03-21 20:05:09', 'admin', '2024-03-31 10:09:38', ''); INSERT INTO `sys_menu` VALUES (2084, '电子面单设置', 3, 22, 'ewaybill_account', 'shop/ewaybillAccount/index', NULL, 1, 0, 'C', '0', '0', '', 'code', 'admin', '2024-03-21 20:05:09', 'admin', '2025-05-19 14:17:30', '');
INSERT INTO `sys_menu` VALUES (2086, '定时任务配置', 3, 99, 'sys_task', 'system/task/index', NULL, 1, 0, 'C', '0', '0', '', 'time-range', 'admin', '2024-03-22 19:29:20', 'admin', '2025-03-02 15:55:12', ''); INSERT INTO `sys_menu` VALUES (2086, '定时任务配置', 3, 80, 'sys_task', 'system/task/index', NULL, 1, 0, 'C', '0', '0', '', 'time-range', 'admin', '2024-03-22 19:29:20', 'admin', '2025-05-19 14:14:06', '');
INSERT INTO `sys_menu` VALUES (2087, '发货管理', 0, 20, 'ship', NULL, NULL, 1, 0, 'M', '0', '0', '', 'guide', 'admin', '2024-03-30 17:36:10', 'admin', '2024-08-25 15:45:48', ''); INSERT INTO `sys_menu` VALUES (2087, '发货管理', 0, 20, 'ship', NULL, NULL, 1, 0, 'M', '0', '0', '', 'guide', 'admin', '2024-03-30 17:36:10', 'admin', '2024-08-25 15:45:48', '');
INSERT INTO `sys_menu` VALUES (2088, '发货快递管理', 2087, 9, 'ship_logistics', 'shipping/logistics/company', NULL, 1, 0, 'C', '0', '0', '', 'checkbox', 'admin', '2024-03-30 17:37:01', 'admin', '2024-12-08 16:19:02', ''); INSERT INTO `sys_menu` VALUES (2088, '发货快递管理', 2087, 9, 'ship_logistics', 'shipping/logistics/company', NULL, 1, 0, 'C', '0', '0', '', 'checkbox', 'admin', '2024-03-30 17:37:01', 'admin', '2024-12-08 16:19:02', '');
INSERT INTO `sys_menu` VALUES (2089, '发货记录', 2087, 3, 'record', 'shipping/index', NULL, 1, 0, 'C', '0', '0', '', 'guide', 'admin', '2024-03-30 17:37:42', 'admin', '2024-07-28 18:56:02', ''); INSERT INTO `sys_menu` VALUES (2089, '发货记录', 2087, 3, 'record', 'shipping/index', NULL, 1, 0, 'C', '0', '0', '', 'guide', 'admin', '2024-03-30 17:37:42', 'admin', '2024-07-28 18:56:02', '');

View File

@ -0,0 +1,395 @@
<template>
<div class="app-container">
<el-row>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
<el-form-item label="快递公司编码" prop="company">
<el-input
v-model="queryParams.company"
placeholder="请输入快递公司编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="店铺" prop="shopId">
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
<el-option
v-for="item in shopList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-time"
size="mini"
@click="updateWaybillAccount"
>更新电子面单账户信息</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-printer"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- >手动添加</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deliverList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="分配的供应商" align="left" width="211">
<template slot-scope="scope">
{{ scope.row.supplierIds ? supplierList.filter(item =>
scope.row.supplierIds.replace(/^,|,$/g, '').split(',').map(Number).includes(item.id)
).map(item => item.name).join(', ') : '' }}
</template>
</el-table-column>
<el-table-column label="网点" align="left" prop="netsiteName" width="200px">
</el-table-column>
<el-table-column label="网点编号" align="center" prop="netsiteCode" width="100px" />
<el-table-column label="快递公司编码" align="center" prop="company" width="100px" />
<el-table-column label="客户编码" align="center" prop="sellerId" width="100px" />
<el-table-column label="店铺" align="left" prop="netsiteName" width="200px">
<template slot-scope="scope">
{{ shopList.find(x=>x.id === scope.row.shopId) ? shopList.find(x=>x.id === scope.row.shopId).name : '' }}
</template>
</el-table-column>
<el-table-column label="已取单号" align="center" prop="allocatedQuantity" width="100px" />
<el-table-column label="已取消单号" align="center" prop="cancelledQuantity" width="100px" />
<el-table-column label="已回收单号" align="center" prop="recycledQuantity" width="100px" />
<el-table-column label="余额" align="center" prop="amount" width="100px" />
<el-table-column label="发货地址" align="left" prop="provinceName" width="200">
<template slot-scope="scope">
{{scope.row.provinceName}} {{scope.row.cityName}} {{scope.row.districtName}} {{scope.row.streetName}}<br/>
{{scope.row.detailAddress}}
</template>
</el-table-column>
<!-- <el-table-column label="发货信息" align="left" prop="provinceName" width="200">-->
<!-- <template slot-scope="scope">-->
<!-- {{scope.row.name}} <br/>-->
<!-- {{scope.row.mobile}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="省" align="center" prop="provinceName"/>-->
<!-- <el-table-column label="市" align="center" prop="cityName"/>-->
<!-- <el-table-column label="区" align="center" prop="districtName"/>-->
<el-table-column label="发货人" align="center" prop="name"/>
<el-table-column label="发货手机号" align="center" prop="mobile"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-share"
@click="handleShareSupplier(scope.row)"
>分配给供应商</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 手动添加 -->
<el-dialog title="手动添加" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="店铺" prop="shopId">
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
<el-option
v-for="item in shopList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="卖家Id" prop="sellerId">
<el-input v-model.number="form.sellerId" placeholder="请输入卖家Id名" />
</el-form-item>
<el-form-item label="appKey" prop="appKey" v-if="form.type===500">
<el-input v-model="form.appKey" placeholder="请输入appKey" />
</el-form-item>
<el-form-item label="描述" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入描述" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="状态">
<el-option label="启用" value="1"></el-option>
<el-option label="禁用" value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="修改" :visible.sync="updateOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="网点名" prop="netsiteName">
<el-input v-model="form.netsiteName" placeholder="请输入网点名" />
</el-form-item>
<el-form-item label="网点编码" prop="netsiteCode">
<el-input v-model="form.netsiteCode" placeholder="请输入网编码" />
</el-form-item>
<el-form-item label="卖家Id" prop="sellerShopId">
<el-input v-model.number="form.sellerShopId" placeholder="请输入卖家Id名" />
</el-form-item>
<el-form-item label="发货人" prop="name" >
<el-input v-model="form.name" placeholder="请输入发货人" />
</el-form-item>
<el-form-item label="发货手机号" prop="mobile" >
<el-input v-model="form.mobile" placeholder="请输入发货手机号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="分配供应商" :visible.sync="shareOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="供应商" prop="supplierIds">
<el-select v-model="form.supplierIds" placeholder="请选择供应商" clearable multiple >
<el-option
v-for="item in supplierList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shareSupplierSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {listSupplier} from "@/api/goods/supplier";
import {listShop} from "@/api/shop/shop";
import {listOrder, getOrder } from "@/api/order/order";
import {
getWaybillAccountList,
pullWaybillAccount,
shareSupplier,
updateAccount
} from "@/api/dou/ewaybill";
export default {
name: "waybillAccountDou",
data() {
return {
//
loading: true,
//
ids: [],
shopList: [],
deliverList: [],
supplierList: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
title: "",
open:false,
shareOpen:false,
updateOpen:false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
refundStatus: 1,
platformId:400,
orderStatus: '1',
shopId: null
},
//
printParams: {
deliver: null,
printer: null
},
//
form: {
id: null,
sellerShopId:null,
netsiteName:null,
netsiteCode:null,
company:null,
name:null,
mobile:null,
supplierIds: null
},
//
rules: {
netsiteName: [{ required: true, message: '不能为空', trigger: "blur" }],
netsiteCode: [{ required: true, message: '不能为空', trigger: "blur" }],
// sellerShopId: [{ required: true, message: '', trigger: "blur" }],
name: [{ required: true, message: '不能为空', trigger: "blur" }],
mobile: [{ required: true, message: '不能为空', trigger: "blur" }],
}
};
},
created() {
listShop({type: this.queryParams.platformId}).then(response => {
this.shopList = response.rows;
if (this.shopList && this.shopList.length > 0) {
this.queryParams.shopId = this.shopList[0].id
}
this.getList();
});
listSupplier({pageNum: 1, pageSize: 100}).then(resp=>{
this.supplierList = resp.rows
})
},
methods: {
/** 查询商品管理列表 */
getList() {
this.loading = true;
getWaybillAccountList({shopId: this.queryParams.shopId}).then(response => {
this.deliverList = response.data;
});
listOrder(this.queryParams).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false
this.updateOpen = false
this.shareOpen = false
this.reset();
},
//
reset() {
this.form = {
id: null,
erpSkuId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderNum)
this.single = selection.length !== 1
this.multiple = !selection.length
},
//
updateWaybillAccount() {
pullWaybillAccount({shopId: this.queryParams.shopId}).then(response => {
this.getList()
});
},
handleAdd() {
this.open = true
},
addSubmit() {
this.$refs["form"].validate(valid => {
if (valid) {
}
})
},
handleUpdate(row){
this.form.id = row.id
this.form.netsiteName = row.siteName
this.form.netsiteCode = row.siteCode
this.form.sellerShopId = row.sellerShopId
this.form.name = row.name
this.form.mobile = row.mobile
this.updateOpen = true
},
updateSubmit(){
this.$refs["form"].validate(valid => {
if (valid) {
updateAccount(this.form).then(resp=>{
this.$modal.msgSuccess("保存成功")
this.updateOpen =false
this.getList()
})
}
})
},
handleShareSupplier(row) {
this.form.id = row.id
if (row.supplierIds) {
let numArray = row.supplierIds.replace(/^,|,$/g, '').split(',').map(Number);
this.form.supplierIds = numArray
} else this.form.supplierIds = null
this.shareOpen = true
},
shareSupplierSubmit(){
console.log("=======分配供应商ID=====",this.form.supplierIds)
shareSupplier(this.form).then(resp=>{
this.$modal.msgSuccess("保存成功")
this.shareOpen =false
this.getList()
})
}
}
};
</script>

View File

@ -0,0 +1,67 @@
<template>
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in typeList" :label="item.name" :name="item.code" lazy>
<!-- <waybill-account-dou v-if="item.id === 100"></waybill-account-dou>-->
<!-- <print-jd v-if="item.id === 200"></print-jd>-->
<!-- <print-jd-vc v-if="item.id === 280"></print-jd-vc>-->
<!-- <print-pdd v-if="item.id === 300"></print-pdd>-->
<waybill-account-dou v-if="item.id === 400"></waybill-account-dou >
<waybill-account-wei v-if="item.id === 500"></waybill-account-wei>
<!-- <print-offline v-if="item.id === 999"></print-offline>-->
</el-tab-pane>
<!-- <el-tab-pane label="淘宝天猫" name="printTao" lazy>-->
<!-- <print-tao></print-tao>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="京东" name="printJd" lazy>-->
<!-- <print-jd></print-jd>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="拼多多" name="printPdd" lazy>-->
<!-- <print-pdd></print-pdd>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="抖店" name="printDou" lazy>-->
<!-- <print-dou></print-dou>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="视频号" name="printWei" lazy>-->
<!-- <print-wei></print-wei>-->
<!-- </el-tab-pane>-->
</el-tabs>
</div>
</template>
<script>
import waybillAccountDou from "@/views/shop/ewaybillAccount/dou.vue";
import waybillAccountWei from "@/views/shop/ewaybillAccount/wei.vue";
import {listPlatform} from "@/api/shop/shop";
export default {
name: "print",
components:{
waybillAccountDou,waybillAccountWei},
data() {
return {
activeName: '',
typeList: [],
};
},
created() {
},
mounted() {
listPlatform({status:0}).then(res => {
this.typeList = res.rows;
this.activeName = this.typeList[0].code
})
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
}
}
};
</script>

View File

@ -0,0 +1,390 @@
<template>
<div class="app-container">
<el-row>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
<el-form-item label="快递公司编码" prop="deliveryId">
<el-input
v-model="queryParams.deliveryId"
placeholder="请输入快递公司编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="店铺" prop="shopId">
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
<el-option
v-for="item in shopList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-time"
size="mini"
@click="updateWaybillAccount"
>更新电子面单账户信息</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-printer"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- >手动添加</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deliverList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="分配的供应商" align="left" width="211">
<template slot-scope="scope">
{{ scope.row.supplierIds ? supplierList.filter(item =>
scope.row.supplierIds.replace(/^,|,$/g, '').split(',').map(Number).includes(item.id)
).map(item => item.name).join(', ') : '' }}
</template>
</el-table-column>
<el-table-column label="网点" align="left" prop="siteName">
</el-table-column>
<el-table-column label="网点编号" align="center" prop="siteCode" width="100px" />
<el-table-column label="快递公司编码" align="center" prop="deliveryId" width="100px" />
<el-table-column label="客户编码" align="center" prop="sellerShopId" width="100px" />
<el-table-column label="店铺" align="left" prop="netsiteName" width="200px">
<template slot-scope="scope">
{{ shopList.find(x=>x.id === scope.row.shopId) ? shopList.find(x=>x.id === scope.row.shopId).name : '' }}
</template>
</el-table-column>
<el-table-column label="已取单号" align="center" prop="allocated" width="100px" />
<el-table-column label="已取消单号" align="center" prop="cancel" width="100px" />
<el-table-column label="已回收单号" align="center" prop="recycled" width="100px" />
<el-table-column label="余额" align="center" prop="available" width="100px" />
<!-- <el-table-column label="省" align="center" prop="senderProvince"/>-->
<!-- <el-table-column label="市" align="center" prop="senderCity"/>-->
<!-- <el-table-column label="区" align="center" prop="senderCounty"/>-->
<!-- <el-table-column label="发货地址" align="center" prop="senderAddress"/>-->
<el-table-column label="发货地址" align="left" prop="provinceName" width="200">
<template slot-scope="scope">
{{scope.row.senderProvince}} {{scope.row.senderCity}} {{scope.row.senderCounty}} <br/>
{{scope.row.senderAddress}}
</template>
</el-table-column>
<el-table-column label="发货人" align="center" prop="name"/>
<el-table-column label="发货手机号" align="center" prop="mobile"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['shop:shop:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-share"
@click="handleShareSupplier(scope.row)"
>分配给供应商</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 手动添加 -->
<el-dialog title="手动添加" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="店铺" prop="shopId">
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
<el-option
v-for="item in shopList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="卖家Id" prop="sellerShopId">
<el-input v-model="form.sellerShopId" placeholder="请输入卖家Id名" />
</el-form-item>
<el-form-item label="appKey" prop="appKey" v-if="form.type===500">
<el-input v-model="form.appKey" placeholder="请输入appKey" />
</el-form-item>
<el-form-item label="描述" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入描述" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="状态">
<el-option label="启用" value="1"></el-option>
<el-option label="禁用" value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="修改" :visible.sync="updateOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="网点名" prop="siteName">
<el-input v-model="form.siteName" placeholder="请输入网点名" />
</el-form-item>
<el-form-item label="网点编码" prop="siteCode">
<el-input v-model="form.siteCode" placeholder="请输入网编码" />
</el-form-item>
<el-form-item label="卖家Id" prop="sellerShopId">
<el-input v-model.number="form.sellerShopId" placeholder="请输入卖家Id名" />
</el-form-item>
<el-form-item label="发货人" prop="name" >
<el-input v-model="form.name" placeholder="请输入发货人" />
</el-form-item>
<el-form-item label="发货手机号" prop="mobile" >
<el-input v-model="form.mobile" placeholder="请输入发货手机号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="分配供应商" :visible.sync="shareOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="供应商" prop="supplierIds">
<el-select v-model="form.supplierIds" placeholder="请选择供应商" clearable multiple >
<el-option
v-for="item in supplierList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shareSupplierSubmit"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {listShop} from "@/api/shop/shop";
import {listOrder, getOrder } from "@/api/order/order";
import {
getWaybillAccountList,
pullWaybillAccount,
shareSupplier,
updateAccount
} from "@/api/wei/ewaybill";
import {listSupplier} from "@/api/goods/supplier";
export default {
name: "waybillAccountWei",
data() {
return {
//
loading: true,
//
ids: [],
shopList: [],
supplierList: [],
deliverList: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
title: "",
open:false,
shareOpen:false,
updateOpen:false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
refundStatus: 1,
platformId: 500,
orderStatus: '1',
shopId: null
},
//
printParams: {
deliver: null,
printer: null
},
//
form: {
id:null,
siteName:null,
siteCode:null,
sellerShopId:null,
name:null,
mobile:null,
supplierIds: null
},
//
rules: {
siteName: [{ required: true, message: '不能为空', trigger: "blur" }],
siteCode: [{ required: true, message: '不能为空', trigger: "blur" }],
sellerShopId: [{ required: true, message: '不能为空', trigger: "blur" }],
name: [{ required: true, message: '不能为空', trigger: "blur" }],
mobile: [{ required: true, message: '不能为空', trigger: "blur" }],
}
};
},
created() {
listShop({type: this.queryParams.platformId}).then(response => {
this.shopList = response.rows;
if (this.shopList && this.shopList.length > 0) {
this.queryParams.shopId = this.shopList[0].id
}
this.getList();
});
listSupplier({pageNum: 1, pageSize: 100}).then(resp=>{
this.supplierList = resp.rows
})
},
methods: {
/** 查询商品管理列表 */
getList() {
this.loading = true;
getWaybillAccountList({shopId: this.queryParams.shopId}).then(response => {
this.deliverList = response.data;
});
listOrder(this.queryParams).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false
this.shareOpen = false
this.updateOpen = false
this.reset();
},
//
reset() {
this.form = {
id: null,
erpSkuId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderNum)
this.single = selection.length !== 1
this.multiple = !selection.length
},
//
updateWaybillAccount() {
pullWaybillAccount({shopId: this.queryParams.shopId}).then(response => {
this.getList()
});
},
handleAdd() {
this.open = true
},
addSubmit() {
this.$refs["form"].validate(valid => {
if (valid) {
}
})
},
handleUpdate(row){
this.form.id = row.id
this.form.siteName = row.siteName
this.form.siteCode = row.siteCode
this.form.sellerShopId = row.sellerShopId
this.form.name = row.name
this.form.mobile = row.mobile
this.updateOpen = true
},
updateSubmit(){
this.$refs["form"].validate(valid => {
if (valid) {
updateAccount(this.form).then(resp=>{
this.$modal.msgSuccess("保存成功")
this.updateOpen =false
this.getList()
})
}
})
},
handleShareSupplier(row) {
this.form.id = row.id
if (row.supplierIds) {
let numArray = row.supplierIds.replace(/^,|,$/g, '').split(',').map(Number);
this.form.supplierIds = numArray
} else this.form.supplierIds = null
this.shareOpen = true
},
shareSupplierSubmit(){
console.log("=======分配供应商ID=====",this.form.supplierIds)
shareSupplier(this.form).then(resp=>{
this.$modal.msgSuccess("保存成功")
this.shareOpen =false
this.getList()
})
}
}
};
</script>