function() {
debugger;
window.test = __context;
var curr_year = FORM().data.budget_year;
/*22045基本财务*/
setNull0 = function() {
FORM().data.bus_inc = null;
FORM().data.profit_id = null;
FORM().data.sale_id = null;
FORM().data.adm_id = null;
};
/*22048培训费用*/
setNull1 = function() {
FORM().data.train_count = null;
};
/*22044公务用车:*/
setNull2 = function() {
FORM().data.field_12 = null;
FORM().data.car_cost = null;
FORM().data.ment_cost = null;
FORM().data.fun_cost = null;
FORM().data.traffic_cost = null;
};
/*22047差旅费用*/
setNull3 = function() {
FORM().data.travel_cost = null;
FORM().data.goboard_cost = null;
FORM().data.busine_cost = null;
};
/*22046通讯费*/
setNull4 = function() {
FORM().data.signal_cost = null;
};
setNullAll = function() {
setNull0();
setNull1();
setNull2();
setNull3();
setNull4();
};
var unit_id = FORM().data.unit_id;
var budget_year = FORM().data.budget_year;
var declare = FORM().data.declare;
if (unit_id && budget_year && declare && unit_id !== '' && budget_year !== '' && declare !== '') {
console.log('本地表单FORM():');
console.log(FORM());
dataService.callHcmOpenApi('private.testopenapifunc', {
'data': FORM()
}).then(function(data) {
console.log('云函数返回的数据:');
console.log(data);
if (data) {
if (data.result0.count > 0) {
console.log('22045基本财务:', data.result0);
FORM().data.bus_inc = data.result0.list[0].income_money;
FORM().data.profit_id = data.result0.list[0].profit_money;
FORM().data.sale_id = data.result0.list[0].sales_charge;
FORM().data.adm_id = data.result0.list[0].manage_cost;
FORM().data.leader_num = data.result0.list[0].company_per_num;
FORM().data.reception_cost = data.result0.list[0].reception_charge;
} else {
setNull0();
};
if (data.result1.count > 0) {
console.log('22048培训费用:', data.result1);
FORM().data.train_count = data.result1.list[0].train_money;
} else {
setNull1();
};
if (data.result2.count > 0) {
console.log('22044公务用车:', data.result2);
/*购置费用合计(含购置税)(万元)*/
FORM().data.field_12 = data.result2.list[0].buying_car_budget;
/*公务用车费用(万元)*/
FORM().data.car_cost = data.result2.list[0].car_total_budget;
/*处置费用合计(万元)*/
FORM().data.ment_cost = data.result2.list[0].sale_car_budget;
/*运行费用合计(万元)*/
FORM().data.fun_cost = data.result2.list[0].working_car_budget;
/*交通补贴(万元)*/
FORM().data.traffic_cost = data.result2.list[0].allowance_car_budget;
/*租赁运行费用*/
FORM().data.rent_cost = data.result2.list[0].rent_car_budget;
} else {
setNull2();
};
if (data.result3.count > 0) {
console.log('22047差旅费用', data.result3);
FORM().data.busine_cost = data.result3.list[0].reception_cost;
FORM().data.travel_cost = data.result3.list[0].travel_expense;
/*因公临时出国(境)费用(万元)abroad_expense有空格 FORM().data.goboard_cost = data.resul3.list[0].abroad_expense;*/
} else {
setNull3();
};
if (data.result4.count > 0) {
console.log(' 22046通讯费', data.result4);
FORM().data.signal_cost = data.result4.list[0].telephone_rate;
} else {
setNull4();
};
/*SCOPE.show_warning('数据更新成功!');*/
} else {
setNullAll();
SCOPE.show_warning('接口请求失败!');
/*data为空*/
}
});
} else if (!unit_id) {
setNullAll();
SCOPE.show_warning('请选择单位!');
} else if (!budget_year) {
setNullAll();
SCOPE.show_warning('请选择年度!');
}
}
console