FormPanel.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. dataIndex : "bd_baseqty",
  178. editor : {
  179. xtype : "numberfield",
  180. decimalPrecision: 3,
  181. minValue:0,
  182. maxLength: 10,
  183. },
  184. renderer : function(v) {
  185. return saas.util.BaseUtil.numberFormat(v, 3, false);
  186. }
  187. }, {
  188. text : "单位",
  189. dataIndex : "bd_unit",
  190. width : 65
  191. }, {
  192. text : "替代料",
  193. dataIndex : "bd_replace",
  194. width : 250,
  195. editor : {
  196. displayField : "display",
  197. editable : true,
  198. format : "",
  199. hideTrigger : false,
  200. maxLength : 100.0,
  201. minValue : null,
  202. positiveNum : false,
  203. queryMode : "local",
  204. store : null,
  205. valueField : "value",
  206. xtype : "productAddMultiDbfindTrigger"
  207. }
  208. }, {
  209. text : "备注",
  210. dataIndex : "bd_remark",
  211. width : 250,
  212. items : null,
  213. editor : {
  214. xtype : "textfield"
  215. },
  216. }]
  217. }, {
  218. xtype: 'hidden',
  219. name: 'bo_statuscode',
  220. fieldLabel: '状态码',
  221. readOnly:true,
  222. defaultValue: ''
  223. }, {
  224. xtype: 'textfield',
  225. name: 'bo_status',
  226. fieldLabel: '产品状态',
  227. readOnly:true,
  228. defaultValue: ''
  229. },{
  230. xtype : "textfield",
  231. name : "creatorName",
  232. readOnly:true,
  233. fieldLabel : "录入人"
  234. },{
  235. xtype : "datefield",
  236. name : "createTime",
  237. fieldLabel : "录入时间"
  238. }],
  239. auditTexts: {
  240. auditCode: 'BANNED',
  241. auditText: '已禁用',
  242. unAuditCode: 'ENABLE',
  243. unAuditText: '已启用',
  244. auditBtnText: '禁用',
  245. unAuditBtnText: '启用',
  246. }
  247. });