FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. viewName: 'document-bom-formpanel',
  7. caller: 'Bom',
  8. //字段属性
  9. _title: 'BOM资料',
  10. _idField: 'id',
  11. _codeField: 'codefied',
  12. _statusField: 'bo_status',
  13. _statusCodeField: 'bo_statuscode',
  14. _readUrl: '/api/document/bom/read',
  15. _saveUrl: '/api/document/bom/save',
  16. _openUrl: '/api/document/bom/open',
  17. _closeUrl: '/api/document/bom/close',
  18. _deleteUrl: '/api/document/bom/delete',
  19. initId: 0,
  20. _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
  21. codeInHeader: false,
  22. defaultButtons: [{
  23. cls: 'x-formpanel-btn-blue',
  24. xtype: 'button',
  25. text: '新增',
  26. bind: {
  27. hidden: '{!id}'
  28. },
  29. handler: 'add'
  30. }, {
  31. xtype: 'button',
  32. text: '保存',
  33. handler: 'onSave'
  34. }, {
  35. xtype: 'button',
  36. text: '删除',
  37. handler: 'delete'
  38. }, {
  39. xtype: 'button',
  40. bind: {
  41. text: '{auditBtnText}'
  42. },
  43. handler: "auditBtnClick",
  44. }],
  45. auditTexts: {
  46. auditCode: 'BANNED',
  47. auditText: '已禁用',
  48. unAuditCode: 'ENABLE',
  49. unAuditText: '已启用',
  50. auditBtnText: '禁用',
  51. unAuditBtnText: '启用',
  52. },
  53. initComponent: function () {
  54. Ext.applyIf(this, {
  55. defaultItems: [{
  56. xtype: 'hidden',
  57. name: 'id',
  58. fieldLabel: 'id',
  59. }, {
  60. xtype: 'hidden',
  61. name: 'bo_motherid',
  62. fieldLabel: '产品id'
  63. }, {
  64. xtype: "productDbfindTrigger",
  65. name: 'bo_mothercode',
  66. fieldLabel: '产品编号',
  67. allowBlank: false
  68. }, {
  69. xtype: 'textfield',
  70. name: 'pr_brand',
  71. fieldLabel: '品牌',
  72. readOnly: true,
  73. }, {
  74. xtype: 'textfield',
  75. name: 'bo_mothername',
  76. fieldLabel: '产品名称',
  77. readOnly: true,
  78. allowBlank: false
  79. }, {
  80. xtype: 'textfield',
  81. name: 'pr_orispeccode',
  82. fieldLabel: '产品型号',
  83. readOnly: true,
  84. }, {
  85. xtype: 'textfield',
  86. name: 'pr_spec',
  87. fieldLabel: '产品规格',
  88. readOnly: true,
  89. ignore: true
  90. }, {
  91. xtype: 'textfield',
  92. name: 'bo_version',
  93. fieldLabel: '版本号',
  94. allowBlank: false
  95. }, {
  96. xtype: "detailGridField",
  97. name: 'detailGridField',
  98. detnoColumn: 'bd_detno',
  99. showCount: false,
  100. storeModel: 'saas.model.document.bomdetail',
  101. deleteDetailUrl: '/api/document/bom/deleteDetail',
  102. columns: [{
  103. text: "ID",
  104. dataIndex: "id",
  105. hidden: true,
  106. xtype: "numbercolumn"
  107. }, {
  108. text: "关联ID",
  109. dataIndex: "bd_bomid",
  110. hidden: true,
  111. xtype: "numbercolumn"
  112. }, {
  113. allowBlank: false,
  114. text: "物料编号",
  115. dataIndex: "bd_soncode",
  116. width: 150,
  117. editor: {
  118. displayField: "display",
  119. editable: true,
  120. format: "",
  121. hideTrigger: false,
  122. maxLength: 100.0,
  123. minValue: null,
  124. positiveNum: false,
  125. queryMode: "local",
  126. store: null,
  127. valueField: "value",
  128. xtype: "productMultiDbfindTrigger"
  129. }
  130. }, {
  131. allowBlank: false,
  132. text: "物料ID",
  133. hidden: true,
  134. dataIndex: "bd_sonid",
  135. }, {
  136. text: 'model映射需要',
  137. dataIndex: 'productDTO',
  138. hidden: true,
  139. }, {
  140. text: "品牌",
  141. width: 100.0,
  142. dataIndex: "pr_brand",
  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. text: "物料名称",
  152. width: 150.0,
  153. dataIndex: "pr_detail",
  154. ignore: true,
  155. renderer: function (v, m, r) {
  156. if (!v) {
  157. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  158. }
  159. return v;
  160. }
  161. }, {
  162. text: "型号",
  163. width: 200.0,
  164. dataIndex: "pr_orispeccode",
  165. ignore: true,
  166. renderer: function (v, m, r) {
  167. if (!v) {
  168. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  169. }
  170. return v;
  171. }
  172. }, {
  173. text: "规格",
  174. width: 200,
  175. dataIndex: "pr_spec",
  176. ignore: true,
  177. renderer: function (v, m, r) {
  178. if (!v) {
  179. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  180. }
  181. return v;
  182. }
  183. }, {
  184. allowBlank: false,
  185. text: "用量",
  186. width: 110,
  187. xtype: "numbercolumn",
  188. dataIndex: "bd_baseqty",
  189. editor: {
  190. xtype: "numberfield",
  191. decimalPrecision: 3,
  192. minValue: 0,
  193. maxLength: 10,
  194. align: 'end'
  195. },
  196. renderer: function(v, m, r) {
  197. return saas.util.BaseUtil.numberFormat(v, 3, false);
  198. }
  199. }, {
  200. text: "单位",
  201. dataIndex: "bd_unit",
  202. width: 65
  203. }, {
  204. text: "替代料",
  205. dataIndex: "bd_replace",
  206. width: 250,
  207. editor: {
  208. displayField: "display",
  209. editable: true,
  210. format: "",
  211. hideTrigger: false,
  212. maxLength: 100.0,
  213. minValue: null,
  214. positiveNum: false,
  215. queryMode: "local",
  216. store: null,
  217. valueField: "value",
  218. xtype: "productAddMultiDbfindTrigger"
  219. }
  220. }, {
  221. text: "备注",
  222. dataIndex: "bd_remark",
  223. width: 250,
  224. items: null,
  225. editor: {
  226. xtype: "textfield"
  227. },
  228. }, {
  229. dataIndex: "bd_text1",
  230. text: "自定义字段1",
  231. width: 100,
  232. hidden: true,
  233. initHidden: false,
  234. editor: {
  235. xtype: "textfield"
  236. },
  237. }, {
  238. dataIndex: "bd_text2",
  239. text: "自定义字段2",
  240. width: 100,
  241. hidden: true,
  242. initHidden: false,
  243. editor: {
  244. xtype: "textfield"
  245. },
  246. }, {
  247. dataIndex: "bd_text3",
  248. text: "自定义字段3",
  249. width: 100,
  250. hidden: true,
  251. initHidden: false,
  252. editor: {
  253. xtype: "textfield"
  254. },
  255. }, {
  256. dataIndex: "bd_text4",
  257. text: "自定义字段4",
  258. width: 100,
  259. hidden: true,
  260. initHidden: false,
  261. editor: {
  262. xtype: "textfield"
  263. },
  264. }, {
  265. dataIndex: "bd_text5",
  266. text: "自定义字段5",
  267. width: 100,
  268. hidden: true,
  269. initHidden: false,
  270. editor: {
  271. xtype: "textfield"
  272. },
  273. }]
  274. }, {
  275. xtype: 'hidden',
  276. name: 'bo_statuscode',
  277. fieldLabel: '状态码',
  278. readOnly: true,
  279. defaultValue: ''
  280. }, {
  281. xtype: 'textfield',
  282. name: 'bo_status',
  283. fieldLabel: '产品状态',
  284. readOnly: true,
  285. defaultValue: ''
  286. }, {
  287. xtype: "textfield",
  288. name: "creatorName",
  289. readOnly: true,
  290. fieldLabel: "录入人"
  291. }, {
  292. xtype: "datefield",
  293. name: "createTime",
  294. fieldLabel: "录入时间"
  295. }, {
  296. xtype: "textfield",
  297. name: "bo_text1",
  298. fieldLabel: "自定义字段1",
  299. hidden: true,
  300. initHidden: false
  301. }, {
  302. xtype: "textfield",
  303. name: "bo_text2",
  304. fieldLabel: "自定义字段2",
  305. hidden: true,
  306. initHidden: false
  307. }, {
  308. xtype: "textfield",
  309. name: "bo_text3",
  310. fieldLabel: "自定义字段3",
  311. hidden: true,
  312. initHidden: false
  313. }, {
  314. xtype: "textfield",
  315. name: "bo_text4",
  316. fieldLabel: "自定义字段4",
  317. hidden: true,
  318. initHidden: false
  319. }, {
  320. xtype: "textfield",
  321. name: "bo_text5",
  322. fieldLabel: "自定义字段5",
  323. hidden: true,
  324. initHidden: false
  325. }],
  326. });
  327. this.callParent(arguments);
  328. },
  329. });