FormPanel.js 7.9 KB

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