goodsEdit.html
3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!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>