FormPanel.js 7.3 KB

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