Browse Source

出入库单代码优化

zhoudw 7 years ago
parent
commit
ef743543da
17 changed files with 964 additions and 125 deletions
  1. 14 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  2. 25 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  3. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java
  4. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  5. 57 22
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  6. 51 0
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomerMapperTest.java
  7. 0 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java
  8. 0 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java
  9. 1 58
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  10. 0 24
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  11. 1 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  12. 279 0
      frontend/saas-web/app/view/stock/make/FormPanel.js
  13. 214 0
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  14. 5 0
      frontend/saas-web/app/view/stock/make/FormPanelModel.js
  15. 191 0
      frontend/saas-web/app/view/stock/make/QueryPanel.js
  16. 117 0
      frontend/saas-web/app/view/stock/make/QueryPanelController.js
  17. 5 0
      frontend/saas-web/app/view/stock/make/QueryPanelModel.js

+ 14 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java

@@ -6,17 +6,29 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 @SpringBootApplication
 @EnableEurekaClient
 //@EnableAuthClient
 @EnableTransactionManagement
-@EnableFeignClients
+@EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
-public class DocumentApplication  {
+public class DocumentApplication  extends WebMvcConfigurerAdapter {
 
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class);
     }
 
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+
+        registry.addMapping("/**")
+                .allowCredentials(true)
+                .allowedHeaders("*")
+                .allowedOrigins("*")
+                .allowedMethods("*");
+    }
+
 }

+ 25 - 8
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -97,7 +97,7 @@ public class CustomerController {
     }
 
     /**
-     * 采购订单批量删除
+     * 客户资料批量删除
      *
      * @param baseDTOs
      * @return
@@ -120,6 +120,19 @@ public class CustomerController {
         return Result.success(close);
     }
 
+
+    /**
+     * 客户资料批量删除
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchClose")
+    public Result batchClose(@RequestBody BatchDealBaseDTO baseDTOs) {
+        customerService.batchClose(baseDTOs);
+        return Result.success();
+    }
+
     /**
      * 客户资料启用
      *
@@ -132,12 +145,16 @@ public class CustomerController {
         return Result.success(open);
     }
 
-
-
-
-
-
-
-
+    /**
+     * 客户资料批量启用
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchOpen")
+    public Result batchOpen(@RequestBody BatchDealBaseDTO baseDTOs) {
+        customerService.batchOpen(baseDTOs);
+        return Result.success();
+    }
 
 }

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java

@@ -33,4 +33,8 @@ public interface CustomerService extends CommonBaseService<CustomerMapper, Custo
     void deletecontact(Long id);
 
     void deleteaddress(Long id);
+
+    void batchClose(BatchDealBaseDTO baseDTOs);
+
+    void batchOpen(BatchDealBaseDTO baseDTOs);
 }

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java

@@ -3,7 +3,6 @@ package com.usoftchina.saas.document.service.impl;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;

+ 57 - 22
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -255,40 +255,75 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
 //        messageLogService.deleteDetail(docBaseDTO);
     }
 
+    private DocBaseDTO singleClose(Long id) {
+        DocBaseDTO docBaseDTO = null;
+        if (null!=id) {
+            Customer customer = getMapper().selectByPrimaryKey(id);
+            if(Status.CLOSE.name().equals(customer.getCu_statuscode())){
+                throw new BizException(BizExceptionCode.BIZ_CLOSE);
+            }
+            customer.setCu_statuscode(Status.CLOSE.name());
+            customer.setCu_status(Status.CLOSE.getDisplay());
+            getMapper().updateByPrimaryKeySelective(customer);
+            docBaseDTO = getBaseDTOById(id);
+            //日志
+//        messageLogService.close(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
+
     @Override
     public DocBaseDTO close(long id) {
-        Customer customer = getMapper().selectByPrimaryKey(id);
-        if(Status.CLOSE.name().equals(customer.getCu_statuscode())){
-            throw new BizException(BizExceptionCode.BIZ_CLOSE);
+        return singleClose(id);
+    }
+
+    @Override
+    public void batchClose(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
         }
-        customer = new Customer();
-        customer.setId(id);
-        customer.setCu_statuscode(Status.CLOSE.name());
-        customer.setCu_status(Status.CLOSE.getDisplay());
-        getMapper().updateByPrimaryKeySelective(customer);
-        DocBaseDTO docBaseDTO = getBaseDTOById(id);
-        //日志
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            singleClose(base.getId());
+        }
+    }
+
+    private DocBaseDTO singleOpen(Long id) {
+        DocBaseDTO docBaseDTO = null;
+        if (null!=id) {
+            Customer customer = getMapper().selectByPrimaryKey(id);
+            if(Status.OPEN.name().equals(customer.getCu_statuscode())){
+                throw new BizException(BizExceptionCode.BIZ_OPEN);
+            }
+            customer.setCu_statuscode(Status.OPEN.name());
+            customer.setCu_status(Status.OPEN.getDisplay());
+            getMapper().updateByPrimaryKeySelective(customer);
+            docBaseDTO = getBaseDTOById(id);
+            //日志
 //        messageLogService.close(docBaseDTO);
+        }
         return docBaseDTO;
     }
 
+
     @Override
     public DocBaseDTO open(long id) {
-        Customer customer = getMapper().selectByPrimaryKey(id);
-        if(Status.OPEN.name().equals(customer.getCu_statuscode())){
-            throw new BizException(BizExceptionCode.BIZ_OPEN);
+        return singleOpen(id);
+    }
+
+    @Override
+    public void batchOpen(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            singleOpen(base.getId());
         }
-        customer = new Customer();
-        customer.setId(id);
-        customer.setCu_statuscode(Status.OPEN.name());
-        customer.setCu_status(Status.OPEN.getDisplay());
-        getMapper().updateByPrimaryKeySelective(customer);
-        DocBaseDTO docBaseDTO = getBaseDTOById(id);
-        //日志
-//        messageLogService.close(docBaseDTO);
-        return docBaseDTO;
     }
 
+
     private List<CustomerList> getListByMode(ListReqDTO req) {
         List<CustomerList> list = null;
         Long companyId = BaseContextHolder.getCompanyId();

+ 51 - 0
applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomerMapperTest.java

@@ -0,0 +1,51 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.document.DocumentApplication;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+/**
+ * Created by zdw
+ * 2018-10-26 14:44.
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = DocumentApplication.class)
+@EnableAutoConfiguration
+public class CustomerMapperTest {
+    @Autowired
+    private CustomerMapper customerMapper;
+
+
+    @Test
+    public void deleteByPrimaryKey() throws Exception {
+    }
+
+    @Test
+    public void insertSelective() throws Exception {
+    }
+
+    @Test
+    public void selectByPrimaryKey() throws Exception {
+        System.out.println("---");
+        System.out.println(customerMapper.selectByPrimaryKey(new Long(24)).getCompanyId());
+
+
+    }
+
+    @Test
+    public void updateByPrimaryKeySelective() throws Exception {
+    }
+
+    @Test
+    public void updateByPrimaryKey() throws Exception {
+    }
+
+    @Test
+    public void selectCodeById() throws Exception {
+    }
+
+}

+ 0 - 4
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java

@@ -10,14 +10,10 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
 
     int deleteByPrimaryKey(Long pd_id);
 
-    int insert(ProdIODetail record);
-
     int insertSelective(ProdIODetail record);
 
-
     ProdIODetail selectByPrimaryKey(Integer pd_id);
 
-
     int updateByPrimaryKeySelective(ProdIODetail record);
 
     int updateByPrimaryKeyWithBLOBs(ProdIODetail record);

+ 0 - 5
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java

@@ -8,15 +8,10 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
 
     int deleteByPrimaryKey(Long pi_id);
 
-    int insert(ProdInOut record);
-
     int insertSelective(ProdInOut record);
 
-
-
     ProdInOut selectByPrimaryKey(Long pi_id);
 
-
     int updateByPrimaryKeySelective(ProdInOut record);
 
     int updateByPrimaryKeyWithBLOBs(ProdInOut record);

+ 1 - 58
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -97,37 +97,6 @@
     delete from prodiodetail
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
-    insert into prodiodetail (pd_id, pd_piid, pd_inoutno, 
-      pd_piclass, pd_pdno, pd_ordercode, 
-      pd_orderdetno, pd_prodid, pd_prodcode, 
-      pd_unit, pd_inqty, pd_outqty, 
-      pd_orderprice, pd_sendprice, pd_price, 
-      pd_total, pd_taxrate, pd_netprice, 
-      pd_nettotal, pd_whid, pd_whcode, 
-      pd_whname, pd_inwhid, pd_inwhcode, 
-      pd_inwhname, pd_orderid, pd_sdid, 
-      pd_status, companyid, updaterid, 
-      updatetime, pd_text1, pd_text2, 
-      pd_text3, pd_text4, pd_text5, 
-      pd_ym, pd_yqty, pd_remark,pd_ioid
-      )
-    values (#{pd_id,jdbcType=INTEGER}, #{pd_piid,jdbcType=INTEGER}, #{pd_inoutno,jdbcType=VARCHAR}, 
-      #{pd_piclass,jdbcType=VARCHAR}, #{pd_pdno,jdbcType=INTEGER}, #{pd_ordercode,jdbcType=VARCHAR}, 
-      #{pd_orderdetno,jdbcType=INTEGER}, #{pd_prodid,jdbcType=INTEGER}, #{pd_prodcode,jdbcType=VARCHAR}, 
-      #{pd_unit,jdbcType=VARCHAR}, #{pd_inqty,jdbcType=DOUBLE}, #{pd_outqty,jdbcType=DOUBLE},
-      #{pd_orderprice,jdbcType=DOUBLE}, #{pd_sendprice,jdbcType=DOUBLE}, #{pd_price,jdbcType=DOUBLE}, 
-      #{pd_total,jdbcType=DOUBLE}, #{pd_taxrate,jdbcType=DOUBLE}, #{pd_netprice,jdbcType=DOUBLE},
-      #{pd_nettotal,jdbcType=DOUBLE}, #{pd_whid,jdbcType=INTEGER}, #{pd_whcode,jdbcType=VARCHAR}, 
-      #{pd_whname,jdbcType=VARCHAR}, #{pd_inwhid,jdbcType=INTEGER}, #{pd_inwhcode,jdbcType=VARCHAR}, 
-      #{pd_inwhname,jdbcType=VARCHAR}, #{pd_orderid,jdbcType=INTEGER}, #{pd_sdid,jdbcType=INTEGER}, 
-      #{pd_status,jdbcType=INTEGER}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
-      #{updatetime,jdbcType=TIMESTAMP}, #{pd_text1,jdbcType=VARCHAR}, #{pd_text2,jdbcType=VARCHAR}, 
-      #{pd_text3,jdbcType=VARCHAR}, #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, 
-      #{pd_ym,jdbcType=INTEGER}, #{pd_yqty,jdbcType=DOUBLE}, #{pd_remark,jdbcType=LONGVARCHAR},
-      #{pd_ioid,jdbcType=INTEGER}
-      )
-  </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
     <selectKey resultType="java.lang.Long" keyProperty="id">
       SELECT LAST_INSERT_ID() AS ID
@@ -581,32 +550,6 @@
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </update>
   <insert id="batchInsert" parameterType="java.util.List" >
-    insert into prodiodetail
-    (
-    pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_ordercode,
-    pd_orderdetno,pd_prodid,pd_prodcode,pd_unit,
-    pd_inqty,pd_outqty,pd_orderprice,pd_sendprice,pd_price,
-    pd_total,pd_taxrate,pd_netprice,pd_nettotal,
-    pd_whid,pd_whcode,pd_whname,pd_inwhid,pd_inwhcode,
-    pd_inwhname,pd_orderid,pd_sdid,pd_status,pd_remark,
-    companyid,updaterid,updatetime,pd_text1,pd_text2,
-    pd_text3,pd_text4,pd_text5,pd_ym,pd_yqty
-    )
-    values
-    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
-      (
-      #{item.pd_piid,jdbcType=INTEGER},#{item.pd_inoutno,jdbcType=VARCHAR},#{item.pd_piclass,jdbcType=VARCHAR},#{item.pd_pdno,jdbcType=INTEGER},#{item.pd_ordercode,jdbcType=VARCHAR},
-      #{item.pd_orderdetno,jdbcType=INTEGER},#{item.pd_prodid,jdbcType=INTEGER},#{item.pd_prodcode,jdbcType=VARCHAR},#{item.pd_unit,jdbcType=VARCHAR},
-      #{item.pd_inqty,jdbcType=DOUBLE},#{item.pd_outqty,jdbcType=DOUBLE},#{item.pd_orderprice,jdbcType=DOUBLE},#{item.pd_sendprice,jdbcType=DOUBLE},#{item.pd_price,jdbcType=DOUBLE},
-      #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE},#{item.pd_netprice,jdbcType=DOUBLE},#{item.pd_nettotal,jdbcType=DOUBLE},
-      #{item.pd_whid,jdbcType=INTEGER},#{item.pd_whcode,jdbcType=VARCHAR},#{item.pd_whname,jdbcType=VARCHAR},#{item.pd_inwhid,jdbcType=INTEGER},#{item.pd_inwhcode,jdbcType=VARCHAR},
-      #{item.pd_inwhname,jdbcType=VARCHAR},#{item.pd_orderid,jdbcType=INTEGER},#{item.pd_sdid,jdbcType=INTEGER},#{item.pd_status,jdbcType=VARCHAR},#{item.pd_remark,jdbcType=VARCHAR},
-      #{item.companyId,jdbcType=INTEGER},#{item.updaterId,jdbcType=INTEGER},#{item.updateTime,jdbcType=TIMESTAMP},#{item.pd_text1,jdbcType=VARCHAR},#{item.pd_text2,jdbcType=VARCHAR},
-      #{item.pd_text3,jdbcType=VARCHAR},#{item.pd_text4,jdbcType=VARCHAR},#{item.pd_text5,jdbcType=VARCHAR},#{item.pd_ym,jdbcType=INTEGER},#{item.pd_yqty,jdbcType=DOUBLE}
-      )
-    </foreach>
-  </insert>
-  <insert id="batchInsert1" parameterType="java.util.List" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       insert into prodiodetail
       <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -847,9 +790,9 @@
           #{item.pd_ioid,jdbcType=INTEGER},
         </if>
       </trim>
-
     </foreach>
   </insert>
+
   <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update prodiodetail <set>

+ 0 - 24
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -64,30 +64,6 @@
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </delete>
 
-  <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.ProdInOut">
-    insert into prodinout (pi_id, pi_inoutno, pi_class, 
-      pi_date, pi_vendid, pi_vendcode, 
-      pi_vendname, pi_custid, pi_custcode, 
-      pi_custname, pi_puid, pi_pucode, 
-      pi_said, pi_sacode, pi_total, 
-      pi_recordmanid, pi_recordman, pi_recorddate, 
-      pi_status, pi_statuscode, pi_printstatus, 
-      pi_printstatuscode, companyid, updaterid, 
-      updatetime, pi_text1, pi_text2, 
-      pi_text3, pi_text4, pi_text5,
-      pi_address)
-    values (#{pi_id,jdbcType=INTEGER}, #{pi_inoutno,jdbcType=VARCHAR}, #{pi_class,jdbcType=VARCHAR}, 
-      #{pi_date,jdbcType=TIMESTAMP}, #{pi_vendid,jdbcType=INTEGER}, #{pi_vendcode,jdbcType=VARCHAR}, 
-      #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
-      #{pi_custname,jdbcType=VARCHAR}, #{pi_puid,jdbcType=INTEGER}, #{pi_pucode,jdbcType=VARCHAR}, 
-      #{pi_said,jdbcType=INTEGER}, #{pi_sacode,jdbcType=VARCHAR}, #{pi_total,jdbcType=DOUBLE},
-      #{pi_recordmanid,jdbcType=INTEGER}, #{pi_recordman,jdbcType=VARCHAR}, #{pi_recorddate,jdbcType=TIMESTAMP}, 
-      #{pi_status,jdbcType=VARCHAR}, #{pi_statuscode,jdbcType=VARCHAR}, #{pi_printstatus,jdbcType=VARCHAR}, 
-      #{pi_printstatuscode,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
-      #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
-      #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
-      #{pi_address,jdbcType=LONGVARCHAR})
-  </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.ProdInOut">
     <selectKey resultType="java.lang.Long" keyProperty="id">
       SELECT LAST_INSERT_ID() AS ID

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

@@ -102,7 +102,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField",
-        storeModel:'saas.model.purchase.ProdIODetail', 
+        storeModel:'saas.model.document.Product', 
         _detnoColumn:  'pd_pdno',
         columns : [
             {

+ 279 - 0
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -0,0 +1,279 @@
+Ext.define('saas.view.stock.make.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'stock-make-formpanel',
+
+    controller: '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',
+     _relationColumn: 'mm_maid',
+
+     _readUrl:basePath+'purchase/purchase/read/',
+     _saveUrl:basePath+'purchase/purchase/save',
+     _auditUrl:basePath+'purchase/purchase/audit',
+     _deleteUrl:basePath+'purchase/purchase/delete/',
+     _deleteDetailUrl:basePath+'purchase/purchase/deleteItem/',
+     _turnInUrl:basePath+'purchase/prodinout/turnProdin/',
+     initId:0,
+ 
+     toolBtns: [],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        fieldLabel: 'id',
+        columnWidth: 0
+    }, {
+        xtype : "textfield", 
+        name : "ma_code", 
+        fieldLabel : "制造单号",
+        columnWidth: 0.2
+    }, {
+        xtype : "textfield", 
+        name : "ma_type", 
+        fieldLabel : "类型",
+        columnWidth: 0.2
+    },{
+        xtype: 'hidden',
+        name: 'ma_prodid',
+        fieldLabel: '产品id',
+        columnWidth: 0
+    },{
+        xtype : "textfield", 
+        name : "ma_prodcode", 
+        fieldLabel : "产品编号",
+        columnWidth: 0.2
+    },{
+        xtype : "textfield", 
+        name : "ma_proddetail", 
+        fieldLabel : "名称",
+        columnWidth: 0.2
+    },{
+        xtype : "textfield", 
+        name : "ma_prodspec", 
+        fieldLabel : "规格",
+        columnWidth: 0.2
+    },{
+        xtype : "textfield", 
+        name : "ma_version", 
+        fieldLabel : "版本",
+        columnWidth: 0.2
+    },{
+        xtype : "textfield", 
+        name : "ma_produnit", 
+        fieldLabel : "单位",
+        columnWidth: 0.2
+    },
+    {
+        xtype : "textfield", 
+        name : "ma_qty", 
+        fieldLabel : "数量",
+        columnWidth: 0.2
+    },{
+        xtype : "hidden", 
+        name : "ma_whid", 
+        fieldLabel : "仓库id",
+        columnWidth: 0.2
+    },{
+        xtype : "textfield", 
+        name : "ma_whcode", 
+        fieldLabel : "仓库",
+        columnWidth: 0.2
+    },{
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        storeModel:'saas.model.document.Product',
+        _detnoColumn:  'pd_detno',
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "mm_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                locked:true,
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "mm_prodidid", 
+                dataIndex : "mm_prodid", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "mm_prodcode", 
+                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 : "dbfindtrigger"
+                }
+            },
+            {
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
+                }
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["product"]?r.data["product"][m.column.dataIndex]:'';
+                }
+            },
+            {
+                text : "数量", 
+                dataIndex : "pd_qty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+            {
+                text : "已转数", 
+                dataIndex : "pd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+            {
+                text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
+                dataIndex : "pd_price", 
+                width : 120.0, 
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                dataIndex : "pd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "含税金额", 
+                dataIndex : "pd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, 
+            {
+                text : "未税金额", 
+                dataIndex : "pd_taxtotal", 
+                xtype : "numbercolumn"
+            },{
+                text : "需求日期", 
+                dataIndex : "pd_delivery", 
+                flex : 1.0, 
+                xtype:'datecolumn',
+                format : "Y-m-d H:i:s", 
+                editor : {
+                    xtype : "datefield",
+                    editable : true, 
+                    format : "Y-m-d H:i:s", 
+                    hideTrigger : false
+                }
+            },
+            {
+                text : "关联销售单号", 
+                dataIndex : "pd_salecode", 
+                width : 120.0,
+                flex : 1.0
+            }
+        ]
+    },{
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "制单日", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "ma_recorder", 
+        fieldLabel : "制单人",
+        columnWidth: 0.2
+    },{
+        xtype : "numberfield", 
+        name : "ma_price", 
+        fieldLabel : "单位成本",
+        columnWidth: 0.2
+    },{
+        xtype : "numberfield", 
+        name : "ma_total", 
+        fieldLabel : "总成本",
+        columnWidth: 0.2
+    }, {
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        readOnly : true, 
+        editable : false, 
+        name : "ma_status", 
+        bind : "{ma_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "ma_statuscode", 
+        bind : "{ma_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

+ 214 - 0
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -0,0 +1,214 @@
+Ext.define('saas.view.stock.make.FormPanelController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.stock-make-formpanel',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //主表单选放大镜模板
+            'dbfindtrigger[name=pu_vendcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:basePath+'document/vendor/getVendorsByCondition',
+                        //赋值 
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        //联想设置
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            conditionExpression:"ve_name like '{0}%'",//传入后台条件  替换占位符
+                            fieldLabel : "供应商名称", 
+                            columnWidth : 0.25
+                        }],
+                        //放大镜窗口列表
+                        dbColumns:[{
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //从表单选放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:basePath+'document/product/getProductsByCondition',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //从表多选放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        //数据接口
+                        dataUrl:'http://192.168.253.31:9480/product/getProductsByCondition',
+                        //放大镜赋值设置
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        //联想查询条件
+                        dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                        //联想设置
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        //窗口字段设置
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        //窗口列设置
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+    },
+
+    turnIn: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnInUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+              
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
+});

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

@@ -0,0 +1,5 @@
+Ext.define('saas.view.stock.make.FormPanelModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.stock-make-formpanel',
+
+});

+ 191 - 0
frontend/saas-web/app/view/stock/make/QueryPanel.js

@@ -0,0 +1,191 @@
+Ext.define('saas.view.stock.make.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'stock-make-querypanel',
+
+    controller: 'stock-make-querypanel',
+    viewModel: 'stock-make-querypanel',
+
+    viewName: 'stock-make-querypanel',
+    
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'pu_id',
+        bind: '{pu_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        getCondition: function(value) {
+            return 'pu_id=' + value;
+        }
+    }, {
+        xtype: 'textfield',
+        name: 'pu_code',
+        bind: '{pu_code}',
+        fieldLabel: '单据编号'
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_date',
+        bind: '{pu_date}',
+        fieldLabel: '采购日期',
+        columnWidth: 0.5,
+        operation: 'between'
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pu_vendcode',
+        bind: '{pu_vendcode}',
+        fieldLabel: '供应商编号'
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pu_vendname',
+        bind: '{pu_vendname}',
+        fieldLabel: '供应商名称'
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        showDetail: true
+    }, {
+        xtype: 'textfield',
+        name: 'pr_detail',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        showDetail: true
+    }, {
+        xtype: 'combobox',
+        name: 'pu_statuscode',
+        fieldLabel: '审核状态',
+        queryMode: 'local',
+        displayField: 'pu_status',
+        valueField: 'pu_statuscode',
+        editable:false,
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['pu_statuscode', 'pu_status'],
+            data: [
+                ["ALL", "全部"],
+                ["AUDITED", "已审核"],
+                ["UNAUDITED", "未审核"]
+            ]
+        }),
+        getCondition: function(value) {
+            if(value == 'ALL') {
+                return '1=1';
+            }else {
+                return 'pu_statuscode=\'' + value + '\'';
+            }
+        }
+    }, {
+        xtype: 'multicombo',
+        name: 'pu_acceptstatuscode',
+        bind: '{pu_acceptstatuscode}',
+        fieldLabel: '入库状态',
+        datas: [
+            ["TURNIN", "已入库"],
+            ["UNTURNIN", "未入库"],
+            ["PARTIN", "部分入库"]
+        ]
+    }],
+    moreQueryFormItems: [{
+        xtype: 'textfield',
+        name: 'pu_buyername',
+        fieldLabel: '采购员'
+    }, {
+        xtype: 'textfield',
+        name: 'pu_total',
+        fieldLabel: '金额'
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_delivery',
+        fieldLabel: '交货日期',
+        columnWidth: 1
+    }],
+    queryGridConfig: {
+        idField: 'pu_id',
+        codeField: 'pu_code',
+        addTitle: '采购单',
+        addXtype: 'purchase-purchase-formpanel',
+        defaultCondition:'',
+        baseVastUrl: basePath+'purchase/purchase/',
+        baseColumn: [{
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pu_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pu_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pu_indate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '供应商名称',
+            dataIndex: 'pu_vendname',
+            width: 120
+        }, {
+            text: '含税金额',
+            dataIndex: 'pu_taxtotal',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '金额',
+            dataIndex: 'pu_total',
+            xtype: 'numbercolumn',
+            width: 120,
+            flex: 1
+        }],
+        relativeColumn: [{
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pu_code',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pu_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pu_indate',
+            xtype: 'datecolumn',
+            width: 200
+        }, {
+            text: '供应商名称',
+            dataIndex: 'pu_vendname',
+            width: 120
+        }, {
+            text: '采购序号',
+            dataIndex: 'pd_detno',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '物料编号',
+            dataIndex: 'pd_prodcode',
+            width: 120
+        }, {
+            text: '数量',
+            dataIndex: 'pd_qty',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '单价',
+            dataIndex: 'pd_price',
+            xtype: 'numbercolumn',
+            width: 120
+        }, {
+            text: '已转数',
+            dataIndex: 'pd_ytqy',
+            xtype: 'numbercolumn',
+            width: 120,
+            flex: 1
+        }]
+    }
+});

+ 117 - 0
frontend/saas-web/app/view/stock/make/QueryPanelController.js

@@ -0,0 +1,117 @@
+Ext.define('saas.view.stock.make.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.stock-make-querypanel',
+    
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:basePath+'document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:basePath+'document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

+ 5 - 0
frontend/saas-web/app/view/stock/make/QueryPanelModel.js

@@ -0,0 +1,5 @@
+Ext.define('saas.view.stock.make.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.stock-make-querypanel'
+
+});