Commit e8351fcb authored by reedmi's avatar reedmi

完善商品添加

parent 853128f1
......@@ -183,6 +183,18 @@ public class Ware extends AbstractModel {
this.inventories = inventories;
}
public int getCountOfInCosts(){
return getInCosts().size();
}
public int getCountOfOutCosts(){
return getOutCosts().size();
}
public int getCountOfInventories(){
return getInventories().size();
}
@Override
public String toString() {
return "Ware(商品) => [" + super.toString() + ", name=" + name + ", brand=" + brand + ", model=" + model + ", unit=" + unit + "]";
......@@ -194,20 +206,19 @@ public class Ware extends AbstractModel {
Vendor vendor = getVendor();
if (vendor != null) {
vendorUI.put("id", vendor.getId());
vendorUI.put("name", vendor.getName());
vendorUI.put("contactMan", vendor.getContactMan());
}
return vendorUI;
}
public int getCountOfInCosts(){
return getInCosts().size();
}
public int getCountOfOutCosts(){
return getOutCosts().size();
}
public int getCountOfInventories(){
return getInventories().size();
@JsonProperty("category")
public Map<String, Object> getCategoryUI() {
Map<String, Object> categoryUI = new HashMap<String, Object>();
WareCategory category = getCategory();
if (category != null) {
categoryUI.put("id", category.getId());
categoryUI.put("name", category.getName());
}
return categoryUI;
}
}
......@@ -96,7 +96,10 @@ Ext.define('drp.app.view.resources.WareView', {
dataIndex : 'name',
text : '品名',
renderer : function(value, mate, record) {
return record.data['category.name'] + '-' + value;
if(record.data['category.name']) {
return record.data['category.name'] + '-' + value;
}
return value;
}
}, {
xtype : 'gridcolumn',
......
......@@ -126,7 +126,7 @@ Ext.define("drp.app.view.resources.WareViewForm", {
margin : '5 0 0 5',
name : 'vendor.id',
valueField : 'id',
displayField : 'name',
displayField : 'contactMan',
editable : false,
store : 'drp.app.store.resources.VendorStore',
fieldLabel : '供应商'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment