<tbody id="datagridTemplate" style="display: none">
<tr id="list">
<td class="text-center" nowrap>#radiolink#</td>
<td class="text-center" style="color:#8c8c8c;width:50px;" nowrap>
<p><span class="glyphicon glyphicon-edit edit_btn" code="#vc_code#" status="#i_status#"></span></p>
<p><span class="glyphicon glyphicon-trash delete_btn" code="#vc_code#" status="#i_status#"></span></p>
</td>
<td class="text-center" nowrap>#vc_storagename#</td>
select
‘<input type="radio" name="paramlist" value="‘||vc_code||‘" status="‘||i_status||‘" code="‘||i_flag||‘" />‘ AS radiolink,
vc_code,
(SELECT vc_storage_name FROM e_storage WHERE e_inout.vc_storage = e_storage.vc_code) AS vc_storagename,
vc_storage,
"i_status" IS ‘状态:1待确认、2已确认‘;
search=$Search({datagrid:"datagrid",formId:"searchForm",success:function(){
$(".edit_btn").unbind().on("click", function(){
if($(this).attr("code") != undefined && $(this).attr("code") != ""){
if( "2" == $(this).attr("status") ){
ccms.dialog.notice("万能票出入库单已确认,不允许修改!", 2000);
}else{
obj.edit({id:$(this).attr("code")});
}
}
});
$(".delete_btn").unbind().on("click", function(){
var obthis = $(this);
if( "2" == obthis.attr("status") ){
ccms.dialog.notice("万能票出入库单已确认,不允许删除!", 2000);
}else{
$Dialog().confirm("确定要删除该条数据吗?", function(){
if(obthis.attr("code") != undefined && obthis.attr("code") != ""){
obj.del({id:obthis.attr("code")});
}
});
}
});
$(".btn_merchandise").each(function(){
$(this).click(function(){
ccms.dialog.open({url :"${def:context}/action/project/erpClub/fncMngSys/goodsMng/conSet/crud?inout_code="+$(this).attr("code1")+"&inout_type="+$(this).attr("code")+"&vc_storage="+$(this).attr("code2"),id:"pickid"});
});
});
ccms.util.renderRadio("paramlist");
}}).initSearchBtn().searchData(1);
$("#confirm_btn").unbind().on("click",function(){----------确认单据按钮
var pobj = $("input[name=paramlist]:checked");
if( pobj.length <= 0 ){
ccms.dialog.notice("请先选择需要确认的单据",2000);
}else if( "2" == pobj.attr("status") ) {
ccms.dialog.notice("该单据已确认,无法重复确认",2000);
}else if( "1" == pobj.attr("status") ) {
var i_flag = pobj.attr("code");
var url = "";
if( "1" == i_flag ){ // 入
url = "${def:actionroot}/confirm/in?vc_code=" + pobj.val();
}else if( "0" == i_flag ){
url = "${def:actionroot}/confirm/out?vc_code=" + pobj.val();
}
if( "" != url ){
ajaxCall(url,{
method : "get",
progress : true,
dataType : "script",
success : function() {
$Dialog().notice("单据已确认!",1200,function() {
search.searchData(1);
});
}
});
}
}
});
$("#print_btn").unbind().on("click",function(){
var pobj = $("input[name=paramlist]:checked");
if( pobj.length <= 0 ){
ccms.dialog.notice("请先选择需要打印的单据",2000);
}else{
var url = "${def:context}/action/project/erpClub/print/excel/printwarehouse?vc_code=" + pobj.val();
ajaxCall(url,{
method : "get",
progress : true,
dataType : "script",
success : function() {
}
});
}
});
});