作者 Kevin

1、优化收发货人的管理;

2、优化主单和分单编辑界面中的收发货人选择操作;
3、分单号校验规则修改为仅相同主单下不允许分单号重复;
正在显示 26 个修改的文件 包含 1488 行增加560 行删除
... ... @@ -408,7 +408,7 @@ public class BillController extends BasicController{
ResponseModel model = new ResponseModel();
ConsigneeEntity consignee = null;
try {
consignee = consigneeService.findByCode(sCode);
consignee = consigneeService.findByCompanyAndUserId(sCode, Tools.getUserId());
model.setData(consignee);
model.setStatus(200);
}catch (Exception e){
... ...
... ... @@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -13,89 +14,127 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.agent.controller.BasicController;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.service.agent.ConsigneeService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.plugin.easyui.DataGrid;
import com.plugin.easyui.EasyPage;
import tools.NumKit;
import tools.Tools;
/**
*
* Depiction: 收货人控制器
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:24:33
*
*/
@Controller
public class ConsigneeController extends BasicController{
@RequestMapping(value = "/consignee")
public class ConsigneeController extends BasicController {
@Resource
private ConsigneeService consigneeService;
@RequestMapping(value = "consignee/grid.json")
private ConsigneeService service;
@RequestMapping(value = "/getall")
@ResponseBody
public DataGrid<ConsigneeEntity> consignee_grid_json(HttpServletRequest request, EasyPage<ConsigneeEntity> pageForm){
// Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
// pageForm.setSearchParams(searchParams);
// pageForm.parseData(consigneeService.getPage(pageForm));
// return pageForm.getData();
int page = NumKit.parseInt(request.getParameter("page"));
page = page<1?1:page;
int rows = NumKit.parseInt(request.getParameter("rows"));
rows = rows<1?10:rows;
List<ConsigneeEntity> list = consigneeService.list(page, rows);
pageForm.setPage(page);
pageForm.setRows(rows);
DataGrid<ConsigneeEntity> data = new DataGrid<>();
data.setRows(list);
data.setTotal(consigneeService.total(Tools.getUserId()));
pageForm.setData(data );
return pageForm.getData();
}
@RequestMapping(value="consignee/edit")
public String consigne_edit(HttpServletRequest request, String id, Model model){
if(id != null)
{
List<ConsigneeEntity> list = consigneeService.findById(id);
if(list != null && list.size() > 0)
{
model.addAttribute("consignee", list.get(0));
}
public ResponseModel getAll(HttpServletRequest request) {
ResponseModel model = new ResponseModel(200, "操作成功", null);
List<ConsigneeEntity> dataList = service.findAllByUserId(Tools.getUserId());
if (dataList == null || dataList.size() == 0) {
model = new ResponseModel(200, "没有数据", null);
} else {
model = new ResponseModel(200, "查询成功", null);
}
return "consignee/edit";
model.setData(dataList);
return model;
}
@RequestMapping(value = "/list")
public String list(HttpServletRequest request,boolean isWithChoose) {
request.setAttribute("isWithChoose", isWithChoose);
return "consignee/list";
}
@RequestMapping(value = "consignee/getall")
@RequestMapping(value = "/search")
@ResponseBody
public ResponseModel consignee_getall(HttpServletRequest request){
public ResponseModel search(HttpServletRequest request, Integer page, Integer limit,String key) {
if (page == null) {
page = 1;
}
if (limit == null) {
limit = 10;
}
ResponseModel model = new ResponseModel(200, "", null);
model.setData(consigneeService.findAll());
page = page < 1 ? 1 : page;
limit = limit < 1 ? 10 : limit;
List<ConsigneeEntity> dataList = service.list(page, limit,key);
if (dataList == null || dataList.size() == 0) {
model = new ResponseModel(200, "没有数据", null);
} else {
model = new ResponseModel(200, "查询成功", null);
}
model.setCount(StringUtils.isBlank(key)?service.total(Tools.getUserId()):service.total(Tools.getUserId(),key));
model.setData(dataList);
return model;
}
@RequestMapping(value = "consignee/delete")
@RequestMapping(value = "/delete")
@ResponseBody
public ResponseModel consignee_delete(HttpServletRequest request, String ids){
ResponseModel model = new ResponseModel();
try {
consigneeService.deleteAll(ids);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
}
return model;
public ResponseModel delete(String ids) {
ResponseModel model = new ResponseModel(404, "", null);
if (!StringUtils.isBlank(ids)) {
model = new ResponseModel(200, "", null);
if (ids.indexOf(",") > 1) {
try {
service.deleteAll(ids);
model = new ResponseModel(200, "", null);
} catch (Exception e) {
model = new ResponseModel(500, "删除失败", null);
}
} else {
model = new ResponseModel(404, "ID不能为空", null);
}
}
return model;
}
//返回渲染的页面
@RequestMapping(value="consignee/list")
public String consigner_list(){
System.out.println("hello world");
return "consignee/list";
@RequestMapping(value = "/edit")
public String edit(HttpServletRequest request, String id, Model model) {
if (StringUtils.isNotBlank(id)) {
ConsigneeEntity consignee = service.findById(id);
model.addAttribute("consignee", consignee);
}
return "consignee/edit";
}
@RequestMapping(value="consignee/save")
@RequestMapping(value = "/save")
@ResponseBody
public ResponseModel consignee_save(HttpServletRequest request, ConsigneeEntity consignee){
ResponseModel model = new ResponseModel(200, "", null);
consigneeService.save(consignee);
public ResponseModel save(ConsigneeEntity consignee) {
ResponseModel model = new ResponseModel(404, "", null);
if (consignee != null) {
ConsigneeEntity old = service.findByCompanyAndUserId(consignee.getName(),Tools.getUserId());
if (old == null) {
consignee.setCreator(Tools.getUserEntity());
consignee.setModifier(Tools.getUserEntity());
service.save(consignee);
model = new ResponseModel(200, "操作成功", null);
} else {
if(old.getId()!=null) {
service.save(consignee);
model = new ResponseModel(200, "修改成功", null);
}else {
model = new ResponseModel(500, "不能重复添加", null);
}
}
} else {
model = new ResponseModel(500, "参数为空", null);
}
return model;
}
}
... ...
package com.agent.controller.agent;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.agent.controller.BasicController;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.service.agent.ConsigneeService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.plugin.easyui.DataGrid;
import com.plugin.easyui.EasyPage;
import tools.NumKit;
import tools.Tools;
@Controller
public class ConsigneeController extends BasicController{
@Resource
private ConsigneeService consigneeService;
@RequestMapping(value = "consignee/grid.json")
@ResponseBody
public DataGrid<ConsigneeEntity> consignee_grid_json(HttpServletRequest request, EasyPage<ConsigneeEntity> pageForm){
// Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
// pageForm.setSearchParams(searchParams);
// pageForm.parseData(consigneeService.getPage(pageForm));
// return pageForm.getData();
int page = NumKit.parseInt(request.getParameter("page"));
page = page<1?1:page;
int rows = NumKit.parseInt(request.getParameter("rows"));
rows = rows<1?10:rows;
List<ConsigneeEntity> list = consigneeService.list(page, rows);
pageForm.setPage(page);
pageForm.setRows(rows);
DataGrid<ConsigneeEntity> data = new DataGrid<>();
data.setRows(list);
data.setTotal(consigneeService.total(Tools.getUserId()));
pageForm.setData(data );
return pageForm.getData();
}
@RequestMapping(value="consignee/edit")
public String consigne_edit(HttpServletRequest request, String id, Model model){
if(id != null)
{
List<ConsigneeEntity> list = consigneeService.findById(id);
if(list != null && list.size() > 0)
{
model.addAttribute("consignee", list.get(0));
}
}
return "consignee/edit";
}
@RequestMapping(value = "consignee/getall")
@ResponseBody
public ResponseModel consignee_getall(HttpServletRequest request){
ResponseModel model = new ResponseModel(200, "", null);
model.setData(consigneeService.findAll());
return model;
}
@RequestMapping(value = "consignee/delete")
@ResponseBody
public ResponseModel consignee_delete(HttpServletRequest request, String ids){
ResponseModel model = new ResponseModel();
try {
consigneeService.deleteAll(ids);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
}
return model;
}
//返回渲染的页面
@RequestMapping(value="consignee/list")
public String consigner_list(){
System.out.println("hello world");
return "consignee/list";
}
@RequestMapping(value="consignee/save")
@ResponseBody
public ResponseModel consignee_save(HttpServletRequest request, ConsigneeEntity consignee){
ResponseModel model = new ResponseModel(200, "", null);
consigneeService.save(consignee);
return model;
}
}
... ...
... ... @@ -51,13 +51,14 @@ public class ConsignorController extends BasicController {
}
@RequestMapping(value = "/list")
public String list(HttpServletRequest request) {
public String list(HttpServletRequest request,boolean isWithChoose) {
request.setAttribute("isWithChoose", isWithChoose);
return "consignor/list";
}
@RequestMapping(value = "/search")
@ResponseBody
public ResponseModel search(HttpServletRequest request, Integer page, Integer limit) {
public ResponseModel search(HttpServletRequest request, Integer page, Integer limit,String key) {
if (page == null) {
page = 1;
}
... ... @@ -66,16 +67,16 @@ public class ConsignorController extends BasicController {
limit = 10;
}
ResponseModel model = new ResponseModel(200, "", null);
ResponseModel model = new ResponseModel(200, "操作成功", null);
page = page < 1 ? 1 : page;
limit = limit < 1 ? 10 : limit;
List<ConsignorEntity> dataList = service.list(page, limit);
List<ConsignorEntity> dataList = service.list(page, limit,key);
if (dataList == null || dataList.size() == 0) {
model = new ResponseModel(404, "", null);
model = new ResponseModel(200, "没有数据", null);
} else {
model = new ResponseModel(200, "", null);
model = new ResponseModel(200, "查询成功", null);
}
model.setCount(service.total(Tools.getUserId()));
model.setCount(StringUtils.isBlank(key)?service.total(Tools.getUserId()):service.total(Tools.getUserId(),key));
model.setData(dataList);
return model;
}
... ... @@ -122,7 +123,12 @@ public class ConsignorController extends BasicController {
service.save(consignor);
model = new ResponseModel(200, "操作成功", null);
} else {
model = new ResponseModel(500, "不能重复添加", null);
if(old.getId()!=null) {
service.save(consignor);
model = new ResponseModel(200, "修改成功", null);
}else {
model = new ResponseModel(500, "不能重复添加", null);
}
}
} else {
model = new ResponseModel(500, "参数为空", null);
... ...
... ... @@ -355,7 +355,7 @@ public class ManifestController extends BasicController {
model.put("id", mawbId);
model.put("manifest", manifest);
model.put("pre", pre);
return model;
}
... ... @@ -546,11 +546,11 @@ public class ManifestController extends BasicController {
model.addAttribute("typeList", typeList);
request.setAttribute("version", System.currentTimeMillis());
// model.addAttribute("customsStatus",flag);
String waybill_no = manifest!=null?manifest.getWaybillnomaster():"";
String waybill_no = manifest != null ? manifest.getWaybillnomaster() : "";
WaybillReceiptEntity receipt = receiptService.findByWaybillNo(waybill_no);
request.setAttribute("receipt", receipt);
return "manifest/edit";
}
... ... @@ -665,15 +665,15 @@ public class ManifestController extends BasicController {
}
model.addAttribute("pre", pre);
request.setAttribute("version", System.currentTimeMillis());
String waybill_no = manifest!=null?manifest.getWaybillnomaster():"";
String waybill_no = manifest != null ? manifest.getWaybillnomaster() : "";
String sub_waybill_no = "";
if(pre!=null&&pre.getWaybillnosecondary()!=null) {
if (pre != null && pre.getWaybillnosecondary() != null) {
sub_waybill_no = pre.getWaybillnosecondary();
}
WaybillReceiptEntity receipt = receiptService.findByWaybillNoAndSub(waybill_no, sub_waybill_no);
request.setAttribute("receipt", receipt);
return "manifest/sub_edit";
}
... ... @@ -1247,25 +1247,23 @@ public class ManifestController extends BasicController {
}
/**
* 查询分单号
*
* @param manifest
*
* @param waybillnomaster
* 主单号
* @param waybillnoSub
* 分单号
* @return
*/
@RequestMapping(value = "/daryMawbNo", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel daryMawbNo(Long id, String mawbNo) {
public ResponseModel daryMawbNo(String waybillnomaster, String waybillnoSub) {
ResponseModel model = new ResponseModel();
List<PreparesecondaryEntity> list = null;
if (StringUtils.isNotEmpty(mawbNo)) {
list = preparesecondaryServer.findByMawbNo(mawbNo);
}
boolean exist = false;
if (CollectionUtils.isNotEmpty(list)) {
if (list.size() > 0) {
exist = true;
}
if (StringUtils.isNotEmpty(waybillnomaster) && StringUtils.isNotEmpty(waybillnoSub)) {
list = preparesecondaryServer.findByMainAndSub(waybillnomaster, waybillnoSub);
}
boolean exist = list != null && list.size() > 0;
if (exist) {
model.setStatus(500);
} else {
... ...
package com.agent.entity.agent;
import com.agent.entity.BasicEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.agent.entity.BasicEntity;
/**
* Created by cohesion on 2017/3/28.
*
... ... @@ -16,26 +15,27 @@ import javax.persistence.Table;
public class ConsigneeEntity extends BasicEntity {
/**
* 简称
* 简称:收货人
*/
private String code;
/**
* 全称
* 全称:公司全名
*/
private String name;
/**
* 地址
*/
private String address;
/**
* 电话
*/
private String tel;
private String fax;
private String city;
private String country;
private String deltaname;
private String zipcode;
private String aeo;
private String cusid;
private String provincecode;
@Column(name = "CODE")
public String getCode() {
return code;
}
... ... @@ -44,7 +44,6 @@ public class ConsigneeEntity extends BasicEntity {
this.code = code;
}
@Column(name = "NAME")
public String getName() {
return name;
}
... ... @@ -53,7 +52,6 @@ public class ConsigneeEntity extends BasicEntity {
this.name = name;
}
@Column(name = "ADDRESS")
public String getAddress() {
return address;
}
... ... @@ -62,7 +60,6 @@ public class ConsigneeEntity extends BasicEntity {
this.address = address;
}
@Column(name = "TEL")
public String getTel() {
return tel;
}
... ... @@ -70,4 +67,69 @@ public class ConsigneeEntity extends BasicEntity {
public void setTel(String tel) {
this.tel = tel;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getDeltaname() {
return deltaname;
}
public void setDeltaname(String deltaname) {
this.deltaname = deltaname;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public String getAeo() {
return aeo;
}
public void setAeo(String aeo) {
this.aeo = aeo;
}
public String getCusid() {
return cusid;
}
public void setCusid(String cusid) {
this.cusid = cusid;
}
public String getProvincecode() {
return provincecode;
}
public void setProvincecode(String provincecode) {
this.provincecode = provincecode;
}
}
... ...
... ... @@ -9,41 +9,40 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsigneeInfo;
public interface ConsigneeRepository extends PagingAndSortingRepository<ConsigneeEntity, Long>,
JpaSpecificationExecutor<ConsigneeEntity> {
public interface ConsigneeRepository
extends PagingAndSortingRepository<ConsigneeEntity, Long>, JpaSpecificationExecutor<ConsigneeEntity> {
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE NAME = ?1 AND CREATOR = ?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findByCompanyAndUserId(String company,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findById(String id);
@Query(value = "SELECT * FROM(SELECT rownum rn,c.* from PUB_CONSIGNEE c where c.creator=?1 and c.name LIKE %?2%) cr where cr.rn between ?3 and ?4", nativeQuery = true)
public List<ConsigneeEntity> search(long user_id,String key,int start,int end);
@Query(value = "SELECT * FROM(SELECT rownum rn,c.* from PUB_CONSIGNEE c where c.creator=?1) cr where cr.rn between ?2 and ?3", nativeQuery = true)
public List<ConsigneeEntity> list(long user_id,int start,int end);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CODE = ?1 AND NAME = ?2 AND CREATOR=?3 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findByName(String code,String name,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CODE = ?1 AND CREATOR=?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findByCode(String code,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE ID = ?1 AND CREATOR=?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findById(String id,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CREATOR=?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findAll2(long user_id);
@Modifying
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CREATOR = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> getAllByUserId(long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CREATOR = ?1 AND NAME LIKE %?2% ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> getAllByUserIdAndSearchkey(long user_id,String key);
@Modifying
@Query(value = "DELETE FROM PUB_CONSIGNEE WHERE ID = ?1", nativeQuery = true)
void deleteAll(Long id);
//关于,,,,,,,,,,,
@Transactional
@Modifying(clearAutomatically=true)
@Query(value = "INSERT INTO CONSIGNEE_INFO(ID, SH_COMPANY, SH_ADDRESS, SH_ZIPCODE, CITY, DELTANAME, COUNTRY, TELEPHONE, SH_FAX, SH_NAME, SH_PROVINCENAME, SH_PROVINCECODE) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11)", nativeQuery = true)
public int save(String id, String sh_company, String sh_address, String sh_zipcode, String city, String deltaname, String country, String telephone, String sh_fax, String sh_name, String sh_provincename, String sh_provincecode);
// @Transactional
// @Modifying(clearAutomatically=true)
// @Query(value = "", nativeQuery = true)
// public int update();
@Query(value = "SELECT * FROM CONSIGNEE_INFO WHERE ID=?1", nativeQuery = true)
public List<ConsigneeInfo> queryById(String id);
void deleteById(Long id);
// 关于,,,,,,,,,,,
@Transactional
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO PUB_CONSIGNEE(CO_NAME, CO_TELEPHONE, CO_COMPANY, CO_COUNTRY, CO_DELTANAME, CO_CITY, CO_ADDRESS, CO_ZIPCODE, CO_FAX, SHPAEO,SHPCUSID) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11)", nativeQuery = true)
public int save(String co_name, String co_telephone, String co_company, String co_country,
String co_deltaname, String co_city, String co_address, String co_zipcode, String co_fax, String shpaeo,
String shpcusid);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE ID=?1", nativeQuery = true)
public List<ConsigneeEntity> queryById(Long id);
}
... ...
package com.agent.repository.agent;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsigneeInfo;
public interface ConsigneeRepository extends PagingAndSortingRepository<ConsigneeEntity, Long>,
JpaSpecificationExecutor<ConsigneeEntity> {
@Query(value = "SELECT * FROM(SELECT rownum rn,c.* from PUB_CONSIGNEE c where c.creator=?1) cr where cr.rn between ?2 and ?3", nativeQuery = true)
public List<ConsigneeEntity> list(long user_id,int start,int end);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CODE = ?1 AND NAME = ?2 AND CREATOR=?3 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findByName(String code,String name,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CODE = ?1 AND CREATOR=?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findByCode(String code,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE ID = ?1 AND CREATOR=?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findById(String id,long user_id);
@Query(value = "SELECT * FROM PUB_CONSIGNEE WHERE CREATOR=?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsigneeEntity> findAll2(long user_id);
@Modifying
@Query(value = "DELETE FROM PUB_CONSIGNEE WHERE ID = ?1", nativeQuery = true)
void deleteAll(Long id);
//关于,,,,,,,,,,,
@Transactional
@Modifying(clearAutomatically=true)
@Query(value = "INSERT INTO CONSIGNEE_INFO(ID, SH_COMPANY, SH_ADDRESS, SH_ZIPCODE, CITY, DELTANAME, COUNTRY, TELEPHONE, SH_FAX, SH_NAME, SH_PROVINCENAME, SH_PROVINCECODE) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11)", nativeQuery = true)
public int save(String id, String sh_company, String sh_address, String sh_zipcode, String city, String deltaname, String country, String telephone, String sh_fax, String sh_name, String sh_provincename, String sh_provincecode);
// @Transactional
// @Modifying(clearAutomatically=true)
// @Query(value = "", nativeQuery = true)
// public int update();
@Query(value = "SELECT * FROM CONSIGNEE_INFO WHERE ID=?1", nativeQuery = true)
public List<ConsigneeInfo> queryById(String id);
}
... ...
... ... @@ -19,11 +19,17 @@ public interface ConsignorRepository
@Query(value = "SELECT * FROM CONSIGNOR WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> findById(String id);
@Query(value = "SELECT * FROM(SELECT rownum rn,c.* from CONSIGNOR c where c.creator=?1 and c.co_company LIKE %?2%) cr where cr.rn between ?3 and ?4", nativeQuery = true)
public List<ConsignorEntity> search(long user_id,String key,int start,int end);
@Query(value = "SELECT * FROM(SELECT rownum rn,c.* from CONSIGNOR c where c.creator=?1) cr where cr.rn between ?2 and ?3", nativeQuery = true)
public List<ConsignorEntity> list(long user_id,int start,int end);
@Query(value = "SELECT * FROM CONSIGNOR WHERE CREATOR = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> getAllByUserId(long user_id);
@Query(value = "SELECT * FROM CONSIGNOR WHERE CREATOR = ?1 AND CO_COMPANY LIKE %?2% ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> getAllByUserIdAndSearchkey(long user_id,String key);
@Modifying
@Query(value = "DELETE FROM CONSIGNOR WHERE ID = ?1", nativeQuery = true)
... ...
... ... @@ -22,6 +22,9 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
@Query(value = "SELECT * FROM PREPARESECONDARY WHERE WAYBILLNOSECONDARY = ?1", nativeQuery = true)
List<PreparesecondaryEntity> findByMawbNo(String mawbNo);
@Query(value = "SELECT * FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1 AND WAYBILLNOSECONDARY = ?2", nativeQuery = true)
List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub);
@Modifying
@Query(value = "DELETE FROM PREPARESECONDARY WHERE PREPAREMASTERID = ?1", nativeQuery = true)
void deleteAll(Long id);
... ...
package com.agent.service.agent;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsignorEntity;
import com.agent.entity.agent.ManifestEntity;
import com.agent.entity.agent.PreparesecondaryEntity;
import com.agent.repository.agent.ConsigneeRepository;
import com.agent.service.BasicService;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
import tools.Tools;
/**
*
* Depiction:发货人数据库操作
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:25:53
*
*/
@Service
public class ConsigneeService extends BasicService<ConsigneeEntity> {
@Resource
private ConsigneeRepository consigneeRepository;
private ConsigneeRepository service;
@Transactional
public void deleteAll(String ids) {
List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(ids);
for (String id : list) {
consigneeRepository.delete(Long.valueOf(id));
service.delete(Long.valueOf(id));
}
}
public ConsigneeEntity findByCodeAndName(String code, String name) {
List<ConsigneeEntity> consigns = consigneeRepository.findByName(code, name, Tools.getUserId());
public ConsigneeEntity findById(String id) {
List<ConsigneeEntity> list = service.findById(id);
return list != null && !list.isEmpty() ? list.get(0) : null;
}
public ConsigneeEntity findByCompanyAndUserId(String company, long user_id) {
List<ConsigneeEntity> consigns = service.findByCompanyAndUserId(company, user_id);
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public ConsigneeEntity findByCode(String code) {
List<ConsigneeEntity> consigns = consigneeRepository.findByCode(code, Tools.getUserId());
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
public void save(ConsigneeEntity c) {
if (c != null) {
if (c.getCreateDate() == null) {
c.setCreateDate(new Date());
}
if (c.getModifyDate() == null) {
c.setModifyDate(new Date());
}
service.save(c);
}
return null;
}
public Page<ConsigneeEntity> getPage(EasyPage<ConsigneeEntity> pageForm) {
PageRequest pageRequest = buildPageRequest(pageForm);
Specification<ConsigneeEntity> spec = buildSpecification(pageForm);
Page<ConsigneeEntity> page = consigneeRepository.findAll(spec, pageRequest);
return page;
public long count() {
return service.count();
}
public long total(long user_id) {
List<ConsigneeEntity> list = consigneeRepository.findAll2(user_id);
return list!=null?list.size():0;
List<ConsigneeEntity> list = service.getAllByUserId(user_id);
return list != null ? list.size() : 0;
}
public List<ConsigneeEntity> list(int page,int limit) {
int start = (page-1)*limit+1;
int end = page*limit;
long user_id = Tools.getUserId();
return consigneeRepository.list(user_id,start,end);
public long total(long user_id,String key) {
List<ConsigneeEntity> list = service.getAllByUserIdAndSearchkey(user_id,key);
return list != null ? list.size() : 0;
}
public void save(ConsigneeEntity c) {
c.setCreator(Tools.getUserEntity());
consigneeRepository.save(c);
public List<ConsigneeEntity> list(int page, int limit, String key) {
int start = (page - 1) * limit + 1;
int end = page * limit;
long user_id = Tools.getUserId();
if (StringUtils.isBlank(key)) {
return service.list(user_id, start, end);
}
return service.search(user_id, key, start, end);
}
public List<ConsigneeEntity> findAll() {
return consigneeRepository.findAll2(Tools.getUserId());
public List<ConsigneeEntity> findAllByUserId(long user_id) {
return service.getAllByUserId(user_id);
}
public void update(ConsigneeEntity c) {
c.setCreator(Tools.getUserEntity());
consigneeRepository.save(c);
service.save(c);
}
public List<ConsigneeEntity> findById(String id) {
return consigneeRepository.findById(id, Tools.getUserId());
public void saveFromManifest(ManifestEntity manifest, long user_id) {
if (manifest != null && StringUtils.isNotBlank(manifest.getSh_company())) {
ConsigneeEntity bean = new ConsigneeEntity();
bean.setAddress(manifest.getSh_address());
bean.setCity(manifest.getSh_city());
bean.setCode(manifest.getSh_name());
bean.setCountry(manifest.getSh_country());
bean.setDeltaname(manifest.getSh_deltaname());
bean.setFax(manifest.getSh_fax());
bean.setName(manifest.getSh_company());
bean.setTel(manifest.getSh_telephone());
bean.setZipcode(manifest.getSh_zipcode());
bean.setAeo(manifest.getCneaeo());
bean.setCusid(manifest.getCnecusid());
bean.setModifyDate(new Date());
bean.setCreateDate(new Date());
bean.setCreator(Tools.getUserEntity());
bean.setModifier(Tools.getUserEntity());
ConsigneeEntity old = findByCompanyAndUserId(manifest.getSh_company(), user_id);
if (old != null) {
service.delete(old.getId());
}
save(bean);
}
}
public void saveFromPreparesecondary(PreparesecondaryEntity prepare, long user_id) {
if (prepare != null && StringUtils.isNotBlank(prepare.getSh_company())) {
ConsigneeEntity bean = new ConsigneeEntity();
bean.setAddress(prepare.getSh_address());
bean.setCity(prepare.getSh_city());
bean.setCode(prepare.getSh_name());
bean.setCountry(prepare.getSh_country());
bean.setDeltaname(prepare.getSh_deltaname());
bean.setFax(prepare.getSh_fax());
bean.setName(prepare.getSh_company());
bean.setTel(prepare.getSh_telephone());
bean.setZipcode(prepare.getSh_zipcode());
bean.setAeo(prepare.getCneaeo());
bean.setCusid(prepare.getCnecusid());
bean.setModifyDate(new Date());
bean.setCreateDate(new Date());
bean.setCreator(Tools.getUserEntity());
bean.setModifier(Tools.getUserEntity());
ConsigneeEntity old = findByCompanyAndUserId(prepare.getSh_company(), user_id);
if (old != null) {
service.delete(old.getId());
}
save(bean);
}
}
}
... ...
package com.agent.service.agent;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsignorEntity;
import com.agent.repository.agent.ConsigneeRepository;
import com.agent.service.BasicService;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
import tools.Tools;
@Service
public class ConsigneeService extends BasicService<ConsigneeEntity> {
@Resource
private ConsigneeRepository consigneeRepository;
@Transactional
public void deleteAll(String ids) {
List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(ids);
for (String id : list) {
consigneeRepository.delete(Long.valueOf(id));
}
}
public ConsigneeEntity findByCodeAndName(String code, String name) {
List<ConsigneeEntity> consigns = consigneeRepository.findByName(code, name, Tools.getUserId());
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public ConsigneeEntity findByCode(String code) {
List<ConsigneeEntity> consigns = consigneeRepository.findByCode(code, Tools.getUserId());
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public Page<ConsigneeEntity> getPage(EasyPage<ConsigneeEntity> pageForm) {
PageRequest pageRequest = buildPageRequest(pageForm);
Specification<ConsigneeEntity> spec = buildSpecification(pageForm);
Page<ConsigneeEntity> page = consigneeRepository.findAll(spec, pageRequest);
return page;
}
public long total(long user_id) {
List<ConsigneeEntity> list = consigneeRepository.findAll2(user_id);
return list!=null?list.size():0;
}
public List<ConsigneeEntity> list(int page,int limit) {
int start = (page-1)*limit+1;
int end = page*limit;
long user_id = Tools.getUserId();
return consigneeRepository.list(user_id,start,end);
}
public void save(ConsigneeEntity c) {
c.setCreator(Tools.getUserEntity());
consigneeRepository.save(c);
}
public List<ConsigneeEntity> findAll() {
return consigneeRepository.findAll2(Tools.getUserId());
}
public void update(ConsigneeEntity c) {
c.setCreator(Tools.getUserEntity());
consigneeRepository.save(c);
}
public List<ConsigneeEntity> findById(String id) {
return consigneeRepository.findById(id, Tools.getUserId());
}
}
... ...
... ... @@ -78,12 +78,21 @@ public class ConsignorService extends BasicService<ConsignorEntity> {
List<ConsignorEntity> list = service.getAllByUserId(user_id);
return list!=null?list.size():0;
}
public long total(long user_id,String key) {
List<ConsignorEntity> list = service.getAllByUserIdAndSearchkey(user_id,key);
return list!=null?list.size():0;
}
public List<ConsignorEntity> list(int page,int limit) {
public List<ConsignorEntity> list(int page,int limit,String key) {
int start = (page-1)*limit+1;
int end = page*limit;
long user_id = Tools.getUserId();
return service.list(user_id,start,end);
if(StringUtils.isBlank(key)) {
return service.list(user_id,start,end);
}
return service.search(user_id,key,start,end);
}
public List<ConsignorEntity> findAllByUserId(long user_id) {
... ...
... ... @@ -80,7 +80,8 @@ public class MakeHawbService extends BasicService<MakeHawbEntity> {
}
//保存收货人
if(StringUtils.isNotEmpty(consign.getCode()) && StringUtils.isNotEmpty(consign.getName())){
List<ConsigneeEntity> consigns = consigneeRepository.findByName(consign.getCode(),consign.getName(),Tools.getUserId());
// List<ConsigneeEntity> consigns = consigneeRepository.findByName(consign.getCode(),consign.getName(),Tools.getUserId());
List<ConsigneeEntity> consigns = consigneeRepository.findByCompanyAndUserId(consign.getCode(), Tools.getUserId());
if(CollectionUtils.isEmpty(consigns)){
consign.setCreator(SessionUtil.getUser());
consign.setCreateDate(new Date());
... ...
... ... @@ -102,7 +102,8 @@ public class MakeMawbService extends BasicService<MakeMawbEntity> {
public MakeMawbEntity save(MakeMawbEntity bill,MawbOtherFeeEntity otherFee,ConsigneeEntity consign,List<PackageSizeEntity> sizeList) {
//保存收货人
if(StringUtils.isNotEmpty(consign.getCode()) && StringUtils.isNotEmpty(consign.getName())){
List<ConsigneeEntity> consignees = consigneeRepository.findByName(consign.getCode(),consign.getName(),Tools.getUserId());
// List<ConsigneeEntity> consignees = consigneeRepository.findByName(consign.getCode(),consign.getName(),Tools.getUserId());
List<ConsigneeEntity> consignees = consigneeRepository.findByCompanyAndUserId(consign.getCode(), Tools.getUserId());
if(CollectionUtils.isEmpty(consignees)){
consign = consigneeRepository.save(consign);
}
... ...
... ... @@ -51,6 +51,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity
public List<PreparesecondaryEntity> findByMawbNo(String mawbNo) {
return preparesecondaryRepository.findByMawbNo(mawbNo);
}
public List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub) {
return preparesecondaryRepository.findByMainAndSub(waybillnomaster, waybillnoSub);
}
public void deleteAll(Long ids) {
preparesecondaryRepository.deleteAll(ids);
... ...
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑</title>
<link href="<%=basePath %>resource/css/base.css" rel="stylesheet">
<link href="<%=basePath %>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" href="<%=basePath %>resource/easyui/uimaker/easyui.css">
<link href="<%=basePath %>resource/css/form.css" rel="stylesheet">
<script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/validate-extends.js"></script>
<link rel="stylesheet" href="<%=basePath %>resource/css/form.css">
<script type="text/javascript" src="<%=basePath %>resource/js/tools.js"></script>
<!-- validate 验证中英文 -->
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><spring:message code="menu.consignee_info_set" /></title>
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js"></script>
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
<link rel="stylesheet" href="<%=basePath%>resource/layui/css/layui.css" media="all">
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<form class="form-control" id="form">
<input type="hidden" id="id" name="id" value="${consignee.id }" >
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label"><spring:message code="consignee.code" /></td>
<td class="kv-content">
<input id="code" name="code" value="${consignee.code }">
</td>
<td class="kv-label"><spring:message code="consignee.name" /></td>
<td class="kv-content">
<input id="name" name="name" value="${consignee.name }">
</td>
</tr>
<tr>
<td class="kv-label"><spring:message code="consignee.address" /></td>
<td class="kv-content">
<input id="address" name="address" value="${consignee.address}">
</td>
<td class="kv-label"><spring:message code="consignee.tel" /></td>
<td class="kv-content">
<input id="tel" name="tel" value="${consignee.tel }">
</td>
</tr>
<tr>
<td colspan="6">
<div class="opt-buttons" style="padding-top:20px;" id="divsubmit">
<button onclick="save()" type="button" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true">
<span class="l-btn-left"><span class="l-btn-text"><spring:message code="opt.save"/></span></span>
</button>
</div>
</td>
</tr>
<div style="padding: 15px;">
<h3>编辑收货人</h3>
<form class="layui-form">
<input type="hidden" id="id" name="id" value="${consignee.id}">
<table class="layui-table">
<tbody>
<tr>
<td><spring:message code="manifest.company" /><span class="required_span">*</span></td>
<td colspan="5">
<input type="text" name="name" id="name" maxlength="70" lay-verify="required"
value="${consignee.name}" autocomplete="off" class="layui-input" required
oninput="onInputChange(event,'name','oninput')" lay-verify="required"
onpropertychange="onInputChange(event,'name','onpropertychange')">
</td>
</tr>
<tr>
<td><spring:message code="manifest.shr.name" /><span class="required_span">*</span></td>
<td>
<input type="text" name="code" id="code" value="${consignee.code}"
maxlength="70" autocomplete="off" class="layui-input" required lay-verify="required"
oninput="onInputChange(event,'code','oninput')"
onpropertychange="onInputChange(event,'code','onpropertychange')">
</td>
</tbody>
</table>
</form>
</div>
<script>
//保存
function save(){
var data = $("#form").serialize();
$.post("<%=basePath %>consignee/save",data,function (data) {
if (data.status == 200) {
window.location.href = "<%=basePath %>consignee/list" ;
} else {
layer.open({content: "<spring:message code="opt.savefailed"/>"});
}
})
<td><spring:message code="manifest.telephone" /></td>
<td>
<input type="text" name="tel" value="${consignee.tel}"
autocomplete="off" class="layui-input" maxlength="50">
</td>
<td><spring:message code="manifest.fax" /></td>
<td>
<input type="text" name="fax" value="${consignee.fax}"
autocomplete="off" class="layui-input" maxlength="50">
</td>
</tr>
<tr>
<td><spring:message code="manifest.country" /><span class="required_span">*</span></td>
<td>
<input required type="text" name="country" id="country" value="${consignee.country}"
autocomplete="off" class="layui-input" maxlength="2" lay-verify="required"
oninput="onInputChange(event,'country','oninput')"
onpropertychange="onInputChange(event,'country','onpropertychange')">
</td>
<td><spring:message code="manifest.city" /><span class="required_span">*</span></td>
<td>
<input required type="text" name="city" id="city" value="${consignee.city}"
autocomplete="off" class="layui-input" required lay-verify="required" maxlength="70"
oninput="onInputChange(event,'city','oninput')"
onpropertychange="onInputChange(event,'city','onpropertychange')">
</td>
<td><spring:message code="manifest.zip.code" /></td>
<td>
<input type="text" name="zipcode" value="${consignee.zipcode}" autocomplete="off" class="layui-input" maxlength="9">
</td>
</tr>
<tr>
<td><spring:message code="manifest.address" /><span class="required_span">*</span></td>
<td colspan="5">
<input required type="text" name="address" id="address" value="${consignee.address}"
autocomplete="off" class="layui-input" maxlength="70" lay-verify="required"
oninput="onInputChange(event,'address','oninput')"
onpropertychange="onInputChange(event,'address','onpropertychange')">
</td>
</tr>
<tr>
<td><spring:message code="manifest.enterprise.code" /><span class="required_span">*</span></td>
<td>
<input required id="cnecusid" type="text" name="cusid" value="${consignee.cusid}"
autocomplete="off" class="layui-input" maxlength="128" lay-verify="required"
oninput="onInputChange(event,'cnecusid','oninput')"
onpropertychange="onInputChange(event,'cnecusid','onpropertychange')">
</td>
<td><spring:message code="manifest.shr.cneaeo" /></td>
<td colspan="3">
<input type="text" name="aeo" id="cneaeo"
value="${consignee.aeo}" autocomplete="off" class="layui-input" maxlength="20"
oninput="onInputChange(event,'cneaeo','oninput')"
onpropertychange="onInputChange(event,'cneaeo','onpropertychange')">
</td>
</tr>
</tbody>
</table>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo"><spring:message code="opt.save"/></span></button>
<button type="button" class="layui-btn layui-btn-primary"
onclick="self.location=document.referrer;">返回</button>
</div>
</div>
</form>
</div>
<script>
var layer;
layui.use('layer', function() {
layer = layui.layer;
});
$(window).load(function() {
});
layui.use('form', function() {
var form = layui.form;
form.on('submit(formDemo)', function(data){
save(data.field);
return false;
});
});
function save(data){
var url = "<%=basePath%>/consignee/save";
var params = "code=" + data.code;
params += "&name=" + data.name;
if (data.id) {
params += "&id=" + data.id;
}
//取消
function cancel(){
if (data.cusid) {
params += "&cusid=" + data.cusid;
}
</script>
</div>
if (data.aeo) {
params += "&aeo=" + data.aeo;
}
if (data.address) {
params += "&address=" + data.address;
}
if (data.zipcode) {
params += "&zipcode=" + data.zipcode;
}
if (data.city) {
params += "&city=" + data.city;
}
if (data.deltaname) {
params += "&deltaname=" + data.deltaname;
}
if (data.country) {
params += "&country=" + data.country;
}
if (data.provincecode) {
params += "&provincecode=" + data.provincecode;
}
if (data.tel) {
params += "&tel=" + data.tel;
}
if (data.fax) {
params += "&fax=" + data.fax;
}
$.post(url, params, function(response, status) {
if (response.status == 200) {
setInterval("afterSuccess()","1000");
}
layer.msg(response.msg);
});
}
function afterSuccess(){
self.location = document.referrer;
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑</title>
<link href="<%=basePath %>resource/css/base.css" rel="stylesheet">
<link href="<%=basePath %>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" href="<%=basePath %>resource/easyui/uimaker/easyui.css">
<link href="<%=basePath %>resource/css/form.css" rel="stylesheet">
<script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/validate-extends.js"></script>
<link rel="stylesheet" href="<%=basePath %>resource/css/form.css">
<script type="text/javascript" src="<%=basePath %>resource/js/tools.js"></script>
<!-- validate 验证中英文 -->
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
<div class="content">
<form class="form-control" id="form">
<input type="hidden" id="id" name="id" value="${consignee.id }" >
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label"><spring:message code="consignee.code" /></td>
<td class="kv-content">
<input id="code" name="code" value="${consignee.code }">
</td>
<td class="kv-label"><spring:message code="consignee.name" /></td>
<td class="kv-content">
<input id="name" name="name" value="${consignee.name }" maxlength="70">
</td>
</tr>
<tr>
<td class="kv-label"><spring:message code="consignee.address" /></td>
<td class="kv-content">
<input id="address" name="address" value="${consignee.address}" maxlength="70">
</td>
<td class="kv-label"><spring:message code="consignee.tel" /></td>
<td class="kv-content">
<input id="tel" name="tel" value="${consignee.tel }" maxlength="50">
</td>
</tr>
<tr>
<td colspan="6">
<div class="opt-buttons" style="padding-top:20px;" id="divsubmit">
<button onclick="save()" type="button" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true">
<span class="l-btn-left"><span class="l-btn-text"><spring:message code="opt.save"/></span></span>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<script>
//保存
function save(){
var data = $("#form").serialize();
$.post("<%=basePath %>consignee/save",data,function (data) {
if (data.status == 200) {
window.location.href = "<%=basePath %>consignee/list" ;
} else {
layer.open({content: "<spring:message code="opt.savefailed"/>"});
}
})
}
//取消
function cancel(){
}
</script>
</div>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -11,123 +11,174 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><string:message code="menu.consignee_info_set" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath%>resource/css/base.css" rel="stylesheet">
<link href="<%=basePath%>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<%=basePath%>resource/easyui/uimaker/icon.css">
<link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css">
<link rel="stylesheet" href="<%=basePath%>resource/css/form.css">
<title><spring:message code="menu.consignee_info_set" /></title>
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
src="<%=basePath %>resource/easyui/easyui-lang-${pageContext.response.locale}.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
<!--弹出层引入的JS-->
<script type="text/javascript" src="<%=basePath%>resource/layer-v3.0.3/layer/layer.js"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
<link rel="stylesheet" href="<%=basePath%>resource/layui/css/layui.css" media="all">
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
</head>
<body>
<div class="container">
<table id="dg" style="width: 100%;" title='<spring:message code="consignee.list"/>'
data-options="
rownumbers:true,
singleSelect:false,
autoRowHeight:false,
pagination:true,
fitColumns:true,
striped:true,
collapsible:true,
toolbar:'#tb',
pageSize:10">
<thead>
<tr>
<th field="id" checkbox="true"></th>
<th field="." formatter="editFormat" width="40"><spring:message code="opt.edit" /></th>
<th field="code" width="100"><spring:message code="consignee.code" /></th>
<th field="name" width="100"><spring:message code="consignee.name" /></th>
<th field="address" width="100"><spring:message code="consignee.address" /></th>
<th field="tel" width="50"><spring:message code="consignee.tel" /></th>
</tr>
</thead>
</table>
<div id="tb" style="padding: 0 30px;">
<input type="hidden" id="idcc">
<form id="searchForm">
<table class="search_form_table">
<a href="javascript:editRow()" class="easyui-linkbutton"
style="background: #18A197; color: #FFF; border: 1px solid #18A197;" iconCls="icon-add">
<spring:message code="opt.add" />
</a>
<a href="javascript:doDelete()" class="easyui-linkbutton"
style="background: red; color: #FFF; border: 1px solid red" iconCls="icon-no">
<spring:message code="opt.delete" />
</a>
</table>
</form>
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<spring:message code="menu.consignee_info_set" />
</h2>
<div class="layui-colla-content layui-show">
<div class="layui-row">
<div class="layui-col-md2">
<button class="layui-btn" onclick="edit()">新增</button>
<button class="layui-btn layui-btn-danger" onclick="onDelete()">删除</button>
</div>
<div class="layui-col-md3">
<input id="searchInput" class="layui-input" type="text"
oninput="onInputChange(event,'searchInput','oninput')"
onpropertychange="onInputChange(event,'searchInput','onpropertychange')"
placeholder="请输入关键字" autocomplete="on">
</div>
<div class="layui-col-md3">
<button class="layui-btn layui-btn-normal" onclick="doSearch()">搜索</button>
</div>
</div>
<table id="consignee-table" class="layui-hide" lay-filter="consignee-table"></table>
</div>
</div>
</div>
<script type="text/html" id="opt-bar">
<i class="layui-icon layui-icon-edit" style="font-size: 14px; color: #1E9FFF;" lay-event="edit">编辑</i>
</script>
<script type="text/html" id="choose-bar">
<i class="layui-icon layui-icon-ok" style="font-size: 15px;font:bold; color: blue;" lay-event="choose">选择</i>
</script>
<script>
<%-- $.ajax({
url:"<%=basePath %>consignee/grid.json",
success:function(data){
console.log(data);
var layer;
layui.use('layer', function() {
layer = layui.layer;
});
layui.use('element', function() {
var element = layui.element;
});
$(window).load(function() {
doSearch();
});
var table;
function doSearch() {
var api = "<%=basePath%>consignee/search";
var searchKey = $("#searchInput").val();
if(!isEmpty(searchKey)){
api += "?key="+searchKey;
}
layui.use('table', function() {
table = layui.table;
table.on('checkbox(consignee-table)', function(obj) {
/* console.log(JSON.stringify(obj)) */
});
table.render({
elem : '#consignee-table',
url : api,
limit : 10,
page : true,
loading : true,
limits : [ 10, 15, 20, 25, 30, 35, 40, 45, 50 ],
text : {none:'暂无数据'},
cols : [ [ //表头
{
type : 'checkbox',
fixed : 'left',
width : 60
}, {
field : '',
title : '操作',
toolbar : '#opt-bar',
width : 80
},
<c:if test="${isWithChoose}">{field : '',title : '选择',toolbar : '#choose-bar',width : 80}, </c:if>
{
field : 'name',
title : '收货人公司',
}, {
field : 'city',
title : '收货人城市',
sort : true
}, {
field : 'country',
title : '国家代码',
sort : true,
width : 100
}, {
field : 'tel',
title : '电话'
} ] ]
});
});
}
function onDelete() {
var checkStatus = table.checkStatus('consignee-table');
var data = checkStatus.data;
if(data&&data.length){
var ids="";
for (var i = 0; i < data.length; i++) {
var item = data[i];
var id = item.id;
ids+=id;
ids+=","
}
parent.layer.confirm('确定删除吗?', function(index) {
parent.layer.close(index);
doDelete(ids);
});
}
}); --%>
$(function(){
$("#dg").datagrid({
url:"<%=basePath%>consignee/grid.json",
/* queryParams:$("#searchForm").serializeJson(), */
onLoadSuccess:function(data){
console.log("load data success!");
}
function doDelete(ids) {
var api = "<%=basePath%>consignee/delete";
$.post(api, "ids="+ids, function(response, status) {
if(response.status==200){
parent.layer.msg('删除成功');
window.location.reload();
}else{
parent.layer.msg("操作失败");
console.log("response-->"+JSON.stringify(response));
}
});
}
layui.use('table', function() {
var table = layui.table;
table.on('tool(consignee-table)', function(obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var tr = obj.tr; //获得当前行 tr 的DOM对象
if (layEvent === 'edit') { //编辑
window.location.href = "<%=basePath%>/consignee/edit?id="+data.id;
}else if (layEvent === 'choose') {
//选择
var iframe = window.parent.document.getElementById('page-iframe').contentWindow;
iframe.onReceivConsignee(data);
parent.layer.closeAll();
}
});
});
function editFormat(val, row, index){
console.log(row);
return '<a href="javascript:void(0)" style="padding-left:10px;text-decoration:none;padding-right:20px;" onclick="editRow('+row.id+')"><i class="iconfont">&#xe65a;</i></a>';
function edit(){
window.location.href = "<%=basePath%>/consignee/edit";
}
function editRow(id){
if(typeof(id) == "undefined")
window.location.href = "<%=basePath%>/consignee/edit";
else
window.location.href = "<%=basePath%>/consignee/edit?id="+id;
}
function doDelete(){
var rows = $("#dg").datagrid('getChecked');
if(rows.length==0){
layer.open({content:"请先选中要删除的行"});
return false;
}
layer.confirm("确定要删除么?",{btn:['确定','取消']}, function () {
$.post("<%=basePath%>consignee/delete",{ids:getIds().join(",")},function(data){
if(data.status == 200) {
layer.confirm("删除成功!",{btn:['确定','取消']},function(){
window.location.href="<%=basePath%>consignee/list";
})
}else{
layer.open({content:"删除失败!"});
}
},"json");
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><string:message code="menu.consignee_info_set" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath%>resource/css/base.css" rel="stylesheet">
<link href="<%=basePath%>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<%=basePath%>resource/easyui/uimaker/icon.css">
<link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css">
<link rel="stylesheet" href="<%=basePath%>resource/css/form.css">
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
src="<%=basePath %>resource/easyui/easyui-lang-${pageContext.response.locale}.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
<!--弹出层引入的JS-->
<script type="text/javascript" src="<%=basePath%>resource/layer-v3.0.3/layer/layer.js"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
<table id="dg" style="width: 100%;" title='<spring:message code="consignee.list"/>'
data-options="
rownumbers:true,
singleSelect:false,
autoRowHeight:false,
pagination:true,
fitColumns:true,
striped:true,
collapsible:true,
toolbar:'#tb',
pageSize:10">
<thead>
<tr>
<th field="id" checkbox="true"></th>
<th field="." formatter="editFormat" width="40"><spring:message code="opt.edit" /></th>
<th field="code" width="100"><spring:message code="consignee.code" /></th>
<th field="name" width="100"><spring:message code="consignee.name" /></th>
<th field="address" width="100"><spring:message code="consignee.address" /></th>
<th field="tel" width="50"><spring:message code="consignee.tel" /></th>
</tr>
</thead>
</table>
<div id="tb" style="padding: 0 30px;">
<input type="hidden" id="idcc">
<form id="searchForm">
<table class="search_form_table">
<a href="javascript:editRow()" class="easyui-linkbutton"
style="background: #18A197; color: #FFF; border: 1px solid #18A197;" iconCls="icon-add">
<spring:message code="opt.add" />
</a>
<a href="javascript:doDelete()" class="easyui-linkbutton"
style="background: red; color: #FFF; border: 1px solid red" iconCls="icon-no">
<spring:message code="opt.delete" />
</a>
</table>
</form>
</div>
</div>
<script>
<%-- $.ajax({
url:"<%=basePath %>consignee/grid.json",
success:function(data){
console.log(data);
}
}); --%>
$(function(){
$("#dg").datagrid({
url:"<%=basePath%>consignee/grid.json",
/* queryParams:$("#searchForm").serializeJson(), */
onLoadSuccess:function(data){
console.log("load data success!");
}
});
});
function editFormat(val, row, index){
console.log(row);
return '<a href="javascript:void(0)" style="padding-left:10px;text-decoration:none;padding-right:20px;" onclick="editRow('+row.id+')"><i class="iconfont">&#xe65a;</i></a>';
}
function editRow(id){
if(typeof(id) == "undefined")
window.location.href = "<%=basePath%>/consignee/edit";
else
window.location.href = "<%=basePath%>/consignee/edit?id="+id;
}
function doDelete(){
var rows = $("#dg").datagrid('getChecked');
if(rows.length==0){
layer.open({content:"请先选中要删除的行"});
return false;
}
layer.confirm("确定要删除么?",{btn:['确定','取消']}, function () {
$.post("<%=basePath%>consignee/delete",{ids:getIds().join(",")},function(data){
if(data.status == 200) {
layer.confirm("删除成功!",{btn:['确定','取消']},function(){
window.location.href="<%=basePath%>consignee/list";
})
}else{
layer.open({content:"删除失败!"});
}
},"json");
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -23,79 +23,91 @@
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
</head>
<body>
<form class="layui-form">
<input type="hidden" id="id" name="id" value="${consignor.id}">
<table class="layui-table">
<tbody>
<tr>
<td><spring:message code="manifest.company" /><span class="required_span">*</span></td>
<td colspan="5"><input type="text" name="co_company" id="co_company" maxlength="70"
value="${consignor.co_company}" autocomplete="off" class="layui-input" required
maxlength="45" oninput="onInputChange(event,'co_company','oninput')"
onpropertychange="onInputChange(event,'co_company','onpropertychange')"></td>
</tr>
<tr>
<td><spring:message code="manifest.send_name" /><span class="required_span">*</span></td>
<td><input type="text" name="co_name" value="${consignor.co_name}" maxlength="70"
autocomplete="off" class="layui-input" required maxlength="50"></td>
<td><spring:message code="manifest.telephone" /></td>
<td><input type="text" name="co_telephone" placeholder="<spring:message code="manifest.fhr.fh_placeholder"/>"
value="${consignor.co_telephone}" autocomplete="off" class="layui-input" maxlength="50"></td>
<td><spring:message code="manifest.fax" /></td>
<td><input type="text" name="co_fax" placeholder="<spring:message code="manifest.fhr.fh_placeholder"/>" value="${consignor.co_fax}"
autocomplete="off" class="layui-input" maxlength="45"></td>
</tr>
<tr>
<td><spring:message code="manifest.country" /><span class="required_span">*</span></td>
<td><input required type="text" name="co_country" value="${consignor.co_country}"
autocomplete="off" class="layui-input" maxlength="2"></td>
<td><spring:message code="manifest.city" /></td>
<td><input type="text" name="co_city"
value="${consignor.co_city}" autocomplete="off" class="layui-input" required maxlength="70"></td>
<td><spring:message code="manifest.zip.code" /></td>
<td><input type="text" name="co_zipcode" value="${consignor.co_zipcode}"
autocomplete="off" class="layui-input" maxlength="9"></td>
</tr>
<tr>
<td><spring:message code="manifest.address" /><span class="required_span">*</span></td>
<td colspan="5"><input required type="text" name="co_address"
value="${consignor.co_address}" autocomplete="off" class="layui-input" maxlength="70"></td>
</tr>
<tr>
<td><spring:message code="manifest.fhr.shpcusid" /><span class="required_span">*</span></td>
<td><input id="shpcusid" type="text" name="shpcusid" value="${consignor.shpcusid}"
autocomplete="off" class="layui-input" maxlength="100" oninput="onInputChange(event,'shpcusid','oninput')"
onpropertychange="onInputChange(event,'shpcusid','onpropertychange')"></td>
<td><spring:message code="manifest.fhr.shpaeo" /></td>
<td colspan="3"><input type="text" name="shpaeo" id="shpaeo"
value="${consignor.shpaeo}" autocomplete="off" class="layui-input" maxlength="20"
oninput="onInputChange(event,'shpaeo','oninput')"
onpropertychange="onInputChange(event,'shpaeo','onpropertychange')"></td>
</tr>
</tbody>
</table>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo"><spring:message code="opt.save"/></span></button>
<button type="button" class="layui-btn layui-btn-primary"
onclick="self.location=document.referrer;">返回</button>
<div style="padding: 15px;">
<h3>编辑发货人</h3>
<form class="layui-form">
<input type="hidden" id="id" name="id" value="${consignor.id}">
<table class="layui-table">
<tbody>
<tr>
<td><spring:message code="manifest.company" /><span class="required_span">*</span></td>
<td colspan="5"><input type="text" name="co_company" id="co_company" maxlength="70"
value="${consignor.co_company}" autocomplete="off" class="layui-input" required lay-verify="required"
oninput="onInputChange(event,'co_company','oninput')"
onpropertychange="onInputChange(event,'co_company','onpropertychange')"></td>
</tr>
<tr>
<td><spring:message code="manifest.send_name" /><span class="required_span">*</span></td>
<td><input type="text" id="co_name" name="co_name" value="${consignor.co_name}" maxlength="70"
autocomplete="off" class="layui-input" required lay-verify="required"
oninput="onInputChange(event,'co_name','oninput')"
onpropertychange="onInputChange(event,'co_name','onpropertychange')"></td>
<td><spring:message code="manifest.telephone" /></td>
<td><input type="text" name="co_telephone" placeholder="<spring:message code="manifest.fhr.fh_placeholder"/>"
value="${consignor.co_telephone}" autocomplete="off" class="layui-input" maxlength="50"></td>
<td><spring:message code="manifest.fax" /></td>
<td><input type="text" name="co_fax" placeholder="<spring:message code="manifest.fhr.fh_placeholder"/>" value="${consignor.co_fax}"
autocomplete="off" class="layui-input" maxlength="50"></td>
</tr>
<tr>
<td><spring:message code="manifest.country" /><span class="required_span">*</span></td>
<td><input required id="co_country" type="text" name="co_country" value="${consignor.co_country}"
autocomplete="off" class="layui-input" maxlength="2" lay-verify="required"
oninput="onInputChange(event,'co_country','oninput')"
onpropertychange="onInputChange(event,'co_country','onpropertychange')"></td>
<td><spring:message code="manifest.city" /></td>
<td>
<input type="text" name="co_city" id="co_city" value="${consignor.co_city}"
autocomplete="off" class="layui-input" required maxlength="35" lay-verify="required"
oninput="onInputChange(event,'co_city','oninput')"
onpropertychange="onInputChange(event,'co_city','onpropertychange')">
</td>
<td><spring:message code="manifest.zip.code" /></td>
<td><input type="text" name="co_zipcode" value="${consignor.co_zipcode}"
autocomplete="off" class="layui-input" maxlength="9"></td>
</tr>
<tr>
<td><spring:message code="manifest.address" /><span class="required_span">*</span></td>
<td colspan="5"><input id="co_address" required type="text" name="co_address" lay-verify="required"
value="${consignor.co_address}" autocomplete="off" class="layui-input" maxlength="70"
oninput="onInputChange(event,'co_address','oninput')"
onpropertychange="onInputChange(event,'co_address','onpropertychange')"></td>
</tr>
<tr>
<td><spring:message code="manifest.enterprise.code" /><span class="required_span">*</span></td>
<td><input required id="shpcusid" type="text" name="shpcusid" value="${consignor.shpcusid}" lay-verify="required"
autocomplete="off" class="layui-input" maxlength="128" oninput="onInputChange(event,'shpcusid','oninput')"
onpropertychange="onInputChange(event,'shpcusid','onpropertychange')"></td>
<td><spring:message code="manifest.fhr.shpaeo" /></td>
<td colspan="3"><input type="text" name="shpaeo" id="shpaeo"
value="${consignor.shpaeo}" autocomplete="off" class="layui-input" maxlength="20"
oninput="onInputChange(event,'shpaeo','oninput')"
onpropertychange="onInputChange(event,'shpaeo','onpropertychange')"></td>
</tr>
</tbody>
</table>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo"><spring:message code="opt.save"/></span></button>
<button type="button" class="layui-btn layui-btn-primary"
onclick="self.location=document.referrer;">返回</button>
</div>
</div>
</div>
</form>
</form>
</div>
<script>
var layer;
... ...
... ... @@ -20,10 +20,12 @@
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
<link rel="stylesheet" href="<%=basePath%>resource/layui/css/layui.css" media="all">
<script type="text/javascript" src="<%=basePath%>resource/layer-v3.0.3/layer/layer.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js"></script>
<script type="text/javascript" src="<%=basePath%>resource/js/tools.js"></script>
</head>
<body>
<input type="hidden" id="mainIframeName" name="mainIframeName" value="${parentName}">
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title">
... ... @@ -31,10 +33,19 @@
</h2>
<div class="layui-colla-content layui-show">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-col-md2">
<button class="layui-btn" onclick="edit()">新增</button>
<button class="layui-btn layui-btn-danger" onclick="onDelete()">删除</button>
</div>
<div class="layui-col-md3">
<input id="searchInput" class="layui-input" type="text"
oninput="onInputChange(event,'searchInput','oninput')"
onpropertychange="onInputChange(event,'searchInput','onpropertychange')"
placeholder="请输入关键字" autocomplete="on">
</div>
<div class="layui-col-md3">
<button class="layui-btn layui-btn-normal" onclick="doSearch()">搜索</button>
</div>
</div>
<table id="consignor-table" class="layui-hide" lay-filter="consignor-table"></table>
</div>
... ... @@ -44,6 +55,10 @@
<script type="text/html" id="opt-bar">
<i class="layui-icon layui-icon-edit" style="font-size: 14px; color: #1E9FFF;" lay-event="edit">编辑</i>
</script>
<script type="text/html" id="choose-bar">
<i class="layui-icon layui-icon-ok" style="font-size: 15px;font:bold; color: blue;" lay-event="choose">选择</i>
</script>
<script>
var layer;
... ... @@ -62,6 +77,11 @@
var table;
function doSearch() {
var api = "<%=basePath%>consignor/search";
var searchKey = $("#searchInput").val();
if(!isEmpty(searchKey)){
api += "?key="+searchKey;
}
layui.use('table', function() {
table = layui.table;
table.on('checkbox(consignor-table)', function(obj) {
... ... @@ -75,7 +95,7 @@
page : true,
loading : true,
limits : [ 10, 15, 20, 25, 30, 35, 40, 45, 50 ],
text : '暂无数据',
text : {none:'暂无数据'},
cols : [ [ //表头
{
type : 'checkbox',
... ... @@ -86,7 +106,9 @@
title : '操作',
toolbar : '#opt-bar',
width : 80
}, {
},
<c:if test="${isWithChoose}">{field : '',title : '选择',toolbar : '#choose-bar',width : 80}, </c:if>
{
field : 'co_company',
title : '发货人公司',
}, {
... ... @@ -119,7 +141,7 @@
}
parent.layer.confirm('确定删除吗?', function(index) {
layer.close(index);
parent.layer.close(index);
doDelete(ids);
});
}
... ... @@ -129,10 +151,10 @@
var api = "<%=basePath%>consignor/delete";
$.post(api, "ids="+ids, function(response, status) {
if(response.status==200){
layer.msg('删除成功');
parent.layer.msg('删除成功');
window.location.reload();
}else{
layer.msg("操作失败");
parent.layer.msg("操作失败");
console.log("response-->"+JSON.stringify(response));
}
});
... ... @@ -145,12 +167,19 @@
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var tr = obj.tr; //获得当前行 tr 的DOM对象
if (layEvent === 'edit') { //编辑
if (layEvent === 'edit') {
//编辑
window.location.href = "<%=basePath%>/consignor/edit?id="+data.id;
}else if (layEvent === 'choose') {
//选择
var iframe = window.parent.document.getElementById('page-iframe').contentWindow;
iframe.onReceivConsignor(data);
parent.layer.closeAll();
}
});
});
function edit(){
window.location.href = "<%=basePath%>/consignor/edit";
}
... ...
... ... @@ -164,7 +164,7 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<div id="pf-page">
<div class="easyui-tabs1" style="width:100%;height:100%;">
<div title='<spring:message code="menu.premanifest" />' data-options="closable:true">
<iframe class="page-iframe" src="<%=basePath %>manifest/list?type=domestic" frameborder="no" border="no" height="100%" width="100%" scrolling="auto"></iframe>
<iframe id="page-iframe" class="page-iframe" src="<%=basePath %>manifest/list?type=domestic" frameborder="no" border="no" height="100%" width="100%" scrolling="auto"></iframe>
</div>
</div>
</div>
... ...
... ... @@ -38,6 +38,7 @@
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
... ... @@ -82,57 +83,14 @@
checkNo(val);
}
//用户输入订单号满足格式
<%-- if(val.length == 12 && val.indexOf("-") >= 0)
{
$.ajax({
url:"<%=basePath%>/manifest/gettreecode",
method:"get",
data:{
STOCKPRE:val.split("-")[0]
},
success:function(data){
var d = data.data;
$("#carrier").val(d.cARRIERID);
}
});
} --%>
}
</script>
</tr>
<!-- <tr> -->
<%-- <td class="kv-label"><spring:message code="delivery.name.of.goods" /></td>
<td class="kv-content"><input id="name_ofgoods" name="name_ofgoods" type="text"
value="${manifest.name_ofgoods }"></td> --%>
<%-- <td class="kv-label"><spring:message code="delivery.delivery.station" /><span
class="required_span">*</span></td>
<td class="kv-content"><select id="delivery_station" name="delivery_station">
<option value="001"
<c:if test = "${manifest.delivery_station ==001 }">selected="selected"</c:if>><spring:message
code="delivery.ground.handling" /></option>
</select></td>
<td class="kv-label"><spring:message code="delivery.delivery.type" /></td>
<td class="kv-content"><select class="delivery" id="de_type" name="de_type">
<option value="001" <c:if test = "${manifest.de_type ==001 }">selected="selected"</c:if>><spring:message
code="manifest.general.delivery" /></option>
<option value="002" <c:if test = "${manifest.de_type ==002 }">selected="selected"</c:if>><spring:message
code="manifest.mail.delivery" /></option>
<option value="003" <c:if test = "${manifest.de_type ==003 }">selected="selected"</c:if>><spring:message
code="manifest.International" /></option>
</select></td> --%>
<!-- </tr> -->
<tr>
<td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="6"><spring:message
code="manifest.flight.information" /></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.carrier" /><span
class="required_span">*</span></td> --%>
<%-- <td class="kv-content"><input required id="carrier_new" name="carrier" type="text"
placeholder="<spring:message code='manifest.carrier.tip'/>"
value="${manifest.carrier}" oninput="onInputChange(event,'carrier_new','oninput')"
onpropertychange="onInputChange(event,'carrier_new','onpropertychange')"></td> --%>
<td class="kv-label"><spring:message code="manifest.flight.number" /><span
class="required_span">*</span></td>
<td class="kv-content"><input required id="flightno" name="flightno" type="text"
... ... @@ -261,23 +219,12 @@
</td>
</tr>
<%-- <tr>
<td class="kv-label"><spring:message code="manifest.agent.name" /></td>
<td class="kv-content"><input id="agentman" name="agentman" type="text"
value="${manifest.agentman}"
placeholder="<spring:message code="agent.namePlaceholder"/>"></td>
<td class="kv-label"><spring:message code="manifest.agent.company" /></td>
<td class="kv-content" colspan="3">
<input id="agentcompany" name="agentcompany" type="text" value="${manifest.agentcompany}"
placeholder="<spring:message code="agent.companyPlaceholder"/>">
</td>
</tr> --%>
<!-- 发货人信息 start -->
<tr style="background-color: #EBEDF4; color: black;">
<td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="1"><spring:message
code="manifest.shipper.information" /></td>
<!-- <td class="kv-label"> <button type="button" class="layui-btn layui-btn-normal layui-icon layui-icon-user" onclick="showDialog()">弹出选择框</button> </td> -->
<td class="kv-content" colspan="4"><select onchange="changeConsignorSelect()"
<td class="kv-label"> <button type="button" class="layui-btn layui-btn-sm layui-icon layui-icon-user" onclick="showConsignorDialog()">请选择发货人</button> </td>
<%-- <td class="kv-content" colspan="4"><select onchange="changeConsignorSelect()"
id="fh_select">
<option value="-1">请选择</option>
</select> <script>
... ... @@ -337,7 +284,7 @@
}
});
</script>
</td>
</td> --%>
</tr>
<tr>
<td class="kv-label"><spring:message code="manifest.company" /><span
... ... @@ -361,10 +308,6 @@
onpropertychange="onInputChange(event,'co_country','onpropertychange')"></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.city" /></td>
<td class="kv-content"><input id="co_city" name="co_city" type="text"
value="${manifest.co_city }" oninput="onInputChange(event,'co_city','oninput')"
onpropertychange="onInputChange(event,'co_city','onpropertychange')"></td> --%>
<td class="kv-label"><spring:message code="manifest.state" /></td>
<td class="kv-content"><input id="co_deltaname" name="co_deltaname" type="text" maxlength="35"
value="${manifest.co_deltaname}"></td>
... ... @@ -423,7 +366,8 @@
<tr style="background-color: #EBEDF4; color: black;">
<td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="1"><spring:message
code="manifest.consignee" /></td>
<td class="kv-content" colspan="5"><select onchange="changeConsigneeSelect()"
<td class="kv-label"> <button type="button" class="layui-btn layui-btn-sm layui-icon layui-icon-user" onclick="showConsigneeDialog()">请选择收货人</button> </td>
<%-- <td class="kv-content" colspan="5"><select onchange="changeConsigneeSelect()"
id="consignee_select">
<option value="-1">请选择</option>
</select> <script>
... ... @@ -437,7 +381,7 @@
var consignee = consigneeList[index];
$("#sh_company").val(consignee.code?consignee.code:"");
var address = consignee.co_address;
var address = consignee.address;
if(notEmpty(address)){
if(address.length>70){
address = address.substring(0,70);
... ... @@ -471,7 +415,7 @@
}
}
});
</script></td>
</script></td> --%>
</tr>
<tr>
<td class="kv-label"><spring:message code="manifest.company" /><span
... ... @@ -522,16 +466,6 @@
<td style="display: none;" class="kv-content" colspan="5"><input required id="sh_name"
name="sh_name" type="text" value="${manifest.sh_name }"></td>
</tr>
<%-- <tr>
<td class="kv-label"><spring:message code="manifest.province.code" /></td>
<td class="kv-content"><input id="sh_provincecode" name="sh_provincecode" type="text"
value="${manifest.sh_provincecode }"
oninput="onInputChange(event,'sh_provincecode','oninput')"
onpropertychange="onInputChange(event,'sh_provincecode','onpropertychange')"></td>
<td class="kv-label"><spring:message code="manifest.province.name" /></td>
<td class="kv-content" colspan="3"><input id="sh_provincename" name="sh_provincename" type="text"
value="${manifest.sh_provincename }"></td>
</tr> --%>
<tr>
<td class="kv-label" colspan="6">
... ... @@ -749,8 +683,6 @@ $(function(){
submitHandler:function(form){
var co_telephone = $("#co_telephone").val();
var co_fax = $("#co_fax").val();
console.log("co_telephone-->"+co_telephone);
console.log("co_fax-->"+co_fax);
if(isEmpty(co_telephone)&&isEmpty(co_fax)){
layer.open({content: "<spring:message code='manifest.fhr.fh_placeholder'/>"});
... ... @@ -1082,16 +1014,93 @@ $(function(){
});
}
function showDialog() {
function onReceivConsignor(consignor){
if(consignor){
$("#co_company").val(consignor.co_company?consignor.co_company.toUpperCase():"");
var address = consignor.co_address;
if(notEmpty(address)){
if(address.length>70){
address = address.substring(0,70);
}
}else{
address = "";
}
$("#co_address").val(address.toUpperCase());
$("#co_telephone").val(consignor.co_telephone?consignor.co_telephone:"");
$("#co_country").val(consignor.co_country?consignor.co_country:"CN");
$("#co_city").val(consignor.co_city?consignor.co_city.toUpperCase():"");
$("#co_deltaname").val(consignor.co_deltaname?consignor.co_deltaname.toUpperCase():"");
$("#co_name").val(consignor.co_name?consignor.co_name.toUpperCase():"");
$("#co_fax").val(consignor.co_fax?consignor.co_fax:"");
$("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:"");
$("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:"");
if(notEmpty(consignor.shpcusid)){
var temp_1 = consignor.shpcusid.split("+")[0];
var temp_2 = consignor.shpcusid.split("+")[1];
if(notEmpty(temp_2)){
$("#shpcusid").val(temp_2.toUpperCase());
}
}
}
}
function showConsignorDialog() {
var parentName= window.name;
layui.use('layer', function(){
var layer = layui.layer;
var viewUrl="<%=basePath%>consignor/list?isWithChoose=true";
parent.layer.open({
type: 2,
title: '',
shadeClose: false,
shade: 0.8,
area: ['90%', '80%'],
content: viewUrl
});
});
}
function onReceivConsignee(consignee) {
var address = consignee.address;
if(notEmpty(address)){
if(address.length>70){
address = address.substring(0,70);
}
}else{
address = "";
}
$("#sh_address").val(address.toUpperCase());
$("#sh_company").val(consignee.name?consignee.name:"");
$("#sh_telephone").val(consignee.tel?consignee.tel:"");
$("#sh_country").val(consignee.name?consignee.name:"");
$("#sh_name").val(consignee.code?consignee.code:"");
$("#sh_city").val(consignee.city?consignee.city.toUpperCase():"");
$("#sh_fax").val(consignee.fax?consignee.fax:"");
$("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:"");
$("#cneaeo").val(consignee.aeo?consignee.aeo:"");
if(notEmpty(consignee.cusid)){
var temp_1 = consignee.cusid.split("+")[0];
var temp_2 = consignee.cusid.split("+")[1];
if(notEmpty(temp_2)){
$("#cnecusid").val(temp_2.toUpperCase());
}
}
}
function showConsigneeDialog() {
var parentName= window.name;
layui.use('layer', function(){
var layer = layui.layer;
var viewUrl="<%=basePath%>consignor/list";
var viewUrl="<%=basePath%>consignee/list?isWithChoose=true";
parent.layer.open({
type: 2,
title: '',
shadeClose: true,
shadeClose: false,
shade: 0.8,
area: ['50%', '90%'],
area: ['90%', '80%'],
content: viewUrl
});
});
... ...
... ... @@ -43,8 +43,8 @@
<th field="flightdate" formatter="formatFlightDate"><spring:message code="manifest.flight.date"/></th>
<th field="originatingstation"><spring:message code="manifest.starting.point"/></th>
<th field="destinationstation"><spring:message code="manifest.destination"/></th>
<th field="preparetotalweight"><spring:message code="manifest.pre.weight"/></th>
<th field="preparetotalpiece"><spring:message code="manifest.number.of.fittings"/></th>
<th field="preparetotalweight"><spring:message code="manifest.pre.weight"/></th>
<th field="response_text" formatter="checkResponseText" width="200"><spring:message code="manifest.response_text" /></th>
<th field=".." formatter="operatorFormat"><spring:message code="opt.operator" /></th>
</tr>
... ...
... ... @@ -66,10 +66,6 @@
name="waybillnosecondary" type="hidden" value="${pre.waybillnosecondary }"></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="delivery.name.of.goods" /><span
class="required_span">*</span></td>
<td class="kv-content"><input required id="name_ofgoods" name="name_ofgoods" type="text"
value="${pre.name_ofgoods }"></td> --%>
<td class="kv-label"><spring:message code="delivery.delivery.station" /><span
class="required_span">*</span></td>
<td class="kv-content"><select required id="delivery_station" name="delivery_station">
... ... @@ -97,13 +93,6 @@
code="manifest.flight.information" /></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.carrier" /><span
class="required_span">*</span></td> --%>
<%-- <td class="kv-content"><input required id="carrier_new" name="carrier" type="text"
placeholder="<spring:message code='manifest.carrier.tip'/>"
value="${pre.carrier}" oninput="onInputChange(event,'carrier_new','oninput')"
onpropertychange="onInputChange(event,'carrier_new','onpropertychange')"></td> --%>
<td class="kv-label"><spring:message code="manifest.flight.number" /><span
class="required_span">*</span></td>
<td class="kv-content"><input required id="flightno" name="flightno" type="text"
... ... @@ -220,22 +209,14 @@
onpropertychange="onInputChange(event,'productname','onpropertychange')"/>
</td>
</tr>
<%-- <tr>
<td class="kv-label"><spring:message code="manifest.agent.name" /></td>
<td class="kv-content"><input id="agentman" name="agentman" type="text"
value="${agent.threeCode}" placeholder="<spring:message code="agent.namePlaceholder"/>"></td>
<td class="kv-label"><spring:message code="manifest.agent.company" /></td>
<td class="kv-content" colspan="3"><input id="agentcompany" name="agentcompany"
style="width: 400px;" type="text" value="${agent.nameCn }"
placeholder="<spring:message code="agent.companyPlaceholder"/>"></td>
</tr> --%>
<!-- 货物信息 end -->
<!-- 发货信息 start -->
<tr style="background-color: #EBEDF4; color: black;">
<td style="background-color: #EBEDF4; color: black;" class="kv-label"><spring:message
code="manifest.shipper.information" /></td>
<td class="kv-content" colspan="5"><select onchange="changeConsignorSelect()"
<td class="kv-label"> <button type="button" class="layui-btn layui-btn-sm layui-icon layui-icon-user" onclick="showConsignorDialog()">请选择发货人</button> </td>
<%-- <td class="kv-content" colspan="5"><select onchange="changeConsignorSelect()"
id="fh_select">
<option value="-1">请选择</option>
</select> <script>
... ... @@ -294,7 +275,7 @@
}
}
});
</script></td>
</script></td> --%>
</tr>
<tr>
<td class="kv-label"><spring:message code="manifest.company" /><span
... ... @@ -318,10 +299,6 @@
onpropertychange="onInputChange(event,'co_country','onpropertychange')"></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.city" /><span class="required_span">*</span></td>
<td class="kv-content"><input required id="co_city" name="co_city" type="text"
value="${pre.co_city }" oninput="onInputChange(event,'co_city','oninput')"
onpropertychange="onInputChange(event,'co_city','onpropertychange')"></td> --%>
<td class="kv-label"><spring:message code="manifest.state" /></td>
<td class="kv-content"><input id="co_deltaname" name="co_deltaname" type="text" maxlength="35"
value="${pre.co_deltaname }"></td>
... ... @@ -347,10 +324,6 @@
onpropertychange="onInputChange(event,'shpaeo','onpropertychange')"></td>
</tr>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.fhr.shpcusid" /></td>
<td class="kv-content" colspan="3"><input id="shpcusid" name="shpcusid"
type="text" value="${pre.shpcusid }" oninput="onInputChange(event,'shpcusid','oninput')"
onpropertychange="onInputChange(event,'shpcusid','onpropertychange')"></td> --%>
<td class="kv-label" colspan="6"><select id="co_cusid" required>
<c:if test="${not empty pre.shpcusid}">
<c:set var="tempShpType" value='${fn:split(pre.shpcusid,"+")[0]}' />
... ... @@ -375,7 +348,8 @@
<tr style="background-color: #EBEDF4; color: black;">
<td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="1"><spring:message
code="manifest.consignee" /></td>
<td class="kv-content" colspan="5"><select onchange="changeConsigneeSelect()"
<td class="kv-label"> <button type="button" class="layui-btn layui-btn-sm layui-icon layui-icon-user" onclick="showConsigneeDialog()">请选择收货人</button> </td>
<%-- <td class="kv-content" colspan="5"><select onchange="changeConsigneeSelect()"
id="consignee_select">
<option value="-1">请选择</option>
</select> <script>
... ... @@ -413,7 +387,7 @@
}
}
});
</script></td>
</script></td> --%>
</tr>
<tr>
<td class="kv-label"><spring:message code="manifest.company" /><span
... ... @@ -462,21 +436,7 @@
onpropertychange="onInputChange(event,'cneaeo','onpropertychange')"></td>
</tr>
<%-- <tr>
<td class="kv-label"><spring:message code="manifest.province.code" /></td>
<td class="kv-content"><input id="sh_provincecode" name="sh_provincecode" type="text"
value="${pre.sh_provincecode }" oninput="onInputChange(event,'sh_provincecode','oninput')"
onpropertychange="onInputChange(event,'sh_provincecode','onpropertychange')"></td>
<td class="kv-label"><spring:message code="manifest.province.name" /></td>
<td class="kv-content" colspan="3"><input id="sh_provincename" name="sh_provincename"
type="text" value="${pre.sh_provincename }"></td>
</tr> --%>
<tr>
<%-- <td class="kv-label"><spring:message code="manifest.shr.cnecusid" /></td>
<td class="kv-content"><input id="cnecusid" name="cnecusid" type="text"
value="${pre.cnecusid }" oninput="onInputChange(event,'cnecusid','oninput')"
onpropertychange="onInputChange(event,'cnecusid','onpropertychange')"></td> --%>
<td class="kv-label" colspan="6"><select id="sh_cusid" required>
<c:if test="${not empty pre.cnecusid}">
<c:set var="tempCneType" value='${fn:split(pre.cnecusid,"+")[0]}' />
... ... @@ -744,7 +704,7 @@
layer.open({content: "有错"});
$("#ways").val("");
}else{
$.post("<%=basePath%>manifest/daryMawbNo",{id:$("#id").val(),mawbNo:wad},function(data) {
$.post("<%=basePath%>manifest/daryMawbNo",{waybillnomaster:$("#waybillnomaster").val(),waybillnoSub:wad},function(data) {
if (data.status == 500) {
layer.open({content: "<spring:message code="opt.repeatno"/>"});
$("#ways").val("");
... ... @@ -1071,9 +1031,6 @@
success : function(data) {
if (data.status == 200) {
if (data.data) {
console.log("shpType-->"+shpType);
console.log("cneType-->"+cneType);
for (var i = 0; i < data.data.length; i++) {
var type = data.data[i].enterprise_type;
if(selectId=="co_cusid"){
... ... @@ -1098,6 +1055,98 @@
});
}
function onReceivConsignor(consignor){
if(consignor){
$("#co_company").val(consignor.co_company?consignor.co_company.toUpperCase():"");
var address = consignor.co_address;
if(notEmpty(address)){
if(address.length>70){
address = address.substring(0,70);
}
}else{
address = "";
}
$("#co_address").val(address.toUpperCase());
$("#co_telephone").val(consignor.co_telephone?consignor.co_telephone:"");
$("#co_country").val(consignor.co_country?consignor.co_country:"CN");
$("#co_city").val(consignor.co_city?consignor.co_city.toUpperCase():"");
$("#co_deltaname").val(consignor.co_deltaname?consignor.co_deltaname.toUpperCase():"");
$("#co_name").val(consignor.co_name?consignor.co_name.toUpperCase():"");
$("#co_fax").val(consignor.co_fax?consignor.co_fax:"");
$("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:"");
$("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:"");
if(notEmpty(consignor.shpcusid)){
var temp_1 = consignor.shpcusid.split("+")[0];
var temp_2 = consignor.shpcusid.split("+")[1];
if(notEmpty(temp_2)){
$("#shpcusid").val(temp_2.toUpperCase());
}
}
}
}
function showConsignorDialog() {
var parentName= window.name;
layui.use('layer', function(){
var layer = layui.layer;
var viewUrl="<%=basePath%>consignor/list?isWithChoose=true";
parent.layer.open({
type: 2,
title: '',
shadeClose: false,
shade: 0.8,
area: ['90%', '80%'],
content: viewUrl
});
});
}
function onReceivConsignee(consignee) {
var address = consignee.address;
if(notEmpty(address)){
if(address.length>70){
address = address.substring(0,70);
}
}else{
address = "";
}
$("#sh_address").val(address.toUpperCase());
$("#sh_company").val(consignee.name?consignee.name:"");
$("#sh_telephone").val(consignee.tel?consignee.tel:"");
$("#sh_country").val(consignee.name?consignee.name:"");
$("#sh_name").val(consignee.code?consignee.code:"");
$("#sh_city").val(consignee.city?consignee.city.toUpperCase():"");
$("#sh_fax").val(consignee.fax?consignee.fax:"");
$("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:"");
$("#cneaeo").val(consignee.aeo?consignee.aeo:"");
if(notEmpty(consignee.cusid)){
var temp_1 = consignee.cusid.split("+")[0];
var temp_2 = consignee.cusid.split("+")[1];
if(notEmpty(temp_2)){
$("#cnecusid").val(temp_2.toUpperCase());
}
}
}
function showConsigneeDialog() {
var parentName= window.name;
layui.use('layer', function(){
var layer = layui.layer;
var viewUrl="<%=basePath%>consignee/list?isWithChoose=true";
parent.layer.open({
type: 2,
title: '',
shadeClose: false,
shade: 0.8,
area: ['90%', '80%'],
content: viewUrl
});
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...