|
|
@@ -2,621 +2,370 @@
|
|
|
* 询价信息查询
|
|
|
*/
|
|
|
Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
|
|
|
- extend: 'Ext.grid.Panel',
|
|
|
+ extend: 'saas.view.core.base.BasePanel',
|
|
|
xtype: 'purchase-b2b-quotationList-datalist',
|
|
|
- controller: 'purchase-b2b-quotationList-datalist',
|
|
|
- viewModel: 'purchase-b2b-quotationList-datalist',
|
|
|
- autoScroll: true,
|
|
|
- style:'border:1px solid #fff',
|
|
|
- cls:'x-quotation-main',
|
|
|
- layout:'fit',
|
|
|
-
|
|
|
- dataUrl:'/api/purchase/purchase/inquiry/list',
|
|
|
- quotationListUrl:'/api/commons/number/delete/',
|
|
|
|
|
|
- plugins: [{
|
|
|
- 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'
|
|
|
+ viewName: 'purchase-b2b-quotationList-datalist',
|
|
|
+ dataUrl: '/api/purchase/purchase/inquiry/list',
|
|
|
+
|
|
|
+ initComponent: function () {
|
|
|
+ var me = this;
|
|
|
+ Ext.apply(this, {
|
|
|
+ searchField: [{
|
|
|
+ columnWidth:0.33,
|
|
|
+ name: 'search',
|
|
|
+ xtype: 'textfield',
|
|
|
+ emptyText : '请输入供应商名称/物料编号/品牌/名称/型号'
|
|
|
+ },{
|
|
|
+ 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, "未报价"]
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },{
|
|
|
+ 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, "未截止"]
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },{
|
|
|
+ columnWidth:0.5,
|
|
|
+ xtype: 'condatefield',
|
|
|
+ name: '_date',
|
|
|
+ fieldLabel: '日期',
|
|
|
+ operation: 'between'
|
|
|
}],
|
|
|
- bind: {
|
|
|
- store: '{record.qutations}'
|
|
|
- },
|
|
|
- columns: [{
|
|
|
- text: '供应商名称',
|
|
|
- dataIndex: 'vendName',
|
|
|
- width: 175
|
|
|
- }, {
|
|
|
- text: '联系电话',
|
|
|
- dataIndex: 'tel',
|
|
|
- width: 265
|
|
|
- }, {
|
|
|
- text: '替代型号',
|
|
|
- dataIndex: 'replaceOrispeccode',
|
|
|
- width: 100,
|
|
|
- }, {
|
|
|
- width: 120,
|
|
|
- text: '交期',
|
|
|
- dataIndex: 'leadTime'
|
|
|
- }, {
|
|
|
- width: 120,
|
|
|
- text: '税率',
|
|
|
- dataIndex: 'taxRate'
|
|
|
- }, {
|
|
|
- width: 120,
|
|
|
- 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
|
|
|
+
|
|
|
+ toolButtons: [{
|
|
|
+ ignore: true,
|
|
|
+ style:'text-align: center;',
|
|
|
+ xtype:'displayfield',
|
|
|
+ value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'purchase-b2b-sendquotation-datalist\',\'发起询价\',\'maintab-query-sendQuotation\')\">立即询价</a>'
|
|
|
+ }],
|
|
|
+
|
|
|
+ gridConfig: {
|
|
|
+ dataUrl: me.dataUrl,
|
|
|
+ actionColumn: [],
|
|
|
+ selModel: {
|
|
|
+ type: 'cellmodel'
|
|
|
+ },
|
|
|
+ extraPlugins: [{
|
|
|
+ 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)
|
|
|
}
|
|
|
- });
|
|
|
- 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);
|
|
|
- var rowindex = tip.triggerElement.parentNode.rowIndex;
|
|
|
- var rec = Ext.getCmp(grid.id).getStore().getAt(rowindex);
|
|
|
- dg.store.loadData(rec.get('replies'));
|
|
|
- dg.show();
|
|
|
+ },
|
|
|
+ widget: {
|
|
|
+ frame:true,
|
|
|
+ cls:'x-quotation-detail',
|
|
|
+ xtype: 'grid',
|
|
|
+ plugins: [{
|
|
|
+ ptype: 'menuclipboard'
|
|
|
+ }],
|
|
|
+ bind: {
|
|
|
+ store: '{record.qutations}'
|
|
|
+ },
|
|
|
+ columns: [{
|
|
|
+ text: '供应商名称',
|
|
|
+ dataIndex: 'vendName',
|
|
|
+ width: 175
|
|
|
+ }, {
|
|
|
+ text: '联系电话',
|
|
|
+ dataIndex: 'tel',
|
|
|
+ width: 265
|
|
|
+ }, {
|
|
|
+ text: '替代型号',
|
|
|
+ dataIndex: 'replaceOrispeccode',
|
|
|
+ width: 100,
|
|
|
+ }, {
|
|
|
+ width: 120,
|
|
|
+ text: '交期',
|
|
|
+ dataIndex: 'leadTime'
|
|
|
+ }, {
|
|
|
+ width: 120,
|
|
|
+ text: '税率',
|
|
|
+ dataIndex: 'taxRate'
|
|
|
+ }, {
|
|
|
+ width: 120,
|
|
|
+ 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>';
|
|
|
}
|
|
|
- },
|
|
|
- items : [Ext.create('Ext.grid.Panel', {
|
|
|
- id: 'grid-'+id,
|
|
|
- frame:true,
|
|
|
- anchor: '100% 100%',
|
|
|
- width:205,
|
|
|
- store:[],
|
|
|
- columns: [{
|
|
|
- text: '分段数量',
|
|
|
- dataIndex: 'lapQty',
|
|
|
- width: 110,
|
|
|
- renderer:function(v,m,rec){
|
|
|
- return '≥' +v
|
|
|
+ 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
|
|
|
}
|
|
|
- }, {
|
|
|
- text: '分段价格',
|
|
|
- dataIndex: 'price',
|
|
|
- width: 90
|
|
|
- }]
|
|
|
- })]
|
|
|
- });
|
|
|
- }
|
|
|
- return '<div style="text-align: center;color:#34baf6;">查看报价信息</div>';
|
|
|
- }
|
|
|
- }, {
|
|
|
- width: 200,
|
|
|
- text: '操作',
|
|
|
- dataIndex: 'agreed',
|
|
|
- renderer:function(val, meta, record,x,y,store, view){
|
|
|
- var id = record.get('id');
|
|
|
- window.sendMessage = function(id,status,refusereason){
|
|
|
- var params = {
|
|
|
- id:id,
|
|
|
- status:status,
|
|
|
- refusereason:refusereason
|
|
|
- };
|
|
|
- Ext.Ajax.request({
|
|
|
- url : '/api/purchase/purchase/inquiry/deal',
|
|
|
- timeout: 8000,
|
|
|
- headers:{
|
|
|
- 'Access-Control-Allow-Origin': '*',
|
|
|
- 'Authorization': saas.util.State.get('session').token,
|
|
|
- "Content-Type": 'application/json;charset=UTF-8'
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- params:JSON.stringify(params),
|
|
|
- success: function(response, o){
|
|
|
- var res = Ext.decode(response.responseText);
|
|
|
- if(res.success){
|
|
|
- Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].store.loadPage(1);
|
|
|
- saas.util.BaseUtil.showSuccessToast('操作成功');
|
|
|
- }else{
|
|
|
- saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
|
|
|
+ });
|
|
|
+ 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);
|
|
|
+ var rowindex = tip.triggerElement.parentNode.rowIndex;
|
|
|
+ var rec = Ext.getCmp(grid.id).getStore().getAt(rowindex);
|
|
|
+ dg.store.loadData(rec.get('replies'));
|
|
|
+ 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,
|
|
|
+ renderer:function(v,m,rec){
|
|
|
+ return '≥' +v
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '分段价格',
|
|
|
+ dataIndex: 'price',
|
|
|
+ width: 90
|
|
|
+ }]
|
|
|
+ })]
|
|
|
+ });
|
|
|
}
|
|
|
- },
|
|
|
- failure: function (response, opts) {
|
|
|
- saas.util.BaseUtil.showErrorToast('操作失败,请重试');
|
|
|
+ return '<div style="text-align: center;color:#34baf6;">查看报价信息</div>';
|
|
|
}
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- window.checkPrice = function(status,id){
|
|
|
- if(status=='0'){
|
|
|
- var panel = view.ownerCt.ownerCmp.ownerCt;
|
|
|
- var win = Ext.create('Ext.window.Window', {
|
|
|
- renderTo: panel.getEl(),
|
|
|
- cls:'x-window-dbfind',
|
|
|
- height: 100,
|
|
|
- width: 450,
|
|
|
- modal:true,
|
|
|
- title: '提示',
|
|
|
- bodyPadding: 10,
|
|
|
- constrain: true,
|
|
|
- closable: true,
|
|
|
- layout: {
|
|
|
- type: 'vbox',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- items:[{
|
|
|
- xtype:'panel',
|
|
|
- layout:'hbox',
|
|
|
- items:[{
|
|
|
- margin:'0 10 0 0',
|
|
|
- labelWidth:60,
|
|
|
- xtype : "textfield",
|
|
|
- name : "refusereason",
|
|
|
- fieldLabel : "拒绝信息"
|
|
|
- },{
|
|
|
- margin:'0 0 0 5',
|
|
|
- xtype:'button',
|
|
|
- text:'确认',
|
|
|
- handler:function(b){
|
|
|
- var refusereason = b.ownerCt.down('[name=refusereason]').value;
|
|
|
- window.sendMessage(id,status,refusereason);
|
|
|
- b.ownerCt.ownerCt.close();
|
|
|
+ }, {
|
|
|
+ width: 200,
|
|
|
+ text: '操作',
|
|
|
+ dataIndex: 'agreed',
|
|
|
+ renderer:function(val, meta, record,x,y,store, view){
|
|
|
+ var id = record.get('id');
|
|
|
+ window.sendMessage = function(id,status,refusereason){
|
|
|
+ var params = {
|
|
|
+ id:id,
|
|
|
+ status:status,
|
|
|
+ refusereason:refusereason
|
|
|
+ };
|
|
|
+ Ext.Ajax.request({
|
|
|
+ url : '/api/purchase/purchase/inquiry/deal',
|
|
|
+ timeout: 8000,
|
|
|
+ headers:{
|
|
|
+ 'Access-Control-Allow-Origin': '*',
|
|
|
+ 'Authorization': saas.util.State.get('session').token,
|
|
|
+ "Content-Type": 'application/json;charset=UTF-8'
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ params:JSON.stringify(params),
|
|
|
+ success: function(response, o){
|
|
|
+ var res = Ext.decode(response.responseText);
|
|
|
+ if(res.success){
|
|
|
+ Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].store.loadPage(1);
|
|
|
+ saas.util.BaseUtil.showSuccessToast('操作成功');
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ failure: function (response, opts) {
|
|
|
+ saas.util.BaseUtil.showErrorToast('操作失败,请重试');
|
|
|
}
|
|
|
- }]
|
|
|
- }]
|
|
|
- });
|
|
|
- win.show();
|
|
|
- }else if(status=='1'){
|
|
|
- window.sendMessage(id,status,'');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- window.showRefuse = function(msg){
|
|
|
- var panel = view.ownerCt.ownerCmp.ownerCt;
|
|
|
- var win = Ext.create('Ext.window.Window', {
|
|
|
- renderTo: panel.getEl(),
|
|
|
- cls:'x-window-dbfind',
|
|
|
- height: 100,
|
|
|
- width: 450,
|
|
|
- modal:true,
|
|
|
- title: '查看',
|
|
|
- bodyPadding: 10,
|
|
|
- constrain: true,
|
|
|
- closable: true,
|
|
|
- layout: {
|
|
|
- type: 'vbox',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- items:[{
|
|
|
- xtype:'panel',
|
|
|
- layout:'hbox',
|
|
|
- items:[{
|
|
|
- margin:'0 10 0 0',
|
|
|
- labelWidth:60,
|
|
|
- xtype : "displayfield",
|
|
|
- name : "refusereason",
|
|
|
- fieldLabel : "拒绝信息",
|
|
|
- value:msg
|
|
|
- }]
|
|
|
- }]
|
|
|
- });
|
|
|
- win.show();
|
|
|
- }
|
|
|
- if((!val||val=='')&&val!=0){
|
|
|
- //未采纳状态
|
|
|
- return '<div style="width:100%;vertical-align: middle; text-align: center;">'+
|
|
|
- "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;' onClick='window.checkPrice(1,"+id+")'>"+
|
|
|
- "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;' onClick='window.checkPrice(0,"+id+")'>"+
|
|
|
- '</div>';
|
|
|
- }else if(val==1||val=='1'){
|
|
|
- return '<div style="color:#34baf6;width:100%;vertical-align: middle; text-align: center;">已采纳</div>'
|
|
|
- }else if(val==0||val=='0'){
|
|
|
- var refusereason = record.get('refusereason');
|
|
|
- if(!refusereason||refusereason==''){
|
|
|
- return '<div style="color:#ff6c00;width:100%;vertical-align: middle; text-align: center;">已拒绝</div>'
|
|
|
- }else{
|
|
|
- return '<div style="width:100%;vertical-align: middle; text-align: center;">'+
|
|
|
- "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;' onClick='window.showRefuse("+refusereason+")'></input>"+
|
|
|
- '</div>';
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }]
|
|
|
- }
|
|
|
- }],
|
|
|
-
|
|
|
- tbar: [{
|
|
|
- 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.ownerCt.ownerCt;
|
|
|
- grid.condition = grid.getConditions();
|
|
|
- grid.store.loadPage(1);
|
|
|
- }
|
|
|
- }
|
|
|
- },{
|
|
|
- style:'text-align: center;',
|
|
|
- xtype:'displayfield',
|
|
|
- value:'<a href=\"javascript:saas.util.BaseUtil.openTab(\'purchase-sendQuotation-datalist\',\'发起询价\',\'maintab-query-sendQuotation\')\">立即询价</a>'
|
|
|
- }]},
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },{
|
|
|
- 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 : [{
|
|
|
- text : 'id',
|
|
|
- width : 0,
|
|
|
- dataIndex : 'id',
|
|
|
- xtype : 'numbercolumn',
|
|
|
- hidden:true
|
|
|
- },{
|
|
|
- text : '物料编号',
|
|
|
- width : 200.0,
|
|
|
- dataIndex : 'prodCode',
|
|
|
- xtype : '',
|
|
|
- },
|
|
|
- {
|
|
|
- text : '品牌',
|
|
|
- dataIndex : 'prodBrand',
|
|
|
- width : 110.0,
|
|
|
- xtype : '',
|
|
|
- },
|
|
|
- {
|
|
|
- text : '名称',
|
|
|
- dataIndex : 'prodName',
|
|
|
- width : 150.0
|
|
|
- },{
|
|
|
- text : '型号',
|
|
|
- dataIndex : 'prodOrispeccode',
|
|
|
- width : 110.0
|
|
|
- },{
|
|
|
- text : '规格',
|
|
|
- dataIndex : 'prodSpec',
|
|
|
- width : 110.0
|
|
|
- },{
|
|
|
- text : '单位',
|
|
|
- dataIndex : 'prodUnit',
|
|
|
- width : 110.0
|
|
|
- },{
|
|
|
- text : '发起时间',
|
|
|
- dataIndex : 'startDate',
|
|
|
- width : 160.0
|
|
|
- },{
|
|
|
- text : '截止日期',
|
|
|
- dataIndex : 'endDate',
|
|
|
- width : 160.0
|
|
|
- },{
|
|
|
- text : '报价状态',
|
|
|
- dataIndex : 'qutations',
|
|
|
- width : 110.0,
|
|
|
- renderer:function(val, meta, record,x,y,store, view){
|
|
|
- if(!val||val==0||val.length==0){
|
|
|
- return '否'
|
|
|
- }else{
|
|
|
- return '是'
|
|
|
- }
|
|
|
- }
|
|
|
- }, {
|
|
|
- dataIndex: '',
|
|
|
- flex: 1
|
|
|
- }],
|
|
|
-
|
|
|
-
|
|
|
- dbSearchFields: [],
|
|
|
- condition:'',
|
|
|
-
|
|
|
- initComponent: function() {
|
|
|
- var me = this;
|
|
|
- if(me.columns){
|
|
|
- var fields = me.columns.map(column => column.dataIndex);
|
|
|
- me.store = Ext.create('Ext.data.Store',{
|
|
|
- fields:fields,
|
|
|
- autoLoad: true,
|
|
|
- pageSize: 15,
|
|
|
- proxy: {
|
|
|
- timeout:8000,
|
|
|
- type: 'ajax',
|
|
|
- headers:{
|
|
|
- 'Access-Control-Allow-Origin': '*',
|
|
|
- "Content-Type": 'application/json;charset=UTF-8'
|
|
|
- },
|
|
|
- url: me.dataUrl,
|
|
|
- actionMethods: {
|
|
|
- read: 'GET'
|
|
|
- },
|
|
|
- reader: {
|
|
|
- type: 'json',
|
|
|
- rootProperty: 'data.content',
|
|
|
- totalProperty: 'data.totalElements',
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ window.checkPrice = function(status,id){
|
|
|
+ if(status=='0'){
|
|
|
+ var panel = view.ownerCt.ownerCmp.ownerCt;
|
|
|
+ var win = Ext.create('Ext.window.Window', {
|
|
|
+ renderTo: panel.getEl(),
|
|
|
+ cls:'x-window-dbfind',
|
|
|
+ height: 100,
|
|
|
+ width: 450,
|
|
|
+ modal:true,
|
|
|
+ title: '提示',
|
|
|
+ bodyPadding: 10,
|
|
|
+ constrain: true,
|
|
|
+ closable: true,
|
|
|
+ layout: {
|
|
|
+ type: 'vbox',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ items:[{
|
|
|
+ xtype:'panel',
|
|
|
+ layout:'hbox',
|
|
|
+ items:[{
|
|
|
+ margin:'0 10 0 0',
|
|
|
+ labelWidth:60,
|
|
|
+ xtype : "textfield",
|
|
|
+ name : "refusereason",
|
|
|
+ fieldLabel : "拒绝信息"
|
|
|
+ },{
|
|
|
+ margin:'0 0 0 5',
|
|
|
+ xtype:'button',
|
|
|
+ text:'确认',
|
|
|
+ handler:function(b){
|
|
|
+ var refusereason = b.ownerCt.down('[name=refusereason]').value;
|
|
|
+ window.sendMessage(id,status,refusereason);
|
|
|
+ b.ownerCt.ownerCt.close();
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ win.show();
|
|
|
+ }else if(status=='1'){
|
|
|
+ window.sendMessage(id,status,'');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.showRefuse = function(msg){
|
|
|
+ var panel = view.ownerCt.ownerCmp.ownerCt;
|
|
|
+ var win = Ext.create('Ext.window.Window', {
|
|
|
+ renderTo: panel.getEl(),
|
|
|
+ cls:'x-window-dbfind',
|
|
|
+ height: 100,
|
|
|
+ width: 450,
|
|
|
+ modal:true,
|
|
|
+ title: '查看',
|
|
|
+ bodyPadding: 10,
|
|
|
+ constrain: true,
|
|
|
+ closable: true,
|
|
|
+ layout: {
|
|
|
+ type: 'vbox',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ items:[{
|
|
|
+ xtype:'panel',
|
|
|
+ layout:'hbox',
|
|
|
+ items:[{
|
|
|
+ margin:'0 10 0 0',
|
|
|
+ labelWidth:60,
|
|
|
+ xtype : "displayfield",
|
|
|
+ name : "refusereason",
|
|
|
+ fieldLabel : "拒绝信息",
|
|
|
+ value:msg
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ win.show();
|
|
|
+ }
|
|
|
+ if((!val||val=='')&&val!=0){
|
|
|
+ //未采纳状态
|
|
|
+ return '<div style="width:100%;vertical-align: middle; text-align: center;">'+
|
|
|
+ "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;' onClick='window.checkPrice(1,"+id+")'>"+
|
|
|
+ "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;' onClick='window.checkPrice(0,"+id+")'>"+
|
|
|
+ '</div>';
|
|
|
+ }else if(val==1||val=='1'){
|
|
|
+ return '<div style="color:#34baf6;width:100%;vertical-align: middle; text-align: center;">已采纳</div>'
|
|
|
+ }else if(val==0||val=='0'){
|
|
|
+ var refusereason = record.get('refusereason');
|
|
|
+ if(!refusereason||refusereason==''){
|
|
|
+ return '<div style="color:#ff6c00;width:100%;vertical-align: middle; text-align: center;">已拒绝</div>'
|
|
|
+ }else{
|
|
|
+ return '<div style="width:100%;vertical-align: middle; text-align: center;">'+
|
|
|
+ "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;' onClick='window.showRefuse("+refusereason+")'></input>"+
|
|
|
+ '</div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
}
|
|
|
- },
|
|
|
- listeners: {
|
|
|
- beforeload: function (store, op) {
|
|
|
- var date = Ext.ComponentQuery.query('[name=_date]')[0];
|
|
|
- var from = date.value.from || '';
|
|
|
- if(!Ext.isDate(from)){
|
|
|
- from = new Date(from);
|
|
|
- from = from.getTime()
|
|
|
+ }],
|
|
|
+ rootProperty: 'data.content',
|
|
|
+ totalProperty: 'data.totalElements',
|
|
|
+ hiddenTools: true,
|
|
|
+ data: [],
|
|
|
+ columns: [{
|
|
|
+ text : 'id',
|
|
|
+ width : 0,
|
|
|
+ dataIndex : 'id',
|
|
|
+ xtype : 'numbercolumn',
|
|
|
+ hidden:true
|
|
|
+ },{
|
|
|
+ text : '物料编号',
|
|
|
+ width : 200.0,
|
|
|
+ dataIndex : 'prodCode',
|
|
|
+ xtype : '',
|
|
|
+ }, {
|
|
|
+ text : '品牌',
|
|
|
+ dataIndex : 'prodBrand',
|
|
|
+ width : 110.0,
|
|
|
+ xtype : '',
|
|
|
+ }, {
|
|
|
+ text : '名称',
|
|
|
+ dataIndex : 'prodName',
|
|
|
+ width : 150.0
|
|
|
+ },{
|
|
|
+ text : '型号',
|
|
|
+ dataIndex : 'prodOrispeccode',
|
|
|
+ width : 110.0
|
|
|
+ },{
|
|
|
+ text : '规格',
|
|
|
+ dataIndex : 'prodSpec',
|
|
|
+ width : 110.0
|
|
|
+ },{
|
|
|
+ text : '单位',
|
|
|
+ dataIndex : 'prodUnit',
|
|
|
+ width : 110.0
|
|
|
+ },{
|
|
|
+ text : '发起时间',
|
|
|
+ dataIndex : 'startDate',
|
|
|
+ width : 160.0
|
|
|
+ },{
|
|
|
+ text : '截止日期',
|
|
|
+ dataIndex : 'endDate',
|
|
|
+ width : 160.0
|
|
|
+ },{
|
|
|
+ text : '报价状态',
|
|
|
+ dataIndex : 'qutations',
|
|
|
+ width : 110.0,
|
|
|
+ renderer:function(val, meta, record,x,y,store, view){
|
|
|
+ if(!val||val==0||val.length==0){
|
|
|
+ return '否'
|
|
|
}else{
|
|
|
- from = date.value.from.getTime()
|
|
|
+ return '是'
|
|
|
}
|
|
|
- var to = date.value.to || '';
|
|
|
- if(!Ext.isDate(to)){
|
|
|
- to = new Date(to);
|
|
|
- to = to.getTime()
|
|
|
- }else{
|
|
|
- to = date.value.to.getTime()
|
|
|
- }
|
|
|
- var search = Ext.ComponentQuery.query('[name=search]')[0].value;
|
|
|
- var quoted = Ext.ComponentQuery.query('[name=quoted]')[0].value;
|
|
|
- var overdue = Ext.ComponentQuery.query('[name=overdue]')[0].value;
|
|
|
- Ext.apply(store.proxy.extraParams, {
|
|
|
- keyword :search,//search==''?' ':search,
|
|
|
- pageNumber: op._page,
|
|
|
- pageSize: store.pageSize,
|
|
|
- quoted:quoted,
|
|
|
- fromDate:from,
|
|
|
- endDate:to,
|
|
|
- overdue:overdue
|
|
|
- });
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- Ext.apply(me, {
|
|
|
- dockedItems:[{
|
|
|
- xtype: 'pagingtoolbar',
|
|
|
- dock: 'bottom',
|
|
|
- displayInfo: true,
|
|
|
- store: me.store
|
|
|
}]
|
|
|
- });
|
|
|
- }
|
|
|
- me.callParent(arguments);
|
|
|
- },
|
|
|
-
|
|
|
- listeners:{
|
|
|
- boxready: function(grid, width, height, eOpts) {
|
|
|
- var store = grid.getStore(),
|
|
|
- gridBodyBox = grid.body.dom.getBoundingClientRect(),
|
|
|
- gridBodyBoxHeight = gridBodyBox.height;
|
|
|
-
|
|
|
- var pageSize = Math.floor(gridBodyBoxHeight / 33);
|
|
|
-
|
|
|
- store.setPageSize(pageSize);
|
|
|
-
|
|
|
- grid.ownerCt.el.dom.style.left = '8px';
|
|
|
- grid.el.dom.style.padding = '0px'
|
|
|
- },
|
|
|
- itemClick: function(view,record,a,index,c) {
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- getGridSelected:function(type){
|
|
|
- var isErrorSelect = false;
|
|
|
- var checkField = this.statusCodeField;
|
|
|
- var me = this,
|
|
|
- items = me.selModel.getSelection(),
|
|
|
- data = new Array() ;
|
|
|
- Ext.each(items, function(item, index){
|
|
|
- if(!Ext.isEmpty(item.data[me.idField])){
|
|
|
- var o = new Object();
|
|
|
- if(me.idField){
|
|
|
- o['id'] = item.data[me.idField];
|
|
|
- }
|
|
|
- if(me.codeField){
|
|
|
- o['code'] = item.data[me.codeField];
|
|
|
- }
|
|
|
- if(type&&type==item.data[checkField]){
|
|
|
- isErrorSelect = true
|
|
|
- }
|
|
|
- data.push(o);
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
- if(isErrorSelect){
|
|
|
- return false;
|
|
|
- }
|
|
|
- return data;
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 获得过滤条件
|
|
|
- */
|
|
|
- getConditions: function() {
|
|
|
- var me = this,
|
|
|
- tbar = me.getDockedItems()[0],
|
|
|
- items = Ext.Array.filter(tbar.items.items, function(item) {
|
|
|
- return !!item.name;
|
|
|
- }),
|
|
|
- conditions = [];
|
|
|
- for(var i = 0; i < items.length; i++) {
|
|
|
- var item = items[i];
|
|
|
- var field = item.name,
|
|
|
- func = item.getCondition,
|
|
|
- value = item.value,
|
|
|
- condition;
|
|
|
-
|
|
|
- if(value&&value!=''){
|
|
|
- if(typeof func == 'function') {
|
|
|
- condition = {
|
|
|
- type: 'condition',
|
|
|
- value: func(value)
|
|
|
- }
|
|
|
- }else {
|
|
|
- var type = item.fieldType || me.getDefaultFieldType(item),
|
|
|
- operation = item.operation || me.getDefaultFieldOperation(item),
|
|
|
- conditionValue = me.getConditionValue(item, value);
|
|
|
-
|
|
|
- if(!conditionValue) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- condition = {
|
|
|
- type: type,
|
|
|
- field: field,
|
|
|
- operation: operation,
|
|
|
- value: conditionValue
|
|
|
- }
|
|
|
- }
|
|
|
- conditions.push(condition);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return conditions;
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 只要arr1和arr2中存在相同项即返回真
|
|
|
- */
|
|
|
- isContainsAny: function (arr1, arr2) {
|
|
|
- for (var i = 0; i < arr2.length; i++) {
|
|
|
- var a2 = arr2[i];
|
|
|
- if (!!arr1.find(function (a1) {
|
|
|
- return a1 == a2
|
|
|
- })) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- },
|
|
|
-
|
|
|
- getDefaultFieldType: function (field) {
|
|
|
- var me = this,
|
|
|
- xtypes = field.getXTypes().split('/'),
|
|
|
- type;
|
|
|
-
|
|
|
- if (me.isContainsAny(xtypes, ['numberfield'])) {
|
|
|
- type = 'number';
|
|
|
- } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
|
|
|
- type = 'date';
|
|
|
- } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
- type = 'enum';
|
|
|
- } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
|
|
|
- type = 'enum';
|
|
|
- } else {
|
|
|
- type = 'string';
|
|
|
- }
|
|
|
-
|
|
|
- return type;
|
|
|
- },
|
|
|
-
|
|
|
- getDefaultFieldOperation: function (field) {
|
|
|
- var me = this,
|
|
|
- xtypes = field.getXTypes().split('/'),
|
|
|
- operation;
|
|
|
-
|
|
|
- if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
|
|
|
- operation = '=';
|
|
|
- } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
|
|
|
- operation = 'between';
|
|
|
- } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
|
|
|
- operation = 'in';
|
|
|
- } else {
|
|
|
- operation = 'like';
|
|
|
- }
|
|
|
-
|
|
|
- return operation;
|
|
|
+ this.callParent(arguments);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -634,25 +383,48 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
|
|
|
|
|
|
conditionValue = from + ',' + to;
|
|
|
} else if (me.isContainsAny(xtypes, ['condatefield'])) {
|
|
|
- var from = value.from,
|
|
|
- to = value.to;
|
|
|
+ var from = new Date(value.from).getTime(),
|
|
|
+ to = new Date(value.to).getTime();
|
|
|
|
|
|
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
|
|
|
+ conditionValue = {
|
|
|
+ from: from,
|
|
|
+ to: to
|
|
|
+ };
|
|
|
} else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
conditionValue = value;
|
|
|
} else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
|
|
|
- conditionValue = '\'' + value + '\'';
|
|
|
+ conditionValue = value;
|
|
|
} else if (me.isContainsAny(xtypes, ['multicombo'])) {
|
|
|
conditionValue = value.map ? value.map(function (v) {
|
|
|
- return '\'' + v.value + '\'';
|
|
|
+ return v.value;
|
|
|
}).join(',') : '';
|
|
|
} else {
|
|
|
conditionValue = value;
|
|
|
}
|
|
|
|
|
|
return conditionValue;
|
|
|
- }
|
|
|
+ },
|
|
|
|
|
|
-})
|
|
|
+ getExtraParams: function(store, op, condition) {
|
|
|
+ var obj = {
|
|
|
+ keyword: ' ',
|
|
|
+ pageNumber: op._page,
|
|
|
+ pageSize: store.pageSize,
|
|
|
+ };
|
|
|
+
|
|
|
+ for(var i = 0; i < condition.length; i++) {
|
|
|
+ var con = condition[i];
|
|
|
+ if(con.type == 'enum') {
|
|
|
+ obj[con.field] = con.value;
|
|
|
+ }else if(con.type == 'date') {
|
|
|
+ obj.fromDate = con.value.from;
|
|
|
+ obj.endDate = con.value.to;
|
|
|
+ }else {
|
|
|
+ obj.keyword = con.value
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ return obj;
|
|
|
+ },
|
|
|
+});
|
|
|
|