Ext.define('saas.view.purchase.purchaseIn.QueryPanel', { extend: 'saas.view.core.query.QueryPanel', xtype: 'purchase-purchasein-querypanel', controller: 'purchase-purchasein-querypanel', viewModel: 'purchase-purchasein-querypanel', viewName: 'purchase-purchasein-querypanel', initComponent: function () { Ext.apply(this, { queryFormItems: [{ xtype: 'textfield', name: 'pi_inoutno', emptyText: '请输入单号或供应商名称', getCondition: function (value) { return ' (pi_inoutno like\'%' + value + '%\' or pi_vendcode like \'%' + value + '%\' or pi_vendname like \'%' + value + '%\') '; } }, { margin: '0 0 0 20', xtype: 'productDbfindTrigger', name: 'pr_detail', 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 + '\''; } } }, { xtype: 'multicombo', name: 'pi_prstatuscode', fieldLabel: '付款状态', emptyText: '全部', datas: [ ["PAYNONE", "未付款"], ["PAYPART", "部分付款"], ["PAYALL", "已付款"] ] }, { xtype: 'warehouseDbfindTrigger', name: 'pd_whname', fieldLabel: '仓库', emptyText: '请输入仓库编号或名称', showDetail: true }, { xtype: 'textfield', name: 'pi_pucode', fieldLabel: '关联采购单号', emptyText: '请输入采购单号', }, { xtype: 'accountDbfindTrigger', name: 'creatorName', fieldLabel: '录入人', emptyText: '请输入账户名称或姓名', getCondition: function (value) { if (!value) { return '1=1'; } else { return 'prodinout.creatorName like\'%' + value + '%\''; } } }, { xtype: 'accountDbfindTrigger', name: 'pi_auditman', fieldLabel: '审核人', emptyText: '请输入账户名称或姓名' }], queryGridConfig: { idField: 'id', codeField: 'pi_inoutno', addTitle: '采购验收单', addXtype: 'purchase-purchasein-formpanel', defaultCondition: ' pi_class = \'采购验收单\'', baseVastUrl: '/api/purchase/prodinout/', caller: 'PurchaseIn', baseColumn: [{ text: 'id', dataIndex: 'id', hidden: true, xtype: 'numbercolumn' }, { text: '验收单号', dataIndex: 'pi_inoutno', width: 150 }, { text: '单据类型', dataIndex: 'pi_class', hidden: true }, { text: '单据日期', dataIndex: 'pi_date', xtype: 'datecolumn', width: 110 }, { text: '供应商名称', dataIndex: 'pi_vendname', width: 200 }, { text: '金额(元)', xtype: 'numbercolumn', dataIndex: 'pi_nettotal', width: 110, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, true); } }, { text: '价税合计(元)', xtype: 'numbercolumn', dataIndex: 'pi_total', width: 110, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, true); } }, { text: '币别', dataIndex: 'pi_currency', align: 'center', width: 65 }, { text: '审核状态', align: 'center', dataIndex: 'pi_status', width: 80 }, { text: '付款状态', align: 'center', dataIndex: 'pi_prstatus', width: 80 }, { text: '关联采购单号', dataIndex: 'pi_pucode', width: 150 }, { text: 'B2B上传状态', dataIndex: 'b2bStatus', textAlign: 'center', width:120, hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'), initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'), renderer: function(v) { return v ? v : '待上传' } }, { text: '备注', dataIndex: 'pi_remark', width: 250 }], relativeColumn: [{ text: 'id', dataIndex: 'pu_id', xtype: 'numbercolumn', hidden: true }, { text: '验收单号', dataIndex: 'pi_inoutno', width: 150 }, { text: '单据日期', dataIndex: 'pi_date', xtype: 'datecolumn', width: 110 }, { text: '供应商名称', dataIndex: 'pi_vendname', width: 200 }, { text: '审核状态', align: 'center', dataIndex: 'pi_status', width: 80 }, { text: '物料编号', dataIndex: 'pr_code', width: 150 }, { text: '品牌', dataIndex: 'pr_brand', width: 100 }, { text: '物料名称', dataIndex: 'pr_detail', width: 150 }, { text: '型号', dataIndex: 'pr_orispeccode', width: 200 }, { text: '规格', dataIndex: 'pr_spec', width: 200 }, { text: '仓库', dataIndex: 'pd_whname', width: 120 }, { text: '数量', dataIndex: 'pd_inqty', xtype: 'numbercolumn', width: 110, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 3, false); } }, { text: '单位', dataIndex: 'pr_unit', width: 65 }, { text: '单价(元)', dataIndex: 'pd_netprice', xtype: 'numbercolumn', renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, true); }, width: 110 }, { text: '含税单价(元)', dataIndex: 'pd_orderprice', xtype: 'numbercolumn', renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, true); }, width: 110 }, { text: '金额(元)', dataIndex: 'pd_nettotal', xtype: 'numbercolumn', width: 110, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, }, { text: '税率(%)', dataIndex: 'pd_taxrate', xtype: 'numbercolumn', width: 80, renderer : function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 0, true); } }, { text: '税额(元)', dataIndex: 'pd_taxamount', xtype: 'numbercolumn', width: 110, renderer: function (v, g, r) { v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0); return saas.util.BaseUtil.numberFormat(v, 2, true); } }, { text: '价税合计(元)', dataIndex: 'pd_ordertotal', xtype: 'numbercolumn', width: 110, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, }, { text: '币别', dataIndex: 'pi_currency', align: 'center', width: 65 }, { text: "汇率", dataIndex: "pi_rate", xtype: 'numbercolumn', width: 80, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 6, false); } }, { text: '关联采购单号', dataIndex: 'pi_pucode', width: 150 },{ text: "对账状态", dataIndex: "apcheckStatus", width: 100.0 },{ text: 'B2B上传状态', dataIndex: 'b2bStatus', textAlign: 'center', width:120, hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'), initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'), renderer: function(v) { return v ? v : '待上传' } }, { text: '备注', dataIndex: 'pd_remark', width: 250 }] } }); this.callParent(arguments); }, });