From 8d120580505ba97dd9c7bdef9122bf80559a558d Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 09 Feb 2023 18:09:15 +0800 Subject: [PATCH] 后台商品匹配运费模板 规格增加重量 --- src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html | 83 ++++++++++++++++++++++++++++++++++++++--- 1 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html index d91bcd3..70576a0 100644 --- a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html +++ b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html @@ -57,6 +57,12 @@ autoComplete="off" class="layui-input"> </div> </div> + <div class="layui-col-lg6"> + <label class="layui-form-label febs-form-item-require">重量:</label> + <div class="layui-input-block"> + <input type="text" name="goodsWeight" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> + </div> + </div> </div> <div class="layui-form-item"> <div class="layui-col-lg6"> @@ -216,18 +222,31 @@ </div> </div> + <blockquote class="layui-elem-quote blue-border">运费设置</blockquote> <div class="layui-form-item"> - <label class="layui-form-label">设置运费:</label> + <label class="layui-form-label">运费:</label> <div class="layui-input-block"> - <input type="radio" name="hasCarriage" value="1" title="开启" lay-filter="hasCarriage" /> - <input type="radio" name="hasCarriage" value="2" title="关闭" lay-filter="hasCarriage" checked /> + <input type="radio" name="carriageType" value="1" title="固定运费" lay-filter="hasCarriage" /> + <input type="radio" name="carriageType" value="2" title="使用邮费模板" lay-filter="hasCarriage" checked/> </div> </div> - <div class="layui-form-item carriage-input febs-hide"> - <label class="layui-form-label">运费:</label> - <div class="layui-input-block"> - <input type="text" name="carriage" placeholder="" autocomplete="off" class="layui-input"> + <div class="layui-form-item carriage-input febs-hide"> + <div class="layui-col-lg6"> + <label class="layui-form-label">固定运费:</label> + <div class="layui-input-block"> + <input id="carriageAmountDefault" type="text" name="carriageAmount" placeholder="" autocomplete="off" class="layui-input"> + <div class="layui-form-mid layui-word-aux">远费设置为0元,商品将显示为免运费。</div> + </div> + </div> + </div> + + <div class="layui-form-item carriage-rule"> + <div class="layui-col-lg6"> + <label class="layui-form-label febs-form-item-require">邮费模板:</label> + <div class="layui-input-block"> + <div id="carriage-rule"></div> + </div> </div> </div> @@ -380,6 +399,35 @@ autoRow: true, }); + // initValue(); + }) + + var carriageRule = xmSelect.render({ + el: '#carriage-rule', + language: 'zn', + prop : { + value : 'id', + children : 'child' + }, + iconfont: { + parent: 'hidden', + }, + radio: true, + clickClose: true, + tree: { + show: true, + //非严格模式 + strict: false, + }, + data: [] + }) + + febs.get(ctx + 'admin/goods/carriageRuleTree', null, function(res) { + carriageRule.update({ + data : res.data, + autoRow: true, + }); + initValue(); }) @@ -394,6 +442,7 @@ , {field: 'index', title: '序号', width: 70} , {field: 'styleName', title: '样式', edit: 'text'} , {field: 'skuName', title: '规格', edit: 'text'} + , {field: 'goodsWeight', title: '重量', edit:'text'} , {field: 'presentPrice', title: '现价', edit: 'text'} , {field: 'originalPrice', title: '原价', edit: 'text'} , {field: 'costPrice', title: '成本价', edit: 'text'} @@ -455,8 +504,11 @@ form.on('radio(hasCarriage)', function(data){ if (data.value == 2) { $('.carriage-input').hide(); + $('.carriage-rule').show(); } else { $('.carriage-input').show(); + $('.carriage-rule').hide(); + document.getElementById('carriageAmountDefault').value = 0; } }); @@ -652,6 +704,9 @@ "costPrice": goodsInfo.costPrice, "isSku": goodsInfo.isSku, "thumb": goodsInfo.thumb, + "carriageType": goodsInfo.carriageType, + "carriageAmount": goodsInfo.carriageAmount, + "goodsWeight": goodsInfo.goodsWeight, "thumbs": thumbs }); @@ -659,8 +714,21 @@ arr.push(goodsInfo.categoryId) category.setValue(arr); + var arrCarriageRule = []; + arrCarriageRule.push(goodsInfo.carriageRuleId) + carriageRule.setValue(arrCarriageRule); + if (goodsInfo.isNormal == 2) { $(".tc-set").show(); + } + + if (goodsInfo.carriageType == 2) { + $('.carriage-input').hide(); + $('.carriage-rule').show(); + } else { + $('.carriage-input').show(); + $('.carriage-rule').hide(); + document.getElementById('carriageAmountDefault').value = goodsInfo.carriageAmount; } if (goodsInfo.isSku == 1) { @@ -706,6 +774,7 @@ data.field.mailGoodsSkuDto = tableSkuData; data.field.delSkuId=delSku; data.field.categoryId = category.getValue('valueStr'); + data.field.carriageRuleId = carriageRule.getValue('valueStr'); data.field.goodsDetails = editor.getHtml(); $.ajax({ 'url': ctx + 'admin/goods/updateMallGoods', -- Gitblit v1.9.1