|
|
@@ -15,12 +15,25 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
ptype: 'menuclipboard'
|
|
|
},{
|
|
|
ptype: 'rowwidget',
|
|
|
+ setupRowData: function(record, rowIndex, rowValues) {
|
|
|
+ var me = this.rowExpander;
|
|
|
+ me.rowBodyFeature = this;
|
|
|
+ rowValues.rowBodyCls = me.recordsExpanded[record.internalId] ? '' : me.rowBodyHiddenCls;
|
|
|
+ if(record.get('qutations')==null){
|
|
|
+ this.rowExpander.expanderColumn.setWidth(0)
|
|
|
+ }else{
|
|
|
+ this.rowExpander.expanderColumn.setWidth(40)
|
|
|
+ }
|
|
|
+ },
|
|
|
widget: {
|
|
|
frame:true,
|
|
|
+ cls:'x-quotation-detail',
|
|
|
xtype: 'grid',
|
|
|
+ plugins: [{
|
|
|
+ ptype: 'menuclipboard'
|
|
|
+ }],
|
|
|
bind: {
|
|
|
- store: '{record.quotationRspDTOList}',
|
|
|
- //title: 'Orders for {record.name}'
|
|
|
+ store: '{record.qutations}'
|
|
|
},
|
|
|
columns: [{
|
|
|
text: '供应商名称',
|
|
|
@@ -44,10 +57,59 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
dataIndex: 'taxRate'
|
|
|
}, {
|
|
|
width: 120,
|
|
|
- text: '分段信息',
|
|
|
- dataIndex: 'replies'
|
|
|
+ text: '梯度/价格',
|
|
|
+ dataIndex: 'replies',
|
|
|
+ renderer:function(val, meta, record,x,y,store, view){
|
|
|
+ if(val==null||val==''){
|
|
|
+ return '<div style="text-align: center;color:#34baf6;">暂无</div>';
|
|
|
+ }
|
|
|
+ var id = record.id;
|
|
|
+ var renderName=this.columns[y].dataIndex;
|
|
|
+ var grid = view.ownerCt;
|
|
|
+ var columnId;
|
|
|
+ Ext.Array.each(grid.columns, function(c, index){
|
|
|
+ if(c.dataIndex=='replies'){
|
|
|
+ columnId = c.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(!view.tip || view.tip.createFrom != renderName) {
|
|
|
+ view.tip = Ext.create('Ext.tip.ToolTip', {
|
|
|
+ target: view.el,
|
|
|
+ delegate: '.x-grid-cell-'+columnId,
|
|
|
+ trackMouse: true,
|
|
|
+ createFrom:renderName,
|
|
|
+ renderTo: Ext.getBody(),
|
|
|
+ maxWidth :830,
|
|
|
+ layout:'anchor',
|
|
|
+ listeners: {
|
|
|
+ beforeshow: function updateTipBody(tip) {
|
|
|
+ var dg = Ext.getCmp('grid-'+id);
|
|
|
+ dg.store.loadData(val);
|
|
|
+ dg.show();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ items : [Ext.create('Ext.grid.Panel', {
|
|
|
+ id: 'grid-'+id,
|
|
|
+ frame:true,
|
|
|
+ anchor: '100% 100%',
|
|
|
+ width:205,
|
|
|
+ store:[],
|
|
|
+ columns: [{
|
|
|
+ text: '分段数量',
|
|
|
+ dataIndex: 'lapQty',
|
|
|
+ width: 110
|
|
|
+ }, {
|
|
|
+ text: '分段价格',
|
|
|
+ dataIndex: 'price',
|
|
|
+ width: 90
|
|
|
+ }]
|
|
|
+ })]
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return '<div style="text-align: center;color:#34baf6;">查看报价信息</div>';
|
|
|
+ }
|
|
|
}, {
|
|
|
- width: 120,
|
|
|
+ width: 200,
|
|
|
text: '操作',
|
|
|
dataIndex: 'agreed'
|
|
|
}]
|
|
|
@@ -55,36 +117,97 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
}],
|
|
|
|
|
|
tbar: [{
|
|
|
- width: 310,
|
|
|
- name: 'search',
|
|
|
- xtype: 'textfield',
|
|
|
- emptyText : '请输入物料编号/品牌/名称/型号',
|
|
|
- enableKeyEvents: true,
|
|
|
- getCondition: function (value) {
|
|
|
- return ' (pr_code like\'%' + value + '%\' or pr_detail like \'%' + value + '%\' or pr_brand like \'%' + value + '%\' or pr_orispeccode like \'%' + value + '%\') ';
|
|
|
- },
|
|
|
- listeners: {
|
|
|
- keydown: {
|
|
|
- fn: function(th, e, eOpts) {
|
|
|
- if(e.keyCode == 13) {
|
|
|
- var grid = th.up('grid');
|
|
|
- grid.condition = grid.getConditions();
|
|
|
- grid.store.loadPage(1);
|
|
|
+ bodyStyle:'padding:0px 10px 0 0',
|
|
|
+ xtype:'panel',
|
|
|
+ layout:'column',
|
|
|
+ height:75,
|
|
|
+ width:'100%',
|
|
|
+ rbar:{style:'padding:0',items:[{
|
|
|
+ xtype:'button',
|
|
|
+ cls:'x-formpanel-btn-blue',
|
|
|
+ text:'查询',
|
|
|
+ listeners: {
|
|
|
+ click:function(b){
|
|
|
+ var grid = b.ownerCt.ownerCt;
|
|
|
+ grid.condition = grid.getConditions();
|
|
|
+ grid.store.loadPage(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ style:'text-align: center',
|
|
|
+ xtype:'displayfield',
|
|
|
+ value:'立即询价'
|
|
|
+ }]},
|
|
|
+ items:[{
|
|
|
+ columnWidth:0.33,
|
|
|
+ name: 'search',
|
|
|
+ xtype: 'textfield',
|
|
|
+ emptyText : '请输入供应商名称/物料编号/品牌/名称/型号',
|
|
|
+ enableKeyEvents: true,
|
|
|
+ getCondition: function (value) {
|
|
|
+ return value;
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ keydown: {
|
|
|
+ fn: function(th, e, eOpts) {
|
|
|
+ if(e.keyCode == 13) {
|
|
|
+ var grid = th.up('grid');
|
|
|
+ grid.condition = grid.getConditions();
|
|
|
+ grid.store.loadPage(1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- },{
|
|
|
- cls:'x-formpanel-btn-blue',
|
|
|
- xtype:'button',
|
|
|
- text:'查询',
|
|
|
- listeners: {
|
|
|
- click:function(b){
|
|
|
- var grid = b.ownerCt.ownerCt;
|
|
|
- grid.condition = grid.getConditions();
|
|
|
- grid.store.loadPage(1);
|
|
|
+ },{
|
|
|
+ columnWidth:0.33,
|
|
|
+ xtype: 'combobox',
|
|
|
+ name: 'quoted',
|
|
|
+ fieldLabel: '报价状态',
|
|
|
+ allowBlank: true,
|
|
|
+ value:1,
|
|
|
+ editable: false,
|
|
|
+ queryMode: 'local',
|
|
|
+ displayField: 'pi_status',
|
|
|
+ valueField: 'pi_statuscode',
|
|
|
+ store: Ext.create('Ext.data.ArrayStore', {
|
|
|
+ fields: ['pi_statuscode', 'pi_status'],
|
|
|
+ data: [
|
|
|
+ [1, "已报价"],
|
|
|
+ [0, "未报价"]
|
|
|
+ ]
|
|
|
+ }),
|
|
|
+ getCondition: function (value) {
|
|
|
+ return null
|
|
|
}
|
|
|
- }
|
|
|
+ },{
|
|
|
+ columnWidth:0.33,
|
|
|
+ xtype: 'combobox',
|
|
|
+ name: 'overdue',
|
|
|
+ fieldLabel: '截止状态',
|
|
|
+ allowBlank: true,
|
|
|
+ value:0,
|
|
|
+ editable: false,
|
|
|
+ queryMode: 'local',
|
|
|
+ displayField: 'pi_status',
|
|
|
+ valueField: 'pi_statuscode',
|
|
|
+ store: Ext.create('Ext.data.ArrayStore', {
|
|
|
+ fields: ['pi_statuscode', 'pi_status'],
|
|
|
+ data: [
|
|
|
+ [1, "已截止"],
|
|
|
+ [0, "未截止"]
|
|
|
+ ]
|
|
|
+ }),
|
|
|
+ getCondition: function (value) {
|
|
|
+ return null
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ margin:'10px 0 0 0',
|
|
|
+ columnWidth:0.5,
|
|
|
+ xtype: 'condatefield',
|
|
|
+ name: '_date',
|
|
|
+ fieldLabel: '日期',
|
|
|
+ operation: 'between'
|
|
|
+ }]
|
|
|
}],
|
|
|
|
|
|
columns : [{
|
|
|
@@ -173,13 +296,29 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
if (Ext.isEmpty(condition)) {
|
|
|
condition = '';
|
|
|
}
|
|
|
+ var date = Ext.ComponentQuery.query('[name=_date]')[0];
|
|
|
+ var from = date.value.from || '';
|
|
|
+ if(!Ext.isDate(from)){
|
|
|
+ from = new Date(from);
|
|
|
+ from = from.getTime()
|
|
|
+ }else{
|
|
|
+ from = date.value.from.getTime()
|
|
|
+ }
|
|
|
+ var to = date.value.to || '';
|
|
|
+ if(!Ext.isDate(to)){
|
|
|
+ to = new Date(to);
|
|
|
+ to = to.getTime()
|
|
|
+ }else{
|
|
|
+ to = date.value.to.getTime()
|
|
|
+ }
|
|
|
+ var quoted = Ext.ComponentQuery.query('[name=quoted]')[0].value;
|
|
|
Ext.apply(store.proxy.extraParams, {
|
|
|
- keyword:condition,
|
|
|
+ keyword :condition==''?' ':condition[0].value,
|
|
|
pageNumber: op._page,
|
|
|
pageSize: store.pageSize,
|
|
|
- quoted:1,
|
|
|
- fromDate:null,
|
|
|
- endDate:null,
|
|
|
+ quoted:quoted,
|
|
|
+ fromDate:from,
|
|
|
+ endDate:to,
|
|
|
overdue:0
|
|
|
});
|
|
|
}
|
|
|
@@ -207,6 +346,9 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
var pageSize = Math.floor(gridBodyBoxHeight / 32);
|
|
|
|
|
|
store.setPageSize(pageSize);
|
|
|
+
|
|
|
+ grid.ownerCt.el.dom.style.left = '8px';
|
|
|
+ grid.el.dom.style.padding = '0px'
|
|
|
},
|
|
|
itemClick: function(view,record,a,index,c) {
|
|
|
}
|