batchedit1.html 7.69 KB
<include file="public/layout"/>

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;  min-width:400px;">
<div id="" class="layui-layer-content" >
    <div style="margin:10px 10%;font-size: 15px;">
        <if condition="$batchtype eq 1">
        <input id="exp_sum_type3" onclick="showfir(0)" type="radio" name="exp_sum_type" value="3" checked>
        <label for="exp_sum_type3">按件数</label>
        <input id="exp_sum_type2" onclick="showfir(0)" type="radio" name="exp_sum_type" value="2">
        <label for="exp_sum_type2">按重量 </label>
        <input id="exp_sum_type1" onclick="showfir(1)" type="radio" name="exp_sum_type" value="1">
        <label for="exp_sum_type1">统一运费</label>

        <span  id="expfir" style="display: none;"><input type="text" value="" name="uniform_exp_sum" class="t_mane"
               id="uniform_exp_sum" onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
               onkeydown="strkeydown(event, this, 'sumbbtn')"></span>
        </if>
        <if condition="$batchtype eq 2">
            品牌修改为:
            <select name="brand_id" id="brand_id" class="small form-control">
                <option value="0">所有品牌</option>
                <foreach name="brandList" item="v" key="k">
                    <option value="{$v.id}">
                    {$v.name}
                    </option>
                </foreach>
            </select>

        </if>
        <if condition="$batchtype eq 3">
           国别修改为: <select name="nation_id" id="nation_id" class="small form-control">
                <option value="">所有国别</option>
                <foreach name="nationList" item="v" key="k">
                    <option value="{$v.id}">
                    {$v.name}
                    </option>
                </foreach>
            </select>
        </if>
        <if condition="$batchtype eq 4">
            类别修改为:
            <select name="cat_id" id="cat_id" onChange="get_category(this.value,'cat_id_2','0');"
                            class="small form-control">
            <option value="0">请选择分类</option>
            <foreach name="cat_list" item="v" key="k">
                <option value="{$v['id']}">
                {$v.mobile_name}
                </option>
            </foreach>
        </select>
            <select name="cat_id_2" id="cat_id_2" onChange="get_category(this.value,'cat_id_3','0');"
                    class="small form-control">
                <option value="0">请选择分类</option>
            </select>
            <select name="cat_id_3" id="cat_id_3" class="small form-control">
                <option value="0">请选择分类</option>
            </select>
        </if>

        <if condition="$batchtype eq 5">
            修改为:    <input type="radio" id="isshow0" name="isshow" placeholder="" checked value="1">
            <label for="isshow0">上架</label>
            <input type="radio" id="isshow1" name="isshow" placeholder="" value="0">
            <label for="isshow1">下架</label>


        </if>
        <if condition="$batchtype eq 6">
            修改为:
            <input id="distr_type0" type="radio" name="distr_type" value="0" checked="">
            <label for="distr_type0">用户自选</label>
            <input id="distr_type1" type="radio" name="distr_type" value="1">
            <label for="distr_type1">自提</label>
            <input id="distr_type2" type="radio" name="distr_type" value="2">
            <label for="distr_type2">物流</label>



        </if>

        <if condition="$batchtype eq 7">
            是否积分修改为:
            <input id="give_integral1" type="radio" name="give_integral" value="1" checked="">
            <label for="give_integral1"></label>
            <input id="give_integral0" type="radio" name="give_integral" value="0" >
            <label for="give_integral0"></label>



        </if>
        <div style="padding-top: 10px;text-align: left;color: red">
            注:只修改当前页所选项
        </div>
    </div>
    <div class="layui-layer-btn" style="width: 300px;">
        <a class="layui-layer-btn0" id="btnmodi">
            确认修改
        </a>
        <a class="layui-layer-btn1">
            取消
        </a>
    </div>
</div>

<script>


    function showfir(ind) {
        if (ind == 1) {
            $("#expfir").fadeIn(3);
        } else {
            $("#expfir").fadeOut(3);
        }
    }


   $("#btnmodi").click(function () {
       var batchtype="{$batchtype}";
       var getparm="{$urlparam}";
       switch (batchtype)
       {
           case "1":
               var exp_sum_type= $("input[name='exp_sum_type']:checked").val();
               getparm+="&exp_sum_type="+exp_sum_type;
               if (exp_sum_type==1)
               {
                   getparm+="&uniform_exp_sum="+$("#uniform_exp_sum").val();
                   if ($("#uniform_exp_sum").val()=="") {
                       layer.msg('请选择统一金额', {icon: 2, time: 2000});
                       return false;
                   }
               }
               else
               {
                   getparm+="&uniform_exp_sum=0";
               }
               break;
           case "2":
               if ($("#brand_id").val()==0) {
                   layer.msg('请选择品牌', {icon: 2, time: 2000});
                   return false;
               }
               getparm+="&brand_id="+$("#brand_id").val();
               break;
           case "3":
               if ($("#nation_id").val()==0) {
                   layer.msg('请选择国别', {icon: 2, time: 2000});
                   return false;
               }
               getparm+="&nation_id="+$("#nation_id").val();
               break;
           case "4":
               if ($("#cat_id").val()==0) {
                   layer.msg('请选择类别', {icon: 2, time: 2000});
                   return false;
               }
               getparm+="&cat_id="+$("#cat_id").val();
               getparm+="&cat_id_2="+$("#cat_id_2").val();
               getparm+="&cat_id_3="+$("#cat_id_3").val();
               break;
           case "5":
               var getisshow= $("input[name='isshow']:checked").val();
               getparm+="&isshow="+getisshow;
               break;
           case "6":
               var distr_type= $("input[name='distr_type']:checked").val();
               getparm+="&distr_type="+distr_type;
               break;
           case "7":
               var give_integral= $("input[name='give_integral']:checked").val();
               getparm+="&give_integral="+give_integral;
               break;
       }


       layer.msg('加载中...', {
           icon: 16,
           shade: [0.5, '#f5f5f5'],
           scrollbar: false,
           offset: '200px',
           time: 100000
       });
       $.ajax({
           url:getparm+ "&ispost=1",
           type: 'post',
           dataType: 'json',
           success: function (data) {
               layer.closeAll();
               if (data.code==0){
                   layer.msg('修改成功', {icon: 1, time: 2000});
                   setTimeout(function () {
                       window.parent.batcheditclose();
                   },1000)
               }else {
                   layer.msg('修改失败', {icon: 2, time: 2000});
               }
           },
           error: function () {
               layer.closeAll();
               layer.msg('修改失败', {icon: 2, time: 2000});
           }
       });
   })
    $(".layui-layer-btn1").click(function () {
       window.parent.layer.closeAll();
    })

    $("#pricetype").change(function () {
        $("#newpricetype").val($("#pricetype").val());

    })
</script>
</body>
</html>