FormPanel.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. Ext.define('saas.view.purchase.purchase.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-purchase-formpanel',
  4. controller: 'purchase-purchase-formpanel',
  5. viewModel: 'purchase-purchase-formpanel',
  6. viewName: 'purchase-purchase-formpanel',
  7. caller:'Purchase',
  8. //字段属性
  9. _title:'采购单',
  10. _idField: 'id',
  11. _codeField: 'pu_code',
  12. _statusField: 'pu_status',
  13. _statusCodeField: 'pu_statuscode',
  14. _relationColumn: 'pd_puid',
  15. _readUrl:'/api/purchase/purchase/read/',
  16. _saveUrl:'/api/purchase/purchase/save',
  17. _auditUrl:'/api/purchase/purchase/audit',
  18. _unAuditUrl: '/api/purchase/purchase/unAudit/',
  19. _deleteUrl:'/api/purchase/purchase/delete/',
  20. _turnInUrl:'/api/purchase/purchase/turnProdin/',
  21. // _readUrl:'http://localhost:8800/purchase/read/',
  22. // _saveUrl:'http://localhost:8800/purchase/save',
  23. // _auditUrl:'http://localhost:8800/purchase/audit',
  24. // _unAuditUrl:'http://localhost:8800/purchase/unAudit/',
  25. // _deleteUrl:'http://localhost:8800/purchase/delete/',
  26. // _turnInUrl:'http://localhost:8800/purchase/turnProdin/',
  27. initId:0,
  28. toolBtns: [{
  29. xtype: 'button',
  30. text: '转采购验收单',
  31. bind: {
  32. hidden: '{turnHidden}'
  33. },
  34. handler: 'turnIn'
  35. }],
  36. defaultItems: [{
  37. xtype: 'hidden',
  38. name: 'id',
  39. fieldLabel: 'id',
  40. columnWidth: 0
  41. }, {
  42. xtype : "hidden",
  43. name : "pu_vendid",
  44. fieldLabel : "供应商ID"
  45. }, {
  46. xtype : "hidden",
  47. name : "pu_vendcode",
  48. fieldLabel : "供应商编号"
  49. }, {
  50. xtype : "dbfindtrigger",
  51. name : "pu_vendname",
  52. fieldLabel : "供应商名称",
  53. allowBlank : false,
  54. },{
  55. xtype : "hidden",
  56. name : "pu_delivery",
  57. fieldLabel : "交货日期"
  58. },{
  59. xtype : "textfield",
  60. name : "pu_shipaddresscode",
  61. fieldLabel : "交货地址"
  62. }, {
  63. xtype : "textfield",
  64. name : "pu_total",
  65. fieldLabel : "单据金额",
  66. readOnly:true
  67. }, {
  68. name : "detailGridField",
  69. xtype : "detailGridField",
  70. storeModel:'saas.model.purchase.Purchasedetail',
  71. detnoColumn: 'pd_detno',
  72. deleteDetailUrl:'/api/purchase/purchase/deleteDetail/',
  73. allowEmpty: false,
  74. columns : [
  75. {
  76. text : "id",
  77. dataIndex : "id",
  78. xtype : "numbercolumn",
  79. hidden:true
  80. },{
  81. text : "物料id",
  82. dataIndex : "pd_prodid",
  83. xtype : "numbercolumn",
  84. hidden:true
  85. },
  86. {
  87. text : "物料编号",
  88. width : 200.0,
  89. dataIndex : "pd_prodcode",
  90. xtype : "",
  91. items : null,
  92. allowBlank : false,
  93. editor : {
  94. displayField : "display",
  95. editable : true,
  96. format : "",
  97. hideTrigger : false,
  98. maxLength : 100.0,
  99. minValue : null,
  100. positiveNum : false,
  101. queryMode : "local",
  102. store : null,
  103. valueField : "value",
  104. xtype : "multidbfindtrigger"
  105. }
  106. },
  107. {
  108. text : "名称",
  109. dataIndex : "pr_detail",
  110. ignore:true,
  111. renderer: function (v, m, r) {
  112. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  113. }
  114. },
  115. {
  116. text : "规格",
  117. dataIndex : "pr_spec",
  118. ignore:true,
  119. renderer: function (v, m, r) {
  120. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  121. }
  122. },
  123. {
  124. text : "最小包装数",
  125. dataIndex : "pr_zxbzs",
  126. ignore:true,
  127. renderer: function (v, m, r) {
  128. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  129. }
  130. },
  131. {
  132. text : "数量",
  133. dataIndex : "pd_qty",
  134. width : 120.0,
  135. editor : {
  136. xtype : "numberfield",
  137. decimalPrecision: 8,
  138. minValue:0
  139. },
  140. renderer : function(v) {
  141. var arr = (v + '.').split('.');
  142. var xr = (new Array(arr[1].length)).fill('0');
  143. var format = '0.' + xr.join();
  144. return Ext.util.Format.number(v, format);
  145. },
  146. summaryType: 'sum',
  147. summaryRenderer: function(v) {
  148. var arr = (v + '.').split('.');
  149. var xr = (new Array(arr[1].length)).fill('0');
  150. var format = '0.' + xr.join();
  151. return Ext.util.Format.number(v, format);
  152. }
  153. },
  154. {
  155. text : "已转数",
  156. dataIndex : "pd_yqty",
  157. width : 120.0,
  158. editor : {
  159. xtype : "numberfield",
  160. decimalPrecision: 8,
  161. editable : false
  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. {
  178. text : "单价",
  179. dataIndex : "pd_price",
  180. width : 120.0,
  181. editor : {
  182. xtype : "numberfield",
  183. decimalPrecision: 8,
  184. minValue:0
  185. },
  186. renderer : function(v) {
  187. var arr = (v + '.').split('.');
  188. var xr = (new Array(arr[1].length)).fill('0');
  189. var format = '0,000.' + xr.join();
  190. return Ext.util.Format.number(v, format);
  191. }
  192. },
  193. {
  194. text : "税率",
  195. dataIndex : "pd_taxrate",
  196. width : 120.0,
  197. editor : {
  198. xtype : "numberfield",
  199. decimalPrecision: 0,
  200. minValue: 0,
  201. maxValue: 100
  202. }
  203. },
  204. {
  205. text : "含税金额",
  206. dataIndex : "pd_total",
  207. width : 120.0,
  208. editor : {
  209. xtype : "numberfield",
  210. decimalPrecision: 2,
  211. editable : false
  212. },
  213. renderer : function(v) {
  214. var arr = (v + '.').split('.');
  215. var xr = (new Array(arr[1].length)).fill('0');
  216. var format = '0,000.' + xr.join();
  217. return Ext.util.Format.number(v, format);
  218. },
  219. summaryType: 'sum',
  220. summaryRenderer: function(v) {
  221. var arr = (v + '.').split('.');
  222. var xr = (new Array(arr[1].length)).fill('0');
  223. var format = '0,000.' + xr.join();
  224. return Ext.util.Format.number(v, format);
  225. }
  226. },
  227. {
  228. text : "未税金额",
  229. dataIndex : "pd_taxtotal",
  230. width : 120.0,
  231. editor : {
  232. xtype : "numberfield",
  233. decimalPrecision: 2,
  234. editable : false
  235. },
  236. renderer : function(v) {
  237. var arr = (v + '.').split('.');
  238. var xr = (new Array(arr[1].length)).fill('0');
  239. var format = '0,000.' + 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,000.' + xr.join();
  247. return Ext.util.Format.number(v, format);
  248. }
  249. },{
  250. text : "需求日期",
  251. dataIndex : "pd_delivery",
  252. xtype:'datecolumn',
  253. width : 120.0,
  254. editor : {
  255. xtype : "datefield",
  256. editable : false,
  257. hideTrigger : false
  258. }
  259. },
  260. {
  261. text : "关联销售单号",
  262. dataIndex : "pd_salecode",
  263. width : 120.0
  264. }
  265. ]
  266. }, {
  267. xtype : "datefield",
  268. name : "createTime",
  269. bind : "{createTime}",
  270. fieldLabel : "创建时间",
  271. allowBlank : true,
  272. columnWidth : 0.25
  273. }, {
  274. xtype : "datefield",
  275. name : "updateTime",
  276. bind : "{updateTime}",
  277. fieldLabel : "更新时间",
  278. allowBlank : true,
  279. columnWidth : 0.25
  280. }, {
  281. xtype : "textfield",
  282. readOnly : true,
  283. editable : false,
  284. name : "pu_status",
  285. bind : "{pu_status}",
  286. fieldLabel : "单据状态",
  287. allowBlank : true,
  288. columnWidth : 0.25
  289. }, {
  290. xtype : "hidden",
  291. readOnly : true,
  292. editable : false,
  293. name : "pu_statuscode",
  294. bind : "{pu_statuscode}",
  295. fieldLabel : "单据状态码",
  296. allowBlank : true,
  297. columnWidth : 0.0
  298. }]
  299. });