فهرست منبع

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

guq 7 سال پیش
والد
کامیت
15798a8253
26فایلهای تغییر یافته به همراه725 افزوده شده و 46 حذف شده
  1. 1 1
      applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml
  2. 1 1
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  3. 1 1
      applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml
  4. 26 0
      frontend/operation-web/app/util/BaseUtil.js
  5. 103 0
      frontend/operation-web/app/view/auth/ReLogin.js
  6. 15 0
      frontend/operation-web/app/view/auth/ReLogin.scss
  7. 103 0
      frontend/operation-web/app/view/auth/ReLoginController.js
  8. 3 0
      frontend/operation-web/app/view/statistical/CompanyAnalysis.js
  9. 26 0
      frontend/operation-web/app/view/statistical/PersonRegInfo.js
  10. 1 1
      frontend/operation-web/overrides/data/Connection.js
  11. 19 0
      frontend/saas-web/app/Application.scss
  12. 21 0
      frontend/saas-web/app/model/report/PayDetail.js
  13. 21 0
      frontend/saas-web/app/model/report/RecDetail.js
  14. 1 1
      frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js
  15. 2 1
      frontend/saas-web/app/view/main/MainContainerWrap.js
  16. 4 4
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  17. 4 4
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  18. 6 1
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  19. 4 2
      frontend/saas-web/app/view/money/report/PayDetail.js
  20. 4 2
      frontend/saas-web/app/view/money/report/RecDetail.js
  21. 37 16
      frontend/saas-web/app/view/money/verification/FormPanel.js
  22. 12 2
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  23. 139 5
      frontend/saas-web/app/view/purchase/quotationList/DataList.js
  24. 7 3
      frontend/saas-web/app/view/purchase/sendQuotation/DataList.js
  25. 158 0
      frontend/saas-web/app/view/sale/business/Product.js
  26. 6 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml

@@ -34,7 +34,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyId = #{companyId} and pd_query =1 and (pd_addpay + pd_addpre + pd_remain) != 0
+        and  companyId = #{companyId} and pd_query =1
       </if>
     </where>
     order by pd_vendid DESC, pd_detno asc, pd_date desc

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -110,7 +110,7 @@
     rb_rdamount, rb_rbdamount, rb_preamount, rb_discounts, rb_havebalance, rb_status, rb_statuscode, rb_remark,
     recbalance.companyId,
     recbalance.updaterId,recbalance.updatedate, rb_text1, rb_text2, rb_text3, rb_text4, rb_text5,
-    recbalance.creatorName, recbalance.createTime, rb_auditman, rb_auditdate, rb_amount
+    recbalance.creatorName, recbalance.createTime, rb_auditman, rb_auditdate, rb_amount,rb_rate,rb_currency
   </sql>
   <sql id="left_Column_List">
     cu_leftamount

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml

@@ -34,7 +34,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyId = #{companyId} and rd_query = 1 and (rd_addrec + rd_addpre + rd_remain) != 0
+        and  companyId = #{companyId} and rd_query = 1
       </if>
     </where>
     order by rd_custid DESC, rd_detno asc, rd_date desc

+ 26 - 0
frontend/operation-web/app/util/BaseUtil.js

@@ -215,6 +215,32 @@ Ext.define('saas.util.BaseUtil', {
             var xr = (new Array(arr[1].length > decimalPrecision ? decimalPrecision : arr[1].length)).fill('0');
             var format = f1 + '.' + xr.join('');
             return Ext.util.Format.number(value, format);
+        },
+
+        showLoginWin: function() {
+            var main = Ext.getCmp('rootView'),
+            win = Ext.getCmp('relogin');
+
+            if(!win) {
+                win = main.add({
+                    xtype: 'relogin'
+                });
+            }
+
+            win.show();
+        },
+
+        hashcode: function(obj) {
+            let str = JSON.stringify(obj);
+            let hash = 0,
+                i, chr, len;
+            if (str.length === 0) return hash;
+            for (i = 0, len = str.length; i < len; i++) {
+                chr = str.charCodeAt(i);
+                hash = ((hash << 5) - hash) + chr;
+                hash |= 0;
+            }
+            return hash;
         }
     }
 });

+ 103 - 0
frontend/operation-web/app/view/auth/ReLogin.js

@@ -0,0 +1,103 @@
+/**
+ * 重新登录弹窗
+ */
+Ext.define('saas.view.auth.ReLogin', {
+    extend: 'Ext.window.Window',
+    xtype: 'relogin',
+    id: 'relogin',
+
+    controller: 'relogin',
+
+    title: '重新登录',
+    cls: 'x-window-dbfind x-relogin-win',
+    layout: 'fit',
+    modal: true,
+    width: 350,
+    bodyPadding: 20,
+
+    items: [{
+        xtype: 'form',
+        reference: 'reloginform',
+        defaults: {
+            anchor: '100%',
+            labelWidth: 120
+        },
+        items: [{
+            xtype: 'displayfield',
+            height: 32,
+            cls: 'infoLabel',
+            value: '会话已过期,请重新登录',
+        }, {
+            xtype: 'textfield',
+            name: 'username',
+            emptyText: '请输入账号/邮箱/手机号',
+            fieldLabel: '账号',
+            bind: '{account.username}',
+            readOnly: true,
+            hideLabel: true,
+            allowBlank: false
+        }, {
+            xtype: 'textfield',
+            hideLabel: true,
+            fieldLabel: '密码',
+            emptyText: '密码',
+            inputType: 'password',
+            name: 'password',
+            // bind: '{password}',
+            allowBlank: false,
+            enableKeyEvents: true,
+            listeners: {
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            this.up('relogin').getController().onLogin();
+                        }
+                    }
+                }
+            }
+        }, {
+            xtype: 'container',
+            layout: 'hbox',
+            items: [{
+                xtype: 'checkboxfield',
+                flex: 1,
+                cls: 'form-panel-font-color rememberMeCheckbox',
+                height: 30,
+                name: 'remember',
+                bind: '{remember}',
+                boxLabel: '记住密码'
+            }, {
+                xtype: 'box',
+                // html: '<a href="#passwordreset" class="link-forgot-password"> 忘记密码 ?</a>'
+            }]
+        }, {
+            xtype: 'container',
+            layout: {
+                type: 'hbox',
+                pack: 'center'
+            },
+            items: [{
+                xtype: 'button',
+                text: '登录',
+                formBind: true,
+                width: 68,
+                margin: '0 12 0 0',
+                listeners: {
+                    click: 'onLogin'
+                }
+            }, {
+                xtype: 'button',
+                text: '取消',
+                width: 68,
+                margin: '0 0 0 12',
+                listeners: {
+                    click: 'onCancel'
+                }
+            }]
+        }]
+    }],
+
+    listeners: {
+        afterrender: 'onAfterRender',
+    }
+});

+ 15 - 0
frontend/operation-web/app/view/auth/ReLogin.scss

@@ -0,0 +1,15 @@
+.x-relogin-win {
+    .infoLabel {
+        .x-form-display-field {
+            font-size: 14px;
+            vertical-align: middle;
+            line-height: 32px;
+            color: red;
+        }
+    }
+    .rememberMeCheckbox {
+        .x-form-checkbox-default,.x-form-cb-label-default.x-form-cb-label-after {
+            margin: 0;
+        }
+    }
+}

+ 103 - 0
frontend/operation-web/app/view/auth/ReLoginController.js

@@ -0,0 +1,103 @@
+Ext.define('saas.view.auth.ReLoginController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.relogin',
+
+    init: function () {
+        this.callParent(arguments);
+    },
+
+    onAfterRender: function() {
+        var me = this,
+        view = me.getView(),
+        model = me.getViewModel(),
+        remember = model.get('remember'),
+        password = model.get('repassword'),
+        lastSuccess = model.get('lastSuccess'),
+        form = me.lookup('reloginform'),
+        passwordField = form.getForm().findField('password');
+
+        if(remember && lastSuccess) {
+            passwordField.setValue(password);
+        }
+    },
+
+    onLogin: function () {
+        var me = this,
+            view = me.getView(),
+            viewModel = me.getViewModel(),
+            companyId = saas.util.BaseUtil.getCurrentUser().companyId,
+            form = me.lookup('reloginform'),
+            values = form.getValues();
+
+        if(!form.isValid()) {
+            return;
+        }
+
+        view.mask('请稍等...');
+
+        saas.model.Session.login(values.username, values.password, companyId)
+        .then(function (session) {
+            view.isMasked() && view.unmask();
+            viewModel.set('session', session);
+
+            session.get('account').companyId = companyId;
+            
+            me.successReLogin();
+            me.fireEvent('login', session);
+            return session;
+        })
+        .then(function(session) {
+            let headers = Ext.Ajax.getDefaultHeaders() || {};
+            
+            headers['Authorization'] = session.data.token;
+            Ext.Ajax.setDefaultHeaders(headers);
+
+            saas.util.State.set('session', session.data);
+
+            let sessionStr = session.data ? JSON.stringify(session.data) : '';
+
+            if (typeof require === 'function') {
+                let ipc = require('electron').ipcRenderer;
+                ipc.send('session.change', sessionStr);
+            }else {
+                //解析session 把data作为sessionStr
+                sessionStr = session ? JSON.stringify(session.data) : '';
+                const frame = window.frames[window.frames.length - 1];
+                frame.postMessage(sessionStr, '*');
+            }
+            return session;
+        })
+        .catch(function (error) {
+            view.isMasked() && view.unmask();
+            console.error(error);
+            saas.util.BaseUtil.showErrorToast('登录失败: ' + error.message);
+            me.failureReLogin();
+        });
+    },
+
+    successReLogin: function() {
+        var me = this,
+            view = me.getView(),
+            form = me.lookup('reloginform'),
+            values = form.getValues();
+            viewModel = me.getViewModel();
+
+        viewModel.set('repassword', values.password);
+        viewModel.set('lastSuccess', true);
+        view.close();
+    },
+
+    failureReLogin: function() {
+        var me = this,
+        viewModel = me.getViewModel();
+
+        viewModel.set('lastSuccess', false);
+    },
+
+    onCancel: function() {
+        var me = this,
+        view = me.getView();
+
+        view.close();
+    },
+});

+ 3 - 0
frontend/operation-web/app/view/statistical/CompanyAnalysis.js

@@ -32,6 +32,9 @@ Ext.define('saas.view.statistical.CompanyAnalysis', {
                     text: '企业名称',
                     dataIndex: 'ca_company',
                     width: 200,
+                    renderer: function(v, m, r) {
+                        return '<span style="cursor: pointer; color: #3e80f6;">' + v + '</span>';
+                    },
                     listeners: {
                         click: function(tableView, td, rowIdx, colIdx, e, model, tr) {
                             var data = model.data;

+ 26 - 0
frontend/operation-web/app/view/statistical/PersonRegInfo.js

@@ -14,6 +14,32 @@ Ext.define('saas.view.statistical.PersonRegInfo', {
                 getCondition: function (v) {
                     return "(upper(CONCAT(username, '#', mobile) like '%" + v.toUpperCase() + "%'))";
                 },
+            }, {
+                xtype: 'combobox',
+                name: 'bind',
+                fieldLabel: '绑定企业',
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                emptyText :'全部',
+                editable:false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                fields: ['value', 'name'],
+                data: [
+                    ["ALL", "全部"],
+                    ["Y", "是"],
+                    ["N", "否"]
+                ]
+                }),
+                getCondition: function(value) {
+                    if(value == 'ALL') {
+                        return '1=1';
+                    }else if(value == 'Y') {
+                        return 'bind > 0';
+                    }else if(value == 'N') {
+                        return 'bind = 0';
+                    }
+                }
             }],
 
             gridConfig: {

+ 1 - 1
frontend/operation-web/overrides/data/Connection.js

@@ -60,7 +60,7 @@ Ext.define('saas.override.data.Connection', {
 
         if(res && res.code == 40001) {
             // 如果token超时则显示重新登陆弹窗
-            // saas.util.BaseUtil.showLoginWin();
+            saas.util.BaseUtil.showLoginWin();
             throw new Error('会话已过期');
         }
 

+ 19 - 0
frontend/saas-web/app/Application.scss

@@ -616,6 +616,25 @@ input::-webkit-input-placeholder {
 
 .x-quotation-detail{
   width: 1105px !important;
+  .x-grid-row{
+    border-color:#fff !important;
+    background-color: #fff !important;
+  }
+  .x-grid-item-selected{
+    border-color:#fff !important;
+    background-color: #fff !important;
+  }
+}
+
+.x-quotation-main{
+  .x-grid-row{
+    border-color:#fff !important;
+    background-color: #fff !important;
+  }
+  .x-grid-item-selected{
+    border-color:#fff !important;
+    background-color: #fff !important;
+  }
 }
 
 .x-btn-quotation{

+ 21 - 0
frontend/saas-web/app/model/report/PayDetail.js

@@ -0,0 +1,21 @@
+Ext.define('saas.model.report.PayDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pd_date', type: 'string' },
+        { name: 'pd_code', type: 'string' },
+        { name: 'pd_kind', type: 'date' },
+        { name: 'pd_buyername', type: 'string' },
+        { name: 'pd_currency', type: 'string' },
+        { name: 'pd_addpay', type: 'float' },
+        { name: 'pd_addpre', type: 'float' },
+        { name: 'pd_remain', type: 'float' },
+        { name: 'pd_vendname', type: 'string' },
+        { name: 'groupfield', type: 'string',
+            convert: function(v, rec) {
+                return rec.get('pd_vendname') + rec.get('pd_currency');
+            },
+            depends: ['pd_vendname', 'pd_currency']
+        }
+    ],
+});

+ 21 - 0
frontend/saas-web/app/model/report/RecDetail.js

@@ -0,0 +1,21 @@
+Ext.define('saas.model.report.RecDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'rd_date', type: 'string' },
+        { name: 'rd_code', type: 'string' },
+        { name: 'rd_kind', type: 'date' },
+        { name: 'rd_sellername', type: 'string' },
+        { name: 'rd_currency', type: 'string' },
+        { name: 'rd_addrec', type: 'float' },
+        { name: 'rd_addpre', type: 'float' },
+        { name: 'rd_remain', type: 'float' },
+        { name: 'rd_custname', type: 'string' },
+        { name: 'groupfield', type: 'string',
+            convert: function(v, rec) {
+                return rec.get('rd_custname') + rec.get('rd_currency');
+            },
+            depends: ['rd_custname', 'rd_currency']
+        }
+    ],
+});

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js

@@ -98,6 +98,6 @@ Ext.define('saas.view.core.form.field.ConDbfindTrigger', {
     },
 
     isDirty: function() {
-        return this.items.items[0].isDirty() && this.items.items[1].isDirty();
+        return this.items.items[0].isDirty() || this.items.items[1].isDirty();
     }
 });

+ 2 - 1
frontend/saas-web/app/view/main/MainContainerWrap.js

@@ -34,11 +34,12 @@ Ext.define('saas.view.main.MainContainerWrap', {
                 closeTabText: '关闭当前页',
                 closeAllTabsText: '关闭全部页',
                 closeOthersTabsText: '关闭其他页'
-            })],
+            }), new Ext.ux.TabReorderer()],
             items: [{
                 iconCls: 'x-sa sa-home',
                 title: '首页',
                 closable: false,
+                reorderable: false,
                 // margin: '16 0 16 16',
                 // scrollable: true,
                 // bodyPadding: '0 16 0 0',

+ 4 - 4
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -76,10 +76,10 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'pb_rate'
                 }],
-                defaultValue: {
-                    pb_currency: 'RMB',
-                    pb_rate: 1
-                },
+                // defaultValue: {
+                //     pb_currency: 'RMB',
+                //     pb_rate: 1
+                // },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,

+ 4 - 4
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -85,10 +85,10 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'rb_rate'
                 }],
-                defaultValue: {
-                    rb_currency: 'RMB',
-                    rb_rate: 1
-                },
+                // defaultValue: {
+                //     rb_currency: 'RMB',
+                //     rb_rate: 1
+                // },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,

+ 6 - 1
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -84,7 +84,12 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from:'cu_name', to:'rb_custname'
                         },{
                             from:'cu_leftamount', to:'cu_leftamount'
-                        }],
+                        },{
+                            from:'cu_currency',to:'rb_currency'
+                        },{
+                            from:'cr_rate',to:'rb_rate'
+                        }
+                        ],
                     }) ;   
                 }
             },

+ 4 - 2
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -6,8 +6,8 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pd_vendname',
-    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendname]}',
+    groupField: 'groupfield',
+    groupHeaderTpl: '{[values.rows[0].data.pd_vendname]} ({[values.rows[0].data.pd_currency]})',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
@@ -27,6 +27,8 @@ Ext.define('saas.view.money.report.PayDetail', {
         columnWidth: 0.5
     }],
 
+    reportModel: 'saas.model.report.PayDetail',
+
     reportColumns: [{
         text: '单据日期',
         xtype: 'datecolumn',

+ 4 - 2
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,8 +7,8 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'rd_custname',
-    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
+    groupField: 'groupfield',
+    groupHeaderTpl: '{[values.rows[0].data.rd_custname]} ({[values.rows[0].data.rd_currency]})',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
@@ -28,6 +28,8 @@ Ext.define('saas.view.money.report.RecDetail', {
         columnWidth: 0.5
     }],
 
+    reportModel: 'saas.model.report.RecDetail',
+
     reportColumns: [{
         text: '单据日期',
         xtype: 'datecolumn',

+ 37 - 16
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -526,6 +526,27 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         allowBlank: false,
                         name: 'vc_date'
                     }, {
+                        xtype: 'condbfindtrigger',
+                        fieldLabel: '币别汇率',
+                        allowBlank: false,
+                        dbType: 'currencyDbfindTrigger',
+                        dbfinds: [{
+                            from: 'cr_name', to: 'vc_currency'
+                        }, {
+                            from: 'cr_rate', to: 'vc_rate'
+                        }],
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
+                        supFieldConfig: {
+                            xtype: 'numberfield',
+                            readOnly: false,
+                            defaultReadOnly: false,
+                            decimalPrecision: 6,
+                            vtype: 'positiveNumber'
+                        },
+                    },{
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -575,10 +596,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -653,10 +674,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             }, {
                                 from: 'cr_rate', to: 'vc_rate'
                             }],
-                            defaultValue: {
-                                vc_currency: 'RMB',
-                                vc_rate: 1
-                            },
+                            // defaultValue: {
+                            //     vc_currency: 'RMB',
+                            //     vc_rate: 1
+                            // },
                             supFieldConfig: {
                                 xtype: 'numberfield',
                                 readOnly: false,
@@ -730,10 +751,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -807,10 +828,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,

+ 12 - 2
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -82,7 +82,12 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from:'cu_code', to:'vc_custcode'
                         },{
                             from:'cu_name', to:'vc_custname'
-                        }],
+                        },{
+                            from:'cu_currency',to:'vc_currency'
+                        },{
+                            from:'cr_rate',to:'vc_rate'
+                        }
+                        ],
                     }) ;   
 
                 }
@@ -239,7 +244,12 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                         }, {
                             from: 've_name',
                             to: 'vc_vendname'
-                        }],
+                        },{
+                            from:'cu_currency',to:'vc_currency'
+                        },{
+                            from:'cr_rate',to:'vc_rate'
+                        }
+                        ],
                     });
 
                 }

+ 139 - 5
frontend/saas-web/app/view/purchase/quotationList/DataList.js

@@ -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);
 

+ 7 - 3
frontend/saas-web/app/view/purchase/sendQuotation/DataList.js

@@ -11,7 +11,7 @@ Ext.define('saas.view.purchase.sendQuotation.DataList', {
     layout:'fit',
     
     dataUrl:'/api/document/product/list',                 
-    sendQuotationUrl:'http://10.1.80.23:8560/api/purchase/purchase/inquiry/send',
+    sendQuotationUrl:'/api/purchase/purchase/inquiry/send',
 
     plugins: [{
         ptype: 'menuclipboard'
@@ -190,9 +190,13 @@ Ext.define('saas.view.purchase.sendQuotation.DataList', {
             })
             .then(function(res) {
                 grid.setLoading(false);
-                saas.util.BaseUtil.showSuccessToast('操作成功');
-                debugger
+                if(res.data.length>0){
+                    saas.util.BaseUtil.showErrorToast('询价结果: 成功'+(data.length-res.data.length) +'条,失败'+res.data.length+'条');
+                }else{
+                    saas.util.BaseUtil.showSuccessToast('询价成功'+data.length+'条');
+                }
                 grid.store.load();
+                grid.selModel.deselectAll();
             })
             .catch(function(e) {
                 grid.setLoading(false);

+ 158 - 0
frontend/saas-web/app/view/sale/business/Product.js

@@ -0,0 +1,158 @@
+/**
+ * 产品库
+ */
+Ext.define('saas.view.sale.business.Product', {
+    extend: 'saas.view.core.base.BasePanel',
+    xtype: 'sale-business-product',
+
+    controller: 'sale-business-Product',
+    viewModel: 'sale-business-Product',
+    viewName: 'sale-business-Product',
+
+
+    // dataUrl: 'http://10.1.80.23:8560/api/sale/sale/enterprise/businessChance',
+    dataUrl: '/api/sale/sale/enterprise/businessChance',
+    initComponent: function() {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                xtype: 'textfield',
+                name: 'keyword',
+                columnWidth: 0.15,
+                emptyText:'请输入物料编号/名称/型号/品牌'
+            }, {
+                xtype: 'combobox',
+                name: 'uploaded',
+                fieldLabel: '上传状态',
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                emptyText :'全部',
+                editable:false,
+                labelWidth: 80,
+                columnWidth: 0.2,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [
+                        ["全部", "all"],
+                        ["未上传", "0"],
+                        ["已上传", "1"]
+                    ]
+                })
+            }, {
+                xtype: 'checkbox',
+                name: 'self',
+                fieldLabel: '我的产品库'
+            }],
+        
+            gridConfig: {
+                dataUrl: me.dataUrl,
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElements',
+                actionColumn: [],
+                selModel: {
+                    type: 'cellmodel'
+                },
+                hiddenTools: true,
+                data: [{
+
+                }],
+                columns : [{
+                    text: '物料编号',
+                    dataIndex: 'custName',
+                    width: 120
+                }, {
+                    text: '品牌',
+                    dataIndex: 'prodBrand',
+                    width: 100
+                }, {
+                    text: '名称',
+                    dataIndex: 'prodName',
+                    width: 120
+                }, {
+                    text: '型号',
+                    dataIndex: 'prodOrispeccode',
+                    width: 120
+                }, {
+                    text: '规格',
+                    dataIndex: 'prodSpec',
+                    width: 120
+                }, {
+                    text: '单位',
+                    dataIndex: 'prodUnit'
+                }, {
+                    text: '上传状态',
+                    dataIndex: 'needQty'
+                }, {
+                    text: '我的产品',
+                    dataIndex: 'startDate'
+                }]
+            },
+        });
+        this.callParent(arguments);
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = value.from,
+                to = value.to;
+
+            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');
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
+                return v.value;
+            }).join(',') : '';
+        } else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    getExtraParams: function(store, op, condition) {
+        var temp = {};
+
+        for(let x = 0; x < condition.length; x++) {
+            let c = condition[x];
+            if(c.field == 'keyword') {
+                temp.keyword = c.value;
+            }else if(c.field == 'date') {
+                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
+                temp.endDate = new Date(c.value.split(',')[1]).getTime();
+            }else if(c.field == 'quoted') {
+                temp.quoted = c.value == 'all' ? null : c.value;
+            }else if(c.field == 'closed') {
+                // temp.endDate = c.value == 'all' ? null : (
+                //     c.value == '0' ? 
+                // );
+            }
+        }
+        let obj = {
+            pageNumber: store.exportNumber?store.exportNumber:op._page,
+            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
+        };
+        for(let k in temp) {
+            if(!!temp[k]) {
+                obj[k] = temp[k];
+            }
+        }
+        return obj;
+     },
+});

+ 6 - 1
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -29,7 +29,12 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                             to: 'sa_seller'
                         }, {
                             from:'cu_sellerid',to:'cu_sellerid'
-                        }],
+                        },{
+                            from:'cu_currency',to:'sa_currency'
+                        },{
+                            from:'cr_rate',to:'sa_rate'
+                        }
+                        ],
                     });
 
                 }