FormPanel.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. etc:{
  122. vendorkind:{
  123. keyField:'id',
  124. dataField:'vk_name',
  125. reqUrl:'http://192.168.253.41:9480/api/document/vendorkind/save',
  126. delUrl:'http://192.168.253.41:9480/api/document/vendorkind/delete'
  127. }
  128. },
  129. addHandler:function(b){
  130. var form = this.ownerCmp.ownerCt;
  131. this.dialog = form.getController().getView().add({
  132. xtype: 'document-kind-childwin',
  133. bind: {
  134. title: '新增供应商类型'
  135. },
  136. dataKind:'vendorkind',
  137. belong:this.ownerCmp.etc['vendorkind'],
  138. _parent:form,
  139. record:null,
  140. session: true
  141. });
  142. this.dialog.show();
  143. }
  144. }, {
  145. name : "detailGridField",
  146. xtype : "detailGridField",
  147. columns : [
  148. {
  149. text : "序号",
  150. dataIndex : "pd_detno",
  151. width : 100,
  152. xtype : "numbercolumn",
  153. align : 'center',
  154. format:'0',
  155. summaryType: 'count',
  156. summaryRenderer: function(value, summaryData, dataIndex) {
  157. return Ext.String.format('合计: {0}条', value);
  158. },
  159. },
  160. {
  161. editor : {
  162. displayField : "display",
  163. editable : true,
  164. format : "",
  165. hideTrigger : false,
  166. maxLength : 100.0,
  167. minValue : null,
  168. positiveNum : false,
  169. queryMode : "local",
  170. store : null,
  171. valueField : "value",
  172. xtype : "multidbfindtrigger"
  173. },
  174. text : "物料编号",
  175. width : 200.0,
  176. dataIndex : "pd_prodcode",
  177. xtype : "",
  178. items : null
  179. },
  180. {
  181. text : "单位",
  182. editor : {
  183. xtype : "textfield"
  184. },
  185. dataIndex : "pd_unit",
  186. width : 120.0,
  187. xtype : "",
  188. items : null
  189. },
  190. {
  191. text : "数量",
  192. dataIndex : "pd_yqty",
  193. editor : {
  194. xtype : "numberfield"
  195. },
  196. width : 120.0,
  197. xtype : "numbercolumn",
  198. format:'0',
  199. items : null,
  200. summaryType: 'sum'
  201. },
  202. {
  203. text : "单价",
  204. editor : {
  205. xtype : "numberfield"
  206. },
  207. format:'0,000.00',
  208. dataIndex : "pd_price",
  209. width : 120.0,
  210. xtype : "numbercolumn",
  211. items : null,
  212. summaryType: 'sum'
  213. },
  214. {
  215. text : "总额",
  216. dataIndex : "pd_total",
  217. width : 120.0,
  218. xtype : "numbercolumn",
  219. summaryType: 'sum'
  220. },
  221. {
  222. text : "税额",
  223. dataIndex : "pd_taxtotal",
  224. flex : 1.0,
  225. xtype : "numbercolumn",
  226. summaryType: 'sum'
  227. }
  228. ]
  229. }, {
  230. format : "Y-m-d",
  231. xtype : "datefield",
  232. name : "createTime",
  233. bind : "{createTime}",
  234. fieldLabel : "创建时间",
  235. allowBlank : true,
  236. columnWidth : 0.25
  237. }, {
  238. format : "Y-m-d",
  239. xtype : "datefield",
  240. name : "updateTime",
  241. bind : "{updateTime}",
  242. fieldLabel : "更新时间",
  243. allowBlank : true,
  244. columnWidth : 0.25
  245. }, {
  246. xtype : "textfield",
  247. readOnly : true,
  248. editable : false,
  249. name : "pu_status",
  250. bind : "{pu_status}",
  251. fieldLabel : "单据状态",
  252. allowBlank : true,
  253. columnWidth : 0.25
  254. },
  255. // {
  256. // xtype : "hidden",
  257. // readOnly : true,
  258. // editable : false,
  259. // name : "pu_statuscode",
  260. // bind : "{pu_statuscode}",
  261. // fieldLabel : "单据状态码",
  262. // allowBlank : true,
  263. // columnWidth : 0.0
  264. // },
  265. {
  266. xtype : "textfield",
  267. name : "pu_statuscode",
  268. bind : "{pu_statuscode}",
  269. fieldLabel : "忽略字段",
  270. ignore:true,
  271. allowBlank : true,
  272. columnWidth : 0.25
  273. }]
  274. });