|
|
@@ -6,9 +6,10 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
viewModel: 'purchase-quotationList-datalist',
|
|
|
autoScroll: true,
|
|
|
frame:true,
|
|
|
+ cls:'x-quotation-main',
|
|
|
layout:'fit',
|
|
|
|
|
|
- dataUrl:'http://10.1.80.23:8560/api/purchase/purchase/inquiry/list',
|
|
|
+ dataUrl:'/api/purchase/purchase/inquiry/list',
|
|
|
quotationListUrl:'/api/commons/number/delete/',
|
|
|
|
|
|
plugins: [{
|
|
|
@@ -111,7 +112,133 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
}, {
|
|
|
width: 200,
|
|
|
text: '操作',
|
|
|
- dataIndex: 'agreed'
|
|
|
+ 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){
|
|
|
+ saas.util.BaseUtil.showSuccessToast('操作成功');
|
|
|
+ }else{
|
|
|
+ saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ failure: function (response, opts) {
|
|
|
+ saas.util.BaseUtil.showErrorToast('操作失败,请重试');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ 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>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}]
|
|
|
}
|
|
|
}],
|
|
|
@@ -254,8 +381,15 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
width : 160.0
|
|
|
},{
|
|
|
text : '报价状态',
|
|
|
- dataIndex : 'quoted',
|
|
|
- width : 110.0
|
|
|
+ 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
|
|
|
@@ -341,7 +475,7 @@ Ext.define('saas.view.purchase.quotationList.DataList', {
|
|
|
gridBodyBox = grid.body.dom.getBoundingClientRect(),
|
|
|
gridBodyBoxHeight = gridBodyBox.height;
|
|
|
|
|
|
- var pageSize = Math.floor(gridBodyBoxHeight / 32);
|
|
|
+ var pageSize = Math.floor(gridBodyBoxHeight / 33);
|
|
|
|
|
|
store.setPageSize(pageSize);
|
|
|
|