|
@@ -515,6 +515,50 @@ $(document).ready(function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ // 设置适用类型
|
|
|
+ $(".fileType").change(function() {
|
|
|
+
|
|
|
+ let id = $(this).data('id');
|
|
|
+ if (id === undefined || id === '' || isAdding) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let fileTypes = [];
|
|
|
+ let oldVal = $(this).attr("checked");
|
|
|
+ if(oldVal){
|
|
|
+ $(this).removeAttr("checked")
|
|
|
+ }else{
|
|
|
+ $(this).attr("checked","checked")
|
|
|
+ }
|
|
|
+
|
|
|
+ if($('#'+id+'_gusuan').attr("checked")) fileTypes.push(15);
|
|
|
+ if($('#'+id+'_estimate').attr("checked")) fileTypes.push(5);
|
|
|
+ if($('#'+id+'_submission').attr("checked")) fileTypes.push(1);
|
|
|
+ let current = $(this);
|
|
|
+
|
|
|
+ console.log(id,this);
|
|
|
+ $.ajax({
|
|
|
+ url: '/compilation/valuation/' + section + '/fileTypes',
|
|
|
+ type: 'post',
|
|
|
+ dataType: "json",
|
|
|
+ data: {id: id, fileTypes: fileTypes},
|
|
|
+ error: function() {
|
|
|
+ //恢复原值
|
|
|
+ if(oldVal){
|
|
|
+ current.attr("checked","checked")
|
|
|
+ }else{
|
|
|
+ current.removeAttr("checked")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ success: function(response) {
|
|
|
+ if (response.err !== 0) {
|
|
|
+ switchChange($(this));
|
|
|
+ alert('更改失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
//计价规则删除
|
|
|
$('#delete-confirm').click(function () {
|
|
|
let id = $('#del').attr('selectedId');
|
|
@@ -1115,10 +1159,10 @@ function getGroupIndex(groupData) {//用来做唯一标识
|
|
|
return index;
|
|
|
}
|
|
|
function getTaxGroupData() {
|
|
|
- let programData = programList === undefined ? [] : _.indexBy(JSON.parse(programList), 'id');
|
|
|
- let billTemplateData = billTemplateList == undefined ? [] : _.indexBy(JSON.parse(billTemplateList),'ID');
|
|
|
- let mainTreeColData= mainTreeColList == undefined ? [] : _.indexBy(JSON.parse(mainTreeColList),'ID');
|
|
|
- let feeLibData = feeRateList === undefined ? [] : _.indexBy(JSON.parse(feeRateList),'id');
|
|
|
+ let programData = programList === undefined ? [] : _.keyBy(JSON.parse(programList), 'id');
|
|
|
+ let billTemplateData = billTemplateList == undefined ? [] : _.keyBy(JSON.parse(billTemplateList),'ID');
|
|
|
+ let mainTreeColData= mainTreeColList == undefined ? [] : _.keyBy(JSON.parse(mainTreeColList),'ID');
|
|
|
+ let feeLibData = feeRateList === undefined ? [] : _.keyBy(JSON.parse(feeRateList),'id');
|
|
|
let groupData = {};
|
|
|
if($("#taxType").val() !==""){
|
|
|
groupData.taxType = $("#taxType").val();
|