batchedit1.html
7.69 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<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>