|
@@ -24,6 +24,10 @@ let fileType = {
|
|
|
feeRateFile: 'FeeRateFile'
|
|
|
};
|
|
|
|
|
|
+let taxTypeMap = {
|
|
|
+ 1:"一般计税",
|
|
|
+ 2:"简易计税"
|
|
|
+};
|
|
|
|
|
|
const projTreeObj = {
|
|
|
tree: null,
|
|
@@ -1087,7 +1091,7 @@ $(document).ready(function() {
|
|
|
//选择计税方式
|
|
|
$("#taxType").change(function () {
|
|
|
$('#valuation-info').hide();
|
|
|
- changeEngineering();
|
|
|
+ getStdCalcProgramFiles();
|
|
|
});
|
|
|
|
|
|
|
|
@@ -1425,19 +1429,37 @@ $(document).ready(function() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (Object.keys(currentLib).length <= 0) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 输出数据到页面
|
|
|
- if (currentLib.fee_lib !== undefined && currentLib.fee_lib.length > 0) {
|
|
|
- $("#tender-fee-rate").children("option").first().val("newFeeRate-"+currentLib.fee_lib[0].id);
|
|
|
+ if (Object.keys(currentLib).length > 0) {
|
|
|
+ // 输出数据到页面
|
|
|
+ if (currentLib.fee_lib !== undefined && currentLib.fee_lib.length > 0) {
|
|
|
+ $("#tender-fee-rate").children("option").first().val("newFeeRate-"+currentLib.fee_lib[0].id);
|
|
|
+ }
|
|
|
+ $("#tender-engineering").parent().siblings('.hidden-area').slideDown('fast');
|
|
|
}
|
|
|
- $("#tender-engineering").parent().siblings('.hidden-area').slideDown('fast');
|
|
|
}
|
|
|
+ setTaxGroupHtml();
|
|
|
getStdCalcProgramFiles();
|
|
|
}
|
|
|
|
|
|
|
|
|
+ function setTaxGroupHtml() {
|
|
|
+ let groups = getTaxGroupList();
|
|
|
+ let taxTypeArray = [];
|
|
|
+ let htmlString = "";
|
|
|
+ if(groups && groups.length > 0){
|
|
|
+ taxTypeArray = _.uniq(_.map(groups,'taxType'));
|
|
|
+ }
|
|
|
+ for(let t of taxTypeArray){
|
|
|
+ htmlString += "<option value='"+t+"'>"+taxTypeMap[t]+"</option>"
|
|
|
+ }
|
|
|
+ $('#taxType').html(htmlString);
|
|
|
+ if(taxTypeArray.length <2){
|
|
|
+ $('#taxType_div').hide();
|
|
|
+ }else {
|
|
|
+ $('#taxType_div').show();
|
|
|
+ }
|
|
|
+ console.log(taxTypeArray);
|
|
|
+ }
|
|
|
|
|
|
function getStdCalcProgramFiles(){
|
|
|
function getStdCPFilesHtml(taxGroups) {
|
|
@@ -1456,7 +1478,8 @@ $(document).ready(function() {
|
|
|
};
|
|
|
return result;
|
|
|
};
|
|
|
- let stdCPHtml = getStdCPFilesHtml(getTaxGroupList());
|
|
|
+ let taxType = $("#taxType").val();
|
|
|
+ let stdCPHtml = getStdCPFilesHtml(getTaxGroupList(taxType));
|
|
|
$("#tender-calcProgram").html(stdCPHtml);
|
|
|
if ($("#tender-calcProgram")[0].options.length > 1)
|
|
|
$("#tender-calcProgram")[0].selectedIndex = 1;
|
|
@@ -1838,19 +1861,23 @@ function getEngineeringList(){
|
|
|
return engineeringList;
|
|
|
}
|
|
|
|
|
|
-function getTaxGroupList(){//getcalcProgramList
|
|
|
+
|
|
|
+
|
|
|
+function getTaxGroupList(type){//getcalcProgramList
|
|
|
let egrs = getEngineeringList();
|
|
|
let groupList = [];
|
|
|
let egrID = $("#tender-engineering").val();
|
|
|
- let taxType = $("#taxType").val();
|
|
|
for(let egr of egrs) {
|
|
|
if (egr.engineering_id == egrID && egr.lib) {
|
|
|
- for(let group of egr.lib.tax_group){
|
|
|
- if(group.taxType == taxType && group.program_lib){
|
|
|
- groupList.push(group);
|
|
|
+ if(type){//是否要过滤,如果这个参数不传,则返回整个数组;
|
|
|
+ for(let group of egr.lib.tax_group){
|
|
|
+ if(group.taxType == type && group.program_lib){
|
|
|
+ groupList.push(group);
|
|
|
+ }
|
|
|
}
|
|
|
+ }else {
|
|
|
+ groupList = egr.lib.tax_group;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
return groupList;
|