MakeScrapDetail.js 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. Ext.define('make.model.make.MakeScrapDetail', {
  2. extend: 'saas.model.Base',
  3. fields: [
  4. { name: 'id', type: 'int' }, // id
  5. { name: 'md_detno', type: 'int' }, // 序号
  6. { name: 'md_prodid', type: 'int' }, // 物料id
  7. { name: 'md_prodcode', type: 'string' }, // 物料编号
  8. { name: 'md_qty', type: 'float' }, // 数量
  9. { name: 'pr_unit', type: 'string' }, // 单位
  10. { name: 'md_price', type: 'float'}, // 单价
  11. { name: 'md_total', type: 'float', // 金额
  12. convert: function(v, rec) {
  13. var t = rec.get('md_price') * rec.get('md_qty');
  14. return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
  15. },
  16. depends: ['md_price', 'md_qty']
  17. },
  18. { name: 'md_maid', type: 'int' }, // 工单id
  19. { name: 'md_mmid', type: 'int' }, // 用料表id
  20. { name: 'md_omacode', type: 'string' }, // 采购单号
  21. { name: 'md_mmdetno', type: 'int' }, // 工单序号
  22. { name: 'md_remark', type: 'string' }, // 备注
  23. { name: 'md_text1', type: 'string' },
  24. { name: 'md_text2', type: 'string' },
  25. { name: 'md_text3', type: 'string' },
  26. { name: 'md_text4', type: 'string' },
  27. { name: 'md_text5', type: 'string' },
  28. ],
  29. //一对一映射
  30. associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
  31. });