Пример #1
0
  BaseGrid<BusiObject> create_bcode_famify_Grid() {
    CheckBoxSelectionModel<BusiObject> cbs = new CheckBoxSelectionModel<BusiObject>();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig C3 = new ColumnConfig("ChineseName", "中文名", 80);
    C3.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C3);
    ColumnConfig C4 = new ColumnConfig("englishname", "英文名称", 80);
    C4.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C4);
    ColumnConfig C5 = new ColumnConfig("Relationship", "关系", 80);
    BaseComboBoxX bc5 = new BaseComboBoxX("name", "dictionary", "where type='hr_relationship'");
    C5.setEditor(bc5.getCellEditor());

    columns.add(C5);
    ColumnConfig C6 = new ColumnConfig("Birthday", "生日", 80);
    DateField dateField6 = new DateField();
    dateField6.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C6.setEditor(new CellEditor(dateField6));
    C6.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C6);
    ColumnConfig C7 = new ColumnConfig("sex", "性别", 80);
    BaseComboBoxX bc7 = new BaseComboBoxX("name", "dictionary", "where type='hr_sex'");
    C7.setEditor(bc7.getCellEditor());
    columns.add(C7);
    ColumnConfig C8 = new ColumnConfig("Nationality", "国籍", 80);
    BaseComboBoxX bc8 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C8.setEditor(bc8.getCellEditor());
    columns.add(C8);
    ColumnConfig C9 = new ColumnConfig("PassportNo", "护照编码", 80);
    C9.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C9);
    ColumnConfig C10 = new ColumnConfig("PassportIssueCountry", "护照发出地", 80);
    C10.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C10);
    ColumnConfig C11 = new ColumnConfig("PassportIssueDate", "护照发出日期", 80);
    DateField dateField11 = new DateField();
    dateField11.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C11.setEditor(new CellEditor(dateField11));
    C11.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C11);
    ColumnConfig C12 = new ColumnConfig("Occupation", "职业", 80);
    C12.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C12);
    ColumnConfig C13 = new ColumnConfig("Company", "公司", 80);
    C13.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C13);
    ColumnConfig C14 = new ColumnConfig("JobPosition", "职位", 80);
    C14.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C14);

    ColumnModel cm = new ColumnModel(columns);
    bcode_famify_grid = new BaseGrid<BusiObject>(get_bcode_famify_Store(), cm, true, true);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    bcode_famify_grid.setSelectionModel(cbs);
    bcode_famify_grid.setHeight(400);
    return bcode_famify_grid;
  }
Пример #2
0
  BaseFormPanel createbcode_Spouse_Form() {
    form = new BaseFormPanel(get_bcode_Spouse_Store());
    TableLayout tl = new TableLayout(6);

    TableData td = new TableData();
    td.setRowspan(1);
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    td.setVerticalAlign(VerticalAlignment.MIDDLE);
    td.setPadding(2);
    form.setLayout(tl);
    form.setHeaderVisible(false);
    form.setBodyBorder(false);
    form.setPadding(1);

    form.add(new Label("配偶中文名称:"), td);
    TextField<String> C_num3 = new TextField<String>();
    C_num3.setName("Spouse_cnname");
    form.add(C_num3, td);
    form.add(new Label("配偶英文名称:"), td);
    TextField<String> C_num4 = new TextField<String>();
    C_num4.setName("Spouse_enname");
    form.add(C_num4, td);
    form.add(new Label("身份证号:"), td);
    TextField<String> C_num5 = new TextField<String>();
    C_num5.setName("idcard");
    form.add(C_num5, td);
    form.add(new Label("国籍:"), td);
    BaseComboBoxX C_num6 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C_num6.setName("Nationality");
    form.add(C_num6, td);
    form.add(new Label("护照编码:"), td);
    TextField<String> C_num7 = new TextField<String>();
    C_num7.setName("PassportNo");
    form.add(C_num7, td);
    form.add(new Label("护照签发国家:"), td);
    BaseComboBoxX C_num8 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C_num8.setName("PassportIssueCountry");
    form.add(C_num8, td);
    form.add(new Label("护照签发日期:"), td);
    DateField C_data9 = new DateField();
    C_data9.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-M-d"));
    C_data9.setName("PassportIssueDate");
    form.add(C_data9, td);
    form.add(new Label("职业:"), td);
    TextField<String> C_num10 = new TextField<String>();
    C_num10.setName("Occupation");
    form.add(C_num10, td);

    form.add(new Label("公司:"), td);
    TextField<String> C_num11 = new TextField<String>();
    C_num11.setName("Company");
    form.add(C_num11, td);

    form.add(new Label("工作职位:"), td);
    TextField<String> C_num14 = new TextField<String>();
    C_num14.setName("JobPosition");
    form.add(C_num14, td);
    form.inited(126);
    return form;
  };
Пример #3
0
  /** * 主窗口 */
  void initmainpanel() {

    w = new BaseFormPanel(getStore());
    w.setHeaderVisible(false);
    Label cardno_l = new Label("卡号:");
    cardno_l.setWidth("50");
    Label cname_l = new Label("名字:");
    cname_l.setWidth("50");
    Label sex_l = new Label("性别:");
    sex_l.setWidth("50");
    Label edu_l = new Label("学历:");
    Label bird_l = new Label("出生日期:");

    Label mobil_l = new Label("手机号:");
    Label idno_l = new Label("身份证号:");
    Label mark_l = new Label("备注:");

    cardno_t = new TextField<String>();
    cardno_t.setAllowBlank(false);
    cardno_t.addListener(Events.Change, this);
    cname_t = new TextField<String>();
    cname_t.setAllowBlank(false);

    //		passwordc_t.setAllowBlank(false);
    //		password_t.setAllowBlank(false);
    //
    // TextField<String> sex_t = new TextField<String>();
    // BaseGridEditor sex_t= CodeNameMapFactory.aa();
    BaseComboBoxForm<BaseModelData> sex_t = CodeNameMapFactory.createSexInput_F();
    TextField<String> edu_t = new TextField<String>();
    // CodeNameMapFactory codenamemap = new CodeNameMapFactory();

    // BaseGridEditor<String> edu_t =codenamemap.createSexInput_G();

    // createBocdeInput_F
    DateField bird_t = new DateField();
    bird_t.setAutoWidth(true);

    bird_t.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-M-d H:mm:ss"));
    TextField<String> mobil_t = new TextField<String>();
    mobil_t.setAllowBlank(false);
    TextField<String> idno_t = new TextField<String>();

    TextArea mark_t = new TextArea();
    mark_t.setSize(420, 40);
    // TextField<String> password_t = new TextField<String>();

    password_t.setPassword(true);
    passwordc_t.setPassword(true);
    // password_t.setToolTip("将光标放到此处,并由会员录入自己的密码");
    ccode_t = new TextField<String>();
    // ccode_t.setEnabled(false);
    ccode_t.setVisible(false);
    icode_t = new TextField<String>();
    icode_t.setVisible(false);

    cardno_t.setName("s_cardno");
    cname_t.setName("cname");
    password_t.setName("password");

    sex_t.setName("s_sex");
    edu_t.setName("s_edu");
    bird_t.setName("s_birid");
    mobil_t.setName("s_mobil");
    idno_t.setName("s_idno");
    mark_t.setName("s_mark");
    ccode_t.setName("ccode");
    icode_t.setName("icode");
    // password_t.setName("password");

    TableLayout tl = new TableLayout(4);
    tl.setWidth("600");
    w.setLayout(tl);
    TableData td = new TableData();
    td.setColspan(1);
    // td.setWidth("2000");
    td.setMargin(100);
    td.setPadding(5);
    td.setRowspan(1);

    TableData td2 = new TableData();
    td2.setColspan(3);
    // td.setWidth("2000");
    td2.setMargin(100);
    td2.setPadding(5);
    td2.setRowspan(1);

    w.add(cardno_l, td);
    w.add(cardno_t, td);
    w.add(cname_l, td);
    w.add(cname_t, td);

    w.add(mobil_l, td);
    w.add(mobil_t, td);
    w.add(sex_l, td);
    w.add(sex_t, td);

    w.add(new Label("密码:"), td);
    w.add(password_t, td);
    w.add(new Label("重新录入密码:"), td);
    w.add(passwordc_t, td);

    w.add(edu_l, td);
    w.add(edu_t, td);
    w.add(bird_l, td);
    w.add(bird_t, td);

    w.add(idno_l, td);
    w.add(idno_t, td);
    w.add(new Label(""), td);
    w.add(new Label(""), td);
    w.add(mark_l, td);
    w.add(mark_t, td2);

    w.add(new Label("销售人员:"), td);
    BaseComboBoxForm<BaseModelData> cbf = createBcode_filter();
    cbf.setName("rbcode");
    cbf.setAllowBlank(false);
    w.add(cbf, td2);

    w.add(ccode_t, td);
    w.add(icode_t, td);
    w.setBottomComponent(addfinace);

    addfinace.addListener(Events.Select, this);
    addfinace.setEnabled(false);
    w.inited();

    // w.setAutoHeight(true);
    // w.setAutoWidth(true);
    // w.setSize(661, 300);

    cardno_t.addListener(Events.Change, this);
    cname_t.addListener(Events.Change, this);

    // mobil_t.addListener(Events.Change, this);

    cardno_t.setValidateOnBlur(true);
    cname_t.setValidateOnBlur(true);
  }
Пример #4
0
  LayoutContainer initProButtons() {

    TableLayout tl = new TableLayout(2);
    lc.setLayout(tl);

    TableData td1 = new TableData();
    td1.setColspan(1);
    TableData td2 = new TableData();
    td2.setColspan(2);

    bsd_add =
        new BcodeSelectDialog<TreeNodeModelData>() {
          public void doposted(List<TreeNodeModelData> modeldatalist) {
            if (modeldatalist.size() > 0) {
              this.setEmptyText("已经选择了数据");

              List<TreeNodeModelData> selectchecklist = bsd_add.getTree().getCheckedSelection();

              if (selectchecklist.size() <= 0) {
                MessageBox.alert("错误", "请选择“离职人员”", null);
                return;
              }
              String bcodestr = "";
              for (TreeNodeModelData tnmd : selectchecklist) {
                BusiObject bo = new BusiObject();

                bcodestr += " systembcode like '" + tnmd.get("systembcode") + "%25' or ";
              }
              bcodestr += " 1=2";
              GWT.log("bcodestr =" + bcodestr);

              String sql =
                  "select icode, bcode,employstatus,leavereason,leavemark,Resignationdate from bcode_job where exists (select * from systembcode_view where systembcode_view.bcode = bcode_job.bcode  and ( "
                      + bcodestr
                      + "))";
              GWT.log("sql =" + sql);
              store.getStoreinfo().setSql(sql);
              store.reload();
            }
          }
        };
    bsd_add.setNeesreselect(false);
    bsd_add.setEmptyText("未选择数据");
    bsd_add.setExpanded();
    bsd_add.setCheckNodes(CheckNodes.BOTH);

    Resignationdate = new DateField();
    Resignationdate.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));

    save.addListener(Events.OnClick, getListener());
    lc.add(new LabelField("选择人员:"), td1);
    lc.add(bsd_add, td1);

    lc.add(new LabelField("状态改变为:"), td1);
    lc.add(C_num8, td1);

    lc.add(leavereason_l, td1);
    lc.add(C_num9, td1);

    lc.add(resignationdate_l, td1);
    lc.add(Resignationdate, td1);

    lc.add(mark_l, td1);
    lc.add(mark_t, td1);

    leavereason_l.setVisible(false);
    C_num9.setVisible(false);
    mark_l.setVisible(false);
    mark_t.setVisible(false);
    resignationdate_l.setVisible(false);
    Resignationdate.setVisible(false);

    lc.add(save, td2);

    bsd_add.addListener(Events.Changed, getListener());
    C_num8.addListener(Events.Changed, getListener());
    C_num9.addListener(Events.Changed, getListener());
    mark_t.addListener(Events.Changed, getListener());
    Resignationdate.addListener(Events.Changed, getListener());
    return lc;
  }
Пример #5
0
  public PanelGridContrato() {

    setCollapsible(true);
    setResizable(false);
    setMinimizable(true);
    setHeadingHtml("Contratos");
    setSize(700, 459);
    setLayout(new FitLayout());

    mainPanel = new ContentPanel();
    mainPanel.setFrame(true);
    mainPanel.setHeaderVisible(false);
    mainPanel.setLayout(new RowLayout(Orientation.VERTICAL));

    panelTool = new ContentPanel();
    panelTool.setHeaderVisible(false);
    panelTool.setFrame(true);
    panelTool.setCollapsible(true);
    panelTool.setLayout(new AbsoluteLayout());

    btnRelatrio = new Button("Relatório");
    btnRelatrio.setSize("44px", "44px");
    btnRelatrio.setIconAlign(IconAlign.TOP);
    btnRelatrio.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.report24()));
    //		btnRelatrio.setEnabled(false);
    btnRelatrio.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            ParametrosReport parametros = new ParametrosReport();
            parametros.setNomeRelatorio(JasperName.CONTRATO);
            parametros.setContratoId(getSelecaoGrid().getId());

            InstanceService.RELATORIO_SERVICE.relatorio(parametros, new RelatorioCallback());
          }
        });

    panelTool.add(btnRelatrio, new AbsoluteData(606, 6));

    btnEditar = new Button("Editar");
    btnEditar.setSize("44px", "44px");
    btnEditar.setIconAlign(IconAlign.TOP);
    btnEditar.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconEditar24()));
    btnEditar.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {

            DTOContrato contrato = getSelecaoGrid();

            if (contrato != null) {
              FormContrato formContrato = ProviderFacadeManager.formContrato.createInstance();
              formContrato.setModal(true);
              formContrato.loadDTOContrato(contrato);
              formContrato.show();
            } else {
              WebMessageBox.alert("Selecione o contrato para editar!");
            }
          }
        });
    panelTool.add(btnEditar, new AbsoluteData(556, 6));

    btnNovo = new Button("Novo");
    btnNovo.setSize("44px", "44px");
    btnNovo.setIconAlign(IconAlign.TOP);
    btnNovo.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconAdicionar24()));
    btnNovo.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {
            FormContrato formContrato = ProviderFacadeManager.formContrato.createInstance();
            formContrato.setModal(true);
            formContrato.show();
          }
        });
    panelTool.add(btnNovo, new AbsoluteData(506, 6));

    panelTool.add(new LabelField("Cliente:"), new AbsoluteData(6, 6));

    RpcProxy<PagingLoadResult<DTOCliente>> proxyCliente =
        new RpcProxy<PagingLoadResult<DTOCliente>>() {
          @Override
          public void load(
              Object loadConfig, AsyncCallback<PagingLoadResult<DTOCliente>> callback) {
            InstanceService.CLIENTE_SERVICE.loadPagingList((PagingLoadConfig) loadConfig, callback);
          }
        };

    PagingLoader<PagingLoadResult<ModelData>> loaderCliente =
        new BasePagingLoader<PagingLoadResult<ModelData>>(proxyCliente);

    storeCliente = new ListStore<DTOCliente>(loaderCliente);

    comboCliente = new ComboBox<DTOCliente>();
    comboCliente.setStore(storeCliente);
    comboCliente.setSize("286px", "22px");
    comboCliente.setTemplate(getTemplateNome());
    comboCliente.setValueField("id");
    comboCliente.setDisplayField("nome");
    comboCliente.setItemSelector("div.search-item");
    comboCliente.setHideTrigger(true);
    comboCliente.setLoadingText("Carregando...");
    comboCliente.setPageSize(10);
    comboCliente.addListener(
        Events.OnBlur,
        new Listener<ComponentEvent>() {
          public void handleEvent(ComponentEvent evt) {
            if (comboCliente.getValue() == null) {
              comboCliente.clear();
            }
          };
        });

    panelTool.add(comboCliente, new AbsoluteData(6, 28));

    tfData = new DateField();
    tfData.setSize("119px", "22px");
    tfData.setEditable(false);
    tfData.setValue(new Date());
    tfData
        .getDatePicker()
        .addListener(
            Events.Select,
            new Listener<DatePickerEvent>() {
              @Override
              public void handleEvent(DatePickerEvent be) {
                loadContratos();
              }
            });
    tfData.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
    panelTool.add(tfData, new AbsoluteData(298, 28));

    btnPesquisa = new Button();
    btnPesquisa.setSize("44px", "44px");
    btnPesquisa.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconPesquisa24()));
    btnPesquisa.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            pesquisa();
          }
        });
    panelTool.add(btnPesquisa, new AbsoluteData(423, 6));

    panelTool.add(new LabelField("Data:"), new AbsoluteData(300, 6));
    mainPanel.add(panelTool, new RowData(Style.DEFAULT, 75.0, new Margins(3)));

    storeContratos = new ListStore<DTOContrato>();

    gridContratos = new Grid<DTOContrato>(storeContratos, getColumnModel());
    gridContratos.setBorders(true);
    gridContratos.setAutoExpandColumn("nomeCliente");

    mainPanel.add(gridContratos, new RowData(Style.DEFAULT, 340.0, new Margins(3)));

    add(mainPanel);

    loadContratos();
  }