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 ...@@ -68,10 +68,13 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
private boolean insertAction(CalendarActionDto dto) { private boolean insertAction(CalendarActionDto dto) {
Date createTime = new Date(); Date createTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto); CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setStatus((byte) 1);
action.setId(idService.nextId()); action.setId(idService.nextId());
action.setCreateTime(createTime); action.setCreateTime(createTime);
action.setUpdateTime(createTime); action.setUpdateTime(createTime);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList(); List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>(); List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
List<CalendarActionJurisdictionRelationship> relationshipList = new ArrayList<>(); List<CalendarActionJurisdictionRelationship> relationshipList = new ArrayList<>();
...@@ -108,7 +111,6 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA ...@@ -108,7 +111,6 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
Date updateTime = new Date(); Date updateTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto); CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setUpdateTime(updateTime); action.setUpdateTime(updateTime);
action.setStatus((byte) 1);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList(); List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>(); List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
......
...@@ -193,7 +193,26 @@ ...@@ -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) { calendarActionService.deleteCalendarAction(action.id).success(function (result) {
if (result.result) { if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess')); SweetAlert.success($translate.instant('CommonSuccess'));
...@@ -202,11 +221,31 @@ ...@@ -202,11 +221,31 @@
} else { } else {
SweetAlert.warning($translate.instant('SystemException')); SweetAlert.warning($translate.instant('SystemException'));
} }
}).error(function () {
SweetAlert.warning($translate.instant('SystemException'));
}); });
}; };
$scope.addAction = function () { $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 弹框相关 //action detail 弹框相关
...@@ -216,19 +255,17 @@ ...@@ -216,19 +255,17 @@
$scope.cancelActionText = textConfig.cancelText; $scope.cancelActionText = textConfig.cancelText;
$scope.saveActionText = textConfig.createText; $scope.saveActionText = textConfig.createText;
var actionModel = {}; var actionModel = {};
if (type === "Edit") {
$scope.title = action ? "Edit Action" : "Add Action";
actionModel = angular.copy(action); actionModel = angular.copy(action);
if (type === "Edit") {
$scope.title = "Edit Action";
$scope.saveActionText = textConfig.saveText; $scope.saveActionText = textConfig.saveText;
} else if (type === "Show") { } else if (type === "Show") {
actionModel = angular.copy(action);
$scope.title = "Action Details"; $scope.title = "Action Details";
$scope.actionReadOnly = true; $scope.actionReadOnly = true;
$scope.cancelActionText = textConfig.confirmText; $scope.cancelActionText = textConfig.confirmText;
} else if (type === "Add") { } else if (type === "Add") {
actionModel = angular.copy(action);
$scope.title = "Create Action"; $scope.title = "Create Action";
$scope.cancelActionText = textConfig.createText;
} else { } else {
return; return;
} }
...@@ -237,9 +274,15 @@ ...@@ -237,9 +274,15 @@
return; return;
} }
var formInstance;
$scope.formOptions = { $scope.formOptions = {
formData: actionModel, formData: actionModel,
readOnly: $scope.actionReadOnly, readOnly: $scope.actionReadOnly,
showColonAfterLabel: true,
validationGroup: "actionData",
onInitialized: function(e) {
formInstance = e.component;
},
items: [ items: [
{ {
colSpan: 2, colSpan: 2,
...@@ -395,7 +438,15 @@ ...@@ -395,7 +438,15 @@
}; };
$scope.saveAction = function () { $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) { calendarActionService.saveCalendarAction(actionModel).success(function (result) {
if (result.result) { if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess')); SweetAlert.success($translate.instant('CommonSuccess'));
...@@ -423,7 +474,9 @@ ...@@ -423,7 +474,9 @@
refreshTaskTypeList(); refreshTaskTypeList();
}; };
$scope.refreshAll = {}; $scope.refreshAll = function () {
refreshAll();
};
var textConfig = { var textConfig = {
confirmText: $translate.instant('ButtonConfirm'), confirmText: $translate.instant('ButtonConfirm'),
...@@ -434,7 +487,6 @@ ...@@ -434,7 +487,6 @@
}; };
(function () { (function () {
$scope.refreshAll = refreshAll();
refreshAll(); refreshAll();
})(); })();
......
<div id="calendar-action"> <div id="calendar-action">
<div class="calendar-action-Head">{{'CalendarActionHead'|translate}}</div> <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 class="calendar-action-container"> <div class="calendar-action-container">
<div id="data-grid-action"> <div id="data-grid-action">
<div> <div>
...@@ -38,31 +52,40 @@ ...@@ -38,31 +52,40 @@
<td>{{getTriggerName(action.triggerId)}}</td> <td>{{getTriggerName(action.triggerId)}}</td>
<td>{{getTaskTypeName(action.taskTypeId)}}</td> <td>{{getTaskTypeName(action.taskTypeId)}}</td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[0].status == 1}}, readOnly:true}"/></td> <td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[0].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[0].description}}</td> <td>{{action.jurisdictionDtoList[0].description}}</td>
<td> <td>
<div class="logic-num">{{action.jurisdictionDtoList[0].logicNum}}</div> <div class="logic-num">{{action.jurisdictionDtoList[0].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[0].logicUnit)}}</div> <div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[0].logicUnit)}}
</div>
</td> </td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[1].status == 1}}, readOnly:true}"/></td> <td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[1].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[1].description}}</td> <td>{{action.jurisdictionDtoList[1].description}}</td>
<td> <td>
<div class="logic-num">{{action.jurisdictionDtoList[1].logicNum}}</div> <div class="logic-num">{{action.jurisdictionDtoList[1].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[1].logicUnit)}}</div> <div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[1].logicUnit)}}
</div>
</td> </td>
<td><div dx-check-box="{ value: {{action.jurisdictionDtoList[2].status == 1}}, readOnly:true}"/></td> <td>
<div dx-check-box="{ value: {{action.jurisdictionDtoList[2].status == 1}}, readOnly:true}"/>
</td>
<td>{{action.jurisdictionDtoList[2].description}}</td> <td>{{action.jurisdictionDtoList[2].description}}</td>
<td> <td>
<div class="logic-num">{{action.jurisdictionDtoList[2].logicNum}}</div> <div class="logic-num">{{action.jurisdictionDtoList[2].logicNum}}</div>
<div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[2].logicUnit)}}</div> <div class="logic-unit">{{getLogicUnitName(action.jurisdictionDtoList[2].logicUnit)}}
</div>
</td> </td>
<td class="operation-button"> <td class="operation-button">
<span ng-click="editAction(action, 'Show')">Detail</span> <span ng-click="editAction(action, 'Show')">Detail</span>
<span ng-click="editAction(action, 'Edit')">Edit</span> <span ng-click="editAction(action, 'Edit')">Edit</span>
<span ng-click="deleteAction(action)">Delete</span> <span ng-click="confirmDelete(action)">Delete</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -93,8 +116,11 @@ ...@@ -93,8 +116,11 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="hideEditTaskTypeListPanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button> <button ng-click="hideEditTaskTypeListPanel();" class="btn btn-default btn-gray">{{'Cancel' |
<button ng-click="editTaskType();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}</button> translate}}
</button>
<button ng-click="editTaskType();" class="btn btn-default btn-red">{{'NewTaxCalendar' | translate}}
</button>
</div> </div>
</script> </script>
...@@ -102,7 +128,8 @@ ...@@ -102,7 +128,8 @@
<div id="edit-task-type"></div> <div id="edit-task-type"></div>
<script type="text/ng-template" class="content" id="edit-task-type.html"> <script type="text/ng-template" class="content" id="edit-task-type.html">
<div class="modal-header"> <div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditTaskTypePanel()">&times;</span> <span class="close" data-dismiss="modal" aria-hidden="true"
ng-click="hideEditTaskTypePanel()">&times;</span>
<h4 class="modal-title"> <h4 class="modal-title">
<i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i> <i style="color: #b22;font-size: 23px; cursor: pointer;" class="fa fa-pencil"></i>
...@@ -118,27 +145,32 @@ ...@@ -118,27 +145,32 @@
</span> </span>
</div> </div>
<div class="col-lg-9"> <div class="col-lg-9">
<div class="box-font" dx-text-box="{}" dx-validator="validateOption.taskTypeText" ng-model="editTaskTypeEntity.name"></div> <div class="box-font" dx-text-box="{}" dx-validator="validateOption.taskTypeText"
ng-model="editTaskTypeEntity.name"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="hideEditTaskTypePanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}</button> <button ng-click="hideEditTaskTypePanel();" class="btn btn-default btn-gray">{{'Cancel' | translate}}
<button ng-click="confirmSubmitTaskType();" class="btn btn-default btn-red">{{'Confirm' | translate}}</button> </button>
<button ng-click="confirmSubmitTaskType();" class="btn btn-default btn-red">{{'Confirm' | translate}}
</button>
</div> </div>
</script> </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> <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> <div id="edit-action-pop"></div>
<script type="text/ng-template" class="content" id="edit-action-pop.html"> <script type="text/ng-template" class="content" id="edit-action-pop.html">
<div class="modal-header"> <div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true" ng-click="hideEditActionPanel()">&times;</span> <span class="close" data-dismiss="modal" aria-hidden="true"
ng-click="hideEditActionPanel()">&times;</span>
<div class="long-title"><h3>{{title}}</h3></div> <div class="long-title"><h3>{{title}}</h3></div>
</div> </div>
...@@ -152,10 +184,13 @@ ...@@ -152,10 +184,13 @@
<div class="modal-footer"> <div class="modal-footer">
<button ng-click="hideEditActionPanel();" class="btn btn-default btn-gray">{{cancelActionText}}</button> <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> <button ng-show="!actionReadOnly" ng-click="saveAction();" class="btn btn-default btn-red">
{{saveActionText}}
</button>
</div> </div>
</script> </script>
</div> </div>
</div>
\ No newline at end of file
...@@ -32,6 +32,38 @@ ...@@ -32,6 +32,38 @@
font-size: larger; 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 { #table-body {
background-color: #ffffff; background-color: #ffffff;
} }
...@@ -45,7 +77,7 @@ ...@@ -45,7 +77,7 @@
} }
#table-body .dx-checkbox-icon { #table-body .dx-checkbox-icon {
background: #bbb; border-color: #bbb;
} }
#table-body .logic-num { #table-body .logic-num {
......
...@@ -1741,6 +1741,9 @@ constant.trigger = { ...@@ -1741,6 +1741,9 @@ constant.trigger = {
logicUnit: [ logicUnit: [
{ {
id: 0,
name: "N/A"
}, {
id: 1, id: 1,
name: "Calendar Day" name: "Calendar Day"
}, { }, {
...@@ -1750,7 +1753,7 @@ constant.trigger = { ...@@ -1750,7 +1753,7 @@ constant.trigger = {
id: 3, id: 3,
name: "Month" name: "Month"
}, { }, {
id: 3, id: 4,
name: "Year" 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