FormPanel.js 7.2 KB

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