$(document).ready(function(){ setPerm(); }); function ajaxCheckWork(){ var count_check = $('input#count_check').val(); if( count_check > 0 ){ $.ajax({ type: "POST", url: "<?php echo_path('/works/check/' . $work->id); ?> ", data: { count_check: count_check, }, dataType: 'json', success: function( response ){ $('div#dynamicZone').html( response['html'] ); if( response['is_success'] ){ // ztree setWorkTreeNodeColor('blue');
} ?> </div> </div> </div> <script type="text/javascript"> function removeImage(){ if( confirm('您确定要删除这张图片吗?') ) $.ajax({ url: "<?php echo_path('/images/remove/part/' . $part->id); ?> ", type: "GET", data: [], success: function(){ alert('附图已经被成功删除!'); $('div#maybeRemoved').remove(); } }); } $(document).ready(function(){ setPerm();
$('div.input-group.date').datepicker({ language: 'zh-CN', format: 'yyyy-mm', }); }); function statItemMonthPlan(){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); var project_src = $('form input#project_src').val(); if( project_src ){ window.open("<?php echo_path('/stat/month_item/proc_2/'); ?> " + date_start + '/' + date_end + '/' + project_src ); } else{ window.open("<?php echo_path('/stat/month_item/proc_2/'); ?> " + date_start + '/' + date_end ); } } </script>
<!-- 每隔10分钟 自动加载一次主页 让Session不要过期 --> <script type="text/javascript"> $(document).ready(function(){ setInterval( function(){ refreshSession(); } , 15 * 60 * 1000 ); }); function refreshSession(){ $.ajax({ type: 'GET', url: "<?php echo_path('/session'); ?> ", success: function( response ){ //console.log('refresh session!'); } }); } </script>
$('input#staff_short').keyup(function(){ var text = $(this).val(); var parent = $(this).parents('div.row'); if( text == ''){ $(parent).children('div').children('select#staff_id').html(staffs_all); return false; } $.ajax({ type: "GET", url: "<?php echo_path('/search/staff/'); ?> " + text, data: [], dataType: 'json', success: function( staffs ){ if( staffs.length > 0 ){ var options = ""; $(staffs).each(function(i,e){ var option = '<option value="' + e.id +'">' + e.name + '</option>'; options = options + option; }); $(parent).children('div').children('select#staff_id').html(options);
$('#progress .progress-bar').css( 'width', progress + '%' ); } }); } function ajaxEditPart(){ $.ajax({ type: "POST", url: "<?php echo_path('/parts/edit/' . $part->id); ?> ", data:$('form#editPartForm').serialize(), dataType: 'json', success: function( results ){ $('div#dynamicZone').html( results['html'] ); if( results['is_success'] ){ editTreeNode( results['newNode'] ); } } }); }
</div> </fieldset> </form> </div> </div> <script> type="text/javascript"> $('document').ready(function(){ $('div.input-group.date').datepicker({ language: 'zh-CN', format: 'yyyy-mm', }); }); function statProdProc(){ var prod_num = $('input#prodNum').val(); if( prod_num ){ window.open("<?php echo_path('/stat/prod/proc/'); ?> " + prod_num ); } } </script>
</fieldset> </form> </div> </div> <script type="text/javascript"> $('document').ready(function(){ $('div.input-group.date').datepicker({ language: 'zh-CN', format: 'yyyy-mm-dd', }); }); function statPartByRetrunDate(){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); if( date_start && date_end ){ window.open("<?php echo_path('/stat/part_return_date/'); ?> " + date_start + '/' + date_end ); } } </script>
?> </td> </tr> <?php if ($file->image) { ?> <tr> <td>零件附图</td> <td> <div class="col-xs-6 col-md-4"> <a href="<?php echo_path('/webroot/uploads/' . $file->image, true); ?> " class="thumbnail" target="_blank"> <img src="<?php echo_path('/webroot/uploads/' . $file->image, true); ?> " alt="<?php echo $file->name; ?> " width="250"> </a> </div> </td> </tr> <?php } ?> </tbody> </table> </div>
var roughcast = $('select#roughcast').val(); if( start_date && end_date && start_time && end_time ){ var start_point = start_date + ' ' + start_time; var end_point = end_date + ' ' + end_time; if( roughcast ){ window.open("<?php echo_path('/stat/part/mr_date/'); ?> " + start_point + '/' + end_point + '/' + roughcast ); } else{ window.open("<?php echo_path('/stat/part/mr_date/'); ?> " + start_point + '/' + end_point ); } } else{ alert('错误, 查询信息填写不完整!'); } } function getTimeStr( time_str ){ var pattern = /^(\d{2}):(\d{2})$/; var hour = time_str.match(pattern)[1]; var min = time_str.match(pattern)[2];
$('div.input-group.date').datepicker({ language: 'zh-CN', format: 'yyyy-mm-dd', }); }); function statByReturnDate(){ var start_date = $('form#statByReturnDateForm input#start_date').val(); var end_date = $('form#statByReturnDateForm input#end_date').val(); var use_dep = $('form#statByReturnDateForm select#use_dep').val(); if( start_date && end_date ){ if( use_dep == 0 ){ window.open("<?php echo_path('/stat/part/return/'); ?> " + start_date + '/' + end_date ); } else{ window.open("<?php echo_path('/stat/part/return/'); ?> " + start_date + '/' + end_date + '/' + use_dep ); } } } </script>
<button type="button" onclick="ajaxAddProd(); return false;" class="btn btn-success needPerm" roles="6" groups="1"><span class="glyphicon glyphicon-edit"></span> 提交</button> <button type="reset" class="btn btn-default btn-cancel needPerm" roles="6" groups="1"><span class="glyphicon glyphicon-share"></span> 重置</button> </div> </div> </fieldset> </form> </div> </div> <script type="text/javascript"> function ajaxAddProd(){ $.ajax({ type: "POST", url: "<?php echo_path('/productions/add'); ?> ", data:$('form#addProdForm').serialize(), dataType: 'json', success: function( results ){ $('div#dynamicZone').html( results['html'] ); // 更新z-tree节点 if( results['is_success'] ){ var newNode = results['newNode']; addTreeNode( newNode ); } }
if( selectedNode.type != 'file' ){ alert('对不起,您必须选择零件节点!'); return false; } if( selectedNode.id != file_id ){ alert('对不起,您选择的零件节点不是当前工序的父节点!'); return false; } $.ajax({ type: "POST", url: "<?php echo_path('/lib/units/add/' . $file->id); ?> ", data: $('form#ajax').serialize(), dataType: "json", success: function( results ){ if( results['is_success'] ){ clearErrors('ajaxAddNodeErrors'); $('button[type="reset"]').click(); // 页面更新元素 addOrInsertNode( results['newNode'] ); // 更新 zTree
format: 'yyyy-mm-dd', }); }); function statItemMonthPlan(){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); var group_id = $('select#staff_group').val(); //console.log( month , group_id ); if( date_start && date_end ){ if( group_id ){ window.open("<?php echo_path('/stat/month_item/plan/'); ?> " + date_start + '/' + date_end + '/' + group_id ); } else{ window.open("<?php echo_path('/stat/month_item/plan/'); ?> " + date_start + '/' + date_end ); } } } </script>
} ?> ><a href="<?php echo_path('/staffs/' . $i); ?> "><?php echo $i; ?> </a></li> <?php } ?> <?php } ?> <?php if ($page >= 1 && $page < $pages) { ?> <li><a href="<?php echo_path('/staffs/' . ($page + 1)); ?> ">»</a></li> <?php } ?> </ul> </div> </div>
" target="_blank"><span class="glyphicon glyphicon-lock"></span> 用户管理</a></li> <?php } ?> <li><a href="<?php echo_path('/profile'); ?> " target="_blank"><span class="glyphicon glyphicon-wrench"></span> 密码修改</a></li> <li><a href="#" onclick="popAboutBox();return false;"><span class="glyphicon glyphicon-info-sign"></span> 关于</a></li> <li class="divider"></li> <li><a href="#" onclick="hideHeadingBar();"><span class="glyphicon glyphicon-hand-up"></span> 隐藏菜单栏</a></li> <li><a href="<?php echo_path('/logout'); ?> "><span class="glyphicon glyphicon-off"></span> 注销</a></li> </ul> </li> </ul> </nav> <?php } else { ?> <div class="navbar-right" id="brandMsg" style="width: 280px;"> <a href="#" style="left: 0px;">品质驱动世界</a> <a href="#" style="left: 130px;">绿色造就未来</a> </div> <?php }
" + start_date + '/' + end_date ); } } function ajaxSearchByPartNum(){ var num = $('form#searchByPartNumForm input#num').val(); if( num ){ window.open("<?php echo_path('/urgent/search/part/'); ?> " + num ); } } function ajaxSearchGroupByProc(){ var start_date = $('form#ajaxSearchGroupByProcForm input#start_date').val(); var end_date = $('form#ajaxSearchGroupByProcForm input#end_date').val(); if( start_date && end_date ){ window.open("<?php echo_path('/urgent/search/proc/'); ?> " + start_date + '/' + end_date ); } } </script>
<td><?php echo get_user_group($user->group_id); ?> </td> <td><?php echo date('Y-m-d H:i:s', strtotime($user->create)); ?> </td> <td> <div class="btn-group"> <a href="<?php echo_path('/users/add'); ?> " class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus-sign"></span></a> <a href="<?php echo_path('/users/edit/' . $user->id); ?> " class="btn btn-sm btn-success"><span class="glyphicon glyphicon-share"></span></a> <a href="#" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash"></span></a> </div> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="panel-footer"> </div>
// ajax loading icon... if( $('img#loadingIcon').length == 0 ){ var loading_icon_path = "<?php echo_path('/webroot/img/ajax_loading.gif'); ?> "; $(tr).children('td').eq( $(tr).children('td').length - 1 ).children('a').after('<img id="loadingIcon" src="'+loading_icon_path+'">'); } $.ajax({ type: "POST", url: "<?php echo_path('/prod_manager/item_month/2014-06'); ?> ", data: { proc_id: proc_id, planned_completion_date: planned_completion_date, production_date: production_date }, success: function( response ){ if( $('img#loadingIcon').length ){ setTimeout( function(){ $('img#loadingIcon').remove(); } , 1000 ); }
<?php include_element('log.php'); ?> </ul> </div> </div> </div> </body> </html> <script type="text/javascript"> function freshCaptcha(){ var url = "<?php echo_path('/vendor/captcha/captcha.php'); ?> "; document.getElementById('captchaImg').src=url; } function validate(){ var user = $('input#account').val(); var pwd = $('input#password').val(); if( user == '' || pwd == '' ){ alert('用户名或密码不能为空!'); return false; }
} ?> </div> </div> </div> <script type="text/javascript"> function removeImage(){ if( confirm('您确定要删除这张图片吗?') ) $.ajax({ url: "<?php echo_path('/images/remove/proc/' . $proc->id); ?> ", type: "GET", data: [], success: function(){ alert('附图已经被成功删除!'); $('div#maybeRemoved').remove(); //$('div#maybeExtended').removeClass('col-xs-6').addClass('col-xs-12'); } }); } $(document).ready(function(){
?> </td> </tr> <?php if ($unit->image) { ?> <tr> <td>工序附图</td> <td> <div class="col-xs-6 col-md-4"> <a href="<?php echo_path('/webroot/uploads/' . $unit->image, true); ?> " class="thumbnail" target="_blank"> <img src="<?php echo_path('/webroot/uploads/' . $unit->image, true); ?> " alt="<?php echo $unit->name; ?> " width="250"> </a> </div> </td> </tr> <?php } ?> <tr> <td>备注</td> <td><?php
</form> </div> </div> </div> </div> <script type="text/javascript"> // 上传图片 function imageUpload(){ var url = "<?php echo_path('/lib/images/upload/' . $type . '/' . $id); ?> " $('input#ImageUploader').fileupload({ url: url, dataType: 'json', done: function ( e , data ) { // 图片上传成功! if( data.result.is_success ){ $('div#uploadImageErrorBox').html('<p class="alert alert-success">图片添加成功!</p>'); } else{
language: 'zh-CN', format: 'yyyy-mm-dd', }); }); function statByMrDate(){ var start_date = $('form#statByMrDateForm input#start_date').val(); var end_date = $('form#statByMrDateForm input#end_date').val(); if( start_date && end_date ){ window.open("<?php echo_path('/stat/part/mr_price/'); ?> " + start_date + '/' + end_date ); } } function statByProdNum(){ var prod_num = $('input#prodNum').val(); if( prod_num ){ window.open("<?php echo_path('/stat/part/mr_price/by_prod/'); ?> " + prod_num ); } } </script>
</form> </div> </div> <script type="text/javascript"> $('document').ready(function(){ $('div.input-group.date').datepicker({ language: 'zh-CN', format: 'yyyy-mm', }); }); function statItemMonthPlan(){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); if( date_start && date_end && parseInt( date_start.replace('-','') ) <= parseInt( date_end.replace('-','') ) ){ window.open("<?php echo_path('/stat/total_count/'); ?> " + date_start + '/' + date_end ); } } </script>
<script type="text/javascript"> function ajaxEditPart(){ var selectedNode = zTree.getSelectedNodes()[0]; if( selectedNode.type != 'file' ){ alert('对不起,当前节点不是零件节点!'); return false; } $.ajax({ url: "<?php echo_path('/lib/files/edit/' . $file->id); ?> ", type: "POST", data:$('form#addPartForm').serialize(), dataType: 'json', success: function( results ){ $('div#dynamicZone').html( results['html'] ); if( results['is_success'] ){ $('div#successMsgBox').show().fadeOut('slow'); // 更新ztree节点
} else{ showErrors( 'ajaxAddNodeErrors' , results['errors'] ); return false; } } }); } function ajaxAddNode(){ $.ajax({ type: "POST", url: "<?php echo_path('/processes/add/' . $part_id); ?> ", data: $('form#ajax').serialize(), dataType: "json", success: function( results ){ if( results['is_success'] ){ clearErrors('ajaxAddNodeErrors'); $('button[type="reset"]').click(); // 页面更新元素 var newNode = results['newNode']; addOrInsertNode( newNode );
<script type="text/javascript"> function ajaxAddPart(){ var selectedNode = zTree.getSelectedNodes()[0]; if( selectedNode.type != 'folder' ){ alert('对不起,只有分类节点才能添加零件子节点!'); return false; } $.ajax({ url: "<?php echo_path('/lib/files/add/' . $parent_folder_id); ?> ", type: "POST", data:$('form#addPartForm').serialize(), dataType: 'json', success: function( results ){ $('div#dynamicZone').html( results['html'] ); if( results['is_success'] ){ // 更新ztree节点 //var selectedNode = zTree.getSelectedNodes()[0]; zTree.addNodes( selectedNode , results['newNode'] );
/*function statByWorkDoneDate(){ var start_date = $('form#statByWorkDoneDateForm input#start_date').val(); var end_date = $('form#statByWorkDoneDateForm input#end_date').val(); if( start_date && end_date ){ window.open("<?php echo_path('/stat/work/done/'); ?> " + start_date + '/' + end_date ); } }*/ function statAllByWorkDoneDate(){ var start_date = $('form#statByWorkDoneDateForm input#start_date').val(); var end_date = $('form#statByWorkDoneDateForm input#end_date').val(); if( start_date && end_date ){ window.open("<?php echo_path('/stat/work/done/all/'); ?> " + start_date + '/' + end_date ); } } </script>
}); function statItemMonthPlan( type ){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); if( date_start && date_end && parseInt( date_start.replace('-','') ) <= parseInt( date_end.replace('-','') ) ){ window.open("<?php echo_path('/stat/proc_graph/'); ?> " + date_start + '/' + date_end + '/' + type ); } } function statItemMonthPlanTable(){ var date_start = $('form div.input-group#dp1 input').val(); var date_end = $('form div.input-group#dp2 input').val(); if( date_start && date_end && parseInt( date_start.replace('-','') ) <= parseInt( date_end.replace('-','') ) ){ window.open("<?php echo_path('/stat/proc_table/'); ?> " + date_start + '/' + date_end ); } } </script>