123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- Ext.define('make.view.make.bomComposite.SearchForm', {
- extend: 'Ext.form.Panel',
- xtype: 'make-query-searchform',
- controller: 'make-query-searchform',
- name: 'bomcomposite1',
- width: '100%',
- minHeight: 100,
- bodyPadding: '10 10 0 10',
- margin: '0 0 12 0',
- layout: 'column',
- viewModel: {
- formulas: {
- //总在途
- onOrder: function (get) {
- var a = get('noComplete'),
- b = get('purchase'),
- i = Number(get('application'));
- return Number(a) + Number(b) + Number(i);
- },
- //总库存
- onHand: function (get) {
- var a = get('greattotal'),
- b = get('badtotal');
- return Number(a) + Number(b);
- },
- //总需求
- onNeed: function (get) {
- var a = get('noShipment'),
- b = get('noPicking'),
- c = get('safeInventory'),
- d = get('safeForecastUnClash');
- return Number(a) + Number(b) + Number(c) + Number(d);
- },
- //净需求
- realNeed: function (get) {
- var a = Number(get('noShipment')),
- b = Number(get('noPicking')),
- c = Number(get('safeInventory')),
- d = Number(get('greattotal')),
- e = Number(get('noComplete')),
- f = Number(get('purchase')),
- g = Number(get('safeForecastUnClash')),
- i = Number(get('application'));
- return a + b + c + g + i - d - e - f;
- }
- }
- },
- initComponent: function () {
- var me = this;
- Ext.apply(this, {
- items: [{
- xtype: "productDbfindTrigger",
- name: 'pr_code',
- allowBlank: false,
- emptyText: '请选择物料',
- width: 200,
- columnWidth: 0.25
- }, {
- xtype: 'displayfield',
- name: 'pr_detail',
- fieldLabel: '名称',
- labelWidth: 50,
- width: 200,
- columnWidth: 0.25,
- margin: '0 0 0 10'
- }, {
- xtype: 'displayfield',
- name: 'pr_orispeccode',
- fieldLabel: '型号',
- labelWidth: 50,
- width: 200,
- columnWidth: 0.25,
- margin: '0 0 0 10'
- }, {
- xtype: 'displayfield',
- name: 'pr_unit',
- fieldLabel: '单位',
- labelWidth: 50,
- width: 200,
- columnWidth: 0.25,
- margin: '0 0 0 10'
- }, {
- xtype: 'button',
- text: '查询',
- handler: 'onQuery'
- }, {
- xtype: 'form',
- columnWidth: 1,
- layout: 'column',
- margin: '0 0 10 0',
- bodyStyle: 'background:#f6f6f6; padding:10px;',
- defaults: {
- columnWidth: 0.25,
- layout: 'vbox',
- xtype: 'form',
- cls: 'bomcomposite-form',
- bodyStyle: 'background:#f7f7f7;',
- defaults: {
- xtype: 'displayfield',
- labelStyle: 'color:#505363;font-size: 13px;',
- thousandSeparator: ',',
- renderer: function (v) {
- if (!v) {
- v = 0;
- }
- return saas.util.BaseUtil.numberFormat(v, 6, true)
- }
- }
- },
- items: [{
- items: [{
- fieldLabel: '总需求量(+)',
- labelStyle: 'color:#505363;font-size: 13px; font-weight: bold;',
- bind: '{onNeed}',
- renderer: function (v) {
- if (!v) {
- v = 0;
- }
- return '<font><B>' + saas.util.BaseUtil.numberFormat(v, 6, true) + '</font>'
- }
- }, {
- name: 'noShipment',
- fieldLabel: '订单未发货',
- bind: '{noShipment}'
- }, {
- name: 'noPicking',
- fieldLabel: '工单未领料',
- bind: '{noPicking}'
- }, {
- name: 'safeInventory',
- fieldLabel: '安全库存',
- bind: '{safeInventory}'
- }, {
- name: 'safeForecastUnClash',
- fieldLabel: '备货未核销',
- bind: '{safeForecastUnClash}'
- }]
- }, {
- items: [{
- fieldLabel: '现有库存量(-)',
- labelStyle: 'color:#505363;font-size: 13px; font-weight: bold;',
- bind: '{greattotal}',
- renderer: function (v) {
- if (!v) {
- v = 0;
- }
- return '<font><B>' + saas.util.BaseUtil.numberFormat(v, 6, true) + '</font>'
- }
- }, {
- name: 'greattotal',
- fieldLabel: '良品库存',
- bind: '{greattotal}'
- }, {
- name: 'badtotal',
- fieldLabel: '不良品库存',
- bind: '{badtotal}'
- }, {
- name: 'total',
- fieldLabel: '总库存',
- bind: '{onHand}'
- }]
- }, {
- items: [{
- fieldLabel: '在途库存量(-)',
- labelStyle: 'color:#505363;font-size: 13px; font-weight: bold;',
- bind: '{onOrder}',
- renderer: function (v) {
- if (!v) {
- v = 0;
- }
- return '<font><B>' + saas.util.BaseUtil.numberFormat(v, 6, true) + '</font>'
- }
- }, {
- name: 'purchase',
- fieldLabel: '采购未交',
- bind: '{purchase}'
- }, {
- name: 'noComplete',
- fieldLabel: '工单未完工',
- bind: '{noComplete}'
- }, {
- name: 'application',
- fieldLabel: '请购未转',
- bind: '{application}'
- }]
- }, {
- items: [{
- fieldLabel: '净需求',
- labelWidth: 60,
- labelStyle: 'color:#505363;font-size: 13px; font-weight: bold;',
- thousandSeparator: ',',
- bind: '{realNeed}',
- renderer: function (v) {
- if (!v) {
- v = 0;
- }
- return '<font color="red"><B>' + saas.util.BaseUtil.numberFormat(v, 6, true) + '</font>'
- },
- }]
- }]
- }]
- });
- this.callParent(arguments);
- },
- });
|