FormPanel.js 11 KB

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