Commit e8351fcb authored by reedmi's avatar reedmi

完善商品添加

parent 853128f1
...@@ -183,6 +183,18 @@ public class Ware extends AbstractModel { ...@@ -183,6 +183,18 @@ public class Ware extends AbstractModel {
this.inventories = inventories; this.inventories = inventories;
} }
public int getCountOfInCosts(){
return getInCosts().size();
}
public int getCountOfOutCosts(){
return getOutCosts().size();
}
public int getCountOfInventories(){
return getInventories().size();
}
@Override @Override
public String toString() { public String toString() {
return "Ware(商品) => [" + super.toString() + ", name=" + name + ", brand=" + brand + ", model=" + model + ", unit=" + unit + "]"; return "Ware(商品) => [" + super.toString() + ", name=" + name + ", brand=" + brand + ", model=" + model + ", unit=" + unit + "]";
...@@ -194,20 +206,19 @@ public class Ware extends AbstractModel { ...@@ -194,20 +206,19 @@ public class Ware extends AbstractModel {
Vendor vendor = getVendor(); Vendor vendor = getVendor();
if (vendor != null) { if (vendor != null) {
vendorUI.put("id", vendor.getId()); vendorUI.put("id", vendor.getId());
vendorUI.put("name", vendor.getName()); vendorUI.put("contactMan", vendor.getContactMan());
} }
return vendorUI; return vendorUI;
} }
public int getCountOfInCosts(){ @JsonProperty("category")
return getInCosts().size(); public Map<String, Object> getCategoryUI() {
} Map<String, Object> categoryUI = new HashMap<String, Object>();
WareCategory category = getCategory();
public int getCountOfOutCosts(){ if (category != null) {
return getOutCosts().size(); categoryUI.put("id", category.getId());
categoryUI.put("name", category.getName());
} }
return categoryUI;
public int getCountOfInventories(){
return getInventories().size();
} }
} }
...@@ -96,8 +96,11 @@ Ext.define('drp.app.view.resources.WareView', { ...@@ -96,8 +96,11 @@ Ext.define('drp.app.view.resources.WareView', {
dataIndex : 'name', dataIndex : 'name',
text : '品名', text : '品名',
renderer : function(value, mate, record) { renderer : function(value, mate, record) {
if(record.data['category.name']) {
return record.data['category.name'] + '-' + value; return record.data['category.name'] + '-' + value;
} }
return value;
}
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 160, width : 160,
......
...@@ -126,7 +126,7 @@ Ext.define("drp.app.view.resources.WareViewForm", { ...@@ -126,7 +126,7 @@ Ext.define("drp.app.view.resources.WareViewForm", {
margin : '5 0 0 5', margin : '5 0 0 5',
name : 'vendor.id', name : 'vendor.id',
valueField : 'id', valueField : 'id',
displayField : 'name', displayField : 'contactMan',
editable : false, editable : false,
store : 'drp.app.store.resources.VendorStore', store : 'drp.app.store.resources.VendorStore',
fieldLabel : '供应商' 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