Преглед на файлове

产品管理-员工管理

wangxiaoming преди 7 години
родител
ревизия
794b40ba19
променени са 24 файла, в които са добавени 582 реда и са изтрити 175 реда
  1. 1 1
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java
  2. 0 9
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsMachine.java
  3. 0 3
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java
  4. 0 5
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java
  5. 0 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java
  6. 2 11
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml
  7. 18 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/produceMapper.xml
  8. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminProduceController.java
  9. 5 5
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsEmployeeController.java
  10. 3 23
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/MachineController.java
  11. 9 6
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProduceAppController.java
  12. 175 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/employee_list.ftl
  13. 126 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/save_employee.ftl
  14. 123 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/update_employee.ftl
  15. 29 29
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_List.ftl
  16. 72 74
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl
  17. 5 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl
  18. 13 1
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl
  19. BIN
      watero-rst-web/src/main/webapp/common/images/pts/barcode-1.png
  20. BIN
      watero-rst-web/src/main/webapp/common/images/pts/jiqi-2.png
  21. BIN
      watero-rst-web/src/main/webapp/common/images/pts/qrcode-1.png
  22. BIN
      watero-rst-web/src/main/webapp/common/images/pts/rili-1.png
  23. BIN
      watero-rst-web/src/main/webapp/common/images/pts/select-1.png
  24. BIN
      watero-rst-web/src/main/webapp/common/images/pts/tanhao.png

+ 1 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java

@@ -20,7 +20,7 @@ public class Produce implements Serializable {
     private Date produceCreateTime;         //创建时间
     private Date produceUpdateTime;         //修改时间
 
-    private Integer produceType;
+    private Integer produceType;            //产品类型  1.净水机 2.冲奶机
 
     private Integer employeeId;            //员工id
 

+ 0 - 9
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsMachine.java

@@ -22,7 +22,6 @@ public class PtsMachine implements Serializable{
     private Integer machineProcessState;//生成流程状态
     private String machineSoftwareVersion;//软件版本
     private String machineHardwareVersion;//硬件版本
-    private String machineNfcId;//nfcId(卡片ID)
     private Date machineCreateTime;//创建时间
     private Date machineUpdateTime;//修改时间
 
@@ -153,12 +152,4 @@ public class PtsMachine implements Serializable{
     public void setMachineProduceType(Integer machineProduceType) {
         this.machineProduceType = machineProduceType;
     }
-
-    public String getMachineNfcId() {
-        return machineNfcId;
-    }
-
-    public void setMachineNfcId(String machineNfcId) {
-        this.machineNfcId = machineNfcId;
-    }
 }

+ 0 - 3
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java

@@ -41,7 +41,4 @@ public interface MachineService {
 
     //根据机器id获取产品类型
     Integer getProduceType(Integer machineId);
-
-    //查询是否存在相同的机器信息
-    Integer getMachineIsHave(PtsMachine ptsMachine);
 }

+ 0 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java

@@ -76,9 +76,4 @@ public class MachineServiceImpl implements MachineService {
         return machineMapper.getProduceType(machineId);
     }
 
-    @Override
-    public Integer getMachineIsHave(PtsMachine ptsMachine) {
-        return machineMapper.getMachineIsHave(ptsMachine);
-    }
-
 }

+ 0 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java

@@ -37,7 +37,4 @@ public interface MachineMapper {
 
    //根据机器id获取产品类型
    Integer getProduceType(Integer machineId);
-
-   //查询是否存在相同的机器信息
-   Integer getMachineIsHave(PtsMachine ptsMachine);
 }

+ 2 - 11
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -5,11 +5,11 @@
         INSERT INTO tb_rst_pts_machine
         (machine_qrcode,machine_barcode,machine_sales_state,
         machine_status,machine_produced_time,machine_is_print,
-        machine_compound_img,machine_process_state,machine_create_time,machine_produce_type,machine_nfcId)
+        machine_compound_img,machine_process_state,machine_create_time,machine_produce_type)
         VALUES
         (#{machineQrcode},#{machineBarcode},2,#{machineStatus},
         #{machineProducedTime},#{machineIsPrint},#{machineCompoundImg},#{machineProcessState},
-        #{machineCreateTime},#{machineProduceType},#{machineNfcId})
+        #{machineCreateTime},#{machineProduceType})
     </insert>
 
     <update id="updateMachine" parameterType="PtsMachine" >
@@ -165,13 +165,4 @@
         where pm.machine_id = #{machineId} limit 1
 
     </select>
-    
-    <select id="getMachineIsHave" parameterType="PtsMachine" resultType="Integer">
-        SELECT
-            COUNT(*)
-        FROM
-            tb_rst_pts_machine pm
-        LEFT JOIN tb_rst_pts_machine_logs ml ON pm.machine_id = ml.machine_id
-        where pm.machine_nfcId = #{machineNfcId} and ml.logs_process_time = #{machineCreateTime}
-    </select>
 </mapper>

+ 18 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/produceMapper.xml

@@ -112,8 +112,7 @@
         tb_rst_pts_produce.produce_status AS  produceStatus,
         tb_rst_pts_produce.produce_remake AS produceRemake,
         tb_rst_pts_produce.produce_create_time AS  produceCreateTime,
-        tb_rst_pts_produce.produce_update_time AS produceUpdateTime,
-        tb_rst_pts_produce.produce_type AS produceType
+        tb_rst_pts_produce.produce_update_time AS produceUpdateTime
         FROM
         tb_rst_pts_produce
         WHERE
@@ -182,8 +181,8 @@
 
 
     <insert id="saveProduce" parameterType="Produce" useGeneratedKeys="true"  keyProperty="produceId">
-        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake)
-        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake})
+        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake,produce_type)
+        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake},#{produceType})
     </insert>
 
     <update id="updateProduce" parameterType="Produce" >
@@ -201,6 +200,9 @@
             <if test="produceRemake !=null and produceRemake !=''">
                 produce_remake = #{produceRemake},
             </if>
+            <if test="produceType !=null and produceType !=''">
+                produce_type = #{produceType},
+            </if>
         </set>
         WHERE
             produce_id = #{produceId}
@@ -387,4 +389,16 @@
         </where>
     </select>
 
+
+
+    <delete id="delNode"  parameterType="java.util.ArrayList">
+        delete from tb_rst_pts_process_node
+        where
+        node_id in
+        <foreach collection="array" item="nodeId" index="index" separator="," open="(" close=")">
+             #{nodeId}
+        </foreach>
+    </delete>
+
+
 </mapper>

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminProduceController.java

@@ -38,7 +38,7 @@ public class AdminProduceController {
      */
     @RequiresPermissions("produce:list_produce:produce")
     @RequestMapping("/_produce_list")
-    public ModelAndView selectOrderList(HttpServletRequest request) {
+    public ModelAndView selectProduceList(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("pts/produce/produce_list");
         List<Produce> list = produceService.getProduceList();
 

+ 5 - 5
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsEmployeeController.java

@@ -34,7 +34,7 @@ public class AdminPtsEmployeeController {
      */
     @RequestMapping("/_employee_list")
     @RequiresPermissions("employee:list_employee:employee")
-    public ModelAndView subMenuList(HttpServletRequest request,
+    public ModelAndView getEmployeeList(HttpServletRequest request,
                                     @RequestParam(value= "pageSize",defaultValue= "10" ,required=false) Integer pageSize,
                                     @RequestParam(value = "pageNO", defaultValue = "1",required=false) Integer pageNO,
                                     @RequestParam(value = "totalNum", defaultValue = "0",required=false) Integer totalNum) {
@@ -80,7 +80,7 @@ public class AdminPtsEmployeeController {
      */
     @RequiresPermissions("employee:add_employee:employee")
     @RequestMapping("/to_save_employee")
-    public ModelAndView goSaveProduce(HttpServletRequest request) {
+    public ModelAndView goSaveEmployee(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("pts/employee/save_employee");
         return mv;
     }
@@ -93,7 +93,7 @@ public class AdminPtsEmployeeController {
     @ResponseBody
     @RequiresPermissions("employee:add_employee:employee")
     @RequestMapping(value="/save_employee")
-    public ResponseJson saveProduce(PtsEmployee employee, HttpServletRequest request) {
+    public ResponseJson saveEmployee(PtsEmployee employee, HttpServletRequest request) {
 
        Integer flag = ptsEmployeeService.saveEmployee(employee);
         if (flag < 1 ){
@@ -111,7 +111,7 @@ public class AdminPtsEmployeeController {
     @ResponseBody
     @RequiresPermissions("employee:update_employee:employee")
     @RequestMapping(value="/to_update_employee")
-    public ModelAndView updateProduce(String employeeId, HttpServletRequest request) {
+    public ModelAndView toUpdateEmployee(String employeeId, HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("pts/employee/update_employee");
         if(employeeId == null || "".equals(employeeId)){
             return mv;
@@ -130,7 +130,7 @@ public class AdminPtsEmployeeController {
     @ResponseBody
     @RequiresPermissions("employee:update_employee:employee")
     @RequestMapping(value="/update_employee")
-    public ResponseJson updateProduce(PtsEmployee employee, HttpServletRequest request) {
+    public ResponseJson updateEmployee(PtsEmployee employee, HttpServletRequest request) {
         Integer flag = ptsEmployeeService.updateEmployee(employee);
         if (flag < 1 ){
             return new ResponseJson(500, "ERROR", 500);

+ 3 - 23
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/MachineController.java

@@ -56,22 +56,6 @@ public class MachineController {
         JSONObject query = JSONObject.fromObject(nodeList);
         Integer employeeId = query.getInt("employeeId");//员工id
         String produceNo = query.getString("produceId");//产品编号
-        String nfcId = query.getString("nfcId");//NFCID(卡片id)
-        JSONArray nodes = query.getJSONArray("nodes");//选项集合(包含一个或多个工序选项,详情见示例)
-
-        //根据卡片id与生产时间判断数据库是否存在相同的数据
-        JSONObject machineJsonObject = nodes.getJSONObject(0);
-        String ProcessTime = machineJsonObject.getString("logsProcessTime"); //工序执行时间 (时间戳)
-        Date ProcessDate = timeConversions(ProcessTime);
-        PtsMachine machine = new PtsMachine();
-        machine.setMachineNfcId(nfcId);
-        machine.setMachineCreateTime(ProcessDate);
-        Integer ishave = machineService.getMachineIsHave(machine);
-        if(ishave > 0){
-            rj.setResultMsg("200");
-            rj.setResultMsg("ERROR");
-            return rj;
-        }
         Produce produce = produceService.getProduce(produceNo);//根据产品编号获取产品信息
         //生成条形码,二维码
         String berQrcode = generationBarCode();
@@ -88,11 +72,10 @@ public class MachineController {
             ptsMachine.setMachineProcessState(1);//生成流程状态1.正常2.异常
             ptsMachine.setMachineCreateTime(new Date());//创建时间
             ptsMachine.setMachineProduceType(produce.getProduceType());//产品类型
-            ptsMachine.setMachineNfcId(nfcId);
             machineService.addMachine(ptsMachine);
         }
         boolean isAbnormality = true;//状态是否异常
-
+        JSONArray nodes = query.getJSONArray("nodes");//选项集合(包含一个或多个工序选项,详情见示例)
         PtsMachineLogs ptsMachineLogs = new PtsMachineLogs();
         for(int i = 0;i< nodes.size();i++){
             JSONObject jsonObject = nodes.getJSONObject(i);
@@ -263,12 +246,9 @@ public class MachineController {
                 num = String.valueOf(number);
                 break;
         }
-        String months = String.valueOf(month);
-        if(month < 10){
-            months = "0"+months;
-        }
+
         //拼接
-        String barcode = productModel+productFeatures+softwareVersion+String.valueOf(year).substring(2,4)+months+num;
+        String barcode = productModel+productFeatures+softwareVersion+String.valueOf(year).substring(2,4)+month+num;
         return barcode;
     }
 }

+ 9 - 6
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProduceAppController.java

@@ -48,6 +48,8 @@ public class ProduceAppController {
         }
         //查询员工所做的产品,产品的工序,工序的节点操作
         List<Produce> list = produceService.getAllProduceList(Integer.valueOf(employeeId));
+
+        boolean flag = false;
         for(Produce produce : list ){
             produce.setEmployeeId(0);
             for(ProduceProcess produceProcess : produce.getProcess()){
@@ -55,6 +57,7 @@ public class ProduceAppController {
                 if ( emId != Integer.valueOf(employeeId)){
                     emId = 0;
                 }else{
+                    flag = true;
                     produce.setEmployeeId(emId);
                 }
                 produceProcess.setEmployeeId(emId);
@@ -63,16 +66,16 @@ public class ProduceAppController {
                 }
             }
         }
-        if(list.size() < 1){
-            rsj.setResultCode(500);
-            rsj.setResultMsg("ERROR");
-            rsj.setReturnMsg("该员工未绑定工序");
-            return rsj;
-        }else{
+        if(flag){
             rsj.setResultCode(200);
             rsj.setResultMsg("SUCCESS");
             rsj.setReturnMsg(list);
             return rsj;
+        }else{
+            rsj.setResultCode(500);
+            rsj.setResultMsg("ERROR");
+            rsj.setReturnMsg("该员工未绑定工序");
+            return rsj;
         }
 
     }

+ 175 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/employee_list.ftl

@@ -0,0 +1,175 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <link rel="Bookmark" href="/favicon.ico" >
+    <link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/list_base.ftl">
+    <title>员工列表</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 员工管理
+    <span class="c-gray en">&gt;</span> 员工列表
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #58d2ea;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <div class="text-c">
+        <form action="${path}/admin/employee/_employee_list" method="post">
+            <input type="text" class="input-text" style="width:150px" value="${employeeNo!}" placeholder="员工编号" id="employeeNo" name="employeeNo">
+            <input type="text" class="input-text" style="width:150px" value="${employeeName!}" placeholder="员工姓名" id="employeeName" name="employeeName">
+            <input type="text" class="input-text" style="width:150px" value="${employeeTel!}" placeholder="员工电话" id="employeeTel" name="employeeTel">
+            <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+        </form>
+    </div>
+    <div class="cl pd-5 bk-gray mt-20">
+            <span class="l">
+                <button onClick="toAddEmployee()" class="btn radius" style="background: #58d2ea;color: #fff;" type="button"><i class="Hui-iconfont">&#xe604;</i>增加员工</button>
+            </span>
+    </div>
+    <table class="table table-border table-bordered table-hover">
+        <thead>
+        <tr>
+            <th scope="col" colspan="18">员工列表</th>
+            <#--<th scope="col" colspan="2">共有数据:<strong>#{page.total}</strong> 条</th>-->
+        </tr>
+        <tr class="text-c">
+            <th width="80">员工编号</th>
+            <th width="100">员工姓名</th>
+            <th width="120">员工电话</th>
+            <th width="55">员工状态</th>
+            <th width="80">入职日期</th>
+            <th width="100">员工岗位</th>
+            <th width="80">离职日期</th>
+            <th width="150">添加时间</th>
+            <th width="100">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        <#list page.dataList as employee>
+            <tr class="text-c">
+                <td>${employee.employeeNo!}</td>
+                <td>${employee.employeeName!}</td>
+                <td>${employee.employeeTel!}</td>
+                <td>
+                    <#if employee.employeeState == 0>
+                        离职
+                    <#elseif employee.employeeState == 1>
+                        在职
+                    </#if>
+                </td>
+                <td>${(employee.employeeEntryDate?string("yyyy-MM-dd"))!''}</td>
+                <td>${employee.employeePost!}</td>
+                <td>${(employee.employeeDepartureDate?string("yyyy-MM-dd"))!''}</td>
+                <td>${(employee.employeeCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                <td>
+                    <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_employee(${employee.employeeId!});">
+                        <i class="Hui-iconfont">&#xe6df;</i>
+                    </a>
+                    <#--<a style="text-decoration:none" href="javascript:void(0);" title="删除" onclick="admin_del_employee(${employee.employeeId!});">
+                        <i class="Hui-iconfont">&#xe60b;</i>
+                    </a>-->
+                </td>
+            </tr>
+        </#list>
+
+        </tbody>
+    </table>
+</div>
+<tfoot>
+<#include "/base/page_util.ftl">
+</tfoot>
+<script type="text/javascript">
+    /*
+        参数解释:
+        title	标题
+        url		请求的url
+        id		需要操作的数据id
+        w		弹出层宽度(缺省调默认值)
+        h		弹出层高度(缺省调默认值)
+    */
+
+    /*子页面添加完信息后回显添加结果是否成功*/
+    function admin_result(str,num) {
+        layer.msg(str,{icon:num,time:1000});
+    }
+
+    /*管理员-详情*/
+    function admin_add_filter(url){
+        window.location.href= url;
+    }
+    /*管理员-删除*/
+    function admin_del(obj,id){
+        layer.confirm('确认要删除吗?',function(index){
+            $.ajax({
+                type: 'POST',
+                url: '',
+                dataType: 'json',
+                success: function(data){
+                    $(obj).parents("tr").remove();
+                    layer.msg('已删除!',{icon:1,time:1000});
+                },
+                error:function(data) {
+                    console.log(data.msg);
+                },
+            });
+        });
+    }
+
+    /*管理员-编辑*/
+    function admin_edit(title,url,id,w,h){
+        layer_show(title,url,w,h);
+    }
+    /* 录入FAQ */
+    function add_FAQ(menuId,type) {
+        window.location.href= root_path + "/admin/faq/_add_FAQ?menuId="+menuId+"&menuType="+type;
+       // layer_show("增加FAQ", root_path + "/admin/faq/_add_FAQ?menuId="+menuId+"&menuType="+type);
+    }
+
+    /* 修改二级菜单状态 */
+    function update_FAQState(detaId) {
+        layer.confirm('确认要停用吗?',function(index){
+            $.post(root_path + "/admin/faq/updat_FAQState",{detaId:detaId}, function(result){
+                if (result.returnCode != 200 || result.returnCode != 200) {
+                    layer.msg('修改失败,请重试!',{icon: 5,time:3000});
+                } else {
+                    layer.msg('修改成功!',{icon: 1,time:2000}, function () {
+                        // 关闭当前页面,并刷新父级页面
+                        window.location.reload();
+                    });
+                }
+            });
+        });
+    }
+
+</script>
+<script>
+    /**
+     * 跳转到添加员工页面
+     */
+    function toAddEmployee(){
+        window.location.href= "${path}/admin/employee/to_save_employee";
+    }
+
+    /**
+     *跳转到编辑页面
+     * @param employee
+     */
+    function admin_update_employee(employeeId) {
+        window.location.href= "${path}/admin/employee/to_update_employee?employeeId="+employeeId;
+    }
+
+    /**
+     * 删除员工
+     * @param employeeId
+     */
+    function admin_del_employee(employeeId) {
+        window.location.href= "${path}/admin/employee/delete_employee?employeeId="+employeeId;
+    }
+</script>
+</body>
+</html>

+ 126 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/save_employee.ftl

@@ -0,0 +1,126 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <#include "/base/add_base.ftl">
+    <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css" />
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 5px 10px;width: 60%;}
+        .my-input-date{padding: 5px 10px;width: 60%;background: url(${path}/common/images/pts//rili-1.png) 98.5% center no-repeat; background-size:auto 80%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 60%;}
+        .my-btn-reset{padding: 6px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 6px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+    </style>
+    <title>添加员工- 员工管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 员工管理
+    <span class="c-gray en">&gt;</span> 添加员工
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #58d2ea;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-addEmployee">
+        <div style="padding: 10px;width: 600px;margin: 0 auto;">
+            <div class="my-title">员工信息</div>
+            <div class="input-box"><span class="input-dic">员工编号</span>&nbsp;&nbsp;<input class="my-input" name="employeeNo" type="text" value="" placeholder="请输入员工编号"/> </div>
+            <div class="input-box"><span class="input-dic">员工姓名</span>&nbsp;&nbsp;<input class="my-input" name="employeeName" type="text" value="" placeholder="请输入员工姓名"/> </div>
+            <div class="input-box"><span class="input-dic">员工电话</span>&nbsp;&nbsp;<input class="my-input" name="employeeTel" type="text" value="" placeholder="请输入员工手机号码"/> </div>
+            <div class="input-box"><span class="input-dic">员工状态</span>&nbsp;&nbsp;
+                <input type="radio" id="employeeState1" name="employeeState" value="1"/><label for="employeeState1">在职</label>
+                <input type="radio" id="employeeState2" name="employeeState" value="0"/><label for="employeeState2">离职</label>
+            </div>
+            <div class="input-box"><span class="input-dic">清空卡权限</span>
+                <input type="radio" id="employeeClearPower1" name="employeeClearPower" value="1" /><label for="employeeClearPower1">具有</label>
+                <input type="radio" id="employeeClearPower2" name="employeeClearPower" value="0" /><label for="employeeClearPower2">不具有</label>
+            </div>
+
+            <div class="input-box"><span class="input-dic">入职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeEntryDate" value="" placeholder="请选择入职日期" onClick="WdatePicker()" readonly="readonly"/> </div>
+            <div class="input-box" id="isDeparture"><span class="input-dic">离职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeDepartureDate" value="" placeholder="请选择离职日期" onClick="WdatePicker()" readonly="readonly"/> </div>
+            <div class="input-box"><span class="input-dic">员工岗位</span>&nbsp;&nbsp;<input class="my-input" type="text" name="employeePost" value="" placeholder="请输入员工岗位"/> </div>
+
+            <div style="clear: both;"></div>
+            <div class="input-box"><span class="input-dic">员工备注</span>&nbsp;&nbsp;
+                <textarea rows="3" cols="20" class="my-textarea" name="employeeDesc"></textarea>
+            </div>
+            <div>
+                <button type="reset" class="my-btn-reset">重置</button><button type="submit" class="my-btn-submit">确认提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+    //动态显示隐藏所属菜单
+    $(document).on('click', '.menuSubid input[type=radio]', function() {
+        isSelectShow($(this).val())
+    })
+
+    $(function(){
+        $("#form-admin-addEmployee").validate({
+            rules:{
+                subName:{
+                    required:true,
+                    minlength:4,
+                    maxlength:30
+                }
+            },
+            onkeyup:false,
+            focusCleanup:true,
+            success:"valid",
+            submitHandler:function(form){
+                $.post(root_path + "/admin/employee/save_employee", formatJSON(),function(result){
+                    if (result.returnCode != 200 || result.returnCode != 200) {
+                        layer.msg('录入失败,请重试!',{icon: 5,time:3000});
+                    } else {
+                        layer.msg('录入成功!!',{icon: 1,time:2000}, function () {
+                            // 关闭当前页面,并刷新父级页面
+                            window.location.href= '${path}/admin/employee/list_employee';
+                        });
+                    }
+                });
+            }
+        });
+    });
+
+    /*将表单format为JSON*/
+    function formatJSON() {
+        debugger;
+        var serializeObj={};
+        $($("#form-admin-addEmployee").serializeArray()).each(function(){
+            if (this.value != "" && this.value != null) {
+                serializeObj[this.name]=this.value;
+            }
+        });
+        return serializeObj;
+    }
+
+    $(function(){
+        //隐藏离职日期
+        $("#isDeparture").hide();
+
+        //监听离职状态,离职的才有离职时间
+        $("[name='employeeState']").change(function(){
+            $("[name='employeeDepartureDate']").val("");
+            var  departureDate =  $("[name='employeeState']:checked").val();
+            if(departureDate == "0"){
+                $("#isDeparture").show();
+            }else{
+                $("#isDeparture").hide();
+            }
+        })
+    })
+</script>
+</body>
+</html>

+ 123 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/update_employee.ftl

@@ -0,0 +1,123 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <#include "/base/add_base.ftl">
+    <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css" />
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 5px 10px;width: 60%;}
+        .my-input-date{padding: 5px 10px;width: 60%;background: url(${path}/common/images/pts//rili-1.png) 98.5% center no-repeat; background-size:auto 80%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 60%;}
+        .my-btn-reset{padding: 6px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 6px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+    </style>
+    <title>添加员工- 员工管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 员工管理
+    <span class="c-gray en">&gt;</span> 修改员工
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #58d2ea;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-addEmployee">
+        <div style="padding: 10px;width: 600px;margin: 0 auto;">
+            <div class="my-title">员工信息</div>
+            <input type="hidden" name="employeeId" value="${employee.employeeId!}">
+            <div class="input-box"><span class="input-dic">员工编号</span>&nbsp;&nbsp;<input class="my-input" name="employeeNo" type="text" value="${employee.employeeNo!}" placeholder="请输入员工编号"/> </div>
+            <div class="input-box"><span class="input-dic">员工姓名</span>&nbsp;&nbsp;<input class="my-input" name="employeeName" type="text" value="${employee.employeeName!}" placeholder="请输入员工姓名"/> </div>
+            <div class="input-box"><span class="input-dic">员工电话</span>&nbsp;&nbsp;<input class="my-input" name="employeeTel" type="text" value="${employee.employeeTel!}" placeholder="请输入员工手机号码"/> </div>
+            <div class="input-box"><span class="input-dic">员工状态</span>&nbsp;&nbsp;
+                <input type="radio" id="employeeState1" name="employeeState" value="1" <#if employee.employeeState == 1>checked</#if>/><label for="employeeState1">在职</label>
+                <input type="radio" id="employeeState2" name="employeeState" value="0" <#if employee.employeeState == 0>checked</#if>/><label for="employeeState2">离职</label>
+            </div>
+            <div class="input-box"><span class="input-dic">清空卡权限</span>
+                <input type="radio" id="employeeClearPower1" name="employeeClearPower" value="1" <#if employee.employeeClearPower == 1>checked</#if>/><label for="employeeClearPower1">具有</label>
+                <input type="radio" id="employeeClearPower2" name="employeeClearPower" value="0" <#if employee.employeeClearPower == 0>checked</#if>/><label for="employeeClearPower2">不具有</label>
+            </div>
+
+            <div class="input-box"><span class="input-dic">入职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeEntryDate" value="${(employee.employeeEntryDate?string("yyyy-MM-dd"))!''}" placeholder="请选择入职日期" onClick="WdatePicker()" readonly="readonly"/> </div>
+            <div class="input-box" id="isDeparture" style="<#if employee.employeeState == 1>display: none</#if>"><span class="input-dic">离职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeDepartureDate" value="${(employee.employeeDepartureDate?string("yyyy-MM-dd"))!''}" placeholder="请选择离职日期" onClick="WdatePicker()" readonly="readonly"/> </div>
+            <div class="input-box"><span class="input-dic">员工岗位</span>&nbsp;&nbsp;<input class="my-input" type="text" name="employeePost" value="${employee.employeePost!}" placeholder="请输入员工岗位"/> </div>
+
+            <div style="clear: both;"></div>
+            <div class="input-box"><span class="input-dic">员工备注</span>&nbsp;&nbsp;
+                <textarea rows="3" cols="20" class="my-textarea" name="employeeDesc">${employee.employeeDesc!}</textarea>
+            </div>
+            <div>
+                <button type="reset" class="my-btn-reset">重置</button><button type="submit" class="my-btn-submit">确认提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+    //动态显示隐藏所属菜单
+    $(document).on('click', '.menuSubid input[type=radio]', function() {
+        isSelectShow($(this).val())
+    })
+
+    $(function(){
+        $("#form-admin-addEmployee").validate({
+            rules:{
+                subName:{
+                    required:true,
+                    minlength:4,
+                    maxlength:30
+                }
+            },
+            onkeyup:false,
+            focusCleanup:true,
+            success:"valid",
+            submitHandler:function(form){
+                $.post(root_path + "/admin/employee/update_employee", formatJSON(),function(result){
+                    if (result.returnCode != 200 || result.returnCode != 200) {
+                        layer.msg('录入失败,请重试!',{icon: 5,time:3000});
+                    } else {
+                        layer.msg('录入成功!!',{icon: 1,time:2000}, function () {
+                            // 关闭当前页面,并刷新父级页面
+                            window.location.href= '${path}/admin/employee/list_employee';
+                        });
+                    }
+                });
+            }
+        });
+    });
+
+    /*将表单format为JSON*/
+    function formatJSON() {
+        var serializeObj={};
+        $($("#form-admin-addEmployee").serializeArray()).each(function(){
+            if (this.value != "" && this.value != null) {
+                serializeObj[this.name]=this.value;
+            }
+        });
+        return serializeObj;
+    }
+
+    $(function(){
+        //监听离职状态,离职的才有离职时间
+        $("[name='employeeState']").change(function(){
+            $("[name='employeeDepartureDate']").val("");
+            var  departureDate =  $("[name='employeeState']:checked").val();
+            if(departureDate == "0"){
+                $("#isDeparture").show();
+            }else{
+                $("#isDeparture").hide();
+            }
+        })
+    })
+</script>
+</body>
+</html>

+ 29 - 29
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_List.ftl

@@ -152,49 +152,49 @@
                     /*$("#barcodeId").html(machineBarcode);
                     $("#qrcodeImg").attr('src',machineQrcode);*/
                     if(produceType == 1){//净水机模板
-                        $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
-                                '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
-                                '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
-                                '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
-                                '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                        $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
+                                '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO可移动智能净水机</span>' +
+                                '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:WA-1X</span>' +
+                                '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
+                                '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no.:4295</span> ' +
                                 '</div>');
                     }
                     if(produceType == '' || produceType == null){
-                        $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
-                                '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
-                                '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
-                                '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
-                                '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                        $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
+                                '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO可移动智能净水机</span>' +
+                                '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:WA-1X</span>' +
+                                '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
+                                '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
                                 '</div>');
                     }
                     if(produceType == 2){//冲奶机模板
-                        $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
-                                '<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
-                                '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
-                                '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
-                                '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                        $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
+                                '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">爱贝源冲奶机</span>' +
+                                '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:WA-1X</span>' +
+                                '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
+                                '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
                                 '</div>');
                     }
 
                 }
                 $("#printlist").printArea();
                 $("#printlist").html("");
-                updatePrint(machineBarcode);
+                updatePrint(machineId);
             }
 
             ref = setInterval(function(){
-                latestMachines();
+                latestMachine();
             },2000);
-            function  latestMachines() {
+            function  latestMachine() {
                 $.ajax({
                     cache: true,
                     type: "POST",
@@ -273,12 +273,12 @@
                 return   year+"-"+month+"-"+date;
             }
 
-            function updatePrint(machineBarcode){
+            function updatePrint(machineId){
                 $.ajax({
                     "type" : "post",
                     "url" : "${path}/admin/machine/_update_print",
                     "dataType" : "json",
-                    "data" :{machineBarcode : machineBarcode},
+                    "data" :{machineId : machineId},
                     "success" : function(data) {
 
                     },

+ 72 - 74
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -44,7 +44,7 @@
 				</thead>
 				<tbody id="listid">
 					<#list machineList as list>
-						<tr >
+						<tr>
                             <td width="2">
                                 <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
                             </td>
@@ -70,15 +70,11 @@
         <script type="text/javascript" src="${path}/common/static/h-ui.admin/js/H-ui.js"></script>
 
 		<script type="text/javascript">
-            $("#all").on('click',function(){
-                console.log($(this).prop('checked'));
-                if($(this).prop('checked')){
-                    $("input[name='checkbox']").prop("checked","true");
-                }else{
-                    $("input[name='checkbox']").removeAttr("checked");
-                }
+            $("#all").click(function(){
+                $("input[name='checkbox']").attr("checked","true");
+            })
+
 
-            });
                 if(${machineIsPrint} == 1){
                     $("#notPrint").attr("class", "current");
                     $("#machineIsPrint").val(1);
@@ -111,51 +107,41 @@
             function  printList() {
                 var machineBarcode = null;
                 var machineQrcode = null;
-                var machineProduceType = null;
-                var prints = "";
-                var settingNumber = $("#settingNumber").val();
+                var machineProduceType = null
                     $("input[name='checkbox']:checkbox:checked").each(function(){
-                        prints += $(this).val();
                         machineBarcode = $(this).val().substring(0,13);
                         machineQrcode = $(this).val().substring(13,($(this).val().length)-1);
                         machineProduceType = $(this).val().substring(($(this).val().length)-1,$(this).val().length);
-                        for (var i=0;i<settingNumber;i++){
-                            code128(machineBarcode);
-                            var barcodes = $("#bcTarget").html();
-                            /*$("#barcodeId").html(machineBarcode);
-                            $("#qrcodeImg").attr('src',machineQrcode);*/
-                            if(machineProduceType == 1){//净水机模板
-                                $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
-                                        '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
-                                        '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
-                                        '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
-                                        '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                        '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                        '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                        '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
-                                        '</div>');
-                            }
-                            if(machineProduceType == 2){//冲奶机模板
-                                $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
-                                        '<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
-                                        '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
-                                        '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
-                                        '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
-                                        '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
-                                        '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
-                                        '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
-                                        '</div>');
-                            }
-                            updatePrint(machineBarcode);
+                        code128(machineBarcode);
+                        var barcodes = $("#bcTarget").html();
+                        /*$("#barcodeId").html(machineBarcode);
+                        $("#qrcodeImg").attr('src',machineQrcode);*/
+                        if(machineProduceType == 1){//净水机模板
+                            $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
+                                    '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO可移动智能净水机</span>' +
+                                    '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:WA-1X</span>' +
+                                    '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
+                                    '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                    '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                    '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                    '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no.:4295</span> ' +
+                                    '</div>');
                         }
+                        if(machineProduceType == 2){//冲奶机模板
+                            $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
+                                    '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">爱贝源冲奶机</span>' +
+                                    '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:WA-1X</span>' +
+                                    '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
+                                    '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                    '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                    '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                    '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
+                                    '</div>');
+                        }
+                        updatePrint(machineBarcode);
                     })
-                if(prints != ""){
-                    $("#printlist").printArea();
-                    $("#printlist").html("");
-                }else{
-                    alert("未选中需要打印的条形码");
-                }
-                prints = "";
+                $("#printlist").printArea();
+                $("#printlist").html("");
             /*$.ajax({
                     cache: true,
                     type: "POST",
@@ -221,38 +207,50 @@
                 latestMachine();
             },2000);
             function  latestMachine() {
-                var machineIsPrint = $("#machineIsPrint").val();
-                if(machineIsPrint == 2){
-                    $.ajax({
-                        cache: true,
-                        type: "POST",
-                        url: "${path}/admin/machine/_LatestMachine_list",
-                        data:{machineId : $("#machineId").val()},// 你的formid
-                        success: function(data){
-                            if(data != null){
-                                $.each(data,function(i,value) {
-                                    if(i+1 == data.length){
-                                        $("#machineId").val(value.machineId);
-                                    }
-                                    $("#listid").prepend('<tr><td width="2"> ' +
-                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > </td>' +
-                                            '<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
-                                            '<td class="td-manage text-c"> <a onclick="machineLogs('+value.machineId+');" title="生产流程" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe667;</i></a> </td></tr>');
+                $.ajax({
+                    cache: true,
+                    type: "POST",
+                    url: "${path}/admin/machine/_LatestMachine_list",
+                    data:{machineId : $("#machineId").val()},// 你的formid
+                    success: function(data){
+                        if(data != null){
+                            $.each(data,function(i,value) {
+                                if(i+1 == data.length){
+                                    $("#machineId").val(value.machineId);
+                                }
+                                $("#listid").prepend('<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
+                                        '<td class="td-manage text-c"> <a onclick="machineLogs('+value.machineId+');" title="生产流程" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe667;</i></a> </td>');
+                            });
+                        }
 
+                    },
+                    error: function(){
+                        console.log("查询最新机器失败!");
+                    }
+                });
+            }
 
-                                });
-                            }
 
-                        },
-                        error: function(){
-                            console.log("查询最新机器失败!");
-                        }
-                    });
+            function   formatDate(now)   {
+                var time = new Date(now);
+                var   year=time.getFullYear();
+                var   month=time.getMonth()+1;
+                var   date=time.getDate();
+                var   hour=time.getHours();
+                var   minute=time.getMinutes();
+                var   second=time.getSeconds();
+                if(month < 10){
+                    month = "0"+month;
                 }
-
+                if(date < 10){
+                    date = "0"+date;
+                }
+                if(minute < 10){
+                    minute = "0"+minute;
+                }
+                return   year+"-"+month+"-"+date;
             }
 
-
                 function updatePrint(machineBarcode){
                     $.ajax({
                         "type" : "post",

+ 5 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl

@@ -32,6 +32,10 @@
             <div class="my-title">产品信息</div>
             <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" type="text" value="" placeholder="请输入产品名称"/> </div>
             <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" value="" placeholder="请输入产品描述"/> </div>
+            <div class="input-box"><span class="input-dic">产品类型</span>
+                <label><input type="radio" name="produceType" value="1">净水机</label>
+                <label><input type="radio" name="produceType" value="2">冲奶机</label>
+            </div>
             <div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;"></div>
             <div class="my-title">节点信息</div>
 
@@ -137,6 +141,7 @@
         produce.json = JSON.stringify(proessList);      //将工序变成json存入到产品对象中
         produce.produceName = $("[name='produceName']").val();//获取产品名称
         produce.produceRemake = $("[name='produceRemake']").val();//获取产品描述
+        produce.produceType = $("[name='produceType']").val();//获取产品描述
         return produce;
     }
 

+ 13 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

@@ -33,6 +33,10 @@
             <input type="hidden" name="produceId" value="${produce.produceId!}">
             <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" type="text" value="${produce.produceName!}" placeholder="请输入产品名称"/> </div>
             <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" value="${produce.produceRemake!}" placeholder="请输入产品描述"/> </div>
+            <div class="input-box"><span class="input-dic">产品类型</span>
+                <label><input type="radio" name="produceType" value="1" <#if nodes.nodeStatus == 1>checked</#if>>净水机</label>
+                <label><input type="radio" name="produceType" value="2" <#if nodes.nodeStatus == 2>checked</#if>>冲奶机</label>
+            </div>
             <div style="background-color:rgba(0,0,0,.1);height: 1px;margin: 15px 0;"></div>
             <div class="my-title">节点信息</div>
 
@@ -152,6 +156,7 @@
         produce.produceId = $("[name='produceId']").val();//获取产品id
         produce.produceName = $("[name='produceName']").val();//获取产品名称
         produce.produceRemake = $("[name='produceRemake']").val();//获取产品描述
+        produce.produceType = $("[name='produceType']").val();//获取产品描述
 
         produce.delProcessIds = delProcessIds;    //需要删除的工序id
         produce.delNodeIds = delNodeIds;           //需要删除的节点操作id
@@ -225,8 +230,13 @@
         if(parseInt(processNumber) < 2){
             layer.msg('至少要有一个节点!',{icon: 5,time:3000});
         }else{
+            var processId = $(node).parents(".processList").find("[name='processId']").val();
+            delProcessIds += processId+",";
+            $(node).parents(".processList").find("[name='nodeId']").each(function(){
+                delNodeIds += $(this).val()+",";
+            });
+
             $(node).parents(".processList").remove();
-            //delProcessIds += delProcessIds+",";
         }
     }
 
@@ -239,6 +249,8 @@
         if(parseInt(nodesNumber) < 2){
             layer.msg('至少要有一个节点操作!',{icon: 5,time:3000});
         }else{
+            var nodeId = $(node).parents(".nodeList").find("[name='nodeId']").val();
+            delNodeIds += nodeId  + ",";
             $(node).parents(".nodeList").remove();
         }
     }

BIN
watero-rst-web/src/main/webapp/common/images/pts/barcode-1.png


BIN
watero-rst-web/src/main/webapp/common/images/pts/jiqi-2.png


BIN
watero-rst-web/src/main/webapp/common/images/pts/qrcode-1.png


BIN
watero-rst-web/src/main/webapp/common/images/pts/rili-1.png


BIN
watero-rst-web/src/main/webapp/common/images/pts/select-1.png


BIN
watero-rst-web/src/main/webapp/common/images/pts/tanhao.png