瀏覽代碼

代码提交

hy 7 年之前
父節點
當前提交
e6d30bb1d5

+ 6 - 9
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -33,17 +33,10 @@ Ext.define('saas.view.document.bom.FormPanel', {
     }, {
         xtype: 'button',
         text: '保存',
-        handler: 'onSave',
-        // bind: {
-        //     // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
-        //     disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
-        // }
+        handler: 'onSave'
     }, {
         xtype: 'button',
         text: '删除',
-        // bind: {
-        //     hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
-        // },
         handler: 'delete'
     }, {
         xtype: 'button',
@@ -107,6 +100,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 xtype : "numbercolumn"
             },
             {
+                allowBlank:false,
                 text : "子件编号", 
                 editor : {
                     xtype : "textfield"
@@ -114,6 +108,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 dataIndex : "bd_soncode", 
             },
             {
+                allowBlank:false,
                 text : "单位", 
                 editor : {
                     xtype : "textfield"
@@ -121,6 +116,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 dataIndex : "bd_unit", 
             },
             {
+                allowBlank:false,
                 text : "单位用量", 
                 editor : {
                     xtype : "textfield"
@@ -128,6 +124,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 dataIndex : "bd_baseqty", 
             },
             {
+                allowBlank:false,
                 text : "替代料", 
                 editor : {
                     xtype : "textfield"
@@ -141,7 +138,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
         auditText: '已关闭',
         unAuditCode: 'OPEN',
         unAuditText: '已开启',
-        auditBtnText: '关闭',
+        auditBtnText: '禁用',
         unAuditBtnText: '启用',
     }
 });

+ 85 - 41
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -33,25 +33,13 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name: 'cu_name',
         fieldLabel: '客户名称',
         allowBlank: false,
-        columnWidth: 0.25
+        columnWidth: 0.5
     },{
         xtype: 'textfield',
         name: 'cu_code',
         fieldLabel: '客户编号',
         allowBlank: true,
         columnWidth: 0.25
-    },{
-        xtype: 'textfield',
-        name: 'cu_status',
-        fieldLabel: '状态',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{
-        xtype: 'hidden',
-        name: 'cu_statuscode',
-        fieldLabel: '状态码',
-        allowBlank: true,
-        columnWidth: 0.25
     },{
         editable:false,
         xtype : "remotecombo", 
@@ -79,11 +67,17 @@ Ext.define('saas.view.document.customer.FormPanel', {
             this.dialog.show();
         }
     },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        xtype: 'hidden',
+        name: 'cu_status',
+        fieldLabel: '状态',
+        allowBlank: true,
+        columnWidth: 0
+    },{
+        xtype: 'hidden',
+        name: 'cu_statuscode',
+        fieldLabel: '状态码',
+        allowBlank: true,
+        columnWidth: 0.25
     },{
         xtype : "datefield", 
         name : "cu_begindate", 
@@ -104,39 +98,90 @@ Ext.define('saas.view.document.customer.FormPanel', {
         fieldLabel : "期初预收", 
         allowBlank : true, 
         columnWidth : 0.25    
+    },{
+        xtype : "numberfield", 
+        name : "cu_taxrate", 
+        fieldLabel : "税率", 
+        allowBlank : false, 
+        columnWidth : 0.25   
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
         name : "cu_promisedays", 
         fieldLabel : "承付天数", 
         allowBlank : true, 
-        columnWidth : 0.25      
+        columnWidth : 0.25        
     },{
         xtype : "numberfield", 
-        name : "cu_taxrate", 
-        fieldLabel : "税率", 
-        allowBlank : false, 
-        columnWidth : 0.25   
+        hideTrigger:true,
+        name : "cu_credit", 
+        fieldLabel : "额度", 
+        allowBlank : true, 
+        columnWidth : 0.25
     },{
-        // xtype : "numberfield", 
-        // name : "cu_ta", 
-        // fieldLabel : "应收款余额", 
-        // allowBlank : true, 
-        // readOnly:true,
-        // editable:false,
-        // columnWidth : 0.25     
+        xtype : "textfield", 
+        name : "cu_sellername", 
+        fieldLabel : "业务员", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "cu_1", 
+        fieldLabel : "纳税人识别号", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "cu_2", 
+        fieldLabel : "开户银行", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "cu_3", 
+        fieldLabel : "银行账户", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
     },{
         xtype:'textfield',
         name : "cu_uu", 
         fieldLabel : "客户UU", 
         allowBlank : true, 
         columnWidth : 0.25
+    },{
+        xtype:'textfield',
+        name : "cu_leftamount", 
+        fieldLabel : "应收款余额", 
+        allowBlank : true, 
+        readOnly:true,
+        ignore:true,
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "createTime", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        hidden:true,
+        columnWidth : 0
     },{  
         xtype : "datefield", 
         name : "updateTime", 
         fieldLabel : "更新时间", 
         allowBlank : true, 
-        columnWidth : 0.25
+        hidden:true,
+        columnWidth : 0
     }, {
         height: 169,
         xtype : "detailGridField", 
@@ -158,6 +203,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 xtype : "numbercolumn"
             },
             {
+                allowBlank:false,
                 text : "联系人", 
                 editor : {
                     xtype : "textfield"
@@ -167,16 +213,18 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null
             },
             {
+                allowBlank:false,
                 text : "电话", 
                 editor : {
                     hideTrigger:true,
-                    xtype : "numberfield"
+                    xtype : "textfield"
                 },
                 dataIndex : "cc_tel", 
                 xtype : "", 
                 items : null
             },
             {
+                allowBlank:false,
                 text : "微信/QQ", 
                 editor : {
                     xtype : "textfield"
@@ -262,6 +310,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 xtype : "numbercolumn"
             },
             {
+                allowBlank:false,
                 text : "送货地址", 
                 editor : {
                     xtype : "textfield"
@@ -271,6 +320,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null
             },  
             {
+                allowBlank:false,
                 text : "联系人", 
                 editor : {
                     xtype : "textfield"
@@ -280,9 +330,10 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 items : null   
             },
             {
+                allowBlank:false,
                 text : "联系电话", 
                 editor : {
-                    xtype : "numberfield",
+                    xtype : "textfield",
                     hideTrigger:true,
                 },
                 dataIndex : "ca_phone", 
@@ -348,16 +399,9 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype: 'button',
         text: '保存',
         handler: 'onSave',
-        // bind: {
-        //     // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
-        //     disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
-        // }
     }, {
         xtype: 'button',
         text: '删除',
-        // bind: {
-        //     hidden: '{deleteHidden || ' + me._statusCodeField + '=="' + me.auditTexts.auditCode + '"}'
-        // },
         handler: 'delete'
     }, {
         xtype: 'button',
@@ -371,7 +415,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         auditText: '已关闭',
         unAuditCode: 'OPEN',
         unAuditText: '已开启',
-        auditBtnText: '关闭',
+        auditBtnText: '禁用',
         unAuditBtnText: '启用',
     }
 });

+ 30 - 7
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -178,12 +178,35 @@ Ext.define('saas.view.document.product.FormPanel', {
         columnWidth : 0.25
     }],
 
+    defaultButtons:[{
+        cls: 'x-formpanel-btn-orange',
+        xtype: 'button',
+        text: '新增',
+        bind: {
+            hidden: '{!id}'
+        },
+        handler: 'add'
+    }, {
+        xtype: 'button',
+        text: '保存',
+        handler: 'onSave',
+    }, {
+        xtype: 'button',
+        text: '删除',
+        handler: 'delete'
+    }, {
+        xtype: 'button',
+        bind: {
+            text: '{auditBtnText}'
+        },
+        handler: "auditBtnClick",
+    }],
     auditTexts: {
-        auditCode: 'OPEN',
-        auditText: '已开启',
-        unAuditCode: 'CLOSE',
-        unAuditText: '已关闭',
-        auditBtnText: '启用',
-        unAuditBtnText: '关闭',
-    },
+        auditCode: 'CLOSE',
+        auditText: '已关闭',
+        unAuditCode: 'OPEN',
+        unAuditText: '已开启',
+        auditBtnText: '用',
+        unAuditBtnText: '启用',
+    }
 });

+ 2 - 1
frontend/saas-web/app/view/document/vendor/FormModel.js

@@ -3,7 +3,8 @@ Ext.define('saas.view.document.vendor.FormModel', {
     alias: 'viewmodel.document-vendor-formpanel',
 
     data: {
-        id: 0
+        id: 0,
+        ve_begindate:new Date()
     },
 
     formulas:{

+ 80 - 23
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -33,7 +33,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         name: 've_name',
         fieldLabel: '供应商名称',
         allowBlank: false,
-        columnWidth: 0.25
+        columnWidth: 0.5
     },{
         xtype: 'textfield',
         name: 've_code',
@@ -41,7 +41,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank: true,
         columnWidth: 0.25
     },{
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 've_status',
         fieldLabel: '状态',
         allowBlank: true,
@@ -82,10 +82,12 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         name : "createTime", 
         fieldLabel : "创建时间", 
         allowBlank : true, 
-        columnWidth : 0.25
+        hidden:true,
+        columnWidth : 0
     },{
         xtype : "datefield", 
         name : "ve_begindate", 
+        format:'Y-m-d',
         fieldLabel : "期初日期", 
         allowBlank : true, 
         columnWidth : 0.25  
@@ -103,6 +105,13 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         fieldLabel : "期初预收", 
         allowBlank : true, 
         columnWidth : 0.25    
+    },{
+        xtype : "numberfield", 
+        name : "ve_taxrate", 
+        hideTrigger:true,
+        fieldLabel : "税率", 
+        allowBlank : false, 
+        columnWidth : 0.25   
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
@@ -111,19 +120,32 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25      
     },{
-        xtype : "numberfield", 
-        name : "ve_taxrate", 
-        fieldLabel : "税率", 
-        allowBlank : false, 
-        columnWidth : 0.25   
+        xtype : "textfield", 
+        name : "ve_1", 
+        fieldLabel : "纳税人识别号", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
     },{
-        // xtype : "numberfield", 
-        // name : "ve_ta", 
-        // fieldLabel : "应收款余额", 
-        // allowBlank : true, 
-        // readOnly:true,
-        // editable:false,
-        // columnWidth : 0.25     
+        xtype : "textfield", 
+        name : "ve_2", 
+        fieldLabel : "开户银行", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "ve_3", 
+        fieldLabel : "银行账户", 
+        ignore:true,
+        editable:false,
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
     },{
         xtype:'textfield',
         name : "ve_uu", 
@@ -135,7 +157,16 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         name : "updateTime", 
         fieldLabel : "更新时间", 
         allowBlank : true, 
-        columnWidth : 0.25
+        hidden:true,
+        columnWidth : 0.25  
+    },{  
+        xtype : "numberfield", 
+        name : "ve_leftamount", 
+        fieldLabel : "应付款金额", 
+        allowBlank : true, 
+        readOnly:true,
+        ignore:true,
+        columnWidth : 0.25  
     }, {
         xtype : "detailGridField", 
         storeModel:'saas.model.document.vendorcontact',
@@ -156,6 +187,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 xtype : "numbercolumn"
             },
             {
+                allowBlank:false,
                 text : "联系人", 
                 editor : {
                     xtype : "textfield"
@@ -164,6 +196,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 xtype : "", 
             },
             {
+                allowBlank:false,
                 text : "电话", 
                 editor : {
                     hideTrigger:true,
@@ -173,6 +206,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 xtype : "", 
             },
             {
+                allowBlank:false,
                 text : "微信/QQ", 
                 editor : {
                     xtype : "textfield"
@@ -237,12 +271,35 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         }
     ],
 
+    defaultButtons:[{
+        cls: 'x-formpanel-btn-orange',
+        xtype: 'button',
+        text: '新增',
+        bind: {
+            hidden: '{!id}'
+        },
+        handler: 'add'
+    }, {
+        xtype: 'button',
+        text: '保存',
+        handler: 'onSave',
+    }, {
+        xtype: 'button',
+        text: '删除',
+        handler: 'delete'
+    }, {
+        xtype: 'button',
+        bind: {
+            text: '{auditBtnText}'
+        },
+        handler: "auditBtnClick",
+    }],
     auditTexts: {
-        auditCode: 'OPEN',
-        auditText: '已开启',
-        unAuditCode: 'CLOSE',
-        unAuditText: '已关闭',
-        auditBtnText: '启用',
-        unAuditBtnText: '关闭',
-    },
+        auditCode: 'CLOSE',
+        auditText: '已关闭',
+        unAuditCode: 'OPEN',
+        unAuditText: '已开启',
+        auditBtnText: '用',
+        unAuditBtnText: '启用',
+    }
 });

+ 1 - 150
frontend/saas-web/app/view/sys/config/FormPanelController.js

@@ -5,48 +5,6 @@ Ext.define('saas.view.sys.config.FormPanelController', {
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     FormUtil: Ext.create('saas.util.FormUtil'),
 
-    auditBtnClick: function() {
-        var me = this,
-        form = me.getView(),
-        statusCodeField = form._statusCodeField,
-        viewModel = me.getViewModel(),
-        status = viewModel.get(statusCodeField);
-
-        status == 'AUDITED' ? me.unAudit() : me.audit();
-    },
-
-    add: function(){
-        var form = this.getView();
-        var id = form.xtype + '-add';
-        openTab(form.xtype,'新增' + form._title, id);
-    },
-    
-    delete: function(){
-        var me = this;
-        var form = this.getView();
-        var viewModel = me.getViewModel();
-        var id = viewModel.get(form._idField);
-        var code = viewModel.get(form._codeField);
-        if(id&&id.value!=0){
-            me.BaseUtil.request({
-                url: form._deleteUrl+id,
-                method: 'POST',
-            })
-            .then(function(localJson) {
-                if(localJson.success){
-                    var mainTab = Ext.getCmp('main-tab-panel');
-                    mainTab.getActiveTab().close();
-                    //解析参数
-                    showToast('删除成功');
-                }
-            })
-            .catch(function(res) {
-                console.error(res);
-                showToast('删除失败: ' + res.message);
-            });
-        }
-    },
-
     onSave: function() {
         var me = this,
         form = this.getView();
@@ -111,113 +69,6 @@ Ext.define('saas.view.sys.config.FormPanelController', {
             console.error(res);
             showToast('保存失败: ' + res.message);
         });
-    },
-
-    audit: function(){
-        var me = this,
-        form = this.getView(),
-        detailCount = form.detailCount,
-        viewModel = me.getViewModel(),
-        modelData = viewModel.getData();
-
-        var valid = form.isValid();
-
-        if(!valid) {
-            showToast('表单校验有误,请检查');
-            return false;
-        }
-        
-        if(form.getForm().wasDirty==false){
-            showToast('未修改数据,请修改后保存');
-            return false;
-        }
-        //form里面数据
-        var formData = form.getFormData();
-        var params = {
-            main: formData.main
-        };
-
-        for(var i = 0; i < detailCount; i++) {
-            params['items' + ( i + 1)] = formData['detail' + i];
-        }
-
-        // 只有一个从表时从表字段改为items
-        if(detailCount == 1) {
-            params.items = params.items1;
-            delete params.items1;
-        }
-
-        me.BaseUtil.request({
-            url: form._auditUrl,
-            params: JSON.stringify(params),
-            method: 'POST',
-        })
-        .then(function(localJson) {
-            if(localJson.success){
-                // 未保存直接审核会返回id
-                if(localJson.data) {
-                    var id = localJson.data.id;
-                    var code = localJson.data.code;
-                    
-                    form.initId = id;
-
-                    var newId = form.xtype + '-' + id;
-                    var newTitle = form._title + '(' + code + ')';
-
-                    refreshTabTitle(newId, newTitle);
-                }
-                form.FormUtil.loadData(form);
-                form.setEditable(false);
-                showToast('审核成功');
-            }
-        })
-        .catch(function(res) {
-            console.error(res);
-            showToast('审核失败: ' + res.message);
-        });
-    },
-    unAudit: function() {
-        var me = this;
-        var form = this.getView();
-        var viewModel = me.getViewModel();
-        var id = viewModel.get(form._idField);
-        var code = viewModel.get(form._codeField);
-        if(id&&id.value!=0){
-            me.BaseUtil.request({
-                url: form._unAuditUrl+id,
-                method: 'POST',
-            })
-            .then(function(localJson) {
-                if(localJson.success){
-                    //解析参数
-                    showToast('反审核成功');
-                    form.FormUtil.loadData(form);
-                }
-            })
-            .catch(function(res) {
-                console.error(res);
-                showToast('反审核失败: ' + res.message);
-            });
-        }
-    },
-    codeEditorBlur: function(e) {
-        var me = this,
-        viewModel = me.getViewModel(),
-        targetEl = event.target,
-        faEl = targetEl.getElementsByClassName('fa')[0];
-
-        if(faEl && faEl.classList.contains('fa-check-circle')) {
-            // 处理重复触发事件
-            // viewModel.set('base.codeEditable', false);
-        }else {
-            viewModel.set('base.codeEditable', false);
-        }
-    },
-    codeEditorClick: function() {
-        var me = this,
-        viewModel = me.getViewModel(),
-        codeEditable = viewModel.get('base.codeEditable');
-
-        viewModel.set('base.codeEditable', !codeEditable);
     }
+
 });