Commit 99c9b754 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed entity page-- frank

parent eb4ff044
......@@ -83,12 +83,8 @@
{{selectCompany.name | limitString:50}}</p>
</div>
<div class="right-option">
<!--<button type="button" class="btn btn-in-grid" style="width: 117px;" ng-click="updateOrg()" ng-if="hasEditPermission"><i class="material-icons middle">create</i>{{'Change' | translate}}</button>-->
<button type="button" id="organizationIsActiveBtn" class="btn"
ng-class="{true:'btn-secondary', false:'btn-in-grid'}[!selectCompany.isActive]"
ng-click="updateIsActive()" ng-disabled="!isCanOrganizationIsActiveBtn"><i
ng-show="selectCompany.isActive"
class="material-icons stop">block</i>{{selectCompany.isActiveStr}}
<button type="button" id="organizationIsActiveBtn" class="btn" ng-class="{true:'btn-secondary', false:'btn-in-grid'}[!selectCompany.isActive]"
ng-click="updateIsActive()" ng-disabled="!isCanOrganizationIsActiveBtn"><i ng-show="selectCompany.isActive" class="material-icons stop">block</i>{{selectCompany.isActiveStr}}
</button>
<span class="right-operate"></span>
</div>
......
commonModule.
controller('editOrganizationModalController', ['$scope', '$log', '$translate', 'uiGridConstants', '$location', '$timeout', '$interval', 'areaRegionService', '$filter', 'SweetAlert', 'regionService', 'orgService', 'organizationStructureService', 'businessUnitService', 'projectService', 'dimensionService',
commonModule.controller('editOrganizationModalController', ['$scope', '$log', '$translate', 'uiGridConstants', '$location', '$timeout', '$interval', 'areaRegionService', '$filter', 'SweetAlert', 'regionService', 'orgService', 'organizationStructureService', 'businessUnitService', 'projectService', 'dimensionService',
function ($scope, $log, $translate, uiGridConstants, $location, $timeout, $interval, areaRegionService, $filter, SweetAlert, regionService, orgService, organizationStructureService, businessUnitService, projectService, dimensionService) {
var selectedModel = '.addOrgControlPop'; //'#addOrgControlPop' + $scope.dimensionId;
......@@ -31,7 +30,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
var newOrg = function () {
$scope.editOrgModel = {
TypeLevel: 1,
code:''
code: ''
};
......@@ -86,41 +85,41 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$(selectedModel).modal('show');
};
$scope.nameKeyUp = function(){
$scope.nameKeyUp = function () {
var hasSpecialChar = window.PWC.hasSpecialChar($scope.editOrgModel.name);
if (hasSpecialChar){
if (hasSpecialChar) {
$scope.editOrgModel.nameError = $translate.instant('SpecialChar');
} else{
} else {
$scope.editOrgModel.nameError = null;
}
};
// 保存机构
$scope.saveOrg = function () {
if($scope.isInternational){
if ($scope.isInternational) {
saveInternationalOrg();
}else{
} else {
saveLocalOrg();
}
};
var saveInternationalOrg = function () {
$scope.orgControlForm.$setSubmitted();
if(saveVerify()) return;
if (saveVerify()) return;
var editModel = $scope.editOrgModel;
// 是否为境外企业
editModel.oversea = $scope.isInternational;
if((typeof $scope.editOrgModel.logoutTime) ==="string"){
if (""!==($scope.editOrgModel.logoutTime)) {
if ((typeof $scope.editOrgModel.logoutTime) === "string") {
if ("" !== ($scope.editOrgModel.logoutTime)) {
$scope.editOrgModel.logoutTime = new Date($scope.editOrgModel.logoutTime);
}
}
if((typeof $scope.editOrgModel.foundationDate) ==="string"){
if (""!==($scope.editOrgModel.foundationDate)) {
if ((typeof $scope.editOrgModel.foundationDate) === "string") {
if ("" !== ($scope.editOrgModel.foundationDate)) {
$scope.editOrgModel.foundationDate = new Date($scope.editOrgModel.foundationDate);
}
}
......@@ -135,7 +134,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
}
//所属业务线校验
if(!editModel.businessUnitID){
if (!editModel.businessUnitID) {
SweetAlert.error("请检查必填项");
return;
}
......@@ -197,29 +196,29 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
}
};
var saveVerify =function () {
var saveVerify = function () {
var fail = false;
if($('.localRequired').attr("required")==="required"){
$('.localRequired').each( function (index,ele){
if(null==ele.value||""===ele.value){
if ($('.localRequired').attr("required") === "required") {
$('.localRequired').each(function (index, ele) {
if (null == ele.value || "" === ele.value) {
SweetAlert.error("请检查必填项");
fail = true;
return false;
}
});
}
$('.orgAreaRequired').each( function (index,ele){
if(null==ele.innerText||""===ele.innerText){
$('.orgAreaRequired').each(function (index, ele) {
if (null == ele.innerText || "" === ele.innerText) {
SweetAlert.error("请检查必填项");
fail = true;
return false;
}
});
var taxPlayer=$scope.editOrgModel.taxPayerNumber;
if(!(taxPlayer.length===18)){
SweetAlert.error($translate.instant('UnifiedSocialCreditCode')+"长度必须为18位");
var taxPlayer = $scope.editOrgModel.taxPayerNumber;
if (!(taxPlayer.length === 18)) {
SweetAlert.error($translate.instant('UnifiedSocialCreditCode') + "长度必须为18位");
fail = true;
return fail;
}
......@@ -231,7 +230,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
console.log(saveVerify());
if(saveVerify()) return;
if (saveVerify()) return;
var hasSpecialChar = window.PWC.hasSpecialChar($scope.editOrgModel.name);
if (hasSpecialChar) {
......@@ -240,7 +239,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
return false;
}
if ($scope.orgControlForm.$invalid ) {
if ($scope.orgControlForm.$invalid) {
$scope.isShowBasic = true;
return;
} else {
......@@ -269,8 +268,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
editModel.parentID = constant.organization.parentIdNull;
}
if((typeof $scope.editOrgModel.foundationDate) ==="string"){
if (""!==($scope.editOrgModel.foundationDate)) {
if ((typeof $scope.editOrgModel.foundationDate) === "string") {
if ("" !== ($scope.editOrgModel.foundationDate)) {
$scope.editOrgModel.foundationDate = new Date($scope.editOrgModel.foundationDate);
}
}
......@@ -346,13 +345,13 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
orgService.getSingleOrg(orgId).success(function (orgData) {
$scope.selectCompany = orgData;
$scope.editOrgModel = orgData;
$scope.editOrgModel.foundationDate=($filter('date')(new Date($scope.editOrgModel.foundationDate), "yyyy-MM-dd"));
$scope.editOrgModel.foundationDate = ($filter('date')(new Date($scope.editOrgModel.foundationDate), "yyyy-MM-dd"));
$scope.orgAccountList = [];
$scope.serviceList = [];
$scope.OrgAccountRowIndex = 1;
});
if($scope.isInternational){
if ($scope.isInternational) {
$('.localRequired').removeAttr("required");
$('.orgAreaRequired').removeAttr("required");
}
......@@ -560,8 +559,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.changeLocal = function () {
$scope.isLocal = true;
$scope.isInternational = false;
$('.localRequired').attr("required",true);
$('.orgAreaRequired').attr("required",true);
$('.localRequired').attr("required", true);
$('.orgAreaRequired').attr("required", true);
};
// 强制刷新机构控件里的机构
......@@ -592,8 +591,230 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.nationalEconomicIndustryList = constant.NationalEconomicIndustryList;
$scope.trueFalse = constant.trueFalse;
$scope.countryCNList = constant.countryCNList;
$('.localRequired').attr("required",true);
$('.orgAreaRequired').attr("required",true);
$('.localRequired').attr("required", true);
$('.orgAreaRequired').attr("required", true);
$scope.equityGridOptions = {
bindingOptions: {
dataSource: 'shareholderDatasource'
},
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
keyExpr: "id",
columns: [
{
dataField: "investment_entity_id",
allowHeaderFiltering: false,
caption: $translate.instant('InvestmentEntity'),
calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) {
// return item.value == data.importType;
// });
// if (importType1) {
// return importType1.name;
// } else {
// return '未知';
// }
}
},
{
dataField: "ownershipForm",
allowHeaderFiltering: false,
caption: $translate.instant('ownershipForm'),
},
{
dataField: "commonPreferred",
allowHeaderFiltering: false,
caption: $translate.instant('CommonPreferred'),
calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) {
// return item.value == data.importType;
// });
// if (importType1) {
// return importType1.name;
// } else {
// return '未知';
// }
}
},
{
dataField: "classOfShares",
allowHeaderFiltering: false,
caption: $translate.instant('classOfShares'),
},
{
dataField: "votingPercentage",
allowHeaderFiltering: false,
caption: $translate.instant('votingPercentage'),
},
{
dataField: "id",
allowHeaderFiltering: false,
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editShareholder(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;')
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteShareholder(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
$log.error(e);
}
}
}
],
onContentReady: function (e) {
$scope.shareholderGridInstance = e.component;
},
loadPanel: {
enabled: false
},
selection: {
mode: "single"
},
grouping: {
autoExpandAll: false
},
allowColumnResizing: true,
columnAutoWidth: true,
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
placeholder: $translate.instant('Search'),
width: 518,
visible: false
},
headerFilter: {
visible: false,
texts: {
cancel: $translate.instant('Cancel'),
ok: $translate.instant('Confirm'),
emptyValue: $translate.instant('Empty'),
selectAllText: $translate.instant('SelectAll')
}
}
};
$scope.directorGridOptions = {
bindingOptions: {
dataSource: 'directorDatasource'
},
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
keyExpr: "id",
columns: [
{
dataField: "director_name",
allowHeaderFiltering: false,
caption: $translate.instant('director_name')
},
{
dataField: "residency",
allowHeaderFiltering: false,
caption: $translate.instant('residency'),
},
{
dataField: "date_of_appointment",
allowHeaderFiltering: false,
caption: $translate.instant('date_of_appointment'),
calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) {
// return item.value == data.importType;
// });
// if (importType1) {
// return importType1.name;
// } else {
// return '未知';
// }
}
},
{
dataField: "date_of_resignation",
allowHeaderFiltering: false,
caption: $translate.instant('date_of_resignation'),
},
{
dataField: "is_executive",
allowHeaderFiltering: false,
caption: $translate.instant('is_executive'),
},
{
dataField: "other_roles",
allowHeaderFiltering: false,
caption: $translate.instant('other_roles'),
},
{
dataField: "id",
allowHeaderFiltering: false,
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editDirector(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;')
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteDirector(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
$log.error(e);
}
}
}
],
onContentReady: function (e) {
$scope.directorGridInstance = e.component;
},
loadPanel: {
enabled: false
},
selection: {
mode: "single"
},
grouping: {
autoExpandAll: false
},
allowColumnResizing: true,
columnAutoWidth: true,
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
placeholder: $translate.instant('Search'),
width: 518,
visible: false
},
headerFilter: {
visible: false,
texts: {
cancel: $translate.instant('Cancel'),
ok: $translate.instant('Confirm'),
emptyValue: $translate.instant('Empty'),
selectAllText: $translate.instant('SelectAll')
}
}
};
// $('.localRequired').attr("required","true"); required="required"
};
......
......@@ -13,13 +13,13 @@
<ul class="nav nav-tabs">
<li class="active">
<a href="#basicdata" data-toggle="tab">
{{'OrganizationBasicData' | translate}}
{{'FundamentalInfo' | translate}}
<span class="glyphicon glyphicon-exclamation-sign" ng-if="isShowBasic"></span>
</a>
</li>
<li>
<a href="#advancedOptions" data-toggle="tab">
{{'OrganizationAdvancedOptions' | translate}}
{{'ShareholderInfo' | translate}}
<span class="glyphicon glyphicon-exclamation-sign" ng-if="isShowAdvanced"></span>
</a>
</li>
......@@ -30,7 +30,7 @@
<form class="form-horizontal" id="orgControlForm" name="orgControlForm">
<div class="local">
<div style="margin-left: 20px;margin-top: 20px">
<span style="font-weight: bold;font-size: large;">{{'entityInfo'|translate}}</span>
<span style="font-weight: bold;font-size: large;">{{'EntityInfo'|translate}}</span>
</div>
<div class="bottom-row">
<div class="quarter-div leftUp">
......@@ -129,8 +129,7 @@
<div class="quarter-div rightUp">
<!--businessLicense-->
<div class="form-group">
<label for="businessLicense" class="col-sm-3 control-label"><span
class="must-input">*</span>{{'businessLicense' | translate}}:</label>
<label for="businessLicense" class="col-sm-3 control-label"><span class="must-input">*</span>{{'businessLicense' | translate}}:</label>
<div class="col-sm-9"
ng-class="{'has-error':orgControlForm.businessLicense.$invalid && (orgControlForm.businessLicense.$dirty || orgControlForm.$submitted)}">
<input class="form-control localRequired" name="businessLicense"
......@@ -240,18 +239,10 @@
<!--Equity information-->
<div class="label-current-holding">
<label class="basic-label" style="font-weight: bold;font-size: large;">{{'ShareHolder' | translate}}</label>
</div>
<div class="right-option">
<button type="button" class="btn btn-in-grid" style="width: 117px;" ng-click="addEquity()">
<button type="button" class="btn btn-in-grid" style="width: 117px;float:right" ng-click="addEquity()">
<i class="material-icons middle">create</i>{{'Create' | translate}}
</button>
</div>
<div class="current-holding-info">
<span class="control-label"><strong
class="label label-default"
title="{{EquitySumInfo.orgTotal}}"></strong>
</span>
</div>
<div class="dx-viewport grid-container">
<div id="equityGridContainer" dx-data-grid="equityGridOptions" style="margin-top: 10px;">
</div>
......@@ -260,18 +251,10 @@
<!--Direcotr information-->
<div class="label-director">
<label class="basic-label" style="font-weight: bold;font-size: large;">{{'DirectorInfo' | translate}}</label>
</div>
<div class="right-option">
<button type="button" class="btn btn-in-grid" style="width: 117px;" ng-click="addDirector()">
<button type="button" class="btn btn-in-grid" style="width: 117px;float:right" ng-click="addDirector()">
<i class="material-icons middle">create</i>{{'Create' | translate}}
</button>
</div>
<div class="current-holding-info">
<span class="control-label"><strong
class="label label-default"
title="{{DirectorList.length}}"></strong>
</span>
</div>
<div class="dx-viewport grid-container">
<div id="DirectorGridContainer" dx-data-grid="directorGridOptions" style="margin-top: 10px;">
</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