Browse Source

Merge branch 'dev' into release-20170915

# Conflicts:
#	src/main/webapp/resources/view/vendor/left_nav.html
yangc 8 years ago
parent
commit
f983fa911d
29 changed files with 3214 additions and 539 deletions
  1. 73 0
      src/main/java/com/uas/platform/b2c/fa/settlement/controller/BillSubmitController.java
  2. 14 0
      src/main/java/com/uas/platform/b2c/fa/settlement/dao/BillSubmitDao.java
  3. 276 0
      src/main/java/com/uas/platform/b2c/fa/settlement/model/BillSubmit.java
  4. 40 0
      src/main/java/com/uas/platform/b2c/fa/settlement/service/BillSubmitService.java
  5. 234 0
      src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java
  6. 2 1
      src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java
  7. 8 0
      src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDao.java
  8. 10 12
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  9. 136 9
      src/main/webapp/resources/css/common.css
  10. 1 1
      src/main/webapp/resources/css/user/user.css
  11. BIN
      src/main/webapp/resources/img/user/images/ticket01.jpg
  12. BIN
      src/main/webapp/resources/img/user/images/ticket02.jpg
  13. 20 1
      src/main/webapp/resources/js/common/query/bill.js
  14. 12 0
      src/main/webapp/resources/js/usercenter/app.js
  15. 322 243
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_ctrl.js
  16. 78 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_record_ctrl.js
  17. 216 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_no_invoice_ctrl.js
  18. 6 0
      src/main/webapp/resources/js/vendor/app.js
  19. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/pay_center_ctrl.js
  20. 173 0
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_invoice_ctrl.js
  21. 1 1
      src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html
  22. 526 264
      src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html
  23. 203 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_invoice_record.html
  24. 229 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html
  25. 1 1
      src/main/webapp/resources/view/usercenter/left_nav.html
  26. 213 0
      src/main/webapp/resources/view/usercenter/modal/apply-invoice.html
  27. 1 1
      src/main/webapp/resources/view/vendor/forstore/pay_center.html
  28. 413 0
      src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html
  29. 5 4
      src/main/webapp/resources/view/vendor/left_nav.html

+ 73 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/controller/BillSubmitController.java

@@ -0,0 +1,73 @@
+package com.uas.platform.b2c.fa.settlement.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
+import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 开票申请
+ * @author wangyc
+ * @version 2017/8/24 16:34 wangyc
+ */
+@RestController
+@RequestMapping(value = "/trade/billSubmit")
+public class BillSubmitController {
+
+    private final BillSubmitService billSubmitService;
+
+    private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
+    @Autowired
+    public BillSubmitController (BillSubmitService billSubmitService) {
+        this.billSubmitService = billSubmitService;
+    }
+
+    /**
+     * 新增开票申请
+     * @param jsonObject 开票信息
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.POST, produces = "application/json")
+    public List<BillSubmit> save(@RequestBody JSONObject jsonObject) {
+        String orderids = jsonObject.get("orderids").toString();
+        Long invoiceid = Long.valueOf(jsonObject.get("invoiceid").toString());
+        String[] orderidList = orderids.split(SplitChar.COMMA);
+        logger.log("发票申请", "保存发票申请信息");
+        return billSubmitService.save(orderidList, invoiceid);
+    }
+
+    /**
+     * 分页获取发票申请
+     * @param params 分页参数
+     * @param keyword 关键词
+     * @param role 角色
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.GET)
+    public Page<BillSubmit> getBillSubmits(PageParams params, String keyword, String invoicetype , String status, String role) {
+        PageInfo pageInfo = new PageInfo(params);
+        logger.log("发票申请", "查找包含关键字的发票申请信息");
+        return billSubmitService.getAll(pageInfo, keyword, invoicetype, status, role);
+    }
+
+    /**
+     * 审核发票申请
+     * @param ids 发票申请记录
+     * @return
+     */
+    @RequestMapping(value = "/{ids}", method = RequestMethod.PUT)
+    public List<BillSubmit> auditBillSubmit(@PathVariable("ids") String ids) {
+        logger.log("发票申请", "审核发票申请");
+        return billSubmitService.auditBillSubmit(ids);
+    };
+}

+ 14 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/dao/BillSubmitDao.java

@@ -0,0 +1,14 @@
+package com.uas.platform.b2c.fa.settlement.dao;
+
+import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author wangyc
+ * @version 2017/8/30 20:33 wangyc
+ */
+@Repository
+public interface BillSubmitDao extends JpaSpecificationExecutor<BillSubmit>, JpaRepository<BillSubmit, Long> {
+}

+ 276 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/model/BillSubmit.java

@@ -0,0 +1,276 @@
+package com.uas.platform.b2c.fa.settlement.model;
+
+import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.common.account.model.UserBaseInfo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wangyc on 2017/8/24.
+ *
+ * @version 2017/8/24 14:53 wangyc
+ */
+@Entity
+@Table(name = "trade$bill_submit")
+public class BillSubmit implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "trade$bill_submit_gen")
+    @SequenceGenerator(name = "trade$bill_submit_gen", sequenceName = "trade$bill_submit_seq", allocationSize = 1)
+    @Column(name = "bs_id")
+    private Long id;
+
+    /**
+     * 申请时间
+     */
+    @Column(name = "bs_createtime")
+    private Date createTime;
+
+    /**
+     * 处理时间
+     */
+    @Column(name = "bs_handleTime")
+    private Date handleTime;
+
+    /**
+     * 申请人uu
+     */
+    @Column(name = "bs_submituu")
+    private Long submituu;
+
+    /**
+     * 申请人
+     */
+    @OneToOne(cascade = { CascadeType.REFRESH })
+    @JoinColumn(name = "bs_submituu", insertable = false, updatable = false)
+    private UserBaseInfo submiter;
+
+    /**
+     * 申请人企业uu
+     */
+    @Column(name = "bs_submitenuu")
+    private Long submitEnuu;
+
+    /**
+     * 申请人企业
+     */
+    @OneToOne(cascade = { CascadeType.REFRESH })
+    @JoinColumn(name = "bs_submitenuu", insertable = false, updatable = false)
+    private Enterprise submitEnterprise;
+
+    /**
+     * 卖方企业uu
+     */
+    @Column(name = "bs_sellerenuu")
+    private Long sellerenuu;
+
+    /**
+     * 卖方企业名称
+     */
+    @Column(name = "bs_sellername")
+    private String sellername;
+
+    /**
+     * 订单号,以“,”拼接
+     */
+    @Lob
+    @Column(name = "bs_orderids")
+    @Basic(fetch = FetchType.LAZY)
+    private String orderids;
+
+    /**
+     * 开票金额
+     */
+    @Column(name = "bs_price")
+    private Double price;
+
+    /**
+     * 开票类型
+     */
+    @Column(name = "bs_invoicetype")
+    private Integer invoicetype;
+
+    /**
+     * 发票主键
+     */
+    @Column(name = "bs_invoiceid")
+    private Long invoiceid;
+
+    /**
+     * 发票抬头
+     */
+    @Column(name = "bs_invoicetitle")
+    private String invoicetitle;
+
+    /**
+     * 发票的地址
+     */
+    @Column(name = "bs_invoice_address", length = 2000)
+    private String invoiceAddress;
+
+    /**
+     * 收票人
+     */
+    @Column(name = "bs_receivername")
+    private String receiverName;
+
+    /**
+     * 收票人联系电话
+     */
+    @Column(name = "bs_rectel")
+    private String recTel;
+
+    /**
+     * 申请状态
+     */
+    @Column(name = "bs_status")
+    private Integer status;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getHandleTime() {
+        return handleTime;
+    }
+
+    public void setHandleTime(Date handleTime) {
+        this.handleTime = handleTime;
+    }
+
+    public Long getSubmituu() {
+        return submituu;
+    }
+
+    public void setSubmituu(Long submituu) {
+        this.submituu = submituu;
+    }
+
+    public UserBaseInfo getSubmiter() {
+        return submiter;
+    }
+
+    public void setSubmiter(UserBaseInfo submiter) {
+        this.submiter = submiter;
+    }
+
+    public Long getSubmitEnuu() {
+        return submitEnuu;
+    }
+
+    public void setSubmitEnuu(Long submitEnuu) {
+        this.submitEnuu = submitEnuu;
+    }
+
+    public Enterprise getSubmitEnterprise() {
+        return submitEnterprise;
+    }
+
+    public void setSubmitEnterprise(Enterprise submitEnterprise) {
+        this.submitEnterprise = submitEnterprise;
+    }
+
+    public Long getSellerenuu() {
+        return sellerenuu;
+    }
+
+    public void setSellerenuu(Long sellerenuu) {
+        this.sellerenuu = sellerenuu;
+    }
+
+    public String getSellername() {
+        return sellername;
+    }
+
+    public void setSellername(String sellername) {
+        this.sellername = sellername;
+    }
+
+    public String getOrderids() {
+        return orderids;
+    }
+
+    public void setOrderids(String orderids) {
+        this.orderids = orderids;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Integer getInvoicetype() {
+        return invoicetype;
+    }
+
+    public void setInvoicetype(Integer invoicetype) {
+        this.invoicetype = invoicetype;
+    }
+
+    public Long getInvoiceid() {
+        return invoiceid;
+    }
+
+    public void setInvoiceid(Long invoiceid) {
+        this.invoiceid = invoiceid;
+    }
+
+    public String getInvoicetitle() {
+        return invoicetitle;
+    }
+
+    public void setInvoicetitle(String invoicetitle) {
+        this.invoicetitle = invoicetitle;
+    }
+
+    public String getInvoiceAddress() {
+        return invoiceAddress;
+    }
+
+    public void setInvoiceAddress(String invoiceAddress) {
+        this.invoiceAddress = invoiceAddress;
+    }
+
+    public String getReceiverName() {
+        return receiverName;
+    }
+
+    public void setReceiverName(String receiverName) {
+        this.receiverName = receiverName;
+    }
+
+    public String getRecTel() {
+        return recTel;
+    }
+
+    public void setRecTel(String recTel) {
+        this.recTel = recTel;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+}

+ 40 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/service/BillSubmitService.java

@@ -0,0 +1,40 @@
+package com.uas.platform.b2c.fa.settlement.service;
+
+import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
+import com.uas.platform.core.model.PageInfo;
+import org.springframework.data.domain.Page;
+
+import java.util.List;
+
+/**
+ * 开票申请
+ * @author wangyc
+ * @version 2017/8/24 16:42 wangyc
+ */
+public interface BillSubmitService {
+
+    /**
+     * 新增开票申请
+     * @param orderids 订单号集
+     * @param invoiceid 发票id
+     * @return
+     */
+    List<BillSubmit> save(String[] orderids, Long invoiceid);
+
+    /**
+     * @param pageInfo 分页参数
+     * @param keyword 关键词
+     * @param status 开票状态
+     * @param invoicetype 发票类型
+     * @param role 角色
+     * @return
+     */
+    Page<BillSubmit> getAll(PageInfo pageInfo, String keyword, String invoicetype , String status, String role);
+
+    /**
+     * 审核发票申请
+     * @param ids 发票申请记录
+     * @return
+     */
+    List<BillSubmit> auditBillSubmit(String ids);
+}

+ 234 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java

@@ -0,0 +1,234 @@
+package com.uas.platform.b2c.fa.settlement.service.impl;
+
+import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.fa.settlement.dao.BillDao;
+import com.uas.platform.b2c.fa.settlement.dao.BillSubmitDao;
+import com.uas.platform.b2c.fa.settlement.model.Bill;
+import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
+import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
+import com.uas.platform.b2c.trade.order.dao.OrderDao;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.Status;
+import com.uas.platform.core.model.Type;
+import com.uas.platform.core.persistence.criteria.CriterionExpression;
+import com.uas.platform.core.persistence.criteria.LogicalExpression;
+import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import com.uas.platform.core.persistence.criteria.SimpleExpression;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.*;
+
+/**
+ * 开票申请
+ * @author wangyc
+ * @version 2017/8/24 17:10 wangyc
+ */
+@Service
+public class BillSubmitServiceImpl implements BillSubmitService {
+
+    private final OrderDao orderDao;
+
+    private final BillDao billDao;
+
+    private final BillSubmitDao billSubmitDao;
+
+    @Autowired
+    public BillSubmitServiceImpl (OrderDao orderDao, BillDao billDao, BillSubmitDao billSubmitDao) {
+        this.orderDao = orderDao;
+        this.billDao = billDao;
+        this.billSubmitDao = billSubmitDao;
+    }
+
+    @Override
+    public List<BillSubmit> save(String[] orderids, Long billid) {
+        // 获取验证发票信息
+        Bill bill = billDao.findOne(billid);
+        if (bill == null)
+            throw new IllegalOperatorException("发票信息不存在");
+
+        Long buyeruu = SystemSession.getUser().getUserUU();
+        Long buyerEnuu = null;
+        if (SystemSession.getUser().getEnterprise() != null)
+            buyerEnuu = SystemSession.getUser().getEnterprise().getUu();
+
+        if ((!bill.getUseruu().equals(buyeruu)) || (buyerEnuu != null && !bill.getEnuu().equals(buyerEnuu)))
+            throw new IllegalOperatorException("发票信息不属于您,请重新确认发票信息");
+
+        // 获取验证订单信息
+        List<String> orderidList = Arrays.asList(orderids);
+        List<Order> orders = orderDao.findByOrderIds(orderidList);
+
+        if (CollectionUtils.isEmpty(orders))
+            throw new IllegalOperatorException("订单号错误,请重新确认订单信息");
+
+        // 验证订单号是否正确
+        if (orders.size() != orderidList.size()) {
+            List<String> orderIds = new ArrayList<String>();
+            for (Order order : orders) {
+                orderIds.add(order.getOrderid());
+            }
+            orderidList.removeAll(orderIds);
+
+            String errorIdStr = com.alibaba.dubbo.common.utils.StringUtils.join(orderids, SplitChar.COMMA);
+            throw new IllegalOperatorException("订单号: " + errorIdStr + " 不存在,请重新确认订单信息");
+        }
+
+        Map<Long, List<Order>> map = new HashMap<Long, List<Order>>();
+
+        // 将订单按卖家分组
+        for (Order order : orders) {
+            if (map.get(order.getSellerenuu()) == null) {
+                List<Order> afterGroup = new ArrayList<Order>();
+                afterGroup.add(order);
+                map.put(order.getSellerenuu(), afterGroup);
+            } else {
+                map.get(order.getSellerenuu()).add(order);
+            }
+
+        }
+        List<BillSubmit> billSubmits = new ArrayList<BillSubmit>();
+        for (Long sellerenuu : map.keySet()) {
+            BillSubmit billSubmit = createBillSubmit(bill, map.get(sellerenuu), buyerEnuu);
+            billSubmits.add(billSubmit);
+        }
+
+        return billSubmitDao.save(billSubmits);
+    }
+
+    // 初始化发票申请
+    public BillSubmit createBillSubmit(Bill bill, List<Order> orders, Long buyerEnuu) {
+        Long buyeruu = SystemSession.getUser().getUserUU();
+        // 发票基本信息
+        BillSubmit billSubmit = new BillSubmit();
+        billSubmit.setInvoicetitle(bill.getHead());
+        billSubmit.setInvoiceid(bill.getId());
+        billSubmit.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+        billSubmit.setInvoicetype(bill.getKind());
+        billSubmit.setCreateTime(new Date());
+        billSubmit.setReceiverName(bill.getName());
+        billSubmit.setRecTel(bill.getTelephone());
+        billSubmit.setStatus(Status.SUBMITTED.value());
+        billSubmit.setSubmituu(SystemSession.getUser().getUserUU());
+        if (SystemSession.getUser().getEnterprise() != null)
+            billSubmit.setSubmitEnuu(SystemSession.getUser().getEnterprise().getUu());
+
+        String orderIds = "";
+        Double price = 0d;
+        for (int i = 0; i < orders.size(); i++) {
+            if (buyerEnuu != null) {
+                Order order = orders.get(i);
+                if (buyerEnuu.equals(order.getBuyerenuu()) && buyeruu.equals(order.getBuyeruu())) {
+                    billSubmit.setSellername(order.getSellername());
+                    billSubmit.setSellerenuu(order.getSellerenuu());
+                    order.setInvoicetype(bill.getKind());
+                    order.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+                    order.setInvoiceid(bill.getId());
+                    order.setInvoicetitle(bill.getHead());
+                    order.setVatBillStatus(Status.TOBEMAKE_BILL.value());
+                    orderDao.save(order);
+                    price += order.getPrice();
+                    orderIds += order.getOrderid();
+                    if (i < orders.size() - 1)
+                        orderIds += SplitChar.COMMA;
+                } else {
+                    throw new IllegalOperatorException("订单号: " + order.getOrderid() + " ,不属于您的订单,请重新确认订单号");
+                }
+            } else {
+
+            }
+        }
+
+        billSubmit.setPrice(price);
+        billSubmit.setOrderids(orderIds);
+
+        return billSubmit;
+    }
+
+    @Override
+    public Page<BillSubmit> getAll(final PageInfo pageInfo, String keyword, String invoicetype , String status, String role) {
+        if (Type.BUYER.name().equals(role)) {
+            pageInfo.expression(PredicateUtils.eq("submituu", SystemSession.getUser().getUserUU(), false));
+            if (SystemSession.getUser().getEnterprise() != null)
+                pageInfo.expression(PredicateUtils.eq("submitEnuu", SystemSession.getUser().getEnterprise().getUu(), false));
+        }
+
+        if (Type.SELLER.name().equals(role)) {
+            if (SystemSession.getUser().getEnterprise() != null) {
+                pageInfo.expression(PredicateUtils.eq("sellerenuu", SystemSession.getUser().getEnterprise().getUu(), false));
+            } else {
+                throw new IllegalOperatorException("请选择企业账套后查看开票申请");
+            }
+        }
+
+        if (StringUtils.hasText(invoicetype))
+            pageInfo.expression(PredicateUtils.eq("invoicetype", Integer.parseInt(invoicetype), false));
+
+        if (StringUtils.hasText(status))
+            pageInfo.expression(PredicateUtils.eq("status", Integer.parseInt(status), false));
+
+        if (StringUtils.hasText(keyword)) {
+            SimpleExpression sellername = new SimpleExpression("sellername", keyword, CriterionExpression.Operator.LIKE);
+            SimpleExpression orderids = new SimpleExpression("orderids", keyword, CriterionExpression.Operator.LIKE);
+            SimpleExpression invoicetitle = new SimpleExpression("invoicetitle", keyword, CriterionExpression.Operator.LIKE);
+            SimpleExpression receiverName = new SimpleExpression("receiverName", keyword, CriterionExpression.Operator.LIKE);
+            SimpleExpression recTel = new SimpleExpression("recTel", keyword, CriterionExpression.Operator.LIKE);
+            SimpleExpression[] simpleExpressions = new SimpleExpression[]{sellername, orderids, invoicetitle, receiverName, recTel};
+            LogicalExpression logicalExpression = PredicateUtils.or(simpleExpressions);
+            pageInfo.expression(logicalExpression);
+        }
+
+        return billSubmitDao.findAll(new Specification<BillSubmit>() {
+            @Override
+            public Predicate toPredicate(Root<BillSubmit> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+                query.where(pageInfo.getPredicates(root, query, cb));
+                return null;
+            }
+        }, pageInfo);
+    }
+
+    @Override
+    public List<BillSubmit> auditBillSubmit(String ids) {
+        String[] idList = ids.split(SplitChar.COMMA);
+        List<BillSubmit> billSubmits = new ArrayList<BillSubmit>();
+        for (String id : idList) {
+            BillSubmit billSubmit = billSubmitDao.findOne(Long.parseLong(id));
+
+            if (billSubmit == null)
+                throw new IllegalOperatorException("此发票申请不存在");
+            if (!SystemSession.getUser().getEnterprise().getUu().equals(billSubmit.getSellerenuu()))
+                throw new IllegalOperatorException("此发票申请不属于当前企业");
+            if (Status.SUBMITTED.value() != billSubmit.getStatus())
+                throw new IllegalOperatorException("此发票申请不为待开票状态,不可开票");
+
+            billSubmit.setStatus(Status.AUDITED.value());
+            billSubmit.setHandleTime(new Date());
+
+            String[] orderids = billSubmit.getOrderids().split(SplitChar.COMMA);
+            for (String orderid : orderids) {
+                Order order = orderDao.findOrderByOrderid(orderid);
+                if (order == null)
+                    throw new IllegalOperatorException("订单: " + orderid + " 不存在,请与客服人员确认该订单");
+                if (!SystemSession.getUser().getEnterprise().getUu().equals(order.getSellerenuu()))
+                    throw new IllegalOperatorException("订单: " + orderid + " 不属于当前企业,不可开票");
+
+                order.setVatBillStatus(Status.TOBERECEIVE_BILL.value());
+                orderDao.save(order);
+            }
+            billSubmits.add(billSubmit);
+        }
+        billSubmitDao.save(billSubmits);
+        return billSubmits;
+    }
+}

+ 2 - 1
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -670,7 +670,8 @@ public class OrderController {
 	public Page<Order> getBillByStatusByPersonal(PageParams params, String keyword, int status) {
 		PageInfo pageInfo = new PageInfo(params);
 		pageInfo.filter("buyeruu", SystemSession.getUser().getUserUU());
-		pageInfo.filter("buyerenuu", SystemSession.getUser().getEnterprise().getUu());
+		if (SystemSession.getUser().getEnterprise() != null)
+			pageInfo.filter("buyerenuu", SystemSession.getUser().getEnterprise().getUu());
 		assert logger != null;
 		logger.log("买家订单管理", "买家获取买家订单信息", "获取待开发票的订单");
 		return orderService.getBillByStatus(pageInfo, keyword, status);

+ 8 - 0
src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDao.java

@@ -60,6 +60,14 @@ public interface OrderDao extends JpaSpecificationExecutor<Order>, JpaRepository
 	 */
 	Order findOrderByOrderid(String orderid);
 
+	/**
+	 * 根据订单号集获取订单信息
+	 * @param orderids 订单号集
+	 * @return
+	 */
+	@Query("select o from trade.Order o where o.orderid in (:orderids)")
+	List<Order> findByOrderIds(@Param("orderids") List<String> orderids);
+
 	/**
 	 * Gets count by buyeruu and status.
 	 *

+ 10 - 12
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -2316,18 +2316,16 @@ public class OrderServiceImpl implements OrderService {
 
     @Override
     public Page<Order> getBillByStatus(final PageInfo page, String keyword, int status) {
-        SimpleExpression simpleExpression1 = new SimpleExpression("status", Status.CANCELLED.value(), Operator.NE);
-        SimpleExpression simpleExpression2 = new SimpleExpression("status", Status.UNAVAILABLE_NOPAID.value(),
-                Operator.NE);
-        page.expression(simpleExpression1);
-        page.expression(simpleExpression2);
-        if (status != 799) {
-            page.filter("vatBillStatus", status);
-        } else { // 如果等于799,代表是要找处于待收发票状态的明细的订单
-            page.filter("tobeReceiveinvoice", Status.TOCONFIRM_BILL.value());
-        }
-        if ((keyword != null) && (!keyword.equals(""))) {
-            page.filter("orderid", keyword);
+        page.expression(PredicateUtils.eq("status", status, false));
+        page.expression(PredicateUtils.isNull("invoiceid"));
+        page.expression(PredicateUtils.eq("invoicetype", Type.Bill_No.value(), false));
+
+        if (StringUtils.hasText(keyword)) {
+            SimpleExpression sellername = new SimpleExpression("sellername", keyword , Operator.LIKE);
+            SimpleExpression orderid = new SimpleExpression("orderid", keyword, Operator.LIKE);
+            SimpleExpression[] simpleExpressions = new SimpleExpression[]{sellername, orderid};
+            LogicalExpression logicalExpression = PredicateUtils.or(simpleExpressions);
+            page.expression(logicalExpression);
         }
 
         return orderDao.findAll(new Specification<Order>() {

+ 136 - 9
src/main/webapp/resources/css/common.css

@@ -451,7 +451,7 @@ input.ng-invalid.ng-dirty,textarea.ng-invalid.ng-dirty {
 .u-panel {
 	border: 1px solid #1BA5F8;
 	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
-          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
 }
 .u-panel-heading {
 	height: 57px;
@@ -479,7 +479,6 @@ input.ng-invalid.ng-dirty,textarea.ng-invalid.ng-dirty {
 /* 提示框 */
 .callout {
 	position: absolute;
-	
 	border: 1px solid #dddddd;
 	background-color: white;
 	box-shadow: 5px 5px 5px #E2E3E4;
@@ -635,7 +634,7 @@ table th.before-blank:before, table th.before-blank:after {
 .search-check .search button{
 	background: #d3e1fc;
 	border-radius: 0;
-	border: #e2dbdb 1px solid;
+	border: none !important;
 	border-left: none;
 }
 .search-check .search a{
@@ -672,7 +671,7 @@ table th.before-blank:before, table th.before-blank:after {
 .check-input input{
 	display: none;
 }
-.check-input label {
+.check-input label label {
 	width: 15px;
 	height: 15px;
 	display: inline-block;
@@ -710,14 +709,15 @@ div.ng-table-pager a.page-a{
 .down-goods-btn{
 	display: inline-block;
 	width: 94px;
-	height: 34px;
-	line-height: 34px;
+	height: 30px;
+	line-height: 30px;
 	text-align: center;
 	font-size: 14px;
 	background: #5078cb;
 	color: #fff;
 	float: right;
 	margin-right: 15px;
+	margin-top: 2px;
 }
 .down-goods-btn:hover{
 	background: #3f7ae3;
@@ -730,18 +730,37 @@ div.ng-table-pager a.page-a{
 .ng-table-pager .ng-table-pagination li.active a{
 	background: #5078cb !important;
 }
+.ng-table-pager .ng-table-pagination li.active a:hover{
+	color: #fff !important;
+}
 div.ng-table-pager div.page-go-block{
 	margin-top: 0 !important;
 }
-div.ng-table-pager a.page-a{
+.ng-table-pagination .page-number{
+	height: 30px !important;
+	border-bottom-right-radius: 0;
+	border-top-right-radius: 0;
+}
+body div.ng-table-pager input.page-number{
+	width: 40px;
+	height: 30px;
+	padding: 0 !important;
+	line-height: 30px;
+}
+body div.ng-table-pager a.page-a{
 	color: #fff;
 	border-color: #4574E8;
-	padding: 6px 6px;
+	/*padding: 6px 6px !important;*/
 	font-size: 14px;
 	border-top-right-radius: 4px;
 	border-bottom-right-radius: 4px;
 	text-decoration: none;
-	height: 31px;
+	height: 30px !important;
+	display: inline-block;
+	width: 35px;
+	padding: 0;
+	text-align: center;
+	line-height: 30px;
 }
 .ng-table-pagination .page-a:hover{
 	background: none !important;
@@ -805,4 +824,112 @@ input:required:invalid, input:focus:invalid, textarea:required:invalid, textarea
 }
 :-ms-input-placeholder { /* Internet Explorer 10-11 */
 	color:    #999;
+}
+/*显示多少条下拉*/
+.show-input{
+	margin-right: 40px;
+	width: 116px;
+	display: inline-block;
+}
+.show-input .form-control{
+	width: 45px;
+	height: 22px;
+	line-height: 22px;
+	border-radius: 1px;
+	padding: 0 2px;
+	float: right;
+	margin-left: 5px;
+	font-size: 12px;
+}
+.search-check .more-hover {
+	color: #fff !important;
+}
+.search-check .check{
+	position: relative;
+}
+.search-check .check ul{
+	width: 94px;
+	position: absolute;
+	left: 0;
+	top: 30px;
+	background: #fff;
+	border: #e8e8e8 1px solid;
+	padding: 5px 0;
+	display: none;
+	z-index: 200;
+}
+.search-check .check:hover ul{
+	display: inline-block;
+}
+.search-check .check ul li{
+	width: 100%;
+	line-height: 22px;
+	float: left;
+}
+.search-check .check ul li a{
+	display: inline-block;
+	width: 100%;
+	height: 22px;
+	text-align: center;
+	font-size: 14px;
+	line-height: 22px;
+}
+.red{
+	color: #f00 !important;
+}
+.blue{
+	color: #5078cb !important;
+}
+
+/*全选操作*/
+.operation-btn{
+	margin-right: 15px;
+	margin-top: 4px;
+}
+.operation-btn a{
+	width: 55px;
+	height: 26px;
+	line-height: 26px;
+	display: inline-block;
+	text-align: center;
+	font-size: 14px;
+}
+.operation-btn a.off{
+	background: #b4b5b9;
+	color: #333;
+	margin-right: 10px;
+}
+.operation-btn a.ok{
+	background: #5078cb;
+	color: #fff;
+}
+
+/*改为按钮*/
+.edit-icon button {
+	width: 50px;
+	height: 24px;
+	border: none;
+	color: #fff;
+	float: left;
+}
+.edit-icon button:nth-of-type(2){
+	margin-top: 3px;
+}
+.edit-icon button.ok {
+	background: #33b401;
+}
+.edit-icon button.off {
+	background: #f15601;
+}
+.edit-icon button.edit {
+	background: #5078cb;
+}
+.edit-icon button.up {
+	background: #fff;
+	border: #5078cb 1px solid;
+	color: #5078cb;
+}
+.edit-icon button.up:hover{
+	background: #5078cb;
+	color: #fff;
 }

+ 1 - 1
src/main/webapp/resources/css/user/user.css

@@ -1077,7 +1077,7 @@ body {
     float: left;
     vertical-align: middle;
     margin-top: 35px;
-    border: #e8e8e8 1px solid;
+    border: #e8e8e8 1px solid !important;
 }
 
 .oder_list dl .pro_xq p {

BIN
src/main/webapp/resources/img/user/images/ticket01.jpg


BIN
src/main/webapp/resources/img/user/images/ticket02.jpg


+ 20 - 1
src/main/webapp/resources/js/common/query/bill.js

@@ -33,12 +33,31 @@ define([ 'ngResource' ], function() {
 				method : 'DELETE'
 			},
 			getPersonalSpecial : {
-				url : 'trade/bill//personal',
+				url : 'trade/bill/personal',
 				method : 'GET',
 				params : {
 					'type' : 'special'
 				}
 			}
 		});
+	}]).factory('BillSubmit', ['$resource', function($resource) {
+			//获取ComponentSubmit的分页数据
+		return $resource('trade/billSubmit', {}, {
+			submitBillApply : {
+				url : ' trade/billSubmit',
+				method : 'POST',
+				isArray: true
+			},
+			getSubmitBillApply : {
+				url : ' trade/billSubmit',
+				method : 'GET'
+			},
+			sureBillApply : {
+				url : 'trade/billSubmit/:ids',
+				method : 'PUT',
+				isArray : 'true'
+			}
+
+		});
 	}]);
 });

+ 12 - 0
src/main/webapp/resources/js/usercenter/app.js

@@ -65,6 +65,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 			templateUrl: 'static/view/usercenter/forstore/buyer_invoice.html',
 			controller: 'invoiceCtrl',
 			controllerUrl: 'app/controllers/forstore/buyer_invoice_ctrl'
+		})).state('buyer_no_invoice', angularAMD.route({
+			url: '/noInvoice',
+			title: '未开票',
+			templateUrl: 'static/view/usercenter/forstore/buyer_no_invoice.html',
+			controller: 'NoInvoiceCtrl',
+			controllerUrl: 'app/controllers/forstore/buyer_no_invoice_ctrl'
+		})).state('buyer_invoice-record', angularAMD.route({
+			url: '/invoiceRecord',
+			title: '开票记录',
+			templateUrl: 'static/view/usercenter/forstore/buyer_invoice_record.html',
+			controller: 'buyerInvoiceRecordCtrl',
+			controllerUrl: 'app/controllers/forstore/buyer_invoice_record_ctrl'
 		})).state('pay_center', angularAMD.route({
 			url: '/payCenter',
 			templateUrl: 'static/view/usercenter/forstore/pay_center.html',

+ 322 - 243
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_ctrl.js

@@ -6,19 +6,27 @@ define(['app/app'], function(app) {
     'use strict';
     app.register.controller('invoiceCtrl', ['$scope', '$rootScope', 'toaster', '$modal', '$q', 'Bill', '$upload', '$http', '$location', '$stateParams', '$state', function($scope, $rootScope, toaster, $modal, $q, Bill, $upload, $http, $location, $stateParams, $state) {
         $rootScope.active = 'buyer_invoice';
-
+        $scope.tab = 'buyer_invoice';
         $scope.invoiceType = 1205;
-
+        $scope.isSpecial = true; //专票,等于true为不存在
+        $scope.isNormal = true; //普票,等于true为不存在
         // 获取发票信息方法	1205为增值税专用发票	1206为增值税普通发票	1207为不开发票
         var getInvoiceInfo = function() {
             Bill.getListPersonal(null, function(data) {
                 $scope.invoices = data;
+                angular.forEach($scope.invoices, function (item) {
+                    if(item.kind == '1205'){
+                        $scope.isSpecial = false;
+                    } else if (item.kind == '1206') {
+                        $scope.isNormal = false;
+                    }
+                })
             }, function(error) {
                 toaster.pop('error', '获取发票信息失败');
             });
         };
         getInvoiceInfo();
-
+        // $scope.bill = {};
         // 获取省市区地理信息
         var getGeoInfo = function () {
             $http.get('static/js/prod/data/city.json').success(function(data) {
@@ -36,276 +44,347 @@ define(['app/app'], function(app) {
             });
         };
         getGeoInfo();
-        
-        // 新建发票类型	1205专用增值税发票   --1206普通发票  --1207不开发票
-        /*$scope.addInvoice = function () {
-            $modal.open({
-                templateUrl : 'static/view/prod/modal/edit-invoice-modal.html',
-                controller : 'BillInputCtrl',
-                size : 'lg',
-                resolve : {
-                    invoiceInfo: function() {
-                        if($scope.invoiceType == 1205) {
-                            return 1205 + "";
-                        }
-                        if($scope.invoiceType == 1206) {
-                            return 1206 + "";
-                        }
-                    }
-                }
-            }).result.then(function(invoice){
-                if(invoice) {
-                    getInvoiceInfo();
-                }
-            }, function(reason){
-                toaster.pop('info', '提示 ' + '您已取消新建发票信息');
-            });
-        };*/
 
         $scope.bill = {};
-        $scope.bill.kind = sessionStorage.getItem('invoiceType') ? sessionStorage.getItem('invoiceType') : 1205;
         $scope.bill.address = {};
-        $scope.bill.is_agree = true;
-        $scope.linkError = false;
-        $scope.addressError = false;
-        $scope.saveInvoice = function() {
-            $scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
-            var file = null;
-            if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
-                file = $scope.bill.billInfo[0];
-            }
-            $upload.upload({
-                url: 'trade/bill/save',
-                file: file,
-                method: 'POST',
-                data: {
-                    bill: $scope.bill
-                }
-            }).success(function(data){
-                toaster.pop('success', '保存成功');
-                sessionStorage.setItem('invoiceType', $scope.bill.kind);
-                $state.reload();
-            }).error(function(data){
-                toaster.pop('error', data);
-            });
-        };
 
-
-        $scope.deleteInvoice = function(invoice) {
-            var isToDelete = confirm("确定要删除吗?");
-            if(!isToDelete) {
-                return;
+            //保存发票信息
+            $scope.saveBill = function(flag) {
+                var dataValidFlag = $scope.checkValidFrom();
+                if (!flag && dataValidFlag && $scope.bill.is_agree) {
+                    $scope.bill.kind = $scope.billType
+                    if (!$scope.isAdd) { //修改
+                        doSave('修改发票信息');
+                    } else { // 新增
+                        doSave('添加发票');
+                    }
+                } else if (flag || !dataValidFlag) {
+                    toaster.pop('error', '请填写正确的发票信息');
+                } else {
+                    toaster.pop('error', '请勾选并阅读《发票须知》');
+                }
+            };
+            var doSave = function (message) {
+                $scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
+                var file = null;
+                if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
+                    file = $scope.bill.billInfo[0];
+                }
+                $upload.upload({
+                    url: 'trade/bill/save',
+                    file: file,
+                    method: 'POST',
+                    data: {
+                        bill: $scope.bill
+                    }
+                }).success(function(data){
+                    toaster.pop('success', message + '成功');
+                    $scope.changeBillStatusFlag = false
+                    $state.reload();
+                }).error(function(data){
+                    toaster.pop('error', message + '失败');
+                });
             }
-            Bill.deleteById({id: invoice.id}, function(data) {
-                toaster.pop('success', '删除成功');
-                sessionStorage.setItem('invoiceType', $scope.bill.kind);
-                $state.reload();
-            }, function(error) {
-                toaster.pop('error', '删除发票资料失败', error);
-            });
-        };
 
-        $scope.viewInvoice = function(invoice) {
-            $modal.open({
-                templateUrl : 'static/view/common/billInfoModal.html',
-                controller : 'BillInfoCtrl',
-                resolve : {
-                    invoice : function() {
-                        //深拷贝一份
-                        return angular.copy(invoice);
-                    }
+            $scope.isDoUpload = false;
+            //上传发票许可证
+            $scope.onUploadPermission = function () {
+                $scope.isDoUpload = true;
+                if (event.target.files[0].size < 3*1024*1024) {
+                    $scope.bill.attachUrl = event.target.files[0].name;
+                } else {
+                    $scope.bill.attachUrl = '';
                 }
-            });
-        };
-        $scope.linkmanLen = function() {
-            // if (num == 1){
-            //     console.log($scope.bill.name.length);
-            //     size = document.getElementById("pbillname").value.length;
-            // }else if (num == 2){
-            //     size = document.getElementById("zbillname").value.length;
-            //     console.log($scope.bill.name.length);
-            // }
-            var size = $scope.bill.name.length;
-            if (size > 10) {
-                $scope.linkError = true;
-                return;
             }
-            $scope.linkError = false;
-        };
-        $scope.addressLen = function() {
-            // if (num == 1){
-            //     size = document.getElementById("paddress").value.length;
-            // }else if (num == 2){
-            //     size = document.getElementById("zaddress").value.length;
-            // }
-            var size = $scope.bill.detailAddress.length;
-            if (size > 30) {
-                $scope.addressError = true;
-                return;
+
+            //判断中文字符串的长度
+            var getRealStringLen = function (str) {
+                var realLength = 0, len = str.length, charCode = -1;
+                for (var i = 0; i < len; i++) {
+                    charCode = str.charCodeAt(i);
+                    if (charCode >= 0 && charCode <= 128) realLength += 1;
+                    else realLength += 2;
+                }
+                return realLength;
             }
-            $scope.addressError = false;
-        };
 
-        // $scope.$watch('bill.kind', function (newValue, oldValue) {
-        //     console.log(oldValue);
-        //     console.log(newValue);
-        //     if (newValue !== oldValue){
-        //         $scope.bill = {};
-        //         $scope.bill.kind = newValue;
-        //     }
-        // });
+            $scope.validForm = {
+                validBillHead: true,
+                validBillName: true,
+                validBankName: true,
+                validDetailAddress: true,
+                validCompanyAddress: true
+            }
 
-        $scope.modifyInvoice = function(invoice) {
-            $modal.open({
-                templateUrl : 'static/view/prod/modal/edit-invoice-modal.html',
-                controller : 'BillInputCtrl',
-                size : 'lg',
-                resolve : {
-                    invoiceInfo: function() {
-                        if($scope.invoiceType == 1205) {
-                            return 1205 + "-" +invoice.id;
-                        }
-                        if($scope.invoiceType == 1206) {
-                            return 1206 + "-" +invoice.id;
-                        }
+            $scope.checkValidFrom = function () {
+                var flag = true
+                angular.forEach($scope.validForm, function (item) {
+                    if (!item) {
+                        flag = false;
                     }
+                })
+                return flag;
+            }
+        $scope.checkValidFrom();
+            //发票抬头check
+            $scope.checkBillHead = function () {
+                var len = getRealStringLen($scope.bill.head);
+                if (len > 100) {
+                    $scope.validForm.validBillHead = false;
+                } else {
+                    $scope.validForm.validBillHead = true;
                 }
-            }).result.then(function(invoice){
-                if(invoice) {
-                    getInvoiceInfo();
-                }
-            }, function(reason){
-                toaster.pop('info', '提示 ' + '您已取消编辑发票信息');
-            });
-        };
-    }]);
+            }
 
-    // 发票详情
-    app.register.controller('BillInfoCtrl', ['$scope', '$modalInstance', 'invoice', function($scope, $modalInstance, invoice) {
-        $scope.bill = invoice;
-        $scope.dismiss = function() {
-            $modalInstance.dismiss();
+        //收票人check
+        $scope.checkBillName = function () {
+            var len = getRealStringLen($scope.bill.name);
+            if (len > 20) {
+                $scope.validForm.validBillName = false;
+            } else {
+                $scope.validForm.validBillName = true;
+            }
         }
-    }]);
-
-    // 发票编辑模态框
-    app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoiceInfo', '$upload', '$modalInstance', '$q', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoiceInfo, $upload, $modalInstance, $q) {
-        //BaseService.scrollBackToTop();
 
-        $scope.bill = {};
-        $scope.bill.address = {};
-        $scope.bill.is_agree = true;
-        $scope.linkError = false;
-        $scope.addressError = false;
-        $scope.bill.kind = Number(invoiceInfo.split("-")[0]);
-        if(invoiceInfo.split("-").length == 2) {
-            $scope.invoiceId = Number(invoiceInfo.split("-")[1]);
-        }
-        $scope.setType = function() {
-            switch($scope.bill.kind) {
-                case 1206:
-                    $scope.isNormal = true;
-                    $scope.isSpecial = false; break;
-                case 1205:
-                    $scope.isNormal = false;
-                    $scope.isSpecial = true; break;
-                default:
-                    $scope.isNormal = true;
-                    $scope.isSpecial = true;
+        //开户银行Check
+        $scope.checkBankName = function () {
+            var len = getRealStringLen($scope.bill.bankName);
+            if (len > 60) {
+                $scope.validForm.validBankName = false;
+            } else {
+                $scope.validForm.validBankName = true;
             }
-        };
-
-        //设置发票类型
-        $scope.setType();
+        }
 
-        //获取发票信息
-        $scope.getData = function() {
-            if($scope.invoiceId) {
-               return Bill.getBillById({id: $scope.invoiceId}, function(data) {
-                    $scope.bill = data;
-                    $scope.bill.is_agree = true;
-                    $scope.setType();
-                }, function(response) {
-                    toaster.pop('error', '获取指定的发票信息失败');
-                });
+        //详细地址Check
+        $scope.checkDetailAddress = function () {
+            var len = getRealStringLen($scope.bill.detailAddress);
+            if (len > 60) {
+                $scope.validForm.validDetailAddress = false;
             } else {
-                return {};
+                $scope.validForm.validDetailAddress = true;
             }
-        };
+        }
 
-        $scope.linkmanLen = function() {
-            var size = $scope.bill.name.length;
-            // if (num == 1){
-            //     size = document.getElementById("mpbillname").value.length;
-            // }else if (num == 2){
-            //     size = document.getElementById("mzbillname").value.length;
-            // }
-            if (size > 10) {
-                $scope.linkError = true;
-                return;
+        //单位地址check
+        $scope.checkCompanyAddress = function () {
+            var len = getRealStringLen($scope.bill.companyAddress);
+            if (len > 100) {
+                $scope.validForm.validCompanyAddress = false;
+            } else {
+                $scope.validForm.validCompanyAddress = true;
             }
-            $scope.linkError = false;
-        };
+        }
 
-        $scope.addressLen = function() {
-            var size = $scope.bill.detailAddress.length;
-            // if (num == 1){
-            //     size = document.getElementById("mpaddress").value.length;
-            // }else if (num == 2){
-            //     size = document.getElementById("mzaddress").value.length;
-            // }
-            if (size > 30) {
-                $scope.addressError = true;
-                return;
+        //设置新增栏目切换发票类型
+        $scope.billType = 1206
+        //设置发票类型
+        $scope.setType = function() {
+            angular.forEach($scope.invoices, function (item) {
+                if(item.kind == '1205'){
+                    $scope.isSpecial = false;
+                } else if (item.kind == '1206') {
+                    $scope.isNormal = false;
+                }
+            })
+            if (!$scope.isNormal) {
+                $scope.billType = 1205
+            }
+            if (!$scope.isSpecial) {
+                $scope.billType = 1206
             }
-            $scope.addressError = false;
         };
-
-        //等到获取到发票信息,
-        $q.all([$scope.getData().$promise]).then(function () {
-            $http.get('static/js/prod/data/city.json').success(function(data) {
-                $scope.division = data;
-                if($scope.bill.area){
-                    $scope.bill.address = {};
-                    //拼装下拉选择框
-                    var arr = $scope.bill.area.split(',');
-                    $scope.bill.address.province = arr[0];
-                    $scope.bill.address.city = arr[1];
-                    $scope.bill.address.district = arr[2];
-                }
-            }).error(function(e) {
-                toaster.pop('error', '系统错误 ' + '加载城市信息失败');
-            });
-        }, function () {
-            //ERROR
-        });
-
-        //保存发票信息
-        $scope.saveBill = function() {
-            $scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
-            var file = null;
-            if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
-                file = $scope.bill.billInfo[0];
+        //设置修改区域显示标志
+        $scope.changeBillStatusFlag = false;
+        $scope.showDeleteBox = false
+        $scope.setChangeBillStatusFlag = function (flag) {
+            $scope.changeBillStatusFlag = flag;
+            if (!flag) {
+                $scope.bill = {};
+            }
+        }
+        $scope.exitEdit = function () {
+            $state.reload();
+        }
+        $scope.addBill = function () {
+            $scope.setType();
+            $scope.bill = {};
+            $scope.changeBillStatusFlag = true;
+            $scope.isAdd = true;
+        }
+        $scope.setBillType = function (type) {
+            $scope.bill = {};
+            $scope.billType = type;
+            this.form.$setPristine();
+            this.form.$setUntouched();
+        }
+        //修改发票
+        $scope.modifyInvoice = function (invoice) {
+            $scope.changeBillStatusFlag = true;
+            $scope.isAdd = false;
+            $scope.billType = invoice.kind
+            $scope.bill = invoice;
+            $scope.bill.is_agree = true;
+            $scope.bill.address = {};
+            var area = invoice.area.split(',');
+            angular.forEach(area, function (item, index) {
+                switch(index) {
+                    case 0:
+                        $scope.bill.address.province = item;
+                        break;
+                    case 1:
+                        $scope.bill.address.city = item;
+                        break;
+                    case 2:
+                        $scope.bill.address.district = item;
+                        break;
             }
-            $upload.upload({
-                url: 'trade/bill/save',
-                file: file,
-                method: 'POST',
-                data: {
-                    bill: $scope.bill
-                }
-            }).success(function(data){
-                toaster.pop('success', '保存发票信息成功');
-                $modalInstance.close(data);
-            }).error(function(data){
-                toaster.pop('error', '保存发票信息失败');
             });
         };
+        //删除按钮点击
+        $scope.deleteInvoice = function (invoice) {
+            $scope.tempDeleteId = invoice.id //删除发票临时存放
+            $scope.setDeleteBox(true)
+        }
+        //设置提示框状态
+        $scope.setDeleteBox = function (flag) {
+            $scope.showDeleteBox = flag
+        }
+        //确定删除
+        $scope.doDeleteInvoice = function () {
+            Bill.deleteById({id: $scope.tempDeleteId}, null, function (data) {
+                toaster.pop('success', '删除发票成功')
+                $state.reload();
+            }, function (error) {
+                toaster.pop('error', '删除发票失败')
+            })
+        }
+    }]);
 
-        //取消发票信息操作
-        $scope.exit = function() {
+    // 发票详情
+    app.register.controller('BillInfoCtrl', ['$scope', '$modalInstance', 'invoice', function($scope, $modalInstance, invoice) {
+        $scope.bill = invoice;
+        $scope.dismiss = function() {
             $modalInstance.dismiss();
         }
-
     }]);
+
+    // 发票编辑模态框
+    // app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoiceInfo', '$upload', '$modalInstance', '$q', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoiceInfo, $upload, $modalInstance, $q) {
+    //     //BaseService.scrollBackToTop();
+    //
+    //     $scope.bill = {};
+    //     $scope.bill.address = {};
+    //     $scope.bill.is_agree = true;
+    //     $scope.linkError = false;
+    //     $scope.addressError = false;
+    //     $scope.bill.kind = Number(invoiceInfo.split("-")[0]);
+    //     if(invoiceInfo.split("-").length == 2) {
+    //         $scope.invoiceId = Number(invoiceInfo.split("-")[1]);
+    //     }
+    //     $scope.setType = function() {
+    //         switch($scope.bill.kind) {
+    //             case 1206:
+    //                 $scope.isNormal = true;
+    //                 $scope.isSpecial = false; break;
+    //             case 1205:
+    //                 $scope.isNormal = false;
+    //                 $scope.isSpecial = true; break;
+    //             default:
+    //                 $scope.isNormal = true;
+    //                 $scope.isSpecial = true;
+    //         }
+    //     };
+    //
+    //     //设置发票类型
+    //     $scope.setType();
+    //
+    //     //获取发票信息
+    //     $scope.getData = function() {
+    //         if($scope.invoiceId) {
+    //             return Bill.getBillById({id: $scope.invoiceId}, function(data) {
+    //                 $scope.bill = data;
+    //                 $scope.bill.is_agree = true;
+    //                 $scope.setType();
+    //             }, function(response) {
+    //                 toaster.pop('error', '获取指定的发票信息失败');
+    //             });
+    //         }
+    //     };
+    //
+    //     $scope.linkmanLen = function() {
+    //         var size = $scope.bill.name.length;
+    //         // if (num == 1){
+    //         //     size = document.getElementById("mpbillname").value.length;
+    //         // }else if (num == 2){
+    //         //     size = document.getElementById("mzbillname").value.length;
+    //         // }
+    //         if (size > 10) {
+    //             $scope.linkError = true;
+    //             return;
+    //         }
+    //         $scope.linkError = false;
+    //     };
+    //
+    //     $scope.addressLen = function() {
+    //         var size = $scope.bill.detailAddress.length;
+    //         // if (num == 1){
+    //         //     size = document.getElementById("mpaddress").value.length;
+    //         // }else if (num == 2){
+    //         //     size = document.getElementById("mzaddress").value.length;
+    //         // }
+    //         if (size > 30) {
+    //             $scope.addressError = true;
+    //             return;
+    //         }
+    //         $scope.addressError = false;
+    //     };
+    //
+    //     //等到获取到发票信息,
+    //     $q.all([$scope.getData().$promise]).then(function () {
+    //         $http.get('static/js/prod/data/city.json').success(function(data) {
+    //             $scope.division = data;
+    //             if($scope.bill.area){
+    //                 $scope.bill.address = {};
+    //                 //拼装下拉选择框
+    //                 var arr = $scope.bill.area.split(',');
+    //                 $scope.bill.address.province = arr[0];
+    //                 $scope.bill.address.city = arr[1];
+    //                 $scope.bill.address.district = arr[2];
+    //             }
+    //         }).error(function(e) {
+    //             toaster.pop('error', '系统错误 ' + '加载城市信息失败');
+    //         });
+    //     }, function () {
+    //         //ERROR
+    //     });
+    //
+    //     //保存发票信息
+    //     $scope.saveBill = function() {
+    //         $scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
+    //         var file = null;
+    //         if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
+    //             file = $scope.bill.billInfo[0];
+    //         }
+    //         $upload.upload({
+    //             url: 'trade/bill/save',
+    //             file: file,
+    //             method: 'POST',
+    //             data: {
+    //                 bill: $scope.bill
+    //             }
+    //         }).success(function(data){
+    //             toaster.pop('success', '保存发票信息成功');
+    //             $modalInstance.close(data);
+    //         }).error(function(data){
+    //             toaster.pop('error', '保存发票信息失败');
+    //         });
+    //     };
+    //
+    //     //取消发票信息操作
+    //     $scope.exit = function() {
+    //         $modalInstance.dismiss();
+    //     }
+    //
+    // }]);
 });

+ 78 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_record_ctrl.js

@@ -0,0 +1,78 @@
+define([ 'app/app' ], function(app) {
+    'use strict';
+    app.register.controller('buyerInvoiceRecordCtrl', ['$scope','$rootScope','$modal','BillSubmit','BaseService', 'toaster','ngTableParams', function ($scope, $rootScope, $modal, BillSubmit, BaseService, toaster, ngTableParams) {
+        $scope.tab = 'buyer_invoice-record';
+        // 开票申请
+        $scope.keyword = '';
+        $scope.invoiceType = '';
+
+        var initDataRule = function () {
+            $scope.param = {
+                page: 1,
+                count: 10,
+                sorting: {
+                    createTime : "DESC"
+                },
+                keyword: '',
+                invoiceType: '',
+                status: '',
+                role: 'BUYER'
+            };
+        };
+        initDataRule();
+
+        // 切换发票类型
+        $scope.changeInvoiceType = function(invoiceType) {
+            $scope.invoiceType = invoiceType;
+            $scope.billRecordTableParam.page(1);
+            $scope.billRecordTableParam.reload();
+        };
+
+        // 切换状态
+        $scope.changeStatus = function (status) {
+            $scope.status = status;
+            $scope.billRecordTableParam.page(1);
+            $scope.billRecordTableParam.reload();
+        };
+
+        $scope.$$kdnData = {};
+        var initTable = function () {
+            $scope.billRecordTableParam = new ngTableParams($scope.param,{
+                total : 0,
+                getData : function ($defer, params) {
+                    var param = BaseService.parseParams(params.url());
+                    param.keyword = $scope.keyword;
+                    param.invoicetype = $scope.invoiceType;
+                    param.status = $scope.status;
+                    BillSubmit.getSubmitBillApply(param, function (page) {
+                        $scope.$$kdnData.totalElements = page.totalElements;
+                        if(Number(page.totalElements) > 0) {
+                            $scope.$$kdnData.start = Number(page.size) * (Number(page.number) - 1) + 1;
+                        }else {
+                            $scope.$$kdnData.start = 0;
+                        }
+                        $scope.$$kdnData.end = Number(page.size) * (Number(page.number) - 1) + Number(page.numberOfElements);
+                        params.total(page.totalElements);
+                        $defer.resolve(page.content);
+                        //划分数据
+                        $scope.billData = page.content;
+                    }, function () {
+                        toaster.pop('error', '获取开票记录失败');
+                    });
+                }
+            });
+        };
+        initTable();
+        
+        $scope.searchByKey = function () {
+            $scope.param.keyword = $scope.keyword;
+            initTable();
+        }
+        $scope.enterEvent = function (e) {
+            var keycode = window.event?e.keyCode:e.which;
+            if(keycode==13){
+                $scope.searchByKey();
+            }
+        }
+    }]);
+});

+ 216 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_no_invoice_ctrl.js

@@ -0,0 +1,216 @@
+define([ 'app/app' ], function(app) {
+    'use strict';
+    app.register.controller('NoInvoiceCtrl', ['$scope','$rootScope','$modal', 'Order', 'toaster','ngTableParams','BaseService','Bill', function ($scope, $rootScope, $modal, Order, toaster, ngTableParams, BaseService, Bill) {
+        $scope.tab = 'buyer_no_invoice';
+
+        // 开票申请
+        $scope.applyInvoice = function () {
+            var applyItem = [];
+            angular.forEach($scope.orderData, function (item) {
+                if (item.checked) {
+                    applyItem.push(item);
+                }
+            })
+            if (applyItem.length > 0) {
+                if ($scope.invoices.length > 0) {
+                    $modal.open({
+                        templateUrl : $rootScope.rootPath + '/static/view/usercenter/modal/apply-invoice.html',
+                        size : 'lg',
+                        controller : 'NoInvoiceSubmitCtrl',
+                        resolve : {
+                            submitInvoice : function () {
+                                return applyItem;
+                            },
+                            invoiceData: function () {
+                                return $scope.invoices;
+                            }
+                        }
+                    })
+                } else {
+                    toaster.pop('error','请前往开票信息页面新增发票');
+                }
+            } else {
+                toaster.pop('error','请勾选未开票订单');
+            }
+        };
+        var initDataRule = function () {
+            $scope.param = {
+                page : 1,
+                count : 10,
+                status : 520,
+                sorting: {creattime : "DESC"},
+                keyword : ''
+            };
+            $scope.keyword = '';
+
+            Bill.getListPersonal(null, function(data) {
+                $scope.invoices = data;
+            }, function(error) {
+                toaster.pop('error', '获取发票信息失败');
+            });
+        }
+        initDataRule();
+
+        $scope.$$kdnData = {};
+
+        var initTable = function () {
+            $scope.orderBillTableParam = new ngTableParams($scope.param,{
+                total : 0,
+                getData : function ($defer, params) {
+                    var param = BaseService.parseParams(params.url());
+                    // param.pageParams.sorting = {creattime : "DESC"};
+                    param.keyword = $scope.keyword;
+                    Order.getOrderOnBillByPersonal(param, function (page) {
+                        $scope.$$kdnData.totalElements = page.totalElements;
+                        if(Number(page.totalElements) > 0) {
+                            $scope.$$kdnData.start = Number(page.size) * (Number(page.number) - 1) + 1;
+                        }else {
+                            $scope.$$kdnData.start = 0;
+                        }
+                        $scope.$$kdnData.end = Number(page.size) * (Number(page.number) - 1) + Number(page.numberOfElements);
+                        params.total(page.totalElements);
+                        $defer.resolve(page.content);
+                        //划分数据
+                        $scope.orderData = page.content;
+                        //初始化选中状态
+                        angular.forEach($scope.orderData, function (item) {
+                            item.checked = false;
+                        })
+                    }, function () {
+                        toaster.pop('error', '获取未开票订单信息失败');
+                    });
+                }
+            });
+        };
+        initTable();
+
+        $scope.searchByKeyword = function () {
+            $scope.param.keyword = $scope.keyword;
+            initTable();
+        }
+        $scope.enterEvent = function (e) {
+            var keycode = window.event?e.keyCode:e.which;
+            if(keycode==13){
+                $scope.searchByKeyword();
+            }
+        }
+
+        //全选状态
+        $scope.isAllCheck = false;
+        //全选
+        $scope.onAllChecked = function () {
+            if (!$scope.isAllCheck) {
+                angular.forEach($scope.orderData, function (item, index) {
+                    item.checked = true;
+                })
+            } else {
+                angular.forEach($scope.orderData, function (item, index) {
+                    item.checked = false;
+                })
+            }
+            $scope.isAllCheck = !$scope.isAllCheck;
+        }
+
+
+        //单选
+        $scope.checkInvoice = function (item) {
+            var temAllCheck = true;
+            item.checked = !item.checked;
+            angular.forEach($scope.orderData, function (itemss) {
+                if (!itemss.checked) {
+                    temAllCheck = false;
+                }
+            })
+            $scope.isAllCheck = temAllCheck;
+        }
+
+    }]);
+    app.register.controller('NoInvoiceSubmitCtrl', ['$scope','$rootScope','$modal', 'Order', 'toaster', 'submitInvoice', '$modalInstance','invoiceData','BillSubmit','$state', function ($scope, $rootScope, $modal, Order, toaster, submitInvoice, $modalInstance, invoiceData, BillSubmit, $state) {
+        //公司列表
+        $scope.submitInvoice = [];
+
+        //订单数
+        $scope.orderCount = submitInvoice.length || 0;
+
+        //总金额
+        $scope.allPrice = 0;
+
+        //发票信息
+        $scope.invoiceData = {};
+
+        $scope.orderIdArr = [];
+        // 数据处理
+        $scope.dealData = function () {
+            var submitItem = submitInvoice;
+            var temStoreIdArr = [];
+            var tmpPriceArr = [];
+            angular.forEach(submitItem, function (item) {
+                var index = temStoreIdArr.indexOf(item.storeid);
+                $scope.orderIdArr.push(item.orderid);
+                if (index == -1) {
+                    temStoreIdArr.push(item.storeid);
+                    tmpPriceArr.push({price: item.price, storeName: item.storeName, orderid: item.orderid});
+                } else {
+                    tmpPriceArr[index].price += item.price;
+                }
+            })
+            angular.forEach(tmpPriceArr, function (item, index) {
+                $scope.submitInvoice.push(tmpPriceArr[index]);
+                $scope.allPrice += tmpPriceArr[index].price;
+            })
+        }
+        $scope.dealData();
+
+        $scope.hasSpecial = false;
+        $scope.hasNormal = false;
+
+        $scope.getInvoiceData = function (invoiceKind) {
+            var tmpInvoice = invoiceData;
+            if (!invoiceKind) {
+                if (tmpInvoice.length == 1) {
+                    $scope.invoiceData = tmpInvoice[0];
+                    if (tmpInvoice[0].kind == 1205) {
+                        $scope.hasSpecial = true;
+                    } else if (tmpInvoice[0].kind == 1206) {
+                        $scope.hasNormal = true;
+                    }
+                } else if (tmpInvoice.length > 1) {
+                    $scope.getInvoiceData(1206);
+                }
+            } else {
+                angular.forEach(tmpInvoice, function (item) {
+                    if (item.kind == 1205) {
+                        $scope.hasSpecial = true;
+                    }
+
+                    if (item.kind == 1206) {
+                        $scope.hasNormal = true;
+                    }
+
+                    if (item.kind == invoiceKind) {
+                        $scope.invoiceData = item;
+                    }
+                })
+            }
+        }
+
+        $scope.getInvoiceData();
+
+        //关闭模态框
+        $scope.closeModal = function () {
+            $modalInstance.dismiss();
+        }
+
+        //提交申请
+        $scope.apply = function () {
+            BillSubmit.submitBillApply(null, {orderids: $scope.orderIdArr.join(','), invoiceid: $scope.invoiceData.id}, function (data) {
+                toaster.pop('success', '申请发票成功');
+                $scope.closeModal();
+                $state.reload();
+            },function (error) {
+                toaster.pop('error', '申请发票失败');
+            })
+        }
+
+    }]);
+});

+ 6 - 0
src/main/webapp/resources/js/vendor/app.js

@@ -555,6 +555,12 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl: 'static/view/vendor/forstore/messagePublic.html',
 			controller: 'MessagePublicCtrl',
 			controllerUrl: 'app/controllers/forstore/messagePublicCtrl'
+		})).state('vendorInvoice', angularAMD.route({
+			url: '/vendor_invoice',
+			title:'发票管理',
+			templateUrl: 'static/view/vendor/forstore/vendor-invoice.html',
+			controller: 'vendorInvoiceCtrl',
+			controllerUrl: 'app/controllers/forstore/vendor_invoice_ctrl'
 		}))
 	}]);
 

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/pay_center_ctrl.js

@@ -195,7 +195,7 @@ define(['app/app'], function(app) {
         $scope.validateNumber = function (number) {
             if(number) {
                 if(/^\d+$/.test(number)) {
-                    if(number.length < 31 || number.length > 7) {
+                    if(number.length < 31 && number.length > 7) {
                         $scope.$payCenter.numberVal = true;
                         return ;
                     }

+ 173 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_invoice_ctrl.js

@@ -0,0 +1,173 @@
+define([ 'app/app' ], function(app) {
+    'use strict';
+    app.register.controller('vendorInvoiceCtrl', ['$scope','$rootScope','$modal','BillSubmit','BaseService', 'toaster','ngTableParams','$state', function ($scope, $rootScope, $modal, BillSubmit, BaseService, toaster, ngTableParams, $state) {
+        $rootScope.active = 'vendor_invoice';
+        // 切换tab
+        $scope.active = 'apply_invoice';
+        $scope.toggleTab = function (t) {
+            if (t=='apply_invoice') {
+                initDataRule(101);
+            } else {
+                initDataRule(102);
+            }
+            initTable();
+            if ($scope.isAllCheck) {
+               $scope.onAllChecked();
+            }
+            $scope.active = t;
+        };
+
+        var initDataRule = function (stateNum) {
+            // $scope.param = {};
+            // $scope.pageparam = {};
+             $scope.keyword = '';
+             $scope.billType = 1;
+            // $scope.role = 'SELLER';
+            // $scope.status = stateNum;
+            // $scope.pageparam.page = 1;
+            // $scope.pageparam.count = 10;
+            // $scope.pageparam.sorting = {createTime : "DESC"};
+            $scope.param = {
+                page : 1,
+                count : 10,
+                status : stateNum,
+                sorting: {createTime : "DESC"},
+                keyword : '',
+                role :'SELLER',
+                invoicetype: ''
+            };
+
+            // $scope.param.pageParams = $scope.pageparam;
+            // $scope.param.keyword = $scope.keyword;
+            // $scope.param.role = $scope.role;
+            // $scope.param.status = $scope.status;
+        }
+        initDataRule(101);
+
+        $scope.$$kdnData = {};
+        var initTable = function () {
+            $scope.billRecordTableParam = new ngTableParams($scope.param,{
+                total : 0,
+                getData : function ($defer, params) {
+                    var param = BaseService.parseParams(params.url());
+                //    param.pageParams.sorting = {creattime : "DESC"};
+                         param.keyword = $scope.keyword;
+                    BillSubmit.getSubmitBillApply(param, function (page) {
+                        $scope.$$kdnData.totalElements = page.totalElements;
+                        if(Number(page.totalElements) > 0) {
+                            $scope.$$kdnData.start = Number(page.size) * (Number(page.number) - 1) + 1;
+                        }else {
+                            $scope.$$kdnData.start = 0;
+                        }
+                        $scope.$$kdnData.end = Number(page.size) * (Number(page.number) - 1) + Number(page.numberOfElements);
+                        params.total(page.totalElements);
+                        $defer.resolve(page.content);
+                        //划分数据
+                        $scope.billData = page.content;
+                        //初始化选中状态和地址信息
+                        $scope.isAllCheck = false;
+                        angular.forEach($scope.billData, function (item) {
+                            var temAddr = item.invoiceAddress.split(',')
+                            item.detailAddr = temAddr[3]
+                            item.area = temAddr[0]+'  '+temAddr[1]+'  '+temAddr[2]
+                            item.checked = false
+                        })
+                    }, function () {
+                        toaster.pop('error', '获取开票记录失败');
+                    });
+                }
+            });
+        };
+        initTable();
+
+        $scope.billTypeSearch = function (billType) {
+        //    console.log($scope.billType)
+            if (billType == 1) {
+                $scope.param.invoicetype  = '';
+            } else if (billType == 2) {
+                $scope.param.invoicetype  = 1206;
+            } else if (billType == 3) {
+                $scope.param.invoicetype  = 1205;
+            }
+            initTable();
+        }
+
+        $scope.searchByKey = function (k) {
+            $scope.keyword = k;
+            initTable();
+        }
+
+        $scope.enterEvent = function(e, keyword) {
+            var keycode = window.event ? e.keyCode : e.which;
+            if(keycode==13){
+                $scope.searchByKey(keyword);
+            }
+        }
+        //全选状态
+        $scope.isAllCheck = false
+        //全选
+        $scope.onAllChecked = function () {
+            if (!$scope.isAllCheck) {
+                angular.forEach($scope.billData, function (item, index) {
+                    item.checked = true
+                })
+            } else {
+                angular.forEach($scope.billData, function (item, index) {
+                    item.checked = false
+                })
+            }
+            $scope.isAllCheck = !$scope.isAllCheck
+        }
+
+
+        //单选
+        $scope.checkInvoice = function (item) {
+            var temAllCheck = true
+            item.checked = !item.checked
+            angular.forEach($scope.billData, function (itemss) {
+                if (!itemss.checked) {
+                    temAllCheck = false
+                }
+            })
+            $scope.isAllCheck = temAllCheck
+        }
+
+        //提交申请
+        $scope.submitApply = function () {
+            var flag = false;
+            angular.forEach($scope.billData, function (item) {
+                if (item.checked) {
+                    flag = true;
+                }
+            });
+            if (flag) {
+                $scope.setShowSubmitBox(true);
+            } else {
+                toaster.pop('error','请先勾选开票申请');
+            }
+        }
+        
+        $scope.setShowSubmitBox = function (flag) {
+            $scope.showSubmitBox = flag;
+        }
+
+        //确认提交
+        $scope.doSubmit = function () {
+            var tmpIds = '';
+            angular.forEach($scope.billData, function (item) {
+                if (item.checked) {
+                    tmpIds += item.id + ',';
+                }
+            });
+            tmpIds = tmpIds.substring(0, tmpIds.length-1)
+            BillSubmit.sureBillApply({ids: tmpIds}, null, function (data) {
+                $state.reload();
+                toaster.pop('success','开票成功');
+                $scope.setShowSubmitBox(false);
+            },function (error) {
+                toaster.pop('error','开票失败');
+            })
+        }
+
+    }]);
+});

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -520,7 +520,7 @@
 			<!--购物车清单-->
 			<dl style="display: inline-block;" when-scrolled="scrollLoadData()">
 				<dt>
-					<span class="wd01"><input type="checkbox" id="checkonAll" name="checkbox" ng-checked="isChooseAll" ng-click="chooseAllCarts()"/><label for="checkonAll"></label></span>
+					<span class="wd01"><input ng-disabled="cartMap.length == 0" type="checkbox" id="checkonAll" name="checkbox" ng-checked="isChooseAll" ng-click="chooseAllCarts()"/><label for="checkonAll" ng-disabled="cartMap.length == 0"></label></span>
 					<span class="wid24">产品信息</span>
 					<span class="wd02">交期(天)</span>
 					<span>单价</span>

+ 526 - 264
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -1,6 +1,6 @@
 <style>
     .u_c_invoice {
-        background: #f5f5f5;
+        background: #fff;
     }
     .u_c_invoice select {
         opacity: 1
@@ -10,7 +10,8 @@
         /*margin-bottom: 16px;*/
     }
     .u_c_invoice .ticket_record_list {
-        background: #f5f5f5;
+        background: #fff;
+        min-height: 323px;
     }
     .u_c_invoice #add-invoice {
         width: 100%;
@@ -52,26 +53,411 @@
     .u_c_invoice #add-invoice .form-group{
         line-height: 34px;
     }
+    .ticket_record .ticket_record_list .ticket_record_title {
+        padding: 8px 18px;
+    }
+    .ticket_record .ticket_record_list .ticket_record_title .l_title {
+        font-size: 14px;
+    }
+    .ticket_record .ticket_record_list .ticket_record_title .add_btn{
+        width: auto;
+        height: 40px;
+        text-align: center;
+        float: right;
+        font-size: 12px;
+        margin-right: 32px;
+    }
+    .ticket_record .ticket_record_list .ticket_record_title .add_btn i{
+        background: white;
+        color: #32b500;
+        margin-right: 5px;
+        font-size: 14px;
+    }
+    .ticket_record .ticket_record_list .ticket_record_title .add_btn:hover{
+        cursor: pointer;
+    }
+    .ticket_record_list dl dt span {
+        font-weight: bold;
+        color: #fff;
+        background: #89aefa;
+    }
+    .match-menu {
+        width: 100%;
+        height: 20px;
+        line-height: 20px;
+    }
+    .match-menu span.active {
+        background: #fff;
+        border: #82d2fa 1px solid;
+        border-bottom: #fff 1px solid;
+    }
+    .match-menu span {
+        display: inline-block;
+        text-align: center;
+        width: 100px;
+        height: 20px;
+        background: #eee;
+        border-top-left-radius: 3px;
+        border-top-right-radius: 3px;
+        margin-left: 390px;
+        line-height: 19px;
+        position: relative;
+        bottom: 20px;
+    }
+    .match-menu span.active a {
+        color: #333;
+    }
+    .match-menu span a {
+        font-size: 12px;
+        color: #999;
+        display: inline-block;
+        height: 20px;
+        width: 78px;
+    }
+    a:hover {
+        text-decoration: none;
+    }
+    .match-menu span i {
+        font-size: 14px;
+        color: #999;
+    }
+    .match-menu span i:hover, .match-menu span a:hover {
+        color: #5078cb;
+    }
+    .ticket_record .oder01 ul.active {
+        border-bottom: #82d2fa 1px solid;
+    }
+    /*提示框样式*/
+    .com-del-box{
+        position: fixed;
+        z-index: 2;
+        height: 152px;
+        opacity: 1;
+        background-color: white;
+        width: 310px;
+        -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        margin: -155px 0 0 -75px;
+        top: 55%;
+        left: 50%;
+    }
+    .com-del-box .title{
+        height: 30px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 30px;
+    }
+    .com-del-box .title a{
+        color: white;
+        font-size: 16px;
+    }
+    .com-del-box .content{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+    }
+    .com-del-box .content p{
+        line-height: 50px;
+        font-size: 14px;
+        padding-top: 10px;
+    }
+    .com-del-box .content p i{
+        color: #5078cb;
+        font-size: 16px;
+        margin-right: 10px;
+    }
+    .com-del-box .content div{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+    }
+    .com-del-box .content div a{
+        width: 55px;
+        height: 26px;
+        line-height: 26px;
+        display: inline-block;
+        text-align: center;
+        font-size: 14px;
+    }
+    .com-del-box .content div a:first-child{
+        background: #b4b5b9;
+        color: #333;
+        margin-right: 10px;
+    }
+    .com-del-box .content div a:last-child{
+        background: #5078cb;
+        color: #fff;
+    }
+    .com-del-box .content div a:hover{
+        background: #3f7ae3;
+        color: #fff;
+    }
+    /*新增普票样式*/
+    .content-title {
+        font-size: 19px;
+    }
+
+    td > .simple-select {
+        display: inline;
+    }
+    .normal-control-label {
+        margin-bottom: 0;
+        text-align: right;
+        padding-top: 7px;
+        padding-right: 23px;
+    }
+
+    #bill-info label {
+        font-size: 14px;
+        line-height: 1.429;
+        font-weight: normal;
+    }
+    #bill-info span.disable {
+        color: rgb(153, 153, 153);
+    }
+    .base-line {
+        vertical-align: -webkit-baseline-middle;
+    }
+
+    #bill-info .row {
+        margin-left: 0px;
+        margin-right: 0px;
+    }
+
+    #bill-info {
+        font-size: 15px;
+        margin-bottom: 1em;
+    }
+
+    .error {
+        padding-top: 7px;
+        line-height: 1.5;
+    }
+
+    div.radio {
+        margin-top: 0px;
+        margin-bottom: 0;
+        height: 27px;
+        line-height: 27px;
+        padding-top: 6px;
+        padding-left: 0;
+    }
+
+    .padding-top-5 {
+        padding-top: 5px;
+    }
+
+    label.padding-left-0 {
+        padding-left: 0px;
+    }
+
+    .checkbox .col-md-3 {
+        padding-right: 0px;
+    }
+
+    div.upload {
+        margin-left: 15px;
+        width: 370px;
+    }
+
+    #bill-info,  #bill-info input, #bill-info select{
+        font-size: 14px !important;
+    }
+
+    .height-34 {
+        height: 34px;
+        line-height: 26px;
+    }
+
+    .a-background {
+        color: red;
+    }
+
+    .address .checkbox .col-md-3{
+        width: 20%;
+    }
+    #bill-info .form-control {
+        color: #000;
+        font-size: 14px;
+    }
+    #bill-info .format-error {
+        color: red;
+        height: 30px;
+        line-height: 30px;
+    }
+
+    #bill-info select {
+        opacity: 1;
+    }
+    #bill-info .content-header{
+        font-size: 14px;
+        padding-bottom: 0;
+        color: rgb(80, 120, 203);
+        font-weight: bold;
+        line-height: 1.429;
+        padding-left: 40px;
+        padding-bottom: 10px;
+    }
+    .select-adder{
+        background:url("static/img/user/images/xiala.png") right no-repeat ;
+        background-position-x: 150px;
+    }
+    .form-btn .btn {
+        background: #5078cb;
+        border-color: #3b88c3;
+        width: 60px;
+        height: 26px;
+        line-height: 13px;
+        color: #fff;
+        border-radius: 0;
+        text-align: center;
+        vertical-align: middle;
+        white-space: nowrap;
+    }
+    .form-btn .btn:first-child{
+        background: #c8c6c6;
+        border: 1px solid #c8c6c6;
+    }
+    .form-area {
+        background: #f5f8fe;
+        margin: 0 15px;
+    }
+    .form-area .row {
+        padding-top: 15px;
+    }
+    .form-area .address .row {
+        padding-top: 0px;
+    }
+    .form-area form {
+        padding-top: 15px;
+    }
+    .form-bottom {
+        background: #fff;
+        text-align: center;
+        vertical-align: middle;
+        padding-top: 20px;
+        padding-bottom: 3px;
+    }
+    .ticket_record_list dl dt span {
+        font-weight: normal;
+    }
+    /*radio*/
+    #bill-info .radioLabel {
+        line-height: 20px;
+        cursor: pointer;
+        color: #666;
+    }
+    #bill-info .radio-inline {
+        padding-left: 0;
+        margin: 0 26px;
+    }
+    #bill-info .radioLabel label{
+        width: 12px;
+        height: 12px;
+        background: url(static/img/icon/check-rule.png);
+        background-position: 0 0px;
+        vertical-align: middle;
+        margin-bottom: 0 !important;
+        margin-right: 0px !important;
+        padding: 0;
+        min-height: 12px;
+        left: -7px;
+    }
+    #bill-info .radioLabel input[type="radio"]:checked + label {
+        background-position: -15px -12px;
+    }
+    #bill-info .radioLabel input[type="radio"]:checked + label{
+        color: #5078cb;
+    }
+    #bill-info .radioLabel input[type="radio"]{
+        display: none;
+    }
+    #bill-info .form-area .input-file-default {
+        width: 75px;
+    }
+    .ticket_record_list dl dd:hover {
+        background: #f1f5ff;
+    }
+    #bill-info .select-file-box input {
+        display: none;
+    }
+    #bill-info .select-file-box span {
+        width: 74px;
+        display: block;
+        text-align: center;
+        height: 22px;
+        line-height: 22px;
+        background: #ff8522;
+        font-size: 12px;
+        color: #fff;
+        margin-top: 5px;
+        position: relative;
+        left: -22px;
+        border-radius: 2px;
+    }
+    .cursor-not-allowed {
+        cursor: not-allowed!important;
+    }
+    .ticket_record_list .ticket_data dd {
+        border-left: #dae5fd 1px solid;
+        border-bottom: #dae5fd 1px solid!important;
+        border-right: #dae5fd 1px solid;
+    }
+    #bill-info .form-input-line {
+        height: 34px;
+        width: 331px;
+        display: inline-block;
+        margin: 0 15px;
+        float: left;
+    }
+    #bill-info .form-input-line input[type='text'],#bill-info .form-input-line select {
+        border-radius: 2px;
+        border: 1px solid #eef4ff;
+    }
+    #bill-info .file-line {
+        width: 247px;
+    }
+    #bill-info .address .form-input-line {
+        margin: 0 10px 0 0;
+    }
+    #bill-info .address .form-input-line:first-child {
+        margin-left: 15px;
+    }
+    #bill-info .control-label{
+        position: relative;
+        top: 7px;
+    }
+    #bill-info .normal-control-label {
+        position: relative;
+        top: 5px;
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">
     <!--开票记录-->
     <div class="ticket_record oder">
         <div class="oder01">
-            <ul>
-                <li class="active"><a>开票信息</a></li>
-                <!--<li><a>开票记录</a></li>-->
+            <ul ng-class="{'active': changeBillStatusFlag}">
+                <li ng-class="{'active': tab == 'buyer_invoice' && !changeBillStatusFlag}" style="margin-left: 15px;"><a ng-click="changeBillStatusFlag = false" ui-sref="buyer_invoice">开票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
             </ul>
         </div>
-       <!-- <div class="page">
-            <ul>
-                <li><a >上一页</a> </li>
-                <li>第<input type="text" placeholder="3">页</li>
-                <li><a >下一页</a> </li>
-            </ul>
-        </div>-->
+        <div style="background: #f5f5f5; height: 11px" ng-if="!changeBillStatusFlag"></div>
+        <!--发票操作导航-->
+        <div class="match-menu" ng-if="changeBillStatusFlag">
+                <span class="active">
+                    <a ng-bind="isAdd?'新增发票信息':'修改发票信息'"></a>
+                        <i class="fa fa-remove" ng-click="exitEdit()"></i>
+                </span>
+        </div>
         <!--我的发票-->
-        <div class="ticket_record_list">
+        <div class="ticket_record_list" ng-if="!changeBillStatusFlag">
+            <div class="ticket_record_title">
+                <span class="l_title">已设置的开票信息</span>
+                <span class="add_btn" ng-click="addBill()" ng-if="!(!isSpecial && !isNormal)"><i class="fa fa-plus-circle"></i>   新增发票</span>
+            </div>
             <!-- 开票资料-->
             <div class="tab" style="display: inline-block;">
                 <dl class="ticket_data">
@@ -83,158 +469,132 @@
                         <span>收票人电话</span>
                         <span>编辑</span>
                     </dt>
-                    <p class="height16">&nbsp;</p>
+                  <!--  <p class="height16">&nbsp;</p>-->
                     <dd ng-repeat="invoice in invoices">
                         <span class="wd01">
-                            <img ng-if="invoice.kind == 1206" src="static/img/user/images/ticket01.png"/>
-                            <img ng-if="invoice.kind == 1205" src="static/img/user/images/ticket02.png"/>
+                            <img ng-if="invoice.kind == 1206" src="static/img/user/images/ticket01.jpg"/>
+                            <img ng-if="invoice.kind == 1205" src="static/img/user/images/ticket02.jpg"/>
+                        </span>
+                        <span ng-cloak class="textmore" title="{{invoice.head}}">{{invoice.head}}</span>
+                        <span class="wd01 textmore" ng-cloak title="{{invoice.name}}">{{invoice.name}}</span>
+                        <span class="textmore" ng-cloak title="{{invoice.area+','+invoice.detailAddress}}">{{invoice.area}} {{invoice.detailAddress}}</span>
+                        <span ng-cloak title="{{invoice.telephone}}">{{invoice.telephone}}</span>
+                        <span>
+                            <!--<a  class="look" ng-click="viewInvoice(invoice)">查看/</a>-->
+                            <a  ng-click="modifyInvoice(invoice)">修改</a> |
+                            <a  ng-click="deleteInvoice(invoice)">删除</a>
                         </span>
-                        <span ng-cloak class="textmore">{{invoice.head}}</span>
-                        <span class="wd01 textmore" ng-cloak>{{invoice.name}}</span>
-                        <span class="textmore" ng-cloak>{{invoice.area}} {{invoice.detailAddress}}</span>
-                        <span ng-cloak>{{invoice.telephone}}</span>
-                        <span><a  class="look" ng-click="viewInvoice(invoice)">查看/</a><a  ng-click="modifyInvoice(invoice)">修改/</a><a  ng-click="deleteInvoice(invoice)">删除</a></span>
                     </dd>
-                    <dd ng-if="invoices.length == 0" class="text-center" style="font-size: 14px;line-height: 60px;">
-                        暂无发票信息,请补充发票信息
+                    <dd ng-if="invoices.length == 0 || !invoices" class="text-center invoice-box" style="font-size: 12px;line-height: 200px;height: 200px; border: none!important;">
+                        <img src="static/img/all/empty-cart.png">
+                        <span style="width: auto;float: right;line-height: 200px;color: #999;position: relative;right: 400px;font-size: 12px">暂无开票信息</span>
                     </dd>
                 </dl>
             </div>
-            <div id="add-invoice">
-                <h2 class="add-invoice-title">新增开票信息</h2>
-                <div class="row invoice-type">
-                    <label class="col-md-2" style="padding: 15px 0 15px 2.5em;"><b class="text-inverse">*</b>发票类型:</label>
-                    <div class="col-md-9">
-                        <label class="radio-inline"><input type="radio" ng-model="bill.kind" value="1206" ng-checked="bill.kind==1206">增值税普票(不可抵扣)</label>
-                        <label class="radio-inline"><input type="radio" ng-model="bill.kind" value="1205" ng-checked="bill.kind==1205">增值税专票(可抵扣)</label>
+        </div>
+        <!--新增发票 -->
+        <div id="bill-info" ng-if="changeBillStatusFlag">
+            <div class="row">
+                <h2 class="content-header"  ng-bind="billType == 1205?'增值税专票':'增值税普票'"></h2>
+            </div>
+            <div class="form-area">
+                <div class="row" ng-if="isAdd">
+                    <label class="col-md-2 normal-control-label"><b class="text-inverse">*</b>发票类型:</label>
+                    <div class="radio col-md-10">
+                      <!--  <label class="radio-inline">
+                            <label class="padding-top-5"><input type="radio" ng-click="setBillType(1206)" ng-model="billType" value="1206" ng-disabled="!isNormal"></label>
+                            <label ng-class="{'disable':!isNormal, '':isNormal}" class="padding-left-0">增值税普通发票(不可抵扣)</label>
+                        </label>
+                        <label class="radio-inline">
+                            <label class="padding-top-5"><input type="radio" ng-click="setBillType(1205)" ng-model="billType" value="1205" ng-disabled="!isSpecial"></label>
+                            <label ng-class="{'disable':!isSpecial, '':isSpecial}" class="padding-left-0">增值税专用发票(可抵扣) </label>
+                        </label>-->
+                        <label for="1206" class="radio-inline radioLabel" ng-class="{'cursor-not-allowed':!isNormal}">
+                            <input type="radio" name="bill" value="1206" ng-disabled="!isNormal" ng-click="setBillType(1206)" ng-model="billType" id="1206">
+                            <label ng-class="{'cursor-not-allowed':!isNormal}" for="1206" class="txtContact"></label>
+                            <span ng-class="{'disable':!isNormal, '':isNormal}">增值税普票(不可抵扣)</span>
+                        </label>
+                        <label for="1205" class="radio-inline radioLabel" ng-class="{'cursor-not-allowed':!isSpecial}">
+                            <input type="radio" name="bill" value="1205" ng-disabled="!isSpecial" ng-click="setBillType(1205)" ng-model="billType" id="1205">
+                            <label ng-class="{'cursor-not-allowed':!isSpecial}" for="1205" class="txtContact"></label>
+                            <span ng-class="{'disable':!isSpecial, '':isSpecial}">增值税专票(可抵扣)</span>
+                        </label>
                     </div>
                 </div>
-                <form class="add-invoice-form form-horizontal" novalidate="novalidate" name="form" ng-if="bill.kind==1206">
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>发票抬头:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.head" name="billHead" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.head||form.billHead.$touched)&&form.billHead.$invalid">必填项</div>
-                    </div>
+                <form class="form-horizontal" novalidate="novalidate" name="form">
                     <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票人:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.name" name="billName" ng-change="linkmanLen()" id="pbillname"  required="required">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>发票抬头:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.head" ng-focus="form.billHead.$touched = false" ng-blur="form.billHead.$touched = true; checkBillHead()" name="billHead" required="required" placeholder="请输入发票抬头">
                         </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="form.billName.$dirty && linkError">请勿超过10个字</span>
-                            <span ng-show="(bill.name||form.billName.$touched)&&form.billName.$invalid">必填项</span>
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票人联系电话:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.telephone" name="billTel"
-                                   ng-pattern="/^((\(\d{3}\))|(\d{3}\\-))?(13|15|17|18)\d{9}$/" ng-length="11" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.telephone||form.billTel.$touched)&&form.billTel.$invalid">请输入正确的手机号码</div>
+                        <div class="text-inverse error col-md-3" ng-show="form.billHead.$touched&&(form.billHead.$invalid || !validForm.validBillHead)" ng-bind="form.billHead.$error.required?'请填写发票抬头':'请勿超过50个字'"></div>
                     </div>
-                    <div class="form-group">
-                        <label for="landlineNum" class="col-md-2"><b class="text-inverse">*</b>座机号码:</label>
-                        <div class="col-md-5">
-                            <input type="text" ng-model="bill.landlineNumber" required class="form-control" id="landlineNum" name="landlineNumber" placeholder="请输入你的办公号码" ng-pattern="/^[0-9]{2,4}[\-\+]?[0-9]{6,8}$/">
-                        </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="(bill.landlineNumber || form.landlineNumber.$touched) && form.landlineNumber.$invalid" class="format-error">请输入正确的座机号</span>
+                    <div class="form-group" ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位地址:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.companyAddress" ng-focus="form.companyAddr.$touched = false" ng-blur="form.companyAddr.$touched = true; checkCompanyAddress()" name="companyAddr" required="required" placeholder="请输入单位地址">
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.companyAddr.$touched&&(form.companyAddr.$invalid || !validForm.validCompanyAddress)" ng-bind="form.companyAddr.$error.required?'请填写单位地址':'请勿超过50个字'"></div>
                     </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票地址:</label>
-                        <div class="mar-rt0 row checkbox">
-                            <div class="col-md-2">
-                                <select class="select-adder form-control"
-                                        ng-model="bill.address.province" name="province"
-                                        ng-options="key as key for (key,value) in division"
-                                        ng-change="bill.address.city='';bill.address.district='';">
-                                    <option value="">省</option>
-                                </select>
-                            </div>
-                            <div class="col-md-2">
-                                <select class="select-adder form-control" ng-model="bill.address.city" name="city"
-                                        ng-options="key as key for (key,value) in division[bill.address.province]"
-                                        ng-change="bill.address.district='';">
-                                    <option value="">市</option>
-                                </select>
-                            </div>
-                            <div class="col-md-2">
-                                <select class="select-adder form-control" ng-model="bill.address.district" name="district"
-                                        ng-options="value as value for value in division[bill.address.province][bill.address.city]" required="required">
-                                    <option value="">区</option>
-                                </select>
-                            </div>
+                    <div class="form-group"  ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位电话:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.companyPhone.$touched&&form.companyPhone.$invalid" ng-bind="form.companyPhone.$error.required?'请填写单位电话':form.companyPhone.$error.maxlength?'请勿超过20个字符':'请填写正确的电话号码,用-隔开'"></div>
                     </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票详细地址:</label>
-                        <div class="col-md-5">
-                            <input id="paddress" type="text" class="form-control" ng-model="bill.detailAddress" ng-change="addressLen()" name="billDetail" required="required" >
-                        </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="form.billName.$dirty && addressError">请勿超过30个字</span>
-                            <span ng-show="(bill.detailAddress||form.billDetail.$touched)&&form.billDetail.$invalid">必填项</span>
+                    <div class="form-group"  ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>税务登记号:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.companyTaxNum.$touched&&(form.companyTaxNum.$invalid)" ng-bind="form.companyTaxNum.$error.required?'请填写税务登记号':'请填写15-20位数字或字母'"></div>
                     </div>
-                    <div class="form-group">
-                        <label class="col-md-2"></label>
-                        <div class="col-md-5" style="line-height: 20px;">
-                            <label class="check-active checkbox-inline text-inverse" style="padding-left: 20px;">
-                                <input type="checkbox" checked="true" name="is_agree" ng-model="bill.is_agree" required="required"  id="check-py"/>
-                                <label for="check-py"></label>
-                                <span>我已阅读并同意</span>
-                            </label>
-                            <a href="help/helpList/19" class="base-line" target="_blank">《发票须知》</a>
+                    <div class="form-group"  ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.bankName" ng-focus="form.bankName.$touched = false" ng-blur="form.bankName.$touched = true; checkBankName()" name="bankName" required="required" placeholder="请输入开户银行">
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.bankName.$touched&&(form.bankName.$invalid || !validForm.validBankName)" ng-bind="form.bankName.$error.required?'请填写开户银行':'请勿超过30个字'"></div>
                     </div>
-                    <div class="col-md-offset-3">
-                        <input type="submit" value="保存发票信息" class="btn btn-warning" ng-disabled="form.$invalid||(!bill.is_agree)||linkError||addressError" ng-click="saveInvoice()">
-                        <input type="button" value="取消修改" class="btn btn-warning" ng-show="isRevice" ng-click="exit()">
-                    </div>
-                </form>
-                <form class="add-invoice-form form-horizontal" novalidate="novalidate" name="form" ng-if="bill.kind==1205">
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>发票抬头:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.head" name="billHead" required="required">
+                    <div class="form-group"  ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行账户:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.bankAccount" name="account" ng-focus="form.account.$touched = false" ng-blur="form.account.$touched = true" ng-pattern="/^[0-9]*$/" required ng-maxlength="30" placeholder="请输入开户银行账号">
                         </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.head||form.billHead.$touched)&&form.billHead.$invalid">必填项</div>
+                        <div class="text-inverse error col-md-3" ng-show="form.account.$touched&&(form.account.$invalid)" ng-bind="form.account.$error.required?'请填写开户银行账号':'请填写30位以内的数字'"></div>
                     </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票人:</label>
-                        <div class="col-md-5">
-                            <input type="text" id="zbillname" class="form-control" ng-model="bill.name" name="billName" ng-change="linkmanLen()" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="form.billName.$dirty && linkError">请勿超过10个字</span>
-                            <span ng-show="(bill.name||form.billName.$touched)&&form.billName.$invalid">必填项</span>
+                    <div class="form-group"  ng-if="billType == 1205">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>上传开户许可证:{{form.permissionUpload}}</label>
+                        <div class="form-input-line file-line">
+                            <input type="text" name="permission" required class="form-control" ng-model="bill.attachUrl" readonly style="background: #fff">
                         </div>
+                        <div class="col-md-1">
+                            <label class="select-file-box">
+                                <span>选择文件</span>
+                                <input class="input-file-default" type="file" ng-file-select ng-model="bill.billInfo" ng-change="onUploadPermission()" ng-multiple="false" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg,application/pdf,*.pdf">
+                            </label></div>
+                        <div class="text-inverse error col-md-3" ng-show="isDoUpload&&(form.permission.$error.required)">请勿超过3M</div>
                     </div>
                     <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票人联系电话:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.telephone" name="billTel"
-                                   ng-pattern="/^((\(\d{3}\))|(\d{3}\\-))?(13|15|17|18)\d{9}$/" ng-length="11" required="required">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>收票人:</label>
+                        <div class="form-input-line">
+                            <input id="mzbillname" type="text" class="form-control" ng-focus="form.billName.$touched = false" ng-blur="form.billName.$touched = true; checkBillName()" ng-model="bill.name" name="billName" required="required" placeholder="请输入收票人">
                         </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.telephone || form.billTel.$touched)&&form.billTel.$invalid">输入正确的联系方式</div>
+                        <div class="text-inverse error col-md-3" ng-show="form.billName.$touched&&(form.billName.$invalid || !validForm.validBillName)" ng-bind="form.billName.$error.required?'请填写收票人姓名':'请勿超过10个字'"></div>
                     </div>
                     <div class="form-group">
-                        <label for="landlineNumber" class="col-md-2"><b class="text-inverse">*</b>座机号码:</label>
-                        <div class="col-md-5">
-                            <input type="text" ng-model="bill.landlineNumber" required class="form-control" id="landlineNumber" name="landlineNumber" placeholder="请输入你的办公号码" ng-pattern="/^[0-9]{2,4}[\-\+]?[0-9]{6,8}$/">
-                        </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="(bill.landlineNumber || form.landlineNumber.$touched) && form.landlineNumber.$invalid" class="format-error">请输入正确的座机号</span>
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
+                        <div class="form-input-line">
+                            <input type="text" class="form-control" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true" name="billTel"
+                                   ng-pattern="/^[0-9]*$/" ng-maxlength="11" ng-minlength="8" required="required" placeholder="请输入联系电话">
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-11位数字'"></div>
                     </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票地址:</label>
-                        <div class="mar-rt0 row checkbox">
-                            <div class="col-md-2">
+                    <div class="form-group address">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>所在地区:</label>
+                        <div class="row checkbox">
+                            <div class="form-input-line" style="width: 160px">
                                 <select required="required" class="select-adder form-control"
                                         ng-model="bill.address.province" name="province"
                                         ng-options="key as key for (key,value) in division"
@@ -242,14 +602,14 @@
                                     <option value="">省</option>
                                 </select>
                             </div>
-                            <div class="col-md-2">
+                            <div class="form-input-line" style="width: 160px">
                                 <select class="select-adder form-control" ng-model="bill.address.city" name="city"
                                         ng-options="key as key for (key,value) in division[bill.address.province]"
                                         ng-change="bill.address.district='';" required="required">
                                     <option value="">市</option>
                                 </select>
                             </div>
-                            <div class="col-md-2">
+                            <div class="form-input-line" style="width: 160px">
                                 <select class="select-adder form-control" ng-model="bill.address.district" name="district"
                                         ng-options="value as value for value in division[bill.address.province][bill.address.city]" required="required">
                                     <option value="">区</option>
@@ -258,140 +618,42 @@
                         </div>
                     </div>
                     <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>收票详细地址:</label>
-                        <div class="col-md-5">
-                            <input type="text" id="zaddress" class="form-control" required="required" name="billDetail" ng-model="bill.detailAddress" ng-change="addressLen()">
-                        </div>
-                        <div class="text-inverse error col-md-2">
-                            <span ng-show="form.billName.$dirty && addressError">请勿超过30个字</span>
-                            <span ng-show="(bill.detailAddress||form.billDetail.$touched)&&form.billDetail.$invalid">必填项</span>
-                        </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>单位地址:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.companyAddress" name="companyAddr" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.companyAddress||form.companyAddr.$touched)&&form.companyAddr.$invalid">必填项</div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>单位电话:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.companyPhone||form.companyPhone.$touched)&&form.companyPhone.$invalid">输入正确的电话</div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>税务登记号:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.companyTaxNumber" name="companyTaxNum" required="true" ng-minlength="15">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.companyTaxNumber||form.companyTaxNum.$touched)&&(form.companyTaxNum.$error.required||form.companyTaxNum.$error.minlength)">至少15位数字</div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>开户银行:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.bankName" name="bankName" required="required">
-                        </div>
-                        <div class="text-inverse error col-md-2" ng-show="(bill.bankName||form.bankName.$touched)&&form.bankName.$invalid">必填项</div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"><b class="text-inverse">*</b>开户银行账户:</label>
-                        <div class="col-md-5">
-                            <input type="text" class="form-control" ng-model="bill.bankAccount" name="account" ng-pattern="/^[0-9]*$/" required="required" minlength="8" maxlength="30">
-                        </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.bankAccount||form.account.$touched)&&(form.account.$invalid)">输入正确的银行卡账号</div>
-                    </div>
-                    <div class="form-group" ng-show="!bill.attachUrl || billInfoRevise">
-                        <label class="col-md-2" for="exampleInputFile">上传开票资料:</label>
-                        <div class="col-md-5">
-                            <input class="form-control" type="file" ng-file-select ng-model="bill.billInfo" name="billInfo" id="InputFile" ng-multiple="false" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg,application/pdf,*.pdf">
+                        <label class="col-md-2 control-label"><b class="text-inverse">*</b>详细地址:</label>
+                        <div class="form-input-line" style="width: 502px">
+                            <input id="mzaddress" type="text" class="form-control" required="required" name="billDetail" ng-model="bill.detailAddress" title="建议您填写详细发件地址,如街道名,门牌号,楼层和房间号等信息"
+                            placeholder="建议您填写详细发件地址,如街道名,门牌号,楼层和房间号等信息" ng-focus="form.billDetail.$touched = false" ng-blur="form.billDetail.$touched = true; checkDetailAddress()" >
                         </div>
+                        <div class="text-inverse error col-md-3" ng-show="form.billDetail.$touched&&(form.billDetail.$invalid|| !validForm.validDetailAddress)" ng-bind="form.billDetail.$error.required?'请填写详细地址':'请勿超过30个字'"></div>
                     </div>
-                    <div class="form-group" ng-show="bill.attachUrl&&!billInfoRevise">
-                        <label class="col-md-2" for="exampleInputFile">开票资料:</label>
-                        <div class="col-md-5 height-34">
-                            <a href="{{bill.attachUrl}}" target="_blank">点击查看</a>&nbsp;<a class="a-background" ng-click="billInfoRevise=true;">修改</a>
+                    <div class="form-bottom">
+                        <div class="form-group">
+                                <label class="check-active checkbox-inline text-inverse">
+                                    <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" id="check-mzy">
+                                    <label for="check-mzy" style="position: relative;bottom: 2px;"></label>
+                                    <span style="color: #333;">我已阅读并同意</span>
+                                </label>
+                                <a href="help#/nav/19" target="_blank" style="color: #5078cb; font-size: 14px; position: relative;top: 2px;">《发票须知》</a>
                         </div>
-                    </div>
-                    <div class="form-group">
-                        <label class="col-md-2"></label>
-                        <div class="col-md-5">
-                            <label class="check-active check-inline text-inverse" style="padding-left: 0;">
-                                <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" required="" id="check-zy">
-                                <label for="check-zy"></label>
-                                <span>我已阅读并同意</span>
-                            </label>
-                            <a href="help/helpList/19" target="_blank">《发票须知》</a>
+                        <div class="form-btn">
+                            <input type="button" value="取消" class="btn" ng-click="setChangeBillStatusFlag(false)">
+                            <input type="submit" value="保存" class="btn"
+                                   ng-click="saveBill(form.$invalid)">
                         </div>
                     </div>
-                    <div class="col-md-offset-3">
-                        <input type="submit" value="保存发票信息" class="btn btn-warning" ng-disabled="form.$invalid||(!bill.is_agree)||linkError||addressError" ng-click="saveInvoice()">
-                        <input type="button" value="取消修改" class="btn btn-warning" ng-show="isRevice" ng-click="exit()">
-                    </div>
                 </form>
             </div>
-            <!-- 开票记录-->
-            <div class="tab">
-                <dl>
-                    <dt>
-                        <span>发票类型</span>
-                        <span>开票抬头</span>
-                        <span>开票金额</span>
-                        <span>产品订单号</span>
-                        <span>收票人</span>
-                        <span>状态</span>
-                    </dt>
-                    <p class="height16">&nbsp;</p>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket01.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>开票中</em></span>
-                    </dd>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket02.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>运输中</em></span>
-                    </dd>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket01.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>开票中</em></span>
-                    </dd>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket02.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>运输中</em></span>
-                    </dd>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket01.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>开票中</em></span>
-                    </dd>
-                    <dd>
-                        <span><img src="static/img/user/images/ticket02.png"/> </span>
-                        <span>折扣卷</span>
-                        <span>¥8888.52</span>
-                        <span><em>20170116001</em></span>
-                        <span>王某某</span>
-                        <span><em>运输中</em></span>
-                    </dd>
-                </dl>
+        </div>
+        <!-- 提示框 -->
+        <div class="com-del-box" ng-if="showDeleteBox">
+            <div class="title">
+                <a ng-click="setDeleteBox(false)"><i class="fa fa-close fa-lg"></i></a>
+            </div>
+            <div class="content">
+                <p><i class="fa fa-exclamation-circle"></i>是否要删除此发票?</p>
+                <div>
+                    <a ng-click="setDeleteBox(false)">取消</a>
+                    <a ng-click="doDeleteInvoice()">确认</a>
+                </div>
             </div>
         </div>
     </div>

+ 203 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice_record.html

@@ -0,0 +1,203 @@
+<style>
+    /*未开票*/
+    .invoice-record{
+        width: 100%;
+        margin: 0 auto;
+        background: #fff;
+        margin-top: 16px;
+        display: inline-block;
+    }
+    .invoice-record-content{
+        width: 1000px;
+        margin: 0 auto;
+        margin-top: 16px;
+    }
+    .invoice-com-tab{
+        box-sizing: border-box;
+        border: #dae5fd 1px solid;
+        border-bottom: none;
+        margin-bottom: 0!important;
+    }
+    .invoice-com-tab thead{
+        height: 40px;
+        width: 100%;
+        background: #89aefa;
+    }
+    .invoice-com-tab thead>tr th{
+        color: #fff;
+        font-weight: normal;
+        font-size: 14px;
+        text-align: center;
+        border-bottom: none;
+        vertical-align: middle;
+    }
+    .invoice-com-tab tbody tr:hover{
+        background: #f1f5ff;
+    }
+    .invoice-com-tab tbody>tr>td{
+        font-size: 14px;
+        color: #666;
+        border-bottom: 1px solid #dae5fd;
+        border-right: 1px solid #dae5fd;
+        height: 50px;
+        vertical-align: middle;
+        text-align: center;
+    }
+    .invoice-com-tab thead>tr>th.select-line{
+        padding: 8px 0;
+    }
+    .invoice-com-tab thead>tr>th .form-control{
+        color: #666;
+        padding: 0 5px;
+        height: 24px;
+        width: 52px;
+        opacity: 1;
+        border: #fff 1px solid;
+        border-radius: 2px;
+        position: relative;
+        left: 10px;
+    }
+    /*无记录与记录条数*/
+    .table>tbody>tr.record-num td{
+        padding: 0;
+        border: none;
+        text-align: right;
+        font-size: 12px;
+        padding-right: 10px;
+        border-right: #fff 1px solid;
+        border-left: #fff 1px solid;
+    }
+    .table>tbody>tr.record-num:hover{
+        background: none;
+    }
+    .table>tbody+tbody{
+        border-top: 0;
+    }
+    .table>tbody+tbody.no-record-list tr td{
+        border: none;
+    }
+    .blue{
+        color: #5078cb !important;
+    }
+    .select-adder {
+        background: url(static/img/user/images/xiala.png) right no-repeat #fff !important;
+        background-position-x: 116% !important;
+    }
+    .invoice-search{
+        width: 100%;
+        margin: 0 auto;
+        background: #f5f8fe;
+        height: 40px;
+        margin-top: 5px;
+    }
+    .invoice-search div.fr{
+        width: 388px;
+        margin-top: 3px;
+        margin-right: 14px;
+    }
+    .invoice-search input.form-control{
+        width: 330px;
+        height: 32px;
+        line-height: 32px;
+        font-size: 12px;
+        border-radius: 0;
+        border: #5078cb 1px solid;
+        background: #fff;
+        float: left;
+    }
+    .invoice-search button{
+        border: none;
+        width: 58px;
+        height: 32px;
+        background: #5078cb;
+        text-align: center;
+        font-size: 14px;
+        color: #fff;
+        float: right;
+    }
+    body div.ng-table-pager a.page-a {
+        float: right;
+        background: #5078cb!important;
+    }
+    .ng-table-pagination .page-a:hover {
+        background: #5078cb!important;
+    }
+</style>
+<!--右侧主体部分-->
+<div class="user_right fr u_c_invoice">
+    <!--开票记录-->
+    <div class="ticket_record oder">
+        <div class="oder01">
+            <ul>
+                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">开票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
+            </ul>
+        </div>
+        <!--开票记录-->
+        <div class="invoice-record">
+            <div class="invoice-search">
+                <div class="fr">
+                    <input type="text" ng-keydown="enterEvent($event)" class="form-control" ng-model="keyword" placeholder="商家名称/订单号/发票抬头/收票人/联系电话"/>
+                    <button ng-click="searchByKey()">搜索</button>
+                </div>
+            </div>
+            <div class="invoice-record-content">
+                <table class="invoice-com-tab table" ng-table="billRecordTableParam">
+                    <thead>
+                        <tr>
+                            <th width="88">申请时间</th>
+                            <th width="130">商家名称</th>
+                            <th width="80">订单号</th>
+                            <th width="105">可开票金额(¥)</th>
+                            <th width="55" class="select-line">
+                                <select class="select-adder form-control" ng-model="invoiceType" ng-change="changeInvoiceType(invoiceType)">
+                                    <option value="">类型</option>
+                                    <option value="1206">普票</option>
+                                    <option value="1205">专票</option>
+                                </select>
+                            </th>
+                            <th width="100">发票抬头</th>
+                            <th width="50">收票人</th>
+                            <th width="55">联系电话</th>
+                            <th width="55">
+                                <select class="select-adder form-control" style="width: 60px;" ng-model="status" ng-change="changeStatus(status)">
+                                    <option value="">状态</option>
+                                    <option value="101">待开票</option>
+                                    <option value="102">已开票</option>
+                                </select>
+                            </th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr ng-repeat="item in billData">
+                            <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
+                            <td ng-bind="item.sellername"></td>
+                            <td>
+                                <span style="display: block" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid"></span>
+                            </td>
+                            <td ng-bind="item.price"></td>
+                            <td ng-bind="item.invoicetype==1206?'普票':'专票'"></td>
+                            <td ng-bind="item.invoicetitle"></td>
+                            <td ng-bind="item.receiverName"></td>
+                            <td ng-bind="item.recTel"></td>
+                            <td>
+                                <span ng-bind="item.status==101?'待开票':'已开票'" ng-class="{'blue':item.status==101}"></span>
+                            </td>
+                        </tr>
+                        <tr class="record-num" ng-if="billData.length > 0">
+                            <td colspan="10">
+                                <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements"></span> 条</span>
+                            </td>
+                        </tr>
+                    </tbody>
+                    <tbody class="no-record-list" ng-if="billData.length <= 0 || !billData">
+                    <tr class="height200">
+                    <td colspan="9" style="border: #fff 1px solid"><img src="static/img/all/empty-cart.png"><span>暂无开票记录</span></td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>

+ 229 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html

@@ -0,0 +1,229 @@
+<style>
+/*未开票*/
+    .no-invoice{
+        width: 100%;
+        margin: 0 auto;
+        background: #fff;
+        margin-top: 16px;
+        display: inline-block;
+    }
+    .no-invoice-tip{
+        width: 1000px;
+        height: 142px;
+        margin: 0 auto;
+        background: #f5f8fe;
+        padding: 8px 30px;
+        margin-top: 20px;
+    }
+    .no-invoice-tip p{
+        font-size: 12px;
+        color: #666;
+        line-height: 25px;
+    }
+    .no-invoice-tip p:nth-of-type(2){
+        color: #333;
+    }
+.no-invoice-tip p strong{
+    font-weight: bold;
+}
+.no-invoice-content{
+    width: 1000px;
+    margin: 0 auto;
+}
+.invoice-com-tab{
+    box-sizing: border-box;
+    border: #dae5fd 1px solid;
+    border-bottom: none!important;
+}
+.invoice-com-tab thead{
+    height: 40px;
+    width: 100%;
+    background: #89aefa;
+}
+.invoice-com-tab thead>tr th{
+    color: #fff;
+    font-weight: normal;
+    font-size: 14px;
+    text-align: center;
+    border-bottom: none;
+    vertical-align: middle;
+}
+.invoice-com-tab tbody tr:hover{
+    background: #f1f5ff;
+}
+.invoice-com-tab tbody>tr>td{
+    font-size: 14px;
+    color: #666;
+    border-bottom: 1px solid #dae5fd;
+    border-right: 1px solid #dae5fd;
+    height: 40px;
+    vertical-align: middle;
+    text-align: center;
+}
+/*无记录与记录条数*/
+.table>tbody>tr.record-num td{
+    padding: 0;
+    border: none;
+    text-align: right;
+    font-size: 12px;
+    padding-right: 10px;
+    border-right: #fff 1px solid;
+    border-left: #fff 1px solid;
+}
+.table>tbody>tr.record-num:hover{
+    background: none;
+}
+.table>tbody+tbody{
+    border-top: 0;
+}
+.table>tbody+tbody.no-record-list tr td{
+    border: none;
+}
+    /*全选*/
+.table .check-act input{
+    display: none;
+}
+.table .check-act label{
+    width: 12px;
+    height: 12px;
+    display: inline-block;
+    background: url(static/img/icon/check-rule.png) no-repeat;
+    position: relative;
+    top: 7px;
+}
+.table .check-act label{
+    background-position: -48px 0;
+}
+.table .check-act input:checked + label{
+    background-position: -31px 0;
+}
+.apply-btn{
+    width: 100%;
+    margin: 0 auto;
+    text-align: center;
+    margin: 30px 0;
+}
+.apply-btn button{
+    width: 80px;
+    height: 26px;
+    line-height: 26px;
+    text-align: center;
+    font-size: 14px;
+    color: #fff;
+    background: #5078cb;
+    border: none;
+}
+.invoice-search{
+    width: 1000px;
+    margin: 0 auto;
+    background: #f5f8fe;
+    height: 40px;
+    margin-top: 16px;
+}
+.invoice-search div.fr{
+    width: 388px;
+    margin-top: 3px;
+    margin-right: 14px;
+}
+.invoice-search input.form-control{
+    width: 330px;
+    height: 32px;
+    line-height: 32px;
+    font-size: 12px;
+    border-radius: 0;
+    border: #5078cb 1px solid;
+    background: #fff;
+    float: left;
+}
+.invoice-search button{
+    border: none;
+    width: 58px;
+    height: 32px;
+    background: #5078cb;
+    text-align: center;
+    font-size: 14px;
+    color: #fff;
+    float: right;
+}
+body div.ng-table-pager a.page-a {
+    float: right;
+    background: #5078cb!important;
+}
+.ng-table-pagination .page-a:hover {
+    background: #5078cb!important;
+}
+</style>
+<!--右侧主体部分-->
+<div class="user_right fr u_c_invoice">
+    <!--开票记录-->
+    <div class="ticket_record oder">
+        <div class="oder01">
+            <ul>
+                <li ng-class="{'active': tab == 'buyer_invoice'}"><a ui-sref="buyer_invoice">开票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
+            </ul>
+        </div>
+        <!--未开票-->
+        <div class="no-invoice">
+            <div class="no-invoice-tip">
+                <p>温馨提示:</p>
+                <p>1、申请发票时默认将同一店铺的订单合并开一张发票,如需分开开票,请分别提交申请 ;</p>
+                <p>2、您只能对订单状态为<strong>“交易成功”</strong>,且已不能再发起售后的人民币交易订单进行补开发票;</p>
+                <p>3、发票金额为产品总金额且不含运费、积分、优惠券、促销折扣等金额 ;</p>
+                <p>4、发票邮寄费用将由卖家承担。</p>
+            </div>
+            <div class="invoice-search">
+                <div class="fr">
+                    <input type="text" ng-keydown="enterEvent($event)" class="form-control" ng-model="keyword" placeholder="商家名称/订单号"/>
+                    <button ng-click="searchByKeyword()">搜索</button>
+                </div>
+            </div>
+            <div class="no-invoice-content">
+                <table class="invoice-com-tab table" ng-table="orderBillTableParam">
+                    <thead>
+                        <tr>
+                            <th width="80">
+                                <lable class="check-act">
+                                    <input type="checkbox" id="checkAll" ng-disabled="!orderData || orderData.length == 0" ng-click="onAllChecked()" ng-checked="isAllCheck"/>
+                                    <label for="checkAll"></label>
+                                </lable>
+                                全选</th>
+                            <th width="120">商家名称</th>
+                            <th width="250">订单号</th>
+                            <th width="200">可开票金额(¥)</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr ng-repeat="item in orderData track by $index">
+                            <td>
+                                <lable class="check-act">
+                                    <input type="checkbox" id={{$index+1}} ng-checked="item.checked" ng-click="checkInvoice(item)" />
+                                    <label for={{$index+1}}></label>
+                                </lable>
+                            </td>
+                            <td ng-bind="item.storeName"></td>
+                            <td>
+                                <span style="display: block" ng-repeat="orderid in item.orderid.split(',')" ng-bind="orderid"></span>
+                            </td>
+                            <td ng-bind="item.price"></td>
+                        </tr>
+                        <tr class="record-num" ng-if="orderData.length > 0">
+                            <td colspan="4">
+                                <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements"></span> 条</span>
+                            </td>
+                        </tr>
+                    </tbody>
+                    <tbody class="no-record-list" ng-if="orderData.length <= 0 || !orderData">
+                        <tr class="height200">
+                            <td colspan="4" style="border: #fff 1px solid"><img src="static/img/all/empty-cart.png"><span>暂无未开票订单</span></td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+            <div class="apply-btn" ng-style="$$kdnData.totalElements>10?'margin-top: 100px':''" ng-if="orderData.length > 0">
+                <button ng-click="applyInvoice()">申请开票</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/left_nav.html

@@ -33,7 +33,7 @@
                     <!--<a href="javascript:void(0)" ui-sref="my_seek_purchase">我的求购</a>-->
                 <!--</li>-->
                 <!--<li ng-class="{'active' : active == 'buyer_logistics'}"><a href="javascript:void(0)" ui-sref="buyer_logistics">物流信息</a></li>-->
-                <li ng-class="{'active' : active == 'buyer_invoice'}"><a href="javascript:void(0)" ui-sref="buyer_invoice">我的发票</a></li>
+                <li ng-class="{'active' : active == 'buyer_invoice'}"><a href="javascript:void(0)" ui-sref="buyer_invoice">发票管理</a></li>
                 <!--<li ng-class="{'active' : active == 'after_sale'}" class="undo">-->
                     <!--<a href="javascript:void(0)" ui-sref="after_sale">申请售后</a>-->
                 <!--</li>-->

+ 213 - 0
src/main/webapp/resources/view/usercenter/modal/apply-invoice.html

@@ -0,0 +1,213 @@
+<style>
+.modal-dialog{
+    width: 590px;
+    border-radius: 5px;
+    overflow: hidden;
+    margin-top: 10%;
+}
+.modal-content{
+    border: none;
+}
+.modal-body{
+    padding: 0;
+}
+.apply-content{
+    width: 100%;
+    margin: 0 auto;
+    background: #fff;
+    padding-bottom: 22px;
+}
+.apply-content .head{
+    width: 100%;
+    height: 30px;
+    margin: 0 auto;
+    line-height: 30px;
+    color: #333;
+    position: relative;
+    text-align: center;
+    font-weight: bold;
+    font-size: 14px;
+}
+.apply-content .head a{
+    position: absolute;
+    right: 6px;
+    top: -2px;
+    font-size: 16px;
+    color: #b7b4b4;
+    font-weight: bold;
+}
+.apply-content .table{
+    width: 100%;
+    margin: 0 auto;
+    max-height: 130px;
+    overflow-y: auto;
+}
+.apply-content .table .row{
+    height: 26px;
+    line-height: 26px;
+    font-size: 12px;
+    color: #666;
+    background: #f8f8f8;
+    margin: 0;
+}
+.apply-content .table .row:nth-child(even){
+    background: #f2f2f2;
+}
+.apply-content .table .row .col-md-8{
+    padding-left: 54px;
+}
+.apply-content .table .row .col-md-4{
+    padding-left: 15px;
+}
+.apply-content .table .row em{
+    font-weight: bold;
+}
+.apply-content .count{
+    width: 100%;
+    margin: 0 auto;
+    height: 35px;
+    line-height: 35px;
+    background: #eceaea;
+    text-align: right;
+    padding-right: 20px;
+    font-size: 14px;
+}
+.apply-content .count em{
+    margin: 0 3px;
+}
+.apply-content .count .red{
+    font-weight: bold;
+}
+/*全选*/
+.apply-content .check-act input{
+    display: none;
+}
+.apply-content .check-act label{
+    width: 12px;
+    height: 12px;
+    display: inline-block;
+    background: url(static/img/icon/check-rule.png) no-repeat;
+    position: relative;
+    top: 0;
+}
+.apply-content .check-act label{
+    background-position: 0 0;
+}
+.apply-content .check-act input:checked + label{
+    background-position: -15px 0;
+}
+.apply-list{
+    margin-top: 10px;
+}
+.apply-list .row{
+    font-size: 14px;
+    color: #666;
+    line-height: 26px;
+}
+.apply-list .row .col-md-4{
+    text-align: right;
+    width: 140px;
+}
+.apply-list .row .col-md-8{
+    margin-left: 8px;
+}
+.deal-btn{
+    width: 100%;
+    margin: 0 auto;
+    text-align: center;
+    margin-top: 10px;
+}
+.deal-btn a{
+    width: 60px;
+    height: 26px;
+    display: inline-block;
+    text-align: center;
+    line-height: 26px;
+    font-size: 14px;
+}
+.deal-btn a.off{
+    background: #cdcccc;
+    color: #666;
+    margin-right: 8px;
+}
+.deal-btn a.ok{
+    background: #5078cb;
+    color: #fff;
+}
+.deal-btn a:hover{
+    background: #337ab7;
+    color: #fff;
+}
+.apply-content label{
+        margin-bottom: 0;
+    }
+</style>
+<div class="modal-body">
+    <div class="apply-content">
+        <div class="head">申请开票<a ng-click="closeModal()">&times;</a></div>
+        <div class="table">
+            <div class="row" ng-repeat="item in submitInvoice">
+                <div class="col-md-8" ng-bind="item.storeName"></div>
+                <div class="col-md-4">金额: <em>¥<span ng-bind="item.price"></span></em> </div>
+            </div>
+        </div>
+        <div class="count">共<em class="blue" ng-bind="submitInvoice.length"></em>个商家,<em class="blue" ng-bind="orderCount"></em>个订单,发票金额总计:<em class="red">¥<span ng-bind="allPrice"></span></em>元</div>
+        <div class="apply-list">
+            <div class="row">
+                <div class="col-md-4">发票类型</div>
+                <div class="col-md-8">
+                    <label class="check-act" style="margin-right: 35px;" ng-show="hasNormal">
+                        <input type="radio" name="1" id="1206" ng-checked="invoiceData.kind == 1206" ng-click="getInvoiceData(1206)"/>
+                        <label for="1206"></label>
+                        增值税普票(不可抵扣)
+                    </label>
+                    <label class="check-act" ng-show="hasSpecial">
+                        <input type="radio" name="1" id="1205" ng-checked="invoiceData.kind == 1205" ng-click="getInvoiceData(1205)"/>
+                        <label for="1205"></label>
+                        增值税专票(可抵扣)
+                    </label>
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-md-4">发票抬头</div>
+                <div class="col-md-8" ng-bind="invoiceData.head"></div>
+            </div>
+            <div class="row" ng-if="invoiceData.kind == 1205">
+                <div class="col-md-4">单位地址</div>
+                <div class="col-md-8" ng-bind="invoiceData.companyAddress"></div>
+            </div>
+            <div class="row" ng-if="invoiceData.kind == 1205">
+                <div class="col-md-4">单位电话</div>
+                <div class="col-md-8" ng-bind="invoiceData.companyPhone"></div>
+            </div>
+            <div class="row" ng-if="invoiceData.kind == 1205">
+                <div class="col-md-4">税务登记号</div>
+                <div class="col-md-8" ng-bind="invoiceData.companyTaxNumber"></div>
+            </div>
+            <div class="row" ng-if="invoiceData.kind == 1205">
+                <div class="col-md-4">开户银行</div>
+                <div class="col-md-8" ng-bind="invoiceData.bankName"></div>
+            </div>
+            <div class="row" ng-if="invoiceData.kind == 1205">
+                <div class="col-md-4">开户银行账户</div>
+                <div class="col-md-8" ng-bind="invoiceData.bankAccount"></div>
+            </div>
+            <div class="row">
+                <div class="col-md-4">收票人</div>
+                <div class="col-md-8" ng-bind="invoiceData.name"></div>
+            </div>
+            <div class="row">
+                <div class="col-md-4">联系电话</div>
+                <div class="col-md-8" ng-bind="invoiceData.telephone"></div>
+            </div>
+            <div class="row">
+                <div class="col-md-4">收票地址</div>
+                <div class="col-md-8" ng-bind="invoiceData.area + ',' + invoiceData.detailAddress"></div>
+            </div>
+        </div>
+        <div class="deal-btn">
+            <a ng-click="closeModal()" class="off">取消</a>
+            <a ng-click="apply()" class="ok">确认</a>
+        </div>
+    </div>
+</div>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/pay_center.html

@@ -589,7 +589,7 @@
             <div class="row">
                 <div class="col-md-2"><em class="colorRed">*</em>银行账号:</div>
                 <div class="col-md-8">
-                    <input ng-model="bankInfo.number"  ng-change="validateNumber(bankInfo.number)" class="form-control" type="text" placeholder="" required>
+                    <input ng-model="bankInfo.number" maxlength="30" ng-change="validateNumber(bankInfo.number)" class="form-control" type="text" placeholder="" required>
                 </div>
             </div>
             <div class="row">

+ 413 - 0
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -0,0 +1,413 @@
+<style>
+    /*未开票*/
+    .vendor-invoice{
+        width: 100%;
+        margin: 0 auto;
+        background: #fff;
+        display: inline-block;
+    }
+    .vendor-invoice-tip{
+        width: 1000px;
+        height: 120px;
+        margin: 0 auto;
+        background: #f5f8fe;
+        padding: 8px 30px;
+        margin-top: 20px;
+    }
+    .vendor-invoice-tip p{
+        font-size: 12px;
+        color: #666;
+        line-height: 25px;
+    }
+    .vendor-invoice-tip p:nth-of-type(2){
+        color: #333;
+    }
+    .vendor-invoice-tip p strong{
+        font-weight: bold;
+    }
+    .vendor-invoice-content{
+        width: 1000px;
+        margin: 0 auto;
+    }
+    .invoice-com-tab{
+        box-sizing: border-box;
+        border: #dae5fd 1px solid;
+        border-bottom: none;
+        margin-bottom: 0!important;
+    }
+    .invoice-com-tab thead{
+        height: 40px;
+        width: 100%;
+        background: #89aefa;
+    }
+    .invoice-com-tab thead>tr th{
+        color: #fff;
+        font-weight: normal;
+        font-size: 14px;
+        text-align: center;
+        border-bottom: none;
+        vertical-align: middle;
+    }
+    .invoice-com-tab tbody tr:hover{
+        background: #f1f5ff;
+    }
+    .invoice-com-tab tbody>tr>td{
+        font-size: 14px;
+        color: #666;
+        border-bottom: 1px solid #dae5fd;
+        border-right: 1px solid #dae5fd;
+        height: 40px;
+        vertical-align: middle;
+        text-align: center;
+    }
+    /*无记录与记录条数*/
+    .table>tbody>tr.record-num td{
+        padding: 0;
+        border: none;
+        text-align: right;
+        font-size: 12px;
+        padding-right: 10px;
+        border-right: #fff 1px solid;
+        border-left: #fff 1px solid;
+    }
+    .table>tbody>tr.record-num:hover{
+        background: none;
+    }
+    .table>tbody+tbody{
+        border-top: 0;
+    }
+    .table>tbody+tbody.no-record-list tr td{
+        border: none;
+    }
+    /*全选*/
+    .table .check-act input{
+        display: none;
+    }
+    .table .check-act label{
+        width: 12px;
+        height: 12px;
+        display: inline-block;
+        background: url(static/img/icon/check-rule.png) no-repeat;
+        position: relative;
+        top: 2px;
+    }
+    .table .check-act label{
+        background-position: -48px 0;
+    }
+    .table .check-act input:checked + label{
+        background-position: -31px 0;
+    }
+    .apply-btn{
+        width: 100%;
+        margin: 0 auto;
+        text-align: center;
+        margin: 30px 0;
+    }
+    .apply-btn button{
+        width: 80px;
+        height: 26px;
+        line-height: 26px;
+        text-align: center;
+        font-size: 14px;
+        color: #fff;
+        background: #5078cb;
+        border: none;
+    }
+    .invoice-com-tab thead>tr>th.select-line{
+        padding: 8px 0;
+    }
+    .invoice-com-tab thead>tr>th .form-control{
+        color: #666;
+        padding: 0 2px;
+        height: 24px;
+        width: 52px;
+        opacity: 1;
+        border: #fff 1px solid;
+        border-radius: 2px;
+        position: relative;
+        left: 10px;
+    }
+    .invoice-com-tab thead>tr th,.invoice-com-tab tbody>tr td{
+        padding: 8px 3px;
+    }
+    .invoice-com-tab tbody>tr td.address{
+        text-align: left;
+    }
+    .invoice-com-tab tbody>tr td.address p{
+        font-size: 14px;
+        width: 161px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
+    /*操作确认框*/
+    .com-del-box{
+        position: fixed;
+        z-index: 22;
+        height: 152px;
+        opacity: 1;
+        background-color: white;
+        width: 310px;
+        -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        margin: -155px 0 0 -75px;
+        top: 55%;
+        left: 50%;
+    }
+    .com-del-box .title{
+        height: 30px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 30px;
+    }
+    .com-del-box .title a{
+        color: white;
+        font-size: 16px;
+    }
+    .com-del-box .content{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+    }
+    .com-del-box .content p{
+        line-height: 23px;
+        font-size: 14px;
+        padding-top: 15px;
+    }
+    .com-del-box .content p i{
+        color: #5078cb;
+        font-size: 18px;
+        margin-right: 5px;
+        position: relative;
+        top: 2px;
+    }
+    .com-del-box .content div{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+        margin-top: 15px;
+    }
+    .com-del-box .content div a{
+        width: 55px;
+        height: 26px;
+        line-height: 26px;
+        display: inline-block;
+        text-align: center;
+        font-size: 14px;
+    }
+    .com-del-box .content div a:first-child{
+        background: #b4b5b9;
+        color: #333;
+        margin-right: 10px;
+    }
+    .com-del-box .content div a:last-child{
+        background: #5078cb;
+        color: #fff;
+    }
+    .com-del-box .content div a:hover{
+        background: #3f7ae3;
+        color: #fff;
+    }
+    .invoice-search{
+        width: 1000px;
+        margin: 0 auto;
+        background: #f5f8fe;
+        height: 40px;
+        margin-top: 16px;
+    }
+    .invoice-search div.fr{
+        width: 388px;
+        margin-top: 3px;
+        margin-right: 14px;
+    }
+    .invoice-search input.form-control{
+        width: 330px;
+        height: 32px;
+        line-height: 32px;
+        font-size: 12px;
+        border-radius: 0;
+        border: #5078cb 1px solid;
+        background: #fff;
+        float: left;
+    }
+    .invoice-search button{
+        border: none;
+        width: 58px;
+        height: 32px;
+        background: #5078cb;
+        text-align: center;
+        font-size: 14px;
+        color: #fff;
+        float: right;
+    }
+    body div.ng-table-pager a.page-a {
+        float: right;
+        background: #5078cb!important;
+    }
+    .ng-table-pagination .page-a:hover {
+        background: #5078cb!important;
+    }
+    .vendor-invoice .select-adder {
+        background-position-x: 113%!important;
+    }
+</style>
+<div class="count user_right fr">
+    <div class="count_center">
+        <div class="com_tab">
+            <ul class="fl">
+                <li ng-class="{'active': active == 'apply_invoice'}" ng-click="toggleTab('apply_invoice')"><a>开票申请</a></li>
+                <li ng-class="{'active': active == 'apply_record'}" ng-click="toggleTab('apply_record')"><a>开票记录</a></li>
+            </ul>
+        </div>
+    </div>
+    <!--申请开票-->
+    <div class="vendor-invoice" ng-if="active == 'apply_invoice'">
+        <div class="vendor-invoice-tip">
+            <p>温馨提示:</p>
+            <P>1、买家只能对订单状态为<strong>“交易成功”</strong>,且已不能再发起售后的人民币交易订单进行补开发票。</P>
+            <p>2、发票金额为产品总金额且不含运费、积分、优惠券、促销折扣等金额。</p>
+            <p>3、发票邮寄费用将由卖家承担。</p>
+        </div>
+        <div class="invoice-search">
+            <div class="fr">
+                <input type="text" ng-keydown="enterEvent($event, keyword)"  class="form-control" ng-model="keyword" placeholder="订单号/发票抬头/收票人/联系电话"/>
+                <button ng-click="searchByKey(keyword)">搜索</button>
+            </div>
+        </div>
+        <div class="vendor-invoice-content">
+            <table class="invoice-com-tab table" ng-table="billRecordTableParam">
+                <thead>
+                <tr>
+                    <th width="45">
+                        <lable class="check-act">
+                            <input type="checkbox" id="checkAll" ng-disabled="!billData || billData.length == 0" ng-click="onAllChecked()" ng-checked="isAllCheck" />
+                            <label for="checkAll"></label>
+                        </lable>
+                        全选</th>
+                    <th width="70">申请时间</th>
+                    <th width="90">订单号</th>
+                    <th width="90">开票金额(¥)</th>
+                    <th width="55" class="select-line">
+                        <select class="select-adder form-control" style="position: relative;left: 6px;" ng-change="billTypeSearch(billType)" ng-model="billType">
+                            <option value="1">类型</option>
+                            <option value="2">普票</option>
+                            <option value="3">专票</option>
+                        </select>
+                    </th>
+                    <th width="120">发票抬头</th>
+                    <th width="50">收票人</th>
+                    <th width="160">收票地址</th>
+                    <th width="50">联系电话</th>
+                </tr>
+                </thead>
+                <tbody>
+                    <tr ng-repeat="item in billData track by $index">
+                        <td  style="width: 50px;">
+                            <lable class="check-act">
+                                <input type="checkbox" id={{$index+1}} ng-checked="item.checked" ng-click="checkInvoice(item)" />
+                                <label for={{$index+1}}></label>
+                            </lable>
+                        </td>
+                        <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
+                        <td>
+                            <span style="display: block" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid"></span>
+                        </td>
+                        <td ng-bind="item.price"></td>
+                        <td ng-bind="item.invoicetype==1206?'普票':'专票'"></td>
+                        <td ng-bind="item.invoicetitle"></td>
+                        <td ng-bind="item.receiverName"></td>
+                        <td class="address" title="{{item.area+'&#10;'+item.detailAddr}}">
+                            <p ng-bind="item.area"></p>
+                            <p ng-bind="item.detailAddr"></p>
+                        </td>
+                        <td ng-bind="item.recTel">13135015772</td>
+                    </tr>
+                    <tr class="record-num" ng-if="billData && billData.length>0">
+                        <td colspan="9">
+                            <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements"></span> 条</span>
+                        </td>
+                    </tr>
+                </tbody>
+                <tbody class="no-record-list" ng-if="!billData || billData.length<=0">
+                <tr class="height200">
+                <td colspan="10" style="border: #fff 1px solid"><img src="static/img/all/empty-cart.png"><span>暂无开票申请</span></td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+        <div class="apply-btn"  ng-style="$$kdnData.totalElements>10?'margin-top: 100px':''" ng-if="billData && billData.length>0">
+            <button ng-click="submitApply()">确认开票</button>
+        </div>
+    </div>
+    <!--开票记录-->
+    <div class="vendor-invoice" ng-if="active == 'apply_record'">
+        <div class="invoice-search" style="margin-top: 5px;margin-bottom: 16px; width: 100%">
+            <div class="fr">
+                <input type="text" ng-keydown="enterEvent($event, keyword)"  class="form-control" ng-model="keyword" placeholder="订单号/发票抬头/收票人/联系电话"/>
+                <button ng-click="searchByKey(keyword)">搜索</button>
+            </div>
+        </div>
+        <div class="vendor-invoice-content">
+            <table class="invoice-com-tab table" ng-table="billRecordTableParam">
+                <thead>
+                <tr>
+                    <th width="70">申请时间</th>
+                    <th width="90">订单号</th>
+                    <th width="90">开票金额(¥)</th>
+                    <th width="55" class="select-line">
+                        <select class="select-adder form-control" style="position: relative;left: 6px;" ng-change="billTypeSearch(billType)" ng-model="billType">
+                            <option value="1">类型</option>
+                            <option value="2">普票</option>
+                            <option value="3">专票</option>
+                        </select>
+                    </th>
+                    <th width="120">发票抬头</th>
+                    <th width="50">收票人</th>
+                    <th width="160">收票地址</th>
+                    <th width="50">联系电话</th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr ng-repeat="item in billData track by $index">
+                    <td ng-bind="item.createTime | date : 'yyyy-MM-dd'"></td>
+                    <td>
+                        <span style="display: block" ng-repeat="orderid in item.orderids.split(',')" ng-bind="orderid"></span>
+                    </td>
+                    <td ng-bind="item.price"></td>
+                    <td ng-bind="item.invoicetype==1206?'普票':'专票'"></td>
+                    <td ng-bind="item.invoicetitle"></td>
+                    <td ng-bind="item.receiverName"></td>
+                    <td class="address" title="{{item.area+'&#10;'+item.detailAddr}}">
+                        <p ng-bind="item.area"></p>
+                        <p ng-bind="item.detailAddr"></p>
+                    </td>
+                    <td ng-bind="item.recTel">13135015772</td>
+                </tr>
+                <tr class="record-num" ng-if="billData && billData.length>0">
+                    <td colspan="9">
+                        <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements"></span> 条</span>
+                    </td>
+                </tr>
+                </tbody>
+                <tbody class="no-record-list" ng-if="!billData || billData.length<=0">
+                <tr class="height200">
+                <td style="border: #fff 1px solid" colspan="10"><img src="static/img/all/empty-cart.png"><span>暂无开票记录</span></td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+
+<!--操作框-->
+<div class="com-del-box" ng-show="showSubmitBox">
+    <div class="title">
+        <a ng-click=""><i class="fa fa-close fa-lg"></i></a>
+    </div>
+    <div class="content">
+        <p><i ng-click="setShowSubmitBox(false)" class="fa fa-exclamation-circle"></i>点击【确认】系统将通知买家发票
+            <br/>已寄出,否则请点击【取消】</p>
+        <div><a ng-click="setShowSubmitBox(false)">取消</a><a ng-click="doSubmit()">确认</a></div>
+    </div>
+</div>

+ 5 - 4
src/main/webapp/resources/view/vendor/left_nav.html

@@ -23,13 +23,14 @@
 	<ul>
 		<li ng-class="{'active' : active == 'vendor_order'}"><a href="javascript:void(0)" ui-sref="vendor_order">订单中心</a></li>
 		<li ng-class="{'active' : active == 'vendor_logistics'}"><a href="javascript:void(0)" ui-sref="vendor_deliveryRule">物流管理</a></li>
-		<!--<li ng-class="{'active' : active == 'vendor_logistics'}"><a href="javascript:void(0)" ui-sref="vendor_logistics">物流管理</a></li>-->
+		<li ng-class="{'active' : active == 'vendor_invoice'}"><a href="javascript:void(0)" ui-sref="vendorInvoice">发票管理</a></li>
+	<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><a href="javascript:void(0)" ui-sref="vendor_logistics">物流管理</a></li>-->
 		<li ng-class="{'active' : active == 'pay_center'}"><a href="javascript:void(0)" ui-sref="pay_center">结算中心</a></li>
 		<li ng-class="{'active' : active == 'vendor_brand_apply'}"><a href="javascript:void(0)" ui-sref="vendor_brand_apply">品牌申请</a></li>
 		<li ng-class="{'active' : active == 'vendor_component_apply'}"><a href="javascript:void(0)" ui-sref="vendor_component_apply">器件申请</a></li>
-		<li ng-class="{'active' : active == 'vendor_upload'}"><a href="javascript:void(0)" ui-sref="vendor_upload">产品导入</a></li>
-		<!--<li ng-class="{'active' : active == 'vendor_repository'}"><a href="javascript:void(0)" ui-sref="vendor_repository">仓库管理</a></li>-->
-		<li ng-class="{'active' : active == 'vendor_material'}"><a href="javascript:void(0)" ui-sref="vendor_material">产品管理</a></li>
+		<li ng-class="{'active' : active == 'vendor_productOn'}"><a href="javascript:void(0)" ui-sref="vendor_productOn">产品导入</a></li>
+		<li ng-class="{'active' : active == 'vendor_repository'}"><a href="javascript:void(0)" ui-sref="vendor_repository">仓库管理</a></li>
+		<li ng-class="{'active' : active == 'vendor_goods'}"><a href="javascript:void(0)" ui-sref="vendor_standardPutOn">产品管理</a></li>
 		<!--<li ng-class="{'active' : active == 'vendor_after_sale'}" class="undo">-->
 		<!--&lt;!&ndash;<a href="javascript:void(0)" ui-sref="vendor_after_sale">售后处理</a>&ndash;&gt;-->
 		<!--售后处理-->