Browse Source

品质管理模块

liujiankang 7 years ago
parent
commit
98d1b04eed

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java

@@ -29,6 +29,7 @@ public class ComplaintDetectInfo implements Serializable {
     private String detectAnalysis;//原因分析
     private Integer detectCustomerId;//客诉id
     private Integer detectRevolutionProduced;//是否转入生产部门
+    private Integer maintenanceResults;//QC检测结果
     private String detectDesc;//备注
     private Date signclosedCreateTime;//创建时间
     private Date signclosedUpdateTime;//修改时间
@@ -227,4 +228,12 @@ public class ComplaintDetectInfo implements Serializable {
     public void setProductName(String productName) {
         this.productName = productName;
     }
+
+    public Integer getMaintenanceResults() {
+        return maintenanceResults;
+    }
+
+    public void setMaintenanceResults(Integer maintenanceResults) {
+        this.maintenanceResults = maintenanceResults;
+    }
 }

+ 7 - 25
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintMaintenanceInfo.java

@@ -20,17 +20,15 @@ public class ComplaintMaintenanceInfo  implements Serializable {
 
     private String maintenanceProductNumber;//产品型号
 
-    private String maintenanceResults;//QC检测结果
 
-    private Boolean maintenanceState;//状态
+
+    private Integer maintenanceState;//状态
 
     private String maintenanceAnalysis;//原因分析
 
     private Integer maintenanceCustomerId;//客诉id
 
-    private Boolean maintenanceIdRepair;//是否可返修
-
-    private String maintenanceContent;//返修内容
+    private Integer maintenanceIdRepair;//是否可返修
 
     private Date maintenanceContentDate;//返修日期
 
@@ -78,19 +76,11 @@ public class ComplaintMaintenanceInfo  implements Serializable {
         this.maintenanceProductNumber = maintenanceProductNumber == null ? null : maintenanceProductNumber.trim();
     }
 
-    public String getMaintenanceResults() {
-        return maintenanceResults;
-    }
-
-    public void setMaintenanceResults(String maintenanceResults) {
-        this.maintenanceResults = maintenanceResults == null ? null : maintenanceResults.trim();
-    }
-
-    public Boolean getMaintenanceState() {
+    public Integer getMaintenanceState() {
         return maintenanceState;
     }
 
-    public void setMaintenanceState(Boolean maintenanceState) {
+    public void setMaintenanceState(Integer maintenanceState) {
         this.maintenanceState = maintenanceState;
     }
 
@@ -110,22 +100,14 @@ public class ComplaintMaintenanceInfo  implements Serializable {
         this.maintenanceCustomerId = maintenanceCustomerId;
     }
 
-    public Boolean getMaintenanceIdRepair() {
+    public Integer getMaintenanceIdRepair() {
         return maintenanceIdRepair;
     }
 
-    public void setMaintenanceIdRepair(Boolean maintenanceIdRepair) {
+    public void setMaintenanceIdRepair(Integer maintenanceIdRepair) {
         this.maintenanceIdRepair = maintenanceIdRepair;
     }
 
-    public String getMaintenanceContent() {
-        return maintenanceContent;
-    }
-
-    public void setMaintenanceContent(String maintenanceContent) {
-        this.maintenanceContent = maintenanceContent == null ? null : maintenanceContent.trim();
-    }
-
     public Date getMaintenanceContentDate() {
         return maintenanceContentDate;
     }

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintDetectInfoService.java

@@ -28,6 +28,12 @@ public interface ComplaintDetectInfoService {
     int updateComplaintDetectById(ComplaintDetectInfo record);
 
     /**
+     * 修改单个待品质检测产品并生成生产数据
+     * @return
+     */
+    int updateComplaintDetect(ComplaintDetectInfo record);
+
+    /**
      * 获取品质检测列表
      * @return
      */

+ 27 - 9
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintDetectInfoServiceImpl.java

@@ -10,16 +10,20 @@ import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.ComplaintDetectInfoService;
 import com.iamberry.rst.service.cm.mapper.AwaitingSignclosedProductMapper;
 import com.iamberry.rst.service.cm.mapper.ComplaintDetectInfoMapper;
+import com.iamberry.rst.service.cm.mapper.ComplaintMaintenanceInfoMapper;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
 public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoService {
     @Autowired
     private ComplaintDetectInfoMapper complaintDetectInfoMapper;
+    @Autowired
+    private ComplaintMaintenanceInfoMapper complaintMaintenanceInfoMapper;
 
     @Override
     public int insert(ComplaintDetectInfo record) {
@@ -33,17 +37,31 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
 
     @Override
     public int updateComplaintDetectById(ComplaintDetectInfo record) {
-        if(record.getDetectRevolutionProduced() == 2){ //在生产表生成记录
-            ComplaintDetectInfo detectInfo = complaintDetectInfoMapper.getComplaintDetectById(record.getDetectId());
-            ComplaintMaintenanceInfo complaintMaintenanceInfo = new ComplaintMaintenanceInfo();
-            complaintMaintenanceInfo.setDetectId(detectInfo.getDetectId());
-            complaintMaintenanceInfo.setMaintenanceEquipmentNumber(detectInfo.getMachineNo() == null ? null:detectInfo.getMachineNo());
-            complaintMaintenanceInfo.setProductId(detectInfo.getProductId());
-            complaintMaintenanceInfo.setMaintenanceProductNumber(detectInfo.getDetectProductNumber() == null ? null:detectInfo.getDetectProductNumber());
-            /*complaintMaintenanceInfo.*/
-        }
         return complaintDetectInfoMapper.updateComplaintDetectById(record);
     }
+
+    @Override
+    public int updateComplaintDetect(ComplaintDetectInfo record) {
+        Integer msg = complaintDetectInfoMapper.updateComplaintDetectById(record);
+        if (msg > 0) {
+            if(record.getDetectRevolutionProduced() == 2){ //在生产表生成记录
+                ComplaintDetectInfo detectInfo = complaintDetectInfoMapper.getComplaintDetectById(record.getDetectId());
+                ComplaintMaintenanceInfo complaintMaintenanceInfo = new ComplaintMaintenanceInfo();
+                complaintMaintenanceInfo.setDetectId(detectInfo.getDetectId());
+                complaintMaintenanceInfo.setMaintenanceEquipmentNumber(detectInfo.getMachineNo() == null ? null:detectInfo.getMachineNo());
+                complaintMaintenanceInfo.setProductId(detectInfo.getProductId());
+                complaintMaintenanceInfo.setMaintenanceProductNumber(detectInfo.getDetectProductNumber() == null ? null:detectInfo.getDetectProductNumber());
+                complaintMaintenanceInfo.setMaintenanceState(1);//默认待维修更换
+                complaintMaintenanceInfo.setMaintenanceAnalysis(record.getDetectAnalysis());
+                complaintMaintenanceInfo.setMaintenanceCustomerId(detectInfo.getCustomerId() == null ? null:detectInfo.getCustomerId());
+                complaintMaintenanceInfo.setMaintenanceIdRepair(1);//默认未评估
+                complaintMaintenanceInfo.setMaintenanceContentDate(new Date());
+                complaintMaintenanceInfo.setMaintenanceCreateTime(new Date());
+                complaintMaintenanceInfoMapper.insert(complaintMaintenanceInfo);
+            }
+        }
+        return msg;
+    }
     @Override
     public PagedResult<ComplaintDetectInfo> listComplaintDetect(PageRequest<ComplaintDetectInfo> pageRequest) {
         PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());

+ 11 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml

@@ -22,13 +22,13 @@
     <result column="machine_no" property="machineNo" jdbcType="VARCHAR" />
     <result column="detect_is_maintenance" property="detectIsMaintenance" jdbcType="BIT" />
     <result column="detect_date" property="detectDate" jdbcType="DATE" />
-
+    <result column="maintenance_results" property="maintenanceResults" jdbcType="BIT" />
   </resultMap>
   <sql id="Base_Column_List" >
     detect_id, customer_id,signclosed_id,product_id,detect_product_number, detect_state,
     detect_phenomenon, detect_failure_classification, detect_failure_cause, detect_results, 
     detect_point, detect_analysis, detect_customer_id, detect_revolution_produced, detect_desc, 
-    signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date
+    signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date,maintenance_results
   </sql>
   <select id="getComplaintDetectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -60,7 +60,8 @@
       cd.detect_is_maintenance detectIsMaintenance,
       cd.detect_date detectDate,
       ci.customer_question_title questionTitle,
-      pi.product_name productName
+      pi.product_name productName,
+      cd.maintenance_results maintenanceResults
     from tb_rst_complaint_detect cd LEFT JOIN tb_rst_customer_info ci ON cd.customer_id = ci.customer_id
         LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
     <where>
@@ -108,7 +109,8 @@
       detect_failure_classification, detect_failure_cause, 
       detect_results, detect_point, detect_analysis, 
       detect_customer_id, detect_revolution_produced, 
-      detect_desc, signclosed_create_time, signclosed_update_time,machine_no,detect_is_maintenance,detect_date
+      detect_desc, signclosed_create_time, signclosed_update_time,
+      machine_no,detect_is_maintenance,detect_date,maintenance_results
       )
     values (#{detectId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},#{signclosedId,jdbcType=INTEGER},
       #{productId,jdbcType=INTEGER},
@@ -117,7 +119,7 @@
       #{detectResults,jdbcType=VARCHAR}, #{detectPoint,jdbcType=VARCHAR}, #{detectAnalysis,jdbcType=VARCHAR}, 
       #{detectCustomerId,jdbcType=INTEGER}, #{detectRevolutionProduced,jdbcType=BIT}, 
       #{detectDesc,jdbcType=VARCHAR}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
-      ,#{machineNo,jdbcType=VARCHAR},#{detectIsMaintenance,jdbcType=BIT},#{detectDate,jdbcType=DATE}
+      ,#{machineNo,jdbcType=VARCHAR},#{detectIsMaintenance,jdbcType=BIT},#{detectDate,jdbcType=DATE},#{maintenanceResults,jdbcType=BIT}
       )
   </insert>
 
@@ -164,7 +166,10 @@
         signclosed_update_time = #{signclosedUpdateTime,jdbcType=TIMESTAMP},
       </if>
       <if test="detectIsMaintenance != null" >
-        detect_is_maintenance = #{detectIsMaintenance,jdbcType=TIMESTAMP}
+        detect_is_maintenance = #{detectIsMaintenance,jdbcType=TIMESTAMP},
+      </if>
+      <if test="maintenanceResults != null" >
+        maintenance_results = #{maintenanceResults,jdbcType=BIT}
       </if>
     </set>
     where detect_id = #{detectId,jdbcType=INTEGER}

+ 11 - 19
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml

@@ -7,20 +7,18 @@
     <result column="maintenance_equipment_number" property="maintenanceEquipmentNumber" jdbcType="INTEGER" />
     <result column="product_id" property="productId" jdbcType="INTEGER" />
     <result column="maintenance_product_number" property="maintenanceProductNumber" jdbcType="VARCHAR" />
-    <result column="maintenance_results" property="maintenanceResults" jdbcType="VARCHAR" />
-    <result column="maintenance_state" property="maintenanceState" jdbcType="BIT" />
+    <result column="maintenance_state" property="maintenanceState" jdbcType="INTEGER" />
     <result column="maintenance_analysis" property="maintenanceAnalysis" jdbcType="VARCHAR" />
     <result column="maintenance_customer_id" property="maintenanceCustomerId" jdbcType="INTEGER" />
-    <result column="maintenance_id_repair" property="maintenanceIdRepair" jdbcType="BIT" />
-    <result column="maintenance_content" property="maintenanceContent" jdbcType="VARCHAR" />
+    <result column="maintenance_id_repair" property="maintenanceIdRepair" jdbcType="INTEGER" />
     <result column="maintenance_content_date" property="maintenanceContentDate" jdbcType="TIMESTAMP" />
     <result column="maintenance_create_time" property="maintenanceCreateTime" jdbcType="TIMESTAMP" />
     <result column="maintenance_update_time" property="maintenanceUpdateTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Base_Column_List" >
     maintenance_id, detect_id, maintenance_equipment_number, product_id,
-    maintenance_product_number, maintenance_results, maintenance_state, maintenance_analysis, 
-    maintenance_customer_id, maintenance_id_repair, maintenance_content, maintenance_content_date, 
+    maintenance_product_number, maintenance_state, maintenance_analysis,
+    maintenance_customer_id, maintenance_id_repair,maintenance_content_date,
     maintenance_create_time, maintenance_update_time
   </sql>
   <select id="getMaintenanceByid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -32,16 +30,16 @@
   <insert id="insert" parameterType="ComplaintMaintenanceInfo" >
     insert into tb_rst_complaint_maintenance (maintenance_id, detect_id, maintenance_equipment_number, 
       product_id, maintenance_product_number,
-      maintenance_results, maintenance_state, maintenance_analysis, 
+      maintenance_state, maintenance_analysis,
       maintenance_customer_id, maintenance_id_repair, 
-      maintenance_content, maintenance_content_date, 
+      maintenance_content_date,
       maintenance_create_time, maintenance_update_time
       )
     values (#{maintenanceId,jdbcType=INTEGER}, #{detectId,jdbcType=INTEGER}, #{maintenanceEquipmentNumber,jdbcType=INTEGER}, 
       #{productId,jdbcType=BIT}, #{maintenanceProductNumber,jdbcType=VARCHAR},
-      #{maintenanceResults,jdbcType=VARCHAR}, #{maintenanceState,jdbcType=BIT}, #{maintenanceAnalysis,jdbcType=VARCHAR}, 
-      #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIdRepair,jdbcType=BIT}, 
-      #{maintenanceContent,jdbcType=VARCHAR}, #{maintenanceContentDate,jdbcType=TIMESTAMP}, 
+      #{maintenanceState,jdbcType=INTEGER}, #{maintenanceAnalysis,jdbcType=VARCHAR},
+      #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIdRepair,jdbcType=INTEGER},
+      #{maintenanceContentDate,jdbcType=TIMESTAMP},
       #{maintenanceCreateTime,jdbcType=TIMESTAMP}, #{maintenanceUpdateTime,jdbcType=TIMESTAMP}
       )
   </insert>
@@ -61,11 +59,8 @@
       <if test="maintenanceProductNumber != null" >
         maintenance_product_number = #{maintenanceProductNumber,jdbcType=VARCHAR},
       </if>
-      <if test="maintenanceResults != null" >
-        maintenance_results = #{maintenanceResults,jdbcType=VARCHAR},
-      </if>
       <if test="maintenanceState != null" >
-        maintenance_state = #{maintenanceState,jdbcType=BIT},
+        maintenance_state = #{maintenanceState,jdbcType=INTEGER},
       </if>
       <if test="maintenanceAnalysis != null" >
         maintenance_analysis = #{maintenanceAnalysis,jdbcType=VARCHAR},
@@ -74,10 +69,7 @@
         maintenance_customer_id = #{maintenanceCustomerId,jdbcType=INTEGER},
       </if>
       <if test="maintenanceIdRepair != null" >
-        maintenance_id_repair = #{maintenanceIdRepair,jdbcType=BIT},
-      </if>
-      <if test="maintenanceContent != null" >
-        maintenance_content = #{maintenanceContent,jdbcType=VARCHAR},
+        maintenance_id_repair = #{maintenanceIdRepair,jdbcType=INTEGER},
       </if>
       <if test="maintenanceContentDate != null" >
         maintenance_content_date = #{maintenanceContentDate,jdbcType=TIMESTAMP},

+ 55 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -212,6 +212,26 @@ public class AdminDetectController {
     }
 
     /**
+     * 跳转到检测完成页面
+     *
+     * @return
+     */
+    @RequiresPermissions("complete:update:complete")
+    @RequestMapping(value = "/to_detect_complete")
+    public ModelAndView toDetectComplete(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("cm/inspection/detect_complete");
+        String detectId = request.getParameter("detectId");
+        if(detectId == null || detectId.equals("")){
+            return null;
+        }
+        ComplaintDetectInfo detectInfo = complaintDetectInfoService.getComplaintDetectById(Integer.valueOf(detectId));
+        mv.addObject("detectId",detectId);
+        mv.addObject("detectInfo",detectInfo);
+        return mv;
+    }
+
+
+    /**
      * 添加/修改检测信息
      * @param request
      * @return
@@ -245,5 +265,40 @@ public class AdminDetectController {
         }
         return msg;
     }
+
+    /**
+     * 检测完成
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("complete:update:complete")
+    @ResponseBody
+    @RequestMapping("/detect_complete")
+    public ResponseJson detect_complete(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(detectInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(detectInfo.getDetectId() == null || detectInfo.getDetectId().equals("")){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(detectInfo.getDetectIsMaintenance() == 2){ //选择不需要转入时 detect_revolution_produced 统一改为待转入
+            detectInfo.setDetectRevolutionProduced(1);
+        }
+        Integer num = complaintDetectInfoService.updateComplaintDetect(detectInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 }
 

+ 3 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl

@@ -204,7 +204,9 @@
             success: function(data){
                 if (data.returnCode == 200) {
                     layer.msg('添加成功',{icon: 1,time:1000},function () {
-                        location.replace(location.href);
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
                     });
                 } else {
                     layer.msg('添加失败',{icon: 5,time:1000});

+ 3 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_remark.ftl

@@ -67,7 +67,9 @@
             success: function(data){
                 if (data.returnCode == 200) {
                     layer.msg('修改成功',{icon: 1,time:1000},function () {
-                        location.replace(location.href);
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
                     });
                 } else {
                     layer.msg('修改失败',{icon: 5,time:1000});

+ 197 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_complete.ftl

@@ -0,0 +1,197 @@
+<!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">
+    <title>检测完成</title>
+    <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: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .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: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 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(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        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>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">检测结果</span>
+            <label for="radio-3">
+                <input type="radio" id="radio-3" name="detectState" value="3" checked/>检测通过
+            </label>
+            <label for="radio-4" style="margin-left: 50px;">
+                <input type="radio" id="radio-4" name="detectState" value="4"/>检测未通过
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectPhenomenon" id="detectPhenomenon" ${detectInfo.detectPhenomenon!''} class="my-textarea" placeholder="工厂检测现象"></textarea>
+        </div>
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectFailureClassification" id="detectFailureClassification" ${detectInfo.detectFailureClassification!''} class="my-textarea" placeholder="故障分类"></textarea>
+        </div>
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectFailureCause" id="detectFailureCause" ${detectInfo.detectFailureCause!''} class="my-textarea" placeholder="故障原因"></textarea>
+        </div>
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectResults" id="detectResults" ${detectInfo.detectResults!''} class="my-textarea" placeholder="判定结果"></textarea>
+        </div>
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectPoint" id="detectPoint" ${detectInfo.detectPoint!''} class="my-textarea" placeholder="故障指向"></textarea>
+        </div>
+        <div class="input-box">
+            <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+            <textarea rows="3" cols="20" name="detectAnalysis" id="detectAnalysis" ${detectInfo.detectAnalysis!''} class="my-textarea" placeholder="原因分析"></textarea>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否需要转入生产部门</span>
+            <label for="radio-5">
+                <input type="radio" id="radio-5" name="detectIsMaintenance" onclick="show()" value="1" checked/>需要转入生产部门
+            </label>
+            <label for="radio-6" style="margin-left: 50px;">
+                <input type="radio" id="radio-6" name="detectIsMaintenance" onclick="hide()" value="2"/>不需要转入生产部门
+            </label>
+        </div>
+        <div class="input-box" id="revolutionProducedId">
+            <span class="input-dic" style="margin-top: 0">立即转入生产部门</span>
+            <label for="radio-7">
+                <input type="radio" id="radio-7" name="detectRevolutionProduced" value="2" checked/>立即转入
+            </label>
+            <label for="radio-8" style="margin-left: 50px;">
+                <input type="radio" id="radio-8" name="detectRevolutionProduced" value="1"/>以后转入
+            </label>
+        </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">QC检查状态</span>
+            <label for="radio-7">
+                <input type="radio" id="radio-9" name="maintenanceResults" value="1" checked/>通过
+            </label>
+            <label for="radio-8" style="margin-left: 50px;">
+                <input type="radio" id="radio-10" name="maintenanceResults" value="2"/>不通过
+            </label>
+        </div>
+        <div class="input-box">
+            <span class="input-dic spanhidth">备注</span>
+            <textarea rows="3" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${detectInfo.detectDesc!''}</textarea>
+        </div>
+        <div>
+            <input type="hidden" value="${detectId!''}" id="detectId" name="detectId">
+           <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+    function hide() {
+        $("#revolutionProducedId").hide();
+    }
+    function show() {
+        $("#revolutionProducedId").show();
+    }
+
+    function  add() {
+
+        var detectPhenomenon = $("#detectPhenomenon").val();
+        if( detectPhenomenon == null || detectPhenomenon == "" ){
+            layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
+            return;
+        }
+        if( detectPhenomenon.length > 300 ){
+            layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
+            return;
+        }
+        var detectFailureClassification = $("#detectFailureClassification").val();
+        if( detectFailureClassification == null || detectFailureClassification == "" ){
+            layer.msg('请输入故障分类',{icon: 5,time:1000});
+            return;
+        }
+        if( detectFailureClassification.length > 50 ){
+            layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
+            return;
+        }
+        var detectFailureCause = $("#detectFailureCause").val();
+        if( detectFailureCause == null || detectFailureCause == "" ){
+            layer.msg('请输入故障原因',{icon: 5,time:1000});
+            return;
+        }
+        if( detectFailureCause.length > 100 ){
+            layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectResults = $("#detectResults").val();
+        if( detectResults == null || detectResults == "" ){
+            layer.msg('请输入判定结果',{icon: 5,time:1000});
+            return;
+        }
+        if( detectResults.length > 100 ){
+            layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectPoint = $("#detectPoint").val();
+        if( detectPoint == null || detectPoint == "" ){
+            layer.msg('请输入故障指向',{icon: 5,time:1000});
+            return;
+        }
+        if( detectPoint.length > 100 ){
+            layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectAnalysis = $("#detectAnalysis").val();
+        if( detectAnalysis == null || detectAnalysis == "" ){
+            layer.msg('请输入原因分析',{icon: 5,time:1000});
+            return;
+        }
+        if( detectAnalysis.length > 100 ){
+            layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/detect/detect_complete",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('检测完成',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('检测完成失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('检测错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl

@@ -3,6 +3,7 @@
 <head>
     <meta charset="UTF-8">
     <title></title>
+<#include "/base/list_base.ftl">
     <style>
         *{padding: 0;margin: 0;}
         .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 25px;margin-right: 5px;}
@@ -14,7 +15,6 @@
         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>
-<#include "/base/list_base.ftl">
 </head>
 <body>
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
@@ -123,7 +123,7 @@
                         <#else >
                             <#if detect.detectRevolutionProduced == 1>
                                 <a style="text-decoration:none" href="javascript:;" title="转入生产"
-                                   onclick="update_info('转入生产','${path}/admin/detect/to_produced_info?detectId=${detect.detectId!''}&state=2','570','450');">
+                                   onclick="update_info('转入生产','${path}/admin/detect/to_detect_complete?detectId=${detect.detectId!''}&state=2','570','450');">
                                     <i class="Hui-iconfont">&#xe645;</i>
                                 </a>
                             </#if>