FormPanel.js 12 KB

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