1 功能介绍:卖家-运输管理-提货方式维护

具体功能界面如下:

自动保存[点击'复选框'自动保存 && 点击‘单选按钮’自动保存 ]

相关代码如下:

显示的'汽运'和'火运'两行代码是写死的,而且只显示两行,当点击'自提'或'配送'时会自动保存到t_trans_delivery表中

选中之后,复选框中的对勾会显示,取消之后 复选框中的对勾又会消失。

表结构如下:

自动保存[点击'复选框'自动保存 && 点击‘单选按钮’自动保存 ]

————————————————————————————————————————

复选框选中或取消的相关代码:

<%
String a = "0" ;
String b = "0" ;
String c = "0";
String d = "0";
if(list!=null){
for(int i=0;i<list.size();i++){
map = (Map)list.get(i);
String transport_mode = myFunc.getValue(map.get("transport_mode"));
String delivery_method = myFunc.getValue(map.get("delivery_method"));
String is_selected = myFunc.getValue(map.get("is_selected"));
if("1".equals(transport_mode) && "1".equals(delivery_method)  && "1".equals(is_selected) ){
a ="1"; //汽运-自提-选中
}
if("1".equals(transport_mode) && "2".equals(delivery_method)  && "1".equals(is_selected) ){
b="2"; //汽运-配送
}
if("2".equals(transport_mode) && "1".equals(delivery_method)  && "1".equals(is_selected) ){
c ="1"; //火运-自提
}
if("2".equals(transport_mode) && "2".equals(delivery_method)  && "1".equals(is_selected) ){
d="2"; // 火运-配送
}
    }
}

%>

——————————————————————————————————————————————————

列表那两行显示的记录代码如下:

<tr align="center">

<td width="50%">
汽运
</td>
<td width="50%">

自 提 <input type="checkbox" name="check" id="check1" value="<%=a%>" 

                        <%if("1".equals(a)){%>checked<%}%>  class="fxk" onclick = "tj(this,'1','1')"/>

配送 <input type="checkbox" name="check" id="check2"  value="<%=b%>"   

                       <%if("2".equals(b)){%>checked<%}%> class="fxk" onclick = "tj(this,'2','1')"/>

</td>
</tr>
<tr align="center">
<td width="50%">
火运
</td>
<td width="50%">

自 提<input type="checkbox" name="check" id="check3" value="<%=c%>"  

                       <%if("1".equals(c)){%>checked<%}%>  class="fxk" onclick = "tj(this,'1','2')"/>

配送<input type="checkbox" name="check" id="check4"  value="<%=d%>"   

                      <%if("2".equals(d)){%>checked<%}%> class="fxk" onclick = "tj(this,'2','2')"/>

</td>

</tr>

提交的js代码:

function tj(obj, value,mode){
var ret = $(obj).is(":checked");  //选中返回true,没选中返回false
obj.disabled = true;
$.ajax({
type: "post",
url:"good_action.jsp",
async:false, //同步
data:{"value":value,"transport_mode":mode,"ret":ret},
success:function(msg){
  if(checkLogin2(msg)){
if(msg.toString() != "0"){
msgBox("保存成功");
}else{
msgBox("保存失败");
}
}
}
});
}

具体业务代码见'sgsd'项目中admin/seller/goodMaintain/good_list.jsp和good_action.jsp

****************************************************************************************************************************

1 功能介绍:卖家-资金管理-开票类型控制

具体功能界面如下:

自动保存[点击'复选框'自动保存 &amp;&amp; 点击‘单选按钮’自动保存 ]

点击按钮会自动保存到invoices_type表中,默认显示是'一票结和两票结'

表结构如下:

自动保存[点击'复选框'自动保存 &amp;&amp; 点击‘单选按钮’自动保存 ]

相关代码如下:

<%
String create_name = "";
String create_time ="";
String id = "";
String is_selected = "";
String status = "";
String invoicing_type="3";
if(list!=null){
for(int i=0;i<list.size();i++){
map = (Map)list.get(i);
id = myFunc.getValue(map.get("id"));
invoicing_type = myFunc.getValue(map.get("invoicing_type"));  // 1:一票结 2:两票结
is_selected = myFunc.getValue(map.get("is_selected"));
create_name = myFunc.getValue(map.get("create_name"));

create_time = myFunc.getValue(map.get("create_time"));

                // 当按钮被选中的时候,按钮显示被选中

if("1".equals(invoicing_type)){
status ="1"; //一票结
}
if("2".equals(invoicing_type)){
status="2"; //两票结
}
if("3".equals(invoicing_type)){
status ="3"; //一票结和两票结
}
        }
}
%>
<input type="hidden" id="invoiceTypeId" value="<%=id%>"/>
<tr align="center">
<td width="25%">
一票结
</td>
<td width="25%">
<input type="radio" name="invoicing_type" id="invoicing_type1"value="<%=status%>"                         <%if("1".equals(status)){%>checked<%}%>  class="fxk" onclick = "tj(this,'1')"/>
</td>
<td width="25%">
<%if("1".equals(status)){ %>
<%=create_name %>
<%}else{ %>
<%} %>
</td>
<td width="25%">
<%if("1".equals(status)){ %>
<%=myFunc.displayDate(myFunc.getValue(create_time))%>
<%}else{ %>
<%} %>
</td>
</tr>
<tr align="center">
<td width="25%">
两票结
</td>
<td width="25%">
<input type="radio" name="invoicing_type" id="invoicing_type1"  value="<%=status%>"                                 <%if("2".equals(status)){%>checked<%}%>  class="fxk" onclick = "tj(this,'2')"/>
</td>
<td width="25%">
<%if("2".equals(status)){ %>
<%=create_name %>
<%}else{ %>
<%} %>
</td>
<td width="25%">
<%if("2".equals(status)){ %>
<%=myFunc.displayDate(myFunc.getValue(create_time))%>
<%}else{ %>
<%} %>
</td>
</tr>
<tr align="center">
<td width="25%">
一票结和两票结
</td>
<td width="25%">
<input type="radio" name="invoicing_type" id="invoicing_type3"  value="<%=status%>"                                 <%if("3".equals(status)||status.equals("")){%>checked<%}%>  class="fxk" onclick = "tj(this,'3')"/>
</td>
<td width="25%">
<%if("3".equals(status)){ %>
<%=create_name %>
<%}else{ %>
<%} %>
</td>
<td width="25%">
<%if("3".equals(status)){ %>
<%=myFunc.displayDate(myFunc.getValue(create_time))%>
<%}else{ %>
<%} %>
</td>
</tr>

</table>

提交的js代码:

function tj(obj, value){
$.ajax({
type: "post",
url:"control_action.jsp",
async:false, //同步
data:{"value":value,"id":$("#invoiceTypeId").val()},
success:function(msg){
  if(checkLogin2(msg)){
if(msg.toString() != "0"){
msgBox("保存成功");
}else{
msgBox("保存失败");
}
}
}
});

}

具体业务代码'sgds'项目的'资金管理'—'开票类型控制' admin/seller/control/control_list.jsp和control_action.jsp

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2021-10-25
  • 2021-07-08
  • 2021-07-18
  • 2021-10-18
  • 2021-05-04
  • 2021-06-03
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2021-07-03
  • 2021-11-24
  • 2021-05-08
  • 2021-04-30
相关资源
相似解决方案