FormPanel.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 : "textfield",
  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. },
  102. {
  103. text : "mm_prodidid",
  104. dataIndex : "mm_prodid",
  105. xtype : "numbercolumn"
  106. },
  107. {
  108. text : "物料编号",
  109. width : 200.0,
  110. dataIndex : "mm_prodcode",
  111. xtype : "",
  112. items : null,
  113. editor : {
  114. displayField : "display",
  115. editable : true,
  116. format : "",
  117. hideTrigger : false,
  118. maxLength : 100.0,
  119. minValue : null,
  120. positiveNum : false,
  121. queryMode : "local",
  122. store : null,
  123. valueField : "value",
  124. xtype : "multidbfindtrigger"
  125. }
  126. },
  127. {
  128. text : "名称",
  129. dataIndex : "pr_detail",
  130. width : 100.0,
  131. ignore:true,
  132. renderer: function (v, m, r) {
  133. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  134. }
  135. },
  136. {
  137. text : "规格",
  138. dataIndex : "pr_spec",
  139. width : 100.0,
  140. ignore:true,
  141. renderer: function (v, m, r) {
  142. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  143. }
  144. },
  145. {
  146. text : "单位",
  147. dataIndex : "pr_unit",
  148. width : 100.0,
  149. ignore:true,
  150. renderer: function (v, m, r) {
  151. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:'';
  152. }
  153. },
  154. {
  155. text : "数量",
  156. dataIndex : "pd_qty",
  157. width : 120.0,
  158. editor : {
  159. xtype : "numberfield",
  160. decimalPrecision: 8,
  161. minValue:0
  162. },
  163. renderer : function(v) {
  164. var arr = (v + '.').split('.');
  165. var xr = (new Array(arr[1].length)).fill('0');
  166. var format = '0.' + xr.join();
  167. return Ext.util.Format.number(v, format);
  168. },
  169. summaryType: 'sum',
  170. summaryRenderer: function(v) {
  171. var arr = (v + '.').split('.');
  172. var xr = (new Array(arr[1].length)).fill('0');
  173. var format = '0.' + xr.join();
  174. return Ext.util.Format.number(v, format);
  175. }
  176. },{
  177. text : "仓库id",
  178. dataIndex : "mm_whid",
  179. xtype : "numbercolumn",
  180. hidden:true
  181. },
  182. {
  183. text : "仓库编号",
  184. dataIndex : "mm_whcode",
  185. hidden:true
  186. },
  187. {
  188. text : "仓库",
  189. dataIndex : "mm_whname",
  190. width : 120.0,
  191. items : null,
  192. editor : {
  193. displayField : "display",
  194. editable : true,
  195. format : "",
  196. hideTrigger : false,
  197. maxLength : 100.0,
  198. minValue : null,
  199. positiveNum : false,
  200. queryMode : "local",
  201. store : null,
  202. valueField : "value",
  203. xtype : "dbfindtrigger"
  204. }
  205. },{
  206. text : "替代料",
  207. dataIndex : "mm_repprodcode",
  208. width : 200.0,
  209. hidden:true
  210. }, {
  211. text : "备注",
  212. dataIndex : "mm_remark",
  213. width : 250,
  214. hidden:true
  215. }]
  216. },{
  217. xtype : "datefield",
  218. name : "createTime",
  219. bind : "{createTime}",
  220. fieldLabel : "制单日",
  221. allowBlank : true,
  222. columnWidth : 0.25
  223. },{
  224. xtype : "textfield",
  225. name : "ma_recorder",
  226. fieldLabel : "制单人",
  227. columnWidth: 0.2
  228. },{
  229. xtype : "numberfield",
  230. name : "ma_price",
  231. fieldLabel : "单位成本",
  232. columnWidth: 0.2
  233. },{
  234. xtype : "numberfield",
  235. name : "ma_total",
  236. fieldLabel : "总成本",
  237. columnWidth: 0.2
  238. }, {
  239. xtype : "datefield",
  240. name : "updateTime",
  241. bind : "{updateTime}",
  242. fieldLabel : "更新时间",
  243. allowBlank : true,
  244. columnWidth : 0.25
  245. }, {
  246. xtype : "textfield",
  247. readOnly : true,
  248. editable : false,
  249. name : "ma_status",
  250. bind : "{ma_status}",
  251. fieldLabel : "单据状态",
  252. allowBlank : true,
  253. columnWidth : 0.25
  254. }, {
  255. xtype : "hidden",
  256. readOnly : true,
  257. editable : false,
  258. name : "ma_statuscode",
  259. bind : "{ma_statuscode}",
  260. fieldLabel : "单据状态码",
  261. allowBlank : true,
  262. columnWidth : 0.0
  263. }]
  264. });