Commit 98affeeb authored by Mccoy Z Xia's avatar Mccoy Z Xia

calendar action 页面调整

parent a1553a9a
......@@ -68,10 +68,13 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
private boolean insertAction(CalendarActionDto dto) {
Date createTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setStatus((byte) 1);
action.setId(idService.nextId());
action.setCreateTime(createTime);
action.setUpdateTime(createTime);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
List<CalendarActionJurisdictionRelationship> relationshipList = new ArrayList<>();
......@@ -108,7 +111,6 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
Date updateTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setUpdateTime(updateTime);
action.setStatus((byte) 1);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
......
......@@ -193,7 +193,26 @@
};
$scope.deleteAction = function (action) {
// 删除确认
$scope.confirmDelete = function (action) {
SweetAlert.swal({
title: $translate.instant('Confirm') + " " + $translate.instant('Delete') + '?',
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
deleteAction(action);
}
});
}
var deleteAction = function (action) {
calendarActionService.deleteCalendarAction(action.id).success(function (result) {
if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess'));
......@@ -202,11 +221,31 @@
} else {
SweetAlert.warning($translate.instant('SystemException'));
}
}).error(function () {
SweetAlert.warning($translate.instant('SystemException'));
});
};
$scope.addAction = function () {
var newAction = {
status: 0,
jurisdictionDtoList: [
{
area: 1,
logicNum: 0,
logicUnit: 0
}, {
area: 2,
logicNum: 0,
logicUnit: 0
}, {
area: 3,
logicNum: 0,
logicUnit: 0
}
]
};
$scope.editAction(newAction, "Add");
};
//action detail 弹框相关
......@@ -216,19 +255,17 @@
$scope.cancelActionText = textConfig.cancelText;
$scope.saveActionText = textConfig.createText;
var actionModel = {};
actionModel = angular.copy(action);
if (type === "Edit") {
$scope.title = action ? "Edit Action" : "Add Action";
actionModel = angular.copy(action);
$scope.title = "Edit Action";
$scope.saveActionText = textConfig.saveText;
} else if (type === "Show") {
actionModel = angular.copy(action);
$scope.title = "Action Details";
$scope.actionReadOnly = true;
$scope.cancelActionText = textConfig.confirmText;
} else if (type === "Add") {
actionModel = angular.copy(action);
$scope.title = "Create Action";
$scope.cancelActionText = textConfig.createText;
} else {
return;
}
......@@ -237,9 +274,15 @@
return;
}
var formInstance;
$scope.formOptions = {
formData: actionModel,
readOnly: $scope.actionReadOnly,
showColonAfterLabel: true,
validationGroup: "actionData",
onInitialized: function(e) {
formInstance = e.component;
},
items: [
{
colSpan: 2,
......@@ -395,7 +438,15 @@
};
$scope.saveAction = function () {
actionModel.status = actionModel.status ? "1" : "0";
var dxResult = DevExpress.validationEngine.validateGroup("actionData").isValid;
if (!dxResult) {
return;
}
actionModel.jurisdictionDtoList.forEach(function (value) {
value.status = value.status ? "1" : "0";
});
calendarActionService.saveCalendarAction(actionModel).success(function (result) {
if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess'));
......@@ -423,7 +474,9 @@
refreshTaskTypeList();
};
$scope.refreshAll = {};
$scope.refreshAll = function () {
refreshAll();
};
var textConfig = {
confirmText: $translate.instant('ButtonConfirm'),
......@@ -434,7 +487,6 @@
};
(function () {
$scope.refreshAll = refreshAll();
refreshAll();
})();
......
<div id="calendar-action">
<div class="calendar-action-Head">{{'CalendarActionHead'|translate}}</div>
<div class="action-title">
<div style="float: left;font-weight: bolder;">
<i class="fa fa-building-o" style="font-size: 40px;"></i>
<span style="font-size: x-large;margin: 0 15px;">Action List</span>
<span class="new-action" ng-click="addAction()">+ New Action</span>
</div>
<div class="action-refresh" ng-click="refreshAll()">
<i class="fa fa-refresh"></i>
Refresh
</div>
</div>
<div class="calendar-action-container">
<div id="data-grid-action">
<div>
<table id="data-table">
<thead id="table-head">
<tr>
<th rowspan="3">Action Item Name</th>
<th rowspan="3">Trigger</th>
<th rowspan="3">
Type of Tasks
<div id="editTaskType" ng-click="editTaskTypeList();">Edit</div>
</th>
<th colspan="9">Jurisdiction of Formation</th>
<th rowspan="3" style="width: 120px;">Operation</th>
</tr>
<tr>
<th colspan="3">Hong Kong</th>
<th colspan="3">BVI</th>
<th colspan="3">Cayman Islands</th>
</tr>
<tr>
<th>Valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
<th>valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
<th>valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
</tr>
</thead>
<tbody id="table-body">
<tr ng-repeat="action in actionList track by $index">
<td>{{action.name}}</td>
<td>{{getTriggerName(action.triggerId)}}</td>
<td>{{getTaskTypeName(action.taskTypeId)}}</td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[0].status == 1}}, readOnly:true}"/></td>
<td>{{action.jurisdictionDtoList[0].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[0].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[0].logicUnit)}}</div>
</td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[1].status == 1}}, readOnly:true}"/></td>
<td>{{action.jurisdictionDtoList[1].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[1].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[1].logicUnit)}}</div>
</td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[2].status == 1}}, readOnly:true}"/></td>
<td>{{action.jurisdictionDtoList[2].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[2].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[2].logicUnit)}}</div>
</td>
<td class="operation-button">
<span ng-click="editAction(action, 'Show')">Detail</span>
<span ng-click="editAction(action, 'Edit')">Edit</span>
<span ng-click="deleteAction(action)">Delete</span>
</td>
</tr>
</tbody>
</table>
<div class="calendar-action-container">
<div id="data-grid-action">
<div>
<table id="data-table">
<thead id="table-head">
<tr>
<th rowspan="3">Action Item Name</th>
<th rowspan="3">Trigger</th>
<th rowspan="3">
Type of Tasks
<div id="editTaskType" ng-click="editTaskTypeList();">Edit</div>
</th>
<th colspan="9">Jurisdiction of Formation</th>
<th rowspan="3" style="width: 120px;">Operation</th>
</tr>
<tr>
<th colspan="3">Hong Kong</th>
<th colspan="3">BVI</th>
<th colspan="3">Cayman Islands</th>
</tr>
<tr>
<th>Valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
<th>valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
<th>valid</th>
<th>Description</th>
<th style="width: 150px;">Logic</th>
</tr>
</thead>
<tbody id="table-body">
<tr ng-repeat="action in actionList track by $index">
<td>{{action.name}}</td>
<td>{{getTriggerName(action.triggerId)}}</td>
<td>{{getTaskTypeName(action.taskTypeId)}}</td>
<td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[0].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[0].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[0].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[0].logicUnit)}}
</div>
</td>
<td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[1].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[1].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[1].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[1].logicUnit)}}
</div>
</td>
<td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[2].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[2].description}}</td>
<td>
<div class="logic-num">{{action.jurisdictionDtoList[2].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[2].logicUnit)}}
</div>
</td>
<td class="operation-button">
<span ng-click="editAction(action, 'Show')">Detail</span>
<span ng-click="editAction(action, 'Edit')">Edit</span>
<span ng-click="confirmDelete(action)">Delete</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="edit-task-type-pop"></div>
<script type="text/ng-template" class="content" id="edit-task-type-pop.html">
<div id="edit-task-type-pop"></div>
<script type="text/ng-template" class="content" id="edit-task-type-pop.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypeListPanel()">&times;</span>
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypeListPanel()">&times;</span>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{'EditTaxProject' | translate}}
</h4>
</div>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{'EditTaxProject' | translate}}
</h4>
</div>
<div class="modal-body">
<div class="row pop-grid-container">
<div class="col-md-12">
<div dx-data-grid="taskTypeGridOptions"></div>
<div class="modal-body">
<div class="row pop-grid-container">
<div class="col-md-12">
<div dx-data-grid="taskTypeGridOptions"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditTaskTypeListPanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button>
<button ng-click="editTaskType();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}</button>
</div>
<div class="modal-footer">
<button ng-click="hideEditTaskTypeListPanel();" class="btn btn-default btn-gray">{{'Cancel' |
translate}}
</button>
<button ng-click="editTaskType();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}
</button>
</div>
</script>
</script>
<div id="edit-task-type"></div>
<script type="text/ng-template" class="content" id="edit-task-type.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypePanel()">&times;</span>
<div id="edit-task-type"></div>
<script type="text/ng-template" class="content" id="edit-task-type.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true"
ng-click="hideEditTaskTypePanel()">&times;</span>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{editTaskTypeTitle}}
</h4>
</div>
<h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
&nbsp;{{editTaskTypeTitle}}
</h4>
</div>
<div class="modal-body" id="editTaskTypeForm" dx-validation-group="{}">
<div class="row">
<div class="col-lg-3">
<div class="modal-body" id="editTaskTypeForm" dx-validation-group="{}">
<div class="row">
<div class="col-lg-3">
<span class="form-title">
{{'TaxEvent' | translate}}
</span>
</div>
<div class="col-lg-9">
<div class="box-font" dx-text-box="{}" dx-validator="validateOption.taskTypeText" ng-model="editTaskTypeEntity.name"></div>
</div>
<div class="col-lg-9">
<div class="box-font" dx-text-box="{}" dx-validator="validateOption.taskTypeText"
ng-model="editTaskTypeEntity.name"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditTaskTypePanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button>
<button ng-click="confirmSubmitTaskType();" class="btn btn-default btn-red">{{'Confirm' | translate}}</button>
</div>
</script>
<div class="modal-footer">
<button ng-click="hideEditTaskTypePanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}
</button>
<button ng-click="confirmSubmitTaskType();" class="btn btn-default btn-red">{{'Confirm' | translate}}
</button>
</div>
<edit-calendar-action-modal is-show="showEditModal" parent-page=".calendar-action-container" operate-type="orgOperateType" is-update="isOrgUpdate" selected-organization="selectedOrg"></edit-calendar-action-modal>
</script>
<edit-calendar-action-modal is-show="showEditModal" parent-page=".calendar-action-container"
operate-type="orgOperateType" is-update="isOrgUpdate"
selected-organization="selectedOrg"></edit-calendar-action-modal>
<div id="edit-action-pop"></div>
<script type="text/ng-template" class="content" id="edit-action-pop.html">
<div id="edit-action-pop"></div>
<script type="text/ng-template" class="content" id="edit-action-pop.html">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditActionPanel()">&times;</span>
<div class="long-title"><h3>{{title}}</h3></div>
</div>
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true"
ng-click="hideEditActionPanel()">&times;</span>
<div class="long-title"><h3>{{title}}</h3></div>
</div>
<div class="modal-body">
<div id="myTabContent" class="tab-content">
<div id="form-container">
<div id="editActionForm" dx-form="formOptions"></div>
<div class="modal-body">
<div id="myTabContent" class="tab-content">
<div id="form-container">
<div id="editActionForm" dx-form="formOptions"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="hideEditActionPanel();" class="btn btn-default btn-gray">{{cancelActionText}}</button>
<button ng-show="!actionReadOnly" ng-click="saveAction();" class="btn btn-default btn-red">{{saveActionText}}</button>
</div>
<div class="modal-footer">
<button ng-click="hideEditActionPanel();" class="btn btn-default btn-gray">{{cancelActionText}}</button>
<button ng-show="!actionReadOnly" ng-click="saveAction();" class="btn btn-default btn-red">
{{saveActionText}}
</button>
</div>
</script>
</script>
</div>
</div>
</div>
\ No newline at end of file
......@@ -32,6 +32,38 @@
font-size: larger;
}
.action-title {
width: 96%;
margin: 2% 2%;
padding-bottom: 15px;
}
.new-action {
display: block;
margin: 15px 25px;
font-size: inherit;
color: red;
outline: none;
}
.action-refresh {
float: right;
color: rgba(0, 0, 0, 0.66);
border: 2px solid rgba(0, 0, 0, 0.4);
border-radius: 8px;
height: 45px;
width: 120px;
font-size: 19px;
text-align: center;
line-height: 45px;
outline: none;
}
.action-refresh i {
margin-right: 7px;
font-size: 23px;
}
#table-body {
background-color: #ffffff;
}
......@@ -45,7 +77,7 @@
}
#table-body .dx-checkbox-icon {
background: #bbb;
border-color: #bbb;
}
#table-body .logic-num {
......
......@@ -1741,6 +1741,9 @@ constant.trigger = {
logicUnit: [
{
id: 0,
name: "N/A"
}, {
id: 1,
name: "Calendar Day"
}, {
......@@ -1750,7 +1753,7 @@ constant.trigger = {
id: 3,
name: "Month"
}, {
id: 3,
id: 4,
name: "Year"
}
]
......
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