Ext.define('saas.view.stock.otherOut.QueryPanel', { extend: 'saas.view.core.query.QueryPanel', xtype: 'stock-otherout-querypanel', controller: 'stock-otherout-querypanel', viewModel: 'stock-otherout-querypanel', viewName: 'stock-otherout-querypanel', queryFormItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'ID', allowBlank: true, columnWidth: 0 }, { xtype: 'textfield', name: 'pi_inoutno', emptyText:'请输入单号或客户', getCondition: function(value) { if(value == 'ALL') { return '1=1'; }else { return ' (pi_inoutno like\'%' + value + '%\' or pi_custcode like \'%'+value+'%\' or pi_custname like \'%'+value+'%\') '; } } }, { xtype: 'textfield', name: 'pd_prodcode', fieldLabel: '物料编号', hidden:true, showDetail: true }, { xtype: 'productDbfindTrigger', name: 'pr_detail', fieldLabel: '物料', emptyText:'输入物料编号或名称', showDetail: true }, { xtype: 'condatefield', name: 'pi_date', fieldLabel: '单据日期', columnWidth: 0.5, operation: 'between' }, { xtype: 'combobox', name: 'pi_statuscode', fieldLabel: '状态', allowBlank: true, emptyText :'全部', editable:false, queryMode: 'local', displayField: 'pi_status', valueField: 'pi_statuscode', store: Ext.create('Ext.data.ArrayStore', { fields: ['pi_statuscode', 'pi_status'], data: [ ["ALL", "全部"], ["AUDITED", "已审核"], ["UNAUDITED", "未审核"] ] }), getCondition: function(value) { if(value == 'ALL') { return '1=1'; }else { return 'pi_statuscode=\'' + value + '\''; } } }], queryGridConfig: { idField:'id', codeField:'pi_inoutno', addTitle:'其它出库单', addXtype:'stock-otherout-formpanel', defaultCondition:' pi_class = \'其它出库单\'', baseVastUrl:'/api/storage/prodinout/', baseColumn: [{ text: 'id', dataIndex: 'id', hidden:true, xtype: 'numbercolumn' }, { text: '其它出库单号', dataIndex: 'pi_inoutno', width: 150 },{ text: '单据类型', dataIndex: 'pi_class', width: 0 },{ text: '单据日期', dataIndex: 'pi_date', xtype:'datecolumn', width: 110 },{ text: '客户', dataIndex: 'pi_custname', width: 250 },{ text: '状态', dataIndex: 'pi_status', width: 90 },{ text: '录入人', dataIndex: 'creatorName', width: 110 },{ text: '审核人', dataIndex: 'pi_auditman', width: 110 },{ text: '备注', dataIndex: 'pi_remark', width: 250 }], relativeColumn: [ { text: 'id', dataIndex: 'pi_id', xtype: 'numbercolumn', hidden:true },{ text: '其它入库单号', dataIndex: 'pi_inoutno', width: 150 },{ text: '单据类型', dataIndex: 'pi_class', width: 0 },{ text: '单据日期', dataIndex: 'pi_date', xtype:'datecolumn', width: 110 },{ text: '供应商', dataIndex: 'pi_vendname', width: 250 },{ text: '状态', dataIndex: 'pi_status', width: 90 },{ text: '序号', dataIndex: 'pd_pdno', width: 80 },{ text: '相关单号', dataIndex: 'pd_ordercode', width: 150 },{ text: '物料编号', dataIndex: 'pd_prodcode', width: 150 },{ text: '物料名称', dataIndex: 'pr_detail', width: 200 },{ text: '物料规格', dataIndex: 'pr_spec', width: 150 },{ text: '单位', dataIndex: 'pr_unit', width: 80 },{ text: '数量', dataIndex: 'pd_inqty', xtype:'numbercolumn', width: 10 },{ text: '仓库', dataIndex: 'pd_whname', width: 150 },{ text: '单价', dataIndex: 'pd_orderprice', xtype:'numbercolumn', width: 110, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } },{ text: '税率', dataIndex: 'pd_taxrate', xtype:'numbercolumn', width: 80, renderer : function(v) { return Ext.util.Format.number(v, '0'); }, },{ text: '金额', dataIndex: 'pd_total', xtype:'numbercolumn', width: 110, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } },{ text: '备注', dataIndex: 'pd_remark', width:250 }] } });