FormPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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 : "dbfindtrigger",
  52. editable:false,
  53. name : "ma_prodcode",
  54. fieldLabel : "产品编号",
  55. allowBlank : false,
  56. columnWidth: 0.25
  57. },{
  58. xtype : "textfield",
  59. name : "ma_proddetail",
  60. fieldLabel : "产品名称",
  61. readOnly:true,
  62. columnWidth: 0.25
  63. },{
  64. xtype : "textfield",
  65. name : "ma_prodspec",
  66. fieldLabel : "产品规格",
  67. readOnly:true,
  68. columnWidth: 0.25,
  69. },{
  70. xtype : "textfield",
  71. name : "ma_version",
  72. fieldLabel : "版本",
  73. readOnly:true,
  74. columnWidth: 0.25
  75. },{
  76. xtype : "textfield",
  77. name : "ma_produnit",
  78. fieldLabel : "单位",
  79. readOnly:true,
  80. columnWidth: 0.25
  81. },
  82. {
  83. xtype : "numberfield",
  84. name : "ma_qty",
  85. fieldLabel : "数量",
  86. columnWidth: 0.25,
  87. allowBlank : false,
  88. minValue:1
  89. },{
  90. xtype : "hidden",
  91. name : "ma_whid",
  92. fieldLabel : "仓库id"
  93. },{
  94. xtype : "hidden",
  95. name : "ma_whcode",
  96. fieldLabel : "仓库编号"
  97. },{
  98. xtype : "dbfindtrigger",
  99. name : "ma_whname",
  100. fieldLabel : "仓库名称",
  101. allowBlank : false,
  102. columnWidth: 0.25
  103. },{
  104. xtype : "numberfield",
  105. name : "ma_price",
  106. fieldLabel : "单位成本",
  107. readOnly:true,
  108. decimals:8,
  109. columnWidth: 0.25
  110. },{
  111. xtype : "numberfield",
  112. name : "ma_total",
  113. readOnly:true,
  114. fieldLabel : "总成本",
  115. decimals:2,
  116. columnWidth: 0.25
  117. },
  118. {
  119. name : "detailGridField",
  120. xtype : "detailGridField",
  121. storeModel:'saas.model.stock.Makematerial',
  122. detnoColumn: 'mm_detno',
  123. deleteDetailUrl:'/api/storage/make/deleteDetail/',
  124. columns : [
  125. {
  126. text : "id",
  127. dataIndex : "id",
  128. xtype : "numbercolumn",
  129. hidden:true
  130. },
  131. {
  132. text : "mm_prodidid",
  133. dataIndex : "mm_prodid",
  134. xtype : "numbercolumn",
  135. hidden:true
  136. },
  137. {
  138. text : "物料编号",
  139. width : 200.0,
  140. dataIndex : "mm_prodcode",
  141. allowBlank : false,
  142. xtype : "",
  143. items : null,
  144. editor : {
  145. displayField : "display",
  146. editable : true,
  147. format : "",
  148. hideTrigger : false,
  149. maxLength : 100.0,
  150. minValue : null,
  151. positiveNum : false,
  152. queryMode : "local",
  153. store : null,
  154. valueField : "value",
  155. xtype : "multidbfindtrigger"
  156. }
  157. },{
  158. text: 'model映射需要',
  159. dataIndex: 'productDTO',
  160. hidden: true,
  161. },
  162. {
  163. text : "名称",
  164. dataIndex : "pr_detail",
  165. width : 100.0,
  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. {
  175. text : "规格",
  176. dataIndex : "pr_spec",
  177. width : 100.0,
  178. ignore:true,
  179. renderer: function (v, m, r) {
  180. if(!v){
  181. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
  182. }
  183. return v;
  184. }
  185. },
  186. {
  187. text : "单位",
  188. dataIndex : "pr_unit",
  189. width : 100.0,
  190. ignore:true,
  191. renderer: function (v, m, r) {
  192. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:'';
  193. }
  194. },
  195. {
  196. text : "需求数量",
  197. xtype: 'numbercolumn',
  198. dataIndex : "mm_qty",
  199. width : 120.0,
  200. editor : {
  201. xtype : "numberfield",
  202. decimalPrecision: 8,
  203. minValue:0
  204. },
  205. renderer : function(v) {
  206. var arr = (v + '.').split('.');
  207. var xr = (new Array(arr[1].length)).fill('0');
  208. var format = '0.' + xr.join();
  209. return Ext.util.Format.number(v, format);
  210. },
  211. summaryType: 'sum',
  212. summaryRenderer: function(v) {
  213. var arr = (v + '.').split('.');
  214. var xr = (new Array(arr[1].length)).fill('0');
  215. var format = '0.' + xr.join();
  216. return Ext.util.Format.number(v, format);
  217. }
  218. },
  219. {
  220. text : "单位用量",
  221. xtype: 'numbercolumn',
  222. dataIndex : "mm_oneuseqty",
  223. width : 120.0,
  224. hidden:true,
  225. editor : {
  226. xtype : "numberfield",
  227. decimalPrecision: 8,
  228. editable:false,
  229. minValue:0
  230. },
  231. renderer : function(v) {
  232. var arr = (v + '.').split('.');
  233. var xr = (new Array(arr[1].length)).fill('0');
  234. var format = '0.' + xr.join();
  235. return Ext.util.Format.number(v, format);
  236. },
  237. summaryType: 'sum',
  238. summaryRenderer: function(v) {
  239. var arr = (v + '.').split('.');
  240. var xr = (new Array(arr[1].length)).fill('0');
  241. var format = '0.' + xr.join();
  242. return Ext.util.Format.number(v, format);
  243. }
  244. },
  245. {
  246. text : "仓库id",
  247. dataIndex : "mm_whid",
  248. xtype : "numbercolumn",
  249. hidden:true
  250. },
  251. {
  252. text : "仓库编号",
  253. dataIndex : "mm_whcode",
  254. hidden:true
  255. },
  256. {
  257. text : "仓库",
  258. dataIndex : "mm_whname",
  259. width : 120.0,
  260. items : null,
  261. allowBlank : false,
  262. editor : {
  263. displayField : "display",
  264. editable : true,
  265. format : "",
  266. hideTrigger : false,
  267. maxLength : 100.0,
  268. minValue : null,
  269. positiveNum : false,
  270. queryMode : "local",
  271. store : null,
  272. valueField : "value",
  273. xtype : "dbfindtrigger"
  274. }
  275. },{
  276. text : "出库单位成本",
  277. dataIndex : "mm_price",
  278. xtype: 'numbercolumn',
  279. width : 120.0,
  280. editor : {
  281. xtype : "numberfield",
  282. decimalPrecision: 8,
  283. minValue:0
  284. },
  285. listeners:{
  286. edit:'price_change'
  287. },
  288. renderer : function(v) {
  289. var arr = (v + '.').split('.');
  290. var xr = (new Array(arr[1].length)).fill('0');
  291. var format = '0,000.' + xr.join();
  292. return Ext.util.Format.number(v, format);
  293. }
  294. }, {
  295. text : "出库成本",
  296. xtype: 'numbercolumn',
  297. dataIndex : "mm_amount",
  298. width : 120.0,
  299. editor : {
  300. xtype : "numberfield",
  301. decimalPrecision: 2,
  302. editable : false
  303. },
  304. renderer : function(v) {
  305. var arr = (v + '.').split('.');
  306. var xr = (new Array(arr[1].length)).fill('0');
  307. var format = '0,000.' + xr.join();
  308. return Ext.util.Format.number(v, format);
  309. },
  310. summaryType: 'sum',
  311. summaryRenderer: function(v) {
  312. var arr = (v + '.').split('.');
  313. var xr = (new Array(arr[1].length)).fill('0');
  314. var format = '0,000.' + xr.join();
  315. return Ext.util.Format.number(v, format);
  316. }
  317. },{
  318. text : "替代料",
  319. dataIndex : "mm_repprodcode",
  320. width : 200.0,
  321. editor : {
  322. xtype : "textfield"
  323. },
  324. }, {
  325. text : "备注",
  326. dataIndex : "mm_remark",
  327. width : 250,
  328. editor : {
  329. xtype : "textfield"
  330. },
  331. }]
  332. },{
  333. xtype : "textfield",
  334. name : "ma_recorder",
  335. fieldLabel : "录入人",
  336. readOnly:true
  337. }, {
  338. xtype : "datefield",
  339. name : "createTime",
  340. fieldLabel : "录入日期",
  341. readOnly:true
  342. }, {
  343. xtype : "textfield",
  344. name : "ma_auditman",
  345. fieldLabel : "审核人",
  346. readOnly:true
  347. }, {
  348. xtype : "datefield",
  349. name : "ma_auditdate",
  350. fieldLabel : "审核日期",
  351. readOnly:true
  352. }]
  353. });