FormPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. Ext.define('saas.view.stock.make.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'stock-make-formpanel',
  4. controller: 'stock-make-formpanel',
  5. viewModel: 'stock-make-formpanel',
  6. viewName: 'stock-make-formpanel',
  7. caller:'Make',
  8. //字段属性
  9. _title:'制造单',
  10. _idField: 'id',
  11. _codeField: 'ma_code',
  12. _statusField: 'ma_status',
  13. _statusCodeField: 'ma_statuscode',
  14. _relationColumn: 'mm_maid',
  15. _readUrl:'/api/storage/make/read/',
  16. _saveUrl:'/api/storage/make/save',
  17. _auditUrl:'/api/storage/make/audit',
  18. _unAuditUrl: '/api/storage/make/unAudit/',
  19. _deleteUrl:'/api/storage/make/delete/',
  20. _getBomUrl:'/api/document/bom/read/',
  21. initId:0,
  22. toolBtns: [],
  23. defaultItems: [{
  24. xtype: 'hidden',
  25. name: 'id',
  26. fieldLabel: 'id',
  27. columnWidth: 0
  28. },{
  29. xtype: 'combobox',
  30. name: 'ma_type',
  31. allowBlank : false,
  32. columnWidth: 0.25,
  33. fieldLabel: '类型',
  34. queryMode: 'local',
  35. displayField: 'name',
  36. valueField: 'value',
  37. editable:false,
  38. allowBlank : false,
  39. store: Ext.create('Ext.data.ArrayStore', {
  40. fields: ['name', 'value'],
  41. data: [
  42. ["拆件", "拆件"],
  43. ["组装", "组装"],
  44. ]
  45. })
  46. },{
  47. xtype: 'hidden',
  48. name: 'ma_prodid',
  49. fieldLabel: '产品id'
  50. },{
  51. xtype : "bomDbfindTrigger",
  52. name : "ma_prodcode",
  53. fieldLabel : "产品编号",
  54. allowBlank : false,
  55. columnWidth: 0.25
  56. },{
  57. xtype : "textfield",
  58. name : "ma_proddetail",
  59. fieldLabel : "产品名称",
  60. readOnly:true,
  61. columnWidth: 0.25
  62. },{
  63. xtype : "textfield",
  64. name : "ma_prodspec",
  65. fieldLabel : "产品规格",
  66. readOnly:true,
  67. columnWidth: 0.25,
  68. },{
  69. xtype : "textfield",
  70. name : "ma_produnit",
  71. fieldLabel : "单位",
  72. readOnly:true,
  73. columnWidth: 0.25
  74. },{
  75. xtype : "textfield",
  76. name : "ma_version",
  77. fieldLabel : "版本",
  78. readOnly:true,
  79. columnWidth: 0.25
  80. },
  81. {
  82. xtype : "numberfield",
  83. name : "ma_qty",
  84. fieldLabel : "数量",
  85. columnWidth: 0.25,
  86. allowBlank : false,
  87. minValue:1
  88. },{
  89. xtype : "hidden",
  90. name : "ma_whid",
  91. fieldLabel : "仓库id"
  92. },{
  93. xtype : "hidden",
  94. name : "ma_whcode",
  95. fieldLabel : "仓库编号"
  96. },{
  97. xtype : "warehouseDbfindTrigger",
  98. name : "ma_whname",
  99. fieldLabel : "仓库名称",
  100. allowBlank : false,
  101. columnWidth: 0.25
  102. },{
  103. xtype : "numberfield",
  104. name : "ma_price",
  105. fieldLabel : "单价",
  106. readOnly:true,
  107. editable:false,
  108. decimalPrecision:8,
  109. columnWidth: 0.25
  110. },{
  111. xtype : "numberfield",
  112. name : "ma_total",
  113. readOnly:true,
  114. editable:false,
  115. fieldLabel : "金额",
  116. decimalPrecision:2,
  117. columnWidth: 0.25
  118. },
  119. {
  120. name : "detailGridField",
  121. xtype : "detailGridField",
  122. storeModel:'saas.model.stock.Makematerial',
  123. detnoColumn: 'mm_detno',
  124. deleteDetailUrl:'/api/storage/make/deleteDetail/',
  125. columns : [
  126. {
  127. text : "id",
  128. dataIndex : "id",
  129. xtype : "numbercolumn",
  130. hidden:true
  131. },
  132. {
  133. text : "mm_prodidid",
  134. dataIndex : "mm_prodid",
  135. xtype : "numbercolumn",
  136. hidden:true
  137. },
  138. {
  139. text : "物料编号",
  140. width : 150.0,
  141. dataIndex : "mm_prodcode",
  142. allowBlank : false,
  143. xtype : "",
  144. items : null,
  145. editor : {
  146. displayField : "display",
  147. editable : true,
  148. format : "",
  149. hideTrigger : false,
  150. maxLength : 100.0,
  151. minValue : null,
  152. positiveNum : false,
  153. queryMode : "local",
  154. store : null,
  155. valueField : "value",
  156. xtype : "productMultiDbfindTrigger"
  157. }
  158. },{
  159. text: 'model映射需要',
  160. dataIndex: 'productDTO',
  161. hidden: true,
  162. },
  163. {
  164. text : "名称",
  165. dataIndex : "pr_detail",
  166. width : 200.0,
  167. ignore:true,
  168. renderer: function (v, m, r) {
  169. if(!v){
  170. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  171. }
  172. return v;
  173. }
  174. },
  175. {
  176. text : "规格",
  177. dataIndex : "pr_spec",
  178. width : 150.0,
  179. ignore:true,
  180. renderer: function (v, m, r) {
  181. if(!v){
  182. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  183. }
  184. return v;
  185. }
  186. },
  187. {
  188. text : "单位",
  189. dataIndex : "pr_unit",
  190. width : 80.0,
  191. ignore:true,
  192. renderer: function (v, m, r) {
  193. if(!v){
  194. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  195. }
  196. return v;
  197. }
  198. },
  199. {
  200. text : "需求数量",
  201. xtype: 'numbercolumn',
  202. dataIndex : "mm_qty",
  203. width : 110.0,
  204. editor : {
  205. xtype : "numberfield",
  206. decimalPrecision: 3,
  207. minValue:0
  208. },
  209. renderer : function(v) {
  210. var arr = (v + '.').split('.');
  211. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  212. var format = '0.' + xr.join();
  213. return Ext.util.Format.number(v, format);
  214. },
  215. summaryType: 'sum',
  216. summaryRenderer: function(v) {
  217. var arr = (v + '.').split('.');
  218. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  219. var format = '0.' + xr.join();
  220. return Ext.util.Format.number(v, format);
  221. }
  222. },
  223. {
  224. text : "单位用量",
  225. xtype: 'numbercolumn',
  226. dataIndex : "mm_oneuseqty",
  227. width : 110.0,
  228. hidden:true,
  229. editor : {
  230. xtype : "numberfield",
  231. decimalPrecision: 8,
  232. editable:false,
  233. minValue:0
  234. },
  235. renderer : function(v) {
  236. var arr = (v + '.').split('.');
  237. var xr = (new Array(arr[1].length)).fill('0');
  238. var format = '0.' + xr.join();
  239. return Ext.util.Format.number(v, format);
  240. },
  241. summaryType: 'sum',
  242. summaryRenderer: function(v) {
  243. var arr = (v + '.').split('.');
  244. var xr = (new Array(arr[1].length)).fill('0');
  245. var format = '0.' + xr.join();
  246. return Ext.util.Format.number(v, format);
  247. }
  248. },
  249. {
  250. text : "仓库id",
  251. dataIndex : "mm_whid",
  252. xtype : "numbercolumn",
  253. hidden:true
  254. },
  255. {
  256. text : "仓库编号",
  257. dataIndex : "mm_whcode",
  258. hidden:true
  259. },
  260. {
  261. text : "仓库",
  262. dataIndex : "mm_whname",
  263. width : 150.0,
  264. items : null,
  265. allowBlank : false,
  266. editor : {
  267. displayField : "display",
  268. editable : true,
  269. format : "",
  270. hideTrigger : false,
  271. maxLength : 100.0,
  272. minValue : null,
  273. positiveNum : false,
  274. queryMode : "local",
  275. store : null,
  276. valueField : "value",
  277. xtype : "warehouseDbfindTrigger"
  278. }
  279. },{
  280. text : "成本单价",
  281. dataIndex : "mm_price",
  282. xtype: 'numbercolumn',
  283. width : 110.0,
  284. editor : {
  285. xtype : "numberfield",
  286. decimalPrecision: 8,
  287. minValue:0
  288. },
  289. listeners:{
  290. edit:'price_change'
  291. },
  292. renderer : function(v) {
  293. var arr = (v + '.').split('.');
  294. var xr = (new Array(arr[1].length)).fill('0');
  295. var format = '0,000.' + xr.join();
  296. return Ext.util.Format.number(v, format);
  297. }
  298. }, {
  299. text : "成本金额",
  300. xtype: 'numbercolumn',
  301. dataIndex : "mm_amount",
  302. width : 110.0,
  303. editor : {
  304. xtype : "numberfield",
  305. decimalPrecision: 2,
  306. editable : false
  307. },
  308. renderer : function(v) {
  309. var arr = (v + '.').split('.');
  310. var xr = (new Array(arr[1].length)).fill('0');
  311. var format = '0,000.' + xr.join();
  312. return Ext.util.Format.number(v, format);
  313. },
  314. summaryType: 'sum',
  315. summaryRenderer: function(v) {
  316. var arr = (v + '.').split('.');
  317. var xr = (new Array(arr[1].length)).fill('0');
  318. var format = '0,000.' + xr.join();
  319. return Ext.util.Format.number(v, format);
  320. }
  321. },{
  322. text : "替代料",
  323. dataIndex : "mm_repprodcode",
  324. width : 0,
  325. editor : {
  326. xtype : "textfield"
  327. },
  328. }, {
  329. text : "备注",
  330. dataIndex : "mm_remark",
  331. width : 250,
  332. editor : {
  333. xtype : "textfield"
  334. },
  335. }]
  336. },{
  337. xtype : "hidden",
  338. name : "creatorId",
  339. fieldLabel : "录入人ID",
  340. readOnly:true
  341. },
  342. {
  343. xtype : "textfield",
  344. name : "creatorName",
  345. fieldLabel : "录入人",
  346. readOnly:true
  347. }, {
  348. xtype : "datefield",
  349. name : "createTime",
  350. fieldLabel : "录入日期",
  351. readOnly:true,
  352. defaultValue: new Date()
  353. },{
  354. xtype : "hidden",
  355. name : "updaterId",
  356. fieldLabel : "更新人ID",
  357. readOnly:true
  358. },{
  359. xtype : "hidden",
  360. name : "updaterName",
  361. fieldLabel : "更新人",
  362. readOnly:true
  363. }, {
  364. xtype : "hidden",
  365. name : "updateTime",
  366. fieldLabel : "更新日期",
  367. readOnly:true,
  368. defaultValue: new Date()
  369. }, {
  370. xtype : "textfield",
  371. name : "ma_auditman",
  372. fieldLabel : "审核人",
  373. readOnly:true
  374. }, {
  375. xtype : "datefield",
  376. name : "ma_auditdate",
  377. fieldLabel : "审核日期",
  378. readOnly:true
  379. }]
  380. });