You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.5 KiB
JavaScript
103 lines
3.5 KiB
JavaScript
Ext.namespace('DsTruck');
|
|
|
|
DsTruck.MsChFeeAudit = function (records, newStatus, waitMsg,USERID) {
|
|
var jsondata = ConvertRecordsToJsonAll(records);
|
|
|
|
Ext.Msg.wait(waitMsg);
|
|
Ext.Ajax.request({
|
|
waitMsg: waitMsg,
|
|
url: '/Import/MsChFee/Audit',
|
|
scope: this,
|
|
params: {
|
|
newStatus: newStatus,
|
|
list: jsondata,
|
|
USERID:USERID
|
|
},
|
|
callback: function (options, success, response) {
|
|
if (success) {
|
|
Ext.MessageBox.hide();
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
if (jsonresult.Success) {
|
|
var newStatusRef = jsonresult.Data;
|
|
|
|
for (var i = 0; i < records.length; i++) {
|
|
var record = records[i];
|
|
record.set('FeeStatus', newStatus);
|
|
record.set('FeeStatus_Ref', newStatusRef);
|
|
record.commit();
|
|
}
|
|
|
|
////////////////
|
|
/* if (newStatus == 8 || newStatus == 9)
|
|
for (var i = 0; i < records.length; i++) {
|
|
var record = records[i];
|
|
Ext.Ajax.request({ //
|
|
waitMsg: '正在生成结算...',
|
|
url: '/Import/CWSettlement/Settlement',
|
|
params: {
|
|
newStatus: newStatus,
|
|
GId: record.get('GId')
|
|
},
|
|
callback: function (_count) {
|
|
//alert('初始化完成');
|
|
},
|
|
scope: this
|
|
});
|
|
} //request over*/
|
|
///////////////////////
|
|
|
|
} else {
|
|
Ext.Msg.show({
|
|
title: '错误',
|
|
msg: jsonresult.Message,
|
|
icon: Ext.Msg.ERROR,
|
|
buttons: Ext.Msg.OK
|
|
});
|
|
}
|
|
|
|
} else {
|
|
Ext.Msg.show({
|
|
title: '请重试',
|
|
msg: '服务器响应出错',
|
|
icon: Ext.Msg.ERROR,
|
|
buttons: Ext.Msg.OK
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
DsTruck.CheckChFeeDelete = function (records) {
|
|
for (var i = 0; i < records.length; i++) {
|
|
var rec = records[i];
|
|
var feeStatus = rec.data.FeeStatus;
|
|
var canDelete = feeStatus == 1 || feeStatus == 6;
|
|
if (canDelete == false) {
|
|
Ext.Msg.show({
|
|
title: '提示',
|
|
msg: '只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择',
|
|
icon: Ext.Msg.ERROR,
|
|
buttons: Ext.Msg.OK
|
|
});
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}/*,
|
|
DsTruck.CheckFinanceInsert = function (records) {
|
|
for (var i = 0; i < records.length; i++) {
|
|
var rec = records[i];
|
|
var FinanceStatus = rec.data.FinanceStatus;
|
|
var canInsert = feeStatus == 0 || feeStatus == 1;
|
|
if (canInsert == false) {
|
|
Ext.Msg.show({
|
|
title: '提示',
|
|
msg: '只能批量保存,请重新选择',
|
|
icon: Ext.Msg.ERROR,
|
|
buttons: Ext.Msg.OK
|
|
});
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}*/ |