Commit b27e0d44 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 63e7b2c3 b50a3f69
...@@ -466,6 +466,14 @@ public class OrganizationDto { ...@@ -466,6 +466,14 @@ public class OrganizationDto {
this.pLevel = pLevel; this.pLevel = pLevel;
} }
public Integer getPLevel() {
return pLevel;
}
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
......
...@@ -787,6 +787,30 @@ public class Organization extends BaseEntity implements Serializable { ...@@ -787,6 +787,30 @@ public class Organization extends BaseEntity implements Serializable {
this.pLevel = pLevel; this.pLevel = pLevel;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.p_level
*
* @return the value of organization.p_level
*
* @mbg.generated
*/
public Integer getPLevel() {
return pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.p_level
*
* @param pLevel the value for organization.p_level
*
* @mbg.generated
*/
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.create_time * This method returns the value of the database column organization.create_time
...@@ -1699,6 +1723,8 @@ public class Organization extends BaseEntity implements Serializable { ...@@ -1699,6 +1723,8 @@ public class Organization extends BaseEntity implements Serializable {
this.logoutTime = logoutTime; this.logoutTime = logoutTime;
} }
public Area getArea() { public Area getArea() {
return area; return area;
} }
......
...@@ -791,6 +791,9 @@ ...@@ -791,6 +791,9 @@
<if test="parentId != null"> <if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR}, parent_id = #{parentId,jdbcType=VARCHAR},
</if> </if>
<if test="parentId == null">
parent_id = NULL,
</if>
<if test="taxPayerNumber != null"> <if test="taxPayerNumber != null">
tax_payer_number = #{taxPayerNumber,jdbcType=VARCHAR}, tax_payer_number = #{taxPayerNumber,jdbcType=VARCHAR},
</if> </if>
......
...@@ -1835,6 +1835,7 @@ ...@@ -1835,6 +1835,7 @@
"DataImportLog": "Data Import Log", "DataImportLog": "Data Import Log",
"DataImportLogTitle": "Data Import Log", "DataImportLogTitle": "Data Import Log",
"SelectedOrganization": "Selected Organization", "SelectedOrganization": "Selected Organization",
"SelectedDataType": "Selected DataType",
"extractFinancialData": "Extract Financial Data", "extractFinancialData": "Extract Financial Data",
"ExtractFinancialDataTitle": "Extract Financial Data", "ExtractFinancialDataTitle": "Extract Financial Data",
"extractInvoiceData": "Extract Invoice Data", "extractInvoiceData": "Extract Invoice Data",
......
...@@ -361,10 +361,10 @@ ...@@ -361,10 +361,10 @@
"LandAppreciationTax": "土地增值税", "LandAppreciationTax": "土地增值税",
"LastMonth": "上月实际", "LastMonth": "上月实际",
"LegalCode": "法人代码", "LegalCode": "法人代码",
"LegalPersonName": "法定代表人/负责人名称", "LegalPersonName": "法定负责人名称",
"LegalPersonPhoneNumber": "法定代表人/负责人手机", "LegalPersonPhoneNumber": "法定负责人手机",
"LegalPersonLandlineNum": "法定代表人/负责人座机", "LegalPersonLandlineNum": "法定负责人座机",
"LegalPersonEmailAddress": "法定代表人/负责人邮箱", "LegalPersonEmailAddress": "法定负责人邮箱",
"RegFinancialOfficerName": "注册登记财务负责人姓名", "RegFinancialOfficerName": "注册登记财务负责人姓名",
"RegFinancialOfficerPhoneNum": "注册登记财务负责人手机", "RegFinancialOfficerPhoneNum": "注册登记财务负责人手机",
"RegFinancialOfficerLandlineNum": "注册登记财务负责人座机", "RegFinancialOfficerLandlineNum": "注册登记财务负责人座机",
......
...@@ -319,7 +319,7 @@ ...@@ -319,7 +319,7 @@
"BranchLocalTaxPaymentRatio": "分支机构就地纳税比例", "BranchLocalTaxPaymentRatio": "分支机构就地纳税比例",
"TotalAssets": "资产总额", "TotalAssets": "资产总额",
"NationalEconomicIndustry": "所属国民经济行业", "NationalEconomicIndustry": "所属国民经济行业",
"EngageNationalProhibitIndustry": "从事国家限制或禁止行业", "EngageNationalProhibitIndustry": "从事国家限制行业",
"ApplicableAccountingStandardsOrAccountingSystems": "适用会计准则或会计制度", "ApplicableAccountingStandardsOrAccountingSystems": "适用会计准则或会计制度",
"GeneralCorporateFinancialStatementFormat": "采用一般企业财务报表格式", "GeneralCorporateFinancialStatementFormat": "采用一般企业财务报表格式",
"SmallMeagerProfit": "小型微利企业", "SmallMeagerProfit": "小型微利企业",
......
...@@ -2079,6 +2079,8 @@ ...@@ -2079,6 +2079,8 @@
"DataImportLog": "数据导入记录", "DataImportLog": "数据导入记录",
"DataImportLogTitle": "数据导入记录", "DataImportLogTitle": "数据导入记录",
"SelectedOrganization": "选择机构", "SelectedOrganization": "选择机构",
"SelectedDataType": "选择数据类型",
"extractFinancialData": "财务数据抽取", "extractFinancialData": "财务数据抽取",
"ExtractFinancialDataTitle": "财务数据抽取", "ExtractFinancialDataTitle": "财务数据抽取",
......
...@@ -399,7 +399,8 @@ ...@@ -399,7 +399,8 @@
{ {
dataField: "createTime", dataField: "createTime",
caption: $translate.instant('RevisionDate'), caption: $translate.instant('RevisionDate'),
allowHeaderFiltering:false allowHeaderFiltering:false,
dataType: "date"
}, },
{ {
dataField: "comment", dataField: "comment",
...@@ -2011,7 +2012,7 @@ ...@@ -2011,7 +2012,7 @@
$scope.isCanOrganizationIsActiveBtn = true; $scope.isCanOrganizationIsActiveBtn = true;
}); });
} }
generalSelectCompanyText();
}; };
// 进入高级配置编辑状态 // 进入高级配置编辑状态
...@@ -2219,6 +2220,10 @@ ...@@ -2219,6 +2220,10 @@
$scope.selectCompanyExtra.completeRecordTotalInstitutions?"是":"否"; $scope.selectCompanyExtra.completeRecordTotalInstitutions?"是":"否";
}; };
var generalSelectCompanyText = function(){
$scope.selectCompany.engageNationalProhibitIndustry = $scope.selectCompany.engageNationalProhibitIndustry?"是":"否";
};
// 添加或者编辑机构成功之后,刷新当前页面的数据 // 添加或者编辑机构成功之后,刷新当前页面的数据
$scope.$watch('isOrgUpdate', function (newValue, oldValue) { $scope.$watch('isOrgUpdate', function (newValue, oldValue) {
if (newValue) { if (newValue) {
...@@ -2391,9 +2396,11 @@ ...@@ -2391,9 +2396,11 @@
//加载用户权限list //加载用户权限list
loadUserRoleList(org.id); loadUserRoleList(org.id);
generalSelectCompanyText();
}); });
orgService.getSingleOrgExtra(org.id).success(function (data) { orgService.getSingleOrgExtra(org.id).success(function (data) {
if(data){ if(data){
$scope.selectCompanyExtra = data; $scope.selectCompanyExtra = data;
......
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
<div class="form-group" ng-show="!isInternational"> <div class="form-group" ng-show="!isInternational">
<div class="col-sm-12" ng-show="!isInternational"> <div class="col-sm-12" ng-show="!isInternational">
<span class="">{{'Abbreviation' | translate}}:<span <span class="">{{'Abbreviation' | translate}}:<span
title="{{selectCompany.abbreviation}}">{{selectCompany.abbreviation ? (selectCompany.foundationDate):'无'}}</span></span> title="{{selectCompany.abbreviation}}">{{selectCompany.abbreviation ? (selectCompany.abbreviation):'无'}}</span></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<span class="">{{'FoundationDate' | translate}}:<span <span class="">{{'FoundationDate' | translate}}:<span
title="{{selectCompany.foundationDate}}">{{selectCompany.foundationDate ? (selectCompany.foundationDate):'无'}}</span></span> title="{{selectCompany.foundationDate}}">{{selectCompany.foundationDate | dateFormat:'YYYY-MM-DD'}}</span></span>
</div> </div>
</div> </div>
<div class="form-group" ng-show="!isInternational"> <div class="form-group" ng-show="!isInternational">
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
<div class="form-group" > <div class="form-group" >
<div class="col-sm-12"> <div class="col-sm-12">
<span class="control-label"> {{'RegistrationLocationEn' | translate}}:<span <span class="control-label"> {{'RegistrationLocationEn' | translate}}:<span
title="{{selectCompany.RegistrationLocationEn}}">{{selectCompany.RegistrationLocationEn }}</span></span> title="{{selectCompany.registrationLocationEn}}">{{selectCompany.registrationLocationEn }}</span></span>
</div> </div>
</div> </div>
<div class="form-group" ng-show="!isInternational"> <div class="form-group" ng-show="!isInternational">
......
...@@ -221,7 +221,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -221,7 +221,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.isUpdate = true; $scope.isUpdate = true;
}); });
} else { } else {
if (editModel.parentID && $scope.selectedOrganization.suborgList) { if (editModel.parentID && $scope.selectedOrganization.suborgList) {
if (editModel.parentID === editModel.id) { if (editModel.parentID === editModel.id) {
...@@ -238,7 +237,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -238,7 +237,6 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
return; return;
} }
}; };
editModel.isActive = !editModel.isActive; editModel.isActive = !editModel.isActive;
orgService.updateOrg(editModel).success(function (data) { orgService.updateOrg(editModel).success(function (data) {
if (data && !data.result) { if (data && !data.result) {
......
...@@ -316,13 +316,12 @@ ...@@ -316,13 +316,12 @@
| translate}}:</label> | translate}}:</label>
<div class="col-sm-9" <div class="col-sm-9"
ng-class="{'has-error':orgControlForm.foundationDate.$invalid && (orgControlForm.foundationDate.$dirty || orgControlForm.$submitted)}"> ng-class="{'has-error':orgControlForm.foundationDate.$invalid && (orgControlForm.foundationDate.$dirty || orgControlForm.$submitted)}">
<div class="input-daterange startDatepicker" > <div class="input-daterange startDatepicker">
<input type="text" id="foundationDate" class="input-sm form-control" name="foundationDate" ng-model="editOrgModel.foundationDate" <input type="text" id="foundationDate" class="input-sm form-control" name="foundationDate" ng-model="editOrgModel.foundationDate"
placeholder="{{resources.FoundationDate}}"/> placeholder="{{resources.FoundationDate}}"/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
......
...@@ -32,13 +32,15 @@ ...@@ -32,13 +32,15 @@
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式 $scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式
$scope.selectedPeriod = null; $scope.selectedPeriod = null;
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.checkedCompanyList = []; $scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = []; $scope.companyList = [];
$scope.m = []; $scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
$scope.importATExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/ATExcelFile'; $scope.importATExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/ATExcelFile';
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
var month = date.getMonth(); var month = date.getMonth();
...@@ -737,7 +739,7 @@ ...@@ -737,7 +739,7 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyList); var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
// var orgIds = $scope.checkedCompanyList; // var orgIds = $scope.checkedCompanyList;
Upload.upload({ Upload.upload({
...@@ -1196,20 +1198,24 @@ ...@@ -1196,20 +1198,24 @@
}; };
$scope.selectOne = function () { $scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) { angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id); var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1); $scope.checkedCompanyList.splice(index, 1);
} }
}); });
if ($scope.companyList.length === $scope.checkedCompanyList.length) { $scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.selectedAll = true;
} else { $scope.checkedCompanyTypeList = "";
$scope.selectedAll = false; $scope.checkedCompanyCodeList = [];
} angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
...@@ -1218,7 +1224,7 @@ ...@@ -1218,7 +1224,7 @@
$scope.selectedOne = true; $scope.selectedOne = true;
$scope.checkedCompanyList = []; $scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) { angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
...@@ -1228,6 +1234,12 @@ ...@@ -1228,6 +1234,12 @@
i.checked = false; i.checked = false;
}) })
} }
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{'PleaseSelect' | translate}} {{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()" <input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne" ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px"> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;">{{i.name}}</span> <span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div> </div>
</li> </li>
</ul> </ul>
......
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式 $scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式
$scope.selectedPeriod = null; $scope.selectedPeriod = null;
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.checkedCompanyList = [];
$scope.companyList = []; $scope.companyList = [];
$scope.m = []; $scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
$scope.importCPRExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/CPRExcelFile'; $scope.importCPRExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/CPRExcelFile';
...@@ -735,7 +737,7 @@ ...@@ -735,7 +737,7 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyList); var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: $scope.importCPRExcelFile, url: $scope.importCPRExcelFile,
...@@ -1242,20 +1244,24 @@ ...@@ -1242,20 +1244,24 @@
}; };
$scope.selectOne = function () { $scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) { angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id); var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1); $scope.checkedCompanyList.splice(index, 1);
} }
}); });
if ($scope.companyList.length === $scope.checkedCompanyList.length) { $scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.selectedAll = true;
} else { $scope.checkedCompanyTypeList = "";
$scope.selectedAll = false; $scope.checkedCompanyCodeList = [];
} angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
...@@ -1264,7 +1270,7 @@ ...@@ -1264,7 +1270,7 @@
$scope.selectedOne = true; $scope.selectedOne = true;
$scope.checkedCompanyList = []; $scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) { angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
...@@ -1274,6 +1280,12 @@ ...@@ -1274,6 +1280,12 @@
i.checked = false; i.checked = false;
}) })
} }
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{'PleaseSelect' | translate}} {{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()" <input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne" ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px"> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;">{{i.name}}</span> <span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div> </div>
</li> </li>
</ul> </ul>
......
...@@ -32,12 +32,14 @@ ...@@ -32,12 +32,14 @@
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式 $scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式
$scope.selectedPeriod = null; $scope.selectedPeriod = null;
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.importIRExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/IRExcelFile'; $scope.importIRExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/IRExcelFile';
$scope.checkedCompanyList = [];
$scope.companyList = []; $scope.companyList = [];
$scope.m = []; $scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
...@@ -215,7 +217,7 @@ ...@@ -215,7 +217,7 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyList); var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: $scope.importIRExcelFile, url: $scope.importIRExcelFile,
...@@ -509,20 +511,24 @@ ...@@ -509,20 +511,24 @@
}; };
$scope.selectOne = function () { $scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) { angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id); var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1); $scope.checkedCompanyList.splice(index, 1);
} }
}); });
if ($scope.companyList.length === $scope.checkedCompanyList.length) { $scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.selectedAll = true;
} else { $scope.checkedCompanyTypeList = "";
$scope.selectedAll = false; $scope.checkedCompanyCodeList = [];
} angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
...@@ -531,7 +537,7 @@ ...@@ -531,7 +537,7 @@
$scope.selectedOne = true; $scope.selectedOne = true;
$scope.checkedCompanyList = []; $scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) { angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
...@@ -541,6 +547,12 @@ ...@@ -541,6 +547,12 @@
i.checked = false; i.checked = false;
}) })
} }
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{'PleaseSelect' | translate}} {{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()" <input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne" ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px"> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;">{{i.name}}</span> <span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div> </div>
</li> </li>
</ul> </ul>
......
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式 $scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式
$scope.selectedPeriod = null; $scope.selectedPeriod = null;
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.checkedCompanyList = [];
$scope.companyList = []; $scope.companyList = [];
$scope.m = []; $scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
$scope.importRLITExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/RLITExcelFile'; $scope.importRLITExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/RLITExcelFile';
...@@ -738,7 +740,7 @@ ...@@ -738,7 +740,7 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyList); var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: $scope.importRLITExcelFile, url: $scope.importRLITExcelFile,
...@@ -1246,20 +1248,24 @@ ...@@ -1246,20 +1248,24 @@
}; };
$scope.selectOne = function () { $scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) { angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id); var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1); $scope.checkedCompanyList.splice(index, 1);
} }
}); });
if ($scope.companyList.length === $scope.checkedCompanyList.length) { $scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.selectedAll = true;
} else { $scope.checkedCompanyTypeList = "";
$scope.selectedAll = false; $scope.checkedCompanyCodeList = [];
} angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
...@@ -1268,7 +1274,7 @@ ...@@ -1268,7 +1274,7 @@
$scope.selectedOne = true; $scope.selectedOne = true;
$scope.checkedCompanyList = []; $scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) { angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
...@@ -1278,6 +1284,12 @@ ...@@ -1278,6 +1284,12 @@
i.checked = false; i.checked = false;
}) })
} }
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{'PleaseSelect' | translate}} {{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()" <input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne" ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px"> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;">{{i.name}}</span> <span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div> </div>
</li> </li>
</ul> </ul>
......
...@@ -1435,6 +1435,8 @@ constant.fileTypeList = [ ...@@ -1435,6 +1435,8 @@ constant.fileTypeList = [
{code:2,type:"所有者权益变动表和汇率表"} {code:2,type:"所有者权益变动表和汇率表"}
]; ];
constant.maxButtonTitleLength = 20;
......
...@@ -32,14 +32,17 @@ ...@@ -32,14 +32,17 @@
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2, ApiImport: 2 }; //导入方式 $scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2, ApiImport: 2 }; //导入方式
$scope.selectedPeriod = null; $scope.selectedPeriod = null;
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.checkedCompanyList = [];
$scope.companyList = []; $scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
$scope.fileTypeList = constant.fileTypeList; $scope.fileTypeList = constant.fileTypeList;
$scope.checkedFileTypeList = []; $scope.checkedFileList = [];
$scope.checkedFileCodeList = [];
$scope.m = []; $scope.checkedFileTypeList = "";
$scope.importATExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/ATExcelFile'; $scope.importATExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/ATExcelFile';
...@@ -101,19 +104,6 @@ ...@@ -101,19 +104,6 @@
projectId: $scope.projectID projectId: $scope.projectID
}; };
$scope.totalData = {
totalNumber: 0,
begDebitTotal: 0,
begCreditTotal: 0,
endDebitTotal: 0,
endCreditTotal: 0,
begBalTotal: 0,
endBalTotal: 0,
debitTotal: 0,
creditTotal: 0,
};
//分页获取数据 //分页获取数据
$scope.eventService = { $scope.eventService = {
refreshInvoiceDataGrid: function () { refreshInvoiceDataGrid: function () {
...@@ -121,549 +111,6 @@ ...@@ -121,549 +111,6 @@
} }
}; };
//转换没有选中的列值
var undefinedStringToNull = function (i, stringName) {
var data = $scope.sheetData.dataList[i][$.inArray($translate.instant(stringName), $scope.selectedMappingList)];
if (_.isUndefined(data)) {
return null;
}
else {
if (PWC.isNullOrEmpty(data)) {
return "";
}
else {
return data;
}
}
}
//转换没有选中的列值
var undefinedNumToNull = function (i, stringName) {
var data = $scope.sheetData.dataList[i][$.inArray($translate.instant(stringName), $scope.selectedMappingList)];
if (_.isUndefined(data)) {
return null;
}
else {
if (PWC.isNullOrEmpty(data)) {
return 0;
}
else {
return data;
}
}
}
//验证每行数据类型
var valueTypeValidation = function (balanceinputlist) {
return true; //todo:[validation] to skip data validation (neo)
var AccountCodeOverLengthMsg = '';
var AccountCodeNullMsg = '';
var PeriodMsg = '';
var BegDebitBalMsg = '';
var BegCreditBalMsg = '';
var DebitBalMsg = '';
var CreditBalMsg = '';
var EndDebitBalMsg = '';
var EndCreditBalMsg = '';
var BegBalMsg = '';
var EndBalMsg = '';
var NumlengthMsg = '';
var AccountCodeOverLengthCount = 0;
var AccountCodeNullCount = 0;
var PeriodCount = 0;
var BegDebitBalCount = 0;
var BegCreditBalCount = 0;
var DebitBalCount = 0;
var CreditBalCount = 0;
var EndDebitBalCount = 0;
var EndCreditBalCount = 0;
var BegBalCount = 0;
var EndBalCount = 0;
var NumLengthCount = 0;
//验证前,将错误数据清空
$scope.errorMsgMap = [];
for (var i = 0; i < balanceinputlist.length; i++) {
var m = balanceinputlist[i];
if (PWC.isNullOrEmpty(m.AcctCode)) {
AccountCodeNullMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('AccountCodeNullMag') + '<br />';
AccountCodeNullCount++;
}
if (m.AcctCode !== null && m.AcctCode.length > 50) {
AccountCodeOverLengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('AccountCodeOverLengthMag') + '<br />';
AccountCodeOverLengthCount++;
}
if (m.MonthId !== null) {
if (!PWC.isInteger(m.MonthId)) {
PeriodMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('PeriodErrorMag') + '<br />';
PeriodCount++;
}
else if (PWC.isInteger(m.MonthId) && (parseInt(m.MonthId) < 1 || parseInt(m.MonthId) > 12)) {
NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('PeriodId') + $translate.instant('PeriodOverLengthMsg') + '<br />';
NumLengthCount++;
}
}
if (m.BegDebitBal !== null) {
if (isNaN(parseFloat(m.BegDebitBal))) {
BegDebitBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegDebitBalMsg') + '<br />';
BegDebitBalCount++;
}
//else if (parseFloat(m.BegDebitBal) < constant.startNum || parseFloat(m.BegDebitBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegDebitBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.BegDebitBal = PWC.round(m.BegDebitBal, 2);
}
}
if (m.BegCreditBal !== null) {
if (isNaN(parseFloat(m.BegCreditBal))) {
BegCreditBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegCreditBalMsg') + '<br />';
BegCreditBalCount++;
}
//else if (parseFloat(m.BegCreditBal) < constant.startNum || parseFloat(m.BegCreditBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegCreditBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.BegCreditBal = PWC.round(m.BegCreditBal, 2);
}
}
if (m.DebitBal !== null) {
if (isNaN(parseFloat(m.DebitBal))) {
DebitBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('DebitBalMsg') + '<br />';
DebitBalCount++;
}
//else if (parseFloat(m.DebitBal) < constant.startNum || parseFloat(m.DebitBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('DebitBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.DebitBal = PWC.round(m.DebitBal, 2);
}
}
if (m.CreditBal !== null) {
if (isNaN(parseFloat(m.CreditBal))) {
CreditBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('CreditBalMsg') + '<br />';
CreditBalCount++;
}
//else if (parseFloat(m.CreditBal) < constant.startNum || parseFloat(m.CreditBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('CreditBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.CreditBal = PWC.round(m.CreditBal, 2);
}
}
if (m.EndDebitBal !== null) {
if (isNaN(parseFloat(m.EndDebitBal))) {
EndDebitBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndDebitBalMsg') + '<br />';
EndDebitBalCount++;
}
//else if (parseFloat(m.EndDebitBal) < constant.startNum || parseFloat(m.EndDebitBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndDebitBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.EndDebitBal = PWC.round(m.EndDebitBal, 2);
}
}
if (m.EndCreditBal !== null) {
if (isNaN(parseFloat(m.EndCreditBal))) {
EndCreditBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndCreditBalMsg') + '<br />';
EndCreditBalCount++;
}
//else if (parseFloat(m.EndCreditBal) < constant.startNum || parseFloat(m.EndCreditBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndCreditBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.EndCreditBal = PWC.round(m.EndCreditBal, 2);
}
}
if (m.BegBal !== null) {
if (isNaN(parseFloat(m.BegBal))) {
BegBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegBalMsg') + '<br />';
BegBalCount++;
}
//else if (parseFloat(m.BegBal) < constant.startNum || parseFloat(m.BegBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('BegBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.BegBal = PWC.round(m.BegBal, 2);
}
}
if (m.EndBal !== null) {
if (isNaN(parseFloat(m.EndBal))) {
EndBalMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndBalMsg') + '<br />';
EndBalCount++;
}
//else if (parseFloat(m.EndBal) < constant.startNum || parseFloat(m.EndBal) > constant.endNum) {
// NumlengthMsg += $translate.instant('LineNum') + ':' + m.SeqNum + ',' + $translate.instant('EndBal') + $translate.instant('NumOverLengthMsg') + '<br />';
// NumLengthCount++;
//}
else {
m.EndBal = PWC.round(m.EndBal, 2);
}
}
}
if (AccountCodeNullMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('AccountCodeNullType'),
'errorCount': AccountCodeNullCount,
'errorContent': AccountCodeNullMsg
});
}
if (AccountCodeOverLengthMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('AccountCodeOverLengthType'),
'errorCount': AccountCodeOverLengthCount,
'errorContent': AccountCodeOverLengthMsg
});
}
if (NumLengthCount > 0) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('NumOutRangeErrorType'),
'errorCount': NumLengthCount,
'errorContent': NumlengthMsg
});
}
if (PeriodMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('PeriodErrorType'),
'errorCount': PeriodCount,
'errorContent': PeriodMsg
});
}
if (BegDebitBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('BegDebitBalType'),
'errorCount': BegDebitBalCount,
'errorContent': BegDebitBalMsg
});
}
if (BegCreditBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('BegCreditBalType'),
'errorCount': BegCreditBalCount,
'errorContent': BegCreditBalMsg
});
}
if (CreditBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('CreditBalType'),
'errorCount': CreditBalCount,
'errorContent': CreditBalMsg
});
}
if (DebitBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('DebitBalType'),
'errorCount': DebitBalCount,
'errorContent': DebitBalMsg
});
}
if (EndDebitBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('EndDebitBalType'),
'errorCount': EndDebitBalCount,
'errorContent': EndDebitBalMsg
});
}
if (EndCreditBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('EndCreditBalType'),
'errorCount': EndCreditBalCount,
'errorContent': EndCreditBalMsg
});
}
if (BegBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('BegBalType'),
'errorCount': BegBalCount,
'errorContent': BegBalMsg
});
}
if (EndBalMsg) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('EndBalType'),
'errorCount': EndBalCount,
'errorContent': EndBalMsg
});
}
if ($scope.errorMsgMap.length > 0) {
$('#errorListModal').modal('show');
return false;
}
return true;
};
//验证是否选中了正确的列名
var validationColumnMapping = function () {
$scope.errorMsgMap = [];
//0.判断选择的开始导入行是否大于实际数据行
if (PWC.isNullOrEmpty($scope.startRowNum)) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('StartRowError'),
'errorCount': 1,
'errorContent': $translate.instant('StartRowNull')
});
}
if (parseInt($scope.startRowNum) > $scope.sheetData.dataList.length) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('StartRowError'),
'errorCount': 1,
'errorContent': $translate.instant('StartRowNumberCheckMsg')
});
}
//1.科目代码必选
if ($scope.selectedMappingList.indexOf($translate.instant('AccountCode')) === -1) {
//errorMsg += $translate.instant('NoAccountCode') + '\n';
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('NoAccountCode')
});
}
//借方期初,贷方期初同时必选
if (($scope.selectedMappingList.indexOf($translate.instant('BegDebitBal')) === -1 &&
$scope.selectedMappingList.indexOf($translate.instant('BegCreditBal')) !== -1)
|| ($scope.selectedMappingList.indexOf($translate.instant('BegDebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('BegCreditBal')) === -1)) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition1')
});
}
//借方发生额,贷方发生额同时必选
if (($scope.selectedMappingList.indexOf($translate.instant('DebitBal')) === -1 &&
$scope.selectedMappingList.indexOf($translate.instant('CreditBal')) !== -1)
|| ($scope.selectedMappingList.indexOf($translate.instant('DebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('CreditBal')) === -1)) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition6')
});
}
//借方期末,贷方期末同时必选
if (($scope.selectedMappingList.indexOf($translate.instant('EndDebitBal')) === -1 &&
$scope.selectedMappingList.indexOf($translate.instant('EndCreditBal')) !== -1)
|| ($scope.selectedMappingList.indexOf($translate.instant('EndDebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('EndCreditBal')) === -1)) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition7')
});
}
//2.期初余额必选或者(借方期初,贷方期初)必选
if (!($scope.selectedMappingList.indexOf($translate.instant('BegBal')) !== -1 ||
$scope.selectedMappingList.indexOf($translate.instant('BegDebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('BegCreditBal')) !== -1)) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition2')
});
}
//3.(借方发生额,贷方发生额)或者(借方期末,贷方期末)或者 期末余额 必选
if (!($scope.selectedMappingList.indexOf($translate.instant('DebitBal')) !== -1
&& $scope.selectedMappingList.indexOf($translate.instant('CreditBal')) !== -1
|| $scope.selectedMappingList.indexOf($translate.instant('EndDebitBal')) !== -1
&& $scope.selectedMappingList.indexOf($translate.instant('EndCreditBal')) !== -1
|| $scope.selectedMappingList.indexOf($translate.instant('EndBal')) !== -1)
) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition3')
});
}
//4.期初余额与借方期初,贷方期初不能同时选
if ($scope.selectedMappingList.indexOf($translate.instant('BegBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('BegDebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('BegCreditBal')) !== -1) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition4')
});
}
//5.期末余额与借方期末,贷方期末不能同时选
if ($scope.selectedMappingList.indexOf($translate.instant('EndBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('EndDebitBal')) !== -1 &&
$scope.selectedMappingList.indexOf($translate.instant('EndCreditBal')) !== -1) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('Condition5')
});
}
//6. CIT时期间必须
if ($scope.serviceTypeId === constant.serviceType.CIT
&& $scope.selectedMappingList.indexOf($translate.instant('PeriodId')) === -1) {
$scope.errorMsgMap.push(
{
'errorType': $translate.instant('SelectColumnError'),
'errorCount': 1,
'errorContent': $translate.instant('PeriodColumnRequired')
});
}
if ($scope.errorMsgMap.length > 0) {
$('#errorListModal').modal('show');
return false;
}
return true;
}
//验证数据
var validationTbData = function () {
var defer = $q.defer();
$scope.balanceInputList = [];
for (var i = $scope.startRowNum - 1; i < $scope.sheetData.dataList.length; i++) {
var balanceDto = {
'SeqNum': i + 1,
'BalanceId': PWC.newGuid(),
'PeriodId': undefinedStringToNull(i, 'PeriodId'),
'AcctCode': undefinedStringToNull(i, 'AccountCode'),
'CustomerCode': undefinedStringToNull(i, 'CustomerCode'),
'MonthId': undefinedStringToNull(i, 'PeriodId'),
'BegDebitBal': undefinedNumToNull(i, 'BegDebitBal'),
'BegCreditBal': undefinedNumToNull(i, 'BegCreditBal'),
'DebitBal': undefinedNumToNull(i, 'DebitBal'),
'CreditBal': undefinedNumToNull(i, 'CreditBal'),
'EndDebitBal': undefinedNumToNull(i, 'EndDebitBal'),
'EndCreditBal': undefinedNumToNull(i, 'EndCreditBal'),
'BegBal': undefinedNumToNull(i, 'BegBal'),
'EndBal': undefinedNumToNull(i, 'EndBal'),
};
$scope.balanceInputList.push(balanceDto);
}
if ($scope.serviceTypeId === constant.serviceType.CIT+"") {
$scope.isSelectPeriod = $scope.balanceInputList[0].MonthId !== null ? true : false;
var isOk = valueTypeValidation($scope.balanceInputList);
defer.resolve(isOk);
return defer.promise;
}
else if ($scope.serviceTypeId === constant.serviceType.VAT+"") {
if ($scope.balanceInputList[0].MonthId === null) {//没有选中月份,默认导入所有期间
$scope.isSelectPeriod = false;
swal({
title: "warning!",
text: $translate.instant('NoPeriod'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
$timeout(function () {
if (isConfirm) {
var isok = valueTypeValidation($scope.balanceInputList);
defer.resolve(isok);
}
else {
defer.resolve(false);
}
}, 300);
});
return defer.promise;
}
else {
$scope.isSelectPeriod = true;
var isSame = true;
$scope.balanceInputList.forEach(function (m) {
if (m.MonthId !== m.PeriodId.toString()) {
isSame = false;
}
});
if (isSame === false) { //是否只导入当前月份数据
swal({
title: "warning!",
text: $translate.instant('PeriodDifferenceTip'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
$timeout(function () {
if (isConfirm) {
var isOk = valueTypeValidation($scope.balanceInputList);
defer.resolve(isOk);
}
else {
defer.resolve(false);
}
}, 300);
});
return defer.promise;
}
else {
var isOk = valueTypeValidation($scope.balanceInputList);
defer.resolve(isOk);
return defer.promise;
}
}
}
};
//根据PeriodId过滤数据 //根据PeriodId过滤数据
var filterImportData = function (m) { var filterImportData = function (m) {
var filterData = false; var filterData = false;
...@@ -679,94 +126,9 @@ ...@@ -679,94 +126,9 @@
}; };
//导入事件 //导入事件
var doUpload = function (importType) { var callApi = function () {
var impExl = $scope.importExcelFile;
var deferred = $q.defer();
var token = $('input[name="__RequestVerificationToken"]').val();
if (!impExl) {
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
return;
}
//列名对应验证
/*if (validationColumnMapping()) {
//数据类型验证
validationTbData().then(function (isSuccess) {
if (isSuccess) {
});
}*/
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = $scope.fileName;
if (importType === $scope.importEnum.Import) {
logDto.OperationName = $translate.instant('ImportProfitLoss');
logDto.OperationType = enums.vatLogOperationTypeEnum.Import;
} else if (importType === $scope.importEnum.CoverImport) {
logDto.OperationName = $translate.instant('CoverImportProfitLoss');
logDto.OperationType = enums.vatLogOperationTypeEnum.CoverImport;
} else if (importType === $scope.importEnum.AddImport) {
logDto.OperationName = $translate.instant('AddImportProfitLoss');
logDto.OperationType = enums.vatLogOperationTypeEnum.AddImport;
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyList);
// var orgIds = $scope.checkedCompanyList;
Upload.upload({
url: $scope.importATExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
file: impExl,
headers: {
'Access-Control-Allow-Origin': '*',
Authorization: apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken(),
__RequestVerificationToken: token,
withCredentials: true
},
__RequestVerificationToken: token,
withCredentials: true
}).then(function(resp) {
var ret = resp.data;
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
} else {
if (ret.resultMsg && ret.resultMsg.length > 0) {
SweetAlert.warning($translate.instant(ret.resultMsg));
}else{
SweetAlert.error($translate.instant('ImportFailed'));
}
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
}
getImportATStatus();
}, function(resp) {
deferred.resolve();
if (resp.statusText === 'HttpRequestValidationException') {
SweetAlert.warning($translate.instant('HttpRequestValidationException'));
} else {
SweetAlert.warning('SaveFail');
}
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.error($translate.instant('ImportFail'));
console.log('Error status: ' + resp.status);
}, function(evt) {
deferred.resolve();
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
$log.debug('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
});
}; };
//显示图标 //显示图标
...@@ -1172,20 +534,24 @@ ...@@ -1172,20 +534,24 @@
}; };
$scope.selectOne = function () { $scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) { angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id); var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1); $scope.checkedCompanyList.splice(index, 1);
} }
}); });
if ($scope.companyList.length === $scope.checkedCompanyList.length) { $scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.selectedAll = true;
} else { $scope.checkedCompanyTypeList = "";
$scope.selectedAll = false; $scope.checkedCompanyCodeList = [];
} angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
...@@ -1194,7 +560,7 @@ ...@@ -1194,7 +560,7 @@
$scope.selectedOne = true; $scope.selectedOne = true;
$scope.checkedCompanyList = []; $scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) { angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i.id); $scope.checkedCompanyList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
...@@ -1204,50 +570,66 @@ ...@@ -1204,50 +570,66 @@
i.checked = false; i.checked = false;
}) })
} }
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList); console.log($scope.checkedCompanyList);
}; };
$scope.selectOneFileType = function () { $scope.selectOneFileType = function () {
$scope.checkedFileList = [];
angular.forEach($scope.fileTypeList , function (i) { angular.forEach($scope.fileTypeList , function (i) {
var index = $scope.checkedFileTypeList.indexOf(i.code); var index = $scope.checkedFileList.indexOf(i.code);
if(i.checked && index === -1) { if(i.checked && index === -1) {
$scope.checkedFileTypeList.push(i.code); $scope.checkedFileList.push(i);
} else if (!i.checked && index !== -1){ } else if (!i.checked && index !== -1){
$scope.checkedFileTypeList.splice(index, 1); $scope.checkedFileList.splice(index, 1);
} }
}); });
if ($scope.fileTypeList.length === $scope.checkedFileTypeList.length) { $scope.selectedAllFileType = $scope.fileTypeList.length === $scope.checkedFileList.length;
$scope.selectedAllFileType = true;
} else { $scope.checkedFileTypeList = "";
$scope.selectedAllFileType = false; $scope.checkedFileCodeList = [];
} angular.forEach($scope.checkedFileList,function (i) {
console.log($scope.checkedFileTypeList); $scope.checkedFileTypeList += i.type+";";
$scope.checkedFileCodeList.push(i.code);
});
console.log($scope.checkedFileList);
}; };
$scope.selectAllFileType = function () { $scope.selectAllFile = function () {
if($scope.selectedAllFileType) { if($scope.selectedAllFileType) {
$scope.selectedOneFileType = true; $scope.selectedOneFile = true;
$scope.checkedFileTypeList = []; $scope.checkedFileList = [];
angular.forEach($scope.fileTypeList, function (i, index) { angular.forEach($scope.fileTypeList, function (i, index) {
$scope.checkedFileTypeList.push(i.code); $scope.checkedFileList.push(i);
i.checked = true; i.checked = true;
}) })
}else { }else {
$scope.selectedOneFileType = false; $scope.selectedOneFile = false;
$scope.checkedFileTypeList = []; $scope.checkedFileList = [];
angular.forEach($scope.fileTypeList, function (i, index) { angular.forEach($scope.fileTypeList, function (i, index) {
i.checked = false; i.checked = false;
}) })
} }
console.log($scope.checkedFileTypeList); $scope.checkedFileTypeList = "";
$scope.checkedFileCodeList = [];
angular.forEach($scope.checkedFileList,function (i) {
$scope.checkedFileTypeList += i.type+";";
$scope.checkedFileCodeList.push(i.code);
});
console.log($scope.checkedFileList);
}; };
//开始 //开始
(function initialize() { (function initialize() {
$log.debug('ImportTBController.ctor()...'); $log.debug('ImportTBController.ctor()...');
checkUserOrganizationPermissionList(); checkUserOrganizationPermissionList();
$scope.doUpload = doUpload; $scope.callApi = callApi;
$scope.refreshTbData = refreshTbData; $scope.refreshTbData = refreshTbData;
$scope.initPagingControl = initPagingControl; $scope.initPagingControl = initPagingControl;
$scope.setButtonWrapStyle = setButtonWrapStyle; $scope.setButtonWrapStyle = setButtonWrapStyle;
...@@ -1265,12 +647,6 @@ ...@@ -1265,12 +647,6 @@
loadImportATStatusInfoDatagrid(); loadImportATStatusInfoDatagrid();
initDatePicker(); initDatePicker();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
if (newValue !== null && newValue !== oldValue) {
initImportFile(newValue);
}
});
$timeout(function () { $timeout(function () {
$scope.isLoadComplete = true; $scope.isLoadComplete = true;
}, 500); }, 500);
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<span class="text-bold" translate="SelectedOrganization"></span>: <span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 220px;">
{{'PleaseSelect' | translate}} {{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu" style="width: 220px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()" <li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li> <span style="margin-left:5px;float: left;">全选</span></li>
...@@ -36,19 +36,19 @@ ...@@ -36,19 +36,19 @@
</div> </div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:80px;"
readonly="readonly" ng-model="UploadPeriodTime"/> readonly="readonly" ng-model="UploadPeriodTime"/>
<i class="fa fa-calendar imp-subheader red-color" style="width:20px;"></i> <i class="fa fa-calendar imp-subheader red-color" style="width:20px;"></i>
</div> </div>
<span class="text-bold" translate="SelectedDataType"></span>:
<div class="dropdown" style="margin-left:10px"> <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 180px;">
{{'PleaseSelect' | translate}} {{checkedFileTypeList ? ((checkedFileTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span> <span class="caret" style="float: right "></span>
</button> </button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu2"> <ul class="dropdown-menu" style="width: 180px;" aria-labelledby="dropdownMenu2">
<li><input type="checkbox" ng-model="selectedAllFileType" ng-change="selectAllFileType()" <li><input type="checkbox" ng-model="selectedAllFileType" ng-change="selectAllFile()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li> <span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0; <li role="separator" class="divider" style="height: 1px;margin: 9px 0;
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<li ng-repeat="i in fileTypeList"> <li ng-repeat="i in fileTypeList">
<div class="checkbox-custom checkbox-default"> <div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOneFileType()" <input type="checkbox" ng-model="i.checked" ng-change="selectOneFileType()"
ng-checked="selectedOneFileType" ng-checked="selectedOneFile"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px"> style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;">{{i.type}}</span> <span style="margin-left:5px;">{{i.type}}</span>
</div> </div>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<button type="button" atms-permission permission-control-type="ngIf" permission-code="{{$root.vatPermission.dataImport.balanceSheet.importCode}}" <button type="button" atms-permission permission-control-type="ngIf" permission-code="{{$root.vatPermission.dataImport.balanceSheet.importCode}}"
class="btn btn-vat-primary" style="float:right; margin-right: 10px;margin-left: 30px;margin-top: 8px;" class="btn btn-vat-primary" style="float:right; margin-right: 10px;margin-left: 30px;margin-top: 8px;"
translate="ImportBtn" translate="ImportBtn"
ng-click="doUpload(importEnum.ApiImport)"></button> ng-click="callApi()"></button>
</div> </div>
</div> </div>
......
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
} }
.period-picker { .period-picker {
width: 150px; width: 110px;
border: 1px solid #c7c5c0; border: 1px solid #c7c5c0;
display: inline-block; display: inline-block;
line-height: 20px; line-height: 20px;
......
<div class="extract-invoice-data"> <div class="extract-invoice-data">
<!--标题--> <!--标题-->
<div class="nav-wrapper"> <div class="nav-wrapper">
<div class="nav-header" translate="ExtractFinancialDataTitle"></div> <div class="nav-header" translate="ExtractInvoiceDataTitle"></div>
<div class="alert alert-warning" style="width:400px;margin-bottom:5px;" ng-show="ImportErrorTab" ng-click="toggleErrorTab()"> <div class="alert alert-warning" style="width:400px;margin-bottom:5px;" ng-show="ImportErrorTab" ng-click="toggleErrorTab()">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>{{errorMsg}} <i class="fa fa-exclamation-circle" aria-hidden="true"></i>{{errorMsg}}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment