FormPanel.js 9.7 KB

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