FormPanel.js 9.8 KB

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