Browse Source

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

rainco 7 years ago
parent
commit
b980b662fe
32 changed files with 5421 additions and 5271 deletions
  1. 33 11
      frontend/saas-portal-web/src/components/conenter/addenterprise.vue
  2. 1 1
      frontend/saas-portal-web/src/components/conenter/details.vue
  3. 16 8
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  4. 10 6
      frontend/saas-portal-web/src/components/conenter/home.vue
  5. 1 4
      frontend/saas-portal-web/src/components/conenter/invitation.vue
  6. 24 4
      frontend/saas-portal-web/static/css/gongsi.css
  7. 4 0
      frontend/saas-portal-web/static/css/main.css
  8. BIN
      frontend/saas-portal-web/static/img/Pattern@2x.png
  9. BIN
      frontend/saas-portal-web/static/img/Pattern@2x@2x.png
  10. 2 14
      frontend/saas-web/app/util/FormUtil.js
  11. 3 3
      frontend/saas-web/app/view/core/form/FormPanel.js
  12. 228 223
      frontend/saas-web/app/view/document/bom/FormPanel.js
  13. 364 359
      frontend/saas-web/app/view/document/customer/FormPanel.js
  14. 362 356
      frontend/saas-web/app/view/document/product/FormPanel.js
  15. 302 297
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  16. 3 3
      frontend/saas-web/app/view/main/Main.js
  17. 226 211
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  18. 169 163
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  19. 187 184
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  20. 365 349
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  21. 344 327
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  22. 381 378
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  23. 382 375
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  24. 17 17
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  25. 391 385
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  26. 402 396
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  27. 295 300
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  28. 362 360
      frontend/saas-web/app/view/stock/make/FormPanel.js
  29. 284 282
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  30. 258 254
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  31. 1 1
      frontend/saas-web/app/view/sys/maxnumbers/Window.js
  32. 4 0
      frontend/saas-web/app/view/viewport/ViewportModel.js

+ 33 - 11
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -15,13 +15,13 @@
                     <ul style="padding:0;text-align: center;">
                         <li>
                             <span class="qy-biaoti"><span class="xingxing">*</span>企业名称</span>
-                            <input autofocus class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写企业全称">
+                            <input autofocus class="inpind" ref="qyname" @change= "spaceName" type="text" :class= "{showborder:qymingzi&&isspaceName&&isspaceNameempty}" placeholder="请填写企业全称">
                             <div class="qy-Tips Tips-buttom"><span ref="qyno" style="color:red"></span></div>
                         </li>
                         <li>
                             <span class="qy-biaoti">所属行业</span>
-                            <select ref="qyindustry" style="width:35%;height: 32px;padding-left:5px" name="selectAge" id="selectAge">   
-                                <option value="">请选择所属行业</option>
+                            <select @change="industry" ref="qyindustry" class="industry border" style="padding-left:5px" name="selectAge" id="selectAge">   
+                                <option value="" disabled selected hidden>请选择所属行业</option>
                                 <option value="贸易零售">贸易零售</option>
                                 <option value="制造加工">制造加工</option>
                                 <option value="服务业">服务业</option>
@@ -43,7 +43,7 @@
                         </li>
                         <li>
                             <span class="qy-biaoti"><span class="xingxing">*</span>企业地址</span>
-                            <input ref="address" @change="address" class="inpind" type="text" placeholder="输入企业详细地址">
+                            <input ref="address" @change="address" class="inpind" type="text" :class= "{showborder:isaddress&&isaddressname}" placeholder="输入企业详细地址">
                             <!-- <div class="addbiaoqian">
                                 <v-distpicker @selected= 'selected' @province= 'qyprovince' :placeholders= 'placeholder'></v-distpicker>
                                 <input ref="address" @change="address" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
@@ -54,13 +54,13 @@
                         </li>
                         <li>
                             <span class="qy-biaoti"><span class="xingxing">*</span>您的姓名</span>
-                            <input class="inpind" @change= "yzusername" ref="name" type="text" value="" placeholder="请输入姓名">
+                            <input class="inpind" @change= "yzusername" ref="name" :class= "{showborder:isname&&isnameempty}" type="text" value="" placeholder="请输入姓名">
                             <div class="qy-Tips Tips-buttom"><span ref="usname" style="color:red"></span></div>
                         </li>
-                        <li><span class="qy-biaoti">手机号</span><span class="qy-mobile">{{mytoken.account.mobile}}</span></li>
+                        <li><span class="qy-biaoti">手机号</span><span class="qy-mobile industry">{{mytoken.account.mobile}}</span></li>
                         <li style="margin-bottom: 64px;">
                             <span class="qy-biaoti">邮箱</span>
-                            <input class="inpind" @change="email" ref="email" type="email" value="">
+                            <input class="inpind" @change="email" ref="email" :class= "{showborder:isemail}" type="email" value="">
                             <div class="qy-Tips Tips-buttom"><span style="color:red" v-html="Email"></span></div>
                         </li>
                         <li>
@@ -126,7 +126,9 @@ import { setTimeout, clearTimeout } from 'timers';
                 isaddress: false,//公司地址验证
                 isaddressname: false,//公司地址是否为空
                 isname: true,//姓名验证
+                isnameempty:false,//姓名是否为空
                 isspaceName: false,//公司名验证
+                isspaceNameempty:false,//公司名是否为空
                 isemail: true,//验证邮箱
                 // disabled: true,
                 isadd: false,//添加成功弹窗
@@ -145,20 +147,33 @@ import { setTimeout, clearTimeout } from 'timers';
                 admin:null,
                 isgsname:false,
                 arr:[],
-                times:null
+                times:null,
             }
         },
         components:{
             // VDistpicker
         },
         mounted(){
-            this.$refs.name.value = this.mytoken.account.realname;
-            this.$refs.email.value = this.mytoken.account.email;
+            if (this.mytoken.account.realname) {
+                this.$refs.name.value = this.mytoken.account.realname;
+                this.isnameempty = true;
+            } else {
+                this.$refs.name.value = '';
+            };
+            if (this.mytoken.account.email) {
+                this.$refs.email.value = this.mytoken.account.email;
+            } else {
+                this.$refs.email.value = '';
+            }
         },
         methods: {
             tabwatch(i){
                 this.nowindex = i;
             },
+            // 行业
+            industry(){
+                this.$refs.qyindustry.style.border = '1px solid #1E88F5'
+            },
             //取消添加企业
             tjquxiao(){
                 document.documentElement.scrollTop = 0;
@@ -169,7 +184,9 @@ import { setTimeout, clearTimeout } from 'timers';
                 let qyname = this.$refs.qyname.value.replace(/\s+/g, "");//公司名字过滤空格
                 if(qyname == ''){
                     this.$refs.qyno.innerHTML = ' <img style="width:14px" src="/static/img/warning.png" alt=""> 企业名称不能为空';
+                    this.isspaceNameempty = false;
                 } else {
+                    this.isspaceNameempty = true;
                     if (this.reg.test(qyname)) {
                         this.$refs.qyno.innerHTML = ' <img style="width:14px" src="/static/img/warning.png" alt=""> 不能包含符号等非法字符';
                         this.isspaceName = false;
@@ -242,7 +259,9 @@ import { setTimeout, clearTimeout } from 'timers';
                 let name = this.$refs.name.value.replace(/\s+/g, "");//姓名过滤空格
                 if (name == '') {
                     this.$refs.usname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 个人姓名不能为空';
+                    this.isnameempty = false;
                 } else {
+                    this.isnameempty = true;
                     if (this.reg.test(name)) {
                         this.$refs.usname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 不能包含符号等非法字符';
                         this.isname = false;
@@ -459,6 +478,9 @@ import { setTimeout, clearTimeout } from 'timers';
     padding-bottom: 1px;
     border-radius: 4px 4px 0 0;
     /* margin-top: -30px; */
+    border: 1px solid #EEEEEE;
+    box-shadow: 0 20px 60px 10px rgba(13,37,62,0.05);
+    border-radius: 4px;
 }
 .tj-up li {
     margin-bottom: 26px;
@@ -497,6 +519,7 @@ import { setTimeout, clearTimeout } from 'timers';
 }
 .qyactive {
     border-bottom: 3px solid  #1E88F5;
+    color: #243A52;
 }
 .qy-conent {
     display: none;
@@ -532,7 +555,6 @@ import { setTimeout, clearTimeout } from 'timers';
 }
 .qy-mobile {
     display: inline-block;
-    width: 35%;
     text-align: left;
 }
 .qy-anniu > span {

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/details.vue

@@ -48,7 +48,7 @@
                         </li>
                         <li>
                             <span class="qy-biaoti">所属行业</span>
-                            <select ref="qyindustry" style="width:35%;height: 32px" name="selectAge" id="selectAge">   
+                            <select ref="qyindustry" class="industry border" name="selectAge" id="selectAge">   
                                 <option value="">请选择所属行业</option>
                                 <option value="贸易零售">贸易零售</option>
                                 <option value="制造加工">制造加工</option>

+ 16 - 8
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -33,7 +33,7 @@
                         </a>
                     </h1>
                 </div>
-            <div class="collapse navbar-collapse navbar-right" role="navigation" style="position: absolute;left: 38%;">
+            <div class="collapse navbar-collapse navbar-right" role="navigation" style="position: absolute;left: 35%;">
             <ul @click="gohome" id="nav" class="nav navbar-nav menu">
                 <li><router-link to="/home"><a @click="setTurnHome"><span style="color: white">首页</span></a></router-link></li>
                 <li><a href="#" @click="feature"><span>特色</span></a></li>
@@ -453,6 +453,10 @@ import { setTimeout } from 'timers';
 .div {
     padding-top: 140px;
     background: #FDFDFD;
+    background-image: url(/static/img/Pattern@2x@2x.png);
+    /* background-size: 110%; */
+    padding-bottom: 1px;
+    /* background-position-y: 80px; */
 }
 .heigh {
     height: 500px;
@@ -461,22 +465,26 @@ import { setTimeout } from 'timers';
     margin-bottom: 100px;
 }
 
-
+/* ele常见问题 */
 .el-menu-demo {
-    border-bottom: 0;
+    border-bottom: 0 !important;
 }
 .el-menu-demo >>> div {
     font-size: 16px !important;
-    background: #1C1F48;
+    background: #1C1F48 !important;
 }
 .el-menu-demo >>> .el-submenu__title:hover {
     background: #1C1F48 !important;
 }
 .el-menu-demo >>> .el-submenu__title {
-    padding: 0px 0px 0px 10px;
-    height: 48px;
-    line-height: 48px;
-    border-bottom: 2px solid #409EFF;
+    padding: 0px 0px 0px 10px !important;
+    height: 48px !important;
+    line-height: 48px !important;
+    border-bottom: 0 !important;
+}
+.el-menu-item:hover {
+    /* color: green !important; */
+    background: #1E88F5 !important;
 }
 .modifyname {
     margin-left: 80px;

+ 10 - 6
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -42,7 +42,7 @@
                     </a>
                 </h1>
             </div>
-        <div class="collapse navbar-collapse navbar-right" role="navigation" style="position: absolute;left: 38%;">
+        <div class="collapse navbar-collapse navbar-right" role="navigation" style="position: absolute;left: 35%;">
           <ul @click="gohome" id="nav" class="nav navbar-nav menu">
             <li><a href="#" @click="setTurnHome"><span>首页</span></a></li>
             <li>
@@ -490,22 +490,26 @@
 }
 /* ele常见问题 */
 .el-menu-demo {
-    border-bottom: 0;
+    border-bottom: 0 !important;
 }
 .el-menu-demo >>> div {
     font-size: 16px !important;
-    background: #1C1F48;
+    background: #1C1F48 !important;
     border-bottom: 0 !important;
 }
 .el-menu-demo >>> .el-submenu__title:hover {
     background: #1C1F48 !important;
 }
 .el-menu-demo >>> .el-submenu__title {
-    padding: 0px 0px 0px 10px;
-    height: 48px;
-    line-height: 48px;
+    padding: 0px 0px 0px 10px !important;
+    height: 48px !important;
+    line-height: 48px !important;
     border-bottom: 0 !important;
 }
+.el-menu-item:hover {
+    /* color: green !important; */
+    background: #1E88F5 !important;
+}
 /* 体验 */
 .tiyan {
   position: fixed;

+ 1 - 4
frontend/saas-portal-web/src/components/conenter/invitation.vue

@@ -221,11 +221,8 @@ import { setTimeout } from 'timers';
                 let url1 = window.location.href;
                 let param = url1.substring(url1.lastIndexOf('=')+1, url1.length);
                 this.$ajax({
-                    url: this.$url.api+"/api/commons/share/valid/param",
+                    url: this.$url.api+"/api/commons/share/valid/param?param="+param,
                     method:'POST',
-                    data:{
-                        param:param
-                    },
                     headers:{
                         "Authorization":Session.getToken(),
                         "Content-Type":"application/x-www-form-urlencoded",

+ 24 - 4
frontend/saas-portal-web/static/css/gongsi.css

@@ -16,9 +16,15 @@
 .over {
     overflow: hidden;
 }
+input::-webkit-input-placeholder {
+    color: #BCC8D8; 
+} 
+
 /* ele常见问题 ---------------------- */
 .el-menu--popup {
-    min-width: 120px !important;
+    min-width: 96px !important;
+    padding: 0 !important;
+    text-align: center !important;
 }
 /* 弹窗 -----------------------------------------------*/
 .tanchuang {
@@ -238,9 +244,22 @@
     text-align: center;
 }
 .qy-conent input {
-    border: 1px solid #1E88F5;
-    width: 35%;
+    /* border: 1px solid #1E88F5; */
+    width: 37%;
     height: 32px;
+    box-shadow: 0 1px 4px 0 #BCC8D8;
+    border: 0;
+}
+.showborder {
+    border: 1px solid #1E88F5 !important;
+}
+.industry {
+    width: 37%;
+    height: 32px;
+}
+.border {
+    box-shadow: 0 1px 4px 0 #BCC8D8;
+    border: 0;
 }
 .tj-biaoqian {
     border: 1px dashed #7CBAFA;
@@ -344,7 +363,6 @@
     box-shadow: 0 20px 60px 8px #F4F8FC;
     border-radius: 4px;
     margin-bottom: 25px;
-    /* margin-top: -30px; */
 }
 .qy-title {
     background: #F4F8FC;
@@ -365,6 +383,8 @@
     padding: 0;
     width: 50%;
     text-align: center;
+    border-bottom: 1px solid #BCC8D8;
+    color: #BCC8D8;
 }
 .qy-xiugai {
     font-family: PingFangSC-Regular;

+ 4 - 0
frontend/saas-portal-web/static/css/main.css

@@ -390,6 +390,7 @@ main > section {
     font-size: 14px;
     color: #fff;
     cursor: pointer;
+    opacity: 0.9;
 }
 .footer-section ul>li:hover a{
     text-decoration: underline ;
@@ -516,6 +517,9 @@ h1.navbar-brand {
     text-transform: uppercase;
     /* font-weight: bold; */
 }
+.navbar-nav>li>a {
+    padding: 15px 20px 3px 20px !important;
+}
 .menu li a {
     display: inline-block;
 }

BIN
frontend/saas-portal-web/static/img/Pattern@2x.png


BIN
frontend/saas-portal-web/static/img/Pattern@2x@2x.png


+ 2 - 14
frontend/saas-web/app/util/FormUtil.js

@@ -4,6 +4,8 @@ Ext.define('saas.util.FormUtil', {
 
         // 请求页面组件接口模板
         baseUrl: '/api/ui/co_view/config?name={viewName}',
+        // 保存自定义配置
+        // saveUrl: '/api/ui/co_view/config?name={viewName}',
         // 模板替换正则
         urlRe: /(.*){viewName}(.*)/g,
 
@@ -13,8 +15,6 @@ Ext.define('saas.util.FormUtil', {
             
             defaultItems = form.defaultItems;
 
-            me.clearItems(defaultItems);
-
             me.applyCusItemConfig(form)
             .then(function(res) {
                 if(res.success) {
@@ -50,18 +50,6 @@ Ext.define('saas.util.FormUtil', {
 
         },
 
-        clearItems: function(items) {
-            for(let i = items.length - 1; i >= 0; i--) {
-                let item = items[i];
-                if(item.group == '_nogroup') {
-                    item.group = undefined;
-                }
-                if(item.xtype == 'container') {
-                    items.splice(i, 1);
-                }
-            }
-        },
-
         /**
          * 获得form的客户自定义字段配置
          * @param form: form组件

+ 3 - 3
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -20,7 +20,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     bodyPadding: '8 12 8 12',
 
     fieldDefaults: {
-        margin: '0 0 10 10',
+        margin: '0 0 10 0',
         labelAlign: 'right',
         labelWidth: 90,
         columnWidth: 0.25,
@@ -226,8 +226,8 @@ Ext.define('saas.view.core.form.FormPanel', {
         viewModel.set(codeField, '');
         viewModel.set('createTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
         viewModel.set('updateTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
-        viewModel.set('creatorId', saas.util.BaseUtil.getCurrentUser().id);
-        viewModel.set('creatorName', saas.util.BaseUtil.getCurrentUser().realname);
+        viewModel.set('creatorId', viewModel.get('account').id);
+        viewModel.set('creatorName', viewModel.get('account').realname);
 
         if (statusCodeField) {
             var o = {};

+ 228 - 223
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -22,234 +22,239 @@ Ext.define('saas.view.document.bom.FormPanel', {
     _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
     codeInHeader: false,
 
-    defaultButtons:[{
-        cls: 'x-formpanel-btn-blue',
-        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",
-    }],
-
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-    },{
-        xtype: 'hidden',
-        name: 'bo_motherid',
-        fieldLabel: '产品id'
-    },{
-        xtype : "productDbfindTrigger", 
-        name: 'bo_mothercode',
-        fieldLabel: '产品编号',
-        allowBlank: false
-    },{
-        xtype: 'textfield',
-        name: 'pr_brand',
-        fieldLabel: '品牌',
-        readOnly:true,
-    },{
-        xtype: 'textfield',
-        name: 'bo_mothername',
-        fieldLabel: '产品名称',
-        readOnly:true,
-        allowBlank: false
-    },{
-        xtype: 'textfield',
-        name: 'pr_orispeccode',
-        fieldLabel: '产品型号',
-        readOnly:true,
-    },{
-        xtype: 'textfield',
-        name: 'pr_spec',
-        fieldLabel: '产品规格',
-        readOnly:true,
-        ignore:true
-    },{
-        xtype: 'textfield',
-        name: 'bo_version',
-        fieldLabel: '版本号',
-        allowBlank: false
-    }, {
-        xtype : "detailGridField",
-        detnoColumn: 'bd_detno',
-        showCount: false,
-        storeModel:'saas.model.document.bomdetail',
-        deleteDetailUrl:'/api/document/bom/deleteDetail',
-        columns : [
-            {
-                text : "ID", 
-                dataIndex : "id", 
-                hidden : true, 
-                xtype : "numbercolumn"
-            }, {
-                text : "关联ID", 
-                dataIndex : "bd_bomid", 
-                hidden : true,  
-                xtype : "numbercolumn"
-            }, {
-                allowBlank:false,
-                text : "物料编号", 
-                dataIndex : "bd_soncode", 
-                width : 150, 
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            }, {
-                allowBlank:false,
-                text : "物料ID", 
-                hidden : true, 
-                dataIndex : "bd_sonid", 
-            }, {
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultButtons:[{
+                cls: 'x-formpanel-btn-blue',
+                xtype: 'button',
+                text: '新增',
+                bind: {
+                    hidden: '{!id}'
+                },
+                handler: 'add'
             }, {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: 'button',
+                text: '保存',
+                handler: 'onSave'
             }, {
-                text : "物料名称", 
-                width : 150.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: 'button',
+                text: '删除',
+                handler: 'delete'
             }, {
-                allowBlank:false,
-                text : "用量", 
-                width : 110, 
-                xtype : "numbercolumn",
-                dataIndex : "bd_baseqty",
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0,
-                    maxLength: 10,
-                    align: 'end'
+                xtype: 'button',
+                bind: {
+                    text: '{auditBtnText}'
                 },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
+                handler: "auditBtnClick",
+            }],
+        
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+            },{
+                xtype: 'hidden',
+                name: 'bo_motherid',
+                fieldLabel: '产品id'
+            },{
+                xtype : "productDbfindTrigger", 
+                name: 'bo_mothercode',
+                fieldLabel: '产品编号',
+                allowBlank: false
+            },{
+                xtype: 'textfield',
+                name: 'pr_brand',
+                fieldLabel: '品牌',
+                readOnly:true,
+            },{
+                xtype: 'textfield',
+                name: 'bo_mothername',
+                fieldLabel: '产品名称',
+                readOnly:true,
+                allowBlank: false
+            },{
+                xtype: 'textfield',
+                name: 'pr_orispeccode',
+                fieldLabel: '产品型号',
+                readOnly:true,
+            },{
+                xtype: 'textfield',
+                name: 'pr_spec',
+                fieldLabel: '产品规格',
+                readOnly:true,
+                ignore:true
+            },{
+                xtype: 'textfield',
+                name: 'bo_version',
+                fieldLabel: '版本号',
+                allowBlank: false
             }, {
-                text : "单位", 
-                dataIndex : "bd_unit", 
-                width : 65 
+                xtype : "detailGridField",
+                detnoColumn: 'bd_detno',
+                showCount: false,
+                storeModel:'saas.model.document.bomdetail',
+                deleteDetailUrl:'/api/document/bom/deleteDetail',
+                columns : [
+                    {
+                        text : "ID", 
+                        dataIndex : "id", 
+                        hidden : true, 
+                        xtype : "numbercolumn"
+                    }, {
+                        text : "关联ID", 
+                        dataIndex : "bd_bomid", 
+                        hidden : true,  
+                        xtype : "numbercolumn"
+                    }, {
+                        allowBlank:false,
+                        text : "物料编号", 
+                        dataIndex : "bd_soncode", 
+                        width : 150, 
+                        editor : {
+                            displayField : "display", 
+                            editable : true, 
+                            format : "", 
+                            hideTrigger : false, 
+                            maxLength : 100.0, 
+                            minValue : null, 
+                            positiveNum : false, 
+                            queryMode : "local", 
+                            store : null, 
+                            valueField : "value", 
+                            xtype : "productMultiDbfindTrigger"
+                        }
+                    }, {
+                        allowBlank:false,
+                        text : "物料ID", 
+                        hidden : true, 
+                        dataIndex : "bd_sonid", 
+                    }, {
+                        text: 'model映射需要',
+                        dataIndex: 'productDTO',
+                        hidden: true,
+                    }, {
+                        text : "品牌", 
+                        width : 100.0, 
+                        dataIndex : "pr_brand",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    }, {
+                        text : "物料名称", 
+                        width : 150.0, 
+                        dataIndex : "pr_detail",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },
+                    {
+                        text : "型号", 
+                        width : 200.0, 
+                        dataIndex : "pr_orispeccode",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },{
+                        text : "规格", 
+                        width : 200, 
+                        dataIndex : "pr_spec",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    }, {
+                        allowBlank:false,
+                        text : "用量", 
+                        width : 110, 
+                        xtype : "numbercolumn",
+                        dataIndex : "bd_baseqty",
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 3,
+                            minValue:0,
+                            maxLength: 10,
+                            align: 'end'
+                        },
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 3, false);
+                        }
+                    }, {
+                        text : "单位", 
+                        dataIndex : "bd_unit", 
+                        width : 65 
+                    }, {
+                        text : "替代料", 
+                        dataIndex : "bd_replace", 
+                        width : 250, 
+                        editor : {
+                            displayField : "display", 
+                            editable : true, 
+                            format : "", 
+                            hideTrigger : false, 
+                            maxLength : 100.0, 
+                            minValue : null, 
+                            positiveNum : false, 
+                            queryMode : "local", 
+                            store : null, 
+                            valueField : "value", 
+                            xtype : "productAddMultiDbfindTrigger"
+                        }
+                    }, {
+                        text : "备注", 
+                        dataIndex : "bd_remark",
+                        width : 250, 
+                        items : null,
+                        editor : {
+                            xtype : "textfield"
+                        },
+                    }]
             }, {
-                text : "替代料", 
-                dataIndex : "bd_replace", 
-                width : 250, 
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productAddMultiDbfindTrigger"
-                }
+                xtype: 'hidden',
+                name: 'bo_statuscode',
+                fieldLabel: '状态码',
+                readOnly:true,
+                defaultValue: ''
             }, {
-                text : "备注", 
-                dataIndex : "bd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
-            }]
-    }, {
-        xtype: 'hidden',
-        name: 'bo_statuscode',
-        fieldLabel: '状态码',
-        readOnly:true,
-        defaultValue: ''
-    }, {
-        xtype: 'textfield',
-        name: 'bo_status',
-        fieldLabel: '产品状态',
-        readOnly:true,
-        defaultValue: ''
-    },{  
-        xtype : "textfield", 
-        name : "creatorName", 
-        readOnly:true,
-        fieldLabel : "录入人"
-    },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入时间"
-    }],
-
-    auditTexts: {
-        auditCode: 'BANNED',
-        auditText: '已禁用',
-        unAuditCode: 'ENABLE',
-        unAuditText: '已启用',
-        auditBtnText: '禁用',
-        unAuditBtnText: '启用',
-    }
+                xtype: 'textfield',
+                name: 'bo_status',
+                fieldLabel: '产品状态',
+                readOnly:true,
+                defaultValue: ''
+            },{  
+                xtype : "textfield", 
+                name : "creatorName", 
+                readOnly:true,
+                fieldLabel : "录入人"
+            },{
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "录入时间"
+            }],
+        
+            auditTexts: {
+                auditCode: 'BANNED',
+                auditText: '已禁用',
+                unAuditCode: 'ENABLE',
+                unAuditText: '已启用',
+                auditBtnText: '禁用',
+                unAuditBtnText: '启用',
+            }
+        });
+        this.callParent(arguments);
+    },
 });

+ 364 - 359
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -22,368 +22,373 @@ Ext.define('saas.view.document.customer.FormPanel', {
 
     codeInHeader: false,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'cu_code',
-        fieldLabel: '客户编号',
-        allowBlank: false,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'cu_name',
-        fieldLabel: '客户名称',
-        allowBlank: false,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'cu_shortname',
-        fieldLabel: '客户简称',
-        columnWidth: 0.25,
-        hidden: true,
-        group: '基础信息',
-    },{
-        editable:false,
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/customerkind/getCombo',
-        name : "cu_type", 
-        fieldLabel : "客户类型", 
-        columnWidth : 0.25,
-        hiddenBtn:false,//true 则会关闭新增按钮功能,
-        group: '基础信息',
-        addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
-            var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
-                bind: {
-                    title: '新增客户类型'
-                },
-                dataKind:'customerkind',
-                belong:document.etc['customerkind'],
-                _parent:form,
-                _combo:this.ownerCmp,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }
-    },{
-        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", 
-        format:'Y-m-d',
-        fieldLabel : "期初日期", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        group: '交易信息',
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "cu_beginaramount", 
-        fieldLabel : "期初应收(元)", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        minValue:0,
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "cu_beginprerecamount", 
-        fieldLabel : "期初预收(元)", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        minValue:0,
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },   
-    },{
-        xtype:'textfield',
-        name : "cu_leftamount", 
-        fieldLabel : "应收余额(元)", 
-        allowBlank : true, 
-        readOnly:true,
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
-    },{
-        xtype : "numberfield", 
-        name : "cu_taxrate", 
-        fieldLabel : "税率(%)", 
-        allowBlank : false, 
-        columnWidth : 0.25,
-        minValue:0,
-        maxValue:100,
-        group: '交易信息',
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "cu_promisedays", 
-        fieldLabel : "结算天数", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision:0,
-        minValue:0,
-        group: '交易信息',
-    }, {
-        xtype : "hidden", 
-        name : "cu_sellerid", 
-        fieldLabel : "业务员id",
-        defaultValue:saas.util.BaseUtil.getCurrentUser().id,
-        group: '交易信息',
-    }, {
-        xtype : "hidden", 
-        name : "cu_sellercode", 
-        fieldLabel : "业务员code",
-        group: '交易信息',
-    }, {
-        xtype : "employeeDbfindTrigger", 
-        name : "cu_sellername", 
-        fieldLabel : "业务员",  
-        columnWidth : 0.25,
-        defaultValue:saas.util.BaseUtil.getCurrentUser().realname,
-        group: '交易信息',
-    },{
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "cu_credit", 
-        fieldLabel : "额度", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        minValue:0,
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
-    },{
-        xtype : "hidden", 
-        name : "cu_nsrzh", 
-        fieldLabel : "纳税人识别号", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "cu_bankaccount", 
-        fieldLabel : "开户银行", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden",  
-        name : "cu_bankcode", 
-        fieldLabel : "银行账户", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype:'hidden',
-        name : "cu_uu", 
-        fieldLabel : "客户UU", 
-        allowBlank : true, 
-        readOnly:true,
-        editable:false,
-        columnWidth : 0.25
-    },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    },{  
-        xtype : "datefield", 
-        name : "updateTime", 
-        fieldLabel : "更新时间", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    },{
-        fieldLabel : "备注", 
-        xtype:'textfield',
-        name : "cu_remark",
-        columnWidth : 1
-    }, {
-        xtype : "detailGridField", 
-        storeModel:'saas.model.document.customercontact',
-        detnoColumn: 'cc_detno',
-        showCount: false,
-        deleteDetailUrl:'/api/document/customer/deletecontact',
-        // minHeight:145,
-        emptyRows: 3,
-        columns : [
-            {
-                text : "ID", 
-                dataIndex : "id", 
-                hidden : true,  
-                xtype : "numbercolumn"
-            },
-            {
-                text : "关联ID", 
-                dataIndex : "cc_cuid", 
-                hidden : true,  
-                xtype : "numbercolumn"
-            },
-            {
-                allowBlank:false,
-                text : "联系人", 
-                editor : {
-                    xtype : "textfield"
-                },
-                dataIndex : "cc_name", 
-                width:110  
-            },
-            {
-                allowBlank:false,
-                text : "电话", 
-                editor : {
-                    // regex:/^1(3|4|5|7|8|9)\d{9}$/,
-                    // regexText:'请输入正确的手机号码',
-                    hideTrigger:true,
-                    xtype : "textfield"
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'cu_code',
+                fieldLabel: '客户编号',
+                allowBlank: false,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'cu_name',
+                fieldLabel: '客户名称',
+                allowBlank: false,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'cu_shortname',
+                fieldLabel: '客户简称',
+                columnWidth: 0.25,
+                hidden: true,
+                group: '基础信息',
+            },{
+                editable:false,
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/customerkind/getCombo',
+                name : "cu_type", 
+                fieldLabel : "客户类型", 
+                columnWidth : 0.25,
+                hiddenBtn:false,//true 则会关闭新增按钮功能,
+                group: '基础信息',
+                addHandler:function(b){
+                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                    var form = this.ownerCmp.ownerCt;
+                    this.dialog = form.getController().getView().add({
+                        xtype: 'document-kind-childwin',
+                        bind: {
+                            title: '新增客户类型'
+                        },
+                        dataKind:'customerkind',
+                        belong:document.etc['customerkind'],
+                        _parent:form,
+                        _combo:this.ownerCmp,
+                        record:null,
+                        session: true
+                    });
+                    this.dialog.show();
+                }
+            },{
+                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", 
+                format:'Y-m-d',
+                fieldLabel : "期初日期", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                group: '交易信息',
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "cu_beginaramount", 
+                fieldLabel : "期初应收(元)", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                minValue:0,
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-                dataIndex : "cc_tel", 
-                width:200 
-            },
-            {
-                allowBlank:true,
-                text : "微信/QQ", 
-                editor : {
-                    xtype : "textfield"
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "cu_beginprerecamount", 
+                fieldLabel : "期初预收(元)", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                minValue:0,
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
+                },   
+            },{
+                xtype:'textfield',
+                name : "cu_leftamount", 
+                fieldLabel : "应收余额(元)", 
+                allowBlank : true, 
+                readOnly:true,
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-                dataIndex : "cc_qq", 
-                width:110 
-            },
-            {
-                text : "邮箱", 
-                editor : {
-                    xtype : "textfield"
+            },{
+                xtype : "numberfield", 
+                name : "cu_taxrate", 
+                fieldLabel : "税率(%)", 
+                allowBlank : false, 
+                columnWidth : 0.25,
+                minValue:0,
+                maxValue:100,
+                group: '交易信息',
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "cu_promisedays", 
+                fieldLabel : "结算天数", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision:0,
+                minValue:0,
+                group: '交易信息',
+            }, {
+                xtype : "hidden", 
+                name : "cu_sellerid", 
+                fieldLabel : "业务员id",
+                defaultValue:saas.util.BaseUtil.getCurrentUser().id,
+                group: '交易信息',
+            }, {
+                xtype : "hidden", 
+                name : "cu_sellercode", 
+                fieldLabel : "业务员code",
+                group: '交易信息',
+            }, {
+                xtype : "employeeDbfindTrigger", 
+                name : "cu_sellername", 
+                fieldLabel : "业务员",  
+                columnWidth : 0.25,
+                defaultValue:saas.util.BaseUtil.getCurrentUser().realname,
+                group: '交易信息',
+            },{
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "cu_credit", 
+                fieldLabel : "额度", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                minValue:0,
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-                dataIndex : "cc_email", 
-                width:180 
-            },
-            {
-                text : "默认联系人", 
-                width:110 ,
-                dataIndex : "cc_default", 
-                xtype : "yncolumn"
-            }]
-    } ,{
-        xtype : "detailGridField", 
-        storeModel:'saas.model.document.customeraddress',
-        detnoColumn: 'ca_detno',
-        showCount: false,
-        deleteDetailUrl:'/api/document/customer/deleteaddress',
-        // height:145,
-        emptyRows: 3,
-        columns : [
-            {
-                text : "ID", 
-                dataIndex : "id", 
-                hidden : true, 
-                xtype : "numbercolumn"
-            },
-            {
-                text : "关联ID", 
-                dataIndex : "ca_cuid", 
-                hidden : true,  
-                xtype : "numbercolumn"
-            },
-            {
-                allowBlank:false,
-                text : "送货地址", 
-                editor : {
-                    xtype : "textfield"
-                },
-                dataIndex : "ca_address", 
-                width:300 
-            },  
-            {
-                allowBlank:true,
-                text : "联系人", 
-                editor : {
-                    xtype : "textfield"
+            },{
+                xtype : "hidden", 
+                name : "cu_nsrzh", 
+                fieldLabel : "纳税人识别号", 
+                allowBlank : true, 
+                columnWidth : 0.25
+            },{
+                xtype : "hidden", 
+                name : "cu_bankaccount", 
+                fieldLabel : "开户银行", 
+                allowBlank : true, 
+                columnWidth : 0.25
+            },{
+                xtype : "hidden",  
+                name : "cu_bankcode", 
+                fieldLabel : "银行账户", 
+                allowBlank : true, 
+                columnWidth : 0.25
+            },{
+                xtype:'hidden',
+                name : "cu_uu", 
+                fieldLabel : "客户UU", 
+                allowBlank : true, 
+                readOnly:true,
+                editable:false,
+                columnWidth : 0.25
+            },{
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "创建时间", 
+                allowBlank : true, 
+                hidden:true,
+                columnWidth : 0
+            },{  
+                xtype : "datefield", 
+                name : "updateTime", 
+                fieldLabel : "更新时间", 
+                allowBlank : true, 
+                hidden:true,
+                columnWidth : 0
+            },{
+                fieldLabel : "备注", 
+                xtype:'textfield',
+                name : "cu_remark",
+                columnWidth : 1
+            }, {
+                xtype : "detailGridField", 
+                storeModel:'saas.model.document.customercontact',
+                detnoColumn: 'cc_detno',
+                showCount: false,
+                deleteDetailUrl:'/api/document/customer/deletecontact',
+                // minHeight:145,
+                emptyRows: 3,
+                columns : [
+                    {
+                        text : "ID", 
+                        dataIndex : "id", 
+                        hidden : true,  
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        text : "关联ID", 
+                        dataIndex : "cc_cuid", 
+                        hidden : true,  
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        allowBlank:false,
+                        text : "联系人", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "cc_name", 
+                        width:110  
+                    },
+                    {
+                        allowBlank:false,
+                        text : "电话", 
+                        editor : {
+                            // regex:/^1(3|4|5|7|8|9)\d{9}$/,
+                            // regexText:'请输入正确的手机号码',
+                            hideTrigger:true,
+                            xtype : "textfield"
+                        },
+                        dataIndex : "cc_tel", 
+                        width:200 
+                    },
+                    {
+                        allowBlank:true,
+                        text : "微信/QQ", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "cc_qq", 
+                        width:110 
+                    },
+                    {
+                        text : "邮箱", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "cc_email", 
+                        width:180 
+                    },
+                    {
+                        text : "默认联系人", 
+                        width:110 ,
+                        dataIndex : "cc_default", 
+                        xtype : "yncolumn"
+                    }]
+            } ,{
+                xtype : "detailGridField", 
+                storeModel:'saas.model.document.customeraddress',
+                detnoColumn: 'ca_detno',
+                showCount: false,
+                deleteDetailUrl:'/api/document/customer/deleteaddress',
+                // height:145,
+                emptyRows: 3,
+                columns : [
+                    {
+                        text : "ID", 
+                        dataIndex : "id", 
+                        hidden : true, 
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        text : "关联ID", 
+                        dataIndex : "ca_cuid", 
+                        hidden : true,  
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        allowBlank:false,
+                        text : "送货地址", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "ca_address", 
+                        width:300 
+                    },  
+                    {
+                        allowBlank:true,
+                        text : "联系人", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "ca_person", 
+                        width:110   
+                    },
+                    {
+                        allowBlank:true,
+                        text : "联系电话", 
+                        editor : {
+                            // regex:/^1(3|4|5|7|8|9)\d{9}$/,
+                            // regexText:'请输入正确的手机号码',
+                            xtype : "textfield",
+                            hideTrigger:true,
+                        },
+                        dataIndex : "ca_phone", 
+                        width:200  
+                    },
+                    {
+                        text : "默认地址", 
+                        dataIndex : "ca_default", 
+                        width:110,
+                        xtype:'yncolumn'
+                    }]
+            }],
+            defaultButtons:[{
+                cls: 'x-formpanel-btn-blue',
+                xtype: 'button',
+                text: '新增',
+                bind: {
+                    hidden: '{!id}'
                 },
-                dataIndex : "ca_person", 
-                width:110   
-            },
-            {
-                allowBlank:true,
-                text : "联系电话", 
-                editor : {
-                    // regex:/^1(3|4|5|7|8|9)\d{9}$/,
-                    // regexText:'请输入正确的手机号码',
-                    xtype : "textfield",
-                    hideTrigger:true,
+                handler: 'add'
+            }, {
+                xtype: 'button',
+                text: '保存',
+                handler: 'onSave',
+            }, {
+                xtype: 'button',
+                text: '删除',
+                handler: 'delete'
+            }, {
+                xtype: 'button',
+                bind: {
+                    text: '{auditBtnText}'
                 },
-                dataIndex : "ca_phone", 
-                width:200  
-            },
-            {
-                text : "默认地址", 
-                dataIndex : "ca_default", 
-                width:110,
-                xtype:'yncolumn'
-            }]
-    }],
-    defaultButtons:[{
-        cls: 'x-formpanel-btn-blue',
-        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: 'BANNED',
-        auditText: '已禁用',
-        unAuditCode: 'ENABLE',
-        unAuditText: '已启用',
-        auditBtnText: '禁用',
-        unAuditBtnText: '启用',
-    }
+                handler: "auditBtnClick",
+            }],
+            auditTexts: {
+                auditCode: 'BANNED',
+                auditText: '已禁用',
+                unAuditCode: 'ENABLE',
+                unAuditText: '已启用',
+                auditBtnText: '禁用',
+                unAuditBtnText: '启用',
+            }
+        });
+        this.callParent(arguments);
+    },
 });

+ 362 - 356
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -22,372 +22,378 @@ Ext.define('saas.view.document.product.FormPanel', {
 
     codeInHeader: false,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'pr_code',
-        fieldLabel: '物料编号',
-        allowBlank: false,
-        group: '基础信息',
-    },{
-        editable:false,
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/productbrand/getCombo',
-        name : "pr_brand", 
-        fieldLabel : "品牌",
-        group: '基础信息',
-        addHandler:function(b){
-            var form = this.ownerCmp.ownerCt;
-            this.dialog = form.add({
-                xtype: 'document-productbrand-window',
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'pr_code',
+                fieldLabel: '物料编号',
+                allowBlank: false,
+                group: '基础信息',
+            },{
+                editable:false,
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/productbrand/getCombo',
+                name : "pr_brand", 
+                fieldLabel : "品牌",
+                group: '基础信息',
+                addHandler:function(b){
+                    var form = this.ownerCmp.ownerCt;
+                    this.dialog = form.add({
+                        xtype: 'document-productbrand-window',
+                        bind: {
+                            title: '新增物料品牌'
+                        },
+                        dataKind:'productbrand',
+                        _parent:form,
+                        _combo:this.ownerCmp,
+                        record:null,
+                        session: true
+                    });
+                    this.dialog.show();
+                }
+            },{
+                xtype: 'textfield',
+                name: 'pr_detail',
+                fieldLabel: '名称',
+                allowBlank: false,
+                group: '基础信息',
+            },{
+                xtype: 'hidden',
+                name: 'pr_status',
+                fieldLabel: '状态',
+                group: '基础信息',
+            },{
+                xtype: 'hidden',
+                name: 'pr_statuscode',
+                fieldLabel: '状态码',
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'pr_orispeccode',
+                fieldLabel: '型号',
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 'pr_spec',
+                fieldLabel: '规格',
+                //allowBlank: false,
+                group: '基础信息',
+            },{
+                editable:false,
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/producttype/getCombo',
+                name : "pr_kind", 
+                fieldLabel : "类型",
+                allowBlank : false,
+                group: '基础信息',
+                addHandler:function(b){
+                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                    var form = this.ownerCmp.ownerCt;
+                    this.dialog = form.getController().getView().add({
+                        xtype: 'document-kind-childwin',
+                        bind: {
+                            title: '新增物料类型'
+                        },
+                        dataKind:'productkind',
+                        belong:document.etc['productkind'],
+                        _parent:form,
+                        _combo:this.ownerCmp,
+                        record:null,
+                        session: true
+                    });
+                    this.dialog.show();
+                }
+            },{  
+                editable:false,
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/productunit/getCombo',
+                name : "pr_unit", 
+                fieldLabel : "单位", 
+                allowBlank : false, 
+                editable:false,
+                group: '基础信息',
+                addHandler:function(b){
+                    var form = this.ownerCmp.ownerCt;
+                    this.dialog = form.add({
+                        xtype: 'document-productunit-window',
+                        bind: {
+                            title: '新增计量单位'
+                        },
+                        dataKind:'productunit',
+                        _parent:form,
+                        _combo:this.ownerCmp,
+                        record:null,
+                        session: true
+                    });
+                    this.dialog.show();
+                }
+            }, {
+                xtype: 'numberfield',
+                fieldLabel: '采购提前期',
+                name: 'pr_leadtime',
+                minValue: 0,
+                maxLength: 10,
+                group: '管理信息',
+            },{
+                xtype : "numberfield", 
+                name : "pr_zxbzs", 
+                fieldLabel : "最小包装数", 
+                minValue:0,
+                decimalPrecision: 0,
+                allowBlank : true,
+                group: '管理信息',
+            },{
+                xtype : "hidden", 
+                name : "pr_vendid", 
+                fieldLabel : "供应商ID",
+                group: '管理信息',
+            },{
+                xtype : "hidden",   
+                name : "pr_vendcode", 
+                fieldLabel : "供应商编号",
+                group: '管理信息',
+            }, {
+                xtype : "vendorDbfindTrigger", 
+                name : "pr_vendname", 
+                fieldLabel : "供应商名称",
+                columnWidth: 0.5,
+                group: '管理信息',
+            },{
+                xtype : "hidden", 
+                name : "pr_whid", 
+                fieldLabel : "仓库ID",
+                group: '管理信息',
+            },{  
+                xtype : "hidden",     
+                name : "pr_whcode", 
+                fieldLabel : "仓库编号",
+                group: '管理信息',
+            }, {
+                xtype : "warehouseDbfindTrigger", 
+                name : "pr_whname", 
+                fieldLabel : "仓库", 
+                columnWidth: 0.25,
+                group: '管理信息',
+            },{
+                xtype : "numberfield", 
+                name : "pr_standardprice", 
+                fieldLabel : "标准定价(元)", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 4,
+                minValue:0,
+                group: '管理信息',
+            },{
+                ignore:true,
+                readOnly:true,
+                xtype : "numberfield", 
+                name : "pr_purcprice", 
+                fieldLabel : "最新购价(元)", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 4,
+                thousandSeparator: ',',
+                minValue:0,
+                group: '管理信息',
+            },{
+                ignore:true,
+                readOnly:true,
+                xtype : "numberfield", 
+                name : "pr_saleprice", 
+                fieldLabel : "最新售价(元)", 
+                decimalPrecision: 4,
+                minValue:0,
+                group: '管理信息',
+            },{  
+                hidden:true,
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "创建时间"
+            },{  
+                hidden:true,
+                xtype : "datefield", 
+                name : "updateTime", 
+                fieldLabel : "更新时间"
+            },{
+                xtype : "textfield", 
+                name : "pr_text1", 
+                fieldLabel : "备注",
+                columnWidth: 1
+            }, {
+                xtype: 'checkbox',
+                fieldLabel: '期初设置',
+                name: 'qcsz',
+                ignore: true,
+                defaultValue:true,
                 bind: {
-                    title: '新增物料品牌'
+                    disabled: '{qcsz_disabled}'
                 },
-                dataKind:'productbrand',
-                _parent:form,
-                _combo:this.ownerCmp,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }
-    },{
-        xtype: 'textfield',
-        name: 'pr_detail',
-        fieldLabel: '名称',
-        allowBlank: false,
-        group: '基础信息',
-    },{
-        xtype: 'hidden',
-        name: 'pr_status',
-        fieldLabel: '状态',
-        group: '基础信息',
-    },{
-        xtype: 'hidden',
-        name: 'pr_statuscode',
-        fieldLabel: '状态码',
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'pr_orispeccode',
-        fieldLabel: '型号',
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 'pr_spec',
-        fieldLabel: '规格',
-        //allowBlank: false,
-        group: '基础信息',
-    },{
-        editable:false,
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/producttype/getCombo',
-        name : "pr_kind", 
-        fieldLabel : "类型",
-        allowBlank : false,
-        group: '基础信息',
-        addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
-            var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
+                listeners: {
+                    change: 'qcsz_change'
+                }
+            }, {
+                xtype : "detailGridField", 
+                storeModel:'saas.model.document.ProductDetail',
+                detnoColumn: 'pd_detno',
+                emptyRows: 1,
+                showCount: true,
+                allowEmpty:true,
+                // hidden: true,
+                deleteDetailUrl:'/api/document/product/deleteDetail',
+                listeners: {
+                    datachanged: 'onDataChanged'
+                },
+                columns : [
+                {
+                    text : "ID", 
+                    dataIndex : "id", 
+                    hidden : true,  
+                    xtype : "numbercolumn"
+                },
+                {
+                    text : "物料ID", 
+                    dataIndex : "pd_prodid", 
+                    hidden : true,  
+                    xtype : "numbercolumn"
+                },
+                {
+                    allowBlank:false,
+                    text : "仓库编号", 
+                    dataIndex : "pd_whcode", 
+                    editor : {
+                        xtype : "warehouseDbfindTrigger"
+                    }, 
+                    width : 150
+                },
+                {
+                    allowBlank:true,
+                    readOnly:true,
+                    editable:false,
+                    text : "仓库名称", 
+                    dataIndex : "pd_whname", 
+                    width : 200
+                },{
+                    allowBlank:true,
+                    hidden:true,
+                    text : "仓库ID", 
+                    dataIndex : "pd_whid", 
+                    xtype : "numbercolumn", 
+                },
+                {
+                    text : "期初数量", 
+                    dataIndex : "pd_num", 
+                    // xtype: 'numbercolumn',
+                    align: 'end',
+                    width : 110.0,
+                    allowBlank : false,
+                    editor : {
+                        xtype : "numberfield",
+                        decimalPrecision: 3,
+                        minValue:0
+                    },
+                    listeners:{
+                        edit:'amount_change'
+                    },
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                },
+                {
+                    text : "单位成本(元)", 
+                    dataIndex : "pd_price", 
+                    // xtype: 'numbercolumn',
+                    align: 'end',
+                    width : 110.0,
+                    allowBlank : true,
+                    editor : {
+                        xtype : "numberfield",
+                        decimalPrecision: 4,
+                        allowDecimals: true,
+                        minValue:0
+                    },
+                    listeners:{
+                        edit:'amount_change'
+                    },
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                },
+                {
+                    text : "期初金额(元)", 
+                    dataIndex : "pd_amount", 
+                    // xtype: 'numbercolumn',
+                    align: 'end',
+                    width : 110.0,
+                    allowBlank : true,
+                    renderer : function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function(v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }]
+            }],
+        
+            defaultButtons:[{
+                cls: 'x-formpanel-btn-blue',
+                xtype: 'button',
+                text: '新增',
                 bind: {
-                    title: '新增物料类型'
+                    hidden: '{!id}'
                 },
-                dataKind:'productkind',
-                belong:document.etc['productkind'],
-                _parent:form,
-                _combo:this.ownerCmp,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }
-    },{  
-        editable:false,
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/productunit/getCombo',
-        name : "pr_unit", 
-        fieldLabel : "单位", 
-        allowBlank : false, 
-        editable:false,
-        group: '基础信息',
-        addHandler:function(b){
-            var form = this.ownerCmp.ownerCt;
-            this.dialog = form.add({
-                xtype: 'document-productunit-window',
+                handler: 'add'
+            }, {
+                xtype: 'button',
+                text: '保存',
+                handler: 'onSave',
+            }, {
+                xtype: 'button',
+                text: '删除',
+                handler: 'delete'
+            }, {
+                xtype: 'button',
                 bind: {
-                    title: '新增计量单位'
+                    text: '{auditBtnText}'
                 },
-                dataKind:'productunit',
-                _parent:form,
-                _combo:this.ownerCmp,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }
-    }, {
-        xtype: 'numberfield',
-        fieldLabel: '采购提前期',
-        name: 'pr_leadtime',
-        minValue: 0,
-        maxLength: 10,
-        group: '管理信息',
-    },{
-        xtype : "numberfield", 
-        name : "pr_zxbzs", 
-        fieldLabel : "最小包装数", 
-        minValue:0,
-        decimalPrecision: 0,
-        allowBlank : true,
-        group: '管理信息',
-    },{
-        xtype : "hidden", 
-        name : "pr_vendid", 
-        fieldLabel : "供应商ID",
-        group: '管理信息',
-    },{
-        xtype : "hidden",   
-        name : "pr_vendcode", 
-        fieldLabel : "供应商编号",
-        group: '管理信息',
-    }, {
-        xtype : "vendorDbfindTrigger", 
-        name : "pr_vendname", 
-        fieldLabel : "供应商名称",
-        columnWidth: 0.5,
-        group: '管理信息',
-    },{
-        xtype : "hidden", 
-        name : "pr_whid", 
-        fieldLabel : "仓库ID",
-        group: '管理信息',
-    },{  
-        xtype : "hidden",     
-        name : "pr_whcode", 
-        fieldLabel : "仓库编号",
-        group: '管理信息',
-    }, {
-        xtype : "warehouseDbfindTrigger", 
-        name : "pr_whname", 
-        fieldLabel : "仓库", 
-        columnWidth: 0.25,
-        group: '管理信息',
-    },{
-        xtype : "numberfield", 
-        name : "pr_standardprice", 
-        fieldLabel : "标准定价(元)", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 4,
-        minValue:0,
-        group: '管理信息',
-    },{
-        ignore:true,
-        readOnly:true,
-        xtype : "numberfield", 
-        name : "pr_purcprice", 
-        fieldLabel : "最新购价(元)", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 4,
-        thousandSeparator: ',',
-        minValue:0,
-        group: '管理信息',
-    },{
-        ignore:true,
-        readOnly:true,
-        xtype : "numberfield", 
-        name : "pr_saleprice", 
-        fieldLabel : "最新售价(元)", 
-        decimalPrecision: 4,
-        minValue:0,
-        group: '管理信息',
-    },{  
-        hidden:true,
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间"
-    },{  
-        hidden:true,
-        xtype : "datefield", 
-        name : "updateTime", 
-        fieldLabel : "更新时间"
-    },{
-        xtype : "textfield", 
-        name : "pr_text1", 
-        fieldLabel : "备注",
-        columnWidth: 1
-    }, {
-        xtype: 'checkbox',
-        fieldLabel: '期初设置',
-        name: 'qcsz',
-        ignore: true,
-        defaultValue:true,
-        bind: {
-            disabled: '{qcsz_disabled}'
-        },
-        listeners: {
-            change: 'qcsz_change'
-        }
-    }, {
-        xtype : "detailGridField", 
-        storeModel:'saas.model.document.ProductDetail',
-        detnoColumn: 'pd_detno',
-        emptyRows: 1,
-        showCount: true,
-        allowEmpty:true,
-        // hidden: true,
-        deleteDetailUrl:'/api/document/product/deleteDetail',
-        listeners: {
-            datachanged: 'onDataChanged'
-        },
-        columns : [
-        {
-            text : "ID", 
-            dataIndex : "id", 
-            hidden : true,  
-            xtype : "numbercolumn"
-        },
-        {
-            text : "物料ID", 
-            dataIndex : "pd_prodid", 
-            hidden : true,  
-            xtype : "numbercolumn"
-        },
-        {
-            allowBlank:false,
-            text : "仓库编号", 
-            dataIndex : "pd_whcode", 
-            editor : {
-                xtype : "warehouseDbfindTrigger"
-            }, 
-            width : 150
-        },
-        {
-            allowBlank:true,
-            readOnly:true,
-            editable:false,
-            text : "仓库名称", 
-            dataIndex : "pd_whname", 
-            width : 200
-        },{
-            allowBlank:true,
-            hidden:true,
-            text : "仓库ID", 
-            dataIndex : "pd_whid", 
-            xtype : "numbercolumn", 
-        },
-        {
-            text : "期初数量", 
-            dataIndex : "pd_num", 
-            // xtype: 'numbercolumn',
-            align: 'end',
-            width : 110.0,
-            allowBlank : false,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 3,
-                minValue:0
-            },
-            listeners:{
-                edit:'amount_change'
+                handler: "auditBtnClick",
+            }],
+            auditTexts: {
+                auditCode: 'BANNED',
+                auditText: '已禁用',
+                unAuditCode: 'ENABLE',
+                unAuditText: '已启用',
+                auditBtnText: '禁用',
+                unAuditBtnText: '启用',
             },
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            }
-        },
-        {
-            text : "单位成本(元)", 
-            dataIndex : "pd_price", 
-            // xtype: 'numbercolumn',
-            align: 'end',
-            width : 110.0,
-            allowBlank : true,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 4,
-                allowDecimals: true,
-                minValue:0
-            },
-            listeners:{
-                edit:'amount_change'
-            },
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-        },
-        {
-            text : "期初金额(元)", 
-            dataIndex : "pd_amount", 
-            // xtype: 'numbercolumn',
-            align: 'end',
-            width : 110.0,
-            allowBlank : true,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
+            listeners: {
+                load: function(form, data) {
+                    var viewModel = form.getViewModel();
+                    var store = viewModel.get('detail0').detailStore,
+                    detailGrid = form.down('grid'),
+                    trueData = detailGrid.getTrueData();
+        
+                    viewModel.set('qcsz', trueData.length > 0);
+                    viewModel.set('qcsz_disabled', trueData.length > 0);
+                    viewModel.notify();
+                    form.getForm().findField('qcsz').resetOriginalValue();
+                }
             },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }]
-    }],
-
-    defaultButtons:[{
-        cls: 'x-formpanel-btn-blue',
-        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: 'BANNED',
-        auditText: '已禁用',
-        unAuditCode: 'ENABLE',
-        unAuditText: '已启用',
-        auditBtnText: '禁用',
-        unAuditBtnText: '启用',
+        });
+        this.callParent(arguments);
     },
-    listeners: {
-        load: function(form, data) {
-            var viewModel = form.getViewModel();
-            var store = viewModel.get('detail0').detailStore,
-            detailGrid = form.down('grid'),
-            trueData = detailGrid.getTrueData();
 
-            viewModel.set('qcsz', trueData.length > 0);
-            viewModel.set('qcsz_disabled', trueData.length > 0);
-            viewModel.notify();
-            form.getForm().findField('qcsz').resetOriginalValue();
-        }
-    },
     beforeSave:function(){
         var me = this,
         controller = me.getController(),

+ 302 - 297
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -22,304 +22,309 @@ Ext.define('saas.view.document.vendor.FormPanel', {
 
     codeInHeader: false,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 've_code',
-        fieldLabel: '供应商编号',
-        allowBlank: false,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 've_name',
-        fieldLabel: '供应商名称',
-        allowBlank: false,
-        columnWidth: 0.25,
-        group: '基础信息',
-    },{
-        xtype: 'textfield',
-        name: 've_shortname',
-        fieldLabel: '供应商简称',
-        columnWidth: 0.25,
-        hidden: true,
-        group: '基础信息',
-    },{
-        xtype: 'hidden',
-        name: 've_status',
-        fieldLabel: '状态',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{
-        xtype: 'hidden',
-        name: 've_statuscode',
-        fieldLabel: '状态码',
-        allowBlank: true,
-        columnWidth: 0.25
-    },{
-        editable:false,
-        xtype : "remotecombo", 
-        storeUrl:'/api/document/vendorkind/getCombo',
-        name : "ve_type", 
-        fieldLabel : "供应商类型", 
-        columnWidth : 0.25,
-        group: '基础信息',
-        addHandler:function(b){
-            var document = Ext.create('saas.view.document.kind.Kind',{});
-            var form = this.ownerCmp.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
-                bind: {
-                    title: '新增供应商类型'
-                },
-                dataKind:'vendorkind',
-                belong:document.etc['vendorkind'],
-                _parent:form,
-                _combo:this.ownerCmp,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }
-    },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    },{
-        xtype : "datefield", 
-        name : "ve_begindate", 
-        format:'Y-m-d',
-        fieldLabel : "期初日期", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        group: '交易信息',
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "ve_beginapamount", 
-        fieldLabel : "期初应付(元)",
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        minValue:0,
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true, 
-        name : "ve_beginprepayamount", 
-        fieldLabel : "期初预付(元)", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        minValue:0,
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },    
-    },{  
-        xtype : "numberfield", 
-        name : "ve_leftamount", 
-        fieldLabel : "应付余额(元)", 
-        allowBlank : true, 
-        readOnly:true,
-        ignore:true,
-        columnWidth : 0.25,
-        decimalPrecision: 2,
-        thousandSeparator: ',',
-        group: '交易信息',
-        renderer : function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
-        },  
-    },{
-        xtype : "numberfield", 
-        name : "ve_taxrate", 
-        hideTrigger:true,
-        fieldLabel : "税率(%)", 
-        allowBlank : false, 
-        columnWidth : 0.25,
-        minValue:0,  
-        maxValue:100,
-        group: '交易信息',
-    },{ 
-        xtype : "numberfield", 
-        hideTrigger:true,
-        name : "ve_promisedays", 
-        fieldLabel : "结算天数", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        minValue:0,
-        maxLength: 8,
-        enforceMaxLength: true,
-        decimalPrecision: 0,
-        group: '交易信息',
-    },{
-        xtype : "textfield", 
-        name : "ve_nsrzh", 
-        fieldLabel : "纳税人识别号", 
-        allowBlank : true, 
-        columnWidth : 0.25,
-        group: '基础信息',
-    },{
-        xtype : "textfield", 
-        name : "ve_bankcode", 
-        fieldLabel : "开户银行", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "textfield", 
-        name : "ve_bankaccount", 
-        fieldLabel : "银行账户", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype:'hidden',
-        name : "ve_uu", 
-        fieldLabel : "供应商UU", 
-        allowBlank : true, 
-        editable:false,
-        readOnly:true,
-        columnWidth : 0.25
-    },{  
-        xtype : "datefield", 
-        name : "updateTime", 
-        fieldLabel : "更新时间", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0.25  
-    }, {
-        xtype : "hidden", 
-        name : "ve_buyercode", 
-        fieldLabel : "采购员编号"
-    },{
-        xtype : "employeeDbfindTrigger", 
-        name : "ve_buyername", 
-        fieldLabel : "采购员",
-        columnWidth : 0.25,
-        defaultValue:saas.util.BaseUtil.getCurrentUser().realname
-    },{
-        xtype : "hidden", 
-        name : "ve_buyerid", 
-        fieldLabel : "采购员ID",
-        defaultValue:saas.util.BaseUtil.getCurrentUser().id
-    },{
-        xtype : "textfield", 
-        name : "ve_address", 
-        fieldLabel : "地址", 
-        allowBlank : true, 
-        columnWidth : 0.75
-    },{
-        fieldLabel : "备注", 
-        xtype:'textfield',
-        name : "ve_remark",
-        columnWidth : 1
-    }, {
-        xtype : "detailGridField", 
-        storeModel:'saas.model.document.vendorcontact',
-        detnoColumn: 'vc_detno',
-        showCount: false,
-        deleteDetailUrl:'/api/document/vendor/deleteContact',
-        columns : [
-            {
-                text : "ID", 
-                dataIndex : "id", 
-                hidden : true, 
-                xtype : "numbercolumn"
-            },
-            {
-                text : "关联ID", 
-                dataIndex : "vc_veid", 
-                hidden : true, 
-                xtype : "numbercolumn"
-            },
-            {
-                allowBlank:false,
-                text : "联系人", 
-                editor : {
-                    xtype : "textfield"
-                },
-                dataIndex : "vc_name", 
-                width:110
-            },
-            {
-                allowBlank:false,
-                text : "电话", 
-                editor : {
-                    // regex:/^[\d | -]*$/,
-                    // regexText:'请输入正确的手机号码',
-                    hideTrigger:true,
-                    xtype : "textfield"
+    initComponent: function() {
+        Ext.apply(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 've_code',
+                fieldLabel: '供应商编号',
+                allowBlank: false,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 've_name',
+                fieldLabel: '供应商名称',
+                allowBlank: false,
+                columnWidth: 0.25,
+                group: '基础信息',
+            },{
+                xtype: 'textfield',
+                name: 've_shortname',
+                fieldLabel: '供应商简称',
+                columnWidth: 0.25,
+                hidden: true,
+                group: '基础信息',
+            },{
+                xtype: 'hidden',
+                name: 've_status',
+                fieldLabel: '状态',
+                allowBlank: true,
+                columnWidth: 0.25
+            },{
+                xtype: 'hidden',
+                name: 've_statuscode',
+                fieldLabel: '状态码',
+                allowBlank: true,
+                columnWidth: 0.25
+            },{
+                editable:false,
+                xtype : "remotecombo", 
+                storeUrl:'/api/document/vendorkind/getCombo',
+                name : "ve_type", 
+                fieldLabel : "供应商类型", 
+                columnWidth : 0.25,
+                group: '基础信息',
+                addHandler:function(b){
+                    var document = Ext.create('saas.view.document.kind.Kind',{});
+                    var form = this.ownerCmp.ownerCt;
+                    this.dialog = form.getController().getView().add({
+                        xtype: 'document-kind-childwin',
+                        bind: {
+                            title: '新增供应商类型'
+                        },
+                        dataKind:'vendorkind',
+                        belong:document.etc['vendorkind'],
+                        _parent:form,
+                        _combo:this.ownerCmp,
+                        record:null,
+                        session: true
+                    });
+                    this.dialog.show();
+                }
+            },{
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "创建时间", 
+                allowBlank : true, 
+                hidden:true,
+                columnWidth : 0
+            },{
+                xtype : "datefield", 
+                name : "ve_begindate", 
+                format:'Y-m-d',
+                fieldLabel : "期初日期", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                group: '交易信息',
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "ve_beginapamount", 
+                fieldLabel : "期初应付(元)",
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                minValue:0,
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-                dataIndex : "vc_tel", 
-                width:200 
-            },
-            {
-                allowBlank:true,
-                text : "微信/QQ", 
-                editor : {
-                    xtype : "textfield"
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true, 
+                name : "ve_beginprepayamount", 
+                fieldLabel : "期初预付(元)", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                minValue:0,
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
+                },    
+            },{  
+                xtype : "numberfield", 
+                name : "ve_leftamount", 
+                fieldLabel : "应付余额(元)", 
+                allowBlank : true, 
+                readOnly:true,
+                ignore:true,
+                columnWidth : 0.25,
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                group: '交易信息',
+                renderer : function(v) {
+                    return saas.util.BaseUtil.numberFormat(v, 2, true);
+                },  
+            },{
+                xtype : "numberfield", 
+                name : "ve_taxrate", 
+                hideTrigger:true,
+                fieldLabel : "税率(%)", 
+                allowBlank : false, 
+                columnWidth : 0.25,
+                minValue:0,  
+                maxValue:100,
+                group: '交易信息',
+            },{ 
+                xtype : "numberfield", 
+                hideTrigger:true,
+                name : "ve_promisedays", 
+                fieldLabel : "结算天数", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                minValue:0,
+                maxLength: 8,
+                enforceMaxLength: true,
+                decimalPrecision: 0,
+                group: '交易信息',
+            },{
+                xtype : "textfield", 
+                name : "ve_nsrzh", 
+                fieldLabel : "纳税人识别号", 
+                allowBlank : true, 
+                columnWidth : 0.25,
+                group: '基础信息',
+            },{
+                xtype : "textfield", 
+                name : "ve_bankcode", 
+                fieldLabel : "开户银行", 
+                allowBlank : true, 
+                columnWidth : 0.25
+            },{
+                xtype : "textfield", 
+                name : "ve_bankaccount", 
+                fieldLabel : "银行账户", 
+                allowBlank : true, 
+                columnWidth : 0.25
+            },{
+                xtype:'hidden',
+                name : "ve_uu", 
+                fieldLabel : "供应商UU", 
+                allowBlank : true, 
+                editable:false,
+                readOnly:true,
+                columnWidth : 0.25
+            },{  
+                xtype : "datefield", 
+                name : "updateTime", 
+                fieldLabel : "更新时间", 
+                allowBlank : true, 
+                hidden:true,
+                columnWidth : 0.25  
+            }, {
+                xtype : "hidden", 
+                name : "ve_buyercode", 
+                fieldLabel : "采购员编号"
+            },{
+                xtype : "employeeDbfindTrigger", 
+                name : "ve_buyername", 
+                fieldLabel : "采购员",
+                columnWidth : 0.25,
+                defaultValue:saas.util.BaseUtil.getCurrentUser().realname
+            },{
+                xtype : "hidden", 
+                name : "ve_buyerid", 
+                fieldLabel : "采购员ID",
+                defaultValue:saas.util.BaseUtil.getCurrentUser().id
+            },{
+                xtype : "textfield", 
+                name : "ve_address", 
+                fieldLabel : "地址", 
+                allowBlank : true, 
+                columnWidth : 0.75
+            },{
+                fieldLabel : "备注", 
+                xtype:'textfield',
+                name : "ve_remark",
+                columnWidth : 1
+            }, {
+                xtype : "detailGridField", 
+                storeModel:'saas.model.document.vendorcontact',
+                detnoColumn: 'vc_detno',
+                showCount: false,
+                deleteDetailUrl:'/api/document/vendor/deleteContact',
+                columns : [
+                    {
+                        text : "ID", 
+                        dataIndex : "id", 
+                        hidden : true, 
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        text : "关联ID", 
+                        dataIndex : "vc_veid", 
+                        hidden : true, 
+                        xtype : "numbercolumn"
+                    },
+                    {
+                        allowBlank:false,
+                        text : "联系人", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "vc_name", 
+                        width:110
+                    },
+                    {
+                        allowBlank:false,
+                        text : "电话", 
+                        editor : {
+                            // regex:/^[\d | -]*$/,
+                            // regexText:'请输入正确的手机号码',
+                            hideTrigger:true,
+                            xtype : "textfield"
+                        },
+                        dataIndex : "vc_tel", 
+                        width:200 
+                    },
+                    {
+                        allowBlank:true,
+                        text : "微信/QQ", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "vc_qq", 
+                        width:110
+                    },
+                    {
+                        text : "邮箱", 
+                        editor : {
+                            xtype : "textfield"
+                        },
+                        dataIndex : "vc_email", 
+                        width:180
+                    },
+                    {
+                        text : "默认联系人", 
+                        dataIndex : "vc_default", 
+                        xtype : "yncolumn",
+                    }]
+                }
+            ],
+        
+            defaultButtons:[{
+                cls: 'x-formpanel-btn-blue',
+                xtype: 'button',
+                text: '新增',
+                bind: {
+                    hidden: '{!id}'
                 },
-                dataIndex : "vc_qq", 
-                width:110
-            },
-            {
-                text : "邮箱", 
-                editor : {
-                    xtype : "textfield"
+                handler: 'add'
+            }, {
+                xtype: 'button',
+                text: '保存',
+                handler: 'onSave',
+            }, {
+                xtype: 'button',
+                text: '删除',
+                handler: 'delete'
+            }, {
+                xtype: 'button',
+                bind: {
+                    text: '{auditBtnText}'
                 },
-                dataIndex : "vc_email", 
-                width:180
-            },
-            {
-                text : "默认联系人", 
-                dataIndex : "vc_default", 
-                xtype : "yncolumn",
-            }]
-        }
-    ],
-
-    defaultButtons:[{
-        cls: 'x-formpanel-btn-blue',
-        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: 'BANNED',
-        auditText: '已禁用',
-        unAuditCode: 'ENABLE',
-        unAuditText: '已启用',
-        auditBtnText: '禁用',
-        unAuditBtnText: '启用',
-    }
+                handler: "auditBtnClick",
+            }],
+            auditTexts: {
+                auditCode: 'BANNED',
+                auditText: '已禁用',
+                unAuditCode: 'ENABLE',
+                unAuditText: '已启用',
+                auditBtnText: '禁用',
+                unAuditBtnText: '启用',
+            }
+        });
+        this.callParent(arguments);
+    },
 });

+ 3 - 3
frontend/saas-web/app/view/main/Main.js

@@ -62,9 +62,9 @@ Ext.define('saas.view.main.Main', {
                     text: '优软云',
                     ui: 'header',
                     tooltip: '优软云',
-                    // handler:function(){
-					//     window.open('http://www.usoftchina.com','_blank');
-                    // }
+                    handler:function(){
+					    window.open('http://www.usoftchina.com','_blank');
+                    }
                 },
                 {
                     margin:'0 3 0 6',

+ 226 - 211
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -6,226 +6,241 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
     viewModel: 'money-fundtransfer-formpanel',
 
     viewName: 'money-fundtransfer-formpanel',
-    caller:'FundTransfer',
-    
-     //字段属性
-     _title:'资金转存',
-     _idField: 'id',
-     _codeField: 'ft_code',
-     _statusField: 'ft_status',
-     _statusCodeField: 'ft_statuscode',
-     _auditmanField: 'ft_auditman',
-     _auditdateField:'ft_auditdate',
-     _relationColumn: 'ftd_ftid',
-     _readUrl:'/api/money/fundtransfer/read',
-     _saveUrl:'/api/money/fundtransfer/save',
-     _auditUrl:'/api/money/fundtransfer/audit',
-     _unAuditUrl: '/api/money/fundtransfer/unAudit',
-     _deleteUrl:'/api/money/fundtransfer/delete',
-     initId:0,
+    caller: 'FundTransfer',
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-        xtype : "datefield", 
-        name : "ft_date", 
-        fieldLabel : "单据日期",
-        defaultValue: new Date(),
-        allowBlank : false
-    }, {
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        storeModel:'saas.model.money.FundTransfer',
-        detnoColumn:  'ftd_detno',
-        deleteDetailUrl:'/api/money/fundtransfer/deleteDetail',
-        columnWidth : 1,
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
+    //字段属性
+    _title: '资金转存',
+    _idField: 'id',
+    _codeField: 'ft_code',
+    _statusField: 'ft_status',
+    _statusCodeField: 'ft_statuscode',
+    _auditmanField: 'ft_auditman',
+    _auditdateField: 'ft_auditdate',
+    _relationColumn: 'ftd_ftid',
+    _readUrl: '/api/money/fundtransfer/read',
+    _saveUrl: '/api/money/fundtransfer/save',
+    _auditUrl: '/api/money/fundtransfer/audit',
+    _unAuditUrl: '/api/money/fundtransfer/unAudit',
+    _deleteUrl: '/api/money/fundtransfer/delete',
+    initId: 0,
+
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            }, {
+                xtype: "datefield",
+                name: "ft_date",
+                fieldLabel: "单据日期",
+                defaultValue: new Date(),
+                allowBlank: false
             }, {
-                text : "期间", 
-                dataIndex : "ftd_ym", 
-                editor : {
-                    xtype : "numberfield"
-                },
-                width : 110.0,
-                items : null,
-                hidden: true
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.FundTransfer',
+                detnoColumn: 'ftd_detno',
+                deleteDetailUrl: '/api/money/fundtransfer/deleteDetail',
+                columnWidth: 1,
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "期间",
+                    dataIndex: "ftd_ym",
+                    editor: {
+                        xtype: "numberfield"
+                    },
+                    width: 110.0,
+                    items: null,
+                    hidden: true
+                }, {
+                    text: "转出账户ID",
+                    dataIndex: "ftd_bankid",
+                    width: 0
+                }, {
+                    text: "转出账户编号",
+                    dataIndex: "ftd_bankcode",
+                    width: 0
+                }, {
+                    text: "转出账户",
+                    width: 200.0,
+                    dataIndex: "ftd_bankname",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "bandinfoDbfindTrigger",
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value"
+                    }
+                }, {
+                    text: "转出账户余额(元)",
+                    dataIndex: "bk_outthisamount",
+                    ignore: true
+                }, {
+                    text: "转入账户ID",
+                    dataIndex: "ftd_inbankid",
+                    width: 0
+                }, {
+                    text: "转入账户编号",
+                    dataIndex: "ftd_inbankcode",
+                    width: 0
+                }, {
+                    text: "转入账户",
+                    width: 200.0,
+                    dataIndex: "ftd_inbankname",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "bandinfoDbfindTrigger"
+                    }
+                }, {
+                    text: "转入账户余额(元)",
+                    dataIndex: "bk_inthisamount",
+                    ignore: true,
+                    width: 150.0
+                }, {
+                    text: "本次转出金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "ftd_nowbalance",
+                    width: 150.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "结算方式",
+                    width: 110.0,
+                    dataIndex: "ftd_paymethod",
+                    editor: {
+                        xtype: 'combo',
+                        queryMode: 'local',
+                        displayField: 'display',
+                        valueField: 'value',
+                        store: Ext.create('Ext.data.Store', {
+                            fields: ['value', 'display'],
+                            data: [{
+                                value: "信用卡",
+                                display: "信用卡"
+                            }, {
+                                value: "支票",
+                                display: "支票"
+                            }, {
+                                value: "汇票",
+                                display: "汇票"
+                            }, {
+                                value: "现金",
+                                display: "现金"
+                            }, {
+                                value: "银行转账",
+                                display: "银行转账"
+                            }, {
+                                value: "支付宝转账",
+                                display: "支付宝转账"
+                            }, {
+                                value: "微信转账",
+                                display: "微信转账"
+                            }]
+                        })
+                    }
+                }, {
+                    text: "结算号",
+                    dataIndex: "ftd_paycode",
+                    width: 150,
+                    editor: {
+                        xtype: ''
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "ftd_remark",
+                    width: 250.0,
+                    items: null,
+                    editor: {
+                        xtype: ""
+                    }
+                }]
             }, {
-                text : "转出账户ID", 
-                dataIndex : "ftd_bankid", 
-                width : 0
+                xtype: "textfield",
+                name: "ft_remark",
+                fieldLabel: "备注",
+                allowBlank: true,
+                columnWidth: 1
             }, {
-                text : "转出账户编号", 
-                dataIndex : "ftd_bankcode", 
-                width :0
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
             }, {
-                text : "转出账户", 
-                width : 200.0, 
-                dataIndex : "ftd_bankname", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    xtype : "bandinfoDbfindTrigger",
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value"
-                }
-            },{
-                text : "转出账户余额(元)", 
-                dataIndex : "bk_outthisamount", 
-                ignore:true
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
             }, {
-                text : "转入账户ID", 
-                dataIndex : "ftd_inbankid", 
-                width : 0
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
             }, {
-                text : "转入账户编号", 
-                dataIndex : "ftd_inbankcode", 
-                width :0
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
             }, {
-                text : "转入账户", 
-                width : 200.0, 
-                dataIndex : "ftd_inbankname", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "bandinfoDbfindTrigger"
-                }
-            },{
-                text : "转入账户余额(元)", 
-                dataIndex : "bk_inthisamount", 
-                ignore:true,
-                width : 150.0
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
             }, {
-                text : "本次转出金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "ftd_nowbalance",
-                width : 150.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
             }, {
-                text : "结算方式",
-                width : 110.0,
-                dataIndex : "ftd_paymethod",
-                editor : {
-                    xtype:'combo',
-                    queryMode: 'local',
-                    displayField: 'display',
-                    valueField: 'value',
-                    store:Ext.create('Ext.data.Store', {
-                        fields: ['value', 'display'],
-                        data : [
-                            {value:"信用卡", display:"信用卡"},
-                            {value:"支票", display:"支票"},
-                            {value:"汇票", display:"汇票"},
-                            {value:"现金", display:"现金"},
-                            {value:"银行转账", display:"银行转账"},
-                            {value:"支付宝转账", display:"支付宝转账"},
-                            {value:"微信转账", display:"微信转账"}
-                        ]
-                    })
-                }
-            },
-             {
-                text : "结算号",
-                dataIndex : "ftd_paycode",
-                width : 150,
-                editor:{
-                    xtype: ''
-                }
-            },{
-                text : "备注", 
-                dataIndex : "ftd_remark",
-                width : 250.0, 
-                items : null,
-                editor : {
-                    xtype : ""
-                }
-            }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "ft_remark", 
-        fieldLabel : "备注", 
-        allowBlank : true, 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                xtype: 'textfield',
+                name: 'ft_auditman',
+                fieldLabel: '审核人',
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "ft_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype: 'textfield',
-        name: 'ft_auditman',
-        fieldLabel: '审核人',
-        readOnly: true
-    },{
-        xtype: "datefield",
-        name: "ft_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }]
+
 });

+ 169 - 163
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -24,173 +24,179 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
      _deleteUrl:'/api/money/othreceipts/delete',  
      initId:0,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-         xtype : 'hidden',
-         name : 'or_custid', 
-         fieldLabel : '客户ID'
-    }, {
-         xtype : 'hidden', 
-         name : 'or_custcode', 
-         fieldLabel : '客户编号'
-     }, {
-         xtype : "customerDbfindTrigger", 
-         name : "or_custname", 
-         fieldLabel : "客户名称",
-         // allowBlank : false
-     }, {
-         xtype : 'hidden',
-         name : 'or_bankid', 
-         fieldLabel : '账户ID'
-     }, {
-         xtype : 'hidden', 
-         name : 'or_bankcode', 
-         fieldLabel : '账户编号'
-     }, {
-         xtype : "bandinfoDbfindTrigger", 
-         name : "or_bankname", 
-         fieldLabel : "账户名称",
-         allowBlank : false
-     }, {
-        xtype:'datefield',
-        name : 'or_date',
-        fieldLabel : '单据日期',
-        defaultValue: new Date(),
-        allowBlank : false
-    },{
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        storeModel:'saas.model.money.Othreceipts',
-        detnoColumn:  'ord_detno',
-        deleteDetailUrl:'/api/money/othreceipts/deleteDetail',
-        columnWidth : 1,
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
+     initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
             }, {
-                text : "期间",
-                dataIndex : "ord_ym",
-                editor : {
-                    xtype : "numberfield",
-                    readOnly: true
-                },
-                // defaultValue: Ext.Date.format(new Date(), 'Ym'),
-                width : 110.0,
-                hidden: true,
-                items : null
+                 xtype : 'hidden',
+                 name : 'or_custid', 
+                 fieldLabel : '客户ID'
             }, {
-                text : "收入类别", 
-                width : 150.0, 
-                dataIndex : "ord_type",
-                items : null,
-                allowBlank : false,
-                hiddenBtn:false,//true 则会关闭新增按钮功能
-                editor : {
-                    xtype : "remotecombo", 
-                    storeUrl:'/api/document/fundinouttype/getCombo?condition=收入',
-                    addHandler:function(b){
-                        var document = Ext.create('saas.view.document.kind.Kind',{});
-                        var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
-                        this.dialog = form.getController().getView().add({
-                            xtype: 'document-kind-childwin',
-                            bind: {
-                                title: '新增收入类别'
-                            },
-                            dataKind:'inoutkind',
-                            belong:document.etc['inoutkind'],
-                            _parent:form,
-                            _combo:this.ownerCmp,
-                            record:null,
-                            session: true
-                        });
-                        this.dialog.show();
+                 xtype : 'hidden', 
+                 name : 'or_custcode', 
+                 fieldLabel : '客户编号'
+             }, {
+                 xtype : "customerDbfindTrigger", 
+                 name : "or_custname", 
+                 fieldLabel : "客户名称",
+                 // allowBlank : false
+             }, {
+                 xtype : 'hidden',
+                 name : 'or_bankid', 
+                 fieldLabel : '账户ID'
+             }, {
+                 xtype : 'hidden', 
+                 name : 'or_bankcode', 
+                 fieldLabel : '账户编号'
+             }, {
+                 xtype : "bandinfoDbfindTrigger", 
+                 name : "or_bankname", 
+                 fieldLabel : "账户名称",
+                 allowBlank : false
+             }, {
+                xtype:'datefield',
+                name : 'or_date',
+                fieldLabel : '单据日期',
+                defaultValue: new Date(),
+                allowBlank : false
+            },{
+                name : "detailGridField", 
+                xtype : "detailGridField", 
+                storeModel:'saas.model.money.Othreceipts',
+                detnoColumn:  'ord_detno',
+                deleteDetailUrl:'/api/money/othreceipts/deleteDetail',
+                columnWidth : 1,
+                columns : [
+                    {
+                        text : "id", 
+                        dataIndex : "id", 
+                        xtype : "numbercolumn",
+                        hidden:true
+                    }, {
+                        text : "期间",
+                        dataIndex : "ord_ym",
+                        editor : {
+                            xtype : "numberfield",
+                            readOnly: true
+                        },
+                        // defaultValue: Ext.Date.format(new Date(), 'Ym'),
+                        width : 110.0,
+                        hidden: true,
+                        items : null
+                    }, {
+                        text : "收入类别", 
+                        width : 150.0, 
+                        dataIndex : "ord_type",
+                        items : null,
+                        allowBlank : false,
+                        hiddenBtn:false,//true 则会关闭新增按钮功能
+                        editor : {
+                            xtype : "remotecombo", 
+                            storeUrl:'/api/document/fundinouttype/getCombo?condition=收入',
+                            addHandler:function(b){
+                                var document = Ext.create('saas.view.document.kind.Kind',{});
+                                var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                                this.dialog = form.getController().getView().add({
+                                    xtype: 'document-kind-childwin',
+                                    bind: {
+                                        title: '新增收入类别'
+                                    },
+                                    dataKind:'inoutkind',
+                                    belong:document.etc['inoutkind'],
+                                    _parent:form,
+                                    _combo:this.ownerCmp,
+                                    record:null,
+                                    session: true
+                                });
+                                this.dialog.show();
+                            }
+                        }
+                    }, {
+                        text : "金额(元)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "ord_nowbalance", 
+                        width : 110.0,
+                        allowBlank : false,
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 2
+                        },
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        },
+                        summaryType: 'sum',
+                        summaryRenderer: function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        }
+                    }, {
+                        text : "备注", 
+                        dataIndex : "ord_remark",
+                        width : 250, 
+                        editor : {
+                            xtype : "textfield"
+                        }
                     }
-                }
+                ]
+            }, {
+                xtype : "numberfield", 
+                name : "or_amount", 
+                fieldLabel : "收款金额(元)",
+                readOnly:true
+            },{
+                xtype : "textfield", 
+                name : "or_remark", 
+                fieldLabel : "备注", 
+                allowBlank : true, 
+                columnWidth : 0.75
+            },{
+                xtype : "hidden", 
+                name : "creatorId", 
+                fieldLabel : "录入人ID", 
+                readOnly:true
+            },
+            {
+                xtype : "textfield", 
+                name : "creatorName", 
+                fieldLabel : "录入人", 
+                readOnly:true
             }, {
-                text : "金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "ord_nowbalance", 
-                width : 110.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "录入日期",
+                readOnly:true, 
+                defaultValue: new Date()
+            },{
+                xtype : "hidden", 
+                name : "updaterId", 
+                fieldLabel : "更新人ID", 
+                readOnly:true
+            },{
+                xtype : "hidden", 
+                name : "updaterName", 
+                fieldLabel : "更新人", 
+                readOnly:true
             }, {
-                text : "备注", 
-                dataIndex : "ord_remark",
-                width : 250, 
-                editor : {
-                    xtype : "textfield"
-                }
-            }
-        ]
-    }, {
-        xtype : "numberfield", 
-        name : "or_amount", 
-        fieldLabel : "收款金额(元)",
-        readOnly:true
-    },{
-        xtype : "textfield", 
-        name : "or_remark", 
-        fieldLabel : "备注", 
-        allowBlank : true, 
-        columnWidth : 0.75
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                xtype : "hidden", 
+                name : "updateTime", 
+                fieldLabel : "更新日期",
+                readOnly:true, 
+                defaultValue: new Date()
+            },{
+                xtype: 'textfield',
+                name: 'or_auditman',
+                fieldLabel: '审核人',
+                readOnly:true
+            },{
+                xtype: "datefield",
+                name: "or_auditdate",
+                fieldLabel: "审核日期",
+                readOnly:true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype: 'textfield',
-        name: 'or_auditman',
-        fieldLabel: '审核人',
-        readOnly:true
-    },{
-        xtype: "datefield",
-        name: "or_auditdate",
-        fieldLabel: "审核日期",
-        readOnly:true
-    }]
+
 });

+ 187 - 184
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -6,191 +6,194 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
     viewModel: 'money-othspendings-formpanel',
 
     viewName: 'money-othspendings-formpanel',
-    caller:'OthSpendings',
-    
-     //字段属性
-     _title:'其它支出单',
-     _idField: 'id',
-     _codeField: 'os_code',
-     _statusField: 'os_status',
-     _statusCodeField: 'os_statuscode',
-     _auditmanField: 'os_auditman',
-     _auditdateField:'os_auditdate',
-     _relationColumn: 'osd_osid',
-     _readUrl:'/api/money/othspendings/read',
-     _saveUrl:'/api/money/othspendings/save',
-     _auditUrl:'/api/money/othspendings/audit',
-     _unAuditUrl: '/api/money/othspendings/unAudit',
-     _deleteUrl:'/api/money/othspendings/delete', 
-     initId:0,
+    caller: 'OthSpendings',
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-         xtype : 'hidden',
-         name : 'os_vendid', 
-         fieldLabel : '供应商ID'
-    }, {
-         xtype : 'hidden', 
-         name : 'os_vendcode', 
-         fieldLabel : '供应商编号'
-     }, {
-         xtype : "vendorDbfindTrigger",
-         name : "os_vendname", 
-         fieldLabel : "供应商名称",
-         // allowBlank : false
-     }, {
-        xtype : 'hidden',
-         name : 'os_bankid', 
-         fieldLabel : '结算账户ID'
-     }, {
-         xtype : 'hidden', 
-         name : 'os_bankcode', 
-         fieldLabel : '结算账户编号'
-     }, {
-         xtype : "bandinfoDbfindTrigger",
-         name : "os_bankname", 
-         fieldLabel : "账户名称",
-         allowBlank : false
-     }, {
-        xtype:'datefield',
-        name : 'os_date',
-        fieldLabel : '单据日期',
-        defaultValue: new Date(),
-        allowBlank : false
-    },{
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        storeModel:'saas.model.money.Othspendings',
-        detnoColumn:  'osd_detno',
-        deleteDetailUrl:'/api/money/othspendings/deleteDetail',
-        columnWidth : 1,
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            }, {
-                text : "期间", 
-                dataIndex : "osd_ym", 
-                editor : {
-                    xtype : "numberfield",
-                    readOnly:true
-                },
-                // defaultValue: Ext.Date.format(new Date(), 'Ym'),
-                width : 110.0, 
-                hidden: true,
-                items : null
-            }, {
-                text : "支出类别", 
-                width : 150.0, 
-                dataIndex : "osd_type",
-                items : null,
-                allowBlank : false,
-                hiddenBtn:false,//true 则会关闭新增按钮功能
-                editor : {
-                    xtype : "remotecombo",
-                    storeUrl:'/api/document/fundinouttype/getCombo?condition=支出',
-                    addHandler:function(b){
-                        var document = Ext.create('saas.view.document.kind.Kind',{});
-                        var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
-                        this.dialog = form.getController().getView().add({
-                            xtype: 'document-kind-childwin',
-                            bind: {
-                                title: '新增支出类别'
-                            },
-                            dataKind:'inoutkind',
-                            belong:document.etc['inoutkind'],
-                            _parent:form,
-                            _combo:this.ownerCmp,
-                            record:null,
-                            session: true
-                        });
-                        this.dialog.show();
+    //字段属性
+    _title: '其它支出单',
+    _idField: 'id',
+    _codeField: 'os_code',
+    _statusField: 'os_status',
+    _statusCodeField: 'os_statuscode',
+    _auditmanField: 'os_auditman',
+    _auditdateField: 'os_auditdate',
+    _relationColumn: 'osd_osid',
+    _readUrl: '/api/money/othspendings/read',
+    _saveUrl: '/api/money/othspendings/save',
+    _auditUrl: '/api/money/othspendings/audit',
+    _unAuditUrl: '/api/money/othspendings/unAudit',
+    _deleteUrl: '/api/money/othspendings/delete',
+    initId: 0,
+
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            }, {
+                xtype: 'hidden',
+                name: 'os_vendid',
+                fieldLabel: '供应商ID'
+            }, {
+                xtype: 'hidden',
+                name: 'os_vendcode',
+                fieldLabel: '供应商编号'
+            }, {
+                xtype: "vendorDbfindTrigger",
+                name: "os_vendname",
+                fieldLabel: "供应商名称",
+                // allowBlank : false
+            }, {
+                xtype: 'hidden',
+                name: 'os_bankid',
+                fieldLabel: '结算账户ID'
+            }, {
+                xtype: 'hidden',
+                name: 'os_bankcode',
+                fieldLabel: '结算账户编号'
+            }, {
+                xtype: "bandinfoDbfindTrigger",
+                name: "os_bankname",
+                fieldLabel: "账户名称",
+                allowBlank: false
+            }, {
+                xtype: 'datefield',
+                name: 'os_date',
+                fieldLabel: '单据日期',
+                defaultValue: new Date(),
+                allowBlank: false
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.Othspendings',
+                detnoColumn: 'osd_detno',
+                deleteDetailUrl: '/api/money/othspendings/deleteDetail',
+                columnWidth: 1,
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "期间",
+                    dataIndex: "osd_ym",
+                    editor: {
+                        xtype: "numberfield",
+                        readOnly: true
+                    },
+                    // defaultValue: Ext.Date.format(new Date(), 'Ym'),
+                    width: 110.0,
+                    hidden: true,
+                    items: null
+                }, {
+                    text: "支出类别",
+                    width: 150.0,
+                    dataIndex: "osd_type",
+                    items: null,
+                    allowBlank: false,
+                    hiddenBtn: false, //true 则会关闭新增按钮功能
+                    editor: {
+                        xtype: "remotecombo",
+                        storeUrl: '/api/document/fundinouttype/getCombo?condition=支出',
+                        addHandler: function (b) {
+                            var document = Ext.create('saas.view.document.kind.Kind', {});
+                            var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                            this.dialog = form.getController().getView().add({
+                                xtype: 'document-kind-childwin',
+                                bind: {
+                                    title: '新增支出类别'
+                                },
+                                dataKind: 'inoutkind',
+                                belong: document.etc['inoutkind'],
+                                _parent: form,
+                                _combo: this.ownerCmp,
+                                record: null,
+                                session: true
+                            });
+                            this.dialog.show();
+                        }
                     }
-                }
-            }, {
-                text : "金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "osd_nowbalance", 
-                width : 110.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
-            }, {
-                text : "备注", 
-                dataIndex : "osd_remark",
-                width : 250, 
-                editor : {
-                    xtype : "textfield"
-                },
-            }
-        ]
-    },{
-        xtype : 'numberfield',
-        name : 'os_amount',
-        fieldLabel : '付款金额(元)',
-        readOnly:true
-    },{
-        xtype : "textfield", 
-        name : "os_remark", 
-        fieldLabel : "备注", 
-        allowBlank : true, 
-        columnWidth : 0.75
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "osd_nowbalance",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "osd_remark",
+                    width: 250,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: 'numberfield',
+                name: 'os_amount',
+                fieldLabel: '付款金额(元)',
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "os_remark",
+                fieldLabel: "备注",
+                allowBlank: true,
+                columnWidth: 0.75
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: 'textfield',
+                name: 'os_auditman',
+                fieldLabel: '审核人',
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "os_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype: 'textfield',
-        name: 'os_auditman',
-        fieldLabel: '审核人',
-        readOnly:true
-    },{
-        xtype: "datefield",
-        name: "os_auditdate",
-        fieldLabel: "审核日期",
-        readOnly:true
-    }]
+
 });

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

@@ -15,7 +15,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
     _statusField: 'pb_status',
     _statusCodeField: 'pb_statuscode',
     _auditmanField: 'pb_auditman',
-    _auditdateField:'pb_auditdate',
+    _auditdateField: 'pb_auditdate',
     _readUrl: '/api/money/paybalance/read',
     _saveUrl: '/api/money/paybalance/save',
     _auditUrl: '/api/money/paybalance/audit',
@@ -25,354 +25,370 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
 
     toolBtns: [],
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-        xtype: 'hidden',
-        name: 'pb_kind',
-        fieldLabel: '单据类型',
-        defaultValue: '付款单',
-        readOnly: true
-    },  {
-        xtype: 'hidden',
-        name: 'pb_vendid',
-        fieldLabel: '供应商ID'
-    }, {
-        xtype: "hidden",
-        name: "pb_vendcode",
-        fieldLabel: "供应商编号"
-    }, {
-        xtype: "vendorDbfindTrigger",
-        name: "pb_vendname",
-        fieldLabel: "供应商名称",
-        allowBlank : false,
-        listeners: {
-            change: 'clearDetails'
-        }
-    },{
-        xtype:"numberfield",
-        name:"ve_leftamount",
-        fieldLabel:"总欠款(元)",
-        thousandSeparator: ',',
-        ignore:true,
-        readOnly: true
-    },{
-        xtype: "datefield",
-        name: "pb_date",
-        fieldLabel: "日期",
-        defaultValue: new Date(),
-        allowBlank : false
-    },{
-        xtype: 'textfield',
-        name: 'pb_manname',
-        fieldLabel: '付款人',
-        defaultValue: saas.util.BaseUtil.getCurrentUser().realname
-    }, {
-        xtype: 'hidden',
-        name: 'pb_pdamount',
-        thousandSeparator: ',',
-        fieldLabel: '付款金额(元)'
-    }, {
-        xtype: "hidden",
-        name: "pb_pbdamount",
-        thousandSeparator: ',',
-        fieldLabel: "本次核销金额(元)"
-    }, {
-        xtype: "numberfield",
-        name: "pb_preamount",
-        fieldLabel: "本次预付(元)",
-        thousandSeparator: ',',
-        readOnly: true
-    }, {
-        xtype: 'numberfield',
-        name: 'pb_discounts',
-        fieldLabel: '整单折扣(元)',
-        hidden: true
-    }, {
-        xtype: 'hidden',
-        name: 'pb_havebalance',
-        thousandSeparator: ',',
-        fieldLabel: '已核销金额(元)'
-    }, {
-        xtype: "detailGridField",
-        storeModel: 'saas.model.money.PayBalance1',
-        detnoColumn: 'pd_detno',
-        deleteDetailUrl: '/api/money/paybalance/deleteDetail1',
-        columns: [
-        {
-            text: 'ID',
-            dataIndex: 'id',
-            hidden: true
-        }, {
-            text: '期间',
-            dataIndex: 'pd_ym',
-            hidden:true,
-            defaultValue: Ext.Date.format(new Date(), 'Ym'),
-            width : 110.0
-        }, {
-            text: '结算账户ID',
-            dataIndex: 'pd_bankid',
-            hidden: true
-        }, {
-            text: '资金账户',
-            dataIndex: 'pd_bankname',
-            width : 200.0,
-            allowBlank : false,
-            editor:{
-                xtype:'bandinfoDbfindTrigger'
-            }
-        },{
-            text: '资金账户编号',
-            dataIndex: 'pd_bankcode',
-            hidden: true
-        }, {
-            text: "付款金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_amount",
-            width : 110.0,
-            allowBlank : false,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 2,
-                thousandSeparator: ','
-            },
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "结算方式",
-            dataIndex: "pd_paymethod",
-            width :200.0,
-            editor : {
-                xtype:'combo',
-                queryMode: 'local',
-                displayField: 'display',
-                valueField: 'value',
-                store:Ext.create('Ext.data.Store', {
-                    fields: ['value', 'display'],
-                    data : [
-                        {value:"信用卡", display:"信用卡"},
-                        {value:"支票", display:"支票"},
-                        {value:"汇票", display:"汇票"},
-                        {value:"现金", display:"现金"},
-                        {value:"银行转账", display:"银行转账"},
-                        {value:"支付宝转账", display:"支付宝转账"},
-                        {value:"微信转账", display:"微信转账"}
-                        ]
-                })
-            }
-        }, {
-            text: "结算号",
-            dataIndex: "pd_paycode",
-            width : 150.0,
-            editor:{
-                xtype:'textfield'
-            }
-        }, {
-            text: "备注",
-            dataIndex: "pd_remark",
-            width: 250,
-            editor:{
-                xtype: 'textfield'
-            }
-        }]
-    },{
-        xtype: "detailGridField",
-        storeModel: 'saas.model.money.PayBalance2',
-        detnoColumn: 'pbd_detno',
-        allowEmpty: true,
-        deleteDetailUrl: '/api/money/paybalance/deleteDetail2',
-        columns: [
-        {
-            text: 'ID',
-            dataIndex: 'id',
-            hidden: true
-        }, {
-            text: '期间',
-            dataIndex: 'pbd_ym',
-            hidden: true
-        }, {
-            text: '来源ID',
-            dataIndex: 'pbd_slid',
-            hidden: true
-        }, {
-            text: '来源单号',
-            dataIndex: 'pbd_slcode', 
-            width : 150,
-            editor:{
-                displayField : "display",
-                editable : true,
-                format : "",
-                hideTrigger : false,
-                maxLength : 100.0,
-                minValue : null,
-                positiveNum : false,
-                queryMode : "local",
-                store : null,
-                valueField : "value",
-                xtype : "oriOrderMutiDbfindTrigger",
-                listeners:{
-                    beforetriggerclick:'vendnamechange'
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            }, {
+                xtype: 'hidden',
+                name: 'pb_kind',
+                fieldLabel: '单据类型',
+                defaultValue: '付款单',
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'pb_vendid',
+                fieldLabel: '供应商ID'
+            }, {
+                xtype: "hidden",
+                name: "pb_vendcode",
+                fieldLabel: "供应商编号"
+            }, {
+                xtype: "vendorDbfindTrigger",
+                name: "pb_vendname",
+                fieldLabel: "供应商名称",
+                allowBlank: false,
+                listeners: {
+                    change: 'clearDetails'
                 }
-            },
+            }, {
+                xtype: "numberfield",
+                name: "ve_leftamount",
+                fieldLabel: "总欠款(元)",
+                thousandSeparator: ',',
+                ignore: true,
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pb_date",
+                fieldLabel: "日期",
+                defaultValue: new Date(),
+                allowBlank: false
+            }, {
+                xtype: 'textfield',
+                name: 'pb_manname',
+                fieldLabel: '付款人',
+                defaultValue: saas.util.BaseUtil.getCurrentUser().realname
+            }, {
+                xtype: 'hidden',
+                name: 'pb_pdamount',
+                thousandSeparator: ',',
+                fieldLabel: '付款金额(元)'
+            }, {
+                xtype: "hidden",
+                name: "pb_pbdamount",
+                thousandSeparator: ',',
+                fieldLabel: "本次核销金额(元)"
+            }, {
+                xtype: "numberfield",
+                name: "pb_preamount",
+                fieldLabel: "本次预付(元)",
+                thousandSeparator: ',',
+                readOnly: true
+            }, {
+                xtype: 'numberfield',
+                name: 'pb_discounts',
+                fieldLabel: '整单折扣(元)',
+                hidden: true
+            }, {
+                xtype: 'hidden',
+                name: 'pb_havebalance',
+                thousandSeparator: ',',
+                fieldLabel: '已核销金额(元)'
+            }, {
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.PayBalance1',
+                detnoColumn: 'pd_detno',
+                deleteDetailUrl: '/api/money/paybalance/deleteDetail1',
+                columns: [{
+                    text: 'ID',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '期间',
+                    dataIndex: 'pd_ym',
+                    hidden: true,
+                    defaultValue: Ext.Date.format(new Date(), 'Ym'),
+                    width: 110.0
+                }, {
+                    text: '结算账户ID',
+                    dataIndex: 'pd_bankid',
+                    hidden: true
+                }, {
+                    text: '资金账户',
+                    dataIndex: 'pd_bankname',
+                    width: 200.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: 'bandinfoDbfindTrigger'
+                    }
+                }, {
+                    text: '资金账户编号',
+                    dataIndex: 'pd_bankcode',
+                    hidden: true
+                }, {
+                    text: "付款金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_amount",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2,
+                        thousandSeparator: ','
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "结算方式",
+                    dataIndex: "pd_paymethod",
+                    width: 200.0,
+                    editor: {
+                        xtype: 'combo',
+                        queryMode: 'local',
+                        displayField: 'display',
+                        valueField: 'value',
+                        store: Ext.create('Ext.data.Store', {
+                            fields: ['value', 'display'],
+                            data: [{
+                                value: "信用卡",
+                                display: "信用卡"
+                            }, {
+                                value: "支票",
+                                display: "支票"
+                            }, {
+                                value: "汇票",
+                                display: "汇票"
+                            }, {
+                                value: "现金",
+                                display: "现金"
+                            }, {
+                                value: "银行转账",
+                                display: "银行转账"
+                            }, {
+                                value: "支付宝转账",
+                                display: "支付宝转账"
+                            }, {
+                                value: "微信转账",
+                                display: "微信转账"
+                            }]
+                        })
+                    }
+                }, {
+                    text: "结算号",
+                    dataIndex: "pd_paycode",
+                    width: 150.0,
+                    editor: {
+                        xtype: 'textfield'
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    editor: {
+                        xtype: 'textfield'
+                    }
+                }]
+            }, {
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.PayBalance2',
+                detnoColumn: 'pbd_detno',
+                allowEmpty: true,
+                deleteDetailUrl: '/api/money/paybalance/deleteDetail2',
+                columns: [{
+                    text: 'ID',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '期间',
+                    dataIndex: 'pbd_ym',
+                    hidden: true
+                }, {
+                    text: '来源ID',
+                    dataIndex: 'pbd_slid',
+                    hidden: true
+                }, {
+                    text: '来源单号',
+                    dataIndex: 'pbd_slcode',
+                    width: 150,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "oriOrderMutiDbfindTrigger",
+                        listeners: {
+                            beforetriggerclick: 'vendnamechange'
+                        }
+                    },
 
-        }, {
-            text: "业务类型",
-            dataIndex: "pbd_slkind", 
-            width : 110
-        }, {
-            text: "单据日期",
-            dataIndex: "pbd_sldate",
-            xtype: 'datecolumn', 
-            width : 110
-        }, {
-            text: "单据金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pbd_amount", 
-            width : 110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "已核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "sl_yamount", 
-            width : 120,
-            ignore:true,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "未核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "sl_namount",
-            ignore:true, 
-            width : 120,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "本次核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pbd_nowbalance",
-            width: 140,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 2
-            },
-            allowBlank : false,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: '备注',
-            dataIndex: 'pbd_remark',
-            width: 250,
-            hidden: true
-        }]
-    }, {
-        xtype: 'textfield',
-        name: 'pb_remark',
-        columnWidth: 1,
-        fieldLabel: '备注'
-    }, {
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                }, {
+                    text: "业务类型",
+                    dataIndex: "pbd_slkind",
+                    width: 110
+                }, {
+                    text: "单据日期",
+                    dataIndex: "pbd_sldate",
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: "单据金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pbd_amount",
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "已核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sl_yamount",
+                    width: 120,
+                    ignore: true,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "未核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sl_namount",
+                    ignore: true,
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "本次核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pbd_nowbalance",
+                    width: 140,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    allowBlank: false,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: '备注',
+                    dataIndex: 'pbd_remark',
+                    width: 250,
+                    hidden: true
+                }]
+            }, {
+                xtype: 'textfield',
+                name: 'pb_remark',
+                columnWidth: 1,
+                fieldLabel: '备注'
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: 'textfield',
+                name: 'pb_auditman',
+                fieldLabel: '审核人',
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pb_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'pb_text1',
+                fieldLabel: '自定义字段1'
+            }, {
+                xtype: 'hidden',
+                name: 'pb_text2',
+                fieldLabel: '自定义字段2'
+            }, {
+                xtype: 'hidden',
+                name: 'pb_text3',
+                fieldLabel: '自定义字段3'
+            }, {
+                xtype: 'hidden',
+                name: 'pb_text4',
+                fieldLabel: '自定义字段4'
+            }, {
+                xtype: 'hidden',
+                name: 'pb_text5',
+                fieldLabel: '自定义字段5'
+            }],
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype: 'textfield',
-        name: 'pb_auditman',
-        fieldLabel: '审核人',
-        readOnly: true
-    },{
-        xtype: "datefield",
-        name: "pb_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }, {
-        xtype: 'hidden',
-        name: 'pb_text1',
-        fieldLabel: '自定义字段1'
-    }, {
-        xtype: 'hidden',
-        name: 'pb_text2',
-        fieldLabel: '自定义字段2'
-    }, {
-        xtype: 'hidden',
-        name: 'pb_text3',
-        fieldLabel: '自定义字段3'
-    }, {
-        xtype: 'hidden',
-        name: 'pb_text4',
-        fieldLabel: '自定义字段4'
-    }, {
-        xtype: 'hidden',
-        name: 'pb_text5',
-        fieldLabel: '自定义字段5'
-    }],
 
-    beforeAudit: function() {
+
+    beforeAudit: function () {
         var form = this,
-        idField = form._idField,
-        controller = form.getController(),
-        viewModel = form.getViewModel(),
-        id = viewModel.get(idField);
+            idField = form._idField,
+            controller = form.getController(),
+            viewModel = form.getViewModel(),
+            id = viewModel.get(idField);
         store1 = viewModel.get('detail0').detailStore,
-        store2 = viewModel.get('detail1').detailStore;
+            store2 = viewModel.get('detail1').detailStore;
 
         // 已保存过的单据不进行此项校验
-        if(id) {
+        if (id) {
             return true;
         }
 
@@ -381,17 +397,17 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         var sum_pbd_nowbalance = store2.sum('pbd_nowbalance'); // 本次核销金额合计
 
         var flag = sum_pd_amount + pb_discounts - sum_pbd_nowbalance;
-         viewModel.set("pb_preamount",flag);
-        if(flag != 0) {
+        viewModel.set("pb_preamount", flag);
+        if (flag != 0) {
             var t = flag > 0 ? '大' : '小';
 
             saas.util.BaseUtil.showConfirm('提示', '付款金额' + t + '于本次核销金额,是否仍要保存并审核?')
-            .then(function(y) {
-                if(y == 'yes') {
-                    controller.audit();
-                }
-            });
-        }else {
+                .then(function (y) {
+                    if (y == 'yes') {
+                        controller.audit();
+                    }
+                });
+        } else {
             controller.audit();
         }
         return false;

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

@@ -16,7 +16,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     _statusField: 'rb_status',
     _statusCodeField: 'rb_statuscode',
     _auditmanField: 'rb_auditman',
-    _auditdateField:'rb_auditdate',
+    _auditdateField: 'rb_auditdate',
     _readUrl: '/api/money/recbalance/read',
     _saveUrl: '/api/money/recbalance/save',
     _auditUrl: '/api/money/recbalance/audit',
@@ -24,331 +24,348 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     _deleteUrl: '/api/money/recbalance/delete',
     initId: 0,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-        xtype: 'hidden',
-        name: 'rb_custid',
-        fieldLabel: '客户ID'
-    }, {
-        xtype: 'hidden',
-        name: 'rb_kind',
-        fieldLabel: '单据类型',
-        defaultValue: '收款单',
-        readOnly: true
-    }, {
-        xtype: 'hidden',
-        name: 'rb_custcode',
-        fieldLabel: '客户编号'
-    }, {
-        xtype: "customerDbfindTrigger",
-        name: "rb_custname",
-        fieldLabel: "客户名称",
-        allowBlank : false,
-        listeners: {
-            change: 'clearDetails'
-        }
-    }, {
-        xtype: "numberfield",
-        name: "cu_leftamount",
-        fieldLabel: "总欠款",
-        ignore: true,
-        readOnly: true
-    }, {
-        xtype: 'hidden',
-        name: 'rb_rbdamount',
-        fieldLabel: '本次核销金额(元)'
-    },{
-        xtype: 'hidden',
-        name: 'rb_rdamount',
-        fieldLabel: '本次付款金额(元)',
-    },  {
-        xtype: "datefield",
-        name: "rb_date",
-        fieldLabel: "日期",
-        defaultValue: new Date(),
-        allowBlank : false
-    }, {
-        xtype: "textfield",
-        name: "rb_manname",
-        fieldLabel: "收款人",
-        defaultValue: saas.util.BaseUtil.getCurrentUser().realname
-    }, {
-        xtype: "numberfield",
-        name: "rb_discounts",
-        fieldLabel: "整单折扣",
-        hidden: true
-    }, {
-        xtype: 'numberfield',
-        name: 'rb_preamount',
-        fieldLabel : '本次预收款',
-        readOnly: true
-    }, {
-        xtype: 'hidden',
-        name: 'rb_havebalance',
-        fieldLabel: '已核销金额(元)'
-    }, {
-        xtype: "detailGridField",
-        storeModel: 'saas.model.money.RecBalance1',
-        detnoColumn: 'rd_detno',
-        deleteDetailUrl: '/api/money/recbalance/deleteDetail1',
-        columns: [{
-            text: 'ID',
-            dataIndex: 'id',
-            hidden: true
-        }, {
-            text: '期间',
-            dataIndex: 'rd_ym',
-            defaultValue: Ext.Date.format(new Date(), 'Ym'),
-            width : 110,
-            hidden: true
-        }, {
-            text: '资金账户ID',
-            dataIndex: 'rd_bankid',
-            editor: {
-                xtype: 'numberfield'
-            },
-            hidden: true
-        }, {
-            text: '资金账户编号',
-            dataIndex: 'rd_bankcode',
-            editor: {
-                xtype: 'textfield'
-            },
-            hidden: true
-        }, {
-            text: '资金账户',
-            dataIndex: 'rd_bankname',
-            allowBlank : false,
-            width: 200,
-            editor:{
-                xtype:'bandinfoDbfindTrigger'
-            }
-        }, {
-            text: "收款金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "rd_amount",
-            width : 110.0,
-            allowBlank : false,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 2
-            },
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "结算方式",
-            dataIndex: "rd_paymethod",
-            width : 150.0,
-            editor : {
-                xtype:'combo',
-                queryMode: 'local',
-                displayField: 'display',
-                valueField: 'value',
-                store:Ext.create('Ext.data.Store', {
-                    fields: ['value', 'display'],
-                    data : [
-                        {value:"信用卡", display:"信用卡"},
-                        {value:"支票", display:"支票"},
-                        {value:"汇票", display:"汇票"},
-                        {value:"现金", display:"现金"},
-                        {value:"银行转账", display:"银行转账"},
-                        {value:"支付宝转账", display:"支付宝转账"},
-                        {value:"微信转账", display:"微信转账"}
-                    ]
-                })
-            }
-        }, {
-            text: "结算号",
-            dataIndex: "rd_paycode",
-            editor: {
-                xtype: 'textfield'
-            }
-        }, {
-            text: "备注",
-            dataIndex: "rd_remark",
-            width: 250,
-            editor: {
-                xtype: 'textfield'
-            }
-        }]
-    },{
-        xtype: "detailGridField",
-        storeModel: 'saas.model.money.RecBalance2',
-        detnoColumn: 'rbd_detno',
-        allowEmpty: true,
-        deleteDetailUrl: '/api/money/recbalance/deleteDetail2',
-        columns: [{
-            text: 'ID',
-            dataIndex: 'id',
-            hidden: true
-        }, {
-            text: '期间',
-            dataIndex: 'rbd_ym',
-            editor: {
-                xtype: 'numberfield'
-            },
-            hidden: true
-        }, {
-            text: '来源ID',
-            dataIndex: 'rbd_slid',
-            editor: {
-                xtype: 'numberfield'
-            },
-            hidden: true
-        }, {
-            text: '来源单号',
-            dataIndex: 'rbd_slcode',
-            width: 200,
-            editor:{
-                displayField : "display",
-                editable : true,
-                format : "",
-                hideTrigger : false,
-                maxLength : 100.0,
-                minValue : null,
-                positiveNum : false,
-                queryMode : "local",
-                store : null,
-                valueField : "value",
-                xtype : "oriOrderMutiDbfindTrigger",
-                listeners:{
-                    beforetriggerclick:'custnamechange'
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            }, {
+                xtype: 'hidden',
+                name: 'rb_custid',
+                fieldLabel: '客户ID'
+            }, {
+                xtype: 'hidden',
+                name: 'rb_kind',
+                fieldLabel: '单据类型',
+                defaultValue: '收款单',
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'rb_custcode',
+                fieldLabel: '客户编号'
+            }, {
+                xtype: "customerDbfindTrigger",
+                name: "rb_custname",
+                fieldLabel: "客户名称",
+                allowBlank: false,
+                listeners: {
+                    change: 'clearDetails'
                 }
-            }
-        }, {
-            text: "业务类型",
-            dataIndex: "rbd_slkind",
-            width:110
-        }, {
-            text: "单据日期",
-            dataIndex: "rbd_sldate",
-            xtype: 'datecolumn',
-            width:110
-        }, {
-            text: "单据金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "rbd_amount",
-            width:110,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "已核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "sl_yamount",
-            width:120,
-            ignore:true,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "未核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "sl_namount",
-            width:120,
-            ignore:true,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "本次核销金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "rbd_nowbalance",
-            width:140,
-            editor : {
-                xtype : "numberfield",
-                decimalPrecision: 2
-            },
-            allowBlank : false,
-            renderer : function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function(v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }]
-    }, {
-        xtype: 'textfield',
-        name: 'rb_remark',
-        fieldLabel: '备注',
-        columnWidth: 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+            }, {
+                xtype: "numberfield",
+                name: "cu_leftamount",
+                fieldLabel: "总欠款",
+                ignore: true,
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'rb_rbdamount',
+                fieldLabel: '本次核销金额(元)'
+            }, {
+                xtype: 'hidden',
+                name: 'rb_rdamount',
+                fieldLabel: '本次付款金额(元)',
+            }, {
+                xtype: "datefield",
+                name: "rb_date",
+                fieldLabel: "日期",
+                defaultValue: new Date(),
+                allowBlank: false
+            }, {
+                xtype: "textfield",
+                name: "rb_manname",
+                fieldLabel: "收款人",
+                defaultValue: saas.util.BaseUtil.getCurrentUser().realname
+            }, {
+                xtype: "numberfield",
+                name: "rb_discounts",
+                fieldLabel: "整单折扣",
+                hidden: true
+            }, {
+                xtype: 'numberfield',
+                name: 'rb_preamount',
+                fieldLabel: '本次预收款',
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'rb_havebalance',
+                fieldLabel: '已核销金额(元)'
+            }, {
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.RecBalance1',
+                detnoColumn: 'rd_detno',
+                deleteDetailUrl: '/api/money/recbalance/deleteDetail1',
+                columns: [{
+                    text: 'ID',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '期间',
+                    dataIndex: 'rd_ym',
+                    defaultValue: Ext.Date.format(new Date(), 'Ym'),
+                    width: 110,
+                    hidden: true
+                }, {
+                    text: '资金账户ID',
+                    dataIndex: 'rd_bankid',
+                    editor: {
+                        xtype: 'numberfield'
+                    },
+                    hidden: true
+                }, {
+                    text: '资金账户编号',
+                    dataIndex: 'rd_bankcode',
+                    editor: {
+                        xtype: 'textfield'
+                    },
+                    hidden: true
+                }, {
+                    text: '资金账户',
+                    dataIndex: 'rd_bankname',
+                    allowBlank: false,
+                    width: 200,
+                    editor: {
+                        xtype: 'bandinfoDbfindTrigger'
+                    }
+                }, {
+                    text: "收款金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "rd_amount",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "结算方式",
+                    dataIndex: "rd_paymethod",
+                    width: 150.0,
+                    editor: {
+                        xtype: 'combo',
+                        queryMode: 'local',
+                        displayField: 'display',
+                        valueField: 'value',
+                        store: Ext.create('Ext.data.Store', {
+                            fields: ['value', 'display'],
+                            data: [{
+                                value: "信用卡",
+                                display: "信用卡"
+                            }, {
+                                value: "支票",
+                                display: "支票"
+                            }, {
+                                value: "汇票",
+                                display: "汇票"
+                            }, {
+                                value: "现金",
+                                display: "现金"
+                            }, {
+                                value: "银行转账",
+                                display: "银行转账"
+                            }, {
+                                value: "支付宝转账",
+                                display: "支付宝转账"
+                            }, {
+                                value: "微信转账",
+                                display: "微信转账"
+                            }]
+                        })
+                    }
+                }, {
+                    text: "结算号",
+                    dataIndex: "rd_paycode",
+                    editor: {
+                        xtype: 'textfield'
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "rd_remark",
+                    width: 250,
+                    editor: {
+                        xtype: 'textfield'
+                    }
+                }]
+            }, {
+                xtype: "detailGridField",
+                storeModel: 'saas.model.money.RecBalance2',
+                detnoColumn: 'rbd_detno',
+                allowEmpty: true,
+                deleteDetailUrl: '/api/money/recbalance/deleteDetail2',
+                columns: [{
+                    text: 'ID',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '期间',
+                    dataIndex: 'rbd_ym',
+                    editor: {
+                        xtype: 'numberfield'
+                    },
+                    hidden: true
+                }, {
+                    text: '来源ID',
+                    dataIndex: 'rbd_slid',
+                    editor: {
+                        xtype: 'numberfield'
+                    },
+                    hidden: true
+                }, {
+                    text: '来源单号',
+                    dataIndex: 'rbd_slcode',
+                    width: 200,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "oriOrderMutiDbfindTrigger",
+                        listeners: {
+                            beforetriggerclick: 'custnamechange'
+                        }
+                    }
+                }, {
+                    text: "业务类型",
+                    dataIndex: "rbd_slkind",
+                    width: 110
+                }, {
+                    text: "单据日期",
+                    dataIndex: "rbd_sldate",
+                    xtype: 'datecolumn',
+                    width: 110
+                }, {
+                    text: "单据金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "rbd_amount",
+                    width: 110,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "已核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sl_yamount",
+                    width: 120,
+                    ignore: true,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "未核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "sl_namount",
+                    width: 120,
+                    ignore: true,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "本次核销金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "rbd_nowbalance",
+                    width: 140,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    allowBlank: false,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }]
+            }, {
+                xtype: 'textfield',
+                name: 'rb_remark',
+                fieldLabel: '备注',
+                columnWidth: 1
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: 'textfield',
+                name: 'rb_auditman',
+                fieldLabel: '审核人',
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "rb_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }],
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    }, {
-        xtype: 'textfield',
-        name: 'rb_auditman',
-        fieldLabel: '审核人',
-        readOnly: true
-    },{
-        xtype: "datefield",
-        name: "rb_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }],
 
-    beforeAudit: function() {
+    beforeAudit: function () {
         var form = this,
-        idField = form._idField,
-        controller = form.getController(),
-        viewModel = form.getViewModel(),
-        id = viewModel.get(idField);
+            idField = form._idField,
+            controller = form.getController(),
+            viewModel = form.getViewModel(),
+            id = viewModel.get(idField);
         store1 = viewModel.get('detail0').detailStore,
-        store2 = viewModel.get('detail1').detailStore;
+            store2 = viewModel.get('detail1').detailStore;
 
         // 已保存过的单据不进行此项校验
-        if(id) {
+        if (id) {
             return true;
         }
 
@@ -358,17 +375,17 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
 
         var flag = sum_rd_amount + rb_discounts - sum_rbd_nowbalance;
 
-        viewModel.set("rb_preamount",flag);
-        if(flag != 0) {
+        viewModel.set("rb_preamount", flag);
+        if (flag != 0) {
             var t = flag > 0 ? '大' : '小';
 
             saas.util.BaseUtil.showConfirm('提示', '付款金额' + t + '于本次核销金额,是否仍要保存并审核?')
-            .then(function(y) {
-                if(y == 'yes') {
-                    controller.audit();
-                }
-            });
-        }else {
+                .then(function (y) {
+                    if (y == 'yes') {
+                        controller.audit();
+                    }
+                });
+        } else {
             controller.audit();
         }
         return false;

+ 381 - 378
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -25,383 +25,389 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     _turnOutUrl: '/api/purchase/prodinout/turnProdOut',
     initId: 0,
 
-    toolBtns: [{
-        xtype: 'button',
-        text: '转采购验退单',
-        hidden: true,
-        bind: {
-            hidden: '{turnHidden}'
-        },
-        handler: 'turnOut'
-    }],
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0
-    }, {
-        xtype: "hidden",
-        name: "pi_class",
-        fieldLabel: "单据类型",
-        readOnly: true,
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_vendid",
-        fieldLabel: "供应商ID",
-        allowBlank: true,
-        columnWidth: 0.0
-    }, {
-        xtype: 'hidden',
-        name: 'pi_vendcode',
-        fieldLabel: '供应商编号'
-    }, {
-        xtype: 'vendorDbfindTrigger',
-        name: 'pi_vendname',
-        fieldLabel: '供应商名称',
-        allowBlank: false,
-    }, {
-        xtype: "datefield",
-        name: "pi_date",
-        fieldLabel: "单据日期",
-        allowBlank: false,
-        columnWidth: 0.25,
-        defaultValue: new Date()
-    }, {
-        xtype: "hidden",
-        name: "pi_puid",
-        fieldLabel: "采购单id",
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_pucode",
-        fieldLabel: "采购单号",
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        name: "detailGridField",
-        xtype: "detailGridField",
-        storeModel: 'saas.model.purchase.ProdInDetail',
-        deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
-        detnoColumn: 'pd_pdno',
-        columns: [{
-            text: "id",
-            dataIndex: "id",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "物料id",
-            dataIndex: "pd_prodid",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "物料编号",
-            width: 150.0,
-            dataIndex: "pd_prodcode",
-            xtype: "",
-            items: null,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "productMultiDbfindTrigger"
-            }
-        }, {
-            text: "品牌",
-            width: 100.0,
-            dataIndex: "pr_brand",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "物料名称",
-            width: 150.0,
-            dataIndex: "pr_detail",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "型号",
-            width: 200.0,
-            dataIndex: "pr_orispeccode",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "规格",
-            width: 200,
-            dataIndex: "pr_spec",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: 'model映射需要',
-            dataIndex: 'productDTO',
-            hidden: true,
-        }, {
-            text: "仓库id",
-            dataIndex: "pd_whid",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "仓库编号",
-            dataIndex: "pd_whcode",
-            hidden: true
-        }, {
-            text: "仓库",
-            dataIndex: "pd_whname",
-            width: 110.0,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "warehouseDbfindTrigger"
-            }
-        }, {
-            text: "数量",
-            dataIndex: "pd_inqty",
-            xtype: 'numbercolumn',
-            width: 110.0,
-            allowBlank: false,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 3,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            }
-        }, {
-            text: "单位",
-            width: 65.0,
-            dataIndex: "pr_unit",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "单价(元)",
-            xtype: 'numbercolumn',
-            width: 120,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            dataIndex: "pd_netprice",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-        }, {
-            text: "含税单价(元)",
-            xtype: 'numbercolumn',
-            width: 120,
-            editor: {
+    initComponent: function () {
+        Ext.applyIf(this, {
+            toolBtns: [{
+                xtype: 'button',
+                text: '转采购验退单',
+                hidden: true,
+                bind: {
+                    hidden: '{turnHidden}'
+                },
+                handler: 'turnOut'
+            }],
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0
+            }, {
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_vendid",
+                fieldLabel: "供应商ID",
+                allowBlank: true,
+                columnWidth: 0.0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_vendcode',
+                fieldLabel: '供应商编号'
+            }, {
+                xtype: 'vendorDbfindTrigger',
+                name: 'pi_vendname',
+                fieldLabel: '供应商名称',
+                allowBlank: false,
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "pi_puid",
+                fieldLabel: "采购单id",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_pucode",
+                fieldLabel: "采购单号",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.purchase.ProdInDetail',
+                deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
+                detnoColumn: 'pd_pdno',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "仓库id",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "pd_whname",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "数量",
+                    dataIndex: "pd_inqty",
+                    xtype: 'numbercolumn',
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 65.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    dataIndex: "pd_netprice",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                }, {
+                    text: "含税单价(元)",
+                    xtype: 'numbercolumn',
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    dataIndex: "pd_orderprice",
+                    width: 120.0,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                    listeners: {
+                        edit: function (value, grid) {
+                            var r = grid.getSelection()[0],
+                                pd_taxrate = r.get('pd_taxrate');
+                            var v = value / (1 + pd_taxrate / 100);
+                            r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
+                        }
+                    }
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_nettotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    xtype: 'numbercolumn',
+                    text: "税率(%)",
+                    dataIndex: "pd_taxrate",
+                    width: 80,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 0,
+                        minValue: 0,
+                        maxValue: 100
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    },
+                }, {
+                    text: "税额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxamount",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "价税合计(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_ordertotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "关联采购单号",
+                    dataIndex: "pd_ordercode",
+                    width: 150.0,
+                    ignore: true,
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    }
+                }]
+            }, {
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
+            }, {
+                xtype: "textfield",
+                name: "pi_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            }, {
                 xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            dataIndex: "pd_orderprice",
-            width: 120.0,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-            listeners: {
-                edit: function (value, grid) {
-                    var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_taxrate');
-                    var v = value / (1 + pd_taxrate / 100);
-                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
-                }
-            }
-        }, {
-            text: "金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_nettotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            xtype: 'numbercolumn',
-            text: "税率(%)",
-            dataIndex: "pd_taxrate",
-            width: 80,
-            editor: {
+                name: "pi_nettotal",
+                fieldLabel: "金额(元)",
+                readOnly: true,
+                thousandSeparator: ',',
+                columnWidth: 0.25
+            }, {
                 xtype: "numberfield",
-                decimalPrecision: 0,
-                minValue: 0,
-                maxValue: 100
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, false);
-            },
-        }, {
-            text: "税额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_taxamount",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "价税合计(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_ordertotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "关联采购单号",
-            dataIndex: "pd_ordercode",
-            width: 150.0,
-            ignore: true,
-        }, {
-            text: "备注",
-            dataIndex: "pd_remark",
-            width: 250,
-            items: null,
-            editor: {
-                xtype: "textfield"
-            }
-        }]
-    }, {
-        xtype: "textfield",
-        name: "pi_remark",
-        fieldLabel: "备注",
-        columnWidth: 1
-    }, {
-        xtype: "textfield",
-        name: "pi_currency",
-        fieldLabel: "币别",
-        readOnly: true,
-        defaultValue: 'RMB'
-    }, {
-        xtype: "numberfield",
-        name: "pi_nettotal",
-        fieldLabel: "金额(元)",
-        readOnly: true,
-        thousandSeparator: ',',
-        columnWidth: 0.25
-    }, {
-        xtype: "numberfield",
-        name: "pi_total",
-        fieldLabel: "价税合计(元)",
-        readOnly: true,
-        thousandSeparator: ',',
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_buyercode",
-        fieldLabel: "采购员编号"
-    }, {
-        xtype: "employeeDbfindTrigger",
-        name: "pi_buyername",
-        fieldLabel: "采购员",
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_buyerid",
-        fieldLabel: "采购员ID"
-    }, {
-        xtype: "hidden",
-        name: "creatorId",
-        fieldLabel: "录入人ID",
-        readOnly: true
-    }, {
-        xtype: "textfield",
-        name: "creatorName",
-        fieldLabel: "录入人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "createTime",
-        fieldLabel: "录入日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "hidden",
-        name: "updaterId",
-        fieldLabel: "更新人ID",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updaterName",
-        fieldLabel: "更新人",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updateTime",
-        fieldLabel: "更新日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "textfield",
-        name: "pi_auditman",
-        fieldLabel: "审核人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "pi_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }],
+                name: "pi_total",
+                fieldLabel: "价税合计(元)",
+                readOnly: true,
+                thousandSeparator: ',',
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_buyercode",
+                fieldLabel: "采购员编号"
+            }, {
+                xtype: "employeeDbfindTrigger",
+                name: "pi_buyername",
+                fieldLabel: "采购员",
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_buyerid",
+                fieldLabel: "采购员ID"
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }],
+        });
+        this.callParent(arguments);
+    },
+
     beforeAudit: function () {
         var me = this,
             viewModel = me.getViewModel(),
@@ -414,7 +420,4 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         });
         return true;
     }
-
-
-
 });

+ 382 - 375
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -24,381 +24,388 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     _deleteUrl: '/api/purchase/prodinout/delete',
     initId: 0,
     toolBtns: [],
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0
-    }, {
-        xtype: 'hidden',
-        name: 'pi_ioid',
-        fieldLabel: 'pi_ioid'
-    }, {
-        xtype: "hidden",
-        name: "pi_class",
-        fieldLabel: "单据类型",
-        readOnly: true,
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_vendid",
-        fieldLabel: "供应商ID",
-        allowBlank: true,
-        hidden: true,
-        columnWidth: 0.0
-    }, {
-        xtype: 'hidden',
-        name: 'pi_vendcode',
-        fieldLabel: '供应商编号'
-    }, {
-        xtype: 'vendorDbfindTrigger',
-        name: 'pi_vendname',
-        fieldLabel: '供应商名称',
-        allowBlank: false,
-    }, {
-        xtype: "datefield",
-        name: "pi_date",
-        fieldLabel: "单据日期",
-        allowBlank: false,
-        columnWidth: 0.25,
-        defaultValue: new Date()
-    }, {
-        xtype: "hidden",
-        name: "pi_puid",
-        fieldLabel: "采购单id",
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_pucode",
-        fieldLabel: "采购单号",
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        name: "detailGridField",
-        xtype: "detailGridField",
-        storeModel: 'saas.model.purchase.ProdOutDetail',
-        deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
-        detnoColumn: 'pd_pdno',
-        columns: [{
-            text: "id",
-            dataIndex: "id",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "物料id",
-            dataIndex: "pd_prodid",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "物料编号",
-            width: 150.0,
-            dataIndex: "pd_prodcode",
-            xtype: "",
-            items: null,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "productMultiDbfindTrigger"
-            }
-        }, {
-            text: 'model映射需要',
-            dataIndex: 'productDTO',
-            hidden: true,
-        }, {
-            text: "品牌",
-            width: 100.0,
-            dataIndex: "pr_brand",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "物料名称",
-            width: 150.0,
-            dataIndex: "pr_detail",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "型号",
-            width: 200.0,
-            dataIndex: "pr_orispeccode",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "规格",
-            width: 200,
-            dataIndex: "pr_spec",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "仓库id",
-            dataIndex: "pd_whid",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "仓库编号",
-            dataIndex: "pd_whcode",
-            hidden: true
-        }, {
-            text: "仓库",
-            dataIndex: "pd_whname",
-            width: 110.0,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "warehouseDbfindTrigger"
-            }
-        }, {
-            text: "数量",
-            dataIndex: "pd_outqty",
-            width: 110.0,
-            xtype: 'numbercolumn',
-            allowBlank: false,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 3,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            }
-        }, {
-            text: "单位",
-            width: 65.0,
-            dataIndex: "pr_unit",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "单价(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_netprice",
-            width: 120,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-        }, {
-            text: "含税单价(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_orderprice",
-            editor: {
+
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_ioid',
+                fieldLabel: 'pi_ioid'
+            }, {
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_vendid",
+                fieldLabel: "供应商ID",
+                allowBlank: true,
+                hidden: true,
+                columnWidth: 0.0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_vendcode',
+                fieldLabel: '供应商编号'
+            }, {
+                xtype: 'vendorDbfindTrigger',
+                name: 'pi_vendname',
+                fieldLabel: '供应商名称',
+                allowBlank: false,
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "pi_puid",
+                fieldLabel: "采购单id",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_pucode",
+                fieldLabel: "采购单号",
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.purchase.ProdOutDetail',
+                deleteDetailUrl: '/api/purchase/prodinout/deleteDetail',
+                detnoColumn: 'pd_pdno',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "仓库id",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "pd_whname",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "数量",
+                    dataIndex: "pd_outqty",
+                    width: 110.0,
+                    xtype: 'numbercolumn',
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 65.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_netprice",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                }, {
+                    text: "含税单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_orderprice",
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                    listeners: {
+                        edit: function (value, grid) {
+                            var r = grid.getSelection()[0],
+                                pd_taxrate = r.get('pd_taxrate');
+                            var v = value / (1 + pd_taxrate / 100);
+                            r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
+                        }
+                    }
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_nettotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "税率(%)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxrate",
+                    width: 80,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 0,
+                        minValue: 0,
+                        maxValue: 100
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    },
+                }, {
+                    text: "税额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxamount",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "价税合计(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_ordertotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "验收明细id",
+                    dataIndex: "pd_ioid",
+                    hidden: true
+                }, {
+                    text: "关联验收单号",
+                    dataIndex: "iocode",
+                    width: 150.0,
+                    ignore: true
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
+            }, {
+                xtype: "textfield",
+                name: "pi_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            }, {
                 xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-            listeners: {
-                edit: function (value, grid) {
-                    var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_taxrate');
-                    var v = value / (1 + pd_taxrate / 100);
-                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
-                }
-            }
-        }, {
-            text: "金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_nettotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "税率(%)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_taxrate",
-            width: 80,
-            editor: {
+                name: "pi_nettotal",
+                fieldLabel: "金额(元)",
+                allowBlank: true,
+                readOnly: true,
+                thousandSeparator: ',',
+                columnWidth: 0.25
+            }, {
                 xtype: "numberfield",
-                decimalPrecision: 0,
-                minValue: 0,
-                maxValue: 100
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, false);
-            },
-        }, {
-            text: "税额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_taxamount",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "价税合计(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_ordertotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "验收明细id",
-            dataIndex: "pd_ioid",
-            hidden: true
-        }, {
-            text: "关联验收单号",
-            dataIndex: "iocode",
-            width: 150.0,
-            ignore: true
-        }, {
-            text: "备注",
-            dataIndex: "pd_remark",
-            width: 250,
-            items: null,
-            editor: {
-                xtype: "textfield"
-            },
-        }]
-    }, {
-        xtype: "textfield",
-        name: "pi_remark",
-        fieldLabel: "备注",
-        columnWidth: 1
-    }, {
-        xtype: "textfield",
-        name: "pi_currency",
-        fieldLabel: "币别",
-        readOnly: true,
-        defaultValue: 'RMB'
-    }, {
-        xtype: "numberfield",
-        name: "pi_nettotal",
-        fieldLabel: "金额(元)",
-        allowBlank: true,
-        readOnly: true,
-        thousandSeparator: ',',
-        columnWidth: 0.25
-    }, {
-        xtype: "numberfield",
-        name: "pi_total",
-        fieldLabel: "价税合计(元)",
-        allowBlank: true,
-        readOnly: true,
-        thousandSeparator: ',',
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_buyercode",
-        fieldLabel: "采购员编号"
-    }, {
-        xtype: "employeeDbfindTrigger",
-        name: "pi_buyername",
-        fieldLabel: "采购员",
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_buyerid",
-        fieldLabel: "采购员ID"
-    }, {
-        xtype: "hidden",
-        name: "creatorId",
-        fieldLabel: "录入人ID",
-        readOnly: true
-    }, {
-        xtype: "textfield",
-        name: "creatorName",
-        fieldLabel: "录入人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "createTime",
-        fieldLabel: "录入日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "hidden",
-        name: "updaterId",
-        fieldLabel: "更新人ID",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updaterName",
-        fieldLabel: "更新人",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updateTime",
-        fieldLabel: "更新日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "textfield",
-        name: "pi_auditman",
-        fieldLabel: "审核人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "pi_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }]
+                name: "pi_total",
+                fieldLabel: "价税合计(元)",
+                allowBlank: true,
+                readOnly: true,
+                thousandSeparator: ',',
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_buyercode",
+                fieldLabel: "采购员编号"
+            }, {
+                xtype: "employeeDbfindTrigger",
+                name: "pi_buyername",
+                fieldLabel: "采购员",
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_buyerid",
+                fieldLabel: "采购员ID"
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
+    },
+
 });

+ 17 - 17
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -397,25 +397,25 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 name: "sa_auditdate",
                 fieldLabel: "审核日期",
                 readOnly: true
+            }],
+            toolBtns: [{
+                xtype: 'button',
+                text: '转出货单',
+                hidden: true,
+                handler: 'turnOut',
+                bind: {
+                    hidden: '{sa_statuscode!="AUDITED"}'
+                }
+            }, {
+                xtype: 'button',
+                text: '转采购单',
+                hidden: true,
+                handler: 'turnPurchase',
+                bind: {
+                    hidden: '{sa_statuscode!="AUDITED"}'
+                }
             }]
         });
         this.callParent();
     },
-    toolBtns: [{
-        xtype: 'button',
-        text: '转出货单',
-        hidden: true,
-        handler: 'turnOut',
-        bind: {
-            hidden: '{sa_statuscode!="AUDITED"}'
-        }
-    }, {
-        xtype: 'button',
-        text: '转采购单',
-        hidden: true,
-        handler: 'turnPurchase',
-        bind: {
-            hidden: '{sa_statuscode!="AUDITED"}'
-        }
-    }]
 });

+ 391 - 385
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -25,404 +25,410 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
     _turnInUrl:'/api/sale/prodinout/turnProdIn',
     initId:0,
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : false, 
-        defaultValue:'销售退货单',
-        allowBlank:false
-    },{
-        xtype : "hidden", 
-        name : "pi_custid",  
-        fieldLabel : "客户ID"
-    },{
-        xtype : "hidden", 
-        name : "pi_custcode",  
-        fieldLabel : "客户编号"
-    }, {
-        xtype : "customerDbfindTrigger", 
-        name : "pi_custname", 
-        fieldLabel : "客户名称",
-        allowBlank:false,
-        setValue:function(value){
-            var me = this,bind, valueBind;
-            var form = me.ownerCt;
-            var c = form.down('[name=pi_address]');
-            if(value&&value!=''){
-                c.setDisabled(false);
-            }else{
-                c.setDisabled(true);
-            }
-            if (me.hasFocus) {
-                bind = me.getBind();
-                valueBind = bind && bind.value;
-                if (valueBind && valueBind.syncing) {
-                    if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
-                        return me;
-                    } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
-                        return me;
-                    }
-                }
-            } else {
-                me.lastSelectedRecords = null;
-            }
-    
-            if (value != null) {
-                me.doSetValue(value);
-            }
-            else {
-                me.suspendEvent('select');
-                me.valueCollection.beginUpdate();
-                me.pickerSelectionModel.deselectAll();
-                me.valueCollection.endUpdate();
-                me.resumeEvent('select');
-            }
-            return me;
-        }
-    }, {
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
-        defaultValue: new Date()
-    }, {
-        columnWidth : 0.5,
-        name : "pi_address", 
-        xtype : "remotecombo", 
-        fieldLabel : "交货地址", 
-        editable:false,
-        allowBlank : false, 
-        storeUrl:'/api/document/customer/getAddressCombo',
-        hiddenBtn:true,//true 则会关闭新增按钮功能
-    }, {
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        detnoColumn:  'pd_pdno',
-        storeModel:'saas.model.sale.SaleInDetail',
-        deleteDetailUrl:'/api/sale/prodinout/deleteDetail',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            }, {
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                width :0
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
             }, {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                allowBlank:false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
+                xtype : "hidden", 
+                name : "pi_class", 
+                fieldLabel : "单据类型", 
+                readOnly:true,
+                allowBlank : false, 
+                defaultValue:'销售退货单',
+                allowBlank:false
             },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "物料名称", 
-                width : 150.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype : "hidden", 
+                name : "pi_custid",  
+                fieldLabel : "客户ID"
             },{
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            }, {
-                text : "仓库ID", 
-                dataIndex : "pd_whid", 
-                width : 0
+                xtype : "hidden", 
+                name : "pi_custcode",  
+                fieldLabel : "客户编号"
             }, {
-                text : "仓库", 
-                width: 110.0,
-                dataIndex : "pd_whcode", 
-                hidden :true
-            }, {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
+                xtype : "customerDbfindTrigger", 
+                name : "pi_custname", 
+                fieldLabel : "客户名称",
                 allowBlank:false,
-                width: 110.0,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
+                setValue:function(value){
+                    var me = this,bind, valueBind;
+                    var form = me.ownerCt;
+                    var c = form.down('[name=pi_address]');
+                    if(value&&value!=''){
+                        c.setDisabled(false);
+                    }else{
+                        c.setDisabled(true);
+                    }
+                    if (me.hasFocus) {
+                        bind = me.getBind();
+                        valueBind = bind && bind.value;
+                        if (valueBind && valueBind.syncing) {
+                            if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
+                                return me;
+                            } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
+                                return me;
+                            }
+                        }
+                    } else {
+                        me.lastSelectedRecords = null;
+                    }
+            
+                    if (value != null) {
+                        me.doSetValue(value);
+                    }
+                    else {
+                        me.suspendEvent('select');
+                        me.valueCollection.beginUpdate();
+                        me.pickerSelectionModel.deselectAll();
+                        me.valueCollection.endUpdate();
+                        me.resumeEvent('select');
+                    }
+                    return me;
                 }
             }, {
-                text : "数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_inqty", 
-                width : 110.0, 
-                allowBlank:false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
-            },{
-                text : "单位", 
-                width : 65.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "单价(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_netprice", 
-                width : 120, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 4, true);
-                },
+                xtype : "datefield", 
+                name : "pi_date", 
+                fieldLabel : "单据日期", 
+                allowBlank : false, 
+                columnWidth : 0.25,
+                defaultValue: new Date()
+            }, {
+                columnWidth : 0.5,
+                name : "pi_address", 
+                xtype : "remotecombo", 
+                fieldLabel : "交货地址", 
+                editable:false,
+                allowBlank : false, 
+                storeUrl:'/api/document/customer/getAddressCombo',
+                hiddenBtn:true,//true 则会关闭新增按钮功能
             }, {
-                text : "含税单价(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_sendprice", 
-                width : 120, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 4, true);
-                },
-                listeners: {
-                    edit: function(value, grid) {
-                        var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_taxrate');
-                        var v = value / (1 + pd_taxrate / 100);
-                        r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
+                name : "detailGridField", 
+                xtype : "detailGridField", 
+                detnoColumn:  'pd_pdno',
+                storeModel:'saas.model.sale.SaleInDetail',
+                deleteDetailUrl:'/api/sale/prodinout/deleteDetail',
+                columns : [
+                    {
+                        text : "id", 
+                        dataIndex : "id", 
+                        xtype : "numbercolumn",
+                        hidden:true
+                    }, {
+                        text : "物料id", 
+                        dataIndex : "pd_prodid", 
+                        width :0
+                    }, {
+                        text : "物料编号", 
+                        width : 150.0, 
+                        dataIndex : "pd_prodcode", 
+                        allowBlank:false,
+                        editor : {
+                            displayField : "display", 
+                            editable : true, 
+                            format : "", 
+                            hideTrigger : false, 
+                            maxLength : 100.0, 
+                            minValue : null, 
+                            positiveNum : false, 
+                            queryMode : "local", 
+                            store : null, 
+                            valueField : "value", 
+                            xtype : "productMultiDbfindTrigger"
+                        }
+                    },{
+                        text: 'model映射需要',
+                        dataIndex: 'productDTO',
+                        hidden: true,
+                    },
+                    {
+                        text : "品牌", 
+                        width : 100.0, 
+                        dataIndex : "pr_brand",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },
+                    {
+                        text : "物料名称", 
+                        width : 150.0, 
+                        dataIndex : "pr_detail",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },
+                    {
+                        text : "型号", 
+                        width : 200.0, 
+                        dataIndex : "pr_orispeccode",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },{
+                        text : "规格", 
+                        width : 200, 
+                        dataIndex : "pr_spec",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    }, {
+                        text : "仓库ID", 
+                        dataIndex : "pd_whid", 
+                        width : 0
+                    }, {
+                        text : "仓库", 
+                        width: 110.0,
+                        dataIndex : "pd_whcode", 
+                        hidden :true
+                    }, {
+                        text : "仓库", 
+                        dataIndex : "pd_whname", 
+                        allowBlank:false,
+                        width: 110.0,
+                        editor : {
+                            displayField : "display", 
+                            editable : true, 
+                            format : "", 
+                            hideTrigger : false, 
+                            maxLength : 100.0, 
+                            minValue : null, 
+                            positiveNum : false, 
+                            queryMode : "local", 
+                            store : null, 
+                            valueField : "value", 
+                            xtype : "warehouseDbfindTrigger"
+                        }
+                    }, {
+                        text : "数量", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_inqty", 
+                        width : 110.0, 
+                        allowBlank:false,
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 3,
+                            minValue:0
+                        },
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 3, false);
+                        },
+                        summaryType: 'sum',
+                        summaryRenderer: function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 3, false);
+                        }
+                    },{
+                        text : "单位", 
+                        width : 65.0, 
+                        dataIndex : "pr_unit",
+                        ignore:true,
+                        renderer: function (v, m, r) {
+                            if(!v){
+                                return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
+                            }                     
+                            return v;
+                        }
+                    },{
+                        text : "单价(元)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_netprice", 
+                        width : 120, 
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 4,
+                            minValue:0
+                        },
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 4, true);
+                        },
+                    }, {
+                        text : "含税单价(元)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_sendprice", 
+                        width : 120, 
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 4,
+                            minValue:0
+                        },
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 4, true);
+                        },
+                        listeners: {
+                            edit: function(value, grid) {
+                                var r = grid.getSelection()[0],
+                                pd_taxrate = r.get('pd_taxrate');
+                                var v = value / (1 + pd_taxrate / 100);
+                                r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
+                            }
+                        }
+                    }, {
+                        text : "金额(元)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_nettotal", 
+                        width : 120, 
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        },
+                        summaryType: 'sum',
+                        summaryRenderer: function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        }
+                    }, {
+                        text : "税率(%)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_taxrate", 
+                        width : 80, 
+                        editor : {
+                            xtype : "numberfield",
+                            decimalPrecision: 0,
+                            minValue: 0,
+                            maxValue: 100
+                        },
+                        renderer: function (v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, false);
+                        }
+                    }, {
+                        text: "税额(元)",
+                        xtype: 'numbercolumn',
+                        dataIndex: "pd_taxamount",
+                        width: 120,
+                        renderer: function (v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        },
+                        summaryType: 'sum',
+                        summaryRenderer: function (v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        }
+                    }, {
+                        text : "价税合计(元)", 
+                        xtype: 'numbercolumn',
+                        dataIndex : "pd_ordertotal", 
+                        width : 120, 
+                        renderer : function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        },
+                        summaryType: 'sum',
+                        summaryRenderer: function(v) {
+                            return saas.util.BaseUtil.numberFormat(v, 2, true);
+                        }
+                    }, {
+                        text : "关联出货单号", 
+                        dataIndex : "pd_iocode", 
+                        xtype : "numbercolumn",
+                        width: 110.0,
+                        format: '0',
+                        ignore:true,
+                        renderer: function(v) {
+                            return v ? v : null;
+                        }
+                    },{
+                        text : "备注", 
+                        dataIndex : "pd_remark",
+                        width : 250, 
+                        items : null,
+                        editor : {
+                            xtype : "textfield"
+                        },
                     }
-                }
+                ]
+            },{
+                xtype : "textfield", 
+                name : "pi_remark", 
+                fieldLabel : "备注", 
+                columnWidth : 1
+            },{
+                xtype: "textfield",
+                name: "pi_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            },{
+                xtype: "numberfield",
+                name: "pi_nettotal",
+                fieldLabel: "金额(元)",
+                thousandSeparator: ',',
+                readOnly: true
+            },{
+                xtype : "numberfield", 
+                name : "pi_total", 
+                fieldLabel : "价税合计(元)", 
+                thousandSeparator: ',',
+                readOnly: true
+            },{
+                xtype: "employeeDbfindTrigger",
+                name: "pi_seller",
+                fieldLabel: "业务员"
+            },{
+                xtype: "hidden",
+                name: "pi_sellerid",
+                fieldLabel: "业务员ID"
             }, {
-                text : "金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_nettotal", 
-                width : 120, 
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype: "hidden",
+                name: "pi_sellercode",
+                fieldLabel: "业务员编号",
+            },{
+                xtype : "hidden", 
+                name : "creatorId", 
+                fieldLabel : "录入人ID", 
+                readOnly:true
+            },
+            {
+                xtype : "textfield", 
+                name : "creatorName", 
+                fieldLabel : "录入人", 
+                readOnly:true
             }, {
-                text : "税率(%)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_taxrate", 
-                width : 80, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 0,
-                    minValue: 0,
-                    maxValue: 100
-                },
-                renderer: function (v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, false);
-                }
+                xtype : "datefield", 
+                name : "createTime", 
+                fieldLabel : "录入日期",
+                readOnly:true, 
+                defaultValue: new Date()
+            },{
+                xtype : "hidden", 
+                name : "updaterId", 
+                fieldLabel : "更新人ID", 
+                readOnly:true
+            },{
+                xtype : "hidden", 
+                name : "updaterName", 
+                fieldLabel : "更新人", 
+                readOnly:true
             }, {
-                text: "税额(元)",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_taxamount",
-                width: 120,
-                renderer: function (v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function (v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype : "hidden", 
+                name : "updateTime", 
+                fieldLabel : "更新日期",
+                readOnly:true, 
+                defaultValue: new Date()
             }, {
-                text : "价税合计(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_ordertotal", 
-                width : 120, 
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype : "textfield", 
+                name : "pi_auditman", 
+                fieldLabel : "审核人", 
+                readOnly:true
             }, {
-                text : "关联出货单号", 
-                dataIndex : "pd_iocode", 
-                xtype : "numbercolumn",
-                width: 110.0,
-                format: '0',
-                ignore:true,
-                renderer: function(v) {
-                    return v ? v : null;
-                }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
-            }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype: "textfield",
-        name: "pi_currency",
-        fieldLabel: "币别",
-        readOnly: true,
-        defaultValue: 'RMB'
-    },{
-        xtype: "numberfield",
-        name: "pi_nettotal",
-        fieldLabel: "金额(元)",
-        thousandSeparator: ',',
-        readOnly: true
-    },{
-        xtype : "numberfield", 
-        name : "pi_total", 
-        fieldLabel : "价税合计(元)", 
-        thousandSeparator: ',',
-        readOnly: true
-    },{
-        xtype: "employeeDbfindTrigger",
-        name: "pi_seller",
-        fieldLabel: "业务员"
-    },{
-        xtype: "hidden",
-        name: "pi_sellerid",
-        fieldLabel: "业务员ID"
-    }, {
-        xtype: "hidden",
-        name: "pi_sellercode",
-        fieldLabel: "业务员编号",
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                xtype : "datefield", 
+                name : "pi_auditdate", 
+                fieldLabel : "审核日期",
+                readOnly:true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
-    }]
+
 });

+ 402 - 396
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -25,404 +25,410 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
     _turnInUrl: '/api/sale/prodinout/turnProdIn',
     initId: 0,
 
-    toolBtns: [{
-        xtype: 'button',
-        text: '转销售退货',
-        handler: 'turnProdIn',
-        hidden: true,
-        bind: {
-            hidden: '{pi_statuscode!="AUDITED"}'
-        }
-    }],
-
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id'
-    }, {
-        xtype: "hidden",
-        name: "pi_class",
-        fieldLabel: "单据类型",
-        readOnly: true,
-        allowBlank: false,
-        defaultValue: '出货单'
-    }, {
-        xtype: "hidden",
-        name: "pi_custid",
-        fieldLabel: "客户ID"
-    }, {
-        xtype: "hidden",
-        name: "pi_custcode",
-        fieldLabel: "客户编号"
-    }, {
-        xtype: "customerDbfindTrigger",
-        name: "pi_custname",
-        fieldLabel: "客户名称",
-        allowBlank: false,
-        setValue: function (value) {
-            var me = this,
-                bind, valueBind;
-            var form = me.ownerCt;
-            var c = form.down('[name=pi_address]');
-            if (value && value != '') {
-                c.setDisabled(false);
-            } else {
-                c.setDisabled(true);
-            }
-            if (me.hasFocus) {
-                bind = me.getBind();
-                valueBind = bind && bind.value;
-                if (valueBind && valueBind.syncing) {
-                    if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
-                        return me;
-                    } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
-                        return me;
-                    }
-                }
-            } else {
-                me.lastSelectedRecords = null;
-            }
-
-            if (value != null) {
-                me.doSetValue(value);
-            } else {
-                me.suspendEvent('select');
-                me.valueCollection.beginUpdate();
-                me.pickerSelectionModel.deselectAll();
-                me.valueCollection.endUpdate();
-                me.resumeEvent('select');
-            }
-            return me;
-        }
-    }, {
-        xtype: "datefield",
-        name: "pi_date",
-        fieldLabel: "单据日期",
-        allowBlank: false,
-        columnWidth: 0.25,
-        defaultValue: new Date()
-    }, {
-        columnWidth: 0.5,
-        name: "pi_address",
-        xtype: "remotecombo",
-        fieldLabel: "交货地址",
-        editable: false,
-        allowBlank: false,
-        storeUrl: '/api/document/customer/getAddressCombo',
-        hiddenBtn: true, //true 则会关闭新增按钮功能
-    }, {
-        name: "detailGridField",
-        xtype: "detailGridField",
-        detnoColumn: 'pd_pdno',
-        storeModel: 'saas.model.sale.SaleOutDetail',
-        deleteDetailUrl: '/api/sale/prodinout/deleteDetail',
-        columns: [{
-            text: "id",
-            dataIndex: "id",
-            xtype: "numbercolumn",
-            hidden: true
-        }, {
-            text: "物料id",
-            dataIndex: "pd_prodid",
-            width: 0
-        }, {
-            text: "物料编号",
-            width: 150.0,
-            dataIndex: "pd_prodcode",
-            xtype: "",
-            items: null,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "productMultiDbfindTrigger"
-            }
-        }, {
-            text: 'model映射需要',
-            dataIndex: 'productDTO',
-            hidden: true,
-        }, {
-            text: "品牌",
-            width: 100.0,
-            dataIndex: "pr_brand",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "物料名称",
-            width: 150.0,
-            dataIndex: "pr_detail",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "型号",
-            width: 200.0,
-            dataIndex: "pr_orispeccode",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
-                }
-                return v;
-            }
-        }, {
-            text: "规格",
-            width: 200,
-            dataIndex: "pr_spec",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+    initComponent: function () {
+        Ext.applyIf(this, {
+            toolBtns: [{
+                xtype: 'button',
+                text: '转销售退货',
+                handler: 'turnProdIn',
+                hidden: true,
+                bind: {
+                    hidden: '{pi_statuscode!="AUDITED"}'
                 }
-                return v;
-            }
-        }, {
-            text: "仓库ID",
-            dataIndex: "pd_whid",
-            hidden: true
-        }, {
-            text: "仓库编号",
-            dataIndex: "pd_whcode",
-            hidden: true
-        }, {
-            text: "仓库",
-            dataIndex: "pd_whname",
-            width: 110.0,
-            items: null,
-            allowBlank: false,
-            editor: {
-                displayField: "display",
-                editable: true,
-                format: "",
-                hideTrigger: false,
-                maxLength: 100.0,
-                minValue: null,
-                positiveNum: false,
-                queryMode: "local",
-                store: null,
-                valueField: "value",
-                xtype: "warehouseDbfindTrigger"
-            }
-        }, {
-            text: "数量",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_outqty",
-            width: 110.0,
-            allowBlank: false,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 3,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 3, false);
-            }
-        }, {
-            text: "单位",
-            width: 65.0,
-            dataIndex: "pr_unit",
-            ignore: true,
-            renderer: function (v, m, r) {
-                if (!v) {
-                    return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+            }],
+        
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id'
+            }, {
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: false,
+                defaultValue: '出货单'
+            }, {
+                xtype: "hidden",
+                name: "pi_custid",
+                fieldLabel: "客户ID"
+            }, {
+                xtype: "hidden",
+                name: "pi_custcode",
+                fieldLabel: "客户编号"
+            }, {
+                xtype: "customerDbfindTrigger",
+                name: "pi_custname",
+                fieldLabel: "客户名称",
+                allowBlank: false,
+                setValue: function (value) {
+                    var me = this,
+                        bind, valueBind;
+                    var form = me.ownerCt;
+                    var c = form.down('[name=pi_address]');
+                    if (value && value != '') {
+                        c.setDisabled(false);
+                    } else {
+                        c.setDisabled(true);
+                    }
+                    if (me.hasFocus) {
+                        bind = me.getBind();
+                        valueBind = bind && bind.value;
+                        if (valueBind && valueBind.syncing) {
+                            if ((Ext.isEmpty(value) && Ext.isEmpty(me.value)) || value === me.value) {
+                                return me;
+                            } else if (Ext.isArray(value) && Ext.isArray(me.value) && Ext.Array.equals(value, me.value)) {
+                                return me;
+                            }
+                        }
+                    } else {
+                        me.lastSelectedRecords = null;
+                    }
+        
+                    if (value != null) {
+                        me.doSetValue(value);
+                    } else {
+                        me.suspendEvent('select');
+                        me.valueCollection.beginUpdate();
+                        me.pickerSelectionModel.deselectAll();
+                        me.valueCollection.endUpdate();
+                        me.resumeEvent('select');
+                    }
+                    return me;
                 }
-                return v;
-            }
-        }, {
-            text: "单价(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_netprice",
-            width: 120,
-            editor: {
-                xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-        }, {
-            text: "含税单价(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_sendprice",
-            width: 120,
-            editor: {
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                columnWidth: 0.5,
+                name: "pi_address",
+                xtype: "remotecombo",
+                fieldLabel: "交货地址",
+                editable: false,
+                allowBlank: false,
+                storeUrl: '/api/document/customer/getAddressCombo',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                detnoColumn: 'pd_pdno',
+                storeModel: 'saas.model.sale.SaleOutDetail',
+                deleteDetailUrl: '/api/sale/prodinout/deleteDetail',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    width: 0
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "仓库ID",
+                    dataIndex: "pd_whid",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "pd_whname",
+                    width: 110.0,
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "数量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_outqty",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 65.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_netprice",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                }, {
+                    text: "含税单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_sendprice",
+                    width: 120,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    },
+                    listeners: {
+                        edit: function (value, grid) {
+                            var r = grid.getSelection()[0],
+                                pd_taxrate = r.get('pd_taxrate');
+                            var v = value / (1 + pd_taxrate / 100);
+                            r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
+                        }
+                    }
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_nettotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "税率(%)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxrate",
+                    width: 80,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 0,
+                        minValue: 0,
+                        maxValue: 100
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, false);
+                    }
+                }, {
+                    text: "税额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_taxamount",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "价税合计(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_ordertotal",
+                    width: 120,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "关联销售单号",
+                    dataIndex: "pd_ordercode",
+                    width: 150.0,
+                    ignore: true
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            },  {
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
+            },{
+                xtype: "textfield",
+                name: "pi_currency",
+                fieldLabel: "币别",
+                readOnly: true,
+                defaultValue: 'RMB'
+            },{
                 xtype: "numberfield",
-                decimalPrecision: 4,
-                minValue: 0
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 4, true);
-            },
-            listeners: {
-                edit: function (value, grid) {
-                    var r = grid.getSelection()[0],
-                        pd_taxrate = r.get('pd_taxrate');
-                    var v = value / (1 + pd_taxrate / 100);
-                    r.set('pd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
-                }
-            }
-        }, {
-            text: "金额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_nettotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "税率(%)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_taxrate",
-            width: 80,
-            editor: {
+                name: "pi_nettotal",
+                fieldLabel: "金额(元)",
+                readOnly: true,
+                thousandSeparator: ','
+            },{
                 xtype: "numberfield",
-                decimalPrecision: 0,
-                minValue: 0,
-                maxValue: 100
-            },
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, false);
-            }
-        }, {
-            text: "税额(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_taxamount",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "价税合计(元)",
-            xtype: 'numbercolumn',
-            dataIndex: "pd_ordertotal",
-            width: 120,
-            renderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            },
-            summaryType: 'sum',
-            summaryRenderer: function (v) {
-                return saas.util.BaseUtil.numberFormat(v, 2, true);
-            }
-        }, {
-            text: "关联销售单号",
-            dataIndex: "pd_ordercode",
-            width: 150.0,
-            ignore: true
-        }, {
-            text: "备注",
-            dataIndex: "pd_remark",
-            width: 250,
-            items: null,
-            editor: {
-                xtype: "textfield"
-            },
-        }]
-    },  {
-        xtype: "textfield",
-        name: "pi_remark",
-        fieldLabel: "备注",
-        columnWidth: 1
-    },{
-        xtype: "textfield",
-        name: "pi_currency",
-        fieldLabel: "币别",
-        readOnly: true,
-        defaultValue: 'RMB'
-    },{
-        xtype: "numberfield",
-        name: "pi_nettotal",
-        fieldLabel: "金额(元)",
-        readOnly: true,
-        thousandSeparator: ','
-    },{
-        xtype: "numberfield",
-        name: "pi_total",
-        fieldLabel: "价税合计(元)",
-        readOnly: true,
-        thousandSeparator: ','
-    },{
-        xtype: "employeeDbfindTrigger",
-        name: "pi_seller",
-        fieldLabel: "业务员"
-    },{
-        xtype: "hidden",
-        name: "pi_sellerid",
-        fieldLabel: "业务员ID"
-    }, {
-        xtype: "hidden",
-        name: "pi_sellercode",
-        fieldLabel: "业务员编号",
-    }, {
-        xtype: "hidden",
-        name: "creatorId",
-        fieldLabel: "录入人ID",
-        readOnly: true
-    }, {
-        xtype: "textfield",
-        name: "creatorName",
-        fieldLabel: "录入人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "createTime",
-        fieldLabel: "录入日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "hidden",
-        name: "updaterId",
-        fieldLabel: "更新人ID",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updaterName",
-        fieldLabel: "更新人",
-        readOnly: true
-    }, {
-        xtype: "hidden",
-        name: "updateTime",
-        fieldLabel: "更新日期",
-        readOnly: true,
-        defaultValue: new Date()
-    }, {
-        xtype: "textfield",
-        name: "pi_auditman",
-        fieldLabel: "审核人",
-        readOnly: true
-    }, {
-        xtype: "datefield",
-        name: "pi_auditdate",
-        fieldLabel: "审核日期",
-        readOnly: true
-    }]
+                name: "pi_total",
+                fieldLabel: "价税合计(元)",
+                readOnly: true,
+                thousandSeparator: ','
+            },{
+                xtype: "employeeDbfindTrigger",
+                name: "pi_seller",
+                fieldLabel: "业务员"
+            },{
+                xtype: "hidden",
+                name: "pi_sellerid",
+                fieldLabel: "业务员ID"
+            }, {
+                xtype: "hidden",
+                name: "pi_sellercode",
+                fieldLabel: "业务员编号",
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
+    },
+
 });

+ 295 - 300
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -6,312 +6,307 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
     viewModel: 'stock-appropriationinout-formpanel',
 
     viewName: 'stock-appropriationinout-formpanel',
-    caller:'AppropriationInOut',
-    
-     //字段属性
-    _title:'调拨单',
+    caller: 'AppropriationInOut',
+
+    //字段属性
+    _title: '调拨单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/storage/prodinout/read',
-    _saveUrl:'/api/storage/prodinout/save',
-    _auditUrl:'/api/storage/prodinout/audit',
+    _readUrl: '/api/storage/prodinout/read',
+    _saveUrl: '/api/storage/prodinout/save',
+    _auditUrl: '/api/storage/prodinout/audit',
     _unAuditUrl: '/api/storage/prodinout/unAudit',
-    _deleteUrl:'/api/storage/prodinout/delete',
-    initId:0,
+    _deleteUrl: '/api/storage/prodinout/delete',
+    initId: 0,
 
-    toolBtns: [],
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0
-    },{
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : true, 
-        columnWidth : 0.25
-    }, {
-        xtype : "hidden", 
-        name : "pi_vendid", 
-        fieldLabel : "供应商ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
-        xtype: 'hidden',
-        name: 'pi_vendcode',
-        fieldLabel: '供应商编号'
-    }, {
-        xtype: 'hidden',
-        name: 'pi_vendname',
-        fieldLabel: '供应商名称'
-    },{
-        xtype : "hidden", 
-        name : "pi_custid", 
-        fieldLabel : "客户ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
-        xtype: 'hidden',
-        name: 'pi_custcode',
-        fieldLabel: '客户编号'
-    }, {
-        xtype: 'hidden',
-        name: 'pi_custname',
-        fieldLabel: '客户名称'
-    },{
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
-        defaultValue: new Date()
-    }, {
-        name : "detailGridField", 
-        xtype : "detailGridField",
-        storeModel:'saas.model.stock.AppropriationInOut',
-        deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
-        detnoColumn:  'pd_pdno',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            },{
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank:false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
-            },{
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
-            },
-            {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "物料名称", 
-                width : 150.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },
-            {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_outqty", 
-                width : 110.0,
-                allowBlank:false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
-            },{
-                text : "单位", 
-                width : 65.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "拨出仓库id", 
-                dataIndex : "pd_whid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "拨出仓库编号", 
-                dataIndex : "pd_whcode",
-                hidden:true
-            },
-            {
-                text : "拨出仓库", 
-                dataIndex : "pd_whname", 
-                width : 120.0, 
-                items : null,
-                allowBlank:false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
-                }
-            },{
-                text : "拨入仓库id", 
-                dataIndex : "pd_inwhid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "拨入仓库编号", 
-                dataIndex : "pd_inwhcode",
-                hidden:true
-            },
-            {
-                text : "拨入仓库", 
-                dataIndex : "pd_inwhname", 
-                width : 120.0, 
-                allowBlank:false,
-                items : null,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
-                }
-            },{
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                },
-            }
-        ]
-    }, {
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+    initComponent: function () {
+        Ext.applyIf(this, {
+            toolBtns: [],
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0
+            }, {
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_vendid",
+                fieldLabel: "供应商ID",
+                allowBlank: true,
+                columnWidth: 0.0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_vendcode',
+                fieldLabel: '供应商编号'
+            }, {
+                xtype: 'hidden',
+                name: 'pi_vendname',
+                fieldLabel: '供应商名称'
+            }, {
+                xtype: "hidden",
+                name: "pi_custid",
+                fieldLabel: "客户ID",
+                allowBlank: true,
+                columnWidth: 0.0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_custcode',
+                fieldLabel: '客户编号'
+            }, {
+                xtype: 'hidden',
+                name: 'pi_custname',
+                fieldLabel: '客户名称'
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.stock.AppropriationInOut',
+                deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
+                detnoColumn: 'pd_pdno',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "数量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_outqty",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 65.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "拨出仓库id",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "拨出仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "拨出仓库",
+                    dataIndex: "pd_whname",
+                    width: 120.0,
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "拨入仓库id",
+                    dataIndex: "pd_inwhid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "拨入仓库编号",
+                    dataIndex: "pd_inwhcode",
+                    hidden: true
+                }, {
+                    text: "拨入仓库",
+                    dataIndex: "pd_inwhname",
+                    width: 120.0,
+                    allowBlank: false,
+                    items: null,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
+            }, {
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
+            }, {
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true,
+                ignore: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true,
+                ignore: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date(),
+                ignore: true
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true,
+                ignore: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true,
+                ignore: true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true,
-        ignore:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true,
-        ignore:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date(),
-        ignore:true
-    }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true,
-        ignore:true
-    }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true,
-        ignore:true
-    }]
+
 });

+ 362 - 360
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -6,390 +6,392 @@ Ext.define('saas.view.stock.make.FormPanel', {
     viewModel: 'stock-make-formpanel',
 
     viewName: 'stock-make-formpanel',
-    caller:'Make',
-    
-     //字段属性
-     _title:'制造单',
-     _idField: 'id',
-     _codeField: 'ma_code',
-     _statusField: 'ma_status',
-     _statusCodeField: 'ma_statuscode',
-     _auditmanField: 'ma_auditman',
-     _auditdateField:'ma_auditdate',
-     _relationColumn: 'mm_maid',
+    caller: 'Make',
 
-     _readUrl:'/api/storage/make/read',
-     _saveUrl:'/api/storage/make/save',
-     _auditUrl:'/api/storage/make/audit',
-     _unAuditUrl: '/api/storage/make/unAudit',
-     _deleteUrl:'/api/storage/make/delete',
-     _getBomUrl:'/api/document/bom/read',
-     initId:0,
- 
-     toolBtns: [],
+    //字段属性
+    _title: '制造单',
+    _idField: 'id',
+    _codeField: 'ma_code',
+    _statusField: 'ma_status',
+    _statusCodeField: 'ma_statuscode',
+    _auditmanField: 'ma_auditman',
+    _auditdateField: 'ma_auditdate',
+    _relationColumn: 'mm_maid',
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        columnWidth: 0
-    },{
-        xtype: 'combobox',
-        name: 'ma_type',
-        allowBlank : false,
-        columnWidth: 0.25,
-        fieldLabel: '类型',
-        queryMode: 'local',
-        displayField: 'name',
-        valueField: 'value',
-        editable:false,
-        allowBlank : false,
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['name', 'value'],
-            data: [
-                ["拆件", "拆件"],
-                ["组装", "组装"],
-            ]
-        })
-    },{
-        xtype: 'hidden',
-        name: 'ma_prodid',
-        fieldLabel: '产品id'
-    },{
-        xtype : "bomDbfindTrigger",
-        name : "ma_prodcode", 
-        fieldLabel : "产品编号",
-        allowBlank : false,
-        columnWidth: 0.25
-    },{
-        xtype : "textfield", 
-        name : "ma_proddetail", 
-        fieldLabel : "产品名称",
-        readOnly:true,
-        columnWidth: 0.25
-    },{
-        xtype : "textfield", 
-        name : "ma_prodorispec", 
-        fieldLabel : "产品型号",
-        readOnly:true,
-        columnWidth: 0.25,
-    },{
-        xtype : "textfield", 
-        name : "ma_prodspec", 
-        fieldLabel : "产品规格",
-        readOnly:true,
-        columnWidth: 0.25,
-    },{
-        xtype : "textfield", 
-        name : "ma_produnit", 
-        fieldLabel : "单位",
-        readOnly:true,
-        columnWidth: 0.25
-    },{
-        xtype : "textfield", 
-        name : "ma_version", 
-        fieldLabel : "版本号",
-        readOnly:true,
-        columnWidth: 0.25
-    },
-    {
-        xtype : "numberfield", 
-        name : "ma_qty", 
-        fieldLabel : "数量",
-        columnWidth: 0.25,
-        allowBlank : false,
-        decimalPrecision:3,
-        vtype: 'positiveNumber',
-    },{
-        xtype : "hidden", 
-        name : "ma_whid", 
-        fieldLabel : "仓库id"
-    },{
-        xtype : "hidden",
-        name : "ma_whcode", 
-        fieldLabel : "仓库编号"
-    },{
-        xtype : "warehouseDbfindTrigger",
-        name : "ma_whname",
-        fieldLabel : "仓库",
-        allowBlank : false,
-        columnWidth: 0.25
-    },{
-        xtype : "numberfield", 
-        name : "ma_price", 
-        fieldLabel : "单价(元)",
-        readOnly:true,
-        editable:false,
-        decimalPrecision:4,
-        columnWidth: 0.25
-    },{
-        xtype : "numberfield", 
-        name : "ma_total",
-        readOnly:true,
-        editable:false, 
-        fieldLabel : "金额(元)",
-        decimalPrecision:2,
-        thousandSeparator: ',',
-        columnWidth: 0.25
-    },
-    {
-        name : "detailGridField", 
-        xtype : "detailGridField", 
-        storeModel:'saas.model.stock.Makematerial',
-        detnoColumn:  'mm_detno',
-        deleteDetailUrl:'/api/storage/make/deleteDetail',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
+    _readUrl: '/api/storage/make/read',
+    _saveUrl: '/api/storage/make/save',
+    _auditUrl: '/api/storage/make/audit',
+    _unAuditUrl: '/api/storage/make/unAudit',
+    _deleteUrl: '/api/storage/make/delete',
+    _getBomUrl: '/api/document/bom/read',
+    initId: 0,
+
+    toolBtns: [],
+
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                columnWidth: 0
             }, {
-                text : "mm_prodidid", 
-                dataIndex : "mm_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
+                xtype: 'combobox',
+                name: 'ma_type',
+                allowBlank: false,
+                columnWidth: 0.25,
+                fieldLabel: '类型',
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                editable: false,
+                allowBlank: false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [
+                        ["拆件", "拆件"],
+                        ["组装", "组装"],
+                    ]
+                })
             }, {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "mm_prodcode", 
-                allowBlank : false,
-                xtype : "", 
-                items : null,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
+                xtype: 'hidden',
+                name: 'ma_prodid',
+                fieldLabel: '产品id'
             }, {
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
+                xtype: "bomDbfindTrigger",
+                name: "ma_prodcode",
+                fieldLabel: "产品编号",
+                allowBlank: false,
+                columnWidth: 0.25
             }, {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "textfield",
+                name: "ma_proddetail",
+                fieldLabel: "产品名称",
+                readOnly: true,
+                columnWidth: 0.25
             }, {
-                text : "物料名称", 
-                width : 200.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "textfield",
+                name: "ma_prodorispec",
+                fieldLabel: "产品型号",
+                readOnly: true,
+                columnWidth: 0.25,
             }, {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "需求数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "mm_qty", 
-                width : 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
+                xtype: "textfield",
+                name: "ma_prodspec",
+                fieldLabel: "产品规格",
+                readOnly: true,
+                columnWidth: 0.25,
             }, {
-            
-                text : "单位用量", 
-                xtype: 'numbercolumn',
-                dataIndex : "mm_oneuseqty", 
-                hidden:true,
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
+                xtype: "textfield",
+                name: "ma_produnit",
+                fieldLabel: "单位",
+                readOnly: true,
+                columnWidth: 0.25
             }, {
-                text : "单位", 
-                dataIndex : "pr_unit",
-                width : 65.0,
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
+                xtype: "textfield",
+                name: "ma_version",
+                fieldLabel: "版本号",
+                readOnly: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "numberfield",
+                name: "ma_qty",
+                fieldLabel: "数量",
+                columnWidth: 0.25,
+                allowBlank: false,
+                decimalPrecision: 3,
+                vtype: 'positiveNumber',
+            }, {
+                xtype: "hidden",
+                name: "ma_whid",
+                fieldLabel: "仓库id"
+            }, {
+                xtype: "hidden",
+                name: "ma_whcode",
+                fieldLabel: "仓库编号"
+            }, {
+                xtype: "warehouseDbfindTrigger",
+                name: "ma_whname",
+                fieldLabel: "仓库",
+                allowBlank: false,
+                columnWidth: 0.25
+            }, {
+                xtype: "numberfield",
+                name: "ma_price",
+                fieldLabel: "单价(元)",
+                readOnly: true,
+                editable: false,
+                decimalPrecision: 4,
+                columnWidth: 0.25
+            }, {
+                xtype: "numberfield",
+                name: "ma_total",
+                readOnly: true,
+                editable: false,
+                fieldLabel: "金额(元)",
+                decimalPrecision: 2,
+                thousandSeparator: ',',
+                columnWidth: 0.25
+            }, {
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.stock.Makematerial',
+                detnoColumn: 'mm_detno',
+                deleteDetailUrl: '/api/storage/make/deleteDetail',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "mm_prodidid",
+                    dataIndex: "mm_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "mm_prodcode",
+                    allowBlank: false,
+                    xtype: "",
+                    items: null,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
                     }
-                    return v;
-                }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 200.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "需求数量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "mm_qty",
+                    width: 110.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+
+                    text: "单位用量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "mm_oneuseqty",
+                    hidden: true,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                }, {
+                    text: "单位",
+                    dataIndex: "pr_unit",
+                    width: 65.0,
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "仓库id",
+                    dataIndex: "mm_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "mm_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "mm_whname",
+                    width: 120.0,
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "成本单价(元)",
+                    dataIndex: "mm_price",
+                    xtype: 'numbercolumn',
+                    width: 120.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    listeners: {
+                        edit: 'price_change'
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                }, {
+                    text: "成本金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "mm_amount",
+                    width: 120.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2,
+                        editable: false
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "mm_remark",
+                    width: 250,
+                    editor: {
+                        xtype: "textfield"
+                    },
+                }]
             }, {
-                text : "仓库id",
-                dataIndex : "mm_whid",
-                xtype : "numbercolumn",
-                hidden:true
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
             }, {
-                text : "仓库编号",
-                dataIndex : "mm_whcode",
-                hidden:true
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
             }, {
-                text : "仓库",
-                dataIndex : "mm_whname",
-                width: 120.0,
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display",
-                    editable : true,
-                    format : "",
-                    hideTrigger : false,
-                    maxLength : 100.0,
-                    minValue : null,
-                    positiveNum : false,
-                    queryMode : "local",
-                    store : null,
-                    valueField : "value",
-                    xtype : "warehouseDbfindTrigger"
-                }
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
             }, {
-                text : "成本单价(元)", 
-                dataIndex : "mm_price", 
-                xtype: 'numbercolumn',
-                width : 120.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                listeners:{
-                    edit:'price_change'
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 4, true);
-                }
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
             }, {
-                text : "成本金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "mm_amount", 
-                width : 120.0, 
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 2,
-                    editable : false
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "ma_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
             }, {
-                text : "备注",
-                dataIndex : "mm_remark",
-                width : 250,
-                editor : {
-                    xtype : "textfield"
-                },
+                xtype: "datefield",
+                name: "ma_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
             }]
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "ma_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "ma_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
-    }],
-    beforeAudit:function(){
+
+    beforeAudit: function () {
         var me = this,
-        controller = me.getController(),
-        viewModel = me.getViewModel(),
-        grid = me.down('detailGridField'),
-        data = grid.getTrueData(),
-        str='',
-        type = viewModel.get('ma_type');
+            controller = me.getController(),
+            viewModel = me.getViewModel(),
+            grid = me.down('detailGridField'),
+            data = grid.getTrueData(),
+            str = '',
+            type = viewModel.get('ma_type');
         if ('拆件' == type) {
-            Ext.Array.each(data,function(item){
-                if(item.mm_price==0){     
-                    str=str+item.mm_detno+'行'+item.mm_prodcode+'物料成本单价为0!'+'<br>'
+            Ext.Array.each(data, function (item) {
+                if (item.mm_price == 0) {
+                    str = str + item.mm_detno + '行' + item.mm_prodcode + '物料成本单价为0!' + '<br>'
                 }
             });
         }
-        if(str!=''){
-            saas.util.BaseUtil.showConfirm('提示',str)
-            .then(function(y) {
-                if(y == 'yes') {
-                    controller.audit();
-                }
-            });
-        }else{
+        if (str != '') {
+            saas.util.BaseUtil.showConfirm('提示', str)
+                .then(function (y) {
+                    if (y == 'yes') {
+                        controller.audit();
+                    }
+                });
+        } else {
             controller.audit();
         }
         return false;

+ 284 - 282
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -6,308 +6,310 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
     viewModel: 'stock-otherin-formpanel',
 
     viewName: 'stock-otherin-formpanel',
-    caller:'OtherIn',
-    
-     //字段属性
-    
-    _title:'其它入库单',
+    caller: 'OtherIn',
+
+    //字段属性
+
+    _title: '其它入库单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
-    _readUrl:'/api/storage/prodinout/read',
-    _saveUrl:'/api/storage/prodinout/save',
-    _auditUrl:'/api/storage/prodinout/audit',
+    _readUrl: '/api/storage/prodinout/read',
+    _saveUrl: '/api/storage/prodinout/save',
+    _auditUrl: '/api/storage/prodinout/audit',
     _unAuditUrl: '/api/storage/prodinout/unAudit',
-    _deleteUrl:'/api/storage/prodinout/delete',
-    initId:0,
+    _deleteUrl: '/api/storage/prodinout/delete',
+    initId: 0,
 
     toolBtns: [],
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0
-    },{
-        xtype : "hidden", 
-        name : "pi_class", 
-        fieldLabel : "单据类型", 
-        readOnly:true,
-        allowBlank : true, 
-        columnWidth : 0.25
-    },{
-        xtype : "hidden", 
-        name : "pi_custid", 
-        fieldLabel : "客户ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
-        xtype: 'hidden',
-        name: 'pi_custcode',
-        fieldLabel: '客户编号'
-    }, {
-        xtype: 'hidden',
-        name: 'pi_custname',
-        fieldLabel: '客户名称'
-    },{
-        xtype : "hidden", 
-        name : "pi_vendid", 
-        fieldLabel : "供应商ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    },{
-        xtype: 'hidden',
-        name: 'pi_vendcode',
-        fieldLabel: '供应商编号'
-    }, {
-        xtype: 'vendorDbfindTrigger',
-        name: 'pi_vendname',
-        fieldLabel: '供应商名称',
-        allowBlank : true,
-    },{
-        xtype : "datefield", 
-        name : "pi_date", 
-        fieldLabel : "单据日期", 
-        allowBlank : false, 
-        columnWidth : 0.25,
-        defaultValue: new Date()
-    }, {
-        xtype: "numberfield",
-        name: "pi_costtotal",
-        fieldLabel: "金额(元)",
-        allowBlank: true,
-        readOnly: true,
-        columnWidth: 0.25,
-        thousandSeparator: ','
-    }, {
-        name : "detailGridField", 
-        xtype : "detailGridField",
-        storeModel:'saas.model.stock.OtherIn',
-        deleteDetailUrl:'/api/storage/prodinout/deleteDetail',
-        detnoColumn:  'pd_pdno',
-        columns : [
-            {
-                text : "id", 
-                dataIndex : "id", 
-                xtype : "numbercolumn",
-                hidden:true
-            },{
-                text : "物料id", 
-                dataIndex : "pd_prodid", 
-                xtype : "numbercolumn",
-                hidden:true
-            },
-            {
-                text : "物料编号", 
-                width : 150.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "productMultiDbfindTrigger"
-                }
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0
+            }, {
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: true,
+                columnWidth: 0.25
+            }, {
+                xtype: "hidden",
+                name: "pi_custid",
+                fieldLabel: "客户ID",
+                allowBlank: true,
+                columnWidth: 0.0
+            }, {
+                xtype: 'hidden',
+                name: 'pi_custcode',
+                fieldLabel: '客户编号'
+            }, {
+                xtype: 'hidden',
+                name: 'pi_custname',
+                fieldLabel: '客户名称'
             }, {
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
+                xtype: "hidden",
+                name: "pi_vendid",
+                fieldLabel: "供应商ID",
+                allowBlank: true,
+                columnWidth: 0.0
             }, {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: 'hidden',
+                name: 'pi_vendcode',
+                fieldLabel: '供应商编号'
             }, {
-                text : "物料名称", 
-                width : 150.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: 'vendorDbfindTrigger',
+                name: 'pi_vendname',
+                fieldLabel: '供应商名称',
+                allowBlank: true,
             }, {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
             }, {
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "numberfield",
+                name: "pi_costtotal",
+                fieldLabel: "金额(元)",
+                allowBlank: true,
+                readOnly: true,
+                columnWidth: 0.25,
+                thousandSeparator: ','
             }, {
-                text : "仓库id", 
-                dataIndex : "pd_whid", 
-                xtype : "numbercolumn",
-                hidden:true
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.stock.OtherIn',
+                deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
+                detnoColumn: 'pd_pdno',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "仓库id",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "pd_whname",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "数量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_inqty",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 80.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_price",
+                    width: 120.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_total",
+                    width: 120.0,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    }
+                }]
             }, {
-                text : "仓库编号", 
-                dataIndex : "pd_whcode",
-                hidden:true
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
             }, {
-                text : "仓库", 
-                dataIndex : "pd_whname", 
-                width: 110.0,
-                allowBlank : false,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "warehouseDbfindTrigger"
-                }
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
             }, {
-                text : "数量", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_inqty", 
-                width : 110.0,
-                allowBlank : false,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
-            },{
-                text : "单位", 
-                width : 80.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text : "单价(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_price",
-                width : 120.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 4, true);
-                }
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
             }, {
-                text : "金额(元)", 
-                xtype: 'numbercolumn',
-                dataIndex : "pd_total", 
-                width : 120.0,
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
             }, {
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                }
-            }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
-    }]
+
 });

+ 258 - 254
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -15,7 +15,7 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
     _auditmanField: 'pi_auditman',
-    _auditdateField:'pi_auditdate',
+    _auditdateField: 'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl: '/api/storage/prodinout/read',
     _saveUrl: '/api/storage/prodinout/save',
@@ -26,271 +26,275 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
 
     toolBtns: [],
 
-    defaultItems: [{
-        xtype: 'hidden',
-        name: 'id',
-        fieldLabel: 'id',
-        allowBlank: true,
-        columnWidth: 0
-    }, {
-        xtype: "hidden",
-        name: "pi_class",
-        fieldLabel: "单据类型",
-        readOnly: true,
-        allowBlank: true,
-        columnWidth: 0.25
-    }, {
-        xtype: "hidden",
-        name: "pi_custid",
-        fieldLabel: "客户ID",
-        allowBlank: true,
-        columnWidth: 0.0
-    }, {
-        xtype: 'hidden',
-        name: 'pi_custcode',
-        fieldLabel: '客户编号'
-    }, {
-        xtype: 'customerDbfindTrigger',
-        name: 'pi_custname',
-        allowBlank : true,
-        fieldLabel: '客户名称'
-    }, {
-        xtype: "datefield",
-        name: "pi_date",
-        fieldLabel: "单据日期",
-        allowBlank: false,
-        columnWidth: 0.25,
-        defaultValue: new Date()
-    }, {
-        xtype: "numberfield",
-        name: "pi_costtotal",
-        fieldLabel: "金额(元)",
-        allowBlank: true,
-        readOnly: true,
-        columnWidth: 0.25,
-        thousandSeparator: ','
-    }, {
-        name: "detailGridField",
-        xtype: "detailGridField",
-        storeModel:'saas.model.stock.OtherOut',
-        deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
-        detnoColumn: 'pd_pdno',
-        columns: [{
-                text: "id",
-                dataIndex: "id",
-                xtype: "numbercolumn",
-                hidden: true
+    initComponent: function () {
+        Ext.applyIf(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'id',
+                fieldLabel: 'id',
+                allowBlank: true,
+                columnWidth: 0
             }, {
-                text: "物料id",
-                dataIndex: "pd_prodid",
-                xtype: "numbercolumn",
-                hidden: true
+                xtype: "hidden",
+                name: "pi_class",
+                fieldLabel: "单据类型",
+                readOnly: true,
+                allowBlank: true,
+                columnWidth: 0.25
             }, {
-                text: "物料编号",
-                width: 150.0,
-                dataIndex: "pd_prodcode",
-                xtype: "",
-                items: null,
-                allowBlank : false,
-                editor: {
-                    displayField: "display",
-                    editable: true,
-                    format: "",
-                    hideTrigger: false,
-                    maxLength: 100.0,
-                    minValue: null,
-                    positiveNum: false,
-                    queryMode: "local",
-                    store: null,
-                    valueField: "value",
-                    xtype: "productMultiDbfindTrigger"
-                }
+                xtype: "hidden",
+                name: "pi_custid",
+                fieldLabel: "客户ID",
+                allowBlank: true,
+                columnWidth: 0.0
             }, {
-                text: 'model映射需要',
-                dataIndex: 'productDTO',
-                hidden: true,
+                xtype: 'hidden',
+                name: 'pi_custcode',
+                fieldLabel: '客户编号'
             }, {
-                text : "品牌", 
-                width : 100.0, 
-                dataIndex : "pr_brand",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: 'customerDbfindTrigger',
+                name: 'pi_custname',
+                allowBlank: true,
+                fieldLabel: '客户名称'
             }, {
-                text : "物料名称", 
-                width : 150.0, 
-                dataIndex : "pr_detail",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
             }, {
-                text : "型号", 
-                width : 200.0, 
-                dataIndex : "pr_orispeccode",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                xtype: "numberfield",
+                name: "pi_costtotal",
+                fieldLabel: "金额(元)",
+                allowBlank: true,
+                readOnly: true,
+                columnWidth: 0.25,
+                thousandSeparator: ','
             }, {
-                text : "规格", 
-                width : 200, 
-                dataIndex : "pr_spec",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
+                name: "detailGridField",
+                xtype: "detailGridField",
+                storeModel: 'saas.model.stock.OtherOut',
+                deleteDetailUrl: '/api/storage/prodinout/deleteDetail',
+                detnoColumn: 'pd_pdno',
+                columns: [{
+                    text: "id",
+                    dataIndex: "id",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料id",
+                    dataIndex: "pd_prodid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "物料编号",
+                    width: 150.0,
+                    dataIndex: "pd_prodcode",
+                    xtype: "",
+                    items: null,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "productMultiDbfindTrigger"
+                    }
+                }, {
+                    text: 'model映射需要',
+                    dataIndex: 'productDTO',
+                    hidden: true,
+                }, {
+                    text: "品牌",
+                    width: 100.0,
+                    dataIndex: "pr_brand",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "物料名称",
+                    width: 150.0,
+                    dataIndex: "pr_detail",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "型号",
+                    width: 200.0,
+                    dataIndex: "pr_orispeccode",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "规格",
+                    width: 200,
+                    dataIndex: "pr_spec",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "仓库id",
+                    dataIndex: "pd_whid",
+                    xtype: "numbercolumn",
+                    hidden: true
+                }, {
+                    text: "仓库编号",
+                    dataIndex: "pd_whcode",
+                    hidden: true
+                }, {
+                    text: "仓库",
+                    dataIndex: "pd_whname",
+                    width: 110.0,
+                    allowBlank: false,
+                    editor: {
+                        displayField: "display",
+                        editable: true,
+                        format: "",
+                        hideTrigger: false,
+                        maxLength: 100.0,
+                        minValue: null,
+                        positiveNum: false,
+                        queryMode: "local",
+                        store: null,
+                        valueField: "value",
+                        xtype: "warehouseDbfindTrigger"
+                    }
+                }, {
+                    text: "数量",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_outqty",
+                    allowBlank: false,
+                    width: 110.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 3,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 3, false);
+                    }
+                }, {
+                    text: "单位",
+                    width: 65.0,
+                    dataIndex: "pr_unit",
+                    ignore: true,
+                    renderer: function (v, m, r) {
+                        if (!v) {
+                            return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
+                        }
+                        return v;
+                    }
+                }, {
+                    text: "单价(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_price",
+                    width: 120.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 4,
+                        minValue: 0
+                    },
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 4, true);
+                    }
+                }, {
+                    text: "金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "pd_total",
+                    width: 120.0,
+                    renderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function (v) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
+                }, {
+                    text: "备注",
+                    dataIndex: "pd_remark",
+                    width: 250,
+                    items: null,
+                    editor: {
+                        xtype: "textfield"
+                    }
+                }]
             }, {
-                text: "仓库id",
-                dataIndex: "pd_whid",
-                xtype: "numbercolumn",
-                hidden: true
+                xtype: "textfield",
+                name: "pi_remark",
+                fieldLabel: "备注",
+                columnWidth: 1
             }, {
-                text: "仓库编号",
-                dataIndex: "pd_whcode",
-                hidden: true
+                xtype: "hidden",
+                name: "creatorId",
+                fieldLabel: "录入人ID",
+                readOnly: true
             }, {
-                text: "仓库",
-                dataIndex: "pd_whname",
-                width: 110.0,
-                allowBlank : false,
-                editor: {
-                    displayField: "display",
-                    editable: true,
-                    format: "",
-                    hideTrigger: false,
-                    maxLength: 100.0,
-                    minValue: null,
-                    positiveNum: false,
-                    queryMode: "local",
-                    store: null,
-                    valueField: "value",
-                    xtype: "warehouseDbfindTrigger"
-                }
+                xtype: "textfield",
+                name: "creatorName",
+                fieldLabel: "录入人",
+                readOnly: true
             }, {
-                text: "数量",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_outqty",
-                allowBlank : false,
-                width: 110.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 3,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 3, false);
-                }
-            },{
-                text : "单位", 
-                width : 65.0, 
-                dataIndex : "pr_unit",
-                ignore:true,
-                renderer: function (v, m, r) {
-                    if(!v){
-                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; 
-                    }                     
-                    return v;
-                }
-            },{
-                text: "单价(元)",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_price", 
-                width : 120.0,
-                editor : {
-                    xtype : "numberfield",
-                    decimalPrecision: 4,
-                    minValue:0
-                },
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 4, true);
-                }
+                xtype: "datefield",
+                name: "createTime",
+                fieldLabel: "录入日期",
+                readOnly: true,
+                defaultValue: new Date()
             }, {
-                text: "金额(元)",
-                xtype: 'numbercolumn',
-                dataIndex: "pd_total",
-                width: 120.0,
-                renderer : function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                }
+                xtype: "hidden",
+                name: "updaterId",
+                fieldLabel: "更新人ID",
+                readOnly: true
             }, {
-                text : "备注", 
-                dataIndex : "pd_remark",
-                width : 250, 
-                items : null,
-                editor : {
-                    xtype : "textfield"
-                }
-            }
-        ]
-    },{
-        xtype : "textfield", 
-        name : "pi_remark", 
-        fieldLabel : "备注", 
-        columnWidth : 1
-    },{
-        xtype : "hidden", 
-        name : "creatorId", 
-        fieldLabel : "录入人ID", 
-        readOnly:true
+                xtype: "hidden",
+                name: "updaterName",
+                fieldLabel: "更新人",
+                readOnly: true
+            }, {
+                xtype: "hidden",
+                name: "updateTime",
+                fieldLabel: "更新日期",
+                readOnly: true,
+                defaultValue: new Date()
+            }, {
+                xtype: "textfield",
+                name: "pi_auditman",
+                fieldLabel: "审核人",
+                readOnly: true
+            }, {
+                xtype: "datefield",
+                name: "pi_auditdate",
+                fieldLabel: "审核日期",
+                readOnly: true
+            }]
+        });
+        this.callParent(arguments);
     },
-    {
-        xtype : "textfield", 
-        name : "creatorName", 
-        fieldLabel : "录入人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    },{
-        xtype : "hidden", 
-        name : "updaterId", 
-        fieldLabel : "更新人ID", 
-        readOnly:true
-    },{
-        xtype : "hidden", 
-        name : "updaterName", 
-        fieldLabel : "更新人", 
-        readOnly:true
-    }, {
-        xtype : "hidden", 
-        name : "updateTime", 
-        fieldLabel : "更新日期",
-        readOnly:true, 
-        defaultValue: new Date()
-    }, {
-        xtype : "textfield", 
-        name : "pi_auditman", 
-        fieldLabel : "审核人", 
-        readOnly:true
-    }, {
-        xtype : "datefield", 
-        name : "pi_auditdate", 
-        fieldLabel : "审核日期",
-        readOnly:true
-    }]
+
 });

+ 1 - 1
frontend/saas-web/app/view/sys/maxnumbers/Window.js

@@ -71,7 +71,7 @@ Ext.define('saas.view.sys.maxnumbers.Window', {
                 hideTrigger : true, 
                 fieldLabel: '流水长度',
                 name: 'mn_number',
-                minValue : 0, 
+                minValue : 1, 
                 allowBlank:false,
                 mouseWheelEnabled: false
             }]

+ 4 - 0
frontend/saas-web/app/view/viewport/ViewportModel.js

@@ -19,6 +19,10 @@ Ext.define('saas.view.viewport.ViewportModel', {
         },
         isAdmin: function(get) {
             var account = get('account');
+            //游客禁止
+            if (account && account.id == -99999){
+                return false;
+            }
             if (account && 0 == account.type) {
                 return true;
             }