| | |
| | | </div> |
| | | </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" value="{{d.data.areaId || '' }}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="bn" class="layui-form-label layui-form-required">商品编码</label> |
| | | <div class="layui-input-inline layui-inline-6"> |
| | | <input name="goods[bn]" id="bn" lay-verType="tips" lay-verify="required|verifybn" value="{{d.data.model.bn }}" class="layui-input" lay-reqText="请输入商品编码" placeholder="请输入不超过30个字符内容" /> |
| | |
| | | 1、选择对应的【商品类型】,将进入多SKU货品模式。同时如果类别有参数,也将进行显示设置。<br/> |
| | | 2、设置多SKU后,商品本身的价格只做对外展示用,实际以进入商品详情选择不同货品为准。<br/> |
| | | 3、货品SKU组合属性值只支持:中文、英文、数字、大写符号,小写符号三个(-、/、.))<br/> |
| | | 4、货号必须为SN字母开头<br/> |
| | | 4、货品编码必须为SN字母开头<br/> |
| | | 5、如果不设置单货品重量,将默认使用商品重量为1个单位的重量。 |
| | | </blockquote>--> |
| | | |
| | |
| | | <tr> |
| | | <th>默认货品</th> |
| | | <th>图片</th> |
| | | <th>货号</th> |
| | | <th>货品编码</th> |
| | | <th>SKU</th> |
| | | <th>重量(克)</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>积分最大<br />可抵金额</th> --> |
| | | <th>库存数量</th> |
| | | <th>冻结库存</th> |
| | | <th style="width: 60px;">建议零售价</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>经销商价</th> |
| | | <th>成本价</th> |
| | | |
| | | <th style="width: 60px;">推广经销商采购返现</th> |
| | | <th>推广用户购买返现</th> |
| | | <th style="width: 80px;">是否支持定制</th> |
| | | <!-- <th>二级返现</th> |
| | | <!-- <th>三级返现</th> --> --> |
| | | |
| | | <th>操作</th> |
| | | </tr> |
| | | </thead> |
| | |
| | | </div> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[sn][]" value="{{item.sn}}" placeholder="货号" class="layui-input layui-inline-3"> |
| | | <input type="text" name="product[sn][]" value="{{item.sn}}" placeholder="货品编码" class="layui-input layui-inline-3"> |
| | | </td> |
| | | <td> |
| | | <input type="hidden" name="product[spesDesc][]" value="{{item.spesDesc}}" placeholder="SKU" class="layui-input"> |
| | |
| | | <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> |
| | | <td> |
| | | {{item.freezeStock}} |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="建议零售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[price][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | |
| | | <input type="text" name="product[distributionPrice][]" value="{{item.distributionPrice||'0'}}" placeholder="经销商价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="市场价" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[distributionCutMoney][]" value="{{item.distributionCutMoney||'0'}}" 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[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="推广普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="checkbox" name="product[isCustomizable][]" {{item.isCustomizable==true? 'checked':""}} value="{{item.isCustomizable||'false'}}" title="支持|不支持" lay-skin="switch" lay-filter="isCustomizable" > |
| | | </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> |
| | | {{item.freezeStock}} |
| | | </td> |
| | | </td> --> |
| | | |
| | | <td> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs del-class" lay-active="delTr">删除</a> |
| | | </td> |
| | |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-active="getGenerateSpecBtn"><i class="layui-icon layui-icon-export"></i>生成SKU货品列表</button> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <!-- <div class="layui-input-inline"> |
| | | <button type="button" class="aKeySetBtn layui-btn layui-btn-warm layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-set"></i>一键设置 |
| | | </button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div id="more_spec"></div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <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="oneKeySetMktPrice"> |
| | | </div> |
| | |
| | | <input type="checkbox" name="skuAttrValue" value="{{item}}" title="{{item}}" lay-filter="skuAttrValue-filter"> |
| | | {{# }); }} |
| | | </script> |
| | | |
| | | <script src="/views/liao.js"></script> |
| | | |
| | | <script> |
| | | var $; |
| | |
| | | } else { |
| | | oldSingleData = d.data.products[0]; |
| | | } |
| | | |
| | | |
| | | //初始化商品信息 |
| | | var getTpl = getSpec_tpl.innerHTML, viewBox = document.getElementById('more_spec'); |
| | | var tmpData = oldMultitermData; |
| | |
| | | var btn = $('#openSpecBtn'); |
| | | $(btn).html("取消SKU"); |
| | | } |
| | | /*****************************************************************/ |
| | | //地区选择 |
| | | |
| | | var expensiveItems = d.data.categories.data.filter(function(item) { |
| | | return item.price > 100; |
| | | }); |
| | | var areaid=0; |
| | | var arelist= d.data.model?.areaCode?.split(","); |
| | | |
| | | if(Array.isArray(arelist)) |
| | | { |
| | | var u= arelist[arelist.length - 1] |
| | | let num = Number(u); |
| | | if(!Number.isNaN(num)) |
| | | { |
| | | areaid=num; |
| | | } |
| | | } |
| | | |
| | | |
| | | coreHelper.Post("Api/Tools/GetAreaCheckedList", { id: areaid}, 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); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | 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()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | /*****************************************************************/ |
| | | |
| | | // 渲染商品分类 |
| | | var insXmSelGoodsCategoryId = xmSelect.render({ |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听开关切换事件 |
| | | form.on('switch(isCustomizable)', function(data){ |
| | | var elem = data.elem; // 当前开关元素 |
| | | elem.value=true; |
| | | |
| | | }); |
| | | //图集上传 |
| | | $('#upBtnimageIds').click(function () { |
| | | cropperImg.cropImg({ |
| | |
| | | form.verify({ |
| | | money: [/((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/, '请输入金额'], |
| | | verifybn: [/^[\S]{0,30}$/, '商品编码最大只允许输入30位字符,且不能出现空格'], |
| | | verifysn: [/^[\S]{0,30}$/, '货号最大只允许输入30位字符,且不能出现空格'], |
| | | verifysn: [/^[\S]{0,30}$/, '货品编码最大只允许输入30位字符,且不能出现空格'], |
| | | verifyname: [/^.{0,200}$/, '商品名称最大只允许输入200位字符'], |
| | | verifybrief: [/^.{0,255}$/, '商品简介最大只允许输入255位字符,且不能出现空格'], |
| | | verifyimageIds: [/^[\S]{0,255}$/, '默认图片 图片id最大只允许输入255位字符,且不能出现空格'], |
| | |
| | | goods.stock = field['goods[stock]']; |
| | | goods.unit = field['goods[unit]']; |
| | | goods.weight = field['goods[weight]']; |
| | | goods.areaCode=''; |
| | | |
| | | 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 { |
| | | |
| | | } |
| | | |
| | | goods.openSpec = parseInt(field.openSpec); |
| | | //多参数产品库生成列表集合 |
| | | var products = []; |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //添加 百分兵法 |
| | | productModel.isCustomizable = field['product[isCustomizable][' + i + ']']; |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | | products.push(productModel); |
| | | |
| | | } |
| | | //会员价格模型 |
| | | var gradePrice = []; |