|
@@ -53,17 +53,10 @@
|
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
|
|
|
<legend>未识别部分</legend>
|
|
|
</fieldset>
|
|
|
- <table class="layui-table" lay-data="{ url:'json/xmmc.json', page:false, id:'idTest'}" lay-filter="freestr">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <!--<th lay-data="{type:'checkbox', fixed: 'left'}"></th>-->
|
|
|
- <th lay-data="{field:'xmmc', width:200}">项目名称</th>
|
|
|
- <th lay-data="{field:'fyje', width:200}">费用金额</th>
|
|
|
- <th lay-data="{width:178, align:'center', toolbar: '#barDemo'}"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- </table>
|
|
|
- <table class="layui-table" id="layui_table_id" lay-filter="dataTable"></table>
|
|
|
+ <div class="" style="margin-left: 10px;width:70%;margin-right: 10px;">
|
|
|
+ <table class="layui-hide" id="xmmc" lay-filter="freestr"></table>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%;height: 100px"></div>
|
|
|
<script type="text/html" id="barDemo">
|
|
|
<a class="layui-btn layui-btn-xs" lay-event="fttz">分摊调整</a>
|
|
|
<a class="layui-btn layui-btn-xs" lay-event="ddtz">单独调整</a>
|
|
@@ -238,33 +231,48 @@
|
|
|
<script>
|
|
|
layui.use('table', function(){
|
|
|
var table = layui.table;
|
|
|
- //监听表格复选框选择
|
|
|
- table.on('checkbox(freestr)', function(obj){
|
|
|
- console.log(obj)
|
|
|
+
|
|
|
+ table.render({
|
|
|
+ elem: '#xmmc'
|
|
|
+// ,url:'/test/table/demo1.json'
|
|
|
+// ,toolbar: '#toolbarDemo'
|
|
|
+ ,title: '为标识'
|
|
|
+// ,totalRow: true
|
|
|
+ ,cols: [[
|
|
|
+ {field:'xmmc', width:200,title:'项目名称'}
|
|
|
+ ,{field:'fyje', width:178,title:'费用金额'}
|
|
|
+ ,{width:178, toolbar: '#barDemo',title:'操作'}
|
|
|
+ ]]
|
|
|
+ ,data:[
|
|
|
+ {
|
|
|
+ "id":"1",
|
|
|
+ "xmmc": "1",
|
|
|
+ "fyje": "xx1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":"2",
|
|
|
+ "xmmc": "2",
|
|
|
+ "fyje": "xx2"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":"3",
|
|
|
+ "xmmc": "3",
|
|
|
+ "fyje": "xx3"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ,page: false
|
|
|
});
|
|
|
//监听工具条
|
|
|
table.on('tool(freestr)', function(obj){
|
|
|
var datacount="";
|
|
|
var data = obj.data;
|
|
|
- alert(data);
|
|
|
if(obj.event === 'fttz'){
|
|
|
datacount=JSON.stringify(data);
|
|
|
-// layer.msg('ID:'+JSON.stringify(data));
|
|
|
} else if(obj.event === 'ddtz'){
|
|
|
datacount=JSON.stringify(data);
|
|
|
-// layer.alert('编辑行:<br>'+ JSON.stringify(data));
|
|
|
}
|
|
|
- $.ajax({
|
|
|
- type : "post",
|
|
|
- url : "#",
|
|
|
- contentType : "application/json;charset=UTF-8",
|
|
|
- data:datacount,
|
|
|
- success : function(result) {
|
|
|
- window.location.reload();
|
|
|
- }
|
|
|
- });
|
|
|
+ alert(datacount);
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
</script>
|
|
|
</html>
|