예제 #1
0
  BaseGrid<BusiObject> create_bcode_contact_Grid() {
    CheckBoxSelectionModel<BusiObject> cbs = new CheckBoxSelectionModel<BusiObject>();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());

    ColumnConfig C3 = new ColumnConfig("enname", "英文名称", 80);
    C3.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C3);
    ColumnConfig C4 = new ColumnConfig("cnname", "中文名称", 80);
    C4.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C4);
    ColumnConfig C5 = new ColumnConfig("tel", "电话", 80);
    C5.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C5);
    ColumnConfig C6 = new ColumnConfig("Relationship", "关系", 80);
    BaseComboBoxX bc6 = new BaseComboBoxX("name", "dictionary", "where type='hr_relationship'");
    C6.setEditor(bc6.getCellEditor());
    columns.add(C6);

    ColumnModel cm = new ColumnModel(columns);
    bcode_contact_grid = new BaseGrid<BusiObject>(getStore(), cm, true, true);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    bcode_contact_grid.setSelectionModel(cbs);
    bcode_contact_grid.setHeight(410);
    bcode_contact_grid.setWidth(750);
    return bcode_contact_grid;
  }
예제 #2
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;
  }
예제 #3
0
  /**
   * 客户的股东和比例
   *
   * @return
   */
  private BaseGrid CreateCCodeGudongPanel() {

    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig gudongmingcheng = new ColumnConfig("gudong", "股东名称", 100);
    TextField<String> gudongmingchengtext = new TextField<String>();
    gudongmingcheng.setEditor(new CellEditor(gudongmingchengtext));
    columns.add(gudongmingcheng);
    ColumnConfig rate = new ColumnConfig("rate", "占股比例", 100);
    TextField<String> ratetext = new TextField<String>();
    rate.setEditor(new CellEditor(ratetext));
    columns.add(rate);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");

    type.addField("gudong");
    type.addField("rate");

    StoreInfo info = new StoreInfo();

    info.setTablename("ccodegudong");
    info.setSql("select * from ccodegudong");
    info.setParent(store); // 关联主表
    info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    info.setLinkparentcolumns(new String[] {"ccode"}); // 关联主表字段
    info.setKeyname(new String[] {"ccode", "idx"}); // 主键

    BaseStore gudong = new BaseStore<JDBCModelData>(type, info);
    gudong.setName("gudong");
    ColumnModel cm = new ColumnModel(columns);
    BaseGrid gudonggrid = new BaseGrid(gudong, cm);

    cbs.setSelectionMode(SelectionMode.SINGLE);

    gudonggrid.setSelectionModel(cbs);
    gudonggrid.setAutoHeight(true);
    gudonggrid.setAutoWidth(true);

    registerStore(gudong);
    return gudonggrid;
  }
예제 #4
0
  BaseGrid createGrid() {
    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());

    //		ColumnConfig C3 = new ColumnConfig("icode",
    //				"icode", 180);
    //		columns.add(C3);

    ColumnConfig C1 = new ColumnConfig("bcode", "人员", 100);

    columns.add(C1);
    ColumnConfig C2 = new ColumnConfig("employstatus", "状态", 100);
    TextField<String> C2_t = new TextField<String>();
    C2.setEditor(new CellEditor(C2_t));
    columns.add(C2);

    ColumnConfig C3 = new ColumnConfig("leavereason", "离职原因", 100);
    TextField<String> C3_t = new TextField<String>();
    C3.setEditor(new CellEditor(C3_t));
    C3.setHidden(true);
    columns.add(C3);

    ColumnConfig C4 = new ColumnConfig("leavemark", "离职备注", 100);
    TextField<String> C4_t = new TextField<String>();
    C4.setEditor(new CellEditor(C4_t));
    C4.setHidden(true);
    columns.add(C4);

    ColumnConfig C5 = new ColumnConfig("Resignationdate", "离职日期", 180);
    C5.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    //		C5.setEditor(new CellEditor(C4_t));
    C5.setHidden(true);
    columns.add(C5);

    ColumnModel cm = new ColumnModel(columns);
    grid = new BaseGrid(getStore(), cm);
    cbs.setSelectionMode(SelectionMode.SIMPLE);
    grid.setSelectionModel(cbs);
    return grid;
  }
예제 #5
0
  private ContentPanel CreateGcode() {
    ContentPanel panel = new ContentPanel();
    //		panel.setSize(400, 400);
    panel.setAutoHeight(true);
    panel.setAutoWidth(true);
    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig gcode = new ColumnConfig("gcode", "商品大类编码", 100);
    TextField<String> gcodetext = new TextField<String>();
    gcode.setEditor(new CellEditor(gcodetext));
    columns.add(gcode);
    ColumnConfig gname = new ColumnConfig("gname", "商品大类名称", 100);
    TextField<String> gnametext = new TextField<String>();
    gname.setEditor(new CellEditor(gnametext));
    columns.add(gname);

    ColumnConfig attrcode = new ColumnConfig("attrcode", "商品大类属性", 100);
    TextField<String> attrcodetext = new TextField<String>();
    attrcode.setEditor(new CellEditor(attrcodetext));
    columns.add(attrcode);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");

    type.addField("gcode");
    type.addField("gname");
    type.addField("attrcode");

    StoreInfo info = new StoreInfo();

    info.setTablename("gcode");
    info.setKeyname(new String[] {"gcode"});
    info.setSql("select * from gcode");
    //		info.setParent(store);// 关联主表
    //		info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    //		info.setLinkparentcolumns(new String[] { "ccode" }); // 关联主表字段
    gcodestore = new BaseStore<JDBCModelData>(type, info);
    //		gudong.setName("gudong");
    //		gudong.setKeyname(new String[] { "ccode", "idx" }); // 主键
    ColumnModel cm = new ColumnModel(columns);
    gcodeegrid = new BaseGrid(gcodestore, cm);

    cbs.setSelectionMode(SelectionMode.SINGLE);

    gcodeegrid.setSelectionModel(cbs);
    gcodeegrid.setAutoHeight(true);
    gcodeegrid.setAutoWidth(true);
    gcodeegrid
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener() {

              @Override
              public void selectionChanged(SelectionChangedEvent se) {
                if (se.getSelection().size() > 0) {
                  //					attrgroupgrid.getModel()
                  attrgroupgrid.getSelectionModel().deselectAll();
                  //	int attr =
                  // ((BaseModelData)gcodeegrid.getSelectionModel().getSelectedItems().get(0)).get("attrcode");
                  //	System.out.println("size="+attrgroupgrid.getStore().getModels().size());
                  //	for(int i=0;i<((BaseModelData)attrgroupgrid.getModel()).getProperties().size())

                  int size = attrgroupgrid.getStore().getModels().size();
                  int attr =
                      Integer.parseInt(
                          ((BaseModelData) gcodeegrid.getSelectionModel().getSelectedItems().get(0))
                              .get("attrcode")
                              .toString());

                  for (int i = 0; i < size; i++) {
                    int attrcode =
                        Integer.parseInt(attrgroupgrid.getValue(i, "attrcode").toString());
                    if ((attrcode & attr) == attrcode) {
                      attrgroupgrid.getSelectionModel().select(i, true);
                    }
                  }

                } else {
                  attrgroupgrid.getSelectionModel().deselectAll();
                }
              }
            });

    registerStore(gcodestore);
    panel.add(gcodeegrid);
    panel.setScrollMode(Scroll.AUTO);
    return panel;
  }
예제 #6
0
  /**
   * 商品大类的属性
   *
   * @return
   */
  private ContentPanel CreateGcodeAttr() {
    ContentPanel panel = new ContentPanel();
    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig gcode = new ColumnConfig("gcode", "商品大类", 100);
    TextField<String> gcodetext = new TextField<String>();
    gcode.setEditor(new CellEditor(gcodetext));
    columns.add(gcode);

    ColumnConfig qty = new ColumnConfig("qty", "商品数量", 100);
    TextField<String> qtytext = new TextField<String>();
    qty.setEditor(new CellEditor(qtytext));
    columns.add(qty);

    ColumnConfig qtyunit = new ColumnConfig("qtyunit", "商品数量单位", 100);
    TextField<String> qtyunittext = new TextField<String>();
    qtyunit.setEditor(new CellEditor(qtyunittext));
    columns.add(qtyunit);

    ColumnConfig discount = new ColumnConfig("discount", "折扣比例", 100);
    TextField<String> discounttext = new TextField<String>();
    discount.setEditor(new CellEditor(discounttext));
    columns.add(discount);
    /*
    ColumnConfig attr = new ColumnConfig("attr", "商品属性", 60);
    TextField<String> attrtext = new TextField<String>();
    attr.setEditor(new CellEditor(attrtext));
    columns.add(attr);

    ColumnConfig attr2 = new ColumnConfig("attr2", "商品属性", 60);
    TextField<String> attr2text = new TextField<String>();
    attr2.setEditor(new CellEditor(attr2text));
    columns.add(attr2);
    ColumnConfig attr3 = new ColumnConfig("attr3", "商品属性", 60);
    TextField<String> attr3text = new TextField<String>();
    attr3.setEditor(new CellEditor(attr3text));
    columns.add(attr3);
    ColumnConfig attr4 = new ColumnConfig("attr4", "商品属性", 60);
    TextField<String> attr4text = new TextField<String>();
    attr4.setEditor(new CellEditor(attr4text));
    columns.add(attr4);
    ColumnConfig attr5 = new ColumnConfig("attr5", "商品属性", 60);
    TextField<String> attr5text = new TextField<String>();
    attr5.setEditor(new CellEditor(attr5text));
    columns.add(attr5);
    ColumnConfig attr6 = new ColumnConfig("attr6", "商品属性", 60);
    TextField<String> attr6text = new TextField<String>();
    attr6.setEditor(new CellEditor(attr6text));
    columns.add(attr6);

    ColumnConfig attr7 = new ColumnConfig("attr7", "商品属性", 60);
    TextField<String> attr7text = new TextField<String>();
    attr7.setEditor(new CellEditor(attr7text));
    columns.add(attr7);

    ColumnConfig attr8 = new ColumnConfig("attr8", "商品属性", 60);
    TextField<String> attr8text = new TextField<String>();
    attr8.setEditor(new CellEditor(attr8text));
    columns.add(attr8);*/

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");

    type.addField("gcode");
    type.addField("qty");
    type.addField("qtyunit");
    type.addField("discount");

    /*		type.addField("attr1");
    type.addField("attr2");
    type.addField("attr3");
    type.addField("attr4");
    type.addField("attr5");
    type.addField("attr6");
    type.addField("attr7");
    type.addField("attr8");*/

    StoreInfo info = new StoreInfo();

    info.setTablename("b2cgcodeattr");

    info.setSql("select gcode,qty,qtyunit,discount from b2cgcodeattr");
    info.setParent(gcodestore); // 关联主表
    info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    info.setLinkparentcolumns(new String[] {"gcode"}); // 关联主表字段
    info.setKeyname(new String[] {"gcode", "idx"});
    BaseStore<JDBCModelData> gcodeattr = new BaseStore<JDBCModelData>(type, info);
    //		gudong.setName("gudong");
    //		gudong.setKeyname(new String[] { "ccode", "idx" }); // 主键
    ColumnModel cm = new ColumnModel(columns);
    BaseGrid attrgrid = new BaseGrid(gcodeattr, cm);

    cbs.setSelectionMode(SelectionMode.SINGLE);

    attrgrid.setSelectionModel(cbs);
    attrgrid.setAutoHeight(true);
    // attrgrid.setAutoWidth(true);

    registerStore(gcodeattr);
    attrgrid.setAutoHeight(true);
    panel.add(attrgrid);

    panel.setScrollMode(Scroll.AUTO);
    return panel;
  }
예제 #7
0
  private ContentPanel CreateGcodeAttrgroup() {
    ContentPanel panel = new ContentPanel();
    CheckBoxSelectionModel cbs =
        new CheckBoxSelectionModel() {
          public void deselectAll() {
            doDeselect(new ArrayList(selected), true);
          }
        };
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig attr = new ColumnConfig("attrcode", "商品属性", 100);
    TextField<String> attrtext = new TextField<String>();
    attr.setEditor(new CellEditor(attrtext));
    columns.add(attr);

    ColumnConfig attrname = new ColumnConfig("attrname", "商品属性", 100);
    //		TextField<String> attrnametext = new TextField<String>();
    //		attrname.setEditor(new CellEditor(attrnametext));
    columns.add(attrname);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");

    type.addField("attrcode");
    type.addField("attrname");

    StoreInfo info = new StoreInfo();

    info.setTablename("b2cgcodeattrgroup");

    info.setSql("select * from b2cgcodeattrgroup");
    //		info.setParent(store);// 关联主表
    //		info.setAutoinccolumn("idx"); // 自增字段,如果子表一定需要
    //		info.setLinkparentcolumns(new String[] { "ccode" }); // 关联主表字段
    BaseStore<JDBCModelData> gcodeattrgroup = new BaseStore<JDBCModelData>(type, info);
    //		gudong.setName("gudong");
    //		gudong.setKeyname(new String[] { "ccode", "idx" }); // 主键
    ColumnModel cm = new ColumnModel(columns);
    attrgroupgrid = new BaseGrid(gcodeattrgroup, cm);

    cbs.setSelectionMode(SelectionMode.MULTI);

    attrgroupgrid.setSelectionModel(cbs);
    attrgroupgrid.setAutoHeight(true);
    attrgroupgrid.setAutoWidth(true);

    attrgroupgrid
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener() {

              @Override
              public void selectionChanged(SelectionChangedEvent se) {

                //
                //	System.out.println("----"+gcodeegrid.getSelectionModel().getSelectedItems().size());
                if (gcodeegrid.getSelectionModel().getSelectedItems().size() < 1
                    && attrgroupgrid.getSelectionModel().getSelectedItems().size() > 0) {

                  MessageBox.alert("警告", "请先选择商品大类!否则属性将不能正确设置。", null);
                  return;
                }

                if (gcodeegrid.getSelectionModel().getSelectedItems().size() < 1) {
                  return;
                }
                int size = se.getSelection().size();
                int z = 0;
                for (int i = 0; i < size; i++) {
                  //
                  //	System.out.println("--"+((BaseModelData)se.getSelection().get(i)).get("attrcode"));
                  z =
                      z
                          | Integer.parseInt(
                              ((BaseModelData) se.getSelection().get(i))
                                  .get("attrcode")
                                  .toString());
                }

                System.out.println("z=" + z);
                // ((BaseModelData)gcodeegrid.getSelectionModel().getSelectedItems().get(0)).set("attrcode", z);
                int index = 0;
                if (gcodeegrid.getSelectionModel().getSelectedItems().size() > 0)
                  index =
                      gcodestore.indexOf(
                          (BaseModelData) gcodeegrid.getSelectionModel().getSelectedItems().get(0));
                if (index >= 0) gcodestore.setValue(index, "attrcode", z);
                else {
                  MessageBox.alert("警告", "未找到指定的行!", null);
                }
              }
            });

    //		registerStore(gcodeattrgroup); 不参与保存,所以不注册
    panel.add(attrgroupgrid);

    return panel;
  }
예제 #8
0
  /**
   * 联系人
   *
   * @return
   */
  public ContentPanel createLinkManPanel() {

    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());

    ColumnConfig lname = new ColumnConfig("lname", "姓名", 80);
    TextField<String> text = new TextField<String>();
    lname.setEditor(new CellEditor(text));
    columns.add(lname);

    ColumnConfig dept = new ColumnConfig("dept", "部门", 80);
    TextField<String> depttext = new TextField<String>();
    dept.setEditor(new CellEditor(depttext));
    columns.add(dept);

    ColumnConfig headship = new ColumnConfig("headship", "职务", 80);
    TextField<String> headshiptext = new TextField<String>();
    headship.setEditor(new CellEditor(headshiptext));
    columns.add(headship);

    ColumnConfig passportcode = new ColumnConfig("passportcode", "护照号", 80);
    TextField<String> passportcodetext = new TextField<String>();
    passportcode.setEditor(new CellEditor(passportcodetext));
    columns.add(passportcode);

    ColumnConfig postcode1 = new ColumnConfig("postcode", "邮编", 80);
    TextField<String> postcodetext = new TextField<String>();
    postcode1.setEditor(new CellEditor(postcodetext));
    columns.add(postcode1);
    ColumnModel cm = new ColumnModel(columns);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");
    type.setTotalName("totle");
    type.addField("ccode", "ccode");

    type.addField("lname");
    type.addField("headship");
    type.addField("dept");
    type.addField("idx");
    type.addField("addr");
    type.addField("headship");
    type.addField("passportcode");

    type.addField("postcode");
    type.addField("telephone");
    type.addField("mobil");
    type.addField("privatemobil");
    type.addField("fax");
    type.addField("addrtype");

    StoreInfo info = new StoreInfo();

    info.setTablename("ccodelinkman_info");
    info.setSql("select * from ccodelinkman_info");
    info.setParent(store);
    info.setAutoinccolumn("idx");
    info.setLinkparentcolumns(new String[] {"ccode"});
    info.setKeyname(new String[] {"ccode", "idx"});

    BaseStore<JDBCModelData> branchorgadd = new BaseStore<JDBCModelData>(type, info);
    branchorgadd.setName("ccodelinkman_info");
    BaseGrid branchorgaddgrid = new BaseGrid(branchorgadd, cm);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    branchorgaddgrid.setSelectionModel(cbs);
    //   officegrid.setAutoExpandColumn("ccode");
    //  panel.setLayout(new BorderLayout());

    // ----------------------------
    final BaseFormPanel formpanel = new BaseFormPanel(branchorgadd);

    TextField<String> branchtelephone = new TextField<String>();
    branchtelephone.setName("telephone");
    branchtelephone.setFieldLabel("办公电话");

    formpanel.add(branchtelephone);
    final TextField<String> mobil = new TextField<String>();
    mobil.setName("mobil");
    mobil.setFieldLabel("移动电话");

    formpanel.add(mobil);

    final TextField<String> privatemobil = new TextField<String>();
    privatemobil.setName("privatemobil");
    privatemobil.setFieldLabel("私人电话");
    formpanel.add(privatemobil);

    privatemobil.addKeyListener(
        new KeyListener() {
          public void componentKeyUp(ComponentEvent event) {
            mobil.setValue(privatemobil.getValue());
          }
        });

    TextField<String> fax = new TextField<String>();
    fax.setName("fax");
    fax.setFieldLabel("传真");

    formpanel.add(fax);

    TextField<String> addrtype = new TextField<String>();
    addrtype.setName("addrtype");
    addrtype.setFieldLabel("地址类型");

    formpanel.add(addrtype);

    final TextField<String> postcode = new TextField<String>();
    postcode.setName("postcode");
    postcode.setFieldLabel("邮编");

    formpanel.add(postcode);

    TextField<String> addr = new TextField<String>();
    addr.setName("addr");
    addr.setFieldLabel("通讯地址");

    formpanel.add(addr);

    formpanel.setScrollMode(Scroll.AUTO);
    formpanel.inited();

    // 设置联系人界面上半部分的布局
    LayoutContainer top = new LayoutContainer();
    TableLayout tl = new TableLayout(2);
    top.setLayout(tl);
    TableData td = new TableData();
    td.setColspan(1);

    td.setRowspan(1);
    td.setVerticalAlign(VerticalAlignment.TOP);
    //			TableData td2 = new TableData();
    //			td2.setColspan(1);
    //			td2.setRowspan(1);

    //		    branchorgaddgrid.setSize(300, 200);
    //   branchorgaddgrid.setAutoWidth(true);
    branchorgaddgrid.setWidth(420);
    branchorgaddgrid.setAutoHeight(true);
    // formpanel.setSize(300, 380);
    formpanel.setHeaderVisible(false);

    top.add(branchorgaddgrid, td);
    top.add(formpanel, td);

    // ----------------家庭成员ccodecustomersolicitude

    List<ColumnConfig> customercolumns = new ArrayList<ColumnConfig>();

    CheckBoxSelectionModel cbs2 = new CheckBoxSelectionModel();

    customercolumns.add(cbs2.getColumn());
    ColumnConfig leaguertype = new ColumnConfig("leaguertype", "家庭成员", 80);
    TextField<String> leaguertext = new TextField<String>();
    leaguertype.setEditor(new CellEditor(leaguertext));
    customercolumns.add(leaguertype);
    ColumnConfig leaguername = new ColumnConfig("leaguername", "姓名", 80);
    TextField<String> leaguernametext = new TextField<String>();
    leaguername.setEditor(new CellEditor(leaguernametext));
    customercolumns.add(leaguername);

    ColumnModel customercm = new ColumnModel(customercolumns);

    ModelType customertype = new ModelType();
    customertype.setRoot("records");
    customertype.setRecordName("record");

    customertype.addField("ccode", "ccode");
    customertype.addField("leaguertype");
    customertype.addField("leaguername");
    customertype.addField("idx");
    customertype.addField("birthday");
    customertype.addField("commemorateday");
    customertype.addField("religion");
    customertype.addField("bekeenon");
    customertype.addField("tourexperience");
    customertype.addField("workexperience");
    customertype.addField("occupation");
    customertype.addField("workheadship");
    customertype.addField("remark");

    StoreInfo customerinfo = new StoreInfo();

    customerinfo.setTablename("ccodecustomersolicitude");
    customerinfo.setSql("select * from ccodecustomersolicitude");
    customerinfo.setParent(store);
    customerinfo.setAutoinccolumn("idx");
    customerinfo.setLinkparentcolumns(new String[] {"ccode"});
    customerinfo.setKeyname(new String[] {"ccode", "idx"});

    BaseStore<JDBCModelData> customertypestore =
        new BaseStore<JDBCModelData>(customertype, customerinfo);
    customertypestore.setName("ccodecustomersolicitude");
    BaseGrid customertypegrid = new BaseGrid(customertypestore, customercm);

    cbs2.setSelectionMode(SelectionMode.SINGLE);
    customertypegrid.setSelectionModel(cbs2);
    // ---------------------
    // --
    BaseFormPanel formcustomerpanel = new BaseFormPanel(customertypestore);
    formcustomerpanel.setHeaderVisible(false);

    TextField<String> birthdayc = new TextField<String>();
    birthdayc.setName("birthday");
    birthdayc.setFieldLabel("生日");

    formcustomerpanel.add(birthdayc);

    TextField<String> commemorateday = new TextField<String>();
    commemorateday.setName("commemorateday");
    commemorateday.setFieldLabel("纪念日");

    formcustomerpanel.add(commemorateday);

    TextField religion = new TextField();
    religion.setName("religion");
    religion.setFieldLabel("信仰");
    formcustomerpanel.add(religion);

    TextField bekeenon = new TextField();
    bekeenon.setName("bekeenon");
    bekeenon.setFieldLabel("主要爱好");

    formcustomerpanel.add(bekeenon);

    TextField tourexperience = new TextField();
    tourexperience.setName("tourexperience");
    tourexperience.setFieldLabel("旅游经历");

    formcustomerpanel.add(tourexperience);

    TextField workexperience = new TextField();
    workexperience.setName("workexperience");
    workexperience.setFieldLabel("工作经历");

    formcustomerpanel.add(workexperience);

    TextField occupation = new TextField();
    occupation.setName("occupation");
    occupation.setFieldLabel("职业");

    formcustomerpanel.add(occupation);

    TextField workheadship = new TextField();
    workheadship.setName("workheadship");
    workheadship.setFieldLabel("工作职位");

    formcustomerpanel.add(workheadship);

    TextField remark = new TextField();
    remark.setName("remark");
    remark.setFieldLabel("备注");

    formcustomerpanel.add(remark);
    formcustomerpanel.setScrollMode(Scroll.AUTO);
    formcustomerpanel.inited();
    //			    FormBinding formcustomerBindings = new FormBinding(formcustomerpanel, true);
    //			    formcustomerBindings.setStore(customertypestore);

    // --end

    ContentPanel panel = new ContentPanel();

    panel.setLayout(new TableLayout(2));
    panel.setHeaderVisible(false);

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

    //   panel.add(formpanel,td2);
    customertypegrid.setAutoHeight(true);
    //		    customertypegrid.setAutoWidth(true);
    customertypegrid.setWidth(420);
    //  formcustomerpanel.setSize(300, 300);

    TableData td2 = new TableData();
    td2.setColspan(1);
    td2.setRowspan(1);

    LayoutContainer bottom = new LayoutContainer();

    TableLayout bottomtl = new TableLayout(2);
    bottom.setLayout(bottomtl);
    TableData bottomtd = new TableData();
    bottomtd.setVerticalAlign(VerticalAlignment.TOP);
    bottomtd.setColspan(1);
    bottomtd.setRowspan(1);

    bottom.add(customertypegrid, bottomtd);
    bottom.add(formcustomerpanel, bottomtd);
    FieldSet fieldset = new FieldSet();
    fieldset.setHeading("联系人");
    FieldSet fieldset2 = new FieldSet();
    fieldset2.setHeading("联系人家庭成员信息");
    fieldset.add(top);
    fieldset2.add(bottom);

    panel.add(fieldset, td1);
    panel.add(fieldset2, td1);
    panel.setScrollMode(Scroll.AUTO);
    panel.setAutoHeight(true);
    panel.setAutoWidth(true);
    return panel;
  }
예제 #9
0
  // 办公地址信息
  public ContentPanel createOfficePanel() {
    ContentPanel panel = new ContentPanel();
    panel.setSize(400, 400);
    CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig ccode = new ColumnConfig("ccode", "ccode", 100);
    columns.add(ccode);

    ColumnConfig column = new ColumnConfig("addrtype", "地址类型", 100);
    TextField<String> text = new TextField<String>();
    column.setEditor(new CellEditor(text));
    columns.add(column);
    ColumnConfig addr = new ColumnConfig("addr", "街道", 100);
    TextField<String> addrtext = new TextField<String>();
    addr.setEditor(new CellEditor(addrtext));
    columns.add(addr);

    ColumnConfig ncode = new ColumnConfig("ncode", "国别地区", 100);
    TextField<String> ncodetext = new TextField<String>();
    ncode.setEditor(new CellEditor(ncodetext));
    columns.add(ncode);

    ColumnConfig fax = new ColumnConfig("fax", "传真", 100);
    TextField<String> faxtext = new TextField<String>();
    fax.setEditor(new CellEditor(faxtext));
    columns.add(fax);

    ColumnModel cm = new ColumnModel(columns);

    ModelType type = new ModelType();
    type.setRoot("records");
    type.setRecordName("record");

    type.addField("ccode", "ccode");
    type.addField("idx");
    type.addField("addrtype");
    type.addField("addr");
    type.addField("ncode");
    type.addField("fax");
    StoreInfo info = new StoreInfo();

    info.setTablename("ccodeofficeaddress");
    info.setSql("select * from ccodeofficeaddress");
    info.setParent(store);
    info.setAutoinccolumn("idx");
    info.setLinkparentcolumns(new String[] {"ccode"});
    info.setKeyname(new String[] {"ccode", "idx"});

    BaseStore<JDBCModelData> officestore = new BaseStore<JDBCModelData>(type, info);
    officestore.setName("ccodeofficeaddress");
    BaseGrid officegrid = new BaseGrid(officestore, cm);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    officegrid.setSelectionModel(cbs);
    // officegrid.setAutoExpandColumn("ccode");
    // panel.setLayout(new BorderLayout());
    panel.setLayout(new FitLayout());
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0));
    panel.add(officegrid);
    // officegrid.set

    registerStore(officestore);
    return panel;
  }
예제 #10
0
  /**
   * 客户资料
   *
   * @return
   */
  private LayoutContainer CreateCCodeDetailPanel() {
    LayoutContainer main = new LayoutContainer();
    TableLayout tl = new TableLayout(2);

    main.setLayout(new TableLayout(2));
    BaseFormPanel leftpanel = new BaseFormPanel(store);
    leftpanel.setLayout(new FormLayout());
    FormData fd = new FormData(200, 30);
    leftpanel.setHeaderVisible(false);
    leftpanel.setBodyBorder(false);

    BaseFormPanel rightpanel = new BaseFormPanel(store);
    rightpanel.setBodyBorder(false);
    rightpanel.setHeaderVisible(false);

    TextField<String> ccode = new TextField<String>();
    ccode.setName("ccode");
    ccode.setAllowBlank(false);
    ccode.setFieldLabel("编码");

    TextField<String> name = new TextField<String>();
    name.setName("cname");
    name.setAllowBlank(false);
    name.setFieldLabel("名称");

    TextField<String> shortcode = new TextField<String>();
    shortcode.setName("shortcode");
    shortcode.setFieldLabel("简码");
    TextField<String> ccodesource = new TextField<String>();
    ccodesource.setName("ccodesource");
    ccodesource.setFieldLabel("客户来源");

    TextField<String> ncode = new TextField<String>();
    ncode.setName("ncode");
    ncode.setFieldLabel("国别");

    TextField<String> httpurl = new TextField<String>();
    httpurl.setName("httpurl");
    httpurl.setFieldLabel("网址");

    DateField setupdate = new DateField();
    setupdate.setName("setupdate");
    setupdate.setFieldLabel("成立时间");
    TextField<String> registercapital = new TextField<String>();
    registercapital.setName("registercapital");
    registercapital.setFieldLabel("注册资金");

    TextField<String> employeenum = new TextField<String>();
    employeenum.setName("employeenum");
    employeenum.setFieldLabel("雇用人数");

    TextField<String> branchorgnum = new TextField<String>();
    branchorgnum.setName("branchorgnum");
    branchorgnum.setFieldLabel("分支机构数");

    TextField<String> artperson = new TextField<String>();
    artperson.setName("artperson");
    artperson.setFieldLabel("法人代表");

    TextField<String> taxno = new TextField<String>();
    taxno.setName("taxno");
    taxno.setFieldLabel("税务登记号");

    TextField<String> partner = new TextField<String>();
    partner.setName("partner");
    partner.setFieldLabel("合伙人");

    /*
     * TextField<String> artno = new TextField<String>();
     * artno.setName("artno"); artno.setFieldLabel("企业代码");
     */

    TextField<String> comholsdatedesc = new TextField<String>();
    comholsdatedesc.setName("comholsdatedesc");
    comholsdatedesc.setFieldLabel("公司特殊假日");

    BaseGrid gudong = CreateCCodeGudongPanel();
    gudong.setAutoHeight(true);
    gudong.setAutoWidth(true);
    leftpanel.add(ccode, fd);
    rightpanel.add(name, fd);
    leftpanel.add(shortcode, fd);
    rightpanel.add(ccodesource, fd);
    leftpanel.add(httpurl, fd);
    rightpanel.add(setupdate, fd);
    leftpanel.add(registercapital, fd);
    rightpanel.add(employeenum, fd);
    leftpanel.add(branchorgnum, fd);
    rightpanel.add(artperson, fd);
    leftpanel.add(taxno, fd);
    rightpanel.add(partner, fd);
    leftpanel.add(comholsdatedesc, fd);

    TableData td = new TableData();
    td.setColspan(1);
    td.setRowspan(1);
    // 对齐方式
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    td.setVerticalAlign(VerticalAlignment.TOP);
    // rightpanel.add(gudong,td2);
    leftpanel.inited();
    rightpanel.inited();
    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeading("股东占股比例");
    fieldSet.add(gudong);
    main.add(leftpanel, td);
    main.add(rightpanel, td);
    main.add(fieldSet, td);
    return main;
  }
예제 #11
0
  public Widget aa() {
    int armStatus = ArmWrapper.FAILED;
    try {
      ArmWrapper.startTransaction(
          this, "com.base.myproject.client.busi.b2c.manager.ChartTest", "aa", new Object[] {});
      ContentPanel panel = new ContentPanel();
      panel.setAutoHeight(true);
      ToolBar tb = new ToolBar();
      Button addsuit = new Button("从商品库里添加套装商品");
      addsuit.setIconStyle("b2csuit");
      panel.setHeading("商品库,如果加入套装你必须先选择一行(必选)");
      tb.add(addsuit);
      panel.setTopComponent(tb);
      // addsuit.addListener(Events.Select, this);
      panel.setAutoWidth(true);
      CheckBoxSelectionModel cbs = new CheckBoxSelectionModel();
      List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
      columns.add(cbs.getColumn());
      ColumnConfig gcode = new ColumnConfig("gcode", "商品大类编码", 100);
      TextField<String> gcodetext = new TextField<String>();
      gcode.setEditor(new CellEditor(gcodetext));
      columns.add(gcode);
      ColumnConfig gname = new ColumnConfig("discountprice", "商品大类名称", 100);
      TextField<String> gnametext = new TextField<String>();
      gname.setEditor(new CellEditor(gnametext));
      columns.add(gname);

      ColumnConfig treecode = new ColumnConfig("price", "商品分类树编码", 100);

      TextField<String> treecodetext = new TextField<String>();
      treecode.setEditor(new CellEditor(treecodetext));
      columns.add(treecode);

      ColumnConfig b2cgcodecolumn = new ColumnConfig("b2cgcode", "商品编码", 100);
      TextField<String> b2cgcodetext = new TextField<String>();
      b2cgcodecolumn.setEditor(new CellEditor(b2cgcodetext));
      columns.add(b2cgcodecolumn);
      ColumnConfig b2cgname = new ColumnConfig("b2cgname", "商品名称", 100);
      TextField<String> b2cgnametext = new TextField<String>();
      b2cgname.setEditor(new CellEditor(b2cgnametext));
      columns.add(b2cgname);

      ModelType type = new ModelType();
      type.setRoot("records");
      type.setRecordName("record");

      type.addField("gcode");
      type.addField("gname");
      type.addField("b2cgcode");
      type.addField("price");
      type.addField("discountprice");
      type.addField("b2cgname");
      type.addField("mainimagepath");
      type.addField("treecode");
      type.addField("detailimage");

      StoreInfo info = new StoreInfo();

      info.setTablename("b2cgcode");
      info.setKeyname(new String[] {"b2cgcode"});
      info.setSql("select * from b2cgcode");
      BaseStore<JDBCModelData> store = new BaseStore<JDBCModelData>(type, info);

      ChartModel model =
          new ChartModel(
              "Team Sales by Month", "font-size: 14px; font-family: Verdana; text-align: center;");
      model.setBackgroundColour("#fefefe");
      model.setLegend(new Legend(Position.TOP, true));
      model.setScaleProvider(ScaleProvider.ROUNDED_NEAREST_SCALE_PROVIDER);

      BarChart bar = new BarChart(BarStyle.GLASS);
      bar.setColour("#00aa00");
      BarDataProvider barProvider = new BarDataProvider("price", "b2cgname");
      barProvider.bind(store);
      bar.setDataProvider(barProvider);
      //  bar.addChartListener(listener);
      model.addChartConfig(bar);

      bar = new BarChart(BarStyle.GLASS);
      bar.setColour("#ff6600");
      barProvider = new BarDataProvider("discountprice");
      barProvider.bind(store);
      bar.setDataProvider(barProvider);
      // bar.addChartListener(listener);
      model.addChartConfig(bar);

      LineChart line = new LineChart();
      line.setAnimateOnShow(true);
      line.setText("Average");
      line.setColour("#FF0000");
      LineDataProvider lineProvider = new LineDataProvider("discountprice");
      lineProvider.bind(store);
      line.setDataProvider(lineProvider);
      model.addChartConfig(line);

      /*	    PieChart pie = new PieChart();
      PieDataProvider piedataprovider = new PieDataProvider("discountprice");
      piedataprovider.bind(store);
      pie.setDataProvider(piedataprovider);
      model.addChartConfig(pie);*/

      String url = "chart/open-flash-chart.swf";
      final Chart chart = new Chart(url);
      chart.setChartModel(model);
      chart.setHeight("300px");
      ContentPanel cp = new ContentPanel();
      cp.setHeading("Chart");
      cp.add(chart);
      ColumnModel cm = new ColumnModel(columns);
      BaseGrid grid = new BaseGrid(store, cm);
      grid.setHeight("300px");
      cp.add(grid);
      armStatus = ArmWrapper.GOOD;
      return cp;
    } finally {
      ArmWrapper.stopTransaction(
          "com.base.myproject.client.busi.b2c.manager.ChartTest", "aa", armStatus);
    }
  }