FormPanel.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. Ext.define('saas.view.sale.b2b.reconciliation.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'sale-b2b-reconciliation-formpanel',
  4. controller: 'sale-b2b-reconciliation-formpanel',
  5. viewModel: 'sale-b2b-reconciliation-formpanel',
  6. viewName: 'sale-b2b-reconciliation-formpanel',
  7. //字段属性
  8. _title: '应收对账单',
  9. _idField: 'id',
  10. _codeField: 'code',
  11. _readUrl: '/api/sale/b2b/apCheck/info',
  12. initId: 0,
  13. initComponent: function () {
  14. Ext.apply(this, {
  15. defaultItems: [{
  16. xtype: 'hidden',
  17. name: 'id',
  18. fieldLabel: 'id'
  19. },{
  20. xtype: 'hidden',
  21. name: 'endDate',
  22. fieldLabel: 'endDate'
  23. },{
  24. xtype: 'hidden',
  25. name: 'beginDate',
  26. fieldLabel: 'beginDate'
  27. }, {
  28. xtype: "textfield",
  29. name: "custName",
  30. fieldLabel: "客户名称",
  31. allowBlank: true,
  32. readOnly:true
  33. }, {
  34. xtype: "textfield",
  35. name: "ac_date",
  36. fieldLabel: "对账期间",
  37. allowBlank: true,
  38. readOnly:true
  39. }, {
  40. xtype: "datefield",
  41. renderer:function(v,m,r){
  42. if(v&&v!=''){
  43. return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
  44. }
  45. },
  46. name: "apDate",
  47. fieldLabel: "制单日期",
  48. allowBlank: true,
  49. readOnly:true
  50. } ,{
  51. xtype: "textfield",
  52. name: "recorder",
  53. fieldLabel: "制单人",
  54. allowBlank: true,
  55. readOnly:true
  56. }, {
  57. xtype: "textfield",
  58. name: "checkStatus",
  59. fieldLabel: "对账状态",
  60. allowBlank: true,
  61. readOnly:true
  62. },{
  63. xtype: "numberfield",
  64. name: "checkAmount",
  65. fieldLabel: "对账总额",
  66. allowBlank: true,
  67. readOnly:true
  68. },{
  69. xtype: "textfield",
  70. name: "currency",
  71. fieldLabel: "币别",
  72. allowBlank: true,
  73. readOnly:true
  74. },{
  75. xtype: "numberfield",
  76. name: "rate",
  77. fieldLabel: "汇率",
  78. allowBlank: true,
  79. readOnly:true
  80. },
  81. {
  82. name: "detailGridField",
  83. xtype: "detailGridField",
  84. detnoColumn: 'ad_detno',
  85. editable:false,
  86. allowEmpty: true,
  87. columns: [{
  88. text: "id",
  89. dataIndex: "id",
  90. xtype: "numbercolumn",
  91. hidden: true
  92. },{
  93. text: "ad_acid",
  94. dataIndex: "ad_acid",
  95. xtype: "numbercolumn",
  96. hidden: true
  97. },{
  98. hidden:true,
  99. text: "采购单号",
  100. width: 150.0,
  101. dataIndex: "orderCode",
  102. }, {
  103. text: "验收单号",
  104. width: 120.0,
  105. dataIndex: "inoutno",
  106. },{
  107. text: "物料编号",
  108. width: 120.0,
  109. dataIndex: "prodCode",
  110. ignore: true,
  111. },{
  112. text: "物料名称",
  113. dataIndex: "prodTitle",
  114. width: 150.0
  115. },{
  116. text: "规格型号",
  117. dataIndex: "prodSpec",
  118. width: 200.0
  119. },{
  120. text: "单位",
  121. dataIndex: "prodUnit",
  122. width: 100.0
  123. },{
  124. text: "数量",
  125. xtype:'numbercolumn',
  126. width: 150.0,
  127. dataIndex: "checkQty",
  128. ignore: true,
  129. renderer: function (v, m, r) {
  130. return saas.util.BaseUtil.numberFormat(v, 3, false);
  131. }
  132. },{
  133. text: "含税单价",
  134. width: 100.0,
  135. dataIndex: "price",
  136. xtype:'numbercolumn',
  137. ignore: true,
  138. renderer: function (v, m, r) {
  139. return saas.util.BaseUtil.numberFormat(v, 4, false);
  140. }
  141. },{
  142. text: "税率%",
  143. xtype:'numbercolumn',
  144. width: 100.0,
  145. dataIndex: "taxrate",
  146. ignore: true,
  147. renderer: function (v, m, r) {
  148. return saas.util.BaseUtil.numberFormat(v, 2, false);
  149. }
  150. },{
  151. text: "金额",
  152. xtype:'numbercolumn',
  153. width: 100.0,
  154. dataIndex: "amount",
  155. renderer: function (v, m, r) {
  156. return saas.util.BaseUtil.numberFormat(v, 4, false);
  157. }
  158. }],
  159. initColumns: function() {
  160. // 构造序号列
  161. var me = this,
  162. columns = me.columns,
  163. detnoField = me.detnoColumn;
  164. indexColumn = {
  165. bind: {
  166. text: "{(configurable && isAdmin) ? ('<div class=\"x-sa sa-setting\" style=\"cursor: pointer;\" title=\"列设置\"></div>') : '序号'}"
  167. },
  168. dataIndex : detnoField,
  169. width : 60,
  170. xtype : "numbercolumn",
  171. align : 'center',
  172. format:'0',
  173. allowBlank: true,
  174. };
  175. if (detnoField) {
  176. Ext.apply(me, { columns: [indexColumn].concat(columns) });
  177. }
  178. }
  179. }]
  180. });
  181. this.callParent();
  182. },
  183. listeners:{
  184. load:function(f){
  185. this.getViewModel().setData({ac_date:Ext.Date.format(new Date(this.getViewModel().data.beginDate),'Y-m-d') + ' --- ' + Ext.Date.format(new Date(this.getViewModel().data.endDate),'Y-m-d')})
  186. }
  187. },
  188. isDirty: function () {
  189. return false;
  190. }
  191. });