goodsEdit.html 3.77 KB
<!DOCTYPE html>
<div id="goodsEdit" class="easyui-layout" fit="true" style="overflow-y: scroll;">
    <form name="goodsEditForm" id="goodsEditForm" method="post">
        <div style="margin-top: 20px;margin-left: 30px">
            <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">

                <tr style="height: 60px">

                    <td >
                        <label>商品SKN</label>  <br>
                        <input id="iptSKN" name="skn" class="easyui-textbox" style="width:520px;" disabled/>
                    </td>
                </tr>
                <tr style="height: 60px">
                    <td >
                        <span style="color:red">*</span><label>标题</label>  <br>
                        <input id="iptTitle" name="title" class="easyui-textbox" style="width:520px;"/>
                    </td>
                </tr>
                <tr style="height: 60px">
                    <td >
                        <span style="color:red">*</span><label>商品描述</label>  <br>
                        <textarea id="taContent"  class="easyui-validatebox" data-options="required:true" name="content" style="width:520px;" rows="6"/>
                    </td>
                </tr>
                <tr style="height: 60px">
                    <td id="imgTd">
                        <div id="imageUpload">
                        </div>
                    </td>
                </tr>
                <tr style="height: 60px">
                    <td >
                        <span style="color:red">*</span><label>展示顺序</label>  <br>
                        <input id="iptWeight" name="weight" type="number" class="easyui-textbox" style="width:520px;"/>
                    </td>
                </tr>

            </table>
        </div>
    </form>
</div>
<script>
    $(function () {
        $("#iptSKN").textbox({
            required:false,
        });
        $("#iptTitle").textbox({
            required:true,
            prompt: "请输入标题",
            validType:'length[0,60]'
        });
        $("#iptWeight").textbox({
            required:true,
            prompt: "数据越大越靠前"
        });
        $("#imageUpload").imageUpload({
            width: 171,
            height: 120,
            realInputName: "url",
            url: contextPath + '/fileupload/uploadFile',
            queryParams: {
                bucket: "goodsimg"
            },
            onBeforeSubmit: function () {
                $.messager.progress({
                    title: "正在执行",
                    msg: "正在执行,请稍后...",
                    interval: 500,
                    text: ""
                });
            },
            filterFileName: function (data) {
                debugger;
                if (!data || data.code != 200) {
                    $.messager.progress("close");
                    $.messager.alert("错误",data.message);
                    return "";
                }
                return data.data.url;
            },
            onLoadSuccess: function (data) {
                debugger;
                $.messager.progress("close");
                return false;
            }
        });

        $("#groupName").textbox({
            required: true,
            missingMessage: "分组名称不能为空",
            prompt: "请输入分组名称"
        });

        var data = paramObject.goodsData;
        if (data){
            $("#iptSKN").textbox("setValue", data.productSkn);
            $("#iptTitle").textbox("setValue", data.title);
            $("#taContent").val(data.content);
            $("#imageUpload").imageUpload('setValue',data.icon);
            $("#iptWeight").textbox("setValue", data.weight);
        }
        $("#goodsEditForm").form("validate")
    });


</script>