整理项目菜单结构
This commit is contained in:
parent
e5acb4bd11
commit
afc9e21057
5242
docs/qihang-erp.sql
5242
docs/qihang-erp.sql
File diff suppressed because one or more lines are too long
|
|
@ -1,141 +0,0 @@
|
|||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80200
|
||||
Source Host : localhost:3306
|
||||
Source Schema : qihang-erp
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80200
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 19/05/2024 18:46:07
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_menu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_menu`;
|
||||
CREATE TABLE `sys_menu` (
|
||||
`menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
|
||||
`menu_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称',
|
||||
`system_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统id(oms用在oms系统)',
|
||||
`parent_id` bigint NULL DEFAULT 0 COMMENT '父菜单ID',
|
||||
`order_num` int NULL DEFAULT 0 COMMENT '显示顺序',
|
||||
`path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '路由地址',
|
||||
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径',
|
||||
`query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '路由参数',
|
||||
`is_frame` int NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)',
|
||||
`is_cache` int NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)',
|
||||
`menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)',
|
||||
`visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)',
|
||||
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)',
|
||||
`perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识',
|
||||
`icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注',
|
||||
PRIMARY KEY (`menu_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2086 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单权限表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_menu
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_menu` VALUES (1, '系统管理', 'oms', 0, 99, '/system', '', '', 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 (2, '商品管理', '', 0, 9, 'goods', '', '', 1, 0, 'M', '0', '0', '', 'theme', 'admin', '2023-12-29 13:29:44', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (4, '采购管理', NULL, 0, 1, 'purchase', '', '', 1, 0, 'M', '0', '0', '', 'server', 'admin', '2023-12-27 15:00:27', 'admin', '2024-04-24 17:06:13', '至简官网地址');
|
||||
INSERT INTO `sys_menu` VALUES (5, '销售管理', 'oms', 0, 2, '/sale', '', '', 1, 0, 'M', '0', '0', '', 'shopping', 'admin', '2023-12-29 16:53:03', 'admin', '2024-05-11 09:16:33', '');
|
||||
INSERT INTO `sys_menu` VALUES (6, '发货管理', 'oms', 0, 3, '/ship', '', '', 1, 0, 'M', '0', '0', '', 'excel', 'admin', '2024-01-01 14:08:04', 'admin', '2024-01-03 14:07:29', '');
|
||||
INSERT INTO `sys_menu` VALUES (7, '售后管理', 'oms', 0, 4, '/saleafter', NULL, NULL, 1, 0, 'M', '0', '0', '', 'clipboard', 'admin', '2024-01-03 14:23:55', 'admin', '2024-01-12 19:47:33', '');
|
||||
INSERT INTO `sys_menu` VALUES (8, '店铺管理', 'oms', 0, 7, '/shop', NULL, NULL, 1, 0, 'M', '0', '0', '', 'server', 'admin', '2024-04-12 16:46:19', 'admin', '2024-04-24 11:17:09', '');
|
||||
INSERT INTO `sys_menu` VALUES (9, '库存管理', '', 0, 5, 'wms', '', '', 1, 0, 'M', '0', '0', '', 'dict', 'admin', '2023-12-31 12:14:33', 'admin', '2024-04-23 15:43:32', '');
|
||||
INSERT INTO `sys_menu` VALUES (100, '用户管理', 'oms', 1, 1, 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2023-12-27 15:00:27', '', '', '用户管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (101, '角色管理', 'oms', 1, 2, 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2023-12-27 15:00:27', '', '', '角色管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (102, '菜单管理', '', 1, 3, 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2023-12-27 15:00:27', '', '', '菜单管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (103, '部门管理', 'oms', 1, 4, 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2023-12-27 15:00:27', '', '', '部门管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (104, '岗位管理', 'oms', 1, 5, 'post', 'system/post/index', '', 1, 0, 'C', '1', '0', 'system:post:list', 'post', 'admin', '2023-12-27 15:00:27', 'admin', '2024-04-12 16:44:52', '岗位管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (105, '字典管理', 'oms', 1, 6, 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2023-12-27 15:00:27', '', '', '字典管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (108, '日志管理', 'oms', 1, 9, 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', '2023-12-27 15:00:27', '', '', '日志管理菜单');
|
||||
INSERT INTO `sys_menu` VALUES (500, '操作日志', 'oms', 108, 1, 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', '2023-12-27 15:00:27', '', '', '操作日志菜单');
|
||||
INSERT INTO `sys_menu` VALUES (501, '登录日志', 'oms', 108, 2, 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2023-12-27 15:00:27', '', '', '登录日志菜单');
|
||||
INSERT INTO `sys_menu` VALUES (1000, '用户查询', NULL, 100, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1001, '用户新增', NULL, 100, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1002, '用户修改', NULL, 100, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1003, '用户删除', NULL, 100, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1004, '用户导出', NULL, 100, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1005, '用户导入', NULL, 100, 6, '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1006, '重置密码', NULL, 100, 7, '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1007, '角色查询', NULL, 101, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1008, '角色新增', NULL, 101, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1009, '角色修改', NULL, 101, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1010, '角色删除', NULL, 101, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1011, '角色导出', NULL, 101, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1012, '菜单查询', NULL, 102, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1013, '菜单新增', NULL, 102, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1014, '菜单修改', NULL, 102, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1015, '菜单删除', NULL, 102, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1016, '部门查询', NULL, 103, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1017, '部门新增', NULL, 103, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1018, '部门修改', NULL, 103, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1019, '部门删除', NULL, 103, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1020, '岗位查询', NULL, 104, 1, '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1021, '岗位新增', NULL, 104, 2, '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1022, '岗位修改', NULL, 104, 3, '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1023, '岗位删除', NULL, 104, 4, '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1024, '岗位导出', NULL, 104, 5, '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1025, '字典查询', NULL, 105, 1, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1026, '字典新增', NULL, 105, 2, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1027, '字典修改', NULL, 105, 3, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1028, '字典删除', NULL, 105, 4, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1029, '字典导出', NULL, 105, 5, '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1039, '操作查询', NULL, 500, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1040, '操作删除', NULL, 500, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1041, '日志导出', NULL, 500, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1042, '登录查询', NULL, 501, 1, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1043, '登录删除', NULL, 501, 2, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1044, '日志导出', NULL, 501, 3, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (1045, '账户解锁', NULL, 501, 4, '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', '2023-12-27 15:00:27', '', '', '');
|
||||
INSERT INTO `sys_menu` VALUES (2005, '供应商管理', NULL, 4, 9, 'supplier/list', 'scm/supplier/index', '', 1, 0, 'C', '0', '0', 'scm:supplier', 'qq', 'admin', '2023-12-29 09:14:02', 'admin', '2023-12-29 09:17:27.514466', '');
|
||||
INSERT INTO `sys_menu` VALUES (2007, '商品管理', NULL, 2, 1, 'goods_list', 'goods/index', '', 1, 0, 'C', '0', '0', 'goods:list', 'theme', 'admin', '2023-12-29 13:31:01', 'admin', '2023-12-29 15:02:40.869685', '');
|
||||
INSERT INTO `sys_menu` VALUES (2008, '商品分类', NULL, 2, 88, 'goods_category', 'goods/category/index', '', 1, 0, 'C', '0', '0', 'goods:category', 'tree-table', 'admin', '2023-12-29 13:32:41', 'admin', '2023-12-29 15:02:22.220534', '');
|
||||
INSERT INTO `sys_menu` VALUES (2009, '品牌管理', NULL, 2, 99, 'goods/brand', 'goods/brand/index', '', 1, 0, 'C', '0', '1', 'goods:brand', 'clipboard', 'admin', '2023-12-29 13:34:49', 'admin', '2024-04-14 18:51:23', '');
|
||||
INSERT INTO `sys_menu` VALUES (2010, '采购单管理', NULL, 4, 1, 'order', 'scm/purchase/order', '', 1, 0, 'C', '0', '0', 'scm:purchase:order', 'button', 'admin', '2023-12-29 16:35:55', 'admin', '2024-04-24 17:06:32', '');
|
||||
INSERT INTO `sys_menu` VALUES (2012, '采购物流管理', NULL, 4, 2, 'ship', 'scm/purchase/ship', '', 1, 0, 'C', '0', '0', 'scm:purchase:ship', 'component', 'admin', '2023-12-29 16:45:42', 'admin', '2024-04-24 17:10:48', '');
|
||||
INSERT INTO `sys_menu` VALUES (2015, '店铺管理', 'oms', 8, 10, 'shop_list', 'shop/shop_index', '', 1, 0, 'C', '0', '0', 'shop:list', 'example', 'admin', '2023-12-29 16:54:02', 'admin', '2024-04-25 11:15:07', '');
|
||||
INSERT INTO `sys_menu` VALUES (2017, '店铺数据统计', 'oms', 5, 8, 'data', 'shop/data', '', 1, 0, 'C', '0', '1', 'shop:data', 'chart', 'admin', '2023-12-29 17:04:08', 'admin', '2023-12-31 19:04:58.785609', '');
|
||||
INSERT INTO `sys_menu` VALUES (2019, '采购账单管理1', NULL, 4, 2, 'purchase', 'scm/purchase/cost', '', 1, 0, 'C', '0', '1', '', 'money', 'admin', '2023-12-29 17:09:32', 'admin', '2024-04-24 17:05:06', '');
|
||||
INSERT INTO `sys_menu` VALUES (2021, '创建采购单', NULL, 4, 0, 'order/create', 'scm/purchase/order/create', '', 1, 0, 'C', '1', '0', '', 'edit', 'admin', '2023-12-29 21:23:45', 'admin', '2024-04-24 17:11:38', '');
|
||||
INSERT INTO `sys_menu` VALUES (2025, '采购单详情', NULL, 4, 1, 'order/detail', 'scm/purchase/order/detail', '', 1, 0, 'C', '1', '0', '', 'button', 'admin', '2023-12-30 17:08:01', 'admin', '2024-04-24 17:15:00', '');
|
||||
INSERT INTO `sys_menu` VALUES (2027, '入库管理', NULL, 9, 0, 'stock_in_entry/list', 'wms/stockInEntry', '', 1, 0, 'C', '0', '0', 'wms:stock_in_entry:list', 'stockin', 'admin', '2023-12-31 12:27:37', 'admin', '2024-01-14 15:12:48', '');
|
||||
INSERT INTO `sys_menu` VALUES (2028, '生成采购入库单', NULL, 4, 3, 'ship/create_stock_in_entry', 'scm/purchase/ship/create_stock_in_entry', '', 1, 0, 'C', '1', '0', '', 'button', 'admin', '2023-12-31 12:31:32', 'admin', '2024-04-24 17:12:38', '');
|
||||
INSERT INTO `sys_menu` VALUES (2029, '店铺退款管理', 'oms', 7, 2, 'shop_refund', 'shop/refund/index', '', 1, 0, 'C', '0', '0', '', 'clipboard', 'admin', '2023-12-31 17:29:03', 'admin', '2024-05-04 18:57:32', '');
|
||||
INSERT INTO `sys_menu` VALUES (2030, '手动创建订单', 'oms', 5, 1, 'order/create', 'sale/order/create', '', 1, 0, 'C', '1', '0', '', 'documentation', 'admin', '2023-12-31 20:01:22', 'admin', '2024-03-24 19:32:32', '');
|
||||
INSERT INTO `sys_menu` VALUES (2032, '订单拉取日志', 'oms', 5, 3, 'order/pull_log', 'shop/order_pull_log', '', 1, 0, 'C', '0', '1', '', 'upload', 'admin', '2023-12-31 20:04:12', 'admin', '2024-05-04 18:56:46', '');
|
||||
INSERT INTO `sys_menu` VALUES (2033, '订单管理', 'oms', 5, 1, 'order_list', 'sale/order/index', '', 1, 0, 'C', '0', '0', '', 'list', 'admin', '2023-12-31 20:05:05', 'admin', '2024-05-05 18:07:27', '');
|
||||
INSERT INTO `sys_menu` VALUES (2036, '店铺订单管理', 'oms', 5, 2, 'shop_order', 'shop/order_index', '', 1, 0, 'C', '0', '0', '', 'excel', 'admin', '2024-01-01 14:14:42', 'admin', '2024-05-04 18:55:37', '');
|
||||
INSERT INTO `sys_menu` VALUES (2046, '出库管理', NULL, 9, 5, 'stockOut', 'wms/stockOutEntry', NULL, 1, 0, 'C', '0', '0', '', 'link', 'admin', '2024-01-03 11:00:53', 'admin', '2024-01-12 15:52:19', '');
|
||||
INSERT INTO `sys_menu` VALUES (2047, '库存查询', NULL, 9, 6, 'goodsInventory', 'goods/goodsInventory', NULL, 1, 0, 'C', '0', '0', '', 'monitor', 'admin', '2024-01-03 11:01:14', 'admin', '2024-01-09 17:55:33', '');
|
||||
INSERT INTO `sys_menu` VALUES (2048, '库存盘点', NULL, 9, 9, 'pan', NULL, NULL, 1, 0, 'C', '0', '1', '', 'bug', 'admin', '2024-01-03 11:01:43', 'admin', '2024-01-09 19:57:08', '');
|
||||
INSERT INTO `sys_menu` VALUES (2049, '打包发货', 'oms', 6, 3, 'ship_order', 'shipping/shipOrder/index', NULL, 1, 0, 'C', '0', '0', '', 'guide', 'admin', '2024-01-03 14:09:18', 'admin', '2024-05-02 10:47:38', '');
|
||||
INSERT INTO `sys_menu` VALUES (2051, '物流跟踪', 'oms', 6, 4, 'ship_logistics', 'shipping/shipOrder/logistics', NULL, 1, 0, 'C', '0', '0', '', 'email', 'admin', '2024-01-03 14:13:12', 'admin', '2024-05-02 10:50:34', '');
|
||||
INSERT INTO `sys_menu` VALUES (2052, '物流公司管理', 'oms', 6, 9, 'logistics_company', 'shipping/logistics/company', NULL, 1, 0, 'C', '0', '0', '', 'checkbox', 'admin', '2024-01-03 14:14:09', 'admin', '2024-04-24 13:53:14', '');
|
||||
INSERT INTO `sys_menu` VALUES (2054, '退款管理', 'oms', 7, 1, 'refund_list', 'sale/refund', NULL, 1, 0, 'C', '0', '0', '', 'size', 'admin', '2024-01-03 14:24:36', 'admin', '2024-05-05 20:14:23', '');
|
||||
INSERT INTO `sys_menu` VALUES (2059, '备货清单', 'oms', 6, 1, 'stocking', 'shipping/stocking', '', 1, 0, 'C', '0', '0', '', 'component', 'admin', '2024-01-09 11:51:52', 'admin', '2024-05-01 21:34:33', '');
|
||||
INSERT INTO `sys_menu` VALUES (2060, '拣货出库', '', 6, 2, 'stockout', 'shipping/stockOut', NULL, 1, 0, 'C', '0', '0', '', 'bug', 'admin', '2024-01-09 13:39:00', 'admin', '2024-04-26 13:51:21', '');
|
||||
INSERT INTO `sys_menu` VALUES (2061, '库位管理', NULL, 9, 99, 'stock_location', 'wms/location', NULL, 1, 0, 'C', '0', '0', '', 'education', 'admin', '2024-01-09 13:54:30', 'admin', '2024-01-09 14:50:33', '');
|
||||
INSERT INTO `sys_menu` VALUES (2063, '发货费用', '', 6, 5, 'ship_fee', 'shipping/shipFee', NULL, 1, 0, 'C', '0', '0', '', 'money', 'admin', '2024-01-12 18:35:31', 'admin', '2024-05-02 10:50:58', '');
|
||||
INSERT INTO `sys_menu` VALUES (2066, '添加商品', NULL, 2, 2, 'create', 'goods/create', NULL, 1, 0, 'C', '1', '0', '', 'component', 'admin', '2024-01-14 19:42:11', 'admin', '2024-04-14 18:50:36', '');
|
||||
INSERT INTO `sys_menu` VALUES (2067, '商品SKU管理', NULL, 2, 3, 'spec_list', 'goods/spec', NULL, 1, 0, 'C', '0', '0', '', 'theme', 'admin', '2024-01-16 14:17:39', 'admin', '2024-04-14 18:51:13', '');
|
||||
INSERT INTO `sys_menu` VALUES (2079, '平台设置', 'oms', 8, 20, 'platform', 'shop/platform', NULL, 1, 0, 'C', '0', '0', NULL, 'date-range', 'admin', '2024-04-12 16:58:07', '', NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (2080, '售后处理查询', 'oms', 7, 3, 'result_list', 'afterSale/index', NULL, 1, 0, 'C', '0', '0', '', 'time', 'admin', '2024-04-15 14:23:40', 'admin', '2024-05-05 20:27:37', '');
|
||||
INSERT INTO `sys_menu` VALUES (2084, '店铺商品管理', 'oms', 8, 1, 'goods_list', 'shop/goods/', NULL, 1, 0, 'C', '0', '0', '', 'shopping', 'admin', '2024-04-15 14:52:16', 'admin', '2024-04-15 14:52:27', '');
|
||||
INSERT INTO `sys_menu` VALUES (2085, '采购账单管理', NULL, 4, 4, 'bill', 'scm/purchase/bill', NULL, 1, 0, 'C', '0', '0', '', 'money', 'admin', '2024-04-24 17:03:07', 'admin', '2024-05-02 10:59:08', '');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -8,9 +8,11 @@ import com.qihang.common.common.PageResult;
|
|||
import com.qihang.common.common.TableDataInfo;
|
||||
import com.qihang.jd.domain.JdGoods;
|
||||
import com.qihang.jd.domain.JdGoodsSku;
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.qihang.jd.domain.bo.JdGoodsBo;
|
||||
import com.qihang.jd.service.JdGoodsService;
|
||||
import com.qihang.jd.service.JdGoodsSkuService;
|
||||
import com.qihang.jd.service.OmsJdGoodsSkuService;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -20,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@AllArgsConstructor
|
||||
public class GoodsController extends BaseController {
|
||||
private final JdGoodsService goodsService;
|
||||
private final JdGoodsSkuService skuService;
|
||||
private final OmsJdGoodsSkuService skuService;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo goodsList(JdGoodsBo bo, PageQuery pageQuery) {
|
||||
PageResult<JdGoods> result = goodsService.queryPageList(bo, pageQuery);
|
||||
|
|
@ -29,8 +31,8 @@ public class GoodsController extends BaseController {
|
|||
}
|
||||
|
||||
@RequestMapping(value = "/skuList", method = RequestMethod.GET)
|
||||
public TableDataInfo skuList(JdGoodsBo bo, PageQuery pageQuery) {
|
||||
PageResult<JdGoodsSku> result = skuService.queryPageList(bo, pageQuery);
|
||||
public TableDataInfo skuList(OmsJdGoodsSku bo, PageQuery pageQuery) {
|
||||
PageResult<OmsJdGoodsSku> result = skuService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
|
@ -46,9 +48,9 @@ public class GoodsController extends BaseController {
|
|||
@PostMapping(value = "/sku/linkErp")
|
||||
public AjaxResult linkErp(@RequestBody LinkErpGoodsSkuBo bo)
|
||||
{
|
||||
JdGoodsSku sku = new JdGoodsSku();
|
||||
OmsJdGoodsSku sku = new OmsJdGoodsSku();
|
||||
sku.setId(bo.getId());
|
||||
sku.setErpSkuId(Long.parseLong(bo.getErpSkuId()));
|
||||
sku.setErpGoodsSkuId(Long.parseLong(bo.getErpSkuId()));
|
||||
skuService.updateById(sku);
|
||||
return success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class OmsJdGoodsSku implements Serializable {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -9,5 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
public interface OmsJdGoodsSkuService extends IService<OmsJdGoodsSku> {
|
||||
PageResult<OmsJdGoodsSku> queryPageList(OmsJdGoodsSku bo, PageQuery pageQuery);
|
||||
|
||||
ResultVo<Integer> saveGoodsSku(Long shopId, OmsJdGoodsSku goodsSku);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,69 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.utils.StringUtils;
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.qihang.jd.service.OmsJdGoodsSkuService;
|
||||
import com.qihang.jd.mapper.OmsJdGoodsSkuMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods_sku(京东商品SKU表)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsJdGoodsSkuServiceImpl extends ServiceImpl<OmsJdGoodsSkuMapper, OmsJdGoodsSku>
|
||||
implements OmsJdGoodsSkuService{
|
||||
private final OmsJdGoodsSkuMapper mapper;
|
||||
|
||||
@Override
|
||||
public PageResult<OmsJdGoodsSku> queryPageList(OmsJdGoodsSku bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsJdGoodsSku> queryWrapper = new LambdaQueryWrapper<OmsJdGoodsSku>()
|
||||
.eq(bo.getShopId()!=null,OmsJdGoodsSku::getShopId,bo.getShopId());
|
||||
|
||||
Page<OmsJdGoodsSku> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
return PageResult.build(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVo<Integer> saveGoodsSku(Long shopId, OmsJdGoodsSku goodsSku) {
|
||||
List<OmsJdGoodsSku> jdGoodsSkus = mapper.selectList(new LambdaQueryWrapper<OmsJdGoodsSku>().eq(OmsJdGoodsSku::getSkuId, goodsSku.getWareId()));
|
||||
if(jdGoodsSkus== null || jdGoodsSkus.isEmpty()){
|
||||
// 新增
|
||||
// if(StringUtils.isNotEmpty(goodsSku.getOuterId())) {
|
||||
// ErpGoodsSpecVo erpGoodsSpecVo = mapper.selectGoodsSpecBySpecNum(goodsSku.getOuterId());
|
||||
// if(erpGoodsSpecVo!=null ){
|
||||
// goodsSku.setErpGoodsId(erpGoodsSpecVo.getGoodsId());
|
||||
// goodsSku.setErpGoodsSkuId(erpGoodsSpecVo.getId());
|
||||
// }
|
||||
// }
|
||||
goodsSku.setShopId(shopId);
|
||||
mapper.insert(goodsSku);
|
||||
}else{
|
||||
// 修改
|
||||
goodsSku.setId(jdGoodsSkus.get(0).getId());
|
||||
goodsSku.setShopId(shopId);
|
||||
// if(StringUtils.isNotEmpty(goodsSku.getOuterId())) {
|
||||
// ErpGoodsSpecVo erpGoodsSpecVo = mapper.selectGoodsSpecBySpecNum(goodsSku.getOuterId());
|
||||
// if(erpGoodsSpecVo!=null ){
|
||||
// goodsSku.setErpGoodsId(erpGoodsSpecVo.getGoodsId());
|
||||
// goodsSku.setErpGoodsSkuId(erpGoodsSpecVo.getId());
|
||||
// }
|
||||
// }
|
||||
mapper.updateById(goodsSku);
|
||||
}
|
||||
return ResultVo.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function listGoodsSku(query) {
|
||||
return request({
|
||||
url: '/dou-api/goods/skuList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getGoodsSku(id) {
|
||||
return request({
|
||||
url: '/dou-api/goods/sku/'+id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function linkErpGoodsSkuId(data) {
|
||||
return request({
|
||||
url: '/dou-api/goods/sku/linkErp',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 接口拉取淘宝商品
|
||||
export function pullGoodsList(data) {
|
||||
return request({
|
||||
url: '/dou-api/goods/pull_goods',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function listGoodsSku(query) {
|
||||
return request({
|
||||
url: '/pdd-api/goods/skuList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getGoodsSku(id) {
|
||||
return request({
|
||||
url: '/pdd-api/goods/sku/'+id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function linkErpGoodsSkuId(data) {
|
||||
return request({
|
||||
url: '/pdd-api/goods/sku/linkErp',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 接口拉取淘宝商品
|
||||
export function pullGoodsList(data) {
|
||||
return request({
|
||||
url: '/pdd-api/goods/pull_goods',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,288 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @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="商品ID" align="center" prop="productId" />
|
||||
<el-table-column label="规格Id" align="center" prop="specId" />
|
||||
<el-table-column label="商品名称" align="center" prop="name" />
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.img" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="规格" align="center" prop="specDetailName1" >
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.specDetailName1}}
|
||||
{{scope.row.specDetailName2}}
|
||||
{{scope.row.specDetailName3}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="SKU编码" align="center" prop="code" />
|
||||
<el-table-column label="价格" align="center" prop="price" >
|
||||
<template slot-scope="scope">
|
||||
{{amountFormatter(null,null,scope.row.price/100,0)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpGoodsSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="skuStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.skuStatus === false">已下架</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.skuStatus === true">销售中</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="handleLink(scope.row)"
|
||||
>关联ERP</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</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 {pullGoodsList,listGoodsSku} from "@/api/dou/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "GoodsDou",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
pullLoading: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type:6}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
amountFormatter(row, column, cellValue, index) {
|
||||
return '¥' + cellValue.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
||||
},
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = 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();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullGoodsList({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取PDD商品接口返回=====',response)
|
||||
if(response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权!请前往店铺列表重新获取授权!', '系统提示', { confirmButtonText: '前往授权', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
// isRelogin.show = false;
|
||||
this.$router.push({path:"/shop/shop_list",query:{type:6}})
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
}else{
|
||||
this.pullLoading = false
|
||||
this.getList()
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
}
|
||||
this.pullLoading = false
|
||||
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,531 +1,55 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="平台" prop="shopType">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.shopType"-->
|
||||
<!-- placeholder="请输入平台"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.shopId"-->
|
||||
<!-- placeholder="请输入店铺"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<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="商品编码" prop="goodsNum">
|
||||
<el-input
|
||||
v-model="queryParams.goodsNum"
|
||||
placeholder="请输入商品编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入商品标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="淘宝天猫" name="taoGoods">
|
||||
<goods-tao></goods-tao>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="京东POP" name="jdGoods" lazy>
|
||||
<goods-jd></goods-jd>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="拼多多" name="pddGoods" lazy>
|
||||
<goods-pdd></goods-pdd>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="抖店" name="douGoods" lazy>
|
||||
<goods-dou></goods-dou>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="视频号小店" name="weiGoods" lazy>
|
||||
<goods-wei></goods-wei>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="快手小店" name="kwaiGoods" lazy>-->
|
||||
<!-- 开发中-->
|
||||
<!-- </el-tab-pane>-->
|
||||
<!-- <el-tab-pane label="小红书" name="xhsGoods" lazy>-->
|
||||
<!-- 开发中-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
|
||||
<el-form-item label="发布日期" prop="publishTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.publishTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发布日期">
|
||||
</el-date-picker>
|
||||
</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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['shop:goods:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['shop:goods:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['shop:goods:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['shop:goods:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="序号" type="index" />
|
||||
<el-table-column label="网店商品ID" align="center" prop="goodsId" />
|
||||
<el-table-column label="店铺" align="center" prop="shopId" />
|
||||
<el-table-column label="商品编码" align="center" prop="goodsNum" />
|
||||
<el-table-column label="商品标题" align="center" prop="title" />
|
||||
<el-table-column label="主图" align="center" prop="thumbUrl" >
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.thumbUrl"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="累计销量" align="center" prop="totalSales" />
|
||||
<el-table-column label="发布日期" align="center" prop="publishTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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:goods:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['shop:goods:remove']"
|
||||
>删除</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="商品id,PDD商品id" prop="goodsId">
|
||||
<el-input v-model="form.goodsId" placeholder="请输入商品id,PDD商品id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="erpGoodsId">
|
||||
<el-input v-model="form.erpGoodsId" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="shopId">
|
||||
<el-input v-model="form.shopId" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品货号,erp系统商品编码" prop="goodsNum">
|
||||
<el-input v-model="form.goodsNum" placeholder="请输入商品货号,erp系统商品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="goodsName">
|
||||
<el-input v-model="form.goodsName" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参考价格,返回价格区间,可能为空" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入参考价格,返回价格区间,可能为空" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入商品标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主图" prop="thumbUrl">
|
||||
<el-input v-model="form.thumbUrl" placeholder="请输入主图" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片json" prop="imageUrl">
|
||||
<el-input v-model="form.imageUrl" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isMoreSku">
|
||||
<el-input v-model="form.isMoreSku" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isOnsale">
|
||||
<el-input v-model="form.isOnsale" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="累计销量" prop="totalSales">
|
||||
<el-input v-model="form.totalSales" placeholder="请输入累计销量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发布日期" prop="publishTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.publishTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发布日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddSShopGoodsSku">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteSShopGoodsSku">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="sShopGoodsSkuList" :row-class-name="rowSShopGoodsSkuIndex" @selection-change="handleSShopGoodsSkuSelectionChange" ref="sShopGoodsSku">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="商品id,阿里productID" prop="goodsId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsId" placeholder="请输入商品id,阿里productID" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品skuid,阿里" prop="skuId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuId" placeholder="请输入商品skuid,阿里" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="specId" prop="spec" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.spec" placeholder="请输入specId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="$comment" prop="erpGoodsSpecId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.erpGoodsSpecId" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="$comment" prop="erpGoodsId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.erpGoodsId" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="$comment" prop="erpGoodsSpecCode" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.erpGoodsSpecCode" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="$comment" prop="skuQuantity" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuQuantity" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分销基准价。代销场景均使用该价格。无SKU商品查看saleInfo中的consignPrice" prop="consignPrice" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.consignPrice" placeholder="请输入分销基准价。代销场景均使用该价格。无SKU商品查看saleInfo中的consignPrice" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="sku编码" prop="outerId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.outerId" placeholder="请输入sku编码" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="spu编码" prop="outerGoodsId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.outerGoodsId" placeholder="请输入spu编码" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报价时该规格的单价,国际站注意要点:含有SKU属性的在线批发产品设定具体价格时使用此值,若设置阶梯价格则使用priceRange" prop="price" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入报价时该规格的单价,国际站注意要点:含有SKU属性的在线批发产品设定具体价格时使用此值,若设置阶梯价格则使用priceRange" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="建议零售价" prop="retailPrice" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.retailPrice" placeholder="请输入建议零售价" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可销售数量" prop="amountOnSale" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountOnSale" placeholder="请输入可销售数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="$comment" prop="isSkuOnsale" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.isSkuOnsale" placeholder="请输入$comment" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="指定规格的货号,对应ERP系统商品specNumber" prop="cargoNumber" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.cargoNumber" placeholder="请输入指定规格的货号,对应ERP系统商品specNumber" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listGoods, getGoods, delGoods, addGoods, updateGoods } from "@/api/shop/goods";
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
|
||||
import GoodsTao from "@/views/shop/tao/goods/index";
|
||||
import GoodsJd from "@/views/shop/jd/goods/index";
|
||||
import GoodsDou from "@/views/shop/dou/goods/index";
|
||||
import GoodsPdd from "@/views/shop/pdd/goods/index";
|
||||
import GoodsWei from "@/views/shop/wei/goods/index";
|
||||
export default {
|
||||
name: "Goods",
|
||||
name: "ShopGoods",
|
||||
components:{GoodsTao,GoodsJd,GoodsDou,GoodsPdd,GoodsWei},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedSShopGoodsSku: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 店铺商品表格数据
|
||||
goodsList: [],
|
||||
// ${subTable.functionName}表格数据
|
||||
sShopGoodsSkuList: [],
|
||||
shopList:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
goodsId: null,
|
||||
erpGoodsId: null,
|
||||
shopId: null,
|
||||
shopType: null,
|
||||
goodsNum: null,
|
||||
goodsName: null,
|
||||
price: null,
|
||||
title: null,
|
||||
thumbUrl: null,
|
||||
imageUrl: null,
|
||||
isMoreSku: null,
|
||||
isOnsale: null,
|
||||
totalSales: null,
|
||||
publishTime: null,
|
||||
createTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
goodsId: [
|
||||
{ required: true, message: "商品id,PDD商品id不能为空", trigger: "blur" }
|
||||
],
|
||||
shopId: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
||||
],
|
||||
shopType: [
|
||||
{ required: true, message: "$comment不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
activeName: 'taoGoods'
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log('url参数:',this.$route.query.shopType)
|
||||
if(this.$route.query.shopType) {
|
||||
this.queryParams.shopType = this.$route.query.shopType
|
||||
listShop({type:this.queryParams.shopType}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
});
|
||||
}
|
||||
this.getList();
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
/** 查询店铺商品列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoods(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
goodsId: null,
|
||||
erpGoodsId: null,
|
||||
shopId: null,
|
||||
shopType: null,
|
||||
goodsNum: null,
|
||||
goodsName: null,
|
||||
price: null,
|
||||
title: null,
|
||||
remark: null,
|
||||
thumbUrl: null,
|
||||
imageUrl: null,
|
||||
isMoreSku: null,
|
||||
isOnsale: null,
|
||||
totalSales: null,
|
||||
publishTime: null,
|
||||
createTime: null
|
||||
};
|
||||
this.sShopGoodsSkuList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加店铺商品";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoods(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.sShopGoodsSkuList = response.data.sShopGoodsSkuList;
|
||||
this.open = true;
|
||||
this.title = "修改店铺商品";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.sShopGoodsSkuList = this.sShopGoodsSkuList;
|
||||
if (this.form.id != null) {
|
||||
updateGoods(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addGoods(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除店铺商品编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delGoods(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** ${subTable.functionName}序号 */
|
||||
rowSShopGoodsSkuIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
handleAddSShopGoodsSku() {
|
||||
let obj = {};
|
||||
obj.goodsId = "";
|
||||
obj.skuId = "";
|
||||
obj.spec = "";
|
||||
obj.erpGoodsSpecId = "";
|
||||
obj.erpGoodsId = "";
|
||||
obj.erpGoodsSpecCode = "";
|
||||
obj.skuQuantity = "";
|
||||
obj.consignPrice = "";
|
||||
obj.outerId = "";
|
||||
obj.outerGoodsId = "";
|
||||
obj.price = "";
|
||||
obj.retailPrice = "";
|
||||
obj.amountOnSale = "";
|
||||
obj.isSkuOnsale = "";
|
||||
obj.cargoNumber = "";
|
||||
obj.attributes = "";
|
||||
this.sShopGoodsSkuList.push(obj);
|
||||
},
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
handleDeleteSShopGoodsSku() {
|
||||
if (this.checkedSShopGoodsSku.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
} else {
|
||||
const sShopGoodsSkuList = this.sShopGoodsSkuList;
|
||||
const checkedSShopGoodsSku = this.checkedSShopGoodsSku;
|
||||
this.sShopGoodsSkuList = sShopGoodsSkuList.filter(function(item) {
|
||||
return checkedSShopGoodsSku.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleSShopGoodsSkuSelectionChange(selection) {
|
||||
this.checkedSShopGoodsSku = selection.map(item => item.index)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('shop/goods/export', {
|
||||
...this.queryParams
|
||||
}, `goods_${new Date().getTime()}.xlsx`)
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,503 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="平台" prop="shopType">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.shopType"-->
|
||||
<!-- placeholder="请输入平台"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.shopId"-->
|
||||
<!-- placeholder="请输入店铺"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<el-select v-model="form.shopId" filterable r placeholder="搜索店铺" >
|
||||
<el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 1">1688</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 2">视频号小店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 3">京东</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 4">淘系店铺</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 5">拼多多</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 6">抖店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 7">小红书</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 8">快手小店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 99">其他</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" prop="goodsNum">
|
||||
<el-input
|
||||
v-model="queryParams.goodsNum"
|
||||
placeholder="请输入商品编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入商品标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="发布日期" prop="publishTime">-->
|
||||
<!-- <el-date-picker clearable-->
|
||||
<!-- v-model="queryParams.publishTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- placeholder="请选择发布日期">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['shop:goods:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
v-hasPermi="['pdd:order:remove']"
|
||||
>API拉取店铺商品</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['shop:goods:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['shop:goods:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['shop:goods:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="序号" type="index" />
|
||||
<el-table-column label="网店商品ID" align="center" prop="goodsId" />
|
||||
<el-table-column label="店铺" align="center" prop="shopId" />
|
||||
<el-table-column label="商品编码" align="center" prop="goodsNum" />
|
||||
<el-table-column label="商品标题" align="center" prop="title" />
|
||||
<el-table-column label="主图" align="center" prop="thumbUrl" >
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.thumbUrl"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="累计销量" align="center" prop="totalSales" />
|
||||
<el-table-column label="发布日期" align="center" prop="publishTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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:goods:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['shop:goods:remove']"
|
||||
>删除</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="title" :visible.sync="open" width="1000px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="平台商品ID" prop="goodsId">
|
||||
<el-input v-model="form.goodsId" placeholder="请输入平台商品ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Erp商品ID" prop="erpGoodsId">
|
||||
<el-input v-model="form.erpGoodsId" placeholder="请输入Erp商品ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<!-- <el-input v-model="form.shopId" placeholder="请输入${comment}" />-->
|
||||
<el-select v-model="form.shopId" filterable r placeholder="搜索店铺" >
|
||||
<el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 1">1688</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 2">视频号小店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 3">京东</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 4">淘系店铺</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 5">拼多多</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 6">抖店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 7">小红书</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 8">快手小店</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px" v-if="item.type === 99">其他</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" prop="goodsNum">
|
||||
<el-input v-model="form.goodsNum" placeholder="请输入商品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="goodsName">
|
||||
<el-input v-model="form.goodsName" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参考价格" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入参考价格,返回价格区间,可能为空" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入商品标题" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="${comment}" prop="remark">-->
|
||||
<!-- <el-input v-model="form.remark" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="主图URL" prop="thumbUrl">
|
||||
<el-input v-model="form.thumbUrl" placeholder="请输入主图" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="商品图片json" prop="imageUrl">-->
|
||||
<!-- <el-input v-model="form.imageUrl" type="textarea" placeholder="请输入内容" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="${comment}" prop="isMoreSku">-->
|
||||
<!-- <el-input v-model="form.isMoreSku" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="${comment}" prop="isOnsale">-->
|
||||
<!-- <el-input v-model="form.isOnsale" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="累计销量" prop="totalSales">-->
|
||||
<!-- <el-input v-model="form.totalSales" placeholder="请输入累计销量" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="发布日期" prop="publishTime">-->
|
||||
<!-- <el-date-picker clearable-->
|
||||
<!-- v-model="form.publishTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- placeholder="请选择发布日期">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-divider content-position="center">商品SKU信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddSShopGoodsSku">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteSShopGoodsSku">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="sShopGoodsSkuList" :row-class-name="rowSShopGoodsSkuIndex" @selection-change="handleSShopGoodsSkuSelectionChange" ref="sShopGoodsSku">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="平台商品ID" prop="goodsId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsId" placeholder="请输入平台商品ID" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平台SkuId" prop="skuId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuId" placeholder="请输入平台SkuId" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="sku编码" prop="outerId" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.outerId" placeholder="请输入sku编码" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="建议零售价" prop="retailPrice" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.retailPrice" placeholder="请输入建议零售价" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listGoods, getGoods, delGoods, addGoods, updateGoods } from "@/api/shop/goods";
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
|
||||
export default {
|
||||
name: "Goods",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedSShopGoodsSku: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 店铺商品表格数据
|
||||
goodsList: [],
|
||||
// ${subTable.functionName}表格数据
|
||||
sShopGoodsSkuList: [],
|
||||
shopList:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
goodsId: null,
|
||||
erpGoodsId: null,
|
||||
shopId: null,
|
||||
shopType: null,
|
||||
goodsNum: null,
|
||||
goodsName: null,
|
||||
price: null,
|
||||
title: null,
|
||||
thumbUrl: null,
|
||||
imageUrl: null,
|
||||
isMoreSku: null,
|
||||
isOnsale: null,
|
||||
totalSales: null,
|
||||
publishTime: null,
|
||||
createTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
goodsId: [{ required: true, message: "平台商品ID不能为空", trigger: "blur" }],
|
||||
shopId: [{ required: true, message: "请选择店铺", trigger: "blur" }],
|
||||
goodsNum: [{ required: true, message: "商品编码不能为空", trigger: "change" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// console.log('url参数:',this.$route.query.shopType)
|
||||
// if(this.$route.query.shopType) {
|
||||
// this.queryParams.shopType = this.$route.query.shopType
|
||||
listShop({type:this.queryParams.shopType}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
});
|
||||
// }
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询店铺商品列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoods(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
goodsId: null,
|
||||
erpGoodsId: null,
|
||||
shopId: null,
|
||||
shopType: null,
|
||||
goodsNum: null,
|
||||
goodsName: null,
|
||||
price: null,
|
||||
title: null,
|
||||
remark: null,
|
||||
thumbUrl: null,
|
||||
imageUrl: null,
|
||||
isMoreSku: null,
|
||||
isOnsale: null,
|
||||
totalSales: null,
|
||||
publishTime: null,
|
||||
createTime: null
|
||||
};
|
||||
this.sShopGoodsSkuList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加店铺商品";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoods(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.sShopGoodsSkuList = response.data.sShopGoodsSkuList;
|
||||
this.open = true;
|
||||
this.title = "修改店铺商品";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.sShopGoodsSkuList = this.sShopGoodsSkuList;
|
||||
if (this.form.id != null) {
|
||||
updateGoods(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addGoods(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除店铺商品编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delGoods(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** ${subTable.functionName}序号 */
|
||||
rowSShopGoodsSkuIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** ${subTable.functionName}添加按钮操作 */
|
||||
handleAddSShopGoodsSku() {
|
||||
let obj = {};
|
||||
obj.goodsId = "";
|
||||
obj.skuId = "";
|
||||
obj.spec = "";
|
||||
obj.erpGoodsSpecId = "";
|
||||
obj.erpGoodsId = "";
|
||||
obj.erpGoodsSpecCode = "";
|
||||
obj.skuQuantity = "";
|
||||
obj.consignPrice = "";
|
||||
obj.outerId = "";
|
||||
obj.outerGoodsId = "";
|
||||
obj.price = "";
|
||||
obj.retailPrice = "";
|
||||
obj.amountOnSale = "";
|
||||
obj.isSkuOnsale = "";
|
||||
obj.cargoNumber = "";
|
||||
obj.attributes = "";
|
||||
this.sShopGoodsSkuList.push(obj);
|
||||
},
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
handleDeleteSShopGoodsSku() {
|
||||
if (this.checkedSShopGoodsSku.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
} else {
|
||||
const sShopGoodsSkuList = this.sShopGoodsSkuList;
|
||||
const checkedSShopGoodsSku = this.checkedSShopGoodsSku;
|
||||
this.sShopGoodsSkuList = sShopGoodsSkuList.filter(function(item) {
|
||||
return checkedSShopGoodsSku.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleSShopGoodsSkuSelectionChange(selection) {
|
||||
this.checkedSShopGoodsSku = selection.map(item => item.index)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('shop/goods/export', {
|
||||
...this.queryParams
|
||||
}, `goods_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,276 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @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="商品ID" align="center" prop="wareId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="sku名称" align="center" prop="skuName" />
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="商家编码" align="center" prop="outerId" />
|
||||
<el-table-column label="京东价" align="center" prop="jdPrice" />
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 1">销售中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">已下架</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="handleLink(scope.row)"
|
||||
>关联ERP</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {listGoodsSku,getGoodsSku,linkErpGoodsSkuId,pullGoodsList} from "@/api/jd/goods";
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "GoodsJd",
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
importOpen:false,
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() },
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
pullLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type: 3}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = 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();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullGoodsList({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取JD商品接口返回=====',response)
|
||||
if(response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权!请前往店铺列表重新获取授权!', '系统提示', { confirmButtonText: '前往授权', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
// isRelogin.show = false;
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
this.$router.push({path:"/shop/shop_list",query:{type:3}})
|
||||
// location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
}else{
|
||||
this.getList()
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
}
|
||||
this.pullLoading = false
|
||||
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @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="商品ID" align="center" prop="goodsId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="商品名" align="center" prop="goodsName" />
|
||||
<el-table-column label="规格" align="center" prop="spec" />
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.thumbUrl" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="店铺" align="center" prop="shopId" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small">{{shopList.find(x=>x.id === scope.row.shopId).name}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商家编码" align="center" prop="outerId" />
|
||||
|
||||
<el-table-column label="状态" align="center" prop="isSkuOnsale" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.isSkuOnsale === 1">上架中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.isSkuOnsale === 0">已下架</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="handleLink(scope.row)"
|
||||
>关联ERP</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</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 {listGoodsSku,pullGoodsList} from "@/api/pdd/goods";
|
||||
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "GoodsPdd",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
pullLoading: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type:5}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = 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();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullGoodsList({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取PDD商品接口返回=====',response)
|
||||
if(response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权!请前往店铺列表重新获取授权!', '系统提示', { confirmButtonText: '前往授权', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
this.$router.push({path:"/shop/shop_list",query:{type:5}})
|
||||
// isRelogin.show = false;
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
}else{
|
||||
this.getList()
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
}
|
||||
this.pullLoading = false
|
||||
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,452 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="店铺名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入店铺名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="平台" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择平台" clearable>
|
||||
<el-option
|
||||
v-for="item in typeList"
|
||||
: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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['shop:shop:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['shop:shop:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['shop:shop:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['shop:shop:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="shopList" @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="center" prop="name" />
|
||||
<!-- <el-table-column label="店铺别名" align="center" prop="nickName" /> -->
|
||||
<!-- <el-table-column label="标识" align="center" prop="ename" /> -->
|
||||
<!-- <el-table-column label="店铺主体" align="center" prop="company" /> -->
|
||||
<el-table-column label="平台" align="center" prop="type" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.type === 1">1688</el-tag>
|
||||
<el-tag v-if="scope.row.type === 2">视频号小店</el-tag>
|
||||
<el-tag v-if="scope.row.type === 3">京东</el-tag>
|
||||
<el-tag v-if="scope.row.type === 4">淘系店铺</el-tag>
|
||||
<el-tag v-if="scope.row.type === 5">拼多多</el-tag>
|
||||
<el-tag v-if="scope.row.type === 6">抖店</el-tag>
|
||||
<el-tag v-if="scope.row.type === 7">小红书</el-tag>
|
||||
<el-tag v-if="scope.row.type === 8">快手小店</el-tag>
|
||||
<el-tag v-if="scope.row.type === 99">其他</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="店铺url" align="center" prop="url" /> -->
|
||||
<!-- <el-table-column label="排序" align="center" prop="orderNum" /> -->
|
||||
<!-- <el-table-column label="是否删除0否1是" align="center" prop="isDelete" /> -->
|
||||
<!-- <el-table-column label="是否显示(0:是1否)" align="center" prop="isShow" /> -->
|
||||
<!-- <el-table-column label="更新时间" align="center" prop="modifyOn" /> -->
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="第三方平台店铺id,淘宝天猫开放平台使用" align="center" prop="sellerUserId" /> -->
|
||||
<!-- <el-table-column label="卖家userId" align="center" prop="sellerUserIdStr" /> -->
|
||||
<!-- <el-table-column label="第三方平台sessionKey" align="center" prop="sessionKey" /> -->
|
||||
<!-- <el-table-column label="Appkey暂时抖音用" align="center" prop="appkey" /> -->
|
||||
<!-- <el-table-column label="Appsercet暂时抖音用" align="center" prop="appSercet" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<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-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['shop:shop:remove']"
|
||||
>删除</el-button>
|
||||
</el-row>
|
||||
<el-button
|
||||
v-if="scope.row.type!==3"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="handleUpdateToken(scope.row)"
|
||||
>更新AccessToken</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
plain
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleApiSetting(scope.row)"
|
||||
>API参数设置</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="店铺名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入店铺名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="平台" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择店铺平台">
|
||||
<el-option
|
||||
v-for="item in typeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺别名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入店铺别名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- API参数设置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="apiOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="appkey" prop="appkey">
|
||||
<el-input v-model="form.appkey" placeholder="请输入appkey" />
|
||||
</el-form-item>
|
||||
<el-form-item label="appSercet" prop="appSercet">
|
||||
<el-input v-model="form.appSercet" placeholder="请输入appSercet" />
|
||||
</el-form-item>
|
||||
<el-form-item label="API请求URL" prop="apiRequestUrl">
|
||||
<el-input v-model="form.apiRequestUrl" placeholder="请输入API请求URL" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卖家UserId" prop="sellerUserId">
|
||||
<el-input v-model="form.sellerUserId" placeholder="请输入sellerUserId" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="描述" prop="remark">-->
|
||||
<!-- <el-input type="textarea" v-model="form.remark" placeholder="请输入描述" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="authOpen" width="500px" append-to-body>
|
||||
<el-form ref="tokenForm" :model="tokenForm" :rules="rules" label-width="80px">
|
||||
<el-descriptions >
|
||||
<el-descriptions-item label="授权URL:"> {{ tokenForm.url }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
请手动复制上面的URL到浏览器中访问
|
||||
</div>
|
||||
<el-form-item label="code" prop="code">
|
||||
<el-input type="textarea" v-model="tokenForm.code" placeholder="请把授权后的code复制到这里" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="getTokenSubmit">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- 请手动复制上面的URL到浏览器中访问-->
|
||||
<!-- </div>-->
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listShop, getShop, delShop, addShop, updateShop, listPlatform} from "@/api/shop/shop";
|
||||
import {float} from "quill/ui/icons";
|
||||
export default {
|
||||
name: "Shop",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 店铺表格数据
|
||||
shopList: [],
|
||||
typeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
apiOpen: false,
|
||||
authOpen: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
type: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
type:null
|
||||
},
|
||||
// 获取token表单
|
||||
tokenForm:{
|
||||
shopId: null,
|
||||
shopType: null
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "店铺名不能为空", trigger: "blur" }
|
||||
],
|
||||
type: [{ required: true, message: "请选择平台", trigger: "change" }],
|
||||
appkey: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
appSercet: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
apiRequestUrl: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
sellerUserId: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
code: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listPlatform().then(res=>{
|
||||
this.typeList = res.rows;
|
||||
if(this.$route.query.type){
|
||||
this.queryParams.type = parseInt(this.$route.query.type)
|
||||
}
|
||||
this.getList();
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
/** 查询店铺列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listShop(this.queryParams).then(response => {
|
||||
this.shopList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.apiOpen = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
nickName: null,
|
||||
ename: null,
|
||||
company: null,
|
||||
type: null,
|
||||
url: null,
|
||||
orderNum: null,
|
||||
isDelete: null,
|
||||
isShow: null,
|
||||
modifyOn: null,
|
||||
remark: null,
|
||||
sellerUserId: null,
|
||||
sellerUserIdStr: null,
|
||||
sessionKey: null,
|
||||
appkey: null,
|
||||
appSercet: 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.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加店铺";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getShop(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.$nextTick(()=>{
|
||||
this.form.type = response.data.type+'';
|
||||
})
|
||||
|
||||
this.open = true;
|
||||
this.title = "修改店铺";
|
||||
});
|
||||
},
|
||||
|
||||
handleApiSetting(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getShop(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.apiOpen = true;
|
||||
this.title = "API参数设置";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateShop(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.apiOpen = false
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addShop(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除店铺编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delShop(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleUpdateToken(row){
|
||||
console.log("获取token",row)
|
||||
if(row.type === 2 || row.type === 5){
|
||||
getJdOAuthUrl({shopId:row.id}).then(response => {
|
||||
console.log("获取token=====jd ",response)
|
||||
this.authOpen = true;
|
||||
this.title = "更新店铺授权";
|
||||
this.tokenForm.url = response.data
|
||||
this.tokenForm.shopId = row.id
|
||||
this.tokenForm.shopType = row.type
|
||||
})
|
||||
}else if(row.type ===1){
|
||||
getTaoOAuthUrl({shopId:row.id}).then(response => {
|
||||
console.log("获取token=====tao ",response)
|
||||
this.authOpen = true;
|
||||
this.title = "更新店铺授权";
|
||||
this.tokenForm.url = response.data
|
||||
this.tokenForm.shopId = row.id
|
||||
this.tokenForm.shopType = row.type
|
||||
})
|
||||
}else if(row.type ===4){
|
||||
getOAuthUrl({shopId:row.id}).then(response => {
|
||||
console.log("获取token=====pdd ",response)
|
||||
this.authOpen = true;
|
||||
this.title = "更新店铺授权";
|
||||
this.tokenForm.url = response.data
|
||||
this.tokenForm.shopId = row.id
|
||||
this.tokenForm.shopType = row.type
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,290 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="平台商品ID" prop="numIid">
|
||||
<el-input
|
||||
v-model="queryParams.numIid"
|
||||
placeholder="请输入平台商品ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpGoodsSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpGoodsSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" >
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="平台skuId" align="center" prop="skuId" />
|
||||
<el-table-column label="平台商品ID" align="center" prop="numIid" />
|
||||
<el-table-column label="商家编码" align="center" prop="outerId" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="主图" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px;" :src="scope.row.picUrl"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" align="center" prop="propertiesName" />
|
||||
<el-table-column label="ERP商品sku Id" align="center" prop="erpGoodsSkuId" />
|
||||
<!-- <el-table-column label="快递单号" align="center" prop="logisticsCode" />-->
|
||||
|
||||
<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-share"
|
||||
@click="handleLink(scope.row)"
|
||||
>关联ERP</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"
|
||||
/>
|
||||
|
||||
<!-- 关联ERP -->
|
||||
<el-dialog title="关联ERP商品SKU" :visible.sync="detailOpen" width="560px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" inline>
|
||||
<el-form-item label="ERP商品SkuId" prop="erpGoodsSkuId">
|
||||
<el-input v-model.number="form.erpGoodsSkuId" placeholder="请输入ERP商品SkuId" style="width:250px" />
|
||||
<!-- <el-select v-model="form.erpGoodsSkuId" filterable remote reserve-keyword placeholder="搜索(sku编码、skuId)" style="width: 350px;"-->
|
||||
<!-- :remote-method="searchSku" :loading="skuListLoading" @change="skuChanage(scope.row)">-->
|
||||
<!-- <el-option v-for="item in skuList" :key="item.id"-->
|
||||
<!-- :label="item.name + ' - ' + item.colorValue + ' ' + item.sizeValue + ' ' + item.styleValue"-->
|
||||
<!-- :value="item.id">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listShop } from "@/api/shop/shop";
|
||||
import { searchSku } from "@/api/goods/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {getGoodsSku, linkErpGoodsSkuId, listGoodsSku, pullGoodsList} from "@/api/tao/goods";
|
||||
|
||||
export default {
|
||||
name: "GoodsTao",
|
||||
data() {
|
||||
return {
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
pullLoading: false,
|
||||
goodsList:[],
|
||||
shopList:[],
|
||||
skuList:[],
|
||||
// 是否显示弹出层
|
||||
detailOpen:false,
|
||||
skuListLoading:false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
shopId: null,
|
||||
numIid: null,
|
||||
skuId: null,
|
||||
outerId: null,
|
||||
erpGoodsSkuId: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
erpGoodsSkuId:null,
|
||||
id:null
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
erpGoodsSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type: 4}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
},
|
||||
mounted() {
|
||||
if(this.$route.query.shopId){
|
||||
this.queryParams.shopId = this.$route.query.shopId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询淘宝订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
console.log('====222222==',this.queryParams)
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.detailOpen = false;
|
||||
this.saleAfterOpen = false
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
erpGoodsSkuId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullGoodsList({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取淘宝商品接口返回=====',response)
|
||||
if(response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权!请前往店铺列表重新获取授权!', '系统提示', { confirmButtonText: '前往授权', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
// isRelogin.show = false;
|
||||
this.$router.push({path:"/shop/shop_list",query:{type:4}})
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
}else{
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.getList()
|
||||
}
|
||||
|
||||
|
||||
this.pullLoading = false
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.detailOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
// 搜索SKU
|
||||
searchSku(query) {
|
||||
this.shopLoading = true;
|
||||
const qw = {
|
||||
keyword: query
|
||||
}
|
||||
searchSku(qw).then(res => {
|
||||
this.skuList = res.rows;
|
||||
this.skuListLoading = false;
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
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 :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @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="商品ID" align="center" prop="productId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="sku属性" align="center" prop="skuAttr" />
|
||||
<el-table-column label="图片" align="center" prop="thumbImg" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.thumbImg" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="商家编码" align="center" prop="skuCode" />
|
||||
<el-table-column label="销售价" align="center" prop="salePrice" >
|
||||
<template slot-scope="scope">{{scope.row.salePrice / 100}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 5">销售中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">已下架</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="handleLink(scope.row)"
|
||||
>关联ERP</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="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</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 {pullGoodsList,listGoodsSku} from "@/api/wei/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
|
||||
export default {
|
||||
name: "GoodsWei",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type: 2}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = 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();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullGoodsList({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取视频号小店商品接口返回=====',response)
|
||||
if(response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权', '系统提示', { confirmButtonText: '重新授权', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
isRelogin.show = false;
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
}else{
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.getList()
|
||||
}
|
||||
|
||||
|
||||
this.pullLoading = false
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue