123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- $(function() {
- 'use strict';
- BemsWebApplication.Popup.RejectExecutionPlan = {
- create: function(viewModel) {
- var handleUpdate = viewModel.update,
- dataModel = viewModel.dataModel,
- popup = viewModel.popup;
-
- var popupVisible = ko.observable(false),
- toolbarItems = [
- { location: 'before', text: $G('rejctReason') },
- { location: 'after', widget: 'button', options: { text: $G('save'), icon: 'save', clickAction: handleSave } },
- { location: 'after', widget: 'button', options: { text: $G('close'), icon: 'close', clickAction: handleClose } }
- ],
- popupOptions = {
- width: '520px',
- height: 'auto',
- //shading: false,
- shadingColor: 'rgba(0,0,0,0.0)',
- visible: popupVisible,
- closeOnOutsideClick: false,
- animation: utils.popup.createAnimation()
- };
- function handleSave() {
-
- if (_.isEmpty(dataModel.RejectReason())) {
- utils.toast.show('반려사유는 필수입력 사항입니다.', 'error');
- return;
- }
- dataModel.RejectUserName(BWA.UserInfo.Name());
- dataModel.RejectUserId(BWA.UserInfo.UserId());
- dataModel.RejectDate(new Date());
- dataModel.WorkProgressId($Code.WorkProgress.WORK_POSTPONE);
- // popup.isReject(true);
- popupVisible(false);
- handleUpdate();
- }
-
- function handleClose() {
- dataModel.RejectReason(undefined);
- popupVisible(false);
- }
- return {
- popupOptions: popupOptions,
- toolbarItems: toolbarItems,
- show: function() {
- popupVisible(true);
- },
- hide: function() {
-
- popupVisible(false);
- }
- };
- }
- }
- });
|