Ext.define('make.view.sale.saleForecast.QueryPanel', { extend: 'saas.view.core.query.QueryPanel', xtype: 'sale-saleforecast-querypanel', controller: 'sale-saleforecast-querypanel', viewModel: { extend: 'saas.view.core.query.QueryPanelModel', data: { form: {}, // 查询字段记录 addEnable: false, // 显示新增按钮 auditEnable: true, // 显示审核按钮 printEnable: false, // 显示打印按钮 importEnable: true, // 显示导入按钮 exportEnable: true, // 显示导出按钮 closeEnable: true, // 显示关闭按钮 deleteEnable: true, // 显示删除按钮 deleteDisable:false, //删除按钮是否可使用 openAudit:false,//单独显示审核按钮 openUnAudit:false,//单独显示反审核按钮 openEnable:false, //显示开启 针对已取消列表 configurable: true, // 允许列设置 } }, viewName: 'sale-saleforecast-querypanel', caller: 'SaleForecast', importUploadPath: '/api/sale/saleforecast/saveToFormal', initComponent: function() { var me = this; console.log('querypanel'); Ext.apply(me, { queryFormItems: [ { xtype: 'condatefield', name: 'sf_date', fieldLabel: '订单时间', showDetail: true, columnWidth: 0.5 }, { xtype: 'multiqueryField', columnWidth: 0.4, name: 'multi_query', querys: { "Prod": {"field": "pr_code", "dbfinds": [{ from: 'pr_code', to: 'pr_code' },{ from: 'pr_detail', to: 'pr_detail' }]}, "Cust": {"field": "sd_custname", "dbfinds": [{ from: 'cu_name', to: 'sd_custname' }]}, "Emp":{"field": "sf_seller", "dbfinds": [{ from: 'em_name', to: 'sf_seller' }]}, "BillCode": {"field": "sf_code" ,"desc": "订单号"} } }], moreQueryFormItems: [{ xtype: 'condatefield', name: 'sf_date', fieldLabel: '单据日期', columnWidth: 1 }, { xtype: 'customerDbfindTrigger', name: 'sd_custname', fieldLabel: '客户名称' },{ xtype: 'productDbfindTrigger', name: 'saleforecastdetail.sd_prodcode', showDetail: true, fieldLabel: '物料编号' },{ xtype: 'textfield', name: 'pr_detail', fieldLabel: '产品名称', readOnly: true, }, { xtype: 'textfield', name: 'pr_orispeccode', fieldLabel: '产品型号', readOnly: true, renderer: saas.util.RenderUtil['renderer_prod'] }, { editable: false, xtype: "remotecombo", storeUrl: '/api/document/productbrand/getCombo', name: "pr_brand", fieldLabel: "厂家/品牌", showDetail: true, addHandler: function (b) { var form = this.ownerCmp.ownerCt; this.dialog = form.add({ xtype: 'document-productbrand-window', bind: { title: '新增物料厂家/品牌' }, dataKind: 'productbrand', _parent: form, _combo: this.ownerCmp, record: null, session: true }); this.dialog.show(); }, editHandler:function(btn,type){ saas.util.BaseUtil.openTab('document-productbrand-datalist', '物料厂家/品牌','maintab--document-productbrand-datalist'); var combo = btn.ownerCt.up('remotecombo'); if(combo){ combo.collapse(); } } },/*{ xtype: 'combobox', name: 'sf_currency', fieldLabel: '币别', queryMode: 'local', displayField: 'sf_currency', valueField: 'sf_currency', emptyText :'', editable:false, store: Ext.create('Ext.data.ArrayStore', { fields: ['sf_currency', 'sf_currency'], data: [ ["RMB", "RMB"], ["USD", "USD"], ["HKD", "HKD"] ] }), getCondition: function(value) { if(!value) { return '1=1'; }else { return 'sf_currency=\'' + value + '\''; } } },*/ { xtype: 'employeeDbfindTrigger', name: 'sf_seller', fieldLabel: '业务员', emptyText:'输入人员编号或名称', }/*, { xtype: 'multicombo', name: 'sa_sendstatuscode', fieldLabel: '业务状态', allowBlank: true, emptyText:'全部', datas: [ ["TURNOUT", "已出库"], ["UNTURNOUT", "未出库"], ["PARTOUT", "部分出库"], ["CLOSE", "已关闭"] ] }*/, { xtype: 'employeeDbfindTrigger', name: 'creatorName', fieldLabel: '录入人', emptyText:'请输入账户名称或姓名', getCondition: function(value) { if(!value) { return '1=1'; }else { return 'saleforecast.creatorName like\'%' + value + '%\''; } } },{ xtype: 'condatefield', name: 'saleforecast.createTime', fieldLabel: '录入日期', columnWidth: 1 }, { xtype: 'employeeDbfindTrigger', name: 'sf_auditman', fieldLabel: '审核人', emptyText:'请输入账户名称或姓名', }, { xtype: 'combobox', name: 'sf_statuscode', fieldLabel: '审核状态', queryMode: 'local', displayField: 'sf_status', valueField: 'sf_statuscode', emptyText :'全部', editable:false, store: Ext.create('Ext.data.ArrayStore', { fields: ['sf_statuscode', 'sf_status'], data: [ ["ALL", "全部"], ["AUDITED", "已审核"], ["UNAUDITED", "未审核"] ] }), getCondition: function(value) { if(value == 'ALL') { return '1=1'; }else { return 'sf_statuscode=\'' + value + '\''; } } }], queryGridConfig: { idField: 'sd_id', mainIdField:'sf_id', detailIdField:'sd_id', codeField: 'sf_code', addTitle: '备货单', addXtype: 'sale-saleforecast-formpanel', defaultCondition:me.defaultCondition, baseVastUrl: '/api/sale/saleforecast/', caller:'SaleForecast', baseColumn: [{ text: '明细id', dataIndex: 'sd_id', hidden:true, xtype: 'numbercolumn' },{ text: 'id', dataIndex: 'sf_id', hidden:true, xtype: 'numbercolumn' }, { text: '备货单号', dataIndex: 'sf_code', width: 150, }, { text: '单据日期', dataIndex: 'sf_date', xtype: 'datecolumn', width: 110 }, { text: '客户名称', dataIndex: 'sd_custname', width: 200 },{ text: '审核状态', dataIndex: 'sf_status', width: 80 },{ text: '序号', dataIndex: 'sd_detno', width: 60 },{ text: '物料名称', dataIndex: 'pr_detail', width: 200 },{ text: '型号', dataIndex: 'pr_orispeccode', width: 200 },{ text: '已核销数量', dataIndex: 'sd_yqty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, },{ text: '备货数', dataIndex: 'sd_qty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, summaryType: 'sum', summaryRenderer: function(v, d, f, m) { return saas.util.BaseUtil.numberFormat(v, 6, true); } },{ text: '已开工单数', dataIndex: 'sd_ymaqty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, },{ text: '订单冲减工单数', dataIndex: 'sd_maqty', xtype: 'numbercolumn', width: 140, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, }, { text: '交货日期', dataIndex: 'sd_delivery', xtype: 'datecolumn', width: 110 },{ text: '业务员', align: 'center', dataIndex: 'sf_seller', width: 80 },{ text: '物料编号', dataIndex: 'sd_prodcode', width: 200 },{ text: '厂家/品牌', dataIndex: 'pr_brand', width: 200 },{ text: '备注', dataIndex: 'sd_remark', width: 250 }], relativeColumn: [{ text: '明细id', dataIndex: 'sd_id', hidden:true, xtype: 'numbercolumn' },{ text: 'id', dataIndex: 'sf_id', hidden:true, xtype: 'numbercolumn' }, { text: '备货单号', dataIndex: 'sf_code', width: 150 }, { text: '单据日期', dataIndex: 'sf_date', xtype: 'datecolumn', width: 110 }, { text: '客户名称', dataIndex: 'sd_custname', width: 200 },{ text: '审核状态', dataIndex: 'sf_status', width: 80 },{ text: '序号', dataIndex: 'sd_detno', width: 60 },{ text: '物料名称', dataIndex: 'pr_detail', width: 200 },{ text: '型号', dataIndex: 'pr_orispeccode', width: 200, renderer: saas.util.RenderUtil['renderer_prod'] },{ text: '已核销数量', dataIndex: 'sd_yqty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, },{ text: '备货数', dataIndex: 'sd_qty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, },{ text: '已开工单数', dataIndex: 'sd_ymaqty', xtype: 'numbercolumn', width: 110, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, },{ text: '订单冲减工单数', dataIndex: 'sd_maqty', xtype: 'numbercolumn', width: 140, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, true); }, }, { text: '交货日期', dataIndex: 'sd_delivery', xtype: 'datecolumn', width: 110 },{ text: '业务员', align: 'center', dataIndex: 'sf_seller', width: 80 },{ text: '物料编号', dataIndex: 'sd_prodcode', width: 200 },{ text: '厂家/品牌', dataIndex: 'pr_brand', width: 200 },{ text: '备注', dataIndex: 'sd_remark', width: 250 }] } }); me.callParent(arguments); }, });