FormPanel.js 11 KB

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