Administrator
2026-06-14 3004639ff851e76ecf2cb378a7b21dbe2caa3505
refactor(goods): 移除优惠券规则和运费规则的前端处理逻辑

- 删除了商品新增页面中的优惠券ID处理代码
- 移除了商品编辑页面中的优惠券规则获取逻辑
- 清理了运费规则ID的前端赋值操作
- 简化了表单提交的数据结构
- 优化了商品管理模块的代码逻辑
2 files modified
21 ■■■■■ changed files
src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html 10 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html 11 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
@@ -789,18 +789,8 @@
        form.on('submit(goods-add-form-submit)', function (data) {
            data.field.goodsType = 1;
            let couponRuleList = couponRule.getValue ? couponRule.getValue() : [];
            if (couponRuleList && couponRuleList.length > 0) {
                var couponIds = [];
                layui.each(couponRuleList, function (key, item) {
                    couponIds.push(item.id)
                });
                data.field.couponIds=couponIds;
            }
            data.field.addMallGoodsSkuDtos = tableSkuData;
            data.field.categoryId = category.getValue('valueStr');
            var carriageRuleId = carriageRule.getValue ? carriageRule.getValue('valueStr') : '';
            data.field.carriageRuleId = carriageRuleId;
            // let content = layedit.getContent();
            // alert(content);
            // data.field.goodsDetails = content;
src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
@@ -919,21 +919,10 @@
        }
        form.on('submit(goods-update-form-submit)', function (data) {
            let couponRuleList = couponRule.getValue ? couponRule.getValue() : [];
            if (couponRuleList && couponRuleList.length > 0) {
                var couponIds = [];
                layui.each(couponRuleList, function (key, item) {
                    couponIds.push(item.id)
                });
                data.field.couponIds=couponIds;
            }
            data.field.goodsType=1;
            data.field.mailGoodsSkuDto = tableSkuData;
            data.field.delSkuId=delSku;
            data.field.categoryId = category.getValue('valueStr');
            var carriageRuleId = carriageRule.getValue ? carriageRule.getValue('valueStr') : '';
            data.field.carriageRuleId = carriageRuleId;
            // data.field.goodsDetails = editor.getHtml();
            data.field.goodsDetails = editor.txt.html();
            $.ajax({
                'url': ctx + 'admin/goods/updateMallGoods',