FormPanel.js 11 KB

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