finance.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. Ext.define('make.view.sys.parameter.tabpage.finance', {
  2. extend: 'Ext.form.Panel',
  3. xtype: 'make-finance-panel',
  4. cls: 'sys-finance-panel x-sys-setting',
  5. layout: 'column',
  6. border: 1,
  7. bodyPadding: 5,
  8. scrollable: true,
  9. autoScroll: true,
  10. defaults: {
  11. padding: '8 10 0 40',
  12. columnWidth: 0.3
  13. },
  14. viewModel: {
  15. data: {
  16. recSourceValue: 'CHECK',
  17. paySourceValue: 'CHECK',
  18. billUserNameValue: '',
  19. billPassWordValue: ''
  20. }
  21. },
  22. items: [{
  23. xtype: 'component',
  24. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">初始化期间设置</div>',
  25. columnWidth: 1,
  26. padding: '8 10 0 20',
  27. }, {
  28. xtype: 'textfield',
  29. fieldLabel: '初始化期间',
  30. name: 'initPeriod',
  31. bind: '{initPeriodValue}',
  32. editable:false
  33. }, {
  34. xtype: 'component',
  35. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">默认税率设置</div>',
  36. columnWidth: 1,
  37. padding: '8 10 0 20',
  38. }, {
  39. xtype: 'combo',
  40. fieldLabel: '默认税率',
  41. readOnly: false,
  42. queryMode: 'local',
  43. displayField: 'name',
  44. valueField: 'value',
  45. editable: true,
  46. name: 'defaultTaxRate',
  47. bind: '{defaultTaxRateValue}',
  48. store: Ext.create('Ext.data.Store', {
  49. fields: ['name', 'value'],
  50. data: [
  51. { value: '0', name: '0' },
  52. { value: '3', name: '3' },
  53. { value: '6', name: '6' },
  54. { value: '13', name: '13' }
  55. ]
  56. })
  57. }, {
  58. xtype: 'displayfield',
  59. value: '<div style="color:#A9A9A9;">*系统客户与供应商新增默认交易税率</div>',
  60. columnWidth: 0.9
  61. }, {
  62. xtype: 'component',
  63. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">存货计价设置</div>',
  64. columnWidth: 1,
  65. padding: '8 10 0 20',
  66. }, {
  67. xtype: 'combo',
  68. fieldLabel: '存货计价方式',
  69. readOnly: false,
  70. queryMode: 'local',
  71. displayField: 'name',
  72. valueField: 'value',
  73. name: 'cucaltor',
  74. bind: '{cucaltorValue}',
  75. store: Ext.create('Ext.data.Store', {
  76. fields: ['name', 'value'],
  77. data: [
  78. { value: 'WACC', name: '加权平均数' },
  79. { value: 'FIFO', name: '先进先出法' },
  80. ]
  81. })
  82. }, {
  83. xtype: 'component',
  84. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">本位币设置</div>',
  85. columnWidth: 1,
  86. padding: '8 10 0 20',
  87. }, {
  88. xtype: 'combo',
  89. fieldLabel: '本位币',
  90. readOnly: false,
  91. queryMode: 'local',
  92. displayField: 'name',
  93. valueField: 'value',
  94. name: 'defaultCurrency',
  95. bind: '{defaultCurrencyValue}',
  96. store: Ext.create('Ext.data.Store', {
  97. fields: ['name', 'value'],
  98. data: [
  99. { value: 'RMB', name: 'RMB' },
  100. { value: 'USD', name: 'USD' },
  101. { value: 'EUR', name: 'EUR' },
  102. { value: 'HKD', name: 'HKD' },
  103. { value: 'JPY', name: 'JPY' },
  104. ]
  105. })
  106. }, {
  107. xtype: 'displayfield',
  108. value: '<div style="color:#A9A9A9;">*本位币修改之后会自动重算业务单据的汇率以及成本等,开账第二个月后不允许修改</div>',
  109. columnWidth: 0.9
  110. }, {
  111. xtype: 'component',
  112. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">发票来源设置</div>',
  113. columnWidth: 1,
  114. padding: '8 10 0 20'
  115. }, {
  116. xtype: 'fieldset',
  117. title: '应收发票来源',
  118. layout: 'column',
  119. columnWidth: 0.6,
  120. margin: '0 0 0 40',
  121. items: [{
  122. xtype: 'radiogroup',
  123. margin: '0 0 20 25',
  124. name: 'recSource',
  125. simpleValue: true,
  126. defaultType: 'container',
  127. columns: 1,
  128. bind: '{recSourceValue}',
  129. items: [
  130. { xtype: 'radiofield', boxLabel: '销售对账单', inputValue: 'CHECK' },
  131. { xtype: 'radiofield', boxLabel: '应收开票', inputValue: 'PRODIO' },
  132. { xtype: 'radiofield', boxLabel: '销售出货/退货审核自动产生', inputValue: 'PRODIOAUTO' }
  133. ]
  134. }]
  135. }, {
  136. xtype: 'fieldset',
  137. title: '应付发票来源',
  138. layout: 'column',
  139. columnWidth: 0.6,
  140. margin: '0 0 0 40',
  141. items: [{
  142. xtype: 'radiogroup',
  143. margin: '0 0 20 25',
  144. name: 'paySource',
  145. simpleValue: true,
  146. defaultType: 'container',
  147. columns: 1,
  148. bind: '{paySourceValue}',
  149. items: [
  150. { xtype: 'radiofield', boxLabel: saas.util.BaseUtil.getCompanyApp() == 'trade-app' ? '采购对账单' : '采购对账单、外协对账单', inputValue: 'CHECK' },
  151. { xtype: 'radiofield', boxLabel: '应付开票', inputValue: 'PRODIO' },
  152. { xtype: 'radiofield', boxLabel: saas.util.BaseUtil.getCompanyApp() == 'trade-app' ? '采购入库/退货审核自动产生' : '采购入库/退货、外协验收/验退审核自动产生', inputValue: 'PRODIOAUTO' }
  153. ]
  154. }]
  155. }, {
  156. xtype: 'component',
  157. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">开票对接设置</div>',
  158. columnWidth: 1,
  159. padding: '8 10 0 20'
  160. }, {
  161. xtype: 'textfield',
  162. name: 'billUserName',
  163. bind: '{billUserNameValue}',
  164. fieldLabel: '账号',
  165. labelWidth: 50,
  166. columnWidth: 0.6
  167. }, {
  168. xtype: 'textfield',
  169. name: 'billPassWord',
  170. bind: '{billPassWordValue}',
  171. fieldLabel: '密码',
  172. labelWidth: 50,
  173. columnWidth: 0.6
  174. }],
  175. initComponent: function () {
  176. var me = this,
  177. viewModel = me.getViewModel(),
  178. mainViewModel = Ext.getCmp('mainView').getViewModel(),
  179. billsourceAP = mainViewModel.get('BillOutAPSource'),
  180. billsourceAR = mainViewModel.get('BillOutARSource'),
  181. billUserName = mainViewModel.get('billUserName'),
  182. billPassWord = mainViewModel.get('billPassWord'),
  183. defaultCurrency = mainViewModel.get('defaultCurrency'),
  184. cucaltor = mainViewModel.get('cucaltor'),
  185. defaultTaxRate = mainViewModel.get('defaultTaxRate'),
  186. initPeriod = mainViewModel.get('initPeriod');
  187. if (billsourceAP) {
  188. viewModel.set('paySourceValue', billsourceAP);
  189. }
  190. if (billsourceAR) {
  191. viewModel.set('recSourceValue', billsourceAR);
  192. }
  193. if (billUserName) {
  194. viewModel.set('billUserNameValue', billUserName);
  195. }
  196. if (billPassWord) {
  197. viewModel.set('billPassWordValue', billPassWord);
  198. }
  199. if (defaultCurrency) {
  200. viewModel.set('defaultCurrencyValue', defaultCurrency); //本位币
  201. }
  202. if (cucaltor) {
  203. viewModel.set('cucaltorValue', cucaltor); //存货计价方式
  204. }
  205. if (defaultTaxRate) {
  206. viewModel.set('defaultTaxRateValue', defaultTaxRate); //默认税率
  207. }
  208. if (initPeriod) {
  209. viewModel.set('initPeriodValue', initPeriod); //初始化期间
  210. }
  211. me.callParent(arguments);
  212. }
  213. });