FormPanel.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. Ext.define('saas.view.test.order.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'test-order-formpanel',
  4. controller: 'test-order-formcontroller',
  5. viewModel: 'test-order-formmodel',
  6. //字段属性
  7. _title:'采购单',
  8. _idField: 'id',
  9. _codeField: 'pu_code',
  10. _statusField: 'pu_status',
  11. _statusCodeField: 'pu_statuscode',
  12. _detnoColumn: 'pd_detno',
  13. _relationColumn: 'pd_puid',
  14. _readUrl:'http://192.168.253.58:8800/purchase/read/',
  15. _saveUrl:'http://192.168.253.58:8800/purchase/save',
  16. _auditUrl:'http://192.168.253.58:8800/purchase/audit',
  17. _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
  18. _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
  19. initId:11,
  20. toolBtns: [{
  21. xtype: 'button',
  22. text: '转单按钮',
  23. handler: function() {
  24. console.log('11');
  25. }
  26. }],
  27. defaultItems: [{
  28. xtype: 'hidden',
  29. name: 'id',
  30. bind: '{id}',
  31. fieldLabel: 'id',
  32. allowBlank: true,
  33. columnWidth: 0
  34. }, {
  35. xtype : "textfield",
  36. name : "pu_code",
  37. bind : "{pu_code}",
  38. fieldLabel : "采购单号",
  39. allowBlank : true,
  40. columnWidth : 0.25
  41. }, {
  42. xtype : "datefield",
  43. name : "pu_date",
  44. bind : "{pu_date}",
  45. fieldLabel : "采购日期",
  46. allowBlank : false,
  47. columnWidth : 0.25,
  48. format:'Y-m-d'
  49. }, {
  50. xtype : "hidden",
  51. name : "pu_vendid",
  52. bind : "{pu_vendid}",
  53. fieldLabel : "供应商ID",
  54. allowBlank : true,
  55. columnWidth : 0.0
  56. }, {
  57. xtype : "dbfindtrigger",
  58. name : "pu_vendcode",
  59. bind : "{pu_vendcode}",
  60. fieldLabel : "供应商编号",
  61. allowBlank : true,
  62. columnWidth : 0.25,
  63. }, {
  64. xtype : "textfield",
  65. name : "pu_vendname",
  66. bind : "{pu_vendname}",
  67. fieldLabel : "供应商名称",
  68. allowBlank : true,
  69. columnWidth : 0.25
  70. }, {
  71. xtype : "hidden",
  72. name : "pu_buyerid",
  73. bind : "{pu_buyerid}",
  74. fieldLabel : "采购员ID",
  75. allowBlank : true,
  76. columnWidth : 0.0
  77. }, {
  78. xtype : "dbfindtrigger",
  79. name : "pu_buyercode",
  80. bind : "{pu_buyercode}",
  81. fieldLabel : "采购员编号",
  82. allowBlank : true,
  83. columnWidth : 0.25
  84. }, {
  85. xtype : "textfield",
  86. name : "pu_buyername",
  87. bind : "{pu_buyername}",
  88. fieldLabel : "采购员名称",
  89. allowBlank : true,
  90. columnWidth : 0.25
  91. },{
  92. xtype : "combo",
  93. name : "pu_total",
  94. bind : "{pu_total}",
  95. fieldLabel : "下拉框",
  96. allowBlank : true,
  97. queryMode: 'local',
  98. displayField: 'display',
  99. valueField: 'value',
  100. store:{
  101. fields: ['display', 'value'],
  102. data : [
  103. {"display":"1", "value":"1"},
  104. {"display":"2", "value":"2"},
  105. {"display":"3", "value":"3"}
  106. ]
  107. },
  108. columnWidth : 0.25
  109. },{
  110. xtype : "remotecombo",
  111. storeUrl:"http://192.168.253.41:9480/api/document/product/getProdUnit",
  112. name : "pu_text1",
  113. bind : "{pu_text1}",
  114. fieldLabel : "物料下拉框",
  115. allowBlank : true,
  116. queryMode: 'local',
  117. displayField: 'display',
  118. valueField: 'value',
  119. columnWidth : 0.25
  120. }, {
  121. name : "detailGridField",
  122. xtype : "detailGridField",
  123. columns : [
  124. {
  125. text : "序号",
  126. dataIndex : "pd_detno",
  127. width : 80.0,
  128. xtype : "rownumberer",
  129. summaryType: 'count'
  130. },
  131. {
  132. editor : {
  133. displayField : "display",
  134. editable : true,
  135. format : "",
  136. hideTrigger : false,
  137. maxLength : 100.0,
  138. minValue : null,
  139. positiveNum : false,
  140. queryMode : "local",
  141. store : null,
  142. valueField : "value",
  143. xtype : "dbfindtrigger"
  144. },
  145. text : "物料编号",
  146. width : 200.0,
  147. dataIndex : "pd_prodcode",
  148. xtype : "",
  149. items : null
  150. },
  151. {
  152. text : "单位",
  153. editor : {
  154. xtype : "textfield"
  155. },
  156. dataIndex : "pd_unit",
  157. width : 120.0,
  158. xtype : "",
  159. items : null
  160. },
  161. {
  162. text : "数量",
  163. dataIndex : "pd_yqty",
  164. width : 120.0,
  165. xtype : "numbercolumn",
  166. items : null,
  167. summaryType: 'sum'
  168. },
  169. {
  170. text : "单价",
  171. dataIndex : "pd_price",
  172. width : 120.0,
  173. xtype : "numbercolumn",
  174. items : null,
  175. summaryType: 'sum'
  176. },
  177. {
  178. text : "总额",
  179. dataIndex : "pd_total",
  180. width : 120.0,
  181. xtype : "numbercolumn",
  182. summaryType: 'sum'
  183. },
  184. {
  185. text : "税额",
  186. dataIndex : "pd_taxtotal",
  187. flex : 1.0,
  188. xtype : "numbercolumn",
  189. summaryType: 'sum'
  190. }
  191. ]
  192. }, {
  193. format : "Y-m-d",
  194. xtype : "datefield",
  195. name : "createTime",
  196. bind : "{createTime}",
  197. fieldLabel : "创建时间",
  198. allowBlank : true,
  199. columnWidth : 0.25
  200. }, {
  201. format : "Y-m-d",
  202. xtype : "datefield",
  203. name : "updateTime",
  204. bind : "{updateTime}",
  205. fieldLabel : "更新时间",
  206. allowBlank : true,
  207. columnWidth : 0.25
  208. }, {
  209. xtype : "textfield",
  210. readOnly : true,
  211. editable : false,
  212. name : "pu_status",
  213. bind : "{pu_status}",
  214. fieldLabel : "单据状态",
  215. allowBlank : true,
  216. columnWidth : 0.25
  217. },
  218. // {
  219. // xtype : "hidden",
  220. // readOnly : true,
  221. // editable : false,
  222. // name : "pu_statuscode",
  223. // bind : "{pu_statuscode}",
  224. // fieldLabel : "单据状态码",
  225. // allowBlank : true,
  226. // columnWidth : 0.0
  227. // },
  228. {
  229. xtype : "textfield",
  230. name : "pu_statuscode",
  231. bind : "{pu_statuscode}",
  232. fieldLabel : "忽略字段",
  233. ignore:true,
  234. allowBlank : true,
  235. columnWidth : 0.25
  236. }]
  237. });