/webccr/src/com/emis/caesar/senao/notiy/TUserInterfaceNotify.java
Java | 1349 lines | 988 code | 72 blank | 289 comment | 113 complexity | c640a292d1103512bd12da4e1637181a MD5 | raw file
- package com.emis.caesar.senao.notiy;
- import com.emis.caesar.senao.data.TEntryEdit;
- import com.emis.caesar.senao.data.TEntryEdits;
- import com.emis.caesar.senao.data.TLoginData;
- import com.emis.caesar.senao.event.TButtonEventContext;
- import com.emis.caesar.senao.event.TEventContext;
- import com.emis.caesar.senao.event.button.*;
- import com.emis.caesar.senao.unit.*;
- import com.emis.caesar.senao.unit.sale.TInvoice;
- import com.emis.caesar.senao.unit.sale.TMember;
- import com.emis.caesar.senao.unit.sale.TPayment;
- import com.emis.caesar.senao.unit.sale.TSaleItem;
- import com.emis.caesar.senao.util.CcrUtil;
- import com.emis.caesarui.webccr.core.PromotionInfoList;
- import com.emis.caesarui.webccr.ui.table.TSalePayTable;
- import com.emis.caesarui.webccr.ui.table.TSalesTable;
- import com.emis.caesarui.webccr.ui.window.*;
- import com.emis.caesarui.webccr.webccr;
- import com.emis.user.emisAuthFactory;
- import com.emis.util.emisUtil;
- import com.vaadin.event.FieldEvents;
- import com.vaadin.server.Page;
- import com.vaadin.server.VaadinService;
- import com.vaadin.server.VaadinSession;
- import com.vaadin.server.WrappedSession;
- import com.vaadin.ui.*;
- import de.steinwedel.messagebox.ButtonOption;
- import de.steinwedel.messagebox.MessageBox;
- import java.util.ArrayList;
- public class TUserInterfaceNotify {
- TCcr FoCcr = null;
- public TUserInterfaceNotify(TCcr oCcr_) {
- overWriteCcr(oCcr_);
- }
- //
- public void overWriteCcr(TCcr oCcr_) {
- FoCcr = oCcr_;
- }
- // 多個條件顯示本來得P_NO
- public void swEntryEdits(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- swEntryEdits(oEdits_, oEvent_, sOkMethod_, sCancelMethod_, "");
- }
- /**
- * 建立一個可動態大小的視窗, 依_oEdits筆數, 建立一個STRING GRID.2欄, 一欄取得TEntryEdit的caption , 一欄輸入
- * 按下確定後. 執行oEvent_ .runEventMethod( _sOkMethod), 按下取消, 則呼叫oEvent_的oEvent_ .runEventMethod(_sCancelMethod_)
- *
- * @param oEdits_
- * @param oEvent_
- * @param sOkMethod_
- * @param sCancelMethod_
- */
- public void swEntryEdits(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sCondition) {
- WinInputText _oInput = new WinInputText(oEdits_, oEvent_, sOkMethod_, sCancelMethod_, sCondition);
- _oInput.setModal(true);
- _oInput.setResizable(false);
- _oInput.setWidth("650px");
- _oInput.setClosable(false);
- _oInput.addStyleName("v-scrollable");
- int _iEditCnt = oEdits_.getEditCount();
- if (_iEditCnt > 0 && _iEditCnt > 12) {
- _oInput.setHeight((14 * 70) + "px");
- } else if (_iEditCnt > 0) {
- _oInput.setHeight(((_iEditCnt + 2) * 70) + "px");
- } else {
- _oInput.setHeight("70px");
- }
- UI.getCurrent().addWindow(_oInput);
- _oInput.addFocusListener(new FieldEvents.FocusListener() {
- @Override
- public void focus(FieldEvents.FocusEvent event) {
- _oInput.TextList.get(0).focus();
- }
- });
- _oInput.addCloseListener(new Window.CloseListener(){
- @Override
- public void windowClose(Window.CloseEvent e) {
- if (( UI.getCurrent() instanceof webccr)) {
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
- // "Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- CcrUtil.setMessage("Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- ((webccr) UI.getCurrent()).getInputLabel().focus();
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
- // "After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- CcrUtil.setMessage("After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- }
- }
- });
- }
- //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
- public void swEntryEdits_COUPON(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_) {
- WinInputText_COUPON _oInput = new WinInputText_COUPON(oEdits_, oEvent_, sOkMethod_);
- _oInput.setModal(true);
- _oInput.setResizable(false);
- _oInput.setWidth("650px");
- _oInput.setClosable(false);
- _oInput.addStyleName("v-scrollable");
- int _iEditCnt = oEdits_.getEditCount();
- if (_iEditCnt > 0 && _iEditCnt > 12) {
- _oInput.setHeight((14 * 70) + "px");
- } else if (_iEditCnt > 0) {
- _oInput.setHeight(((_iEditCnt + 2) * 70) + "px");
- } else {
- _oInput.setHeight("70px");
- }
- UI.getCurrent().addWindow(_oInput);
- _oInput.addFocusListener(new FieldEvents.FocusListener() {
- @Override
- public void focus(FieldEvents.FocusEvent event) {
- _oInput.TextList.get(0).focus();
- }
- });
- _oInput.addCloseListener(new Window.CloseListener(){
- @Override
- public void windowClose(Window.CloseEvent e) {
- if (( UI.getCurrent() instanceof webccr)) {
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
- // "Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- CcrUtil.setMessage("Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- ((webccr) UI.getCurrent()).getInputLabel().focus();
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
- // "After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- CcrUtil.setMessage("After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
- }
- }
- });
- }
- /**
- * 彈出顯示YES/NO, 訊息為sMsg_的子視窗, YES/NO按鍵的預設位置由bDefaultYes控制
- * 按下YES後. 執行oEvent_ .runEventMethod( sYesMethod_),
- * 按下NOP 則呼叫oEvent_的oEvent_ .runEventMethod(_sNoMethod_)
- *
- * @param bDefaultYes
- * @param sMsg_
- * @param oEvent_
- * @param sYesMethod_
- * @param sNoMethod_
- */
- public void askYesOrNo(boolean bDefaultYes, String sMsg_, TEventContext oEvent_, String sYesMethod_, String sNoMethod_) {
- MessageBox _oMsgBox = MessageBox.createInfo();
- _oMsgBox.withCaption("訊息")
- .withMessage(sMsg_);
- if (bDefaultYes) {
- _oMsgBox.withYesButton(() -> {
- oEvent_.runEventMethod(sYesMethod_);
- }, ButtonOption.focus())
- .withNoButton(() -> {
- oEvent_.runEventMethod(sNoMethod_);
- })
- .open();
- } else {
- _oMsgBox.withYesButton(() -> {
- oEvent_.runEventMethod(sYesMethod_);
- })
- .withNoButton(() -> {
- oEvent_.runEventMethod(sNoMethod_);
- }, ButtonOption.focus())
- .open();
- }
- }
- /**
- * 切換按鍵頁面. 第iBtnPanel_塊功能面版, 切換至指定iBtnPage_頁面
- *
- * @param sBtnPanel_
- * @param iBtnPage_
- */
- public void moveToBtnPage(String sBtnPanel_, int iBtnPage_) {
- webccr _oUI = (webccr) UI.getCurrent();
- if (iBtnPage_ == 0 || iBtnPage_ < 0) return; // 為0則表示不換頁
- if ("T".equals(sBtnPanel_)) {
- _oUI.changeTopButton(iBtnPage_ - 1);
- } else if ("B".equals(sBtnPanel_)) {
- _oUI.changeButton(iBtnPage_ - 1);
- }
- }
- /**
- * 開啟WEBCCR主畫面
- */
- public void openWebCcr() {
- String EMIS_USER_BIND_NAME = "com.emis.user.emisCaesarUser.class";
- WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
- session.setAttribute(EMIS_USER_BIND_NAME, FoCcr);
- VaadinSession.getCurrent().setAttribute(EMIS_USER_BIND_NAME, FoCcr);
- //
- String path = "/webccr";
- if (!emisUtil.isEmpty(FoCcr.getsHTTP())) {
- path += "?name=" + FoCcr.getsHTTP();
- }
- emisUtil.setLocation(path);
- }
- // 關閉WEBCCR(關閉CHROME的網頁)
- public void closeWebCcr() {
- try {
- // 正常登出時, 將CASH_ID.IDNO_TOKEN清空
- FoCcr.wrDataToDb.updCASH_IDcolumnIDNO_TOKEN(FoCcr.getCcrID(), true);
- // ((webccr) UI.getCurrent()).getlog().info(login.class, "登出機號="+ FoCcr.getCcrID());
- CcrUtil.setMessage("登出機號="+ FoCcr.getCcrID());
- //
- String path = "/login";
- if (!emisUtil.isEmpty(FoCcr.getsHTTP())) {
- path += "?name=" + FoCcr.getsHTTP();
- }
- //
- WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
- JavaScript.getCurrent().execute("window.onbeforeunload = function (e) { };");
- //
- emisAuthFactory.logout(emisUtil.getServletContext(), session);
- emisUtil.setLocation(path);
- UI.getCurrent().getSession().close();
- } catch (Exception e) {
- // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- }
- /**
- * 商品查詢畫面, 若雙點擊grid上商品, 則回傳指定商品之P_NO, 其餘傳空白
- * TCcrConst.BTN_QUERY_PRODUCT
- * @param oEdit_
- * @param oEvent_
- * @param sOkMethod_
- * @param sCancelMethod_
- * @param sPLUMethod_
- */
- public void swQueryProductFrom(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPLUMethod_) {
- WinProductQry _oWinProdQry = new WinProductQry(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPLUMethod_);
- _oWinProdQry.setModal(true);
- _oWinProdQry.setResizable(false);
- _oWinProdQry.setClosable(false);
- _oWinProdQry.setWidth("95%");
- _oWinProdQry.setHeight("95%");
- UI.getCurrent().addWindow(_oWinProdQry);
- }
- /**
- * 門市群組庫存查詢 (同商品查詢畫面,Table不同)
- * TCcrConst.BTN_QUERY_S_STOCK
- */
- public void swQueryStockFrom(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPLUMethod_) {
- WinProductQry _oWinProdQry = new WinProductQry(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPLUMethod_, TCcrConst.BTN_QUERY_S_STOCK);
- _oWinProdQry.setModal(true);
- _oWinProdQry.setResizable(false);
- _oWinProdQry.setClosable(false);
- _oWinProdQry.setWidth("95%");
- _oWinProdQry.setHeight("95%");
- UI.getCurrent().addWindow(_oWinProdQry);
- }
- //開啟促銷單號頁面
- public void swPromotionFrom(String title,PromotionInfoList pmList, ArrayList<TSaleItem> SaleItemPool,
- TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinPromotion _oWinPromotion = new WinPromotion(pmList, SaleItemPool, oEvent_, sOkMethod_, sCancelMethod_);
- _oWinPromotion.setCaption(title);
- _oWinPromotion.setModal(true);
- _oWinPromotion.setResizable(false);
- _oWinPromotion.setClosable(false);
- _oWinPromotion.setWidth("100%");
- _oWinPromotion.setHeight("100%");
- UI.getCurrent().addWindow(_oWinPromotion);
- _oWinPromotion.addFocusListener(new FieldEvents.FocusListener() {
- @Override
- public void focus(FieldEvents.FocusEvent event) {
- _oWinPromotion.gettPno().focus();
- }
- });
- }
- //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
- //開啟滿額單號頁面 by 折扣折讓
- public void swPromotionFrom1ByFI(PromotionInfoList pmList, TEntryEdit oEdit_, TEventContext oEvent_,
- String sOkMethod_, String sCancelMethod_, String sIS_COUPON_, String sCaption_) {
- //WinPromotion4FI_23 _oWinPromotion4FI_23 = new WinPromotion4FI_23(pmList, oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- WinPromotion4FI_23 _oWinPromotion4FI_23 = new WinPromotion4FI_23(pmList, oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sIS_COUPON_, sCaption_);
- _oWinPromotion4FI_23.setModal(true);
- _oWinPromotion4FI_23.setResizable(false);
- _oWinPromotion4FI_23.setClosable(false);
- _oWinPromotion4FI_23.setWidth("60%");
- _oWinPromotion4FI_23.setHeight("50%");
- UI.getCurrent().addWindow(_oWinPromotion4FI_23);
- }
- //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
- //開啟滿額單號頁面 by 加購贈
- public void swPromotionFrom2ByFI(PromotionInfoList pmList, TEventContext oEvent_,
- String sOkMethod_, String sCancelMethod_, String sIS_COUPON_, String sCaption_) {
- //WinPromotion4FI _oWinPromotion4FI = new WinPromotion4FI(pmList, oEvent_, sOkMethod_, sCancelMethod_);
- WinPromotion4FI _oWinPromotion4FI = new WinPromotion4FI(pmList, oEvent_, sOkMethod_, sCancelMethod_, sIS_COUPON_, sCaption_);
- _oWinPromotion4FI.setModal(true);
- _oWinPromotion4FI.setResizable(false);
- _oWinPromotion4FI.setClosable(false);
- _oWinPromotion4FI.setWidth("90%");
- _oWinPromotion4FI.setHeight("90%");
- UI.getCurrent().addWindow(_oWinPromotion4FI);
- }
- //顯示清(讀)帳畫面, 畫面資料輸入完畢, 按下確認後, 將資料寫入oCcrLog_
- public boolean swSettleAccountsForm(TCcrLog oCcrLog_) {
- MessageBox.createWarning()
- .withCaption("訊息")
- .withMessage("功能開發中")
- .withWidth("400px")
- .withHeight("150").open();
- return true;
- }
- public void swErrMsg(String sMsg_) {
- //swErrMsg(sMsg_, "400px");
- swErrMsg(sMsg_, "450"); //add by Ares 20200416 禮物卡串接銀科
- }
- /**
- * 顯示錯誤訊息視窗
- *
- * @param sMsg_
- */
- public void swErrMsg(String sMsg_, String size) {
- MessageBox.createError()
- .withCaption("錯誤")
- .withMessage(sMsg_)
- .withWidth(size)
- // .withHeight("150")
- .withCloseButton(ButtonOption.focus())
- .open();
- }
- /**
- * 顯示錯誤訊息視窗
- *
- * @param sMsg_
- */
- public void swErrMsgNoSetSize(String sMsg_) {
- MessageBox.createError()
- .withCaption("錯誤")
- .withMessage(sMsg_)
- .withCloseButton(ButtonOption.focus())
- .open();
- }
- /**
- * 顯示錯誤訊息視窗
- * 關閉後,執行Event內的Method
- */
- public void swErrMsgWithBtnEvent(String sMsg_,TEventContext oEventContext_,String sMethod_) {
- MessageBox.createError()
- .withCaption("錯誤")
- .withMessage(sMsg_)
- .withWidth("400px")
- // .withHeight("150")
- .withCloseButton(()->{
- oEventContext_.runEventMethod(sMethod_);
- },ButtonOption.focus())
- .open();
- }
- /**
- * 檢查TextField必填,顯示錯誤訊息視窗 by Notification
- */
- public boolean emisEmptyValid(TextField oField, String sCaption, String sFieldName) {
- boolean _bValid = true;
- if (emisUtil.isEmpty(sCaption)) {
- sCaption = "必填";
- }
- if (emisUtil.isEmpty(oField.getValue())) {
- Notification notif = new Notification(sCaption, "「" + sFieldName + "」欄位不可為空白!", Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- _bValid = false;
- }
- return _bValid;
- }
- /**
- * 檢查DateField必填,顯示錯誤訊息視窗 by Notification
- */
- public static boolean emisEmptyValid(DateField oField, String sCaption, String sFieldName) {
- boolean _bValid = true;
- String _sMsg = "「" + sFieldName + "」欄位不可為空白!";
- if (emisUtil.isEmpty(sCaption)) {
- sCaption = "必填";
- }
- if (oField.getValue() == null) {
- _bValid = false;
- sCaption = "錯誤";
- _sMsg = "「" + sFieldName + "」欄位格式錯誤或不可為空白!";
- }
- if (!_bValid) {
- Notification notif = new Notification(sCaption, _sMsg, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- }
- return _bValid;
- }
- /**
- * 檢查NativeSelect必選,顯示錯誤訊息視窗 by Notification
- */
- public static boolean emisEmptyValid(NativeSelect oSelect, String sCaption, String sFieldName) {
- boolean _bValid = true;
- String _sMsg = "「" + sFieldName + "」下拉式選單未選擇項目!";
- if (emisUtil.isEmpty(sCaption)) {
- sCaption = "必選";
- }
- if (oSelect.getValue() == null || emisUtil.isEmpty((String)oSelect.getValue())) {
- _bValid = false;
- }
- if (!_bValid) {
- Notification notif = new Notification(sCaption, _sMsg, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oSelect.getUI().getPage());
- oSelect.focus();
- }
- return _bValid;
- }
- /**
- * 顯示錯誤訊息視窗 by Notification
- */
- public void emisErrValid(TextField oField, String sCaption,String sMsg_) {
- Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- }
- public void emisErrValid(DateField oField, String sCaption,String sMsg_) {
- Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- }
- public void emisErrValid(PasswordField oField, String sCaption,String sMsg_) {
- Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- }
- public void emisErrValid(CheckBox oField, String sCaption,String sMsg_) {
- Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(oField.getUI().getPage());
- oField.focus();
- }
- public void emisErrValid(String sCaption, String sMsg_) {
- Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- }
- /**
- * 判斷編號欄位之起始編號迄是否大於終止編號 by Notification
- * if (!emisSeqValid(INPUTE_DATE_S, INPUTE_DATE_E, "有效日期", "", 1)) return;
- *
- * @param oField1 起始欄位物件
- * @param oField2 結束欄位物件
- * @param sMsg 欄位名稱訊息
- * @param sUMsg 自訂訊息
- * @param iShowType 訊息顯示方式 0:Notification;other:MessageBox
- * @return
- */
- public boolean emisSeqValid(Object oField1, Object oField2, String sMsg, String sUMsg, int iShowType) {
- String sField1 = "";
- String sField2 = "";
- Page page = null;
- TextField FocusTextField = null;
- DateField FocusDateField = null;
- boolean _bValid = true;
- String _sShow = "";
- if (oField1 instanceof TextField && oField2 instanceof TextField) {
- TextField oText1 = (TextField) oField1;
- TextField oText2 = (TextField) oField2;
- if (!emisUtil.isEmpty(oText1.getValue()) || !emisUtil.isEmpty(oText2.getValue())) {
- sField1 = oText1.getValue();
- sField2 = oText2.getValue();
- page = oText1.getUI().getPage();
- FocusTextField = oText2;
- }
- } else if (oField1 instanceof DateField && oField2 instanceof DateField) {
- DateField oDate1 = (DateField) oField1;
- DateField oDate2 = (DateField) oField2;
- if (oDate1.getValue() != null || oDate2.getValue() != null) {
- if (oDate1.getValue() != null) {
- sField1 = emisUtil.formatDateTime("%Y%M%D", oDate1.getValue());
- } else {
- sField1 = "0";
- }
- if (oDate2.getValue() != null) {
- sField2 = emisUtil.formatDateTime("%Y%M%D", oDate2.getValue());
- } else {
- sField2 = "0";
- }
- page = oDate1.getUI().getPage();
- FocusDateField = oDate2;
- }
- }
- if (!emisUtil.isEmpty(sField1) && !emisUtil.isEmpty(sField2)) {
- try {
- int _iField1Val = Integer.parseInt(sField1);
- int _iField2Val = Integer.parseInt(sField2);
- if (_iField1Val > _iField2Val) _bValid = false;
- if (!emisUtil.isEmpty(sMsg)) {
- _sShow = "「" + sMsg + "」起始不可大於終止!";
- } else {
- _sShow = sUMsg;
- }
- if (!_bValid) {
- // 顯示訊息方式
- if (iShowType == 0) {
- Notification notif = new Notification("警告", _sShow, Notification.Type.WARNING_MESSAGE);
- notif.setDelayMsec(500);
- notif.show(page);
- } else {
- swWarningMsg(_sShow);
- }
- if (FocusTextField != null) {
- FocusTextField.focus();
- } else if(FocusDateField != null) {
- FocusDateField.focus();
- }
- }
- } catch (Exception e) {
- // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- }
- return _bValid;
- }
- /**
- * 顯示警告視窗
- *
- * @param sMsg_
- */
- public void swWarningMsg(String sMsg_) {
- MessageBox.createWarning()
- .withCaption("警告")
- .withMessage(sMsg_)
- .withWidth("400px")
- // .withHeight("150")
- .withCloseButton(ButtonOption.focus())
- .open();
- }
- /**
- * 顯示一般訊息
- *
- * @param sMsg_
- */
- public void swMessage(String sMsg_) {
- MessageBox.createInfo()
- .withCaption("訊息")
- .withMessage(sMsg_)
- .withWidth("400px")
- // .withHeight("150")
- .withOkButton(ButtonOption.focus()).open();
- }
- /**
- * 顯示一般訊息
- * @param sMsg_
- * @param oEventContext_
- * @param sMethod_
- */
- public void swMessageWithBtnEvent(String sMsg_,TEventContext oEventContext_,String sMethod_) {
- MessageBox.createInfo().withCaption("訊息")
- .withMessage(sMsg_).withWidth("400px").withHeight("150")
- .withOkButton(()->{
- oEventContext_.runEventMethod(sMethod_);
- },ButtonOption.focus())
- .open();
- }
- /**
- * 取得登入畫面的輸入值
- *
- * @param oData_
- * @return
- */
- public boolean receiveLoginData(TLoginData oData_) {
- if (!"".equals(oData_.UIxS_NO) && !"".equals(oData_.UIxPASSWORD)
- && !"".equals(oData_.UIxSALE_DATE)) {
- return true;
- }
- return false;
- }
- //將sMsg_輸出至輸入框
- public void wrMessageToMainDisplay(String sMsg_) {
- if ((UI.getCurrent() instanceof webccr)){
- ((webccr) UI.getCurrent()).setShowMsg(sMsg_);
- ((webccr) UI.getCurrent()).setInput("");
- FoCcr.setMainDisplayReset(true);
- }
- }
- /**
- * 取得主畫面, 輸入框已輸入字串值
- *
- * @return
- */
- public String receivceMainDisplayEntryData() {
- return ((webccr) UI.getCurrent()).getInput();
- }
- /**
- * 更新主畫面交易內容, 不含grid. N(not)I(Include)G(Grid)
- */
- public void updateMainFormNIG() {
- try {
- webccr _oWebccr = (webccr) UI.getCurrent();
- // _oWebccr.setInput("");
- if (FoCcr.getCurrentSale() != null) {
- _oWebccr.getFlSlNo().setValue(FoCcr.getCurrentSale().getSn() + "");//交易序號
- _oWebccr.getFlUID().setValue(FoCcr.getCurrentSale().getUID());//統一編號
- _oWebccr.getFlCsNo().setValue(FoCcr.getCurrentSale().getFsCS_NO()); // 經銷商
- // _oWebccr.getFlOwner().setValue(FoCcr.getCurrentSale().getOwner()); //買受人
- _oWebccr.getFlTotalAmt().setValue(((long) FoCcr.getCurrentSale().getRealSaleTotal()) + "");//銷售金額
- _oWebccr.getFlTotalOrderAmt().setValue(((long) FoCcr.getCurrentSale().getOrderTotal()) + "");//客訂金額
- _oWebccr.getFlTotalPayAmt().setValue(((long) FoCcr.getCurrentSale().getRealSaleTotal()) + "");//應付金額
- _oWebccr.getFlChangeAmt().setValue(((long) FoCcr.getCurrentSale().getUnpaidAmout()) + ""); //未付款(+)/找零(-)
- TInvoice _oInvoce = FoCcr.getCurrentSale().getInvoice();
- if (_oInvoce != null) {
- if (!emisUtil.isEmpty(_oInvoce.getDonate())) {
- _oWebccr.getFlCarryDonate().setValue(_oInvoce.getDonate());
- } else if (!emisUtil.isEmpty(_oInvoce.getCarrierCode())) {
- _oWebccr.getFlCarryDonate().setValue(_oInvoce.getCarrierCode());
- }
- }
- } else {
- _oWebccr.getFlSlNo().setValue("");//交易序號
- _oWebccr.getFlUID().setValue("");//統一編號
- _oWebccr.getFlCsNo().setValue(""); // 經銷商
- // _oWebccr.getFlOwner().setValue(""); //買受人
- _oWebccr.getFlTotalAmt().setValue("0");//銷售金額
- _oWebccr.getFlTotalOrderAmt().setValue("0");//客訂金額
- _oWebccr.getFlTotalPayAmt().setValue("0");//應付金額
- _oWebccr.getFlChangeAmt().setValue("0"); //未付款(+)/找零(-)
- _oWebccr.getFlCarryDonate().setValue("");
- }
- if (FoCcr.getUser() != null) {
- _oWebccr.getFlSaler().setValue(FoCcr.getUser().getFLDxUSERNAME()); //售貨員
- } else {
- _oWebccr.getFlSaler().setValue(""); //售貨員
- }
- _oWebccr.getFlSysDate().setValue(FoCcr.getSaleDate() + "/" + emisUtil.todayTime(":"));//交易日期
- _oWebccr.getFlStoreNo().setValue(FoCcr.getStore().getFLDxS_NO());//門市
- _oWebccr.getFlIdNo().setValue(FoCcr.getCcrID());//機號
- _oWebccr.getFlInvNo().setValue(FoCcr.getCurrentInvoiceNo());//發票編號
- //TODO
- _oWebccr.getFlInvCount().setValue("");//發票剩餘張數
- _oWebccr.getFlCcrState().setValue(getCcrStateStr(FoCcr.getCurrnetState()));
- //會員信息
- if (FoCcr.getCurrentSale() != null && FoCcr.getCurrentSale().getFoMerber()!=null) {
- TMember member= FoCcr.getCurrentSale().getFoMerber();
- _oWebccr.getFlMEM_NAME().setValue(member.getFLDxNAME());
- _oWebccr.getFlMEM_POINT().setValue(member.getFLDxPOINT());
- if ("Y".equals(member.getFLDxDOUBLE_AUTH())) {
- _oWebccr.getFlMEM_DOUBLE_AUTH().setValue(member.getFLDxDOUBLE_AUTH()
- + "(" + member.getFLDxPOINT_MAX_EXCHANGE_RATE() + "%)");
- } else {
- _oWebccr.getFlMEM_DOUBLE_AUTH().setValue(member.getFLDxDOUBLE_AUTH());
- }
- _oWebccr.getFlMEM_JOINSTORE ().setValue(member.getFLDxJOINSTORE());
- _oWebccr.getFlMEM_EMAIL().setValue(member.getFLDxEMAIL());
- _oWebccr.getFlMEM_ADDRESS().setValue(member.getFLDxADDRESS());
- _oWebccr.getFlMEM_SEX().setValue(member.getFLDxSEX());
- _oWebccr.getFlMEM_BIRTHDAY().setValue(member.getFLDxBIRTHDAY());
- _oWebccr.getFlMEN_NUMBER().setValue(member.getFLDxMOBILE());
- }else{
- _oWebccr.getFlMEM_NAME().setValue("");
- _oWebccr.getFlMEM_POINT().setValue("");
- _oWebccr.getFlMEM_DOUBLE_AUTH().setValue("");
- _oWebccr.getFlMEM_JOINSTORE ().setValue("");
- _oWebccr.getFlMEM_EMAIL().setValue("");
- _oWebccr.getFlMEM_ADDRESS().setValue("");
- _oWebccr.getFlMEM_SEX().setValue("");
- _oWebccr.getFlMEM_BIRTHDAY().setValue("");
- _oWebccr.getFlMEN_NUMBER().setValue("");
- }
- } catch (Exception e) {
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- }
- /**
- * 更新主畫面上所有內容值
- */
- public void updateMainForm() {
- try {
- webccr _oWebccr = (webccr) UI.getCurrent();
- if (FoCcr.getCurrentSale() != null) {
- ((TSalesTable) _oWebccr.getFTSaleTable()).refreshTbl(FoCcr);
- ((TSalePayTable) _oWebccr.getFTSalePayTable()).refreshTbl(FoCcr);
- } else {
- ((TSalesTable) _oWebccr.getFTSaleTable()).removeAllItems();
- ((TSalePayTable) _oWebccr.getFTSalePayTable()).removeAllItems();
- }
- updateMainFormNIG();
- } catch (Exception e) {
- // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- }
- /**
- * 插入oSaleItem_至主畫上交易明細grid
- *
- * @param oSaleItem_
- * @return
- */
- public boolean insertSaleItemToMainForm(TSaleItem oSaleItem_) {
- try {
- webccr _oWebccr = (webccr) UI.getCurrent();
- TSalesTable _oTbl = ((TSalesTable) _oWebccr.getFTSaleTable());
- _oTbl.addItem(oSaleItem_);
- //Todo select 把子標移到新增加當下SaleItem
- // _oTbl.select(oSaleItem_);
- updateMainForm();
- return true;
- } catch (Exception e) {
- // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- return false;
- }
- /**
- * 主畫面上將oSaleItem_標記刪除(雙刪線)
- *
- * @param oSaleItem_
- * @return
- */
- public boolean delSaleItemToMainForm(TSaleItem oSaleItem_) {
- updateMainForm();
- return false;
- }
- //插入oPayment_至主畫面上付款明細
- public boolean insertPaymentToMainForm(TPayment oPayment_) {
- try {
- webccr _oWebccr = (webccr) UI.getCurrent();
- TSalePayTable _oTbl = ((TSalePayTable) _oWebccr.getFTSalePayTable());
- _oTbl.addItem(oPayment_);
- //Todo select 把子標移到新增加當下SaleItem
- // _oTbl.select(oSaleItem_);
- updateMainForm();
- return true;
- } catch (Exception e) {
- // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
- CcrUtil.setMessage(emisUtil.getStackTrace(e));
- }
- return false;
- }
- //主畫面上將oPayment_標記刪除
- public boolean delPaymentToMainForm(TPayment oPayment_) {
- updateMainForm();
- return false;
- }
- //交易查詢
- public void swQuerySale(String sSaleDate_, TEventContext oEvent_, String sCancelMethod_) {
- SaleQry _oSaleQry = new SaleQry(sSaleDate_, oEvent_, sCancelMethod_);
- _oSaleQry.setModal(true);
- _oSaleQry.setResizable(false);
- _oSaleQry.setClosable(false);
- _oSaleQry.setWidth("95%");
- _oSaleQry.setHeight("100%");
- UI.getCurrent().addWindow(_oSaleQry);
- }
- /**
- * 顯示清(讀)帳畫面, 畫面資料輸入完畢, 按下確認後, 將資料寫入oCcrLog_
- *
- * @param oEvent_
- * @param sOkMethod_
- * @param sCancelMethod_
- * @return
- */
- public boolean swSettleAccountsForm(TCcrLog oCcrLog_, TEventContext oEvent_, boolean isLogin, String sOkMethod_, String sCancelMethod_) {
- WinSettleAccount _oWinStlAcc = new WinSettleAccount(oCcrLog_, oEvent_, isLogin, sOkMethod_, sCancelMethod_);
- _oWinStlAcc.setModal(true);
- _oWinStlAcc.setResizable(false);
- _oWinStlAcc.setClosable(false);
- _oWinStlAcc.setHeight("100%");
- //_oWinStlAcc.setWidth("380px"); //add by Ares 20200701 振興券匯款、餘額的紀錄與計算,同現金方式
- _oWinStlAcc.setWidth("600px");
- UI.getCurrent().addWindow(_oWinStlAcc);
- return true;
- }
- // 門號申辦 / 固網申辦
- public void swPhoneNumber(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinPhoneNumber _oPhoneNumber = new WinPhoneNumber(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oPhoneNumber.setModal(true);
- _oPhoneNumber.setResizable(false);
- _oPhoneNumber.setClosable(false);
- _oPhoneNumber.setWidth("900px");
- //_oPhoneNumber.setHeight("85%");
- _oPhoneNumber.setHeight("90%"); //add by Ares 20190722 特殊商品才需輸入卡片金額
- _oPhoneNumber.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oPhoneNumber);
- }
- // 領機
- public void swReceivePhone(TEntryEdit oEdit_ ,TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinReceivePhone _oReceivePhone = new WinReceivePhone(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oReceivePhone.setModal(true);
- _oReceivePhone.setResizable(false);
- _oReceivePhone.setClosable(false);
- _oReceivePhone.setWidth("500px");
- _oReceivePhone.setHeight("310px");
- UI.getCurrent().addWindow(_oReceivePhone);
- }
- // 弹窗-是否購買鈦金服務
- public void swTservice1(TEntryEdit oEdit_, TBtnTService oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinTService1 _oTService1 = new WinTService1(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("600px");
- _oTService1.setHeight("450px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 弹窗-鈦金服務 T_SERVICE 輸入客戶姓名、手機號碼(必填)
- public void swTservice2(TEntryEdits oEdits_, TBtnTService oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinTService2 _oTService1 = new WinTService2(oEdits_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("600px");
- _oTService1.setHeight("240px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 彈窗--是否購買鈦金服務(新)
- public void swTserviceNew1(TEntryEdit oEdit_, TBtnTServiceNew oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinTServiceNew1 _oTServiceNew1 = new WinTServiceNew1(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTServiceNew1.setModal(true);
- _oTServiceNew1.setResizable(false);
- _oTServiceNew1.setClosable(false);
- _oTServiceNew1.setWidth("600px");
- _oTServiceNew1.setHeight("450px");
- _oTServiceNew1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTServiceNew1);
- }
- // 弹窗-鈦金服務 T_SERVICE_NEW 輸入客戶姓名、手機號碼(必填)、身分證後四碼(AS)
- public void swTserviceNew2(TEntryEdits oEdits_, TBtnTServiceNew oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinTServiceNew2 _oTServiceNew2 = new WinTServiceNew2(oEdits_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTServiceNew2.setModal(true);
- _oTServiceNew2.setResizable(false);
- _oTServiceNew2.setClosable(false);
- _oTServiceNew2.setWidth("600px");
- _oTServiceNew2.setHeight("250px");
- _oTServiceNew2.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTServiceNew2);
- }
- // 弹窗--經銷&企業戶 CS_NO
- public void swCsNo(TEntryEdit oEdit_, TBtnCS_NO oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinCsNo _oTService1 = new WinCsNo(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("520px");
- _oTService1.setHeight("600px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 弹窗--代收
- public void swCollection(TBtnCollection oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinCollection _oTService1 = new WinCollection(oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("520px");
- _oTService1.setHeight("410px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 弹窗-會員點數兌換-折抵金額
- public void swMemPointAmt(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinMemPointAmt _oTService1 = new WinMemPointAmt(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("600px");
- _oTService1.setHeight("220px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 個案開帳
- public void swCaseSale(TEventContext oEvent_, String sCancelMethod_) {
- WinCaseSale _oCaseSale = new WinCaseSale(oEvent_, sCancelMethod_);
- _oCaseSale.setModal(true);
- _oCaseSale.setResizable(false);
- _oCaseSale.setClosable(false);
- _oCaseSale.setWidth("60%");
- _oCaseSale.setHeight("100%");
- UI.getCurrent().addWindow(_oCaseSale);
- }
- //彈窗--小白單手動列印
- public void swSMHandPrint(TEventContext oEvent_, String sOkMethod_){
- WinSM _oSM = new WinSM(oEvent_, sOkMethod_);
- _oSM.setModal(true);
- _oSM.setResizable(false);
- _oSM.setClosable(false);
- _oSM.setWidth("500px");
- //add by Ares 20181024 小白單批次列印
- //_oSM.setHeight("350px");
- _oSM.setHeight("450px");
- _oSM.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oSM);
- }
- //彈窗--全退&作廢
- public void swFullVoid(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_){
- WinFullVoid _oFullVoid = new WinFullVoid(oEvent_, sOkMethod_, sCancelMethod_);
- _oFullVoid.setModal(true);
- _oFullVoid.setResizable(false);
- _oFullVoid.setClosable(false);
- _oFullVoid.setWidth("90%");
- _oFullVoid.setHeight("90%");
- _oFullVoid.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oFullVoid);
- }
- /**
- * 作廢或折讓選項
- * 1. INV_TYPE = 6 直接作廢 不用輸入發票編號與隨機碼
- * 2. (INV_TYPE = 8 || INV_TYPE = 4) & 跨期 -> 折讓
- * 3. INV_TYPE = 8 & (載具||愛心碼) & 無跨期 > 作廢 不用輸入發票編號與隨機碼
- * 4 (INV_TYPE = 8 || INV_TYPE = 4) & 無跨期 > 其他
- */
- //中華家電宅配 by daff 20200107
- public void swVoidDisc(TEventContext oEvent_, String sOkMethod_) {
- webccr webccr = (webccr) UI.getCurrent();
- String OriginDate = webccr.getFoCCR().getCurrentSale().getOriginDate();
- String CreateDate = webccr.getFoCCR().getCurrentSale().getCreateDate();
- boolean bFALG = CcrUtil.isDISCOUNT(OriginDate, CreateDate);
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class, "VOID bFALG=" + bFALG);
- CcrUtil.setMessage("VOID bFALG=" + bFALG);
- boolean bEnable = webccr.getFoCCR().getCurrentSale().getInvType().equals(TCcrConst.INV_TYPE_NONE) ? true : false;
- // ((webccr) UI.getCurrent()).getlog().info(webccr.class, "VOID bEnable=" + bEnable);
- CcrUtil.setMessage("VOID bEnable=" + bEnable);
- String SL_INVTYPE = webccr.getFoCCR().getCurrentSale().getInvType(); //發票別
- //中華家電宅配 by daff 20200107 開窗(全退 作廢/折讓/取消) 前檢核 - 20200915 fix
- WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- boolean open_ = _Void_Disc.chkMBMS_disc(oEvent_, sOkMethod_);
- if (open_) {
- if (bEnable) {
- //作廢
- webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_CANCEL); // 收入類別
- //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc.doOK(oEvent_, sOkMethod_);
- } else if (!bEnable && !bFALG) {
- // 折讓
- webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_DISCOUNT); // 收入類別
- webccr.getFoCCR().getCurrentSale().setInvType(TCcrConst.INV_TYPE_DISCOUNT); // 發票別
- //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc.doOK(oEvent_, sOkMethod_);
- } else if (SL_INVTYPE.equals(TCcrConst.INV_TYPE_ELEC) &&
- (!emisUtil.isEmpty(webccr.getFoCCR().getCurrentSale().getInvoice().getCarrierType()) ||
- !emisUtil.isEmpty(webccr.getFoCCR().getCurrentSale().getInvoice().getDonate())) &&
- bFALG) {
- webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_CANCEL); // 收入類別
- //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc.doOK(oEvent_, sOkMethod_);
- } else {
- //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
- //boolean open_ = _Void_Disc.chkMBMS_disc(oEvent_, sOkMethod_);//中華家電宅配 by daff 20200107 開窗(全退 作廢/折讓/取消) 前檢核
- _Void_Disc.setModal(true);
- _Void_Disc.setResizable(false);
- _Void_Disc.setClosable(false);
- _Void_Disc.setWidth("280px");
- _Void_Disc.setHeight("240px");
- _Void_Disc.addStyleName("v-scrollable");
- //UI.getCurrent().addWindow(_Void_Disc);
- //if(open_) {//中華家電宅配 by daff 20200107
- UI.getCurrent().addWindow(_Void_Disc);
- //}
- }
- }
- }
- // 弹窗-二手機回收作業
- public void swSenaoSec(TSenaoSec FoSenaoSec, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinSenaoSec _oTService1 = new WinSenaoSec(FoSenaoSec, oEvent_, sOkMethod_, sCancelMethod_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("900px");
- _oTService1.setHeight("600px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- // 銷退/重銷 申請 (鈦金、IMEI)
- public void swReturn(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listReturn_, String sOkMethod_, String sCancelMethod_) {
- WinSalesReturn _oSalesReturn = new WinSalesReturn(oEdits_, oEvent_, listReturn_, sOkMethod_, sCancelMethod_);
- _oSalesReturn.setModal(true);
- _oSalesReturn.setResizable(false);
- _oSalesReturn.setClosable(false);
- _oSalesReturn.setWidth("30%");
- _oSalesReturn.setHeight("65%");
- _oSalesReturn.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oSalesReturn);
- }
- // 門號解約 / 固網解約
- public void swCancelContract(TEntryEdits oEdits_, TButtonEventContext oEvent_, int iType_, String sOkMethod_, String sCancelMethod_) {
- WinCancelContract _oCancelContract = new WinCancelContract(oEdits_, oEvent_, iType_, sOkMethod_, sCancelMethod_);
- _oCancelContract.setModal(true);
- _oCancelContract.setResizable(false);
- _oCancelContract.setClosable(false);
- _oCancelContract.setWidth("60%");
- _oCancelContract.setHeight("90%");
- _oCancelContract.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oCancelContract);
- }
- // 交易備忘-聯單號碼&手機號碼&個資 (門號解約/固網解約)
- public void swSaleMemo(TEntryEdits oEdits_, TButtonEventContext oEvent_, String sOkMethod_) {
- WinSaleMemo _oSaleMemo = new WinSaleMemo(oEdits_, oEvent_, sOkMethod_);
- _oSaleMemo.setModal(true);
- _oSaleMemo.setResizable(false);
- _oSaleMemo.setClosable(false);
- _oSaleMemo.setWidth("30%");
- _oSaleMemo.setHeight("30%");
- _oSaleMemo.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oSaleMemo);
- }
- // 包膜(料號 4802開頭)作業 / 有客訂商品且非電視宅配 顧客資料
- //add by Ares 20181107 電視宅配修改
- //public void swCustomer(TEventContext oEvent_, String sCaption_, String sOkMethod_, String sIMEI_) {
- public void swCustomer(TEventContext oEvent_, String sCaption_, String sOkMethod_, String sCancelMethod_, String sIMEI_) {
- //WinCustomer _oCustomer = new WinCustomer(oEvent_, sCaption_, sOkMethod_, sIMEI_);
- WinCustomer _oCustomer = new WinCustomer(oEvent_, sCaption_, sOkMethod_, sCancelMethod_, sIMEI_);
- _oCustomer.setModal(true);
- _oCustomer.setResizable(false);
- _oCustomer.setClosable(false);
- _oCustomer.setWidth("47%");
- _oCustomer.setHeight("70%");
- UI.getCurrent().addWindow(_oCustomer);
- }
- // 宅配派工
- //add by Ares 20181107 電視宅配修改
- //public void swDelivery(TEventContext oEvent_, String sOkMethod_, boolean bIsOrder) {
- public void swDelivery(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, boolean bIsOrder) {
- //WinDelivery _oDelivery = new WinDelivery(oEvent_, sOkMethod_);
- WinDelivery _oDelivery = new WinDelivery(oEvent_, sOkMethod_, sCancelMethod_);
- _oDelivery.setModal(true);
- _oDelivery.setResizable(false);
- _oDelivery.setClosable(false);
- _oDelivery.setWidth("38%");
- _oDelivery.setHeight("100%");
- _oDelivery.setOrder(bIsOrder);
- UI.getCurrent().addWindow(_oDelivery);
- }
- // 特殊商品快取功能
- public void swSpecialProduct(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listProduct_, String sOkMethod_, String sCancelMethod_) {
- WinSpecialProduct _oSpecialProduct = new WinSpecialProduct(oEdits_, oEvent_, listProduct_, sOkMethod_, sCancelMethod_);
- _oSpecialProduct.setModal(true);
- _oSpecialProduct.setResizable(false);
- _oSpecialProduct.setClosable(false);
- _oSpecialProduct.setWidth("30%");
- _oSpecialProduct.setHeight("70%");
- _oSpecialProduct.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oSpecialProduct);
- }
- // 愛心碼
- public void swEinvDonate(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listDonate_, String sOkMethod_, String sCancelMethod_) {
- WinEinvDonate _oEinvDonate = new WinEinvDonate(oEdits_, oEvent_, listDonate_, sOkMethod_, sCancelMethod_);
- _oEinvDonate.setModal(true);
- _oEinvDonate.setResizable(false);
- _oEinvDonate.setClosable(false);
- _oEinvDonate.setWidth("30%");
- _oEinvDonate.setHeight("70%");
- _oEinvDonate.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oEinvDonate);
- }
- // 預購取件 企客(ENT)特殊處理
- public void swPreOrderCsNo(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listSale_, String sPayMethod_, String sCancelMethod_) {
- WinPreOrderCsNo _oPreOrderCsNo = new WinPreOrderCsNo(oEdits_, oEvent_, listSale_, sPayMethod_, sCancelMethod_);
- _oPreOrderCsNo.setModal(true);
- _oPreOrderCsNo.setResizable(false);
- _oPreOrderCsNo.setClosable(false);
- _oPreOrderCsNo.setWidth("50%");
- _oPreOrderCsNo.setHeight("70%");
- UI.getCurrent().addWindow(_oPreOrderCsNo);
- }
- // 門市繳費畫面
- public void swStorePayment(TBtnStorePayment oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinStorePayment _oStorePayment = new WinStorePayment(oEvent_, sOkMethod_, sCancelMethod_);
- _oStorePayment.setModal(true);
- _oStorePayment.setResizable(false);
- _oStorePayment.setClosable(false);
- _oStorePayment.setWidth("600px");
- _oStorePayment.setHeight("500px");
- UI.getCurrent().addWindow(_oStorePayment);
- }
- // 舊機回收(一般)
- public void swSenaoSecNew(TSenaoSecNew SenaoSecNew, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinSenaoSecNew _oSenaoSecNew = new WinSenaoSecNew(SenaoSecNew, oEvent_, sOkMethod_, sCancelMethod_);
- _oSenaoSecNew.setModal(true);
- _oSenaoSecNew.setResizable(false);
- _oSenaoSecNew.setClosable(false);
- _oSenaoSecNew.setWidth("400px");
- _oSenaoSecNew.setHeight("200px");
- UI.getCurrent().addWindow(_oSenaoSecNew);
- }
- //dongle機交易明細查詢
- public void swDongleUuCard() {
- WinUuCardDongle _oDongleUuCard = new WinUuCardDongle();
- _oDongleUuCard.setModal(true);
- _oDongleUuCard.setResizable(false);
- _oDongleUuCard.setClosable(false);
- _oDongleUuCard.setWidth("400px");
- _oDongleUuCard.setHeight("240px");
- // _oDongleUuCard.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oDongleUuCard);
- }
- // LINE PAY 識別碼
- public void swLinePayIdentifier(int iEntryAmt, TBtnLinePay oEvent_) {
- WinLinePay _oLinePay = new WinLinePay(iEntryAmt, oEvent_);
- _oLinePay.setModal(true);
- _oLinePay.setResizable(false);
- _oLinePay.setClosable(false);
- _oLinePay.setWidth("400px");
- _oLinePay.setHeight("180px");
- UI.getCurrent().addWindow(_oLinePay);
- }
- // 會員福利金QRCODE
- public void swBenefitQRCode(TBtnBenefit oEvent_) {
- WinBenefit _oBenefit = new WinBenefit(oEvent_);
- _oBenefit.setModal(true);
- _oBenefit.setResizable(false);
- _oBenefit.setClosable(false);
- _oBenefit.setWidth("400px");
- _oBenefit.setHeight("180px");
- UI.getCurrent().addWindow(_oBenefit);
- }
- //add by Ares 20181009 HAMIPOINT QRCODE
- public void swHamiPointQRCode(TBtnHamiPoint oEvent_) {
- WinHamiPoint _oHamiPoint = new WinHamiPoint(oEvent_);
- _oHamiPoint.setModal(true);
- _oHamiPoint.setResizable(false);
- _oHamiPoint.setClosable(false);
- _oHamiPoint.setWidth("400px");
- _oHamiPoint.setHeight("180px");
- UI.getCurrent().addWindow(_oHamiPoint);
- }
- //add by Ares 20191120 舊會員程式MARK
- /*
- // 輸入會員視窗
- public void swMemQry(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinMemQry _oWinMemQry = new WinMemQry(oEvent_, sOkMethod_, sCancelMethod_);
- _oWinMemQry.setModal(true);
- _oWinMemQry.setResizable(false);
- _oWinMemQry.setClosable(false);
- _oWinMemQry.setWidth("40%");
- _oWinMemQry.setHeight("30%");
- UI.getCurrent().addWindow(_oWinMemQry);
- }
- */
- //add by Ares 20190502 會員分級
- // 新輸入會員視窗
- //public void swQueryMemberInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- public void swQueryMemberInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String Query_Mode_) { //add by Ares 20190829 會員分級問題修正
- WinQueryMemberInfo _oWinQueryMemberInfo = new WinQueryMemberInfo(oEvent_, sOkMethod_, sCancelMethod_, Query_Mode_);
- _oWinQueryMemberInfo.setModal(true);
- _oWinQueryMemberInfo.setResizable(false);
- _oWinQueryMemberInfo.setClosable(false);
- _oWinQueryMemberInfo.setWidth("50%");
- //_oWinQueryMemberInfo.setHeight("30%");
- UI.getCurrent().addWindow(_oWinQueryMemberInfo);
- }
- //add by Ares 20191118 一致性員購
- // 輸入員工代碼視窗
- public void swQueryEmpPurchaseInfo(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPartnerEmployeeId_) {
- WinEmpPurchaseInfo _oTService1 = new WinEmpPurchaseInfo(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPartnerEmployeeId_);
- _oTService1.setModal(true);
- _oTService1.setResizable(false);
- _oTService1.setClosable(false);
- _oTService1.setWidth("600px");
- _oTService1.setHeight("220px");
- _oTService1.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oTService1);
- }
- /*
- public void swQueryEmpPurchaseInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String Query_Mode_) { //add by Ares 20190829 會員分級問題修正
- WinEmpPurchaseInfo _oWinEmpPurchaseInfo = new WinEmpPurchaseInfo(oEvent_, sOkMethod_, sCancelMethod_, Query_Mode_);
- _oWinEmpPurchaseInfo.setModal(true);
- _oWinEmpPurchaseInfo.setResizable(false);
- _oWinEmpPurchaseInfo.setClosable(false);
- _oWinEmpPurchaseInfo.setWidth("40%");
- _oWinEmpPurchaseInfo.setHeight("30%");
- UI.getCurrent().addWindow(_oWinEmpPurchaseInfo);
- } */
- //ADD BY DAFF 新鈦金月繳版修正 20190322
- public void swInsuInsp(TBtnINSU oEvent_, String sOkMethod_, String sCancelMethod_ , String sIMEI ,String sSOURFROM ,String sPAYMENT ,String sS_NO, String sITEMNO ,String sSALEDATE , String sAGNTNO){
- WinInsuInspNo _oInsuInspo = new WinInsuInspNo(oEvent_, sOkMethod_,sIMEI,sSOURFROM,sPAYMENT,sS_NO,sITEMNO,sSALEDATE,sAGNTNO);
- _oInsuInspo.setModal(true);
- _oInsuInspo.setResizable(false);
- _oInsuInspo.setClosable(false);
- _oInsuInspo.setWidth("400px");
- _oInsuInspo.setHeight("450px");
- _oInsuInspo.addStyleName("v-scrollable");
- if(_oInsuInspo.getInsuflag_sow().equals("Y")) {
- UI.getCurrent().addWindow(_oInsuInspo);
- }
- }
- public void swInsuInfo(TBtnINSU oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinInsuInfo _oInsuInfo = new WinInsuInfo(oEvent_, sOkMethod_, sCancelMethod_);
- _oInsuInfo.setModal(true);
- _oInsuInfo.setResizable(false);
- _oInsuInfo.setClosable(false);
- _oInsuInfo.setWidth("1100px");
- _oInsuInfo.setHeight("500px");
- _oInsuInfo.addStyleName("v-scrollable");
- UI.getCurrent().addWindow(_oInsuInfo);
- }
- //add by Ares 20180613 新鈦金優惠券
- public void swINSU_SM(TINSU_SM INSU_SM, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
- WinINSU_SM _oINSU_SM = new WinINSU_SM(INSU_SM, oEvent_, sOkMethod_, sCancelMethod_);
- _oINSU_SM.setModal(true);
- _oINSU_SM.setResizable(false);
- _oINSU_SM.setClosable(false);
- _oINSU_SM.setWidth("400px");
- _oINSU_SM.setHeight("300px");
- UI.getCurrent().addWindow(_oINSU_SM);
- }
- //add by Ares 20180810 中華年繳版保費輸入
- //AIG改下拉方式帶入保險料號 20190911
- public void swINSU_PAID(TINSU_PAID INSU_PAID, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sSHOW_SELECT) {
- WinINSU_PAID _oINSU_PAID = new WinINSU_PAID(INSU_PAID, oEvent_, sOkMethod_, sCancelMethod_ ,sSHOW_SELECT);
- _oINSU_PAID.setModal(true);
- _oINSU_PAID.setResizable(false);
- _oINSU_PAID.setClosable(false);
- _oINSU_PAID.setWidth("600px");
- _oINSU_PAID.setHeight("400px");
- UI.getCurrent().addWindow(_oINSU_PAID);
- }
- //神腦保險年繳代收保費 增加付款方式UI ADD BY DAFF 20190110 START
- //ADD BY DAFF 新鈦金卷號版修正 20190408 START
- //ADD BY DAFF 20190509 加總金額 只判斷年繳 其餘0 sSUM_AMT
- public void swInsuPayMethod(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_,String Coupon, String sALLOW_PAYFLAG , String sCOUNP_NO ,int sSUM_AMT ) {
- WinInsuPayMethod _oWinInsuPayMethod = new WinInsuPayMethod(oEvent_, sOkMethod_, sCancelMethod_, Coupon, sALLOW_PAYFLAG ,sCOUNP_NO ,sSUM_AMT );
- _oWinInsuPayMethod.setModal(true);
- _oWinInsuPayMethod.setResizable(false);
- _oWinInsuPayMethod.setClosable(false);
- _oWinInsuPayMethod.setWidth("40%");
- _oWinInsuPayMethod.setHeight("30%");
- UI.getCurrent().addWindow(_oWinInsuPayMethod);
- }
- //ADD BY DAFF 新鈦金卷號版修正 20190408 END
- //神腦保險年繳代收保費 增加付款方式UI ADD BY DAFF 20190110 END
- //ADD BY DAFF 新鈦金卷號版修正 20190408 START
- public void CouponActivity(TBtnSubtotal oEvent_, String sOkMethod_){
- WinCoupon _oSM = new WinCoupon(oEvent_, sOkMethod_);
- _oSM.setModal(true);
- _oSM.setResizable(false);
- _oSM.setClosable(false);
- _oSM.setWidth("500px");
- _oSM.setHeight("450px");
- _oSM.addStyleName("v-scrollable");
- if(_oSM.getOpenCouponWin().equals("Y")) {
- UI.getCurrent().addWindow(_oSM);
- }
- //call 卷號如有異常彈出訊息
- if(!emisUtil.isEmpty((_oSM.getMESSAGE()))){
- FoCcr.UInotify.swMessage(_oSM.getMESSAGE());
- }
- }
- //ADD BY DAFF 新鈦金卷號版修正 20190408 END
- //add by Ares 20190725 客訂>=庫存時,跳出選擇「要銷售庫存,還是要銷售客訂」
- public void swWinStock_Order(TEventContext oEvent_, String DoStock_, String DoOrder_, String DoCancel_) {
- WinStock_Order _oWinStock_Order = new WinStock_Order(oEvent_, DoStock_, DoOrder_, DoCancel_);
- _oWinStock_Order.setModal(true);
- _oWinStock_Order.setResizable(false);
- _oWinStock_Order.setClosable(false);
- _oWinStock_Order.setWidth("40%");
- _oWinStock_Order.setHeight("27%");
- UI.getCurrent().addWindow(_oWinStock_Order);
- }
- /**
- * 取得CCR狀態字串
- *
- * @param state_
- * @return
- */
- public String getCcrStateStr(int state_) {
- String _sStateName = "";
- if (state_ == TCcrConst.CPS_WAIT_SALE) {
- _sStateName = TCcrConst.CPS_NAME_WAIT_SALE; //等待交易起始
- } else if (state_ == TCcrConst.CPS_SALE) {
- _sStateName = TCcrConst.CPS_NAME_SALE;//交易進行中
- } else if (state_ == TCcrConst.CPS_WAIT_PAY) {
- _sStateName = TCcrConst.CPS_NAME_WAIT_PAY;//等待付款
- } else if (state_ == TCcrConst.CPS_PAY) {
- _sStateName = TCcrConst.CPS_NAME_PAY;//付款中
- } else if (state_ == TCcrConst.CPS_LOCK_PAY) {
- _sStateName = TCcrConst.CPS_NAME_LOCK_PAY; //限定付款
- }
- return _sStateName;
- }
- public void getFocus() {
- if ((UI.getCurrent() instanceof webccr)){
- ((webccr) UI.getCurrent()).getInputLabel().focus();
- }
- }
- }