|
@@ -49,6 +49,17 @@
|
49
|
49
|
class="layui-input" lay-verify="required" lay-reqtext="支付金额不能为空">
|
50
|
50
|
</div>
|
51
|
51
|
</div>
|
|
52
|
+ <div class="layui-form-item layui-inline" style="width: 100%">
|
|
53
|
+ <label class="layui-form-label" style="width: 10%">付款信息</label>
|
|
54
|
+ <div class="layuimini-container" style="margin-left: 13%; padding-bottom: 10px;width: 90%">
|
|
55
|
+ <input type="hidden" id="fkxx" name="fkxx" class="layui-input">
|
|
56
|
+ <div class="layui-btn-group" style="margin-bottom: -8px">
|
|
57
|
+ <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-filter="add"><i class="layui-icon"></i>添加行</button>
|
|
58
|
+ <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-filter="delete"><i class="layui-icon"></i>删除行</button>
|
|
59
|
+ </div>
|
|
60
|
+ <table class="layui-hide" id="currentTableId2" name="currentTableId2" lay-filter="currentTableFilter2" style="padding-top: 0px;margin-top: 0px"></table>
|
|
61
|
+ </div>
|
|
62
|
+ </div>
|
52
|
63
|
|
53
|
64
|
|
54
|
65
|
<!-- 右侧悬浮按钮 -->
|
|
@@ -69,8 +80,9 @@
|
69
|
80
|
<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
|
70
|
81
|
<script type="text/javascript" th:inline="javascript">
|
71
|
82
|
AjaxUtil.ctx = /*[[@{/}]]*/'';
|
72
|
|
- layui.use(['form', 'layer'], function () {
|
|
83
|
+ layui.use(['form', 'layer','table'], function () {
|
73
|
84
|
var form = layui.form,
|
|
85
|
+ table= layui.table,
|
74
|
86
|
layer = layui.layer;
|
75
|
87
|
|
76
|
88
|
var htInfo = parent.getHtInfo();
|
|
@@ -83,9 +95,45 @@
|
83
|
95
|
$("#zfje").val(zfje.toFixed(2));
|
84
|
96
|
}
|
85
|
97
|
});
|
|
98
|
+ var prjPayplan = new Array();
|
|
99
|
+ if ([[${payplan.fkxx}]] != null && [[${payplan.fkxx}]] != "") {
|
|
100
|
+ prjPayplan = eval('(' + [[${payplan.fkxx}]] + ')');
|
|
101
|
+ }
|
|
102
|
+ var currTable2 = table.render({
|
|
103
|
+ elem: '#currentTableId2',
|
|
104
|
+ data: prjPayplan,
|
|
105
|
+ cols: [
|
|
106
|
+ [
|
|
107
|
+ {type: "checkbox", align: 'center'},
|
|
108
|
+ {type: 'numbers', align: 'center'},
|
|
109
|
+ {field: 'name', title: '公司名称', width: '30%',align:'center',edit: 'text'},
|
|
110
|
+ {field: 'fkje', title: '付款金额', width: '15%', align: 'center',edit:'text'},
|
|
111
|
+ {field: 'fksm', title: '付款说明', align: 'center',edit: 'text'}
|
|
112
|
+ ]
|
|
113
|
+ ],
|
|
114
|
+ autoSort: false,
|
|
115
|
+
|
|
116
|
+ limit: Number.MAX_VALUE,
|
|
117
|
+ page: false,
|
|
118
|
+ skin: 'grid',
|
|
119
|
+ done: function (res, curr, count) { // done为数据渲染完的回调
|
|
120
|
+ }
|
|
121
|
+ });
|
86
|
122
|
|
87
|
123
|
//监听提交
|
88
|
124
|
form.on('submit(saveBtn)', function (data) {
|
|
125
|
+ var data_prjPayplan = [];
|
|
126
|
+ for (const item of prjPayplan ) {
|
|
127
|
+ var dfWb = {
|
|
128
|
+ "id": item.id,
|
|
129
|
+ "name": item.name,
|
|
130
|
+ "fkje": item.fkje,
|
|
131
|
+ "fksm": item.fksm
|
|
132
|
+ };
|
|
133
|
+ data_prjPayplan.push(dfWb);
|
|
134
|
+ }
|
|
135
|
+ $("#fkxx").val(JSON.stringify(data_prjPayplan));
|
|
136
|
+ data.field.fkxx = JSON.stringify(data_prjPayplan);
|
89
|
137
|
var index = layer.load(0, {shade: 0.1});
|
90
|
138
|
AjaxUtil.post({
|
91
|
139
|
url: AjaxUtil.ctx + "prjPayplan/doUpdate",
|
|
@@ -106,7 +154,33 @@
|
106
|
154
|
|
107
|
155
|
return false;
|
108
|
156
|
});
|
|
157
|
+ //监听添加行按钮
|
|
158
|
+ $("button[lay-filter='add']").click(function () {
|
|
159
|
+ var newRow={"name":"","fkje":"","fksm":"" };
|
|
160
|
+ prjPayplan.push(newRow)
|
|
161
|
+ currTable2.reload();
|
|
162
|
+ });
|
|
163
|
+ //监听删除行按钮
|
|
164
|
+ $("button[lay-filter='delete']").click(function () {
|
|
165
|
+ if (prjPayplan.length == 0)
|
|
166
|
+ return;
|
109
|
167
|
|
|
168
|
+ var checkStatus = table.checkStatus('currentTableId2')
|
|
169
|
+ , data = checkStatus.data;
|
|
170
|
+ if (data == null || data.length === 0) {
|
|
171
|
+ Message.warning("请选择要删除的文件!", 1000);
|
|
172
|
+ return;
|
|
173
|
+ }
|
|
174
|
+ for (var i = 0; i < prjPayplan.length; i++) {
|
|
175
|
+ var item = prjPayplan[i];
|
|
176
|
+ if (item.LAY_CHECKED) {//条件:选中
|
|
177
|
+ prjPayplan.splice(i, 1);//移除后后造成数组下标索引发生变化,所以下面需要i--
|
|
178
|
+ i--;
|
|
179
|
+ }
|
|
180
|
+ }
|
|
181
|
+ //刷新表格
|
|
182
|
+ currTable2.reload();
|
|
183
|
+ });
|
110
|
184
|
// 监听取消按钮
|
111
|
185
|
$("button[lay-filter='cancleBtn']").click(function () {
|
112
|
186
|
var iframeIndex = parent.layer.getFrameIndex(window.name);
|