FormPanel.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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 : "hidden",
  60. name : "pu_buyerid",
  61. bind : "{pu_buyerid}",
  62. fieldLabel : "采购员ID"
  63. }, {
  64. xtype : "textfield",
  65. name : "pu_buyercode",
  66. fieldLabel : "采购员编号",
  67. hidden:true,
  68. columnWidth : 0
  69. }, {
  70. xtype : "textfield",
  71. name : "pu_buyername",
  72. fieldLabel : "采购员名称"
  73. }, {
  74. xtype : "textfield",
  75. name : "pu_shipaddresscode",
  76. fieldLabel : "交货地址"
  77. }, {
  78. xtype : "textfield",
  79. name : "pu_total",
  80. fieldLabel : "单据金额"
  81. }, {
  82. name : "detailGridField",
  83. xtype : "detailGridField",
  84. storeModel:'saas.model.purchase.Purchasedetail',
  85. detnoColumn: 'pd_detno',
  86. deleteDetailUrl:'/api/purchase/purchase/deleteDetail/',
  87. allowEmpty: false,
  88. columns : [
  89. {
  90. text : "id",
  91. dataIndex : "id",
  92. xtype : "numbercolumn",
  93. hidden:true
  94. },{
  95. text : "物料id",
  96. dataIndex : "pd_prodid",
  97. xtype : "numbercolumn",
  98. hidden:true
  99. },
  100. {
  101. text : "物料编号",
  102. width : 200.0,
  103. dataIndex : "pd_prodcode",
  104. xtype : "",
  105. items : null,
  106. allowBlank : false,
  107. editor : {
  108. displayField : "display",
  109. editable : true,
  110. format : "",
  111. hideTrigger : false,
  112. maxLength : 100.0,
  113. minValue : null,
  114. positiveNum : false,
  115. queryMode : "local",
  116. store : null,
  117. valueField : "value",
  118. xtype : "multidbfindtrigger"
  119. }
  120. },
  121. {
  122. text : "名称",
  123. dataIndex : "pr_detail",
  124. ignore:true,
  125. renderer: function (v, m, r) {
  126. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  127. }
  128. },
  129. {
  130. text : "规格",
  131. dataIndex : "pr_spec",
  132. ignore:true,
  133. renderer: function (v, m, r) {
  134. return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
  135. }
  136. },
  137. {
  138. text : "数量",
  139. dataIndex : "pd_qty",
  140. editor : {
  141. xtype : "numberfield"
  142. },
  143. width : 120.0,
  144. xtype : "numbercolumn",
  145. format:'0,000.00',
  146. summaryType: 'sum'
  147. },
  148. {
  149. text : "已转数",
  150. dataIndex : "pd_yqty",
  151. editor : {
  152. xtype : "numberfield"
  153. },
  154. width : 120.0,
  155. format:'0,000.00',
  156. xtype : "numbercolumn",
  157. format:'0',
  158. items : null
  159. },
  160. {
  161. text : "单价",
  162. editor : {
  163. xtype : "numberfield"
  164. },
  165. format:'0,000.00',
  166. dataIndex : "pd_price",
  167. width : 120.0,
  168. xtype : "numbercolumn",
  169. },
  170. {
  171. text : "税率",
  172. editor : {
  173. xtype : "numberfield"
  174. },
  175. dataIndex : "pd_taxrate",
  176. format:'0,000.00',
  177. width : 120.0,
  178. xtype : "numbercolumn",
  179. },
  180. {
  181. text : "含税金额",
  182. dataIndex : "pd_total",
  183. width : 120.0,
  184. format:'0,000.00',
  185. xtype : "numbercolumn",
  186. summaryType: 'sum'
  187. },
  188. {
  189. text : "未含税金额",
  190. dataIndex : "pd_taxtotal",
  191. width : 120.0,
  192. format:'0,000.00',
  193. xtype : "numbercolumn",
  194. summaryType: 'sum'
  195. },{
  196. text : "需求日期",
  197. dataIndex : "pd_delivery",
  198. xtype:'datecolumn',
  199. width : 120.0,
  200. editor : {
  201. xtype : "datefield",
  202. editable : true,
  203. hideTrigger : false
  204. }
  205. },
  206. {
  207. text : "关联销售单号",
  208. dataIndex : "pd_salecode",
  209. width : 120.0
  210. }
  211. ]
  212. }, {
  213. xtype : "datefield",
  214. name : "createTime",
  215. bind : "{createTime}",
  216. fieldLabel : "创建时间",
  217. allowBlank : true,
  218. columnWidth : 0.25
  219. }, {
  220. xtype : "datefield",
  221. name : "updateTime",
  222. bind : "{updateTime}",
  223. fieldLabel : "更新时间",
  224. allowBlank : true,
  225. columnWidth : 0.25
  226. }, {
  227. xtype : "textfield",
  228. readOnly : true,
  229. editable : false,
  230. name : "pu_status",
  231. bind : "{pu_status}",
  232. fieldLabel : "单据状态",
  233. allowBlank : true,
  234. columnWidth : 0.25
  235. }, {
  236. xtype : "hidden",
  237. readOnly : true,
  238. editable : false,
  239. name : "pu_statuscode",
  240. bind : "{pu_statuscode}",
  241. fieldLabel : "单据状态码",
  242. allowBlank : true,
  243. columnWidth : 0.0
  244. }]
  245. });