supplyChain.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. Ext.define('make.view.sys.parameter.tabpage.supplyChain', {
  2. extend: 'Ext.panel.Panel',
  3. xtype: 'make-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. forCalValue: '0'
  18. }
  19. },
  20. items: [{
  21. xtype: 'component',
  22. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">请购管理设置</div>',
  23. columnWidth: 1,
  24. padding: '8 10 0 20',
  25. }, {
  26. xtype: 'combobox',
  27. name: 'getPriceAndVendor',
  28. fieldLabel: '请购单取价优先选项',
  29. labelWidth: 140,
  30. store: Ext.create('Ext.data.Store', {
  31. fields: ['valueField', 'displayField'],
  32. data : [
  33. {"valueField":"最低价", "displayField":"最低价"},
  34. {"valueField":"最新价", "displayField":"最新价"}
  35. ]
  36. }),
  37. queryMode: 'local',
  38. displayField: 'displayField',
  39. valueField: 'valueField',
  40. bind: '{getPriceAndVendorValue}'
  41. }, {
  42. xtype: 'component',
  43. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">采购管理设置</div>',
  44. columnWidth: 1,
  45. padding: '8 10 0 20',
  46. }, {
  47. xtype: 'textfield',
  48. fieldLabel: '询价默认有效天数',
  49. labelWidth: 120,
  50. name: 'InquiryEffectiveDays',
  51. bind: '{InquiryEffectiveDays}'
  52. }, {
  53. xtype: 'displayfield',
  54. value: '<div style="color:#A9A9A9;">*采购询价截止日期=询价日期+询价默认有效天数</div>',
  55. columnWidth: 0.9
  56. }, {
  57. xtype: 'textfield',
  58. fieldLabel: '价格默认有效天数',
  59. name: 'ValidDateByPrice',
  60. labelWidth: 120,
  61. bind: '{ValidDateByPriceValue}'
  62. }, {
  63. xtype: 'displayfield',
  64. value: '<div style="color:#A9A9A9;">*核价单物料截止日期=生效日期+价格默认有效天数</div>',
  65. columnWidth: 0.9
  66. }, {
  67. xtype: 'component',
  68. html: '<span style="color:#505363;">若需要管控采购单价必须从核价单取价,请勾选</span>',
  69. columnWidth: 0.9
  70. }, {
  71. xtype: 'checkbox',
  72. name: 'ForceGetPrice',
  73. padding: '0 0 0 50',
  74. margin: '5 0 20 0',
  75. boxLabel: '强制取价',
  76. bind: '{ForceGetPriceValue}'
  77. } /*{
  78. xtype: 'component',
  79. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">品质管理设置</div>',
  80. columnWidth: 1,
  81. padding: '8 10 0 20',
  82. }, {
  83. xtype: 'component',
  84. html: '<span style="color:#505363;">若您需要采购验收入库进行检验管理,请勾选</span>',
  85. columnWidth: 0.9
  86. }, {
  87. xtype: 'checkbox',
  88. name: 'forceGetValue',
  89. padding: '0 0 0 50',
  90. margin:'5 0 20 0',
  91. boxLabel: '启用采购收料检验',
  92. }, {
  93. xtype: 'component',
  94. html: '<span style="color:#505363;">若您需要外协验收入库进行检验管理,请勾选</span>',
  95. columnWidth: 0.9
  96. }, {
  97. xtype: 'checkbox',
  98. name: 'forceGetValue',
  99. padding: '0 0 0 50',
  100. margin:'5 0 20 0',
  101. boxLabel: '启用外协收料检验',
  102. }, {
  103. xtype: 'component',
  104. html: '<span style="color:#505363;">若您需要制造完工入库进行检验管理,请勾选</span>',
  105. columnWidth: 0.9
  106. }, {
  107. xtype: 'checkbox',
  108. name: 'forceGetValue',
  109. padding: '0 0 0 50',
  110. margin:'5 0 20 0',
  111. boxLabel: '启用完工入库检验',
  112. }*/, {
  113. xtype: 'component',
  114. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">智能采购设置</div>',
  115. columnWidth: 1,
  116. padding: '8 10 0 20',
  117. }, {
  118. xtype: 'checkbox',
  119. name: 'ENABLEMRP',
  120. padding: '0 0 0 50',
  121. margin: '5 0 0 0',
  122. columnWidth: 0.6,
  123. boxLabel: '系统自动运算智能采购并投放采购单',
  124. bind: '{ENABLEMRPValue}'
  125. }, {
  126. xtype: 'displayfield',
  127. value: '',//占位
  128. columnWidth: 0.3
  129. }, {
  130. xtype: 'textfield',
  131. fieldLabel: '固定提前期(天)',
  132. labelWidth: 120,
  133. name: 'FixedLeadTime',
  134. bind: '{FixedLeadTime}'
  135. }, {
  136. xtype: 'displayfield',
  137. value: '<div style="color:#A9A9A9;">*设置则交期运算和智能采购运算时,会考虑物料固定提前期</div>',
  138. columnWidth: 0.9
  139. }, {
  140. xtype: 'fieldset',
  141. title: '合并采购设置',
  142. layout: 'column',
  143. columnWidth: 0.6,
  144. margin: '0 0 0 40',
  145. items: [{
  146. xtype: 'radiogroup',
  147. columnWidth: 0.3,
  148. margin: '0 0 10 25',
  149. name: 'mergePurc',
  150. simpleValue: true,
  151. defaultType: 'container',
  152. columns: 1,
  153. bind: '{mergePurcValue}',
  154. items: [
  155. { xtype: 'radiofield', boxLabel: '不合并', inputValue: '0' },
  156. { xtype: 'radiofield', boxLabel: '全部合并', inputValue: '1' },
  157. { xtype: 'radiofield', boxLabel: '按天数合并', inputValue: '2' }
  158. ]
  159. }, {
  160. columnWidth: 0.3,
  161. xtype: 'numberfield',
  162. name: 'mergeDays',
  163. margin: '65 0 10',
  164. bind: {
  165. value:'{mergeDaysValue}',
  166. disabled: "{'2'!=mergePurcValue}"
  167. },
  168. }]
  169. }, {
  170. xtype: 'fieldset',
  171. title: '其它设置',
  172. layout: 'column',
  173. columnWidth: 0.6,
  174. margin: '0 0 20 40',
  175. items: [{
  176. margin: '0 0 15 25',
  177. xtype: 'checkbox',
  178. name: 'safetystock',
  179. boxLabel: '安全库存纳入需求',
  180. inputValue: '1',
  181. columnWidth: 0.5,
  182. bind:'{safetystockValue}'
  183. }, {
  184. margin: '0 0 15 25',
  185. xtype: 'checkbox',
  186. name: 'mpq',
  187. boxLabel: '最小包装采购',
  188. inputValue: '1',
  189. columnWidth: 0.5,
  190. bind:'{mpqValue}'
  191. },]
  192. },{
  193. xtype: 'component',
  194. html: '<div style="padding:8px 12px;background-color: #ecedf0;color:#404040">交期运算设置</div>',
  195. columnWidth: 1,
  196. padding: '8 10 0 20',
  197. },{
  198. xtype: 'checkbox',
  199. name: 'useAutoATP',
  200. padding: '0 0 0 50',
  201. margin: '5 0 0 0',
  202. boxLabel: '启用交期自动运算',
  203. bind: '{useAutoATP}'
  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: 'foreCastHasLeadtime',
  215. padding: '0 0 0 50',
  216. margin: '5 0 0 0',
  217. boxLabel: '产品或下阶物料需设置提前期',
  218. bind: '{foreCastHasLeadtime}'
  219. }, {
  220. xtype: 'displayfield',
  221. value: '<div style="color:#A9A9A9;">*启用则备货单提交、审核时判断所有涉及的外购件是否有设置提前期,没有则限制</div>',
  222. columnWidth: 0.9
  223. },{
  224. xtype: 'component',
  225. html: '<span style="color:#505363;">若需要管控非外购产品无有效BOM不允许下销售订单,请勾选此项:</span>',
  226. columnWidth: 0.9
  227. }, {
  228. xtype: 'checkbox',
  229. name: 'saleHasBom',
  230. padding: '0 0 0 50',
  231. margin: '5 0 0 0',
  232. boxLabel: '非外购产品需有BOM才可下销售订单',
  233. bind: '{saleHasBom}'
  234. }, {
  235. xtype: 'displayfield',
  236. value: '<div style="color:#A9A9A9;">*启用则销售单提交、审核时如果物料生产类型不是外购,要判断是否存在已审核BOM</div>',
  237. columnWidth: 0.9
  238. },{
  239. xtype: 'component',
  240. html: '<span style="color:#505363;">若需要管控物料必须设置提前期才允许下销售订单,请勾选此项:</span>',
  241. columnWidth: 0.9
  242. }, {
  243. xtype: 'checkbox',
  244. name: 'saleHasLeadtime',
  245. padding: '0 0 0 50',
  246. margin: '5 0 0 0',
  247. boxLabel: '产品或下阶物料需设置提前期',
  248. bind: '{saleHasLeadtime}'
  249. }, {
  250. xtype: 'displayfield',
  251. value: '<div style="color:#A9A9A9;">*启用则订单提交、审核时判断所有涉及的外购件是否有设置提前期,没有则限制</div>',
  252. columnWidth: 0.9
  253. },{
  254. xtype: 'combo',
  255. fieldLabel: '交期运算优先选项',
  256. labelWidth: 120,
  257. name: 'atpType',
  258. bind: '{atpType}',
  259. queryMode: 'local',
  260. displayField: 'value',
  261. valueField: 'value',
  262. editable: false,
  263. store: Ext.create('Ext.data.ArrayStore', {
  264. fields: ['value'],
  265. data: [
  266. ["订单优先"],
  267. ["交期优先"]
  268. ]
  269. }),
  270. }, {
  271. xtype: 'displayfield',
  272. value: '<div style="color:#A9A9A9;">*设置优先选项,则交期运算时优先选项就取这个</div>',
  273. columnWidth: 0.9
  274. },{
  275. xtype: 'component',
  276. html: '<span style="color:#505363;">若需要交期运算后需求自动生成询价单,请勾选此项:</span>',
  277. columnWidth: 0.9
  278. }, {
  279. xtype: 'checkbox',
  280. name: 'autoInquiryAfterAtp',
  281. padding: '0 0 0 50',
  282. margin: '5 0 0 0',
  283. boxLabel: '交期运算后自动询价',
  284. bind: '{autoInquiryAfterAtp}'
  285. }, {
  286. xtype: 'displayfield',
  287. value: '<div style="color:#A9A9A9;">*启用则销售订单审核后自动将交期运算中的需求生成公共询价</div>',
  288. columnWidth: 0.9
  289. }, {
  290. xtype: 'checkbox',
  291. name: 'BOMChangeRelativeMake',
  292. padding: '0 0 0 50',
  293. margin: '5 0 0 0',
  294. boxLabel: 'BOM变更时变更未结案和未领料工单',
  295. bind: '{BOMChangeRelativeMake}'
  296. }, {
  297. xtype: 'component',
  298. html: '<span style="color:#505363;">若需要备货单审核后自动投放制造工单,请勾选此项:</span>',
  299. columnWidth: 0.9
  300. }, {
  301. xtype: 'checkbox',
  302. name: 'autoThrowMakeAfterAuditForecast',
  303. padding: '0 0 0 50',
  304. margin: '5 0 0 0',
  305. boxLabel: '审核后自动投放工单',
  306. bind: '{autoThrowMakeAfterAuditForecast}',
  307. columnWidth: 0.9
  308. },{
  309. xtype: 'radiogroup',
  310. margin:'0 0 10 15',
  311. name:'forecastThrowMakeStatus',
  312. fieldLabel: '自动投放工单状态',
  313. labelWidth:150,
  314. simpleValue:true,
  315. defaultType: 'container',
  316. bind:'{forecastThrowMakeStatus}',
  317. items: [
  318. {xtype: 'radiofield',boxLabel: '未审核', inputValue: 'UNAUDITED'},
  319. {xtype: 'radiofield',boxLabel: '已审核', inputValue: 'AUDITED'}
  320. ] ,
  321. columnWidth: 0.3
  322. },{
  323. xtype: 'displayfield',
  324. value: '<div style="color:#A9A9A9;">*启用则备货单审核后自动按照需求数量生成工单</div>',
  325. columnWidth: 0.9
  326. }, {
  327. xtype: 'component',
  328. html: '<span style="color:#505363;">若需要销售订单审核后自动投放制造工单,请勾选此项:</span>',
  329. columnWidth: 0.9
  330. }, {
  331. xtype: 'checkbox',
  332. name: 'autoThrowMakeAfterAuditSale',
  333. padding: '0 0 0 50',
  334. margin: '5 0 0 0',
  335. boxLabel: '审核后自动投放工单',
  336. bind: '{autoThrowMakeAfterAuditSale}',
  337. columnWidth: 0.9
  338. },{
  339. xtype: 'radiogroup',
  340. margin:'0 0 10 15',
  341. name:'saleThrowMakeStatus',
  342. labelWidth:150,
  343. fieldLabel: '自动投放工单状态',
  344. simpleValue:true,
  345. defaultType: 'container',
  346. bind:'{saleThrowMakeStatus}',
  347. items: [
  348. {xtype: 'radiofield',boxLabel: '未审核', inputValue: 'UNAUDITED'},
  349. {xtype: 'radiofield',boxLabel: '已审核', inputValue: 'AUDITED'}
  350. ] ,
  351. columnWidth: 0.3
  352. },{
  353. xtype: 'displayfield',
  354. value: '<div style="color:#A9A9A9;">*启用则销售订单审核后自动按照需求数量生成工单</div>',
  355. columnWidth: 0.9
  356. }, {
  357. xtype: 'component',
  358. html: '<span style="color:#505363;">若需要控制备货单、销售订单工单时产品资料必须有填写每日产能,请勾选此项:</span>',
  359. columnWidth: 0.9
  360. }, {
  361. xtype: 'checkbox',
  362. name: 'needDailyCapacity',
  363. padding: '0 0 0 50',
  364. margin: '5 0 0 0',
  365. boxLabel: '产品资料未填写每日产能不允许转工单',
  366. bind: '{needDailyCapacity}',
  367. columnWidth: 0.9
  368. },{
  369. xtype: 'displayfield',
  370. value: '<div style="color:#A9A9A9;">*启用则备货单、销售订单转工单时会判断产品资料有无填写每日产能,未填写不允许转工单</div>',
  371. columnWidth: 0.9
  372. }, {
  373. xtype: 'component',
  374. html: '<span style="color:#505363;">若需要制造工单退完备损才允许结案,请勾选此项:</span>',
  375. columnWidth: 0.9
  376. }, {
  377. xtype: 'checkbox',
  378. name: 'makeEndNeedBackLoss',
  379. padding: '0 0 0 50',
  380. margin: '5 0 0 0',
  381. boxLabel: '制造工单结案需要退备损数',
  382. bind: '{makeEndNeedBackLoss}',
  383. columnWidth: 0.9
  384. },{
  385. xtype: 'displayfield',
  386. value: '<div style="color:#A9A9A9;">*启用则制造工单结案时会判断备损有无退回或报废(备损数=需求数-工单数*单位用量)</div>',
  387. columnWidth: 0.9
  388. }, {
  389. xtype: 'component',
  390. html: '<span style="color:#505363;">若需要外协工单退完备损才允许结案,请勾选此项: </span>',
  391. columnWidth: 0.9
  392. }, {
  393. xtype: 'checkbox',
  394. name: 'osMakeEndNeedBackLoss',
  395. padding: '0 0 0 50',
  396. margin: '5 0 0 0',
  397. boxLabel: '外协工单结案需要退备损数',
  398. bind: '{osMakeEndNeedBackLoss}',
  399. columnWidth: 0.9
  400. },{
  401. xtype: 'displayfield',
  402. value: '<div style="color:#A9A9A9;">*启用则外协工单结案时会判断备损有无退回或报废(备损数=需求数-工单数*单位用量)</div>',
  403. columnWidth: 0.9
  404. },],
  405. initComponent: function () {
  406. var me = this,
  407. viewModel = me.getViewModel(),
  408. mainViewModel = Ext.getCmp('mainView').getViewModel(),
  409. forceGetPrice = mainViewModel.get('ForceGetPrice'),
  410. validDateByPrice = mainViewModel.get('ValidDateByPrice'),
  411. InquiryEffectiveDays = mainViewModel.get('InquiryEffectiveDays'),
  412. ENABLEMRP = mainViewModel.get('ENABLEMRP'), //系统自动运算智能采购并投放采购单
  413. mergePurc = mainViewModel.get('mergePurc'), //采购合并设置
  414. mergeDays = mainViewModel.get('mergeDays'), //合并天数
  415. safetystock = mainViewModel.get('safetystock'), //安全库存纳入需求
  416. fixedLeadTime = mainViewModel.get('FixedLeadTime'), //固定提前期
  417. mpq = mainViewModel.get('mpq'), //最小包采购
  418. getPriceAndVendor = mainViewModel.get('getPriceAndVendor');//请购单取价优先选项
  419. if (forceGetPrice) {
  420. viewModel.set('ForceGetPriceValue', forceGetPrice);
  421. }
  422. if (validDateByPrice) {
  423. viewModel.set('ValidDateByPriceValue', validDateByPrice);
  424. }
  425. if (InquiryEffectiveDays) {
  426. viewModel.set('InquiryEffectiveDays', InquiryEffectiveDays);
  427. }
  428. if(ENABLEMRP){
  429. viewModel.set('ENABLEMRPValue', ENABLEMRP);
  430. }
  431. if(mergePurc){
  432. viewModel.set('mergePurcValue', mergePurc);
  433. }
  434. if(mergeDays){
  435. viewModel.set('mergeDaysValue', mergeDays);
  436. }
  437. if(safetystock){
  438. viewModel.set('safetystockValue', safetystock);
  439. }
  440. if(mpq){
  441. viewModel.set('mpqValue', mpq);
  442. }
  443. if(getPriceAndVendor){
  444. viewModel.set('getPriceAndVendorValue', getPriceAndVendor);
  445. }
  446. if(fixedLeadTime){
  447. viewModel.set('FixedLeadTime', fixedLeadTime);
  448. }
  449. me.callParent(arguments);
  450. }
  451. });