//获取href里面的参数
|
function getUrlParam(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
|
var r = window.location.search.substr(1).match(reg); //匹配目标参数
|
if (r != null) return unescape(r[2]); return null; //返回参数值
|
}
|
|
var listtypeoptions = [];
|
var type = 0;
|
///绑定费用类型
|
var gettype = function (type) {
|
switch (type) {
|
case 1:
|
$('#txtTitle').html('项目其他措施费付款单');
|
listtypeoptions.push('<option value="项目其他措施费">项目其他措施费</option>');
|
break;
|
case 2:
|
$('#txtTitle').html('项目汽车费付款单');
|
listtypeoptions.push('<option value="项目汽车费">项目汽车费</option>');
|
break;
|
case 3:
|
$('#txtTitle').html('项目劳保费付款单');
|
listtypeoptions.push('<option value="项目劳保费">项目劳保费</option>');
|
break;
|
case 4:
|
$('#txtTitle').html('项目其他间接费付款单');
|
listtypeoptions.push('<option value="项目其他间接费">项目其他间接费</option>');
|
break;
|
case 5:
|
$('#txtTitle').html('项目无票支出付款单');
|
listtypeoptions.push('<option value="项目无票支出">项目无票支出</option>');
|
break;
|
case 6:
|
$('#txtTitle').html('项目备用金借款单');
|
listtypeoptions.push('<option value="项目备用金借款">项目备用金借款</option>');
|
break;
|
case 7:
|
$('#txtTitle').html('项目招待费付款单');
|
listtypeoptions.push('<option value="项目招待费">项目招待费</option>');
|
break;
|
case 8:
|
$('#txtTitle').html('咨询顾问费付款单');
|
listtypeoptions.push('<option value="咨询顾问费">咨询顾问费</option>');
|
break;
|
case 9:
|
$('#txtTitle').html('审计费付款单');
|
listtypeoptions.push('<option value="审计费">审计费</option>');
|
break;
|
case 10:
|
$('#txtTitle').html('招待费付款单');
|
listtypeoptions.push('<option value="招待费">招待费</option>');
|
break;
|
case 11:
|
$('#txtTitle').html('外部培训学习费付款单');
|
listtypeoptions.push('<option value="外部培训学习费">外部培训学习费</option>');
|
break;
|
case 12:
|
$('#txtTitle').html('例行培训学习费付款单');
|
listtypeoptions.push('<option value="例行培训学习费">例行培训学习费</option>');
|
break;
|
case 13:
|
$('#txtTitle').html('汽车费付款单');
|
listtypeoptions.push('<option value="汽车费">汽车费</option>');
|
break;
|
case 14:
|
$('#txtTitle').html('招聘费付款单');
|
listtypeoptions.push('<option value="招聘费">招聘费</option>');
|
break;
|
case 15:
|
$('#txtTitle').html('办公费付款单');
|
listtypeoptions.push('<option value="办公用品">办公用品</option>');
|
listtypeoptions.push('<option value="水电费">水电费</option>');
|
listtypeoptions.push('<option value="物业费">物业费</option>');
|
listtypeoptions.push('<option value="办公设备维修">办公设备维修</option>');
|
listtypeoptions.push('<option value="电话费">电话费</option>');
|
listtypeoptions.push('<option value="会务费">会务费</option>');
|
listtypeoptions.push('<option value="保险费">保险费</option>');
|
listtypeoptions.push('<option value="劳保用品">劳保用品</option>');
|
listtypeoptions.push('<option value="绿化">绿化</option>');
|
listtypeoptions.push('<option value="垃圾清运">垃圾清运</option>');
|
listtypeoptions.push('<option value="协会会费">协会会费</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 16:
|
$('#txtTitle').html('办公室装修费付款单');
|
listtypeoptions.push('<option value="办公室装修费">办公室装修费</option>');
|
break;
|
case 17:
|
$('#txtTitle').html('办公物业水电费付款单');
|
listtypeoptions.push('<option value="办公物业水电费">办公物业水电费</option>');
|
break;
|
case 18:
|
$('#txtTitle').html('对外捐赠付款单');
|
listtypeoptions.push('<option value="对外捐赠">对外捐赠</option>');
|
break;
|
case 19:
|
$('#txtTitle').html('文化建设费付款单');
|
listtypeoptions.push('<option value="文化建设费">文化建设费</option>');
|
break;
|
case 20:
|
$('#txtTitle').html('会务费,保险费,劳保用品等其他可控管理费付款单');
|
listtypeoptions.push('<option value="会务费">会务费</option>');
|
listtypeoptions.push('<option value="保险费">保险费</option>');
|
listtypeoptions.push('<option value="劳保用品">劳保用品</option>');
|
listtypeoptions.push('<option value="绿化">绿化</option>');
|
listtypeoptions.push('<option value="垃圾清运">垃圾清运</option>');
|
listtypeoptions.push('<option value="协会会费">协会会费</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 21:
|
$('#txtTitle').html('行政管理无票支出付款单');
|
listtypeoptions.push('<option value="行政管理无票支出">行政管理无票支出</option>');
|
break;
|
case 22:
|
$('#txtTitle').html('社保银行扣缴付款单');
|
listtypeoptions.push('<option value="社保银行扣缴">社保银行扣缴</option>');
|
break;
|
case 23:
|
$('#txtTitle').html('税金付款单');
|
listtypeoptions.push('<option value="税金">税金</option>');
|
|
break;
|
case 24:
|
$('#txtTitle').html('利息付款单');
|
listtypeoptions.push('<option value="利息">利息</option>');
|
break;
|
case 25:
|
$('#txtTitle').html('还款、转贷付款单');
|
listtypeoptions.push('<option value="还款">还款</option>');
|
listtypeoptions.push('<option value="转贷">转贷</option>');
|
break;
|
case 26:
|
$('#txtTitle').html('内部借款付款单');
|
listtypeoptions.push('<option value="内部借款">内部借款</option>');
|
break;
|
case 27:
|
$('#txtTitle').html('研发费用付款单');
|
listtypeoptions.push('<option value="研发费用">研发费用</option>');
|
break;
|
case 28:
|
$('#txtTitle').html('信息化建设付款单');
|
listtypeoptions.push('<option value="信息化建设">信息化建设</option>');
|
break;
|
case 29:
|
$('#txtTitle').html('工资、年终各类评优付款单');
|
listtypeoptions.push('<option value="工资">工资</option>');
|
listtypeoptions.push('<option value="年终">年终</option>');
|
listtypeoptions.push('<option value="评优">评优</option>');
|
break;
|
case 30:
|
$('#txtTitle').html('管理人员工作餐付款单');
|
listtypeoptions.push('<option value="管理人员工作餐">管理人员工作餐</option>');
|
break;
|
case 31:
|
$('#txtTitle').html('年会、旅游付款单');
|
listtypeoptions.push('<option value="年会">年会</option>');
|
listtypeoptions.push('<option value="旅游">旅游</option>');
|
break;
|
case 32:
|
$('#txtTitle').html('其他福利费付款单');
|
listtypeoptions.push('<option value="其他福利费">其他福利费</option>');
|
break;
|
case 33:
|
$('#txtTitle').html('业务单位往来款付款单');
|
listtypeoptions.push('<option value="业务单位往来款">业务单位往来款</option>');
|
break;
|
case 34:
|
$('#txtTitle').html('项目投标保证金付款单');
|
listtypeoptions.push('<option value="项目投标保证金">项目投标保证金</option>');
|
break;
|
case 35:
|
$('#txtTitle').html('银行间资金划转付款单');
|
listtypeoptions.push('<option value="银行间资金划转">银行间资金划转</option>');
|
break;
|
case 36:
|
$('#txtTitle').html('备用金提取付款单');
|
listtypeoptions.push('<option value="备用金提取">备用金提取</option>');
|
break;
|
case 37:
|
$('#txtTitle').html('行政罚款支出付款单');
|
listtypeoptions.push('<option value="行政罚款支出">行政罚款支出</option>');
|
break;
|
case 38:
|
$('#txtTitle').html('计划外支出付款单');
|
listtypeoptions.push('<option value="计划外支出">计划外支出</option>');
|
break;
|
case 39:
|
$('#txtTitle').html('个人备用金借款单');
|
listtypeoptions.push('<option value="个人备用金借款">个人备用金借款</option>');
|
break;
|
case 40:
|
$('#txtTitle').html('项目内部借款付款单');
|
listtypeoptions.push('<option value="项目内部借款">项目内部借款</option>');
|
break;
|
case 41:
|
$('#txtTitle').html('项目主材付款单');
|
listtypeoptions.push('<option value="混凝土">混凝土</option>');
|
listtypeoptions.push('<option value="管桩">管桩</option>');
|
listtypeoptions.push('<option value="水泥">水泥</option>');
|
listtypeoptions.push('<option value="钢筋">钢筋</option>');
|
listtypeoptions.push('<option value="注浆管">注浆管</option>');
|
listtypeoptions.push('<option value="声测管">声测管</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 42:
|
$('#txtTitle').html('项目辅材付款单');
|
listtypeoptions.push('<option value="柴油">柴油</option>');
|
listtypeoptions.push('<option value="小型工具">小型工具</option>');
|
listtypeoptions.push('<option value="安全文明设施">安全文明设施</option>');
|
listtypeoptions.push('<option value="办公用品">办公用品</option>');
|
break;
|
case 43:
|
$('#txtTitle').html('项目施工费/措施费付款单');
|
listtypeoptions.push('<option value="施工费">施工费</option>');
|
listtypeoptions.push('<option value="措施费">措施费</option>');
|
break;
|
case 44:
|
$('#txtTitle').html('办公消耗品付款单');
|
listtypeoptions.push('<option value="办公消耗品">办公消耗品</option>');
|
break;
|
case 45:
|
$('#txtTitle').html('房产付款单');
|
listtypeoptions.push('<option value="房产">房产</option>');
|
break;
|
case 46:
|
$('#txtTitle').html('机械设备付款单');
|
listtypeoptions.push('<option value="机械设备">机械设备</option>');
|
break;
|
case 47:
|
$('#txtTitle').html('电器/仪器/机具付款单');
|
listtypeoptions.push('<option value="电器">电器</option>');
|
listtypeoptions.push('<option value="仪器">仪器</option>');
|
listtypeoptions.push('<option value="机具">机具</option>');
|
break;
|
case 48:
|
$('#txtTitle').html('行政办公设备/车辆付款单');
|
listtypeoptions.push('<option value="行政办公设备">行政办公设备</option>');
|
listtypeoptions.push('<option value="行政车辆">行政车辆</option>');
|
break;
|
case 49:
|
$('#txtTitle').html('设备维修、改装、运输费用付款单');
|
listtypeoptions.push('<option value="设备维修">设备维修</option>');
|
listtypeoptions.push('<option value="改装">改装</option>');
|
listtypeoptions.push('<option value="运输费用">运输费用</option>');
|
break;
|
case 50:
|
$('#txtTitle').html('设备部劳务班组费用付款单');
|
listtypeoptions.push('<option value="设备部劳务班组费用">设备部劳务班组费用</option>');
|
break;
|
case 51:
|
$('#txtTitle').html('周转材料付款单');
|
listtypeoptions.push('<option value="周转材料">周转材料</option>');
|
break;
|
case 52:
|
$('#txtTitle').html('设备维修配件、改装配件、桩机配件采购付款单');
|
listtypeoptions.push('<option value="设备维修配件">设备维修配件</option>');
|
listtypeoptions.push('<option value="改装配件">改装配件</option>');
|
listtypeoptions.push('<option value="桩机配件采购">桩机配件采购</option>');
|
break;
|
case 53:
|
$('#txtTitle').html('节假日福利费付款单');
|
listtypeoptions.push('<option value="节假日福利费">节假日福利费</option>');
|
break;
|
case 55:
|
$('#txtTitle').html('差旅费付款单');
|
listtypeoptions.push('<option value="差旅费">差旅费</option>');
|
break;
|
case 56:
|
$('#txtTitle').html('项目差旅费付款单');
|
listtypeoptions.push('<option value="项目差旅费">项目差旅费</option>');
|
break;
|
case 57:
|
$('#txtTitle').html('项目生产类押金付款单');
|
listtypeoptions.push('<option value="生产类押金">生产类押金</option>');
|
break;
|
case 58:
|
$('#txtTitle').html('非生产类押金付款单');
|
listtypeoptions.push('<option value="非生产类押金">非生产类押金</option>');
|
break;
|
case 19041:
|
$('#txtTitle').html('IPO费用(差旅住宿)付款单');
|
listtypeoptions.push('<option value="IPO费用(差旅住宿)">IPO费用(差旅住宿)</option>');
|
break;
|
case 19042:
|
$('#txtTitle').html('IPO费用(非差旅住宿)付款单');
|
listtypeoptions.push('<option value="IPO费用(非差旅住宿)">IPO费用(非差旅住宿)</option>');
|
break;
|
case 19043:
|
$('#txtTitle').html('礼品、酒付款单');
|
listtypeoptions.push('<option value="礼品">礼品</option>');
|
listtypeoptions.push('<option value="酒">酒</option>');
|
break;
|
case 19044:
|
$('#txtTitle').html('电脑、打印机维修付款单');
|
listtypeoptions.push('<option value="电脑维修">电脑维修</option>');
|
listtypeoptions.push('<option value="打印机维修">打印机维修</option>');
|
break;
|
case 19045:
|
$('#txtTitle').html('办公/职工宿舍房租、水电、物业付款单');
|
listtypeoptions.push('<option value="办公/职工宿舍房租">办公/职工宿舍房租</option>');
|
listtypeoptions.push('<option value="水电">水电</option>');
|
listtypeoptions.push('<option value="物业">物业</option>');
|
break;
|
case 19046:
|
$('#txtTitle').html('会务费、保险费等其他可控管理费付款单');
|
listtypeoptions.push('<option value="会务费">会务费</option>');
|
listtypeoptions.push('<option value="保险费">保险费</option>');
|
listtypeoptions.push('<option value="劳保用品">劳保用品</option>');
|
listtypeoptions.push('<option value="绿化">绿化</option>');
|
listtypeoptions.push('<option value="垃圾清运">垃圾清运</option>');
|
listtypeoptions.push('<option value="协会会费">协会会费</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 19047:
|
$('#txtTitle').html('研发其他费用付款单');
|
listtypeoptions.push('<option value="自主研发产生的专利相关">自主研发产生的专利相关</option>');
|
listtypeoptions.push('<option value="设计试验">设计试验</option>');
|
listtypeoptions.push('<option value="委外研发">委外研发</option>');
|
listtypeoptions.push('<option value="项目申报代理相关">项目申报代理相关</option>');
|
listtypeoptions.push('<option value="专家咨询">专家咨询</option>');
|
listtypeoptions.push('<option value="技术论证评审鉴定">技术论证评审鉴定</option>');
|
listtypeoptions.push('<option value="培训培养">培训培养</option>');
|
listtypeoptions.push('<option value="零星采购">零星采购</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 19048:
|
$('#txtTitle').html('保险理赔款付款单');
|
listtypeoptions.push('<option value="保险理赔款">保险理赔款</option>');
|
break;
|
case 19049:
|
$('#txtTitle').html('保理、承兑等金融手续费付款单');
|
listtypeoptions.push('<option value="保理">保理</option>');
|
listtypeoptions.push('<option value="承兑">承兑</option>');
|
listtypeoptions.push('<option value="其他">其他</option>');
|
break;
|
case 190410:
|
$('#txtTitle').html('个税付款单');
|
listtypeoptions.push('<option value="个税">个税</option>');
|
break;
|
case 190411:
|
$('#txtTitle').html('公积金付款单');
|
listtypeoptions.push('<option value="公积金">公积金</option>');
|
break;
|
case 190412:
|
$('#txtTitle').html('市内交通费付款单');
|
listtypeoptions.push('<option value="市内交通费">市内交通费</option>');
|
break;
|
case 190413:
|
$('#txtTitle').html('项目市内交通费付款单');
|
listtypeoptions.push('<option value="项目市内交通费">项目市内交通费</option>');
|
break;
|
case 190414:
|
$('#txtTitle').html('行政罚款付款单');
|
listtypeoptions.push('<option value="行政罚款">行政罚款</option>');
|
break;
|
case 190415:
|
$('#txtTitle').html('房租费用付款单');
|
listtypeoptions.push('<option value="房租费用">房租费用</option>');
|
break;
|
case 190416:
|
$('#txtTitle').html('社保第三方代缴付款单');
|
listtypeoptions.push('<option value="社保第三方代缴">社保第三方代缴</option>');
|
break;
|
case 190417:
|
$('#txtTitle').html('公积金第三方代缴付款单');
|
listtypeoptions.push('<option value="公积金第三方代缴">公积金第三方代缴</option>');
|
break;
|
case 19091:
|
$('#txtTitle').html('劳务工资付款单');
|
document.getElementById('girdtable').rows[0].cells[0].innerHTML = '项目';
|
$.ajax({
|
url: "/DropDown/ProjectDropDownForProcurementOrder", async: false, cache: false, dataType: "json",
|
success: function (data) {
|
listtypeoptions.push("<option style='display: none'></option>");
|
$.each(data, function (i, r) {
|
listtypeoptions.push('<option value="' + r.Text + '">' + r.Text + '</option>');
|
|
});
|
|
}
|
});
|
break;
|
}
|
if ($.trim(sysid) == '') {
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(0).html(listtypeoptions.join(''));
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(0).trigger("chosen:updated");
|
}
|
|
if (listtypeoptions.length <= 1)//只有一项一下,禁用选择
|
{
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').attr('disabled', 'disabled');
|
}
|
}
|
|
// 金额转大写
|
var changeMoneyToChinese = function (money) {
|
//汉字的数字
|
var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
|
//基本单位
|
var cnIntRadice = new Array('', '拾', '佰', '仟');
|
//对应整数部分扩展单位
|
var cnIntUnits = new Array('', '万', '亿', '兆');
|
//对应小数部分单位
|
var cnDecUnits = new Array('角', '分', '毫', '厘');
|
//整数金额时后面跟的字符
|
var cnInteger = '整';
|
//整型完以后的单位
|
var cnIntLast = '元';
|
//最大处理的数字
|
var maxNum = 999999999999999.9999;
|
//金额整数部分
|
var integerNum;
|
//金额小数部分
|
var decimalNum;
|
//输出的中文金额字符串
|
var chineseStr = '';
|
//分离金额后用的数组,预定义
|
var parts;
|
if (money == '') { return ''; }
|
money = parseFloat(money);
|
if (money >= maxNum) {
|
//超出最大处理数字
|
toastr.warning("付款总额超出最大范围");
|
return '';
|
}
|
if (money == 0) {
|
chineseStr = cnNums[0] + cnIntLast + cnInteger;
|
return chineseStr;
|
}
|
//转换为字符串
|
money = money.toString();
|
if (money.indexOf('.') == -1) {
|
integerNum = money;
|
decimalNum = '';
|
} else {
|
parts = money.split('.');
|
integerNum = parts[0];
|
decimalNum = parts[1].substr(0, 4);
|
}
|
//获取整型部分转换
|
if (parseInt(integerNum, 10) > 0) {
|
var zeroCount = 0;
|
var IntLen = integerNum.length;
|
for (var i = 0; i < IntLen; i++) {
|
var n = integerNum.substr(i, 1);
|
var p = IntLen - i - 1;
|
var q = p / 4;
|
var m = p % 4;
|
if (n == '0') {
|
zeroCount++;
|
} else {
|
if (zeroCount > 0) {
|
chineseStr += cnNums[0];
|
}
|
//归零
|
zeroCount = 0;
|
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
|
}
|
if (m == 0 && zeroCount < 4) {
|
chineseStr += cnIntUnits[q];
|
}
|
}
|
chineseStr += cnIntLast;
|
}
|
//小数部分
|
if (decimalNum != '') {
|
var decLen = decimalNum.length;
|
for (var i = 0; i < decLen; i++) {
|
var n = decimalNum.substr(i, 1);
|
if (n != '0') {
|
chineseStr += cnNums[Number(n)] + cnDecUnits[i];
|
}
|
}
|
}
|
if (chineseStr == '') {
|
chineseStr += cnNums[0] + cnIntLast + cnInteger;
|
} else if (decimalNum == '') {
|
chineseStr += cnInteger;
|
}
|
return chineseStr;
|
}
|
|
|
//获取默认单据号与名称
|
var getusername = function (type) {
|
if ($.trim(sysid) == '') {
|
$.ajax({
|
url: "/oa/General/GetLoad", async: false, cache: false, dataType: "json",
|
success: function (data) {
|
$('input[name="fm_otherexpenditureinfo.Code"]').val(data.orderCode);
|
$('select[name="fm_otherexpenditureinfo.DepartmentID"]').val(data.deptid);
|
$('select[name="fm_otherexpenditureinfo.DepartmentID"]').trigger("chosen:updated");
|
$('input[name="fm_otherexpenditureinfo.dept_name"]').val(data.deptname);
|
$('input[name="fm_otherexpenditureinfo.dept_id"]').val(data.deptid);
|
switch (type) {
|
case 1:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目其他措施费付款(' + data.username + ')');
|
break;
|
case 2:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目汽车费付款(' + data.username + ')');
|
break;
|
case 3:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目劳保费付款(' + data.username + ')');
|
break;
|
case 4:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目其他间接费付款(' + data.username + ')');
|
break;
|
case 5:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目无票支出付款(' + data.username + ')');
|
break;
|
case 6:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目备用金借款(' + data.username + ')');
|
break;
|
case 7:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目招待费付款(' + data.username + ')');
|
break;
|
case 8:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('咨询顾问费付款(' + data.username + ')');
|
break;
|
case 9:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('审计费付款(' + data.username + ')');
|
break;
|
case 10:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('招待费付款(' + data.username + ')');
|
break;
|
case 11:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('外部培训学习费付款(' + data.username + ')');
|
break;
|
case 12:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('例行培训学习费付款(' + data.username + ')');
|
break;
|
case 13:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('汽车费付款(' + data.username + ')');
|
break;
|
case 14:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('招聘费付款(' + data.username + ')');
|
break;
|
case 15:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('办公费付款(' + data.username + ')');
|
break;
|
case 16:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('办公室装修付款(' + data.username + ')');
|
break;
|
case 17:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('办公物业水电费付款(' + data.username + ')');
|
break;
|
case 18:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('对外捐赠付款(' + data.username + ')');
|
break;
|
case 19:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('文化建设费付款(' + data.username + ')');
|
break;
|
case 20:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('会务费,保险费,劳保用品等其他可控管理费付款(' + data.username + ')');
|
break;
|
case 21:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('行政管理无票支出付款(' + data.username + ')');
|
break;
|
case 22:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('社保银行扣缴付款(' + data.username + ')');
|
break;
|
case 23:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('税金付款(' + data.username + ')');
|
break;
|
case 24:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('利息付款(' + data.username + ')');
|
$("input[name='fm_otherexpenditureinfo.IsInPlan']:eq(0)").parent().parent().siblings(".form-item-title").text("是否金融机构");
|
break;
|
case 25:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('还款、转贷付款(' + data.username + ')');
|
break;
|
case 26:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('内部借款付款(' + data.username + ')');
|
break;
|
case 27:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('研发费用付款(' + data.username + ')');
|
break;
|
case 28:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('信息化建设付款(' + data.username + ')');
|
break;
|
case 29:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('工资、年终各类评优付款(' + data.username + ')');
|
break;
|
case 30:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('管理人员工作餐付款(' + data.username + ')');
|
break;
|
case 31:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('年会、旅游付款(' + data.username + ')');
|
break;
|
case 32:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('其他福利费付款(' + data.username + ')');
|
break;
|
case 33:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('业务单位往来款付款(' + data.username + ')');
|
break;
|
case 34:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目投标保证金付款(' + data.username + ')');
|
var projectId = getUrlParam("projectid");
|
if (projectId != null && projectId != 0) {
|
$('input[name="fm_otherexpenditureinfo.ProjectID"]').val(projectId);
|
}
|
break;
|
case 35:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('银行间资金划转付款(' + data.username + ')');
|
break;
|
|
case 36:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('备用金提取付款(' + data.username + ')');
|
break;
|
case 37:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('行政罚款支出付款(' + data.username + ')');
|
break;
|
case 38:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('计划外支出付款(' + data.username + ')');
|
break;
|
case 39:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('个人备用金借款(' + data.username + ')');
|
break;
|
case 40:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目内部借款付款(' + data.username + ')');
|
break;
|
case 41:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目主材付款(' + data.username + ')');
|
break;
|
case 42:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目辅材付款(' + data.username + ')');
|
break;
|
case 43:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目施工费/措施费付款(' + data.username + ')');
|
break;
|
case 44:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('办公消耗品付款(' + data.username + ')');
|
break;
|
case 45:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('房产付款(' + data.username + ')');
|
break;
|
case 46:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('机械设备付款(' + data.username + ')');
|
break;
|
case 47:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('电器/仪器/机具付款(' + data.username + ')');
|
break;
|
case 48:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('行政办公设备/车辆付款(' + data.username + ')');
|
break;
|
case 49:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('设备维修/改装/运输费用付款(' + data.username + ')');
|
break;
|
case 50:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('设备部劳务班组费用付款(' + data.username + ')');
|
break;
|
case 51:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('周转材料付款(' + data.username + ')');
|
break;
|
case 52:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('设备维修配件/改装配件/桩机配件采购付款(' + data.username + ')');
|
break;
|
case 53:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('节假日福利费付款(' + data.username + ')');
|
break;
|
case 55:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('差旅费付款(' + data.username + ')');
|
break;
|
case 56:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目差旅费付款(' + data.username + ')');
|
break;
|
case 57:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目生产类押金付款(' + data.username + ')');
|
break;
|
case 58:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('非生产类押金付款(' + data.username + ')');
|
break;
|
case 19041:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('IPO费用(差旅住宿)付款(' + data.username + ')');
|
break;
|
case 19042:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('IPO费用(非差旅住宿)付款(' + data.username + ')');
|
break;
|
case 19043:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('礼品、酒付款(' + data.username + ')');
|
break;
|
case 19044:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('电脑、打印机维修付款(' + data.username + ')');
|
break;
|
case 19045:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('办公/职工宿舍房租、水电、物业付款(' + data.username + ')');
|
break;
|
case 19046:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('会务费、保险费等其他可控管理费付款(' + data.username + ')');
|
break;
|
case 19047:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('研发其他费用付款(' + data.username + ')');
|
break;
|
case 19048:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('保险理赔款付款(' + data.username + ')');
|
break;
|
case 19049:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('保理、承兑等金融手续费付款(' + data.username + ')');
|
break;
|
case 190410:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('个税付款(' + data.username + ')');
|
break;
|
case 190411:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('公积金付款(' + data.username + ')');
|
break;
|
case 190412:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('市内交通费付款(' + data.username + ')');
|
break;
|
case 190413:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('项目市内交通费付款(' + data.username + ')');
|
break;
|
case 190414:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('行政罚款付款(' + data.username + ')');
|
break;
|
case 190415:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('房租费用付款(' + data.username + ')');
|
break;
|
case 190416:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('社保第三方代缴付款(' + data.username + ')');
|
break;
|
case 190417:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('公积金第三方代缴付款(' + data.username + ')');
|
break;
|
case 19091:
|
$('input[name="fm_otherexpenditureinfo.Title"]').val('劳务工资付款(' + data.username + ')');
|
break;
|
}
|
//// 处理部门项目部不展示,职能部展示
|
var titl = $('input[name="fm_otherexpenditureinfo.Title"]').val();
|
if (titl.indexOf("项目") != -1) {
|
$('input[name="fm_otherexpenditureinfo.dept_name"]').css('display', 'none');
|
}
|
$('#fm_otherexpenditureinfo_dept_id').css('display', 'none');
|
// $(".annex").css('display', 'none');
|
}
|
});
|
}
|
}
|
|
|
//ERP获取关联单号已付款金额
|
var allAmount = 0;//总付款金额
|
var fkMoney = 0;//已付款金额
|
var syMoney = 0;//剩余金额
|
var getpaymoney = function (code) {
|
$.ajax({
|
url: "/oa/General/GetMoney?orderCode=" + code + "&sysid=" + sysid, async: false, cache: false, dataType: "json",
|
success: function (data) {
|
allAmount = parseFloat(data.allamount);
|
fkMoney = parseFloat(data.paymoney);
|
syMoney = parseFloat(data.balance);
|
|
}
|
});
|
}
|
|
|
//计算总金额
|
var countmoney = function () {
|
type = parseInt(getUrlParam('type'));
|
if ($.trim(sysid) != '' && initItems != null) {
|
type = parseInt(initItems.ExpenditureBusinessTypeID);
|
}
|
|
var count = 0;
|
$.each($('input[name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount"]'), function () {
|
var val = $.trim($(this).val());
|
val = isNaN(val) ? 0 : val;
|
val = val == '' ? 0 : parseFloat(val);
|
count += val;
|
});
|
if (type == 41 || type == 42 || type == 43 || type == 44 || type == 45 || type == 46 || type == 47 || type == 48 || type == 50 || type == 51 || type == 52) {
|
if (sysid == '') {
|
var nmoney = allAmount - fkMoney;
|
$('input[name="fm_otherexpenditureinfo.TotalExpenditure"]').val(nmoney);
|
$('input[name="fm_otherexpenditureinfo.CapitalizationTotalExpenditure"]').val(changeMoneyToChinese(nmoney));
|
if (nmoney <= 0) {
|
$('button[onclick="WF_Submit()"],button[onclick="WF_Save()"]').parent().hide()
|
}
|
}
|
else {
|
var nmoeny = parseFloat($('input[name="fm_otherexpenditureinfo.TotalExpenditure"]').val());
|
syMoney = nmoeny > syMoney ? syMoney : nmoeny;
|
$('input[name="fm_otherexpenditureinfo.TotalExpenditure"]').val(syMoney);
|
$('input[name="fm_otherexpenditureinfo.CapitalizationTotalExpenditure"]').val(changeMoneyToChinese(syMoney));
|
}
|
}
|
else {
|
$('input[name="fm_otherexpenditureinfo.TotalExpenditure"]').val(count);
|
$('input[name="fm_otherexpenditureinfo.CapitalizationTotalExpenditure"]').val(changeMoneyToChinese(count));
|
}
|
}
|
|
//选择税率后重新计算
|
$(document).on('change', $('input[name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount"]'), function () {
|
countmoney();
|
});
|
|
|
|
|
//删除事件回调操作
|
deleteMethod = function () {
|
countmoney();
|
}
|
var orderCode = '';
|
//添加事件回调操作
|
createMethod = function () {
|
|
var ntr = $('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').length;
|
if (ntr > 0) {
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(ntr - 1).html(listtypeoptions.join(''));
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(ntr - 1).trigger("chosen:updated");
|
if (listtypeoptions.length <= 1)//只有一项一下,禁用选择
|
{
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(ntr - 1).attr('disabled', 'disabled');
|
|
}
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(ntr - 1).chosen();
|
}
|
var inputs = '<input type="hidden" name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsID" class="edit" field="FundsCostSubjectsID" value="">';
|
$('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').eq(ntr - 1).after(inputs);
|
//财务科目选择后触发
|
$('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').eq(ntr - 1).bind('focus', function (i, r) {
|
getCWinfo(this);
|
});
|
var type = parseInt(getUrlParam('type'));
|
if ($.trim(sysid) != '' && initItems != null) {
|
type = parseInt(initItems.ExpenditureBusinessTypeID);
|
}
|
|
changeTextarea();
|
}
|
|
//动态添加CSS样式
|
function addCSS() {
|
var str_style = 'td{ position:relative;}\
|
.bl{position: relative;}\
|
.bl .back {position: absolute;top: 0;right: 5px;display: inline-block;}\
|
.bl .backdtl {position: absolute;top: 2px;right:10px;display: inline-block;}';
|
if (document.all) { // document.createStyleSheet(url)
|
window.style = str_style;
|
document.createStyleSheet("javascript:style");
|
} else { //document.createElement(style)
|
var style = document.createElement('style');
|
style.type = 'text/css';
|
style.innerHTML = str_style;
|
document.getElementsByTagName('HEAD').item(0).appendChild(style);
|
}
|
}
|
//把input改为textarea
|
function changeTextarea() {
|
//备注
|
$('input[name="fm_otherexpenditureinfo_dtl.Remarks"]').each(function (i, input) {
|
var value = $.trim($(this).val());
|
var textarea = createTextarea("fm_otherexpenditureinfo_dtl", "remarks");
|
changeInputCell(input, textarea, value);
|
})
|
}
|
|
|
|
//替换表格控件元素
|
function changeInputCell(input, newInput, value) {
|
value = value || "";
|
var $input = $(input);
|
var $newInput = $(newInput);
|
var parent = input.parentNode;
|
$newInput.val(value);
|
var hasEdit = $input.hasClass("edit");
|
var isDisbale = $input.prop("disabled");
|
isDisbale && newInput.setAttribute("disabled", "disabled");
|
newInput.innerHTML = value;
|
$input.remove();
|
parent.appendChild(newInput);
|
}
|
|
|
|
//创建textarea
|
function createTextarea(table, name) {
|
var textarea = document.createElement("textarea");
|
textarea.className = "tex_inp";
|
textarea.id = table + "_" + name;
|
textarea.name = table + "." + name;
|
textarea.setAttribute("field", name);
|
return textarea;
|
}
|
|
//选择供应商后绑定数据
|
var setCompanyInfo = function (id, name, UserName, Phone, BankName, BankDeposit, BankAccount) {
|
$('#fm_otherexpenditureinfo_IncomeUnitID').val($.trim(id));
|
$('#fm_otherexpenditureinfo_IncomeUnitName').val(name);
|
$('#fm_otherexpenditureinfo_AccountOpenBankAccount').val(BankName);
|
$('#fm_otherexpenditureinfo_CashBankName').val(BankDeposit);
|
$('#fm_otherexpenditureinfo_ReceivablesAccount').val(BankAccount);
|
|
layer.closeAll();
|
}
|
|
//收入单位选择
|
var getmaterielinfo = function () {
|
layer.open({
|
type: 2,
|
title: '收款单位',
|
shadeClose: true,
|
shade: 0.4,
|
area: ['90%', '90%'],
|
content: "/oa/General/company"
|
});
|
}
|
|
//客户单位选择
|
var getCustomerinfo = function () {
|
layer.open({
|
type: 2,
|
title: '客户单位',
|
shadeClose: true,
|
shade: 0.4,
|
area: ['90%', '90%'],
|
content: "/Customer/Search"
|
});
|
}
|
SetCustomer = function (data) {
|
$AccountOpenBankAccount = $('#fm_otherexpenditureinfo_AccountOpenBankAccount');
|
$CashBankName = $('#fm_otherexpenditureinfo_CashBankName');
|
$ReceivablesAccount = $('#fm_otherexpenditureinfo_ReceivablesAccount');
|
$('#fm_otherexpenditureinfo_IncomeUnitName').val(data.Name);
|
$AccountOpenBankAccount.val(data.AccountName);
|
$CashBankName.val(data.OpenBank);
|
$ReceivablesAccount.val(data.BankCardNumber);
|
$('#fm_otherexpenditureinfo_IncomeUnitID').val(data.Id || "");
|
if (data.AccountName == null || data.AccountName == "")
|
$AccountOpenBankAccount.removeAttr("disabled");
|
else
|
$AccountOpenBankAccount.attr("disabled", "disabled");
|
if (data.OpenBank == null || data.OpenBank == "")
|
$CashBankName.removeAttr("disabled");
|
else
|
$CashBankName.attr("disabled", "disabled");
|
if (data.BankCardNumber == null || data.BankCardNumber == "")
|
$ReceivablesAccount.removeAttr("disabled");
|
else
|
$ReceivablesAccount.attr("disabled", "disabled");
|
layer.closeAll();
|
}
|
|
var thisobj = null;
|
|
//财务科目
|
var getCWinfo = function (obj) {
|
thisobj = obj;
|
layer.open({
|
type: 2,
|
title: '财务科目',
|
shadeClose: true,
|
shade: 0.4,
|
area: ['90%', '90%'],
|
content: "/Article/CWindex"
|
});
|
}
|
|
//选择财务科目后触发
|
var setCWInfo = function (SubjectEncode, SubjectName) {
|
$(thisobj).parent().parent().find('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').val(SubjectName);
|
$(thisobj).parent().parent().find('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsID"]').val(SubjectEncode);
|
layer.closeAll();
|
}
|
|
//项目改为手动填写
|
var changeProjectInput = function () {
|
var $input_project = $('#fm_otherexpenditureinfo_ProjectID');
|
var disable = $input_project.prop("disabled");
|
var isEdit = $input_project.hasClass("edit");
|
var $parent = $input_project.parent();
|
var str_input = '<input type="text" id="fm_otherexpenditureinfo_ProjectName" name="fm_otherexpenditureinfo.ProjectName" field="ProjectName" class="form-control">';
|
var $input = $(str_input);
|
$input.prop("disabled", disable);
|
isEdit && $input.addClass("edit");
|
$parent.html($input);
|
}
|
|
function JsonDateToDate(jsondate) {
|
var date = new Date(parseInt(jsondate.replace("/Date(", "").replace(")/", ""), 10));
|
return date;
|
}
|
|
Date.prototype.Format = function (formatStr) {
|
var str = formatStr;
|
var Week = ['日', '一', '二', '三', '四', '五', '六'];
|
|
var mt = this.getMonth() + 1;
|
str = str.replace(/yyyy|YYYY/, this.getFullYear());
|
str = str.replace(/yy|YY/, (this.getYear() % 100) > 9 ? (this.getYear() % 100).toString() : '0' + (this.getYear() % 100));
|
str = str.replace(/MM/, mt > 9 ? mt : '0' + mt);
|
str = str.replace(/M/g, mt);
|
str = str.replace(/w|W/g, Week[this.getDay()]);
|
str = str.replace(/dd|DD/, this.getDate() > 9 ? this.getDate().toString() : '0' + this.getDate());
|
str = str.replace(/d|D/g, this.getDate());
|
str = str.replace(/hh|HH/, this.getHours() > 9 ? this.getHours().toString() : '0' + this.getHours());
|
str = str.replace(/h|H/g, this.getHours());
|
str = str.replace(/mm/, this.getMinutes() > 9 ? this.getMinutes().toString() : '0' + this.getMinutes());
|
str = str.replace(/m/g, this.getMinutes());
|
|
str = str.replace(/ss|SS/, this.getSeconds() > 9 ? this.getSeconds().toString() : '0' + this.getSeconds());
|
str = str.replace(/s|S/g, this.getSeconds());
|
return str;
|
}
|
|
var getinfo = function (ntype, sorderCode) {
|
var url = '';
|
if (ntype == 3) {
|
url = '/OA/General/GetInOrderByordeCode?orderCode=' + sorderCode;
|
}
|
else {
|
url = '/OA/General/FindSettlementModelByCode?orderCode=' + sorderCode;
|
}
|
$.ajax({
|
url: url, async: false, cache: false, dataType: "json",
|
success: function (data) {
|
$('.subtradd_js').hide();
|
var arytrs = [];
|
var allmoney = 0;
|
if (ntype == 3) {
|
$.each(data, function (i, r) {
|
var html = '<tr class="body">';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureTypeName" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName" type="text" value="' + r.materielinfoName + '" class="form-control edit" field="ExpenditureTypeName" isvalid="yes" checkexpession="NotNull"></td>';
|
html += '<td><textarea class="tex_inp" id="fm_otherexpenditureinfo_dtl_remarks" disabled="disabled" name="fm_otherexpenditureinfo_dtl.remarks" field="remarks">数量:' + r.count + ' 价格:' + r.price + '</textarea></td>';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureNotContainTaxAmount" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount" type="text" class="form-control edit" value="' + r.amount + '" field="ExpenditureNotContainTaxAmount" isvalid="yes" checkexpession="Num"></td>';
|
html += '</tr>';
|
arytrs.push(html);
|
|
});
|
}
|
else {
|
|
if (parseInt(data.subject) == 1) {
|
if (data.InOrders.length > 0) {
|
$.each(data.InOrders, function (i, r) {
|
if (r.orderDtls.length > 0) {
|
$.each(r.orderDtls, function (ii, rr) {
|
var html = '<tr class="body">';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureTypeName" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName" type="text" value="' + rr.materielinfoName + '" class="form-control edit" field="ExpenditureTypeName" isvalid="yes" checkexpession="NotNull"></td>';
|
html += '<td><textarea class="tex_inp" id="fm_otherexpenditureinfo_dtl_remarks" disabled="disabled" name="fm_otherexpenditureinfo_dtl.remarks" field="remarks">数量:' + rr.count + ' 价格:' + rr.price + '</textarea></td>';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureNotContainTaxAmount" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount" type="text" class="form-control edit" value="' + rr.amount + '" field="ExpenditureNotContainTaxAmount" isvalid="yes" checkexpession="Num"></td>';
|
html += '</tr>';
|
arytrs.push(html);
|
});
|
}
|
});
|
}
|
}
|
else {
|
if (data.SettlementDtls.length > 0) {
|
$.each(data.SettlementDtls, function (i, r) {
|
var html = '<tr class="body">';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureTypeName" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName" type="text" value="' + r.content + '" class="form-control edit" field="ExpenditureTypeName" isvalid="yes" checkexpession="NotNull"></td>';
|
html += '<td><textarea class="tex_inp" id="fm_otherexpenditureinfo_dtl_remarks" disabled="disabled" name="fm_otherexpenditureinfo_dtl.remarks" field="remarks">开始日期:' + JsonDateToDate(r.construction_start_date).Format('yyyy-MM-dd') + ' 结算日期:' + JsonDateToDate(r.construction_end_date).Format('yyyy-MM-dd') + '</textarea></td>';
|
html += '<td><input id="fm_otherexpenditureinfo_dtl_ExpenditureNotContainTaxAmount" disabled="disabled" name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount" type="text" class="form-control edit" value="' + r.amount + '" field="ExpenditureNotContainTaxAmount" isvalid="yes" checkexpession="Num"></td>';
|
html += '</tr>';
|
arytrs.push(html);
|
});
|
}
|
}
|
}
|
$('#girdtable tbody').find('.body').remove();
|
$('#girdtable tbody').append(arytrs.join(''));
|
countmoney();
|
}
|
});
|
}
|
|
var setReadOnly = function () {
|
//$(".opinion").hide();
|
$(".btn:last").parent().hide();
|
}
|
|
///数据加载
|
var initData = function () {
|
addCSS();
|
changeTextarea();
|
var url = window.location.href;
|
type = parseInt(getUrlParam('type'));
|
if ($.trim(sysid) != '' && initItems != null) {
|
type = parseInt(initItems.ExpenditureBusinessTypeID);
|
}
|
gettype(type);
|
|
var ExpenditureBusinessTypeName = $('#txtTitle').html().replace('付款单', '');
|
var orderType = 0;
|
var dept_name = "", dept_id = 0;
|
var ot = $.trim(getUrlParam('orderType'));
|
if (ot != '') {
|
orderType = parseInt(ot);
|
}
|
if (sysid != '' && initItems != null) {
|
ExpenditureBusinessTypeName = initItems.ExpenditureBusinessTypeName;
|
orderType = parseInt(initItems.orderType);
|
orderCode = initItems.SettlementNumber;
|
|
dept_id = initItems.dept_id;
|
dept_name = initItems.dept_name;
|
// $(".annex").css('display', 'none');
|
}
|
$('input[name="fm_otherexpenditureinfo.dept_name"]').val(dept_name);
|
$('input[name="fm_otherexpenditureinfo.dept_id"]').val(dept_id);
|
//// 处理部门项目部不展示,职能部展示
|
var titl = $('input[name="fm_otherexpenditureinfo.Title"]').val();
|
|
if (titl.indexOf("项目") != -1) {
|
$('input[name="fm_otherexpenditureinfo.dept_name"]').css('display', 'none');
|
}
|
$('#fm_otherexpenditureinfo_dept_id').css('display', 'none');
|
var inputs = '<input type="hidden" id="fm_otherexpenditureinfo_ExpenditureBusinessTypeID" name="fm_otherexpenditureinfo.ExpenditureBusinessTypeID" field="ExpenditureBusinessTypeID" value="' + type + '">';
|
inputs += '<input type="hidden" id="fm_otherexpenditureinfo_ExpenditureBusinessTypeName" name="fm_otherexpenditureinfo.ExpenditureBusinessTypeName" field="ExpenditureBusinessTypeName" value="' + ExpenditureBusinessTypeName + '">';
|
$('input[name="fm_otherexpenditureinfo.Code"]').after(inputs);
|
|
orderCode = orderCode == '' ? $.trim(getUrlParam('orderCode')) : orderCode;
|
|
$('input[name="fm_otherexpenditureinfo.SettlementNumber"]').val(orderCode);
|
$('input[name="fm_otherexpenditureinfo.SettlementNumber"]').attr('disabled', 'disabled');
|
if ($.trim(orderCode) == '') {
|
$('input[name="fm_otherexpenditureinfo.SettlementNumber"]').parent().parent().remove();
|
}
|
|
|
var lbtype = '';
|
switch (orderType) {
|
case 1: lbtype = '合同单号'; break;
|
case 2: lbtype = '申请单号'; break;
|
case 3: lbtype = '入库单号'; break;
|
case 4: lbtype = '结算款单号'; break;
|
case 5: lbtype = '进度款单号'; break;
|
}
|
|
if (orderType != '') {
|
$('input[name="fm_otherexpenditureinfo.SettlementNumber"]').parent().parent().find('label').html(lbtype);
|
}
|
inputs = '<input type="hidden" id="fm_otherexpenditureinfo_orderType" name="fm_otherexpenditureinfo.orderType" field="orderType" value="' + orderType + '">';
|
$('input[name="fm_otherexpenditureinfo.Code"]').after(inputs);
|
var SettlementMethodName = (initItems != null && $.trim(initItems.SettlementMethodName) != '') ? initItems.SettlementMethodName : $('select[name="fm_otherexpenditureinfo.SettlementMethodID"]').find('option:eq(0)').text();
|
inputs = '<input type="hidden" id="fm_otherexpenditureinfo_SettlementMethodName" name="fm_otherexpenditureinfo.SettlementMethodName" field="SettlementMethodName" value="' + SettlementMethodName + '">';
|
$('select[name="fm_otherexpenditureinfo.SettlementMethodID"]').after(inputs);
|
$('select[name="fm_otherexpenditureinfo.SettlementMethodID"]').bind('change', function () {
|
var text = $(this).find('option:selected').text();
|
$('input[name="fm_otherexpenditureinfo.SettlementMethodName"]').val(text);
|
});
|
|
inputs = '<input type="hidden" id="fm_otherexpenditureinfo_ProjectName" name="fm_otherexpenditureinfo.ProjectName" field="ProjectName" value="">';
|
$('#fm_otherexpenditureinfo_ProjectID').after(inputs);
|
if ($.trim(initItems.ProjectName) != '') {
|
$('input[name="fm_otherexpenditureinfo.ProjectName"]').val(initItems.ProjectName);
|
}
|
var projectid = $.trim(getUrlParam('projectid'));
|
projectid = projectid == '' ? 0 : projectid;
|
if (parseInt(projectid) > 0) {
|
$('#fm_otherexpenditureinfo_ProjectID').val(projectid);
|
$('#fm_otherexpenditureinfo_ProjectID').trigger("chosen:updated");
|
$('#fm_otherexpenditureinfo_ProjectID').attr('disabled', 'disabled');
|
var pname = $('#fm_otherexpenditureinfo_ProjectID').find('option:selected').text();
|
$('#fm_otherexpenditureinfo_ProjectName').val(pname);
|
}
|
getusername(type);
|
|
if ($.trim(sysid) != '' && initItems.Children != null && initItems.Children != undefined && initItems.Children.length > 0) {
|
|
$.each(initItems.Children, function (i, r) {
|
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(i).html(listtypeoptions.join(''));
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(i).val(r.ExpenditureTypeName);
|
$('select[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').eq(i).trigger("chosen:updated");
|
|
var inputs = '<input type="hidden" name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsID" class="edit" field="FundsCostSubjectsID" value="' + r.FundsCostSubjectsID + '">';
|
$('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').eq(i).after(inputs);
|
});
|
}
|
inputs = '<input type="hidden" id="fm_otherexpenditureinfo_IncomeUnitID" name="fm_otherexpenditureinfo.IncomeUnitID" class="edit" field="IncomeUnitID" value="' + $.trim(initItems.IncomeUnitID) + '">';
|
$('#fm_otherexpenditureinfo_IncomeUnitName').after(inputs);
|
if (type == 34) {
|
$('#fm_otherexpenditureinfo_IncomeUnitName').bind('focus', function () {
|
getCustomerinfo();
|
});
|
} else if (type != 6 && type != 26 && type != 36 && type != 39 && type != 40) {
|
$('#fm_otherexpenditureinfo_IncomeUnitName').bind('focus', function () {
|
getmaterielinfo();
|
});
|
}
|
$('input[name="fm_otherexpenditureinfo.IsInPlan"]:eq(0)').attr("value", '1');
|
$('input[name="fm_otherexpenditureinfo.IsInPlan"]:eq(1)').attr("value", '2');
|
|
if ($.trim(sysid) != '' && initItems != null) {
|
var sprintbtn = '<span style="position: absolute;right:20px;"><a onclick="" href="/oa/General/costprint?id=' + sysid + '" target="_blank" style="font-size:12px;margin-right: 20px;"><img src="../../img/ico/printer.png" />表单打印</a>';
|
sprintbtn += '<a onclick="" href="/oa/General/printyj?flowid=' + flowid + '&taskid=' + taskid + '" target="_blank" style="font-size:12px;"><img src="../../img/ico/printer.png" />审核意见打印</a></span>';
|
$('#txtTitle').append(sprintbtn);
|
}
|
if (type == 36) {
|
$('#fm_otherexpenditureinfo_CashBankName').parent().parent().find('label').html('付款银行');
|
$('#fm_otherexpenditureinfo_ReceivablesAccount').parent().parent().find('label').html('付款账号');
|
$('#fm_otherexpenditureinfo_IncomeUnitName').parent().parent().remove();
|
$('#fm_otherexpenditureinfo_AccountOpenBankAccount').parent().parent().remove();
|
} else if (type == 34) {
|
|
if (window.childrenItems.length > 0) {
|
if (window.childrenItems[0].BeginTime.length == 0)
|
$('input[name="fm_otherexpenditureinfo_dtl.BeginTime"]').attr("value", '');
|
if (window.childrenItems[0].EndTime.length == 0)
|
$('input[name="fm_otherexpenditureinfo_dtl.EndTime"]').attr("value", '');
|
}
|
var openType = getUrlParam("openType");
|
if (openType == "readonly")
|
setReadOnly();
|
}
|
if (orderType == 3 || orderType == 4 || orderType == 5)
|
getpaymoney(orderCode, sysid);
|
if (sysid == '' && (orderType == 3 || orderType == 4 || orderType == 5) && orderCode != '') {
|
|
getinfo(orderType, orderCode);
|
}
|
if (sysid != '' && (orderType == 3 || orderType == 4 || orderType == 5) && (type == 41 || type == 42 || type == 43 || type == 44 || type == 45 || type == 46 || type == 47 || type == 48 || type == 49 || type == 50 || type == 51 || type == 52)) {
|
$('input[name="fm_otherexpenditureinfo_dtl.ExpenditureTypeName"]').attr('disabled', 'disabled');
|
$('input[name="fm_otherexpenditureinfo_dtl.remarks"]').attr('disabled', 'disabled');
|
$('textarea[name="fm_otherexpenditureinfo_dtl.remarks"]').attr('disabled', 'disabled');
|
$('input[name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount"]').attr('disabled', 'disabled');
|
$('.subtradd_js').hide();
|
}
|
if (sysid == '') {
|
var inputs = '<input type="hidden" name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsID" class="edit" field="FundsCostSubjectsID" value="">';
|
$('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').after(inputs);
|
}
|
//财务科目选择后触发
|
$('input[name="fm_otherexpenditureinfo_dtl.FundsCostSubjectsName"]').bind('focus', function (i, r) {
|
getCWinfo(this);
|
});
|
var sProjectName = $('#fm_otherexpenditureinfo_ProjectID').find('option:selected').text();
|
$('#fm_otherexpenditureinfo_ProjectName').val(sProjectName);
|
$('#fm_otherexpenditureinfo_ProjectID').bind('change', function (i, r) {
|
sProjectName = $('#fm_otherexpenditureinfo_ProjectID').find('option:selected').text();
|
$('#fm_otherexpenditureinfo_ProjectName').val(sProjectName);
|
});
|
if (type == 34) {
|
var title = $("#txtTitle").html();
|
var pjname = $("#fm_otherexpenditureinfo_ProjectID option:selected").html();
|
$("#txtTitle").html(pjname + "【" + title + "】");
|
}
|
///加载投标保证金默认金额
|
if (sysid == '' && type == 34) {
|
var bidbondamount = $.trim(getUrlParam('bidbondamount'));
|
if (bidbondamount != '') {
|
$('input[name="fm_otherexpenditureinfo_dtl.ExpenditureNotContainTaxAmount"]').val(bidbondamount == 0 ? "" : bidbondamount);
|
countmoney();
|
}
|
}
|
}
|