FormPanel.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. Ext.define('saas.view.purchase.reconciliation.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'purchase-reconciliation-formpanel',
  4. controller: 'purchase-reconciliation-formpanel',
  5. viewModel: 'purchase-reconciliation-formpanel',
  6. viewName: 'purchase-reconciliation-formpanel',
  7. //字段属性
  8. _title: '平台对账单',
  9. _idField: 'id',
  10. _codeField: 'ac_code',
  11. _relationColumn: 'pd_puid',
  12. _readUrl: '/api/money/apcheck/read',
  13. initId: 0,
  14. toolBtns: [{
  15. xtype: 'button',
  16. text: '确认',
  17. bind: {
  18. hidden: '{Hidden}'
  19. },
  20. handler: 'agree'
  21. },{
  22. cls:'x-formpanel-btn-red',
  23. xtype: 'button',
  24. text: '不同意',
  25. bind: {
  26. hidden: '{Hidden}'
  27. },
  28. handler: 'disagree'
  29. }],
  30. initComponent: function () {
  31. Ext.apply(this, {
  32. defaultItems: [{
  33. xtype: 'hidden',
  34. name: 'id',
  35. fieldLabel: 'id'
  36. }, {
  37. xtype: "textfield",
  38. name: "ac_vendname",
  39. fieldLabel: "供应商名称",
  40. allowBlank: true,
  41. readOnly:true
  42. }, {
  43. xtype: "textfield",
  44. name: "ac_date",
  45. fieldLabel: "对账日期",
  46. allowBlank: true,
  47. readOnly:true
  48. }, {
  49. xtype: "textfield",
  50. name: "ac_currency",
  51. fieldLabel: "币别",
  52. allowBlank: true,
  53. readOnly:true
  54. } ,{
  55. xtype: "numberfield",
  56. name: "ac_thisamount",
  57. fieldLabel: "本期应付金额",
  58. allowBlank: true,
  59. readOnly:true
  60. }, {
  61. xtype: "numberfield",
  62. name: "ac_thisuncheck",
  63. fieldLabel: "本期未对账",
  64. allowBlank: true,
  65. readOnly:true
  66. },{
  67. xtype: "numberfield",
  68. name: "ac_thispay",
  69. fieldLabel: "本期已付",
  70. allowBlank: true,
  71. readOnly:true
  72. },{
  73. xtype: "numberfield",
  74. name: "ac_thissend",
  75. fieldLabel: "本期发货",
  76. allowBlank: true,
  77. readOnly:true
  78. },{
  79. xtype: "numberfield",
  80. name: "ac_thischeck",
  81. fieldLabel: "本期已对账",
  82. allowBlank: true,
  83. readOnly:true
  84. },{
  85. xtype: "numberfield",
  86. name: "ac_payamont",
  87. fieldLabel: "应付总额",
  88. allowBlank: true,
  89. readOnly:true
  90. },{
  91. xtype: "textfield",
  92. name: "ac_confirmstatus",
  93. fieldLabel: "确认状态",
  94. allowBlank: true,
  95. readOnly:true
  96. },
  97. {
  98. name: "detailGridField",
  99. xtype: "detailGridField",
  100. storeModel: 'saas.model.purchase.ApCheckDetail',
  101. detnoColumn: 'ad_detno',
  102. editable:false,
  103. features : [Ext.create('Ext.grid.feature.Grouping',{
  104. collapsible:false,
  105. showSummaryRow: false,
  106. groupHeaderTpl: '采购单号 : {name} (共:{rows.length}条)'
  107. })],
  108. allowEmpty: true,
  109. columns: [{
  110. text: "id",
  111. dataIndex: "id",
  112. xtype: "numbercolumn",
  113. hidden: true
  114. },{
  115. text: "ad_acid",
  116. dataIndex: "ad_acid",
  117. xtype: "numbercolumn",
  118. hidden: true
  119. },{
  120. hidden:true,
  121. text: "采购单号",
  122. width: 150.0,
  123. dataIndex: "ad_pucode",
  124. }, {
  125. text: "出入库单号",
  126. width: 120.0,
  127. dataIndex: "ad_inoutno",
  128. },{
  129. text: "物料编号",
  130. width: 120.0,
  131. dataIndex: "ad_prodcode",
  132. ignore: true,
  133. }, {
  134. text: "品牌",
  135. dataIndex: "pr_brand",
  136. width: 100.0
  137. }, {
  138. text: "物料名称",
  139. dataIndex: "pr_detail",
  140. width: 150.0
  141. }, {
  142. text: "型号",
  143. dataIndex: "pr_orispeccode",
  144. width: 200.0
  145. }, {
  146. text: "规格",
  147. dataIndex: "pr_spec",
  148. width: 200.0
  149. },{
  150. text: "数量",
  151. xtype:'numbercolumn',
  152. width: 150.0,
  153. dataIndex: "ad_b2bqty",
  154. ignore: true
  155. },{
  156. text: "含税单价",
  157. width: 100.0,
  158. dataIndex: "ad_price",
  159. xtype:'numbercolumn',
  160. ignore: true
  161. },{
  162. text: "税率%",
  163. xtype:'numbercolumn',
  164. width: 100.0,
  165. dataIndex: "ad_taxrate",
  166. ignore: true
  167. },{
  168. text: "价税合计",
  169. xtype:'numbercolumn',
  170. width: 100.0,
  171. dataIndex: "ad_price",
  172. renderer:function(v,a,rec,c,d,e,f){
  173. return saas.util.BaseUtil.numberFormat(rec.get('ad_price') * rec.get('ad_b2bqty'), 2, true);
  174. }
  175. }],
  176. initColumns: function() {
  177. // 构造序号列
  178. var me = this,
  179. columns = me.columns,
  180. detnoField = me.detnoColumn;
  181. indexColumn = {
  182. bind: {
  183. text: "{(configurable && isAdmin) ? ('<div class=\"x-sa sa-setting\" style=\"cursor: pointer;\" title=\"列设置\"></div>') : '序号'}"
  184. },
  185. dataIndex : detnoField,
  186. width : 60,
  187. xtype : "numbercolumn",
  188. align : 'center',
  189. format:'0',
  190. allowBlank: true,
  191. };
  192. if (detnoField) {
  193. Ext.apply(me, { columns: [indexColumn].concat(columns) });
  194. }
  195. }
  196. }]
  197. });
  198. this.callParent();
  199. },
  200. listeners: {
  201. load:function(form){
  202. form.getViewModel().getData().detail0.detailStore.group('ad_pucode', 'ASC');
  203. }
  204. }
  205. });