|
|
@ -101,6 +101,7 @@ |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var editFlag = [[${@permission.hasPermi('financial:receivables:edit')}]]; |
|
|
|
var closingFlag = [[${@permission.hasPermi('financial:receivables:receivablesClosing')}]]; |
|
|
|
var addReceivablesVoucherFlag=[[${@permission.hasPermi('financial:receivables:addReceivablesVoucher')}]]; |
|
|
|
var receivablesClosingStatusDatas = [[${@dict.getType('receivables_closing_status')}]]; |
|
|
|
var currencyTypeDatas = [[${@dict.getType('sys_common_currency')}]]; |
|
|
@ -219,9 +220,10 @@ |
|
|
|
align: 'center', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
var actions = []; |
|
|
|
//actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|
|
|
actions.push('<a class="btn btn-success btn-xs ' + addReceivablesVoucherFlag + '" href="javascript:void(0)" onclick="addReceivablesVoucher(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>创建收款凭证</a> '); |
|
|
|
|
|
|
|
if (row.receivablesClosingStatus !== '2') { |
|
|
|
actions.push('<a class="btn btn-success btn-xs ' + closingFlag + '" href="javascript:void(0)" onclick="confirmAndClose(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>结案</a> '); |
|
|
|
} |
|
|
|
return actions.join(''); |
|
|
|
} |
|
|
|
}] |
|
|
@ -240,6 +242,42 @@ |
|
|
|
var url = ctx+'financial/receivables/addReceivablesVoucher/'+financialReceivablesId; |
|
|
|
$.modal.open("创建收款凭证",url); |
|
|
|
} |
|
|
|
|
|
|
|
//结案 |
|
|
|
function confirmAndClose(financialReceivablesId) { |
|
|
|
// 使用layer.confirm替代alert,以实现确认功能 |
|
|
|
layer.confirm("确定要结案吗?", { |
|
|
|
title: "系统提示", |
|
|
|
btn: ['确定', '取消'], // 自定义按钮文本 |
|
|
|
yes: function(index, layero) { |
|
|
|
// 用户点击确定后的操作 |
|
|
|
$.ajax({ |
|
|
|
url: ctx + 'financial/receivables/receivablesClosing/' + financialReceivablesId, |
|
|
|
type: 'GET', |
|
|
|
dataType: 'json', |
|
|
|
success: function(data) { |
|
|
|
if (data.code == web_status.SUCCESS) { |
|
|
|
// 成功后提示 |
|
|
|
layer.close(index); // 关闭当前confirm对话框 |
|
|
|
$.modal.alert("结案成功。"); |
|
|
|
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 |
|
|
|
} else { |
|
|
|
layer.close(index); // 关闭当前confirm对话框 |
|
|
|
$.modal.alertError(data.msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function(error) { |
|
|
|
layer.close(index); // 关闭当前confirm对话框 |
|
|
|
$.modal.alertError("结案失败。"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
cancel: function(index, layero) { |
|
|
|
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可 |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |