| | |
| | | <div class="layui-form-mid layui-word-aux"> |
| | | <button href="javascript:void(0);" class="add-brand layui-btn layui-btn-normal layui-btn-xs">添加品牌</button> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="areaId" class="layui-form-label ">所属地区</label> |
| | | <div class="layui-input-block layui-inline-4 address-class"> |
| | | <input type="hidden" name="areaId"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | <i class="layui-icon layui-icon-set"></i>确定 |
| | | </button> |
| | | </div> |
| | | <label class="layui-form-label"> 一级返现</label> |
| | | <label class="layui-form-label">经销商返现</label> |
| | | <div class="layui-input-inline layui-inline-2"> |
| | | <input class="layui-input" id="oneKeySetLevelOne"> |
| | | </div> |
| | |
| | | <th>货号</th> |
| | | <th>SKU</th> |
| | | <th>重量(克)</th> |
| | | <th>赠送积分</th> |
| | | <th>积分最大<br />可抵金额</th> |
| | | <!-- <th>赠送积分</th> |
| | | <th>积分最大<br />可抵金额</th> --> |
| | | <th>库存</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>成本价</th> |
| | | <th>市场价</th> |
| | | <th>一级返现</th> |
| | | <th>二级返现</th> |
| | | <th>三级返现</th> |
| | | <th>经销商返现</th> |
| | | <!-- <th>二级返现</th> |
| | | <th>三级返现</th> --> |
| | | <th>操作</th> |
| | | </tr> |
| | | </thead> |
| | |
| | | <td> |
| | | <input type="number" name="product[weight][]" value="{{item.weight}}" placeholder="重量" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <!-- <td> |
| | | <input type="number" name="product[points][]" value="{{item.points}}" placeholder="积分" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | </td> --> |
| | | <!-- <td> |
| | | <input type="text" name="product[pointsDeduction][]" value="{{item.pointsDeduction}}" placeholder="金额" class="layui-input layui-inline-1"> |
| | | </td> |
| | | </td> --> |
| | | <td class="have-add-td"> |
| | | <input type="number" name="product[stock][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock"> |
| | | </td> |
| | |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="市场价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="一级返现" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="经销商返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelThree][]" value="{{item.levelThree}}" placeholder="三级返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | </td> --> |
| | | <td> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs del-class" lay-active="delTr">删除</a> |
| | | </td> |
| | |
| | | {{# }); }} |
| | | </select> |
| | | </script> |
| | | <script src="/views/liao.js"></script> |
| | | <!--//一键设置SKU图片时自动生成选中的SKU--> |
| | | <script id="imageSetMoreSku_tpl" type="text/html"> |
| | | {{# layui.each(d, function(index, item){ }} |
| | |
| | | 'Authorization': Authorization |
| | | } |
| | | }); |
| | | /*****************************************************************/ |
| | | //地区选择 |
| | | function changeareaIdArea(i, max_i) { |
| | | //清除后面节点 |
| | | for (var x = i + 1; x <= 6; x++) { //最多6层,足够了 |
| | | $("select[name='areaId_" + x + "']").remove(); |
| | | } |
| | | var val = $("select[name='areaId_" + i + "']").val(); |
| | | if (val != "") { |
| | | //取子节点数据,然后显示下一级 |
| | | coreHelper.Post("Api/Tools/GetAreaChildren", { id: val }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | |
| | | if (e.length > 0) { |
| | | var str = ""; |
| | | str += "<select lay-ignore name='areaId_" + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | $.each(e, function (h, z) { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | }); |
| | | str += "</select>"; |
| | | $("select[name='areaId_" + i + "']").after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $("select[name='areaId_" + (i + 1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, i + 2); |
| | | }); |
| | | |
| | | //如果有返回值,就说明省市区没有选择到最终节点 |
| | | if (1 == 1) { |
| | | $("input[name='areaId']").val(""); |
| | | } else { |
| | | $("input[name='areaId']").val($("select[name='areaId_" + i + "']").val()); |
| | | } |
| | | } else { |
| | | $("input[name='areaId']").val($("select[name='areaId_" + i + "']").val()); |
| | | } |
| | | }); |
| | | } else { |
| | | if (1 == 1) { |
| | | $("input[name='areaId']").val(""); |
| | | } else { |
| | | //第一级的元素就直接赋值为空就是了 |
| | | if (i == 1) { |
| | | $("input[name='areaId']").val(""); |
| | | } else { |
| | | i--; |
| | | $("input[name='areaId']").val($("select[name='areaId_" + i + "']").val()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | coreHelper.Post("Api/Tools/GetAreaCheckedList", { id: 0 }, function (data) { |
| | | |
| | | |
| | | var str = ""; |
| | | $.each(data, function (i, n) { |
| | | |
| | | str += "<select lay-ignore name='areaId_" + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += `<option value= ${(d.data.areaId??0)===0?" selected='selected'":''} >请选择</option>`; |
| | | if(n.list.length>0) |
| | | { $.each(n.list, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | | } else { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | $.each(n.thisList, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | | } else { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | } |
| | | }); |
| | | } |
| | | str += "</select>"; |
| | | }); |
| | | $("input[name='areaId']").after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $.each(data, function (i, n) { |
| | | |
| | | if (i < (data.length)) { |
| | | $("select[name='areaId_" + (i + 1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, data.length); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | /*****************************************************************/ |
| | | //获取商品类型 |
| | | types = d.data.types; |
| | | // 渲染商品分类 |
| | |
| | | goods.unit = field['goods[unit]']; |
| | | goods.weight = field['goods[weight]']; |
| | | goods.openSpec = parseInt(field.openSpec); |
| | | if (isNumericString(field["areaId_1"])) { |
| | | goods.areaCode+=`${field["areaId_1"]}`; |
| | | if (isNumericString(field["areaId_2"])) |
| | | goods.areaCode+=`,${field["areaId_2"]}`; |
| | | if (isNumericString(field["areaId_3"])) |
| | | goods.areaCode+=`,${field["areaId_3"]}`; |
| | | } else { |
| | | |
| | | } |
| | | //多参数产品库生成列表集合 |
| | | var products = []; |
| | | var productsCount = parseInt(field['productsCount']); |