From 920a4ebef6f4f70f097ee9d10c05a5481e2d43ab Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 16 十二月 2023 16:56:22 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/entity/param/LocOutAnfmePrintPara.java | 83 +++
src/main/java/com/zy/asrs/mapper/LocOutPrintMatMapper.java | 12
src/main/resources/mapper/LocOutPrintMatMapper.xml | 24 +
src/main/java/com/zy/common/CodeBuilder.java | 2
src/main/java/com/zy/asrs/service/impl/LocOutPrintMatServiceImpl.java | 12
src/main/java/locOutPrintMat.sql | 18
src/main/webapp/views/locOutPrintMat/locOutPrintMat.html | 393 +++++++++++++++++
src/main/java/com/zy/asrs/entity/LocOutPrintMat.java | 208 +++++++++
src/main/java/com/zy/asrs/controller/LocOutPrintMatController.java | 123 +++++
src/main/webapp/static/js/locOutPrintMat/locOutPrintMat.js | 336 +++++++++++++++
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 12
src/main/java/com/zy/asrs/controller/MatController.java | 73 +++
src/main/java/com/zy/asrs/service/LocOutPrintMatService.java | 8
13 files changed, 1,303 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/LocOutPrintMatController.java b/src/main/java/com/zy/asrs/controller/LocOutPrintMatController.java
new file mode 100644
index 0000000..2f6d514
--- /dev/null
+++ b/src/main/java/com/zy/asrs/controller/LocOutPrintMatController.java
@@ -0,0 +1,123 @@
+package com.zy.asrs.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.common.DateUtils;
+import com.zy.asrs.entity.LocOutPrintMat;
+import com.zy.asrs.service.LocOutPrintMatService;
+import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.R;
+import com.zy.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+public class LocOutPrintMatController extends BaseController {
+
+ @Autowired
+ private LocOutPrintMatService locOutPrintMatService;
+
+ @RequestMapping(value = "/locOutPrintMat/{id}/auth")
+ @ManagerAuth
+ public R get(@PathVariable("id") String id) {
+ return R.ok(locOutPrintMatService.selectById(String.valueOf(id)));
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/list/auth")
+ @ManagerAuth
+ public R list(@RequestParam(defaultValue = "1")Integer curr,
+ @RequestParam(defaultValue = "10")Integer limit,
+ @RequestParam(required = false)String orderByField,
+ @RequestParam(required = false)String orderByType,
+ @RequestParam Map<String, Object> param){
+ EntityWrapper<LocOutPrintMat> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ convert(param, wrapper);
+ if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+ return R.ok(locOutPrintMatService.selectPage(new Page<>(curr, limit), wrapper));
+ }
+
+ private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
+ for (Map.Entry<String, Object> entry : map.entrySet()){
+ String val = String.valueOf(entry.getValue());
+ if (val.contains(RANGE_TIME_LINK)){
+ String[] dates = val.split(RANGE_TIME_LINK);
+ wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+ wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+ } else {
+ wrapper.like(entry.getKey(), val);
+ }
+ }
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/add/auth")
+ @ManagerAuth
+ public R add(LocOutPrintMat locOutPrintMat) {
+ locOutPrintMatService.insert(locOutPrintMat);
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/update/auth")
+ @ManagerAuth
+ public R update(LocOutPrintMat locOutPrintMat){
+ if (Cools.isEmpty(locOutPrintMat) || null==locOutPrintMat.getId()){
+ return R.error();
+ }
+ locOutPrintMatService.updateById(locOutPrintMat);
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/delete/auth")
+ @ManagerAuth
+ public R delete(@RequestParam(value="ids[]") Long[] ids){
+ for (Long id : ids){
+ locOutPrintMatService.deleteById(id);
+ }
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/export/auth")
+ @ManagerAuth
+ public R export(@RequestBody JSONObject param){
+ EntityWrapper<LocOutPrintMat> wrapper = new EntityWrapper<>();
+ List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+ Map<String, Object> map = excludeTrash(param.getJSONObject("locOutPrintMat"));
+ convert(map, wrapper);
+ List<LocOutPrintMat> list = locOutPrintMatService.selectList(wrapper);
+ return R.ok(exportSupport(list, fields));
+ }
+
+ @RequestMapping(value = "/locOutPrintMatQuery/auth")
+ @ManagerAuth
+ public R query(String condition) {
+ EntityWrapper<LocOutPrintMat> wrapper = new EntityWrapper<>();
+ wrapper.like("id", condition);
+ Page<LocOutPrintMat> page = locOutPrintMatService.selectPage(new Page<>(0, 10), wrapper);
+ List<Map<String, Object>> result = new ArrayList<>();
+ for (LocOutPrintMat locOutPrintMat : page.getRecords()){
+ Map<String, Object> map = new HashMap<>();
+ map.put("id", locOutPrintMat.getId());
+ map.put("value", locOutPrintMat.getId());
+ result.add(map);
+ }
+ return R.ok(result);
+ }
+
+ @RequestMapping(value = "/locOutPrintMat/check/column/auth")
+ @ManagerAuth
+ public R query(@RequestBody JSONObject param) {
+ Wrapper<LocOutPrintMat> wrapper = new EntityWrapper<LocOutPrintMat>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+ if (null != locOutPrintMatService.selectOne(wrapper)){
+ return R.parse(BaseRes.REPEAT).add(getComment(LocOutPrintMat.class, String.valueOf(param.get("key"))));
+ }
+ return R.ok();
+ }
+
+}
diff --git a/src/main/java/com/zy/asrs/controller/MatController.java b/src/main/java/com/zy/asrs/controller/MatController.java
index 3c0ef82..4bc21fa 100644
--- a/src/main/java/com/zy/asrs/controller/MatController.java
+++ b/src/main/java/com/zy/asrs/controller/MatController.java
@@ -11,8 +11,10 @@
import com.core.common.*;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
+import com.zy.asrs.entity.param.LocOutAnfmePrintPara;
import com.zy.asrs.entity.result.KeyValueVo;
import com.zy.asrs.service.LocInPrintMatService;
+import com.zy.asrs.service.LocOutPrintMatService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.PakoutService;
import com.zy.asrs.utils.MatExcelListener;
@@ -45,6 +47,8 @@
private PakoutService pakoutService;
@Autowired
private LocInPrintMatService locInPrintMatService;
+ @Autowired
+ private LocOutPrintMatService locOutPrintMatService;
@RequestMapping(value = "/mat/auto/matnr/auth")
public R autoMatnr(){
@@ -301,6 +305,75 @@
return R.ok().add(res);
}
+ // 鎵撳嵃
+ @RequestMapping(value = "/loc/out/mat/print/auth")
+ @ManagerAuth(memo = "鍟嗗搧缂栫爜鎵撳嵃")
+ public R locOutMatCodePrint(@RequestParam(value = "param[]") Long[] ids) {
+ if(Cools.isEmpty(ids)) {
+ return R.parse(CodeRes.EMPTY);
+ }
+ List<MatPrint> res = new ArrayList<>();
+ List<String> memoList = new ArrayList<>();
+ for (Long id : ids){
+ LocOutPrintMat locOutPrintMat = locOutPrintMatService.selectById(id);
+ // 鎵撳嵃鏁版嵁娉ㄥ叆
+ MatPrint print = new MatPrint();
+ print.setMatnr(locOutPrintMat.getMatnr());
+ print.setMaktx(locOutPrintMat.getMaktx());
+ print.setBatch(locOutPrintMat.getBatch());
+ print.setAnfme(locOutPrintMat.getAnfme());
+ print.setOwnerId(locOutPrintMat.getOwnerId());
+ print.setOwner(locOutPrintMat.getOwner$());
+ print.setId(locOutPrintMat.getId());
+ res.add(print);
+ print.setMemo(print.getMatnr()+";"+print.getBatch()+";"+print.getOwnerId());
+ if (!memoList.contains(print.getMemo())){
+ memoList.add(print.getMemo());
+ }
+ locOutPrintMat.setUpdateTime(new Date());
+ locOutPrintMat.setUpdateBy(getUserId());
+ locOutPrintMat.setStatus(2);
+ locOutPrintMatService.updateById(locOutPrintMat);
+ }
+ List<LocOutAnfmePrintPara> locOutAnfmePrintParaList = new ArrayList<>();
+ for (String memo : memoList){
+ LocOutAnfmePrintPara locOutAnfmePrintPara = new LocOutAnfmePrintPara();
+ int signInt = 0;
+ Double[] anfme = new Double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
+ for (MatPrint matPrint:res){
+ if (!memo.equals(matPrint.getMemo())){
+ continue;
+ }
+ if (signInt==0){
+ locOutAnfmePrintPara.setMatnr(matPrint.getMatnr());
+ locOutAnfmePrintPara.setBatch(matPrint.getBatch());
+ locOutAnfmePrintPara.setOwner(matPrint.getOwner());
+ locOutAnfmePrintPara.setOwnerId(matPrint.getOwnerId());
+ }
+
+ if (signInt<17){
+ anfme[signInt] = matPrint.getAnfme();
+ signInt++;
+ }else {
+ locOutAnfmePrintPara.setAnfme(anfme);
+ locOutAnfmePrintParaList.add(locOutAnfmePrintPara);
+ locOutAnfmePrintPara = new LocOutAnfmePrintPara();
+ locOutAnfmePrintPara.setMatnr(matPrint.getMatnr());
+ locOutAnfmePrintPara.setBatch(matPrint.getBatch());
+ locOutAnfmePrintPara.setOwner(matPrint.getOwner());
+ locOutAnfmePrintPara.setOwnerId(matPrint.getOwnerId());
+ signInt = 0;
+ anfme = new Double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
+ anfme[signInt] = matPrint.getAnfme();
+ signInt++;
+ }
+ }
+ locOutAnfmePrintPara.setAnfme(anfme);
+ locOutAnfmePrintParaList.add(locOutAnfmePrintPara);
+ }
+ return R.ok().add(locOutAnfmePrintParaList);
+ }
+
/*************************************** 鏁版嵁鐩稿叧 ***********************************************/
diff --git a/src/main/java/com/zy/asrs/entity/LocOutPrintMat.java b/src/main/java/com/zy/asrs/entity/LocOutPrintMat.java
new file mode 100644
index 0000000..8524aae
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/LocOutPrintMat.java
@@ -0,0 +1,208 @@
+package com.zy.asrs.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.zy.asrs.service.LocOwnerService;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.core.common.SpringUtils;
+import com.zy.system.service.UserService;
+import com.zy.system.entity.User;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.core.common.SpringUtils;
+import com.zy.system.service.UserService;
+import com.zy.system.entity.User;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableName;
+import java.io.Serializable;
+
+@Data
+@TableName("asr_loc_out_print_mat")
+public class LocOutPrintMat implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 缂栧彿
+ */
+ @ApiModelProperty(value= "缂栧彿")
+ private String uuid;
+
+ /**
+ * 鎵撳嵃鎯呭喌 1: 鏈墦鍗� 2: 宸叉墦鍗�
+ */
+ @ApiModelProperty(value= "鎵撳嵃鎯呭喌 1: 鏈墦鍗� 2: 宸叉墦鍗� ")
+ private Integer status;
+
+ /**
+ * 娣诲姞鏃堕棿
+ */
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ @TableField("create_time")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /**
+ * 娣诲姞浜哄憳
+ */
+ @ApiModelProperty(value= "娣诲姞浜哄憳")
+ @TableField("create_by")
+ private Long createBy;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ @TableField("update_time")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /**
+ * 淇敼浜哄憳
+ */
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ @TableField("update_by")
+ private Long updateBy;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ /**
+ * 鐗╂枡缂栫爜
+ */
+ @ApiModelProperty(value= "鐗╂枡缂栫爜")
+ private String matnr;
+
+ /**
+ * 鎵规
+ */
+ @ApiModelProperty(value= "鎵规")
+ private String batch;
+
+ /**
+ * 閲嶉噺
+ */
+ @ApiModelProperty(value= "閲嶉噺")
+ private Double anfme;
+
+ /**
+ * 搴撲綅鍙�
+ */
+ @ApiModelProperty(value= "搴撲綅鍙�")
+ @TableField("loc_no")
+ private String locNo;
+
+ /**
+ * 鍟嗗搧鍚嶇О
+ */
+ @ApiModelProperty(value= "鍟嗗搧鍚嶇О")
+ private String maktx;
+
+ /**
+ * 鎷ユ湁鑰�
+ */
+ @ApiModelProperty(value= "鎷ユ湁鑰�")
+ @TableField("owner_id")
+ private Long ownerId;
+
+ public LocOutPrintMat() {}
+
+ public LocOutPrintMat(String uuid,Integer status,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo,String matnr,String batch,Double anfme,String locNo,String maktx,Long ownerId) {
+ this.uuid = uuid;
+ this.status = status;
+ this.createTime = createTime;
+ this.createBy = createBy;
+ this.updateTime = updateTime;
+ this.updateBy = updateBy;
+ this.memo = memo;
+ this.matnr = matnr;
+ this.batch = batch;
+ this.anfme = anfme;
+ this.locNo = locNo;
+ this.maktx = maktx;
+ this.ownerId = ownerId;
+ }
+
+ public LocOutPrintMat(Date now,Long userId,String matnr,String batch,Double anfme,String locNo,String maktx) {
+ this.uuid = String.valueOf(now.getTime());
+ this.createTime = now;
+ this.createBy = userId;
+// this.updateTime = now;
+// this.updateBy = userId;
+ this.matnr = matnr;
+ this.batch = batch;
+ this.anfme = anfme;
+ this.locNo = locNo;
+ this.maktx = maktx;
+ }
+
+ public String getStatus$(){
+ if (null == this.status){ return null; }
+ switch (this.status){
+ case 1:
+ return "鏈墦鍗�";
+ case 2:
+ return "宸叉墦鍗�";
+ default:
+ return String.valueOf(this.status);
+ }
+ }
+
+ public String getCreateTime$(){
+ if (Cools.isEmpty(this.createTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+ }
+
+ public String getCreateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.createBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getUpdateTime$(){
+ if (Cools.isEmpty(this.updateTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+ }
+
+ public String getUpdateBy$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.updateBy);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getNickname());
+ }
+ return null;
+ }
+
+ public String getOwner$(){
+ LocOwnerService locOwnerService = SpringUtils.getBean(LocOwnerService.class);
+ LocOwner locOwner = locOwnerService.selectById(this.ownerId);
+ if (!Cools.isEmpty(locOwner)){
+ return String.valueOf(locOwner.getOwner());
+ }
+ return null;
+ }
+
+
+}
diff --git a/src/main/java/com/zy/asrs/entity/param/LocOutAnfmePrintPara.java b/src/main/java/com/zy/asrs/entity/param/LocOutAnfmePrintPara.java
new file mode 100644
index 0000000..4ff5d12
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/param/LocOutAnfmePrintPara.java
@@ -0,0 +1,83 @@
+package com.zy.asrs.entity.param;
+
+import lombok.Data;
+
+@Data
+public class LocOutAnfmePrintPara {
+
+ /**
+ * 鐗╂枡缂栫爜
+ */
+ private String matnr;
+
+ /**
+ * 鐗╂枡鍚嶇О
+ */
+ private String maktx;
+
+ /**
+ * 鐗╂枡瑙勬牸
+ */
+ private String specs;
+
+ /**
+ * 鐗╂枡鎵规
+ */
+ private String batch;
+
+ /**
+ * 璐т富鍙�
+ */
+ private Long ownerId;
+
+ /**
+ * 璐т富
+ */
+ private String owner;
+
+ /**
+ * 鏁伴噺
+ */
+ private Double[] anfme;
+ private Double anfme1;
+ private Double anfme2;
+ private Double anfme3;
+ private Double anfme4;
+ private Double anfme5;
+ private Double anfme6;
+ private Double anfme7;
+ private Double anfme8;
+ private Double anfme9;
+ private Double anfme10;
+ private Double anfme11;
+ private Double anfme12;
+ private Double anfme13;
+ private Double anfme14;
+ private Double anfme15;
+ private Double anfme16;
+ private Double anfme17;
+ private Double anfme18;
+
+ public void setAnfme(Double[] anfme){
+ this.anfme = anfme;
+ this.anfme1 = anfme[0];
+ this.anfme2 = anfme[1];
+ this.anfme3 = anfme[2];
+ this.anfme4 = anfme[3];
+ this.anfme5 = anfme[4];
+ this.anfme6 = anfme[5];
+ this.anfme7 = anfme[6];
+ this.anfme8 = anfme[7];
+ this.anfme9 = anfme[8];
+ this.anfme10 = anfme[9];
+ this.anfme11 = anfme[10];
+ this.anfme12 = anfme[11];
+ this.anfme13 = anfme[12];
+ this.anfme14 = anfme[13];
+ this.anfme15 = anfme[14];
+ this.anfme16 = anfme[15];
+ this.anfme17 = anfme[16];
+
+ }
+
+}
diff --git a/src/main/java/com/zy/asrs/mapper/LocOutPrintMatMapper.java b/src/main/java/com/zy/asrs/mapper/LocOutPrintMatMapper.java
new file mode 100644
index 0000000..38434e9
--- /dev/null
+++ b/src/main/java/com/zy/asrs/mapper/LocOutPrintMatMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.mapper;
+
+import com.zy.asrs.entity.LocOutPrintMat;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface LocOutPrintMatMapper extends BaseMapper<LocOutPrintMat> {
+
+}
diff --git a/src/main/java/com/zy/asrs/service/LocOutPrintMatService.java b/src/main/java/com/zy/asrs/service/LocOutPrintMatService.java
new file mode 100644
index 0000000..8f2baf5
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/LocOutPrintMatService.java
@@ -0,0 +1,8 @@
+package com.zy.asrs.service;
+
+import com.zy.asrs.entity.LocOutPrintMat;
+import com.baomidou.mybatisplus.service.IService;
+
+public interface LocOutPrintMatService extends IService<LocOutPrintMat> {
+
+}
diff --git a/src/main/java/com/zy/asrs/service/impl/LocOutPrintMatServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocOutPrintMatServiceImpl.java
new file mode 100644
index 0000000..de9c34d
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/impl/LocOutPrintMatServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.service.impl;
+
+import com.zy.asrs.mapper.LocOutPrintMatMapper;
+import com.zy.asrs.entity.LocOutPrintMat;
+import com.zy.asrs.service.LocOutPrintMatService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("locOutPrintMatService")
+public class LocOutPrintMatServiceImpl extends ServiceImpl<LocOutPrintMatMapper, LocOutPrintMat> implements LocOutPrintMatService {
+
+}
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 7ff7b17..9e92560 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -94,6 +94,9 @@
private LocInPrintMatService locInPrintMatService;
@Autowired
+ private LocOutPrintMatService locOutPrintMatService;
+
+ @Autowired
private LocOwnerService locOwnerService;
@@ -1148,6 +1151,7 @@
@Override
public R manDetlOriginOut(JSONObject json, User user) {
+ Date now = new Date();
JSONArray combMats = json.getJSONArray("combMats");
List<MatPrint> matPrintList=new ArrayList<>();
List<Long> ids=new ArrayList<>();
@@ -1174,6 +1178,8 @@
if (manLocDetl.getAnfme() > parseLong){
BigDecimal num = anfme.subtract(outAnfme);
manLocDetl.setAnfme(num.doubleValue());
+ manLocDetl.setUpdateBy(user.getId());
+ manLocDetl.setModiTime(now);
if (!manLocDetlService.update(manLocDetl,manLocDetlWrapper)) {
return R.error("鐗╂枡淇℃伅涓嬫灦澶辫触");
}
@@ -1184,6 +1190,12 @@
}
}
}
+ for (MatPrint jsonOriginDetl:matPrintList) {
+ //澧炲姞鎵撳嵃妗f
+ LocOutPrintMat locOutPrintMat = new LocOutPrintMat(now, user.getId(), jsonOriginDetl.getMatnr(), jsonOriginDetl.getBatch(), jsonOriginDetl.getAnfme(), jsonOriginDetl.getLocNo(), jsonOriginDetl.getMaktx());
+ locOutPrintMat.setOwnerId(jsonOriginDetl.getOwnerId());
+ locOutPrintMatService.insert(locOutPrintMat);
+ }
return R.ok();
}
}
diff --git a/src/main/java/com/zy/common/CodeBuilder.java b/src/main/java/com/zy/common/CodeBuilder.java
index f573008..ac10a8a 100644
--- a/src/main/java/com/zy/common/CodeBuilder.java
+++ b/src/main/java/com/zy/common/CodeBuilder.java
@@ -20,7 +20,7 @@
generator.url="127.0.0.1:1433;databasename=hzjzasrs";
generator.username="sa";
generator.password="sa@123";
- generator.table="asr_loc_in_print_mat";
+ generator.table="asr_loc_out_print_mat";
generator.packagePath="com.zy.asrs";
generator.build();
}
diff --git a/src/main/java/locOutPrintMat.sql b/src/main/java/locOutPrintMat.sql
new file mode 100644
index 0000000..909f97d
--- /dev/null
+++ b/src/main/java/locOutPrintMat.sql
@@ -0,0 +1,18 @@
+-- save locOutPrintMat record
+-- mysql
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat/locOutPrintMat.html', 'locOutPrintMat绠$悊', null , '2', null , '1');
+
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat#view', '鏌ヨ', '', '3', '0', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat#btn-add', '鏂板', '', '3', '1', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat#btn-edit', '缂栬緫', '', '3', '2', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat#btn-delete', '鍒犻櫎', '', '3', '3', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOutPrintMat#btn-export', '瀵煎嚭', '', '3', '4', '1');
+
+-- sqlserver
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat/locOutPrintMat.html', N'鍑哄簱鏁版嵁鎵撳嵃', '221', '2', '10', '1');
+
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat#view', N'鏌ヨ', '70609', '3', '0', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat#btn-add', N'鏂板', '70609', '3', '1', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat#btn-edit', N'缂栬緫', '70609', '3', '2', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat#btn-delete', N'鍒犻櫎', '70609', '3', '3', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOutPrintMat#btn-export', N'瀵煎嚭', '70609', '3', '4', '1');
diff --git a/src/main/resources/mapper/LocOutPrintMatMapper.xml b/src/main/resources/mapper/LocOutPrintMatMapper.xml
new file mode 100644
index 0000000..074ad9b
--- /dev/null
+++ b/src/main/resources/mapper/LocOutPrintMatMapper.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.asrs.mapper.LocOutPrintMatMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocOutPrintMat">
+ <id column="id" property="id" />
+ <result column="uuid" property="uuid" />
+ <result column="status" property="status" />
+ <result column="create_time" property="createTime" />
+ <result column="create_by" property="createBy" />
+ <result column="update_time" property="updateTime" />
+ <result column="update_by" property="updateBy" />
+ <result column="memo" property="memo" />
+ <result column="matnr" property="matnr" />
+ <result column="batch" property="batch" />
+ <result column="anfme" property="anfme" />
+ <result column="loc_no" property="locNo" />
+ <result column="maktx" property="maktx" />
+ <result column="owner_id" property="ownerId" />
+
+ </resultMap>
+
+</mapper>
diff --git a/src/main/webapp/static/js/locOutPrintMat/locOutPrintMat.js b/src/main/webapp/static/js/locOutPrintMat/locOutPrintMat.js
new file mode 100644
index 0000000..75895d7
--- /dev/null
+++ b/src/main/webapp/static/js/locOutPrintMat/locOutPrintMat.js
@@ -0,0 +1,336 @@
+var pageCurr;
+layui.config({
+ base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table','laydate', 'form', 'admin'], function(){
+ var table = layui.table;
+ var $ = layui.jquery;
+ var layer = layui.layer;
+ var layDate = layui.laydate;
+ var form = layui.form;
+ var admin = layui.admin;
+
+ // 鏁版嵁娓叉煋
+ tableIns = table.render({
+ elem: '#locOutPrintMat',
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/locOutPrintMat/list/auth',
+ page: true,
+ limit: 15,
+ limits: [15, 30, 50, 100, 200, 500],
+ toolbar: '#toolbar',
+ cellMinWidth: 50,
+ height: 'full-120',
+ cols: [[
+ {type: 'checkbox'}
+ ,{field: 'id', align: 'center',title: 'ID',hide : true}
+ ,{field: 'uuid', align: 'center',title: '缂栧彿',hide: true}
+ ,{field: 'status$', align: 'center',title: '鎵撳嵃鎯呭喌', width:100,hide: false}
+ ,{field: 'matnr', align: 'center',title: '鐗╂枡缂栫爜', width:180,hide: false}
+ ,{field: 'batch', align: 'center',title: '鎵规', width:100,hide: false}
+ ,{field: 'anfme', align: 'center',title: '閲嶉噺(kg)', width:100,hide: false}
+ ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�', width:120,hide: false}
+ ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О',hide: false}
+ ,{field: 'owner$', align: 'center',title: '璐т富',hide: false}
+ ,{field: 'createTime$', align: 'center',title: '鍏ュ簱鏃堕棿', width:120,hide: false}
+ ,{field: 'createBy$', align: 'center',title: '鍏ュ簱浜哄憳', width:100,hide: false}
+ ,{field: 'updateTime$', align: 'center',title: '鎵撳嵃鏃堕棿', width:120,hide: false}
+ ,{field: 'updateBy$', align: 'center',title: '鎵撳嵃浜哄憳',hide: false}
+ ,{field: 'memo', align: 'center',title: '澶囨敞',hide: false}
+
+ ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+ ]],
+ request: {
+ pageName: 'curr',
+ pageSize: 'limit'
+ },
+ parseData: function (res) {
+ return {
+ 'code': res.code,
+ 'msg': res.msg,
+ 'count': res.data.total,
+ 'data': res.data.records
+ }
+ },
+ response: {
+ statusCode: 200
+ },
+ done: function(res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ limit();
+ }
+ });
+
+ // 鐩戝惉鎺掑簭浜嬩欢
+ table.on('sort(locOutPrintMat)', function (obj) {
+ var searchData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ searchData[this.name] = this.value;
+ });
+ searchData['orderByField'] = obj.field;
+ searchData['orderByType'] = obj.type;
+ tableIns.reload({
+ where: searchData,
+ page: {curr: 1}
+ });
+ });
+
+ // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+ table.on('toolbar(locOutPrintMat)', function (obj) {
+ var checkStatus = table.checkStatus(obj.config.id).data;
+ switch(obj.event) {
+ case 'addData':
+ showEditModel();
+ break;
+ case 'deleteData':
+ if (checkStatus.length === 0) {
+ layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+ return;
+ }
+ del(checkStatus.map(function (d) {
+ return d.id;
+ }));
+ break;
+ case 'exportData':
+ admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+ var titles=[];
+ var fields=[];
+ obj.config.cols[0].map(function (col) {
+ if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
+ titles.push(col.title);
+ fields.push(col.field);
+ }
+ });
+ var exportData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ exportData[this.name] = this.value;
+ });
+ var param = {
+ 'locOutPrintMat': exportData,
+ 'fields': fields
+ };
+ $.ajax({
+ url: baseUrl+"/locOutPrintMat/export/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: JSON.stringify(param),
+ dataType:'json',
+ contentType:'application/json;charset=UTF-8',
+ method: 'POST',
+ success: function (res) {
+ layer.closeAll();
+ if (res.code === 200) {
+ table.exportFile(titles,res.data,'xls');
+ } else if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg, {icon: 2})
+ }
+ }
+ });
+ });
+ break;
+ // 鎵归噺鎵撳嵃
+ case "btnPrintBatch":
+ printMatCodeNos = [];
+ var data = checkStatus;
+ if (data.length === 0){
+ layer.msg('璇烽�夋嫨鎵撳嵃鏁版嵁');
+ } else {
+ layer.open({
+ type: 1,
+ title: '鎵归噺鎵撳嵃 [鏁伴噺'+ data.length +']',
+ area: ['500px'],
+ shadeClose: true,
+ content: $('#printDataDiv'),
+ success: function(layero, index){
+ for (var i = 0; i<data.length;i++) {
+ printMatCodeNos.push(data[i].id);
+ }
+ },
+ end: function () {
+ }
+ });
+ }
+ break;
+ }
+ });
+
+ // 鐩戝惉琛屽伐鍏蜂簨浠�
+ table.on('tool(locOutPrintMat)', function(obj){
+ var data = obj.data;
+ switch (obj.event) {
+ case 'btnPrint':
+ layer.msg("搴熷純")
+ break;
+ // btnPrint(data.id, data.orderNo, 4);
+ case 'edit':
+ showEditModel(data);
+ break;
+ case "del":
+ del([data.id]);
+ break;
+ }
+ });
+
+ /* 寮圭獥 - 鏂板銆佷慨鏀� */
+ function showEditModel(mData) {
+ admin.open({
+ type: 1,
+ area: '600px',
+ title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+ content: $('#editDialog').html(),
+ success: function (layero, dIndex) {
+ layDateRender(mData);
+ form.val('detail', mData);
+ form.on('submit(editSubmit)', function (data) {
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/locOutPrintMat/"+(mData?'update':'add')+"/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: data.field,
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ layer.close(dIndex);
+ layer.msg(res.msg, {icon: 1});
+ tableReload();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ return false;
+ });
+ $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ layui.form.render('select');
+ }
+ });
+ }
+
+ /* 鍒犻櫎 */
+ function del(ids) {
+ layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+ skin: 'layui-layer-admin',
+ shade: .1
+ }, function (i) {
+ layer.close(i);
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/locOutPrintMat/delete/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {ids: ids},
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ layer.msg(res.msg, {icon: 1});
+ tableReload();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ }
+
+ // 鎼滅储
+ form.on('submit(search)', function (data) {
+ pageCurr = 1;
+ tableReload(false);
+ });
+
+ // 閲嶇疆
+ form.on('submit(reset)', function (data) {
+ pageCurr = 1;
+ clearFormVal($('#search-box'));
+ tableReload(false);
+ });
+
+ // 妯℃澘閫夋嫨
+ form.on('radio(selectTemplateRadio)', function (data) {
+ $('.template-preview').hide();
+ $('#template-preview-'+data.value).show();
+ });
+
+ // 寮�濮嬫墦鍗�
+ form.on('submit(doPrint)', function (data) {
+ var templateNo = data.field.selectTemplate;
+ $.ajax({
+ url: baseUrl+"/loc/out/mat/print/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {param: printMatCodeNos},
+ method: 'POST',
+ async: false,
+ success: function (res) {
+ if (res.code === 200){
+ layer.closeAll();
+ for (let i=0;i<res.data.length;i++){
+ console.log(res)
+ var templateDom = $("#templatePreview"+templateNo);
+ var className = templateDom.attr("class");
+ // if (className === 'template-barcode') {
+ // res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="
+ // +res.data[i].matnr+";"
+ // } else {
+ // res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="
+ // +res.data[i].matnr+";"
+ // }
+ }
+ var tpl = templateDom.html();
+ var template = Handlebars.compile(tpl);
+ var html = template(res);
+ var box = $("#box");
+ box.html(html);box.show();
+ box.print({mediaPrint:true});
+ box.hide();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg)
+ }
+ }
+ })
+ });
+
+ // 鏃堕棿閫夋嫨鍣�
+ function layDateRender(data) {
+ setTimeout(function () {
+ layDate.render({
+ elem: '#createTime\\$',
+ type: 'datetime',
+ value: data!==undefined?data['createTime\\$']:null
+ });
+ layDate.render({
+ elem: '#updateTime\\$',
+ type: 'datetime',
+ value: data!==undefined?data['updateTime\\$']:null
+ });
+
+ }, 300);
+ }
+ layDateRender();
+
+});
+
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click','#data-detail-close', function () {
+ parent.layer.closeAll();
+});
+
+function tableReload(child) {
+ var searchData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ searchData[this.name] = this.value;
+ });
+ tableIns.reload({
+ where: searchData,
+ page: {curr: pageCurr}
+ });
+}
diff --git a/src/main/webapp/views/locOutPrintMat/locOutPrintMat.html b/src/main/webapp/views/locOutPrintMat/locOutPrintMat.html
new file mode 100644
index 0000000..e4b7054
--- /dev/null
+++ b/src/main/webapp/views/locOutPrintMat/locOutPrintMat.html
@@ -0,0 +1,393 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title></title>
+ <meta name="renderer" content="webkit">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+ <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
+ <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+
+ <style>
+ /* ------------------------- 鎵撳嵃琛ㄦ牸 ----------------------- */
+ .contain {
+ border-collapse: collapse;
+ width: 280px;
+ font-size: x-small;
+ table-layout: fixed;
+ color: black;
+ }
+ .contain img.template-qrcode {
+ width: 80%;
+ }
+ .contain td, .contain th {
+ border: 1px solid black;
+ text-align: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ padding: 5px;
+ }
+ .contain th {
+ font-weight: bold;
+ color: black;
+ background-color: #f2f2f2;
+ }
+ .contain tr:nth-child(even){background-color: #f9f9f9;}
+ .contain strong {
+ font-weight: bold;
+ line-height: 20px;
+ vertical-align: middle;
+ display: -webkit-box;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+ }
+ .barcode-section {
+ text-align: center;
+ }
+ .barcode-section span {
+ letter-spacing: 1px;
+ font-weight: bold;
+ color: black;
+ }
+
+ #templatePreview3 {
+ color: black;
+ border-color: black;
+ border-collapse: collapse; /* 鎶樺彔杈规 */
+ }
+
+ /* 灏嗘牱寮忓彧搴旂敤鍒板叿鏈夌壒瀹歩d鐨則able銆乼h銆乼d */
+ #templatePreview3, #myTable th, #myTable td {
+ color: black;
+ border: 2px solid black; /* 2鍍忕礌榛戣壊杈规 */
+ }
+
+ #templatePreview3 th, #myTable td {
+ color: black;
+ border-color: black;
+ text-align: left;
+ padding: 8px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div class="layui-fluid">
+ <div class="layui-card">
+ <div class="layui-card-body">
+ <div class="layui-form toolbar" id="search-box">
+ <div class="layui-form-item">
+ <!-- <div class="layui-inline">-->
+ <!-- <label class="layui-form-label">缂栧彿:</label>-->
+ <!-- <div class="layui-input-inline">-->
+ <!-- <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">-->
+ <!-- </div>-->
+ <!-- </div>-->
+ <div class="layui-inline">
+ <label class="layui-form-label">鎵撳嵃鎯呭喌: </label>
+ <div class="layui-input-block">
+ <select name="status">
+ <option value="">璇烽�夋嫨鎵撳嵃鎯呭喌</option>
+ <option value="1">鏈墦鍗�</option>
+ <option value="2">宸叉墦鍗�</option>
+ </select>
+ </div>
+ </div>
+ <!-- <div class="layui-inline">-->
+ <!-- <div class="layui-input-inline">-->
+ <!-- <input class="layui-input" type="text" name="ownerId" placeholder="璐т富" autocomplete="off">-->
+ <!-- </div>-->
+ <!-- </div>-->
+ <div class="layui-inline"> 
+ <button class="layui-btn icon-btn" lay-filter="search" lay-submit>
+ <i class="layui-icon"></i>鎼滅储
+ </button>
+ <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>
+ <i class="layui-icon"></i>閲嶇疆
+ </button>
+ </div>
+ </div>
+ </div>
+ <table class="layui-hide" id="locOutPrintMat" lay-filter="locOutPrintMat"></table>
+ </div>
+ </div>
+</div>
+
+<script type="text/html" id="toolbar">
+ <div class="layui-btn-container">
+ <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
+ <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
+ <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">鎵归噺鎵撳嵃</button>
+
+ <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button>
+ </div>
+</script>
+
+<script type="text/html" id="operate">
+ <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
+ <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+ <!-- <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="btnPrint">鎵撳嵃</a>-->
+
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/jquery/jQuery.print.js"></script>
+<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/locOutPrintMat/locOutPrintMat.js" charset="utf-8"></script>
+</body>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+ <form id="detail" lay-filter="detail" class="layui-form admin-form model-form">
+ <input name="id" type="hidden">
+ <div class="layui-row">
+ <div class="layui-col-md12">
+ <div class="layui-form-item">
+ <label class="layui-form-label">鎵撳嵃鎯呭喌: </label>
+ <div class="layui-input-block">
+ <select name="status">
+ <option value="">璇烽�夋嫨鎵撳嵃鎯呭喌</option>
+ <option value="1">鏈墦鍗�</option>
+ <option value="2">宸叉墦鍗�</option>
+ </select>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">璐т富缂栧彿: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="owner" placeholder="璇疯緭鍏ヨ揣涓荤紪鍙�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鐗╂枡缂栫爜: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="matnr" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鎵规: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="batch" placeholder="璇疯緭鍏ユ壒娆�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">閲嶉噺: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="anfme" placeholder="璇疯緭鍏ラ噸閲�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">搴撲綅鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="locNo" placeholder="璇疯緭鍏ュ簱浣嶅彿">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鍟嗗搧鍚嶇О: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="maktx" placeholder="璇疯緭鍏ュ晢鍝佸悕绉�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囨敞: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="memo" placeholder="璇疯緭鍏ュ娉�">
+ </div>
+ </div>
+ </div>
+ </div>
+ <hr class="layui-bg-gray">
+ <div class="layui-form-item text-right">
+ <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+ </div>
+ </form>
+</script>
+
+
+<!-- 鎵撳嵃鎿嶄綔寮圭獥 -->
+<div id="printDataDiv" style="display: none;padding: 20px">
+ <div class="layui-form" style="text-align: center">
+ <hr>
+ <!--鍗曢�夋-->
+ <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px">
+ <!-- <input type="radio" name="selectTemplate" value="1" title="妯℃澘涓�" lay-filter="selectTemplateRadio" checked="">-->
+ <!-- <input type="radio" name="selectTemplate" value="2" title="妯℃澘浜�" lay-filter="selectTemplateRadio">-->
+ <input type="radio" name="selectTemplate" value="3" title="妯℃澘" lay-filter="selectTemplateRadio">
+ </div>
+ <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;">
+ <legend>鎵撳嵃棰勮</legend>
+ <div id="template-container" style="margin: 20px;text-align: center">
+
+ <!-- 棰勮鍥� 1 -->
+ <div id="template-preview-1" class="template-preview" style="display: inline-block">
+ <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
+ <tr style="height: 74px">
+ <td colspan="3" align="center" scope="col">鍟嗗搧缂栫爜</td>
+ <td class="barcode" colspan="9" align="center" scope="col">
+<!-- <img class="template-code template-barcode" src="" width="90%;">-->
+ <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;">
+ <span>xxxxxx</span>
+ </div>
+ </td>
+ </tr>
+ <tr style="height: 74px">
+ <td align="center" colspan="3">鍟嗗搧</td>
+ <td align="center" colspan="5">xxxxxx-xx/xx</td>
+ <td align="center" colspan="2">澶囨敞</td>
+ <td align="center" colspan="2">xx</td>
+ </tr>
+ </table>
+ </div>
+
+ <!-- 棰勮鍥� 2 -->
+ <div id="template-preview-2" class="template-preview" style="display: none">
+ <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
+ <tr style="height: 30px">
+ <td align="center" width="20%">鍟嗗搧</td>
+ <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td>
+ </tr>
+ <tr style="height: 30px">
+ <td align="center" width="20%">澶囨敞</td>
+ <td align="center" width="80%">xxxxxxxx</td>
+ </tr>
+ <tr style="height: 75px;">
+ <td align="center" colspan="2" width="100%" style="border: none">
+ <img class="template-code template-barcode" src="" width="80%">
+ <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
+ <span>xxxxxx</span>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <!-- 棰勮鍥� 3 -->
+ <div id="template-preview-3" class="template-preview" style="display: none">
+ <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
+ <tr style="height: 74px">
+ <td align="center" scope="col" colspan="1">鍟嗗搧</td>
+ <td align="center" scope="col" colspan="1" style="">xxxxxx-xx/xx</td>
+ <td align="center" scope="col" colspan="2" rowspan="2">
+ <img class="template-code template-qrcode" src="" width="80%">
+ <div style="letter-spacing: 1px;margin-top: 1px; text-align: center">
+ <span>xxxxxx</span>
+ </div>
+ </td>
+ </tr>
+ <tr style="height: 74px">
+ <td align="center" colspan="1">澶囨敞</td>
+ <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </fieldset>
+
+ <button class="layui-btn" id="doPrint" lay-submit lay-filter="doPrint" style="margin-top: 20px">纭畾</button>
+ </div>
+</div>
+
+<div id="box" style="display: block"></div>
+
+<!-- 鍒濆鍖栨墦鍗版ā鏉跨殑鏉″舰鐮� -->
+<script type="text/javascript">
+ $('.template-barcode').attr("src", baseUrl+"/mac/code/auth?type=1¶m=123");
+ $('.template-qrcode').attr("src", baseUrl+"/mac/code/auth?type=2¶m=123");
+</script>
+
+<!-- 妯℃澘寮曟搸 -->
+<!-- 妯℃澘1 -->
+<script type="text/template" id="templatePreview1" class="template-barcode">
+ {{#each data}}
+ <table class="contain" width="280" style="overflow: hidden;font-size: small;table-layout: fixed;">
+ <tr style="height: 74px">
+ <td align="center" colspan="3" scope="col">鍟嗗搧缂栫爜</td>
+ <td align="center" class="barcode" colspan="9" scope="col">
+ <img class="template-code" src="{{this.barcodeUrl}}" width="90%">
+ <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
+ <span>{{this.matnr}}</span>
+ </div>
+ </td>
+ </tr>
+ <tr style="height: 74px">
+ <td align="center" colspan="3">鍟嗗搧</td>
+ <td align="center" colspan="5" style="overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{this.maktx}}</td>
+ <td align="center" colspan="2">澶囨敞</td>
+ <td align="center" colspan="2">{{this.memo}}</td>
+ </tr>
+ </table>
+ {{/each}}
+</script>
+<!-- 妯℃澘2 -->
+<script type="text/template" id="templatePreview2" class="template-barcode">
+ {{#each data}}
+ <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
+ <tr style="height: 35px">
+ <td align="center" width="20%">鍟嗗搧</td>
+ <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.maktx}}</td>
+ </tr>
+ <tr style="height: 35px">
+ <td align="center" width="20%">澶囨敞</td>
+ <td align="center" width="80%">{{this.memo}}</td>
+ </tr>
+ <tr style="height: 79px;">
+ <td align="center" colspan="2" width="100%" style="border: none">
+ <img class="template-code" src="{{this.barcodeUrl}}" width="80%">
+ <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
+ <span>{{this.matnr}}</span>
+ </div>
+ </td>
+ </tr>
+ </table>
+ {{/each}}
+</script>
+<!-- 妯℃澘3 -->
+<script type="text/template" id="templatePreview3" class="template-qrcode">
+ {{#each data}}
+ <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;color: black;">
+ <tr>
+ <th>鍝佸彿</th>
+ <td colspan="5"><strong>{{this.matnr}}</strong></td>
+ </tr>
+ <tr>
+ <th>鎵规</th>
+ <td colspan="2"><strong>{{this.batch}}</strong></td>
+ <th>璐т富</th>
+ <td colspan="2"><strong>{{this.owner}}</strong></td>
+ </tr>
+ <tr>
+ <th>閲嶉噺</th>
+ <td colspan="1"><strong>{{this.anfme1}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme2}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme3}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme4}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme5}}kg</strong></td>
+ </tr>
+ <tr>
+ <td colspan="1"><strong>{{this.anfme6}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme7}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme8}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme9}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme10}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme11}}kg</strong></td>
+ </tr>
+ <tr>
+ <td colspan="1"><strong>{{this.anfme12}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme13}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme14}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme15}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme16}}kg</strong></td>
+ <td colspan="1"><strong>{{this.anfme17}}kg</strong></td>
+ </tr>
+ </table>
+ {{/each}}
+</script>
+</html>
+
--
Gitblit v1.9.1