根据你提供的代码,以下是修改后的完整代码:
var columns = [
new GridColumn('id', { data: 'id', title: lang("id"), visible: false }),
new GridColumn('applyDate', lang('advance_repayment apply_date'), false, '10%'),
new GridColumn('agencyCode', lang('affiliation'), false, '10%'),
new GridColumn('collectionUnit', lang('belonging to_the_echelon'), false, '10%'),
new GridColumn('customerId', lang('customer id'), false, '10%'),
new GridColumn('loanCode', lang('REF NBR'), false, '18%'),
new GridColumn('paidDateValue', lang('last_paid time'), false, '10%'),
new GridColumn('paidAmount', lang('repayment amount'), false, '10%'),
new GridColumn('remark', lang('remark'), false, '10%'),
new GridColumn('repaymentName', lang('repayment voucher'), false, '10%'),
new GridColumn(lang("application status"), false, '10%'),
new GridColumn(newGridColumn(confirmReason),lang("refuse reason"),false,'10%')
];
var settings = {
columns: columns,
processing: true,
serverSide: true,
ajax: {
url:'../d/supplement/getList',
contentType:'application/json',
type:'POST',
lang:defLanguage
},
rowCallback:function(row,data,index){
$(row).find('.link-approve').on(
'click',
function(e){
e.stopPropagation();
let resultConfirm = data.resultConfirm;
let id = data.id;
layer.confirm(
"确认是否通过申请?",
{
btn:['是', '否'],
title:"申请通过确认"
},
function(){
$.ajax({
url:'../d/supplement/saveConfirm',
method: 'POST',
data:{
resultConfirm: 2,
id: id
},
dataType: 'json',
success:function(result){
console.log(result.message);
if(result.message === "已存在对应日期对应金额的还款记录,是否确认新增"){
layer.confirm(
result.message,
{
btn:['是', '否'],
title:"确认新增"
},
function(index){
$.ajax({
url:'../d/supplement/saveConfirm',
method: 'POST',
data:{
resultConfirm: 2,
id: id,
isNotRepay: 1
},
dataType:'json',
success:function(finalResult){
console.log(finalResult.message);
alert(finalResult.message);
}
});
}
);
} else {
alert(result.message);
}
}
});
}
);
}
)
}
这样修改后,代码应该能正常运行。请注意检查语法和逻辑错误,并根据实际需求进行调整。
内容由零声教学AI助手提供,问题来源于学员提问