|
|
|
@ -498,18 +498,71 @@ use \common\libs\MyLib; |
|
|
|
|
// 动态加载html |
|
|
|
|
function reloadItems() { |
|
|
|
|
var id = $('#id').val(); |
|
|
|
|
var lists = { |
|
|
|
|
'list3': '/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=1', |
|
|
|
|
'list4': '/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=2', |
|
|
|
|
'list5': '/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=3', |
|
|
|
|
'list6': '/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=4', |
|
|
|
|
}; |
|
|
|
|
if(id > 0) { |
|
|
|
|
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=1','list3'); |
|
|
|
|
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=2','list4'); |
|
|
|
|
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=3','list5'); |
|
|
|
|
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=4','list6'); |
|
|
|
|
$.each(lists,function(i,d){ |
|
|
|
|
$.get(d,{},function(res){ |
|
|
|
|
console.log(res); |
|
|
|
|
if(res.code == 200){ |
|
|
|
|
renderData(res.data, i); |
|
|
|
|
}else { |
|
|
|
|
alert(res.msg) |
|
|
|
|
} |
|
|
|
|
},'json'); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getPage(url,idname) { |
|
|
|
|
$.get(url,{},function(html){ |
|
|
|
|
html&&$('#' + idname).html(html); |
|
|
|
|
function renderData(data, id) { |
|
|
|
|
var html = ''; |
|
|
|
|
var table_data = []; |
|
|
|
|
$.each(data,function(name,item){ |
|
|
|
|
if (item[1].length) { |
|
|
|
|
table_data.push(item[1]); |
|
|
|
|
html += '<div class="ibox float-e-margins">' + |
|
|
|
|
' <div class="ibox-title">' + |
|
|
|
|
' <h5>'+ item[0] +'</h5>' + |
|
|
|
|
' </div>' + |
|
|
|
|
' <div class="ibox-content">' + |
|
|
|
|
' <div class="row">' + |
|
|
|
|
' <div class="col-md-12">' + |
|
|
|
|
' <table id="'+ id + '_' + name +'_table">' + |
|
|
|
|
' <thead>' + |
|
|
|
|
' <tr>' + |
|
|
|
|
' <th data-field="id">ID</th>' + |
|
|
|
|
' <th data-field="name">名称</th>' + |
|
|
|
|
' <th data-field="price">价格</th>' + |
|
|
|
|
' <th data-field="count">数量</th>' + |
|
|
|
|
' <th data-field="total">合计</th>' + |
|
|
|
|
' <th data-field="">结算方式</th>' + |
|
|
|
|
' <th data-field="">实收</th>' + |
|
|
|
|
' <th data-field="type">分类</th>' + |
|
|
|
|
' <th data-field="">维修人</th>' + |
|
|
|
|
' <th data-field="fix_remark">备注</th>' + |
|
|
|
|
' </tr>' + |
|
|
|
|
' </thead>' + |
|
|
|
|
' </table>' + |
|
|
|
|
' </div>' + |
|
|
|
|
' </div>' + |
|
|
|
|
' </div>' + |
|
|
|
|
'</div>'; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$('#'+ id).html(html).find('table').each(function(i,target){ |
|
|
|
|
$(target).bootstrapTable("destroy"); |
|
|
|
|
$(target).bootstrapTable({ |
|
|
|
|
data: table_data[i], |
|
|
|
|
pagination: false, |
|
|
|
|
queryParams: function (params) { |
|
|
|
|
return params; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}).show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 保存维修信息 |
|
|
|
|