FormPanel.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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-formmodel',
  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. _detnoColumn: 'pd_detno',
  15. _relationColumn: 'pd_puid',
  16. _readUrl:'http://192.168.0.181:8560/api/purchase/purchase/read/',
  17. _saveUrl:'http://192.168.0.181:8560/api/purchase/purchase/save',
  18. _auditUrl:'http://192.168.0.181:8560/api/purchase/purchase/audit',
  19. _deleteUrl:'http://192.168.0.181:8560/api/purchase/purchase/delete/',
  20. _deleteDetailUrl:'http://192.168.0.181:8560/api/purchase/purchase/deleteItem/',
  21. _turnInUrl:'http://192.168.253.228:8800/purchase/turnProdin/',
  22. initId:0,
  23. toolBtns: [{
  24. xtype: 'button',
  25. text: '转采购验收单',
  26. handler: 'turnIn'
  27. }],
  28. defaultItems: [{
  29. xtype: 'hidden',
  30. name: 'id',
  31. bind: '{id}',
  32. fieldLabel: 'id',
  33. allowBlank: true,
  34. columnWidth: 0
  35. }, {
  36. xtype : "textfield",
  37. name : "pu_code",
  38. bind : "{pu_code}",
  39. fieldLabel : "采购单号",
  40. allowBlank : true,
  41. columnWidth : 0.25
  42. }, {
  43. xtype : "hidden",
  44. name : "pu_vendid",
  45. bind : "{pu_vendid}",
  46. fieldLabel : "供应商ID",
  47. allowBlank : true,
  48. columnWidth : 0.0
  49. }, {
  50. xtype : "textfield",
  51. name : "pu_vendcode",
  52. bind : "{pu_vendcode}",
  53. fieldLabel : "供应商编号",
  54. hidden:true,
  55. allowBlank : true,
  56. columnWidth : 0,
  57. }, {
  58. xtype : "dbfindtrigger",
  59. name : "pu_vendname",
  60. bind : "{pu_vendname}",
  61. fieldLabel : "供应商名称",
  62. allowBlank : true,
  63. columnWidth : 0.25
  64. },{
  65. xtype : "datefield",
  66. name : "pu_date",
  67. bind : "{pu_date}",
  68. fieldLabel : "采购日期",
  69. allowBlank : false,
  70. columnWidth : 0.25
  71. }, {
  72. xtype : "hidden",
  73. name : "pu_buyerid",
  74. bind : "{pu_buyerid}",
  75. fieldLabel : "采购员ID",
  76. allowBlank : true,
  77. columnWidth : 0.0
  78. }, {
  79. xtype : "textfield",
  80. name : "pu_buyercode",
  81. bind : "{pu_buyercode}",
  82. fieldLabel : "采购员编号",
  83. allowBlank : true,
  84. hidden:true,
  85. columnWidth : 0
  86. }, {
  87. xtype : "dbfindtrigger",
  88. name : "pu_buyername",
  89. bind : "{pu_buyername}",
  90. fieldLabel : "采购员名称",
  91. allowBlank : true,
  92. columnWidth : 0.25
  93. }, {
  94. xtype : "textfield",
  95. name : "pu_shipaddresscode",
  96. bind : "{pu_shipaddresscode}",
  97. fieldLabel : "交货地址",
  98. allowBlank : true,
  99. columnWidth : 0.25
  100. }, {
  101. xtype : "textfield",
  102. name : "pu_total",
  103. bind : "{pu_total}",
  104. fieldLabel : "单据金额",
  105. allowBlank : true,
  106. columnWidth : 0.25
  107. }, {
  108. name : "detailGridField",
  109. xtype : "detailGridField",
  110. storeModel:'saas.model.purchase.purchasedetail',
  111. columns : [
  112. {
  113. text : "序号",
  114. dataIndex : "pd_detno",
  115. width : 100,
  116. xtype : "numbercolumn",
  117. align : 'center',
  118. format:'0',
  119. summaryType: 'count',
  120. summaryRenderer: function(value, summaryData, dataIndex) {
  121. return Ext.String.format('合计: {0}条', value);
  122. },
  123. }, {
  124. text : "id",
  125. dataIndex : "id",
  126. xtype : "numbercolumn"
  127. },
  128. {
  129. text : "物料编号",
  130. width : 200.0,
  131. dataIndex : "pd_prodcode",
  132. xtype : "",
  133. items : null,
  134. editor : {
  135. displayField : "display",
  136. editable : true,
  137. format : "",
  138. hideTrigger : false,
  139. maxLength : 100.0,
  140. minValue : null,
  141. positiveNum : false,
  142. queryMode : "local",
  143. store : null,
  144. valueField : "value",
  145. xtype : "dbfindtrigger"
  146. }
  147. },
  148. {
  149. text : "名称",
  150. dataIndex : "pr_detail",
  151. ignore:true,
  152. renderer: function (v, m, r) {
  153. return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
  154. }
  155. },
  156. {
  157. text : "规格",
  158. dataIndex : "pr_spec",
  159. ignore:true,
  160. renderer: function (v, m, r) {
  161. return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
  162. }
  163. },
  164. {
  165. text : "数量",
  166. dataIndex : "pd_qty",
  167. editor : {
  168. xtype : "numberfield"
  169. },
  170. width : 120.0,
  171. xtype : "numbercolumn",
  172. format:'0',
  173. items : null,
  174. summaryType: 'sum'
  175. },
  176. {
  177. text : "已转数",
  178. dataIndex : "pd_yqty",
  179. editor : {
  180. xtype : "numberfield"
  181. },
  182. width : 120.0,
  183. xtype : "numbercolumn",
  184. format:'0',
  185. items : null,
  186. summaryType: 'sum'
  187. },
  188. {
  189. text : "单价",
  190. editor : {
  191. xtype : "numberfield"
  192. },
  193. format:'0,000.00',
  194. dataIndex : "pd_price",
  195. width : 120.0,
  196. xtype : "numbercolumn",
  197. items : null,
  198. summaryType: 'sum'
  199. },
  200. {
  201. text : "税率",
  202. editor : {
  203. xtype : "numberfield"
  204. },
  205. dataIndex : "pd_taxrate",
  206. width : 120.0,
  207. xtype : "numbercolumn",
  208. items : null
  209. },
  210. {
  211. text : "含税金额",
  212. dataIndex : "pd_total",
  213. width : 120.0,
  214. xtype : "numbercolumn"
  215. },
  216. {
  217. text : "未税金额",
  218. dataIndex : "pd_taxtotal",
  219. xtype : "numbercolumn"
  220. },{
  221. text : "需求日期",
  222. dataIndex : "pd_delivery",
  223. flex : 1.0,
  224. xtype:'datecolumn',
  225. format : "Y-m-d H:i:s",
  226. editor : {
  227. xtype : "datefield",
  228. editable : true,
  229. format : "Y-m-d H:i:s",
  230. hideTrigger : false
  231. }
  232. },
  233. {
  234. text : "关联销售单号",
  235. dataIndex : "pd_salecode",
  236. width : 120.0,
  237. flex : 1.0
  238. }
  239. ]
  240. }, {
  241. format : "Y-m-d",
  242. xtype : "datefield",
  243. name : "createTime",
  244. bind : "{createTime}",
  245. fieldLabel : "创建时间",
  246. allowBlank : true,
  247. columnWidth : 0.25
  248. }, {
  249. xtype : "datefield",
  250. name : "updateTime",
  251. bind : "{updateTime}",
  252. fieldLabel : "更新时间",
  253. allowBlank : true,
  254. columnWidth : 0.25
  255. }, {
  256. xtype : "textfield",
  257. readOnly : true,
  258. editable : false,
  259. name : "pu_status",
  260. bind : "{pu_status}",
  261. fieldLabel : "单据状态",
  262. allowBlank : true,
  263. columnWidth : 0.25
  264. }, {
  265. xtype : "hidden",
  266. readOnly : true,
  267. editable : false,
  268. name : "pu_statuscode",
  269. bind : "{pu_statuscode}",
  270. fieldLabel : "单据状态码",
  271. allowBlank : true,
  272. columnWidth : 0.0
  273. }]
  274. });