Browse Source

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

hy 7 years ago
parent
commit
8b08b57a6f

+ 6 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -59,4 +59,10 @@ public class SaleDTO extends CommonBaseDTO{
     private String sa_auditman;
     private String sa_auditman;
 
 
     private Date sa_auditdate;
     private Date sa_auditdate;
+
+    private Date sa_date;
+
+    private String sa_seller;
+
+    private String sa_sellercode;
 }
 }

+ 6 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -58,4 +58,10 @@ public class Sale extends CommonBaseEntity{
     private String sa_auditman;
     private String sa_auditman;
 
 
     private Date sa_auditdate;
     private Date sa_auditdate;
+
+    private Date sa_date;
+
+    private String sa_seller;
+
+    private String sa_sellercode;
 }
 }

+ 32 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -30,12 +30,16 @@
     <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
     <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
     <result column="sa_auditman" property="sa_auditman" jdbcType="VARCHAR" />
     <result column="sa_auditman" property="sa_auditman" jdbcType="VARCHAR" />
     <result column="sa_auditdate" property="sa_auditdate" jdbcType="TIMESTAMP"/>
     <result column="sa_auditdate" property="sa_auditdate" jdbcType="TIMESTAMP"/>
+    <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
+    <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
+    <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP"/>
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyId, updaterId, 
     sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyId, updaterId, 
-    updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate
+    updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate,
+    sa_seller,sa_sellercode,sa_date
   </sql>
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     select 
@@ -148,6 +152,15 @@
       <if test="sa_text5 != null" >
       <if test="sa_text5 != null" >
         sa_text5,
         sa_text5,
       </if>
       </if>
+      <if test="sa_seller != null" >
+        sa_seller,
+      </if>
+      <if test="sa_sellercode != null" >
+        sa_sellercode,
+      </if>
+      <if test="sa_date != null" >
+        sa_date,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
       <if test="sa_code != null" >
@@ -225,6 +238,15 @@
       <if test="sa_text5 != null" >
       <if test="sa_text5 != null" >
         #{sa_text5,jdbcType=VARCHAR},
         #{sa_text5,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="sa_seller != null" >
+        #{sa_seller,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_sellercode != null" >
+        #{sa_sellercode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_date != null" >
+        #{sa_date,jdbcType=TIMESTAMP},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
@@ -311,6 +333,15 @@
       <if test="sa_auditdate != null" >
       <if test="sa_auditdate != null" >
         sa_auditdate = #{sa_auditdate,jdbcType=TIMESTAMP},
         sa_auditdate = #{sa_auditdate,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="sa_seller != null" >
+        sa_seller = #{sa_seller,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_sellercode != null" >
+        sa_sellercode = #{sa_sellercode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_date != null" >
+        sa_date = #{sa_date,jdbcType=TIMESTAMP},
+      </if>
     </set>
     </set>
     where sa_id = #{id,jdbcType=INTEGER}
     where sa_id = #{id,jdbcType=INTEGER}
   </update>
   </update>

+ 17 - 0
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -184,5 +184,22 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                 }
                 }
             }
             }
         });
         });
+    },
+    onSave: function() {
+        var me = this,
+            form = me.getView(),
+            viewModel = me.getViewModel(),
+            store1 = viewModel.get('detail0').detailStore;
+
+        var valid = form.isValid();
+        if(!valid) {
+            showToast(form.invalidText);
+            return false;
+        }
+
+        var sum_nowbalance = store1.sum('ord_nowbalance'); // 金额合计
+        viewModel.set('or_amount',sum_nowbalance);
+
+        me.save();
     }
     }
 });
 });

+ 18 - 0
frontend/saas-web/app/view/money/othspendings/FormPanelController.js

@@ -161,7 +161,25 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
 
 
                 }
                 }
             }
             }
+
         });
         });
 
 
+    },
+    onSave: function() {
+        var me = this,
+            form = me.getView(),
+            viewModel = me.getViewModel(),
+            store1 = viewModel.get('detail0').detailStore;
+
+        var valid = form.isValid();
+        if(!valid) {
+            showToast(form.invalidText);
+            return false;
+        }
+
+        var sum_nowbalance = store1.sum('osd_nowbalance'); // 金额合计
+        viewModel.set('os_amount',sum_nowbalance);
+
+        me.save();
     }
     }
 });
 });

+ 49 - 20
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -19,8 +19,9 @@ Ext.define('saas.view.stock.make.FormPanel', {
      _readUrl:'/api/storage/make/read/',
      _readUrl:'/api/storage/make/read/',
      _saveUrl:'/api/storage/make/save',
      _saveUrl:'/api/storage/make/save',
      _auditUrl:'/api/storage/make/audit',
      _auditUrl:'/api/storage/make/audit',
-    _unAuditUrl: '/api/storage/make/unAudit/',
+     _unAuditUrl: '/api/storage/make/unAudit/',
      _deleteUrl:'/api/storage/make/delete/',
      _deleteUrl:'/api/storage/make/delete/',
+     _getBomUrl:'/api/document/bom/read/',
      initId:0,
      initId:0,
  
  
      toolBtns: [],
      toolBtns: [],
@@ -33,7 +34,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
     },{
     },{
         xtype: 'combobox',
         xtype: 'combobox',
         name: 'ma_type',
         name: 'ma_type',
-        columnWidth: 0.2,
+        columnWidth: 0.25,
         fieldLabel: '类型',
         fieldLabel: '类型',
         queryMode: 'local',
         queryMode: 'local',
         displayField: 'name',
         displayField: 'name',
@@ -49,67 +50,68 @@ Ext.define('saas.view.stock.make.FormPanel', {
     },{
     },{
         xtype: 'hidden',
         xtype: 'hidden',
         name: 'ma_prodid',
         name: 'ma_prodid',
-        fieldLabel: '产品id',
-        columnWidth: 0
+        fieldLabel: '产品id'
     },{
     },{
-        xtype : "dbfindtrigger", 
+        xtype : "dbfindtrigger",
+        editable:false, 
         name : "ma_prodcode", 
         name : "ma_prodcode", 
         fieldLabel : "产品编号",
         fieldLabel : "产品编号",
-        columnWidth: 0.2
+        allowBlank : false,
+        columnWidth: 0.25
     },{
     },{
         xtype : "textfield", 
         xtype : "textfield", 
         name : "ma_proddetail", 
         name : "ma_proddetail", 
         fieldLabel : "名称",
         fieldLabel : "名称",
-        columnWidth: 0.2
+        columnWidth: 0.25
     },{
     },{
         xtype : "textfield", 
         xtype : "textfield", 
         name : "ma_prodspec", 
         name : "ma_prodspec", 
         fieldLabel : "规格",
         fieldLabel : "规格",
-        columnWidth: 0.2
+        columnWidth: 0.25
     },{
     },{
         xtype : "textfield", 
         xtype : "textfield", 
         name : "ma_version", 
         name : "ma_version", 
         fieldLabel : "版本",
         fieldLabel : "版本",
-        columnWidth: 0.2
+        columnWidth: 0.25
     },{
     },{
         xtype : "textfield", 
         xtype : "textfield", 
         name : "ma_produnit", 
         name : "ma_produnit", 
         fieldLabel : "单位",
         fieldLabel : "单位",
-        columnWidth: 0.2
+        columnWidth: 0.25
     },
     },
     {
     {
         xtype : "numberfield", 
         xtype : "numberfield", 
         name : "ma_qty", 
         name : "ma_qty", 
         fieldLabel : "数量",
         fieldLabel : "数量",
-        columnWidth: 0.2,
+        columnWidth: 0.25,
+        allowBlank : false,
         minValue:0
         minValue:0
     },{
     },{
         xtype : "hidden", 
         xtype : "hidden", 
         name : "ma_whid", 
         name : "ma_whid", 
-        fieldLabel : "仓库id",
-        columnWidth: 0
+        fieldLabel : "仓库id"
     },{
     },{
         xtype : "hidden",
         xtype : "hidden",
         name : "ma_whcode", 
         name : "ma_whcode", 
-        fieldLabel : "仓库编号",
-        columnWidth: 0
+        fieldLabel : "仓库编号"
     },{
     },{
         xtype : "dbfindtrigger",
         xtype : "dbfindtrigger",
         name : "ma_whname",
         name : "ma_whname",
         fieldLabel : "仓库名称",
         fieldLabel : "仓库名称",
-        columnWidth: 0.2
+        allowBlank : false,
+        columnWidth: 0.25
     },{
     },{
         xtype : "numberfield", 
         xtype : "numberfield", 
         name : "ma_price", 
         name : "ma_price", 
         fieldLabel : "单位成本",
         fieldLabel : "单位成本",
         decimals:8,
         decimals:8,
-        columnWidth: 0.2
+        columnWidth: 0.25
     },{
     },{
         xtype : "numberfield", 
         xtype : "numberfield", 
         name : "ma_total", 
         name : "ma_total", 
         fieldLabel : "总成本",
         fieldLabel : "总成本",
         decimals:2,
         decimals:2,
-        columnWidth: 0.2
+        columnWidth: 0.25
     },
     },
     {
     {
         name : "detailGridField", 
         name : "detailGridField", 
@@ -134,6 +136,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 text : "物料编号", 
                 text : "物料编号", 
                 width : 200.0, 
                 width : 200.0, 
                 dataIndex : "mm_prodcode", 
                 dataIndex : "mm_prodcode", 
+                allowBlank : false,
                 xtype : "", 
                 xtype : "", 
                 items : null,
                 items : null,
                 editor : {
                 editor : {
@@ -178,7 +181,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 }
                 }
             },            
             },            
             {
             {
-                text : "数量", 
+                text : "需求数量", 
                 dataIndex : "mm_qty", 
                 dataIndex : "mm_qty", 
                 width : 120.0,
                 width : 120.0,
                 editor : {
                 editor : {
@@ -199,7 +202,32 @@ Ext.define('saas.view.stock.make.FormPanel', {
                     var format = '0.' + xr.join();
                     var format = '0.' + xr.join();
                     return Ext.util.Format.number(v, format);
                     return Ext.util.Format.number(v, format);
                 }
                 }
-            },{
+            },
+            {
+                text : "单位用量", 
+                dataIndex : "mm_oneuseqty", 
+                width : 120.0,
+                editor : {
+                    xtype : "numberfield",
+                    decimalPrecision: 8,
+                    editable:false,
+                    minValue:0
+                },
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                },
+                summaryType: 'sum',
+                summaryRenderer: function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
+            },            
+            {
                 text : "仓库id",
                 text : "仓库id",
                 dataIndex : "mm_whid",
                 dataIndex : "mm_whid",
                 xtype : "numbercolumn",
                 xtype : "numbercolumn",
@@ -215,6 +243,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 dataIndex : "mm_whname",
                 dataIndex : "mm_whname",
                 width : 120.0,
                 width : 120.0,
                 items : null,
                 items : null,
+                allowBlank : false,
                 editor : {
                 editor : {
                     displayField : "display",
                     displayField : "display",
                     editable : true,
                     editable : true,

+ 91 - 75
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -240,38 +240,35 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                 beforerender:function(f){
                 beforerender:function(f){
                     Ext.apply(f,{
                     Ext.apply(f,{
                         //数据接口
                         //数据接口
-                        dataUrl:'/api/document/product/list',
-                        addXtype: 'document-product-formpanel',
-                        addTitle: '物料资料',
+                        dataUrl:'/api/document/bom/list',
+                        addXtype: 'document-bom-formpanel',
+                        addTitle: 'BOM资料',
                         //放大镜赋值设置
                         //放大镜赋值设置
                         dbfinds:[{
                         dbfinds:[{
-                            from:'pr_code',to:'ma_prodcode'
-                        },{
                             from:'id',to:'ma_prodid'
                             from:'id',to:'ma_prodid'
                         },{
                         },{
-                            from:'pr_detail',to:'ma_proddetail'
-                        },{
-                            from:'pr_spec',to:'ma_prodspec'
+                            from:'bo_mothercode',to:'ma_prodcode'
                         },{
                         },{
-                            from:'pr_unit',to:'ma_produnit'
+                            from:'bo_mothername',to:'ma_proddetail'
                         }],
                         }],
                         //联想设置
                         //联想设置
                         dbtpls:[{
                         dbtpls:[{
-                            field:'pr_code',width:100
-                        },{
-                            field:'pr_detail',width:100
+                            field:'bo_mothercode',width:100
                         },{
                         },{
-                            field:'pr_spec',width:100
+                            field:'bo_mothername',width:100
                         }],
                         }],
-                        defaultCondition:"pr_statuscode='OPEN'",
+                        aftertrigger:function(f,record){
+                            me.getBomData(record.data.id)
+                        },
+                        defaultCondition:"bo_statuscode='OPEN'",
                         //窗口字段设置
                         //窗口字段设置
                         dbSearchFields:[{
                         dbSearchFields:[{
-                            emptyText:'输入物料编号、名称或规格',
+                            emptyText:'输入BOM编号或名称',
                             xtype : "textfield", 
                             xtype : "textfield", 
                             name : "search", 
                             name : "search", 
                             width: 200,
                             width: 200,
                             getCondition: function(v) {
                             getCondition: function(v) {
-                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                                return "(upper(bo_mothercode) like '%"+v.toUpperCase()+"%' or upper(bo_mothername) like '%"+v.toUpperCase()+"%')";
                             },
                             },
                             allowBlank : true, 
                             allowBlank : true, 
                             columnWidth : 0.25
                             columnWidth : 0.25
@@ -283,63 +280,66 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             "dataIndex": "id",
                             "dataIndex": "id",
                         }, {
                         }, {
                             "text": "物料编号",       
                             "text": "物料编号",       
-                            "dataIndex": "pr_code",
+                            "dataIndex": "bo_mothercode",
                             "width": 200,
                             "width": 200,
                         }, {
                         }, {
                             "text": "物料名称",
                             "text": "物料名称",
                             "width": 200,
                             "width": 200,
-                            "dataIndex": "pr_detail",
-                        }, {
-                            "text": "规格",
-                            "dataIndex": "pr_spec",
-                            "width": 100,
-                        }, {
-                            "text": "单位",
-                            "dataIndex": "pr_spec",
-                            "width": 100,
-                        },{
-                            "text": "仓库id",
-                            "dataIndex": "pr_whid",
-                            "hidden": true,
-                        },{
-                            "text": "仓库编号",
-                            "dataIndex": "pr_whcode",
-                            "hidden": true,
-                        },{
-                            "text": "仓库",
-                            "dataIndex": "pr_whname",
-                            "width": 200,
-                        },{
-                            "text": "总库存数",
-                            "dataIndex": "po_onhand",
-                            "width": 100,
-                            align:'right'
-                        },{
-                            "text": "类型",
-                            "dataIndex": "pr_kind",
-                            "width": 100,
-                        },{
-                            "text": "型号",
-                            "dataIndex": "pr_orispeccode",
-                            "width": 100,
-                        },{
-                            "text": "品牌",
-                            "dataIndex": "pr_brand",
-                            "width": 100,
-                        },{
-                            "text": "供应商",
-                            "dataIndex": "pr_vendname",
-                            "width": 100,
-                        },{
-                            "text": "最小包装",
-                            "dataIndex": "pr_zxbzs",
-                            "width": 100,
-                            align:'right'
-                        },{
-                            "text": "L/T",
-                            "dataIndex": "pr_leadtime",
-                            "width": 100,
-                        }]
+                            "dataIndex": "bo_mothername",
+                        }
+                        // ,{
+                        //     "text": "规格",
+                        //     "dataIndex": "pr_spec",
+                        //     "width": 100,
+                        // }, {
+                        //     "text": "单位",
+                        //     "dataIndex": "pr_spec",
+                        //     "width": 100,
+                        // },{
+                        //     "text": "仓库id",
+                        //     "dataIndex": "pr_whid",
+                        //     "hidden": true,
+                        // },{
+                        //     "text": "仓库编号",
+                        //     "dataIndex": "pr_whcode",
+                        //     "hidden": true,
+                        // },{
+                        //     "text": "仓库",
+                        //     "dataIndex": "pr_whname",
+                        //     "width": 200,
+                        // },{
+                        //     "text": "总库存数",
+                        //     "dataIndex": "po_onhand",
+                        //     "width": 100,
+                        //     align:'right'
+                        // },{
+                        //     "text": "类型",
+                        //     "dataIndex": "pr_kind",
+                        //     "width": 100,
+                        // },{
+                        //     "text": "型号",
+                        //     "dataIndex": "pr_orispeccode",
+                        //     "width": 100,
+                        // },{
+                        //     "text": "品牌",
+                        //     "dataIndex": "pr_brand",
+                        //     "width": 100,
+                        // },{
+                        //     "text": "供应商",
+                        //     "dataIndex": "pr_vendname",
+                        //     "width": 100,
+                        // },{
+                        //     "text": "最小包装",
+                        //     "dataIndex": "pr_zxbzs",
+                        //     "width": 100,
+                        //     align:'right'
+                        // },{
+                        //     "text": "L/T",
+                        //     "dataIndex": "pr_leadtime",
+                        //     "width": 100,
+                        // }
+                    
+                    ]
                     }) ;   
                     }) ;   
 
 
                 }
                 }
@@ -466,23 +466,39 @@ Ext.define('saas.view.stock.make.FormPanelController', {
         viewModel.set('ma_price',sum_qty);
         viewModel.set('ma_price',sum_qty);
     },
     },
 
 
-    turnIn: function() {
+
+     getBomData: function(v) {
         var me = this,
         var me = this,
         form = me.getView(),
         form = me.getView(),
-        id = form.getForm().findField(form._idField);
+        viewModel = me.getViewModel(),
+        store = viewModel.get('detail0').detailStore,
+        loadData = new Array();;
+        //请求bom资料
         form.BaseUtil.request({
         form.BaseUtil.request({
-            url: form._turnInUrl+id.value,
+            url: form._getBomUrl+v,
             method: 'GET',
             method: 'GET',
         })
         })
         .then(function(localJson) {
         .then(function(localJson) {
             if(localJson.success){
             if(localJson.success){
-                showToast('转单成功');
-              
+                var data = localJson.data.items;
+                Ext.Array.each(data, function(item, i) {
+                    loadData.push({
+                        mm_detno:item.bd_detno,
+                        mm_prodidid:item.bd_sonid,
+                        mm_prodcode:item.bd_soncode,
+                        mm_oneuseqty:item.bd_baseqty,
+                        pr_detail:'',
+                        pr_spec:'',
+                        pr_unit:''
+                    })                
+                });
+                store.loadData(loadData)
+        
             }
             }
         })
         })
         .catch(function(res) {
         .catch(function(res) {
             console.error(res);
             console.error(res);
-            showToast('转单失败: ' + res.message);
+            showToast('获取BOM资料失败: ' + res.message);
         });
         });
      }
      }
 });
 });

+ 17 - 0
frontend/saas-web/app/view/stock/make/FormPanelModel.js

@@ -2,4 +2,21 @@ Ext.define('saas.view.stock.make.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.stock-make-formpanel',
     alias: 'viewmodel.stock-make-formpanel',
 
 
+    formulas: {
+        ma_qty_change: {
+            bind: '{ma_qty}',
+            get: function(v) {
+                var viewModel = this.getView().getViewModel(),
+                store = viewModel.get('detail0').detailStore,
+                items  = store.getData().items,
+                oneuseqty=0;
+                Ext.Array.each(items, function(item, i) {
+                    oneuseqty = item.get('mm_oneuseqty');
+                    item.set('mm_qty', oneuseqty*v);               
+                });
+                return v;
+            }
+        }
+    }
+
 });
 });