2 Revīzijas c475806a62 ... 5b12ffb639

Autors SHA1 Ziņojums Datums
  liujiankang 5b12ffb639 5. 工厂生产管理 5 gadi atpakaļ
  liujiankang d1119cc799 5. 工厂生产管理 5 gadi atpakaļ

+ 31 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionPlan.java

@@ -27,6 +27,13 @@ public class ProductionPlan implements Serializable {
     private String employeeString;//员工id集合 _线隔开
     private Integer processWorkinghours;//每人每小时数量
     private Integer employeeId;//员工id
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date stateDate;//开始时间
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date endDate;//结束时间
+    private Integer isPerfect;//是否完善
     public Integer getPlanId() {
         return planId;
     }
@@ -129,4 +136,28 @@ public class ProductionPlan implements Serializable {
     public void setEmployeeId(Integer employeeId) {
         this.employeeId = employeeId;
     }
+
+    public Date getStateDate() {
+        return stateDate;
+    }
+
+    public void setStateDate(Date stateDate) {
+        this.stateDate = stateDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Integer getIsPerfect() {
+        return isPerfect;
+    }
+
+    public void setIsPerfect(Integer isPerfect) {
+        this.isPerfect = isPerfect;
+    }
 }

+ 31 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsEmployee.java

@@ -34,6 +34,13 @@ public class PtsEmployee implements Serializable{
     private String employeeLine;  //拉线
     private Integer isJoinProcess;//是否已加入当日其他工序 1是 2 否
     private String processName;//已加入当日其他工序名称
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date stateDate;//开始时间
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date endDate;//结束时间
+    private Double ageEfficiency;//平均效率
 
     public Integer getEmployeeId() {
         return employeeId;
@@ -154,4 +161,28 @@ public class PtsEmployee implements Serializable{
     public void setProcessName(String processName) {
         this.processName = processName;
     }
+
+    public Date getStateDate() {
+        return stateDate;
+    }
+
+    public void setStateDate(Date stateDate) {
+        this.stateDate = stateDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Double getAgeEfficiency() {
+        return ageEfficiency;
+    }
+
+    public void setAgeEfficiency(Double ageEfficiency) {
+        this.ageEfficiency = ageEfficiency;
+    }
 }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/tools/LogisticsInfo.java

@@ -27,6 +27,7 @@ public class LogisticsInfo implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date endDate;                   //结束时间
+    private Integer logisticsIsSynchronous;//是否可同步物流信息 1是 2否
 
     public Integer getLogisticsId() {
         return logisticsId;
@@ -115,4 +116,12 @@ public class LogisticsInfo implements Serializable {
     public void setEndDate(Date endDate) {
         this.endDate = endDate;
     }
+
+    public Integer getLogisticsIsSynchronous() {
+        return logisticsIsSynchronous;
+    }
+
+    public void setLogisticsIsSynchronous(Integer logisticsIsSynchronous) {
+        this.logisticsIsSynchronous = logisticsIsSynchronous;
+    }
 }

+ 5 - 21
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -243,7 +243,6 @@
       c.question_id,
       c.store_id,
       c.company_id,
-      c.customer_area,
       c.customer_in_TDS,
       c.customer_out_TDS,
       c.customer_is_solve,
@@ -262,13 +261,10 @@
       c.customer_province_id as customerProvinceId,
       c.customer_city_id as customerCityId,
       c.customer_district_id as customerDistrictId,
-      ct.complaint_class_name,
       csc.small_class_name,
       t.type_name,
       a.admin_name,
       qd.describe_title,
-      qd.describe_handle_desc,
-      qd.describe_content,
       sc.company_name,
       si.store_name,
       v.visit_status,
@@ -280,7 +276,6 @@
       v.visit_complete_name,
       v.visit_complete_tel,
       sa.admin_name AS visitDesignatedAdminName,
-      cq.question_profile,
       sx.sendback_status AS backStatus,
       cc.relationSendLogisticsNo AS sendLogisticsNo,
       cc.relationSendLogisticsCompany AS sendLogisticsCompany,
@@ -294,7 +289,6 @@
       cc.customerIsSolve as customerIsSolve,
       cc.procMethodIsBack as procMethodIsBack,
       cc.procMethodIsSend as procMethodIsSend,
-      cc.relationSendAddress as customerSendAddress,
       cc.relationId as relationId,
       ri.receivingOne as receivingOne,
       ri.receivingTwo as receivingTwo,
@@ -311,7 +305,6 @@
       cs.completeMaintenanceNum as completeMaintenanceNum,
       cs.beenScrappedNum as beenScrappedNum,
       cs.beenRenovatedNum as beenRenovatedNum,
-      ti.tag_desc as tagDesc,
       ti.tag_flag as tagFlag
       FROM
       tb_rst_cm_customer_info c
@@ -334,8 +327,7 @@
       tb_rst_cm_proc_type.proc_type_id AS procTypeId,
       tb_rst_cm_proc_type.proc_type_name AS procTypeName,
       tb_rst_cm_proc_method.proc_method_is_back AS procMethodIsBack,
-      tb_rst_cm_proc_method.proc_method_is_send AS procMethodIsSend,
-      tb_rst_cm_relation.relation_send_address AS relationSendAddress
+      tb_rst_cm_proc_method.proc_method_is_send AS procMethodIsSend
       FROM
       tb_rst_cm_relation
       LEFT JOIN tb_rst_cm_proc_method ON tb_rst_cm_proc_method.proc_method_id = tb_rst_cm_relation.proc_method_id
@@ -352,24 +344,16 @@
       select tb_rst_cm_sendback_info.sendback_status,tb_rst_cm_sendback_info.relation_id,tb_rst_cm_relation.customer_id
       FROM tb_rst_cm_sendback_info
       LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_cm_sendback_info.relation_id
-      ORDER BY sendback_create_time desc
+      ORDER BY sendback_id desc
       ) ss
       GROUP BY ss.relation_id
       ) sxx
       ) sx ON sx.customer_id = c.customer_id
-      LEFT JOIN (
-      SELECT ss.*
-      from (
-      select tb_rst_cm_sendback_info.*,tb_rst_cm_relation.customer_id
-      FROM tb_rst_cm_sendback_info
-      LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_cm_sendback_info.relation_id
-      ORDER BY
-      sendback_create_time desc
-      ) ss
-      ) sss ON sss.customer_id = c.customer_id
+
       LEFT JOIN (SELECT
       signclosed_id,
       signclosed_customer_id,
+      signclosed_logistics_number,
       COUNT(
       CASE signclosed_is_receiving
       WHEN 1 THEN
@@ -473,7 +457,7 @@
       <if test="sendLogisticsNo != null and sendLogisticsNo != ''">
         AND  (
                 cc.relationSendLogisticsNo =  #{sendLogisticsNo} OR
-                sss.sendback_logistics_no  =  #{sendLogisticsNo} OR
+                ri.signclosed_logistics_number  =  #{sendLogisticsNo} OR
                 soi.sales_post_num = #{sendLogisticsNo}
               )
       </if>

+ 4 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/logisticsInfoMapper.xml

@@ -9,6 +9,8 @@
         <result    column="logistics_onehundred_code"    property="logisticsOnehundredCode" />
         <result    column="logistics_reamk"    property="logisticsReamk" />
         <result    column="create_date"    property="createDate" />
+        <result    column="logistics_is_lash_single"    property="logisticsIsLashSingle" />
+        <result    column="logistics_is_synchronous"    property="logisticsIsSynchronous" />
     </resultMap>
     <sql    id="Base_List" >
         t.logistics_id,
@@ -18,7 +20,8 @@
         t.logistics_onehundred_code,
         t.logistics_reamk,
         t.create_date,
-        t.logistics_is_lash_single
+        t.logistics_is_lash_single,
+        t.logistics_is_synchronous
     </sql>
     <select id="getLogisticsInfoList" resultMap="BaseResultMap" parameterType="LogisticsInfo" >
         select

+ 9 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml

@@ -71,6 +71,15 @@
             <if test="employeeId != null and employeeId != ''">
                 AND pe.pe_employee_id = #{employeeId}
             </if>
+            <if test="stateDate != null and stateDate != ''">
+                AND pp.plan_date &gt;= #{stateDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND pp.plan_date &lt;= #{endDate}
+            </if>
+            <if test="isPerfect != null and isPerfect != '' and isPerfect == 1">
+                AND pp.plan_work_hours is not null AND pp.plan_results is not null
+            </if>
         </where>
         group by plan_id
     </select>

+ 17 - 12
watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java

@@ -602,18 +602,23 @@ public class MQTask implements InitializingBean {
             LogisticsInfo log = new LogisticsInfo();
             log.setLogisticsRstCode(salesOrder.getSalesPostFirm());
             List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
-            // 调用第三方接口查询物流信息
-            Date date = kuaidi100.selectCourierSignCaseTime(listlog.get(0),salesOrder.getSalesPostNum());
-            if(date == null){
-                continue;
-            }
-            // 编辑订单的揽件时间
-            SalesOrder so = new SalesOrder();
-            so.setSalesId(salesOrder.getSalesId());
-            so.setOrderCaseDate(date);
-            if(salesOrderService.update(so) <= 0){
-                logger.info("修改揽件时间异常,订单号:"+salesOrder.getSalesOrderId());
-            }
+            if(listlog.size() > 0){
+            	if(listlog.get(0).getLogisticsIsSynchronous() == 1){
+					// 调用第三方接口查询物流信息
+					Date date = kuaidi100.selectCourierSignCaseTime(listlog.get(0),salesOrder.getSalesPostNum());
+					if(date == null){
+						continue;
+					}
+					// 编辑订单的揽件时间
+					SalesOrder so = new SalesOrder();
+					so.setSalesId(salesOrder.getSalesId());
+					so.setOrderCaseDate(date);
+					if(salesOrderService.update(so) <= 0){
+						logger.info("修改揽件时间异常,订单号:"+salesOrder.getSalesOrderId());
+					}
+				}
+			}
+
         }
 	}
 

+ 61 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProductionPlanController.java

@@ -339,4 +339,65 @@ public class ProductionPlanController {
         }
         return msg;
     }
+    /**
+     * 查询员工工作统计列表
+     * @param pageSize
+     * @param pageNO
+     * @param totalNum
+     * @return
+     */
+    @RequiresPermissions("productionPlan:mployeeStatistical:productionPlan")
+    @RequestMapping("/select_employeeStatistical_list")
+    public ModelAndView select_employeeStatistical_list(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,
+                                                        PtsEmployee ptsEmployee) throws Exception  {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/employee_statistical_list");
+        StringBuilder url = new StringBuilder("/admin/productionPlan/select_employeeStatistical_list?pageSize=" + pageSize);
+        String statedate = request.getParameter("statedate");
+        String enddate = request.getParameter("enddate");
+        ProductionPlan productionPlan = new ProductionPlan();
+        productionPlan.setIsPerfect(1);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        if(statedate != null && !statedate.equals("")){
+            productionPlan.setStateDate(format.parse(statedate));
+            ptsEmployee.setStateDate(format.parse(statedate));
+        }
+        if(enddate != null && !enddate.equals("")){
+            productionPlan.setEndDate(format.parse(enddate));
+            ptsEmployee.setEndDate(format.parse(enddate));
+        }
+
+        PagedResult<PtsEmployee> pagedResult = ptsEmployeeService.getEmployeeList(pageNO, pageSize, ptsEmployee, totalNum == 0);
+
+        //计算平均效率
+        if(pagedResult.getDataList().size() > 0){
+            for(PtsEmployee employee : pagedResult.getDataList()){
+                productionPlan.setEmployeeId(employee.getEmployeeId());
+                List<ProductionPlan> listplan = productionPlanService.listProductionPlan(productionPlan);
+                double totalEfficiency = 0;
+                //计算总效率
+                if(listplan.size() > 0){
+                    for(ProductionPlan plan : listplan){
+                        double efficiency = (plan.getPlanResults()/plan.getPlanWorkHours()/plan.getEmployeesNum())/plan.getProcessWorkinghours();
+                        totalEfficiency += efficiency;
+                    }
+                }
+                if(totalEfficiency > 0){
+                    employee.setAgeEfficiency((totalEfficiency/listplan.size()) * 100);
+                }else{
+                    employee.setAgeEfficiency(0.00);
+                }
+
+            }
+        }
+
+        if (totalNum != 0){
+            pagedResult.setTotal(totalNum);
+        }
+
+        StitchAttrUtil.getSa().setModelAndView(ptsEmployee, mv, "/admin/productionPlan/select_employeeStatistical_list", pagedResult);
+        return mv;
+    }
 }

+ 6 - 6
watero-rst-web/src/main/resources/dev-jdbc.properties

@@ -1,13 +1,13 @@
 jdbc.driver=com.mysql.jdbc.Driver
 ##### \uFFFD\uFFFD\u02BD\uFFFD\uFFFD\uFFFD\uFFFD ####
-#jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-#jdbc.username=watero_rst
-#jdbc.password=watero_RST
+jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+jdbc.username=watero_rst
+jdbc.password=watero_RST
 ##### \uFFFD\uFFFD\u02BD\uFFFD\uFFFD\uFFFD\uFFFD end #####
 
-jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst_test_2?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-jdbc.username=rst_test
-jdbc.password=RST_test
+#jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst_test_2?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#jdbc.username=rst_test
+#jdbc.password=RST_test
 
 #pool settings
 jdbc.pool.init=1

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

@@ -219,6 +219,16 @@
                                     '<div style="position: absolute;padding-top: 25px;" id="bcTarget2" class="barcodeImg">'+barcodes2+'</div>' +
                                     /* '<span style="position: absolute;padding-top: 100px;padding-left: -100px;" id="barcodeId">'+machineBarcode+'</span>' +*/
                                     '</div>');
+                        }else if(produceName === "净水机基础版水箱" || produceName === "净水机银离子水箱"){
+                            $("#printlist").append('<div style="width: 242px;height: 122px;position: relative;">' +
+                                    '<span style="position: absolute;left: 10px;font-size: 14px;">'+produceName+'</span>' +
+                                    '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
+                                    '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +
+                                    '<div style="position: absolute;left: 5px;top: 64px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
+                                    '<span style="position: absolute;top: 85px;left: 10px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
+                                    '<img style="position: absolute;right: 5px;top:18px;width: 76px;height: 76px; display: none;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
+                                    '<span style="position: absolute;right: 9px;top: 85px;font-size: 12px;">'+ produceCreateTime +'</span>' +
+                                    '</div>');
                         }else{
                             $("#printlist").append('<div style="width: 242px;height: 122px;position: relative;">' +
                                     '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +

+ 176 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/employee_statistical_list.ftl

@@ -0,0 +1,176 @@
+<!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>
+    <style>
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #50a2ea;padding: 1px 25px;height: 32px;background-color: #fff;color: #50a2ea;}
+        .barcodeImg{margin:10px 0px}
+        .table-bg thead th{background-color: #e2f6ff;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">/</span> 员工管理
+    <span class="c-gray en">/</span> 员工列表
+    <a class="btn radius r" 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/productionPlan/select_employeeStatistical_list" method="post">
+
+            <input type="text" style="margin-top: -3px;width:9%;height:30px;margin-right: 0px;font-size: 9px;" name="statedate" id="statedate" class="input-text" placeholder="工作计划开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd'})" value="${(ptsEmployee.stateDate?string("yyyy-MM-dd"))!''}" readonly="readonly"/>-
+            <input type="text" style="margin-top: -3px;width:9%;height:30px;margin-right: 0px;font-size: 9px;" name="enddate" id="enddate" class="input-text" placeholder="工作计划结束时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd'})" value="${(ptsEmployee.endDate?string("yyyy-MM-dd"))!''}" readonly="readonly"/>
+            <button type="submit" class="my-btn-search" style="cursor:pointer;" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+        </form>
+    </div>
+
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort">
+        <thead>
+       <#-- <tr>
+            <th scope="col" colspan="18">员工列表</th>
+        &lt;#&ndash;<th scope="col" colspan="2">共有数据:<strong>#{page.total}</strong> 条</th>&ndash;&gt;
+        </tr>-->
+        <tr class="text-c">
+
+            <th width="80">员工编号</th>
+            <th width="100">员工姓名</th>
+            <th width="100">所属部门</th>
+            <th width="55">平均效率</th>
+        </tr>
+        </thead>
+        <tbody>
+            <#if page.dataList?? &&  (page.dataList?size > 0) >
+                    <#list page.dataList as employee>
+                        <tr class="text-c">
+                            <td>${employee.employeeNo!}</td>
+                            <td>${employee.employeeName!}</td>
+                            <td>${employee.employeeLine!}</td>
+                            <td>${employee.ageEfficiency!''}%</td>
+                        </tr>
+                    </#list>
+            <#else>
+            <tr><td colspan="11" class="td-manage text-c" >暂时没有记录</td></tr>
+            </#if>
+        </tbody>
+    </table>
+    </div>
+</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 edit_process(url) {
+        window.location.href = url
+    }
+
+    /*管理员-详情*/
+    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>
+    /**
+     * 导出员工到EXCEL
+     */
+    function toExcel(){
+        window.location.href= "${path}/admin/employee/excel";
+    }
+    /**
+     * 跳转到添加员工页面
+     */
+    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>

+ 11 - 2
watero-rst-web/src/main/webapp/common/js/salesOrder/salesOrder.js

@@ -510,6 +510,9 @@ function sharePrice(){
     $("#add_product").find("tr").each(function(){
         var colorDiscount = 0,colorPrice = 0,salesPayMoney=0,itemNum=0;
         colorDiscount = Number($(this).find(".color_discount").val());
+        if(colorDiscount === 0){
+            colorDiscount = 1;
+        }
         itemNum = $(this).find(".item-num").val();
         if(!isEmpty(itemNum)){
             return;
@@ -522,6 +525,9 @@ function sharePrice(){
     $("#add_product").find("tr").each(function(i, dom){
         var colorDiscount = 0,colorPrice = 0,salesPayMoney=0,itemNum=0;
         colorDiscount = Number($(this).find(".color_discount").val());
+        if(colorDiscount === 0){
+            colorDiscount = 1;
+        }
         itemNum = $(this).find(".item-num").val();
         if(!isEmpty(itemNum)){
             return;
@@ -529,12 +535,15 @@ function sharePrice(){
         itemNum = Number(itemNum);
         var total = accMul(colorDiscount,itemNum);
         var proportion = accDiv(total,colorDiscountAll);
+        if(colorDiscountAll === 0){
+            proportion = 0;
+        }
         var msg = Math.floor(salesPayMoneyTest * proportion  * 100) /100;
         /*var msg = Math.floor(accMul(salesPayMoneyTest,proportion)  * 100) /100;*/
 
         if(i === length -1){
-            $(this).find(".item_total").val(accSub(salesPayMoneyTest,remainingAmount));
-            $(this).find(".item_totalTd").html(accSub(salesPayMoneyTest,remainingAmount));
+                $(this).find(".item_total").val(accSub(salesPayMoneyTest,remainingAmount));
+                $(this).find(".item_totalTd").html(accSub(salesPayMoneyTest,remainingAmount));
         }else{
             remainingAmount = accAdd(msg,remainingAmount);
             $(this).find(".item_total").val(msg);