ProdOutDetail.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Ext.define('saas.model.purchase.ProdOutDetail', {
  2. extend: 'saas.model.Base',
  3. fields: [
  4. { name: 'id', type: 'int' }, // id
  5. { name: 'pd_prodid', type: 'int' }, // 物料id
  6. { name: 'pd_prodcode', type: 'string' }, // 物料编号
  7. { name: 'pr_brand', type: 'string' }, // 品牌
  8. { name: 'pr_detail', type: 'string' }, // 名称
  9. { name: 'pr_orispeccode', type: 'string' }, // 型号
  10. { name: 'pr_spec', type: 'string' }, // 规格
  11. { name: 'pd_outqty', type: 'float' }, // 数量
  12. { name: 'pr_unit', type: 'string' }, // 单位
  13. { name: 'pd_netprice', type: 'float' }, // 单价
  14. { name: 'pd_orderprice', type: 'float', // 含税单价
  15. convert: function(v, rec) {
  16. return rec.get('pd_netprice') * (1 + rec.get('pd_taxrate') / 100);
  17. },
  18. depends: ['pd_netprice', 'pd_taxrate']
  19. },
  20. { name: 'pd_nettotal', type: 'float', // 金额
  21. convert: function(v, rec) {
  22. return rec.get('pd_netprice') * rec.get('pd_outqty');
  23. },
  24. depends: ['pd_netprice', 'pd_outqty']
  25. },
  26. { name: 'pd_taxrate', type: 'float' }, // 税率
  27. { name: 'pd_taxamount', type: 'float', // 税额
  28. convert: function(v, rec) {
  29. return rec.get('pd_ordertotal') - rec.get('pd_nettotal');
  30. },
  31. depends: ['pd_ordertotal', 'pd_nettotal']
  32. },
  33. { name: 'pd_ordertotal', type: 'float', // 价税合计
  34. convert: function(v, rec) {
  35. return rec.get('pd_orderprice') * rec.get('pd_outqty');
  36. },
  37. depends: ['pd_orderprice', 'pd_outqty']
  38. },
  39. { name: 'pd_whid', type: 'int' }, // 仓库id
  40. { name: 'pd_whcode', type: 'string' }, // 仓库编号
  41. { name: 'pd_whname', type: 'string' }, // 仓库
  42. { name: 'pd_ioid', type: 'int' }, // 验收明细id
  43. { name: 'iocode', type: 'string' }, // 验收单号
  44. { name: 'iodetno', type: 'int' }, // 验收序号
  45. { name: 'pd_remark', type: 'string' }, // 备注
  46. { name: 'pd_text1', type: 'string' },
  47. { name: 'pd_text2', type: 'string' },
  48. { name: 'pd_text3', type: 'string' },
  49. { name: 'pd_text4', type: 'string' },
  50. { name: 'pd_text5', type: 'string' }
  51. ],
  52. //一对一映射
  53. associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
  54. });