FormPanel.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. Ext.define('saas.view.document.bom.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'document-bom-formpanel',
  4. controller: 'document-bom-formpanel',
  5. viewModel: 'document-bom-formpanel',
  6. caller:'Bom',
  7. //字段属性
  8. _title:'BOM资料',
  9. _idField: 'id',
  10. _codeField: 'codefied',
  11. _statusField: 'bo_status',
  12. _statusCodeField: 'bo_statuscode',
  13. _readUrl:'/api/document/bom/read',
  14. _saveUrl:'/api/document/bom/save',
  15. _openUrl:'/api/document/bom/open',
  16. _closeUrl:'/api/document/bom/close',
  17. _deleteUrl:'/api/document/bom/delete',
  18. initId:0,
  19. _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
  20. codeInHeader: false,
  21. defaultButtons:[{
  22. cls: 'x-formpanel-btn-blue',
  23. xtype: 'button',
  24. text: '新增',
  25. bind: {
  26. hidden: '{!id}'
  27. },
  28. handler: 'add'
  29. }, {
  30. xtype: 'button',
  31. text: '保存',
  32. handler: 'onSave'
  33. }, {
  34. xtype: 'button',
  35. text: '删除',
  36. handler: 'delete'
  37. }, {
  38. xtype: 'button',
  39. bind: {
  40. text: '{auditBtnText}'
  41. },
  42. handler: "auditBtnClick",
  43. }],
  44. defaultItems: [{
  45. xtype: 'hidden',
  46. name: 'id',
  47. fieldLabel: 'id',
  48. },{
  49. xtype: 'hidden',
  50. name: 'bo_motherid',
  51. fieldLabel: '产品id'
  52. },{
  53. xtype : "productDbfindTrigger",
  54. name: 'bo_mothercode',
  55. fieldLabel: '产品编号',
  56. allowBlank: false
  57. },{
  58. xtype: 'textfield',
  59. name: 'pr_brand',
  60. fieldLabel: '品牌',
  61. readOnly:true,
  62. },{
  63. xtype: 'textfield',
  64. name: 'bo_mothername',
  65. fieldLabel: '产品名称',
  66. readOnly:true,
  67. allowBlank: false
  68. },{
  69. xtype: 'textfield',
  70. name: 'pr_orispeccode',
  71. fieldLabel: '产品型号',
  72. readOnly:true,
  73. },{
  74. xtype: 'textfield',
  75. name: 'pr_spec',
  76. fieldLabel: '产品规格',
  77. readOnly:true,
  78. ignore:true
  79. },{
  80. xtype: 'textfield',
  81. name: 'bo_version',
  82. fieldLabel: '版本号',
  83. allowBlank: false
  84. }, {
  85. xtype : "detailGridField",
  86. detnoColumn: 'bd_detno',
  87. showCount: false,
  88. storeModel:'saas.model.document.bomdetail',
  89. deleteDetailUrl:'/api/document/bom/deleteDetail',
  90. columns : [
  91. {
  92. text : "ID",
  93. dataIndex : "id",
  94. hidden : true,
  95. xtype : "numbercolumn"
  96. }, {
  97. text : "关联ID",
  98. dataIndex : "bd_bomid",
  99. hidden : true,
  100. xtype : "numbercolumn"
  101. }, {
  102. allowBlank:false,
  103. text : "物料编号",
  104. dataIndex : "bd_soncode",
  105. width : 150,
  106. editor : {
  107. displayField : "display",
  108. editable : true,
  109. format : "",
  110. hideTrigger : false,
  111. maxLength : 100.0,
  112. minValue : null,
  113. positiveNum : false,
  114. queryMode : "local",
  115. store : null,
  116. valueField : "value",
  117. xtype : "productMultiDbfindTrigger"
  118. }
  119. }, {
  120. allowBlank:false,
  121. text : "物料ID",
  122. hidden : true,
  123. dataIndex : "bd_sonid",
  124. }, {
  125. text: 'model映射需要',
  126. dataIndex: 'productDTO',
  127. hidden: true,
  128. }, {
  129. text : "品牌",
  130. width : 100.0,
  131. dataIndex : "pr_brand",
  132. ignore:true,
  133. renderer: function (v, m, r) {
  134. if(!v){
  135. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  136. }
  137. return v;
  138. }
  139. }, {
  140. text : "物料名称",
  141. width : 150.0,
  142. dataIndex : "pr_detail",
  143. ignore:true,
  144. renderer: function (v, m, r) {
  145. if(!v){
  146. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  147. }
  148. return v;
  149. }
  150. },
  151. {
  152. text : "型号",
  153. width : 200.0,
  154. dataIndex : "pr_orispeccode",
  155. ignore:true,
  156. renderer: function (v, m, r) {
  157. if(!v){
  158. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  159. }
  160. return v;
  161. }
  162. },{
  163. text : "规格",
  164. width : 200,
  165. dataIndex : "pr_spec",
  166. ignore:true,
  167. renderer: function (v, m, r) {
  168. if(!v){
  169. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  170. }
  171. return v;
  172. }
  173. }, {
  174. allowBlank:false,
  175. text : "用量",
  176. width : 110,
  177. xtype : "numbercolumn",
  178. dataIndex : "bd_baseqty",
  179. editor : {
  180. xtype : "numberfield",
  181. decimalPrecision: 3,
  182. minValue:0,
  183. maxLength: 10,
  184. align: 'end'
  185. },
  186. renderer : function(v) {
  187. return saas.util.BaseUtil.numberFormat(v, 3, false);
  188. }
  189. }, {
  190. text : "单位",
  191. dataIndex : "bd_unit",
  192. width : 65
  193. }, {
  194. text : "替代料",
  195. dataIndex : "bd_replace",
  196. width : 250,
  197. editor : {
  198. displayField : "display",
  199. editable : true,
  200. format : "",
  201. hideTrigger : false,
  202. maxLength : 100.0,
  203. minValue : null,
  204. positiveNum : false,
  205. queryMode : "local",
  206. store : null,
  207. valueField : "value",
  208. xtype : "productAddMultiDbfindTrigger"
  209. }
  210. }, {
  211. text : "备注",
  212. dataIndex : "bd_remark",
  213. width : 250,
  214. items : null,
  215. editor : {
  216. xtype : "textfield"
  217. },
  218. }]
  219. }, {
  220. xtype: 'hidden',
  221. name: 'bo_statuscode',
  222. fieldLabel: '状态码',
  223. readOnly:true,
  224. defaultValue: ''
  225. }, {
  226. xtype: 'textfield',
  227. name: 'bo_status',
  228. fieldLabel: '产品状态',
  229. readOnly:true,
  230. defaultValue: ''
  231. },{
  232. xtype : "textfield",
  233. name : "creatorName",
  234. readOnly:true,
  235. fieldLabel : "录入人"
  236. },{
  237. xtype : "datefield",
  238. name : "createTime",
  239. fieldLabel : "录入时间"
  240. }],
  241. auditTexts: {
  242. auditCode: 'BANNED',
  243. auditText: '已禁用',
  244. unAuditCode: 'ENABLE',
  245. unAuditText: '已启用',
  246. auditBtnText: '禁用',
  247. unAuditBtnText: '启用',
  248. }
  249. });