|
@@ -139,6 +139,10 @@ $(document).ready(function() {
|
|
|
$("#artificial-area").show();
|
|
|
$("#add-compilation-title").text('添加人工系数');
|
|
|
break;
|
|
|
+ case 'program':
|
|
|
+ $("#program-area").show();
|
|
|
+ $("#add-compilation-title").text('添加计算程序');
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
$("#addcompilation").modal('show');
|
|
@@ -156,7 +160,7 @@ $(document).ready(function() {
|
|
|
});
|
|
|
|
|
|
// 移除操作
|
|
|
- $(".bill-list, .ration-list, .glj-list, .fee-list").on("click", ".remove-lib", function() {
|
|
|
+ $(".bill-list, .ration-list, .glj-list, .fee-list, .artificial-list, .program-list").on("click", ".remove-lib", function() {
|
|
|
$(this).parent().remove();
|
|
|
});
|
|
|
|
|
@@ -235,6 +239,7 @@ function initCompilation() {
|
|
|
let gljLibData = gljList === undefined ? [] : JSON.parse(gljList);
|
|
|
let feeLibData = feeRateList === undefined ? [] : JSON.parse(feeRateList);
|
|
|
let artificialCoefficientData = artificialCoefficientList === undefined ? [] : JSON.parse(artificialCoefficientList);
|
|
|
+ let programData = programList === undefined ? [] : JSON.parse(programList);
|
|
|
|
|
|
mainTreeCol = mainTreeCol !== '' ? mainTreeCol.replace(/\n/g, '\\n') : mainTreeCol;
|
|
|
billsTemplateData = billsTemplateData.replace(/\n/g, '\\n');
|
|
@@ -295,6 +300,14 @@ function initCompilation() {
|
|
|
}
|
|
|
$("select[name='artificial_lib']").children("option").first().after(html);
|
|
|
|
|
|
+ // 计算程序标准库
|
|
|
+ html = '';
|
|
|
+ for(let tmp of programData) {
|
|
|
+ let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + '</option>';
|
|
|
+ html += tmpHtml;
|
|
|
+ }
|
|
|
+ $("select[name='program_lib']").children("option").first().after(html);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -310,6 +323,7 @@ function getAndValidData(model) {
|
|
|
let gljLib = $("select[name='glj_lib']").children("option:selected").val();
|
|
|
let feeLib = $("select[name='fee_lib']").children("option:selected").val();
|
|
|
let artificialLib = $("select[name='artificial_lib']").children("option:selected").val();
|
|
|
+ let programLib = $("select[name='program_lib']").children("option:selected").val();
|
|
|
|
|
|
if (name === '' && model === 'all') {
|
|
|
throw '编办名字不能为空';
|
|
@@ -335,11 +349,16 @@ function getAndValidData(model) {
|
|
|
throw '请选择费率库';
|
|
|
}
|
|
|
|
|
|
+ if (model === 'program' && (programLib === '' || programLib === undefined)) {
|
|
|
+ throw '请选择计算程序';
|
|
|
+ }
|
|
|
+
|
|
|
let standardBillString = $("select[name='standard_bill']").children("option:selected").text();
|
|
|
let rationLibString = $("select[name='ration_lib']").children("option:selected").text();
|
|
|
let gljLibString = $("select[name='glj_lib']").children("option:selected").text();
|
|
|
let feeLibString = $("select[name='fee_lib']").children("option:selected").text();
|
|
|
let artificialString = $("select[name='artificial_lib']").children("option:selected").text();
|
|
|
+ let programString = $("select[name='program_lib']").children("option:selected").text();
|
|
|
|
|
|
let result = {
|
|
|
name: name,
|
|
@@ -362,6 +381,10 @@ function getAndValidData(model) {
|
|
|
artificial: {
|
|
|
id: artificialLib,
|
|
|
name: artificialString
|
|
|
+ },
|
|
|
+ program: {
|
|
|
+ id: programLib,
|
|
|
+ name: programString
|
|
|
}
|
|
|
};
|
|
|
return result;
|
|
@@ -405,6 +428,10 @@ function validLib() {
|
|
|
throw '请添加人工系数';
|
|
|
}
|
|
|
|
|
|
+ if ($("input:hidden[name='program_lib']").length <= 0) {
|
|
|
+ throw '请添加计算程序';
|
|
|
+ }
|
|
|
+
|
|
|
result = true;
|
|
|
} catch (error) {
|
|
|
alert(error);
|