supplyChain.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. Ext.define('trade.view.sys.parameter.tabpage.supplyChain', {
  2. extend: 'Ext.panel.Panel',
  3. xtype: 'trade-supplychain-panel',
  4. cls: 'sys-supplychain-panel x-sys-setting',
  5. // controller: 'sys-power-formpanel',
  6. // viewModel: 'sys-power-formpanel',
  7. layout: 'column',
  8. border: 1,
  9. bodyPadding: 5,
  10. scrollable: true,
  11. defaults: {
  12. padding: '8 10 0 40',
  13. columnWidth: 0.3
  14. },
  15. viewModel: {
  16. data: {
  17. }
  18. },
  19. items: [{
  20. xtype: 'component',
  21. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">请购管理设置</div>',
  22. columnWidth: 1,
  23. padding: '8 10 0 20',
  24. }, {
  25. xtype: 'combobox',
  26. name: 'getPriceAndVendor',
  27. fieldLabel: '请购单取价优先选项',
  28. labelWidth: 140,
  29. store: Ext.create('Ext.data.Store', {
  30. fields: ['valueField', 'displayField'],
  31. data : [
  32. {"valueField":"最低价", "displayField":"最低价"},
  33. {"valueField":"最新价", "displayField":"最新价"}
  34. ]
  35. }),
  36. queryMode: 'local',
  37. displayField: 'displayField',
  38. valueField: 'valueField',
  39. bind: '{getPriceAndVendorValue}'
  40. }, {
  41. xtype: 'component',
  42. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">采购管理设置</div>',
  43. columnWidth: 1,
  44. padding: '8 10 0 20',
  45. }, {
  46. xtype: 'textfield',
  47. fieldLabel: '询价默认有效天数',
  48. labelWidth: 120,
  49. name: 'InquiryEffectiveDays',
  50. bind: '{InquiryEffectiveDays}'
  51. }, {
  52. xtype: 'displayfield',
  53. value: '<div style="color:#A9A9A9;">*采购询价截止日期=询价日期+询价默认有效天数</div>',
  54. columnWidth: 0.9
  55. }, {
  56. xtype: 'textfield',
  57. fieldLabel: '价格默认有效天数',
  58. name: 'ValidDateByPrice',
  59. labelWidth: 120,
  60. bind: '{ValidDateByPriceValue}'
  61. }, {
  62. xtype: 'displayfield',
  63. value: '<div style="color:#A9A9A9;">*核价单物料截止日期=生效日期+价格默认有效天数</div>',
  64. columnWidth: 0.9
  65. }, {
  66. xtype: 'component',
  67. html: '<span style="color:#505363;">若需要管控采购单价必须从核价单取价,请勾选</span>',
  68. columnWidth: 0.9
  69. }, {
  70. xtype: 'checkbox',
  71. name: 'ForceGetPrice',
  72. padding: '0 0 0 50',
  73. margin: '5 0 20 0',
  74. boxLabel: '强制取价',
  75. bind: '{ForceGetPriceValue}'
  76. } /*{
  77. xtype: 'component',
  78. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">品质管理设置</div>',
  79. columnWidth: 1,
  80. padding: '8 10 0 20',
  81. }, {
  82. xtype: 'component',
  83. html: '<span style="color:#505363;">若您需要采购验收入库进行检验管理,请勾选</span>',
  84. columnWidth: 0.9
  85. }, {
  86. xtype: 'checkbox',
  87. name: 'forceGetValue',
  88. padding: '0 0 0 50',
  89. margin:'5 0 20 0',
  90. boxLabel: '启用采购收料检验',
  91. }, {
  92. xtype: 'component',
  93. html: '<span style="color:#505363;">若您需要外协验收入库进行检验管理,请勾选</span>',
  94. columnWidth: 0.9
  95. }, {
  96. xtype: 'checkbox',
  97. name: 'forceGetValue',
  98. padding: '0 0 0 50',
  99. margin:'5 0 20 0',
  100. boxLabel: '启用外协收料检验',
  101. }, {
  102. xtype: 'component',
  103. html: '<span style="color:#505363;">若您需要制造完工入库进行检验管理,请勾选</span>',
  104. columnWidth: 0.9
  105. }, {
  106. xtype: 'checkbox',
  107. name: 'forceGetValue',
  108. padding: '0 0 0 50',
  109. margin:'5 0 20 0',
  110. boxLabel: '启用完工入库检验',
  111. }*/, {
  112. xtype: 'component',
  113. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">智能采购设置</div>',
  114. columnWidth: 1,
  115. padding: '8 10 0 20',
  116. }, {
  117. xtype: 'checkbox',
  118. name: 'ENABLEMRP',
  119. padding: '0 0 0 50',
  120. margin: '5 0 0 0',
  121. columnWidth: 0.6,
  122. boxLabel: '系统自动运算智能采购并投放采购单',
  123. bind: '{ENABLEMRPValue}'
  124. }, {
  125. xtype: 'fieldset',
  126. title: '合并采购设置',
  127. layout: 'column',
  128. columnWidth: 0.6,
  129. margin: '0 0 0 40',
  130. items: [{
  131. xtype: 'radiogroup',
  132. columnWidth: 0.3,
  133. margin: '0 0 10 25',
  134. name: 'mergePurc',
  135. simpleValue: true,
  136. defaultType: 'container',
  137. columns: 1,
  138. bind: '{mergePurcValue}',
  139. items: [
  140. { xtype: 'radiofield', boxLabel: '不合并', inputValue: '0' },
  141. { xtype: 'radiofield', boxLabel: '全部合并', inputValue: '1' },
  142. { xtype: 'radiofield', boxLabel: '按天数合并', inputValue: '2' }
  143. ]
  144. }, {
  145. columnWidth: 0.3,
  146. xtype: 'numberfield',
  147. name: 'mergeDays',
  148. margin: '65 0 10',
  149. bind: {
  150. value: '{mergeDaysValue}',
  151. disabled: "{'2'!=mergePurcValue}"
  152. },
  153. }]
  154. }, {
  155. xtype: 'fieldset',
  156. title: '其它设置',
  157. layout: 'column',
  158. columnWidth: 0.6,
  159. margin: '0 0 0 40',
  160. items: [{
  161. margin: '0 0 15 25',
  162. xtype: 'checkbox',
  163. name: 'safetystock',
  164. boxLabel: '安全库存纳入需求',
  165. inputValue: '1',
  166. columnWidth: 0.5,
  167. bind: '{safetystockValue}'
  168. }, {
  169. margin: '0 0 15 25',
  170. xtype: 'checkbox',
  171. name: 'mpq',
  172. boxLabel: '最小包装采购',
  173. inputValue: '1',
  174. columnWidth: 0.5,
  175. bind: '{mpqValue}'
  176. },]
  177. },{
  178. xtype: 'component',
  179. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">交期运算设置</div>',
  180. columnWidth: 1,
  181. padding: '8 10 0 20',
  182. },{
  183. xtype: 'checkbox',
  184. name: 'useAutoATP',
  185. padding: '0 0 0 50',
  186. margin: '5 0 0 0',
  187. boxLabel: '启用交期自动运算',
  188. bind: '{useAutoATP}'
  189. }, {
  190. xtype: 'displayfield',
  191. value: '<div style="color:#A9A9A9;">*自动计算交期</div>',
  192. columnWidth: 0.9
  193. },{
  194. xtype: 'component',
  195. html: '<span style="color:#505363;">若需要管控物料必须设置提前期才允许备货,请勾选此项:</span>',
  196. columnWidth: 0.9
  197. }, {
  198. xtype: 'checkbox',
  199. name: 'foreCastHasLeadtime',
  200. padding: '0 0 0 50',
  201. margin: '5 0 0 0',
  202. boxLabel: '产品或下阶物料需设置提前期',
  203. bind: '{foreCastHasLeadtime}'
  204. }, {
  205. xtype: 'displayfield',
  206. value: '<div style="color:#A9A9A9;">*启用则备货单提交、审核时判断所有涉及的外购件是否有设置提前期,没有则限制</div>',
  207. columnWidth: 0.9
  208. },{
  209. xtype: 'component',
  210. html: '<span style="color:#505363;">若需要管控物料必须设置提前期才允许下销售订单,请勾选此项:</span>',
  211. columnWidth: 0.9
  212. }, {
  213. xtype: 'checkbox',
  214. name: 'saleHasLeadtime',
  215. padding: '0 0 0 50',
  216. margin: '5 0 0 0',
  217. boxLabel: '产品或下阶物料需设置提前期',
  218. bind: '{saleHasLeadtime}'
  219. }, {
  220. xtype: 'displayfield',
  221. value: '<div style="color:#A9A9A9;">*启用则订单提交、审核时判断所有涉及的外购件是否有设置提前期,没有则限制</div>',
  222. columnWidth: 0.9
  223. },{
  224. xtype: 'combo',
  225. fieldLabel: '交期运算优先选项',
  226. labelWidth: 120,
  227. name: 'atpType',
  228. bind: '{atpType}',
  229. queryMode: 'local',
  230. displayField: 'value',
  231. valueField: 'value',
  232. editable: false,
  233. store: Ext.create('Ext.data.ArrayStore', {
  234. fields: ['value'],
  235. data: [
  236. ["订单优先"],
  237. ["交期优先"]
  238. ]
  239. }),
  240. }, {
  241. xtype: 'displayfield',
  242. value: '<div style="color:#A9A9A9;">*设置优先选项,则交期运算时优先选项就取这个</div>',
  243. columnWidth: 0.9
  244. },{
  245. xtype: 'component',
  246. html: '<span style="color:#505363;">若需要交期运算后需求自动生成询价单,请勾选此项:</span>',
  247. columnWidth: 0.9
  248. }, {
  249. xtype: 'checkbox',
  250. name: 'autoInquiryAfterAtp',
  251. padding: '0 0 0 50',
  252. margin: '5 0 0 0',
  253. boxLabel: '交期运算后自动询价',
  254. bind: '{autoInquiryAfterAtp}'
  255. }, {
  256. xtype: 'displayfield',
  257. value: '<div style="color:#A9A9A9;">*启用则销售订单审核后自动将交期运算中的需求生成公共询价</div>',
  258. columnWidth: 0.9
  259. },],
  260. initComponent: function () {
  261. var me = this,
  262. viewModel = me.getViewModel(),
  263. mainViewModel = Ext.getCmp('mainView').getViewModel(),
  264. getPriceAndVendor = mainViewModel.get('getPriceAndVendor'),
  265. forceGetPrice = mainViewModel.get('ForceGetPrice'),
  266. validDateByPrice = mainViewModel.get('ValidDateByPrice'),
  267. InquiryEffectiveDays = mainViewModel.get('InquiryEffectiveDays'),
  268. ENABLEMRP = mainViewModel.get('ENABLEMRP'), //系统自动运算智能采购并投放采购单
  269. mergePurc = mainViewModel.get('mergePurc'), //采购合并设置
  270. mergeDays = mainViewModel.get('mergeDays'), //合并天数
  271. safetystock = mainViewModel.get('safetystock'), //安全库存纳入需求
  272. mpq = mainViewModel.get('mpq'); //最小包采购
  273. if (getPriceAndVendor) {
  274. viewModel.set('getPriceAndVendorValue', getPriceAndVendor);
  275. }
  276. if (forceGetPrice) {
  277. viewModel.set('ForceGetPriceValue', forceGetPrice);
  278. }
  279. if (validDateByPrice) {
  280. viewModel.set('ValidDateByPriceValue', validDateByPrice);
  281. }
  282. if (InquiryEffectiveDays) {
  283. viewModel.set('InquiryEffectiveDays', InquiryEffectiveDays);
  284. }
  285. if (ENABLEMRP) {
  286. viewModel.set('ENABLEMRPValue', ENABLEMRP);
  287. }
  288. if (mergePurc) {
  289. viewModel.set('mergePurcValue', mergePurc);
  290. }
  291. if (mergeDays) {
  292. viewModel.set('mergeDaysValue', mergeDays);
  293. }
  294. if (safetystock) {
  295. viewModel.set('safetystockValue', safetystock);
  296. }
  297. if (mpq) {
  298. viewModel.set('mpqValue', mpq);
  299. }
  300. me.callParent(arguments);
  301. }
  302. });