Browse Source

客诉后续流程

liujiankang 6 years ago
parent
commit
c0d43c3897

+ 10 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectItem.java

@@ -11,6 +11,7 @@ public class ComplaintDetectItem implements Serializable {
     private Integer detectItemId;//主键
     private Integer detectId;//检测id
     private Integer productId;//产品id
+    private Integer productColorId;//产品颜色id
     private String machineNo;//机器编号
     private String detectProductNumber;//产品型号
     private Integer detectItemState;//状态 1未检测 2已检测
@@ -18,7 +19,7 @@ public class ComplaintDetectItem implements Serializable {
     private String detectItemClassification;//故障分类
     private String detectItemFailureCause;//故障原因
     private String detectItemResults;//判定结果
-    private String detectItemPoint;//判定结果
+    private String detectItemPoint;//故障指向
     private String detectItemNalysis;//原因分析
     private String detectItemContent;//维修内容
     private Integer isMaintenance;//是否维修
@@ -216,4 +217,12 @@ public class ComplaintDetectItem implements Serializable {
     public void setQuestionTitle(String questionTitle) {
         this.questionTitle = questionTitle;
     }
+
+    public Integer getProductColorId() {
+        return productColorId;
+    }
+
+    public void setProductColorId(Integer productColorId) {
+        this.productColorId = productColorId;
+    }
 }

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

@@ -45,4 +45,9 @@ public interface ComplaintDetectInfoService {
      * @return
      */
     int insertItem(ComplaintDetectItem complaintDetectItem);
+    /**
+     * 删除品检项
+     * @return
+     */
+    int deleteDetectItem(Integer detectItemId);
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintDetectInfoServiceImpl.java

@@ -58,4 +58,9 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     public int insertItem(ComplaintDetectItem complaintDetectItem) {
         return complaintDetectInfoMapper.insertItem(complaintDetectItem);
     }
+
+    @Override
+    public int deleteDetectItem(Integer detectItemId) {
+        return complaintDetectInfoMapper.deleteDetectItem(detectItemId);
+    }
 }

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/ComplaintDetectInfoMapper.java

@@ -49,4 +49,10 @@ public interface ComplaintDetectInfoMapper {
      * @return
      */
     int insertItem(ComplaintDetectItem complaintDetectItem);
+
+    /**
+     * 删除品检项
+     * @return
+     */
+    int deleteDetectItem(Integer detectItemId);
 }

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

@@ -81,6 +81,39 @@
       <if test="customerId != null" >
         AND cd.customer_id like CONCAT('%',#{customerId},'%')
       </if>
+      <if test="productId != null" >
+        AND cd.product_id = #{productId}
+      </if>
+      <if test="productColorId != null" >
+        AND cd.product_color_id = #{productColorId}
+      </if>
+      <if test="detectItemPhenomenon != null and detectItemPhenomenon != ''" >
+        AND cd.detect_item_phenomenon = #{detectItemPhenomenon}
+      </if>
+      <if test="detectItemClassification != null and detectItemClassification != ''" >
+        AND cd.detect_item_classification = #{detectItemClassification}
+      </if>
+      <if test="detectItemFailureCause != null and detectItemFailureCause != ''" >
+        AND cd.detect_item_failure_cause = #{detectItemFailureCause}
+      </if>
+      <if test="detectItemResults != null and detectItemResults != ''" >
+        AND cd.detect_item_results = #{detectItemResults}
+      </if>
+      <if test="detectItemPoint != null and detectItemPoint != ''" >
+        AND cd.detect_item_point = #{detectItemPoint}
+      </if>
+      <if test="detectItemNalysis != null and detectItemNalysis != ''" >
+        AND cd.detect_item_nalysis = #{detectItemNalysis}
+      </if>
+      <if test="detectItemContent != null and detectItemContent != ''" >
+        AND cd.detect_item_content = #{detectItemContent}
+      </if>
+      <if test="isMaintenance != null and isMaintenance != ''" >
+        AND cd.is_maintenance = #{isMaintenance}
+      </if>
+      <if test="maintenanceResults != null and maintenanceResults != ''" >
+        AND cd.maintenance_results = #{maintenanceResults}
+      </if>
     </where>
       ORDER BY cd.detect_item_create_time DESC
   </select>
@@ -171,7 +204,8 @@
     maintenance_results,
     detect_item_desc,
     detect_item_date,
-    detect_item_create_time
+    detect_item_create_time,
+    product_color_id
     )
     values
     <foreach collection="list" item="node" index="index" separator="," open="" close="">
@@ -192,7 +226,8 @@
       #{node.maintenanceResults},
       #{node.detectItemDesc},
       #{node.detectItemDate},
-      #{node.detectItemCreateTime}
+      #{node.detectItemCreateTime},
+      #{node.productColorId}
       )
     </foreach>
   </insert>
@@ -216,27 +251,35 @@
     maintenance_results,
     detect_item_desc,
     detect_item_date,
-    detect_item_create_time
+    detect_item_create_time,
+    product_color_id,
+    customer_id
     )
     values
       (
-      #{node.detectId},
-      #{node.productId},
-      #{node.machineNo},
-      #{node.detectProductNumber},
-      #{node.detectItemState},
-      #{node.detectItemPhenomenon},
-      #{node.detectItemClassification},
-      #{node.detectItemFailureCause},
-      #{node.detectItemResults},
-      #{node.detectItemPoint},
-      #{node.detectItemNalysis},
-      #{node.detectItemContent},
-      #{node.isMaintenance},
-      #{node.maintenanceResults},
-      #{node.detectItemDesc},
-      #{node.detectItemDate},
-      #{node.detectItemCreateTime}
+      #{detectId},
+      #{productId},
+      #{machineNo},
+      #{detectProductNumber},
+      #{detectItemState},
+      #{detectItemPhenomenon},
+      #{detectItemClassification},
+      #{detectItemFailureCause},
+      #{detectItemResults},
+      #{detectItemPoint},
+      #{detectItemNalysis},
+      #{detectItemContent},
+      #{isMaintenance},
+      #{maintenanceResults},
+      #{detectItemDesc},
+      #{detectItemDate},
+      #{detectItemCreateTime},
+      #{productColorId},
+      #{customerId}
       )
   </insert>
+
+  <delete id="deleteDetectItem" parameterType="Integer">
+    DELETE FROM tb_rst_complaint_detect_item WHERE detect_item_id = #{detectItemId}
+  </delete>
 </mapper>

+ 72 - 12
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -105,8 +105,9 @@ public class AdminDetectController {
         ProductType productType = new ProductType();
         List<ProductType> productTypeList = productService.listProductType(productType);
         mv.addObject("productTypeList",productTypeList);
-
-
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+        mv.addObject("productList",productList);
 //        url.append("&pageTotal=").append(total).append("&pageNO=");
 //        mv.addObject("page", result);
 //        mv.addObject("url", url.toString());
@@ -124,13 +125,46 @@ public class AdminDetectController {
     @RequiresPermissions("detect:add:detect")
     @ResponseBody
     @RequestMapping("/add_detect")
-    public ResponseJson addDetect(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
+    public ResponseJson addDetect(HttpServletRequest request, ComplaintDetectInfo detectInfo, ComplaintDetectItem detectItem) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(detectInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
+        String itemDate = request.getParameter("itemDate");
+        if(itemDate == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        detectItem.setDetectItemDate(format.parse(itemDate));
+        ComplaintDetectInfo detect = new ComplaintDetectInfo();
+        if(detectInfo.getCustomerId() == null){
+            detect.setDetectCreateTime(new Date());
+            complaintDetectInfoService.insert(detect);
+        }else{
+            ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectByCustomerId(detectInfo.getCustomerId());
+            if(detectinfo == null){
+                detect.setCustomerId(detectInfo.getCustomerId());
+                detect.setDetectCreateTime(new Date());
+                complaintDetectInfoService.insert(detect);
+            }else{
+                detect.setDetectId(detectinfo.getDetectId());
+            }
+            detectItem.setCustomerId(detectInfo.getCustomerId());
+        }
+        detectItem.setDetectId(detect.getDetectId());
+        detectItem.setDetectItemState(1);
+        detectItem.setDetectItemCreateTime(new Date());
+        if(complaintDetectInfoService.insertItem(detectItem) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        }
         return msg;
     }
 
@@ -139,21 +173,20 @@ public class AdminDetectController {
      *
      * @return
      */
-    /*@RequiresPermissions("info:update:info")
+    @RequiresPermissions("info:update:info")
     @RequestMapping(value = "/to_add_remark")
     public ModelAndView toAddRemark(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/inspection/add_remark");
-        String detectId = request.getParameter("detectId");
-        if(detectId == null || detectId.equals("")){
+        String detectItemId = request.getParameter("detectItemId");
+        if(detectItemId == null || detectItemId.equals("")){
             return mv;
         }
-        ComplaintDetectInfo detectInfo = complaintDetectInfoService.getComplaintDetectById(Integer.valueOf(detectId));
-        mv.addObject("detectId",detectId);
-        mv.addObject("detectInfo",detectInfo);
+        ComplaintDetectItem detectItem = complaintDetectInfoService.getDetectItemById(Integer.valueOf(detectItemId));
+        mv.addObject("detectItemId",detectItemId);
+        mv.addObject("detectItem",detectItem);
         return mv;
     }
-
-    *//**
+    /**
      * 跳转到添加修改转入信息页面
      *
      * @return
@@ -210,7 +243,7 @@ public class AdminDetectController {
             msg.setReturnCode(500);
             return msg;
         }
-        if(detectInfo.getDetectId() == null || detectInfo.getDetectId().equals("")){
+        if(detectInfo.getDetectItemId() == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
@@ -384,5 +417,32 @@ public class AdminDetectController {
         }
         return msg;
     }
+
+    /**
+     * 删除检测信息
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("remark:add:remark")
+    @ResponseBody
+    @RequestMapping("/delete")
+    public ResponseJson delete(HttpServletRequest request, Integer detectItemId) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(detectItemId == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintDetectInfoService.deleteDetectItem(detectItemId);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 }
 

+ 26 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -381,12 +381,37 @@ public class AdminSignclosedController {
     @RequiresPermissions("signclosed:update:signclosed")
     @RequestMapping(value = "/to_into_complaint")
     public ModelAndView tointoComplaint(HttpServletRequest request,Integer signclosedId) {
-        ModelAndView mv = new ModelAndView("cm/signclosed/update_sender");
+        ModelAndView mv = new ModelAndView("cm/signclosed/init_complaint");
+        ComplaintSignclosedInfo complaintSignclosedInfo = complaintSignclosedInfoService.getSignclosedById(signclosedId);
         List<SignclosedProductInfo> listProductInfo = complaintSignclosedInfoService.listSignclosedById(signclosedId);
         mv.addObject("signclosedId",signclosedId);
+        mv.addObject("customerId",complaintSignclosedInfo.getSignclosedCustomerId());
         mv.addObject("listProductInfo",listProductInfo);
         return mv;
     }
+
+    /**
+     * 转入品质(修改状态)
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("signclosed:update:signclosed")
+    @RequestMapping(value = "/update_states")
+    public ResponseJson updateStates(HttpServletRequest request,ComplaintSignclosedInfo complaintSignclosedInfo){
+        ResponseJson msg = new ResponseJson();
+        if(complaintSignclosedInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        complaintSignclosedInfo.setSignclosedState(2);
+        complaintSignclosedInfoService.updateSignclosedById(complaintSignclosedInfo);
+        msg.setResultCode(200);
+        msg.setReturnCode(200);
+        return msg;
+    }
+
     /**
      * 转入品质
      *

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

@@ -32,53 +32,31 @@
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
         <div class="input-box">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>客诉编号:</label>
+            <div class="formControls col-8 col-sm-8 text-c huanhang" style="margin-left: -4.5%;">
+                <input class="my-input-date" type="text"  name="customerId" id="customerId" placeholder="请输入客诉编号,如没有请留空"/>
+            </div>
+        </div>
+        <div class="input-box">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>检测产品:</label>
-            <div class="formControls col-9 col-sm-9 text-c huanhang" style="margin-bottom: 15px;">
-                <table class="table table-border table-bg table-bordered" style="width: 420px;">
-                    <thead>
-                    <tr class="text-c">
-                        <th style="text-align: center;" width="100">产品名称</th>
-                        <th style="text-align: center;" width="50">产品颜色</th>
-                        <th style="text-align: center;" width="50">产品编号</th>
-                    </tr>
-                    </thead>
-                    <tbody id="addProduct">
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin-bottom: 15px;">
+                <select id="productId" name="productId" class="select" style="width: 150px;">
                     <#if (productList?size > 0)>
-                        <#list productList as product>
-                        <tr>
+                            <#list productList as product>
+                                <option value="${product.productId!""}">${product.productName!""}</option>
+                            </#list>
+                    </#if>
+                </select>
 
-                        <td>
-                            <div class="formControls col-xs-12 col-sm-12 skin-minimal">
-                                <input type="radio"  id="radio-1${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>
-                                <label for="radio-1${product.productId!''}">&nbsp;&nbsp;${product.productName!''}</label>
-                            </div>
-                        </td>
-                        <td>
-                            <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:90%" class="my-select">
-                            <#if (product.colorList?size > 0)>
-                                <#list product.colorList as colorList>
-                                    <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
-                                </#list>
-                            <#else>
-                                <option value ="">暂无颜色</option>
-                            </#if>
-                            </select>
-                        </td>
-                        <td>
-                            <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 100%;" placeholder="机器编号" /><br>
-                        </td>
+                <select id="productColorId" name="productColorId" class="select" style="width: 150px;">
 
-                        </tr>
-                        </#list>
-                    </#if>
-                    </tbody>
-                </table>
+                </select>
             </div>
         </div>
         <div class="input-box">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>检测日期:</label>
             <div class="formControls col-8 col-sm-8 text-c huanhang" style="margin-left: -4.5%;">
-                <input class="my-input-date" type="text"  name="detect_date" id="detectDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
+                <input class="my-input-date" type="text"  name="itemDate" id="itemDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
             </div>
         </div>
 
@@ -86,11 +64,11 @@
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>检测结果:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal huanhang" style="margin: 10px 0px;">
                 <div class="radio-box">
-                    <input type="radio" id="radio-3" name="detectState" value="3" checked/>
+                    <input type="radio" id="radio-3" name="maintenanceResults" value="1" checked/>
                     <label for="radio-3">检测通过</label>
                 </div>
                 <div class="radio-box">
-                    <input type="radio" id="radio-4" name="detectState" value="4"/>
+                    <input type="radio" id="radio-4" name="maintenanceResults" value="2"/>
                     <label for="radio-4">检测未通过</label>
                 </div>
             </div>
@@ -98,53 +76,59 @@
         <div class="input-box" >
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>工厂检测现象:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-                    <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectPhenomenon" id="detectPhenomenon" class="my-textarea" placeholder="工厂检测现象"></textarea>
+                    <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemPhenomenon" id="detectItemPhenomenon" class="my-textarea" placeholder="工厂检测现象"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障分类:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectFailureClassification" id="detectFailureClassification" class="my-textarea" placeholder="故障分类"></textarea>
+                <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemClassification" id="detectItemClassification" class="my-textarea" placeholder="故障分类"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障原因:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectFailureCause" id="detectFailureCause" class="my-textarea" placeholder="故障原因"></textarea>
+            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemFailureCause" id="detectItemFailureCause" class="my-textarea" placeholder="故障原因"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>判定结果:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectResults" id="detectResults" class="my-textarea" placeholder="判定结果"></textarea>
+            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemResults" id="detectItemResults" class="my-textarea" placeholder="判定结果"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障指向:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectPoint" id="detectPoint" class="my-textarea" placeholder="故障指向"></textarea>
+            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemPoint" id="detectItemPoint" class="my-textarea" placeholder="故障指向"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>原因分析:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectAnalysis" id="detectAnalysis" class="my-textarea" placeholder="原因分析"></textarea>
+            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemNalysis" id="detectItemNalysis" class="my-textarea" placeholder="原因分析"></textarea>
+            </div>
+        </div>
+        <div class="input-box">
+            <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>维修内容:</label>
+            <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
+            <textarea style="margin-left: 0%;" rows="3" cols="20" name="detectItemContent" id="detectItemContent" class="my-textarea" placeholder="维修内容"></textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>是否维修:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal">
                 <div class="radio-box">
-                    <input type="radio" id="radio-5" name="detectIsMaintenance" value="1" checked/>
+                    <input type="radio" id="radio-5" name="isMaintenance" value="1" checked/>
                     <label for="radio-5">需要维修</label>
                 </div>
                 <div class="radio-box">
-                    <input type="radio" id="radio-6" name="detectIsMaintenance" value="2"/>
+                    <input type="radio" id="radio-6" name="isMaintenance" value="2"/>
                     <label for="radio-6">不需要维修</label>
                 </div>
             </div>
         </div>
-        <div class="input-box">
+        <#--<div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>是否已转入:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
                 <div class="radio-box">
@@ -155,14 +139,14 @@
                     <input type="radio" id="radio-8" name="detectRevolutionProduced" value="1"/>
                      <label for="radio-8">未转入维修</label>
                 </div>
-        </div>
+        </div>-->
         </div>
 
         <div class="input-box" >
             <label class="form-label col-3 col-sm-3 huanhang"  style="text-align: right;">备注:</label>
             <div class="formControls col-xs-9 col-sm-9">
                 <div class="radio-box">
-                    <textarea rows="3" style="width: 186%;margin-left: -15%;margin-top: 5%;" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
+                    <textarea rows="3" style="width: 186%;margin-left: -15%;margin-top: 5%;" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
                 </div>
             </div>
         </div>
@@ -185,75 +169,112 @@
                     $("#maintenanceEquipmentNumber"+$(this).val()).val("");
                 });
             });
-
-
         });
 
+        //查询产品颜色信息
+    $('#productId').change(function(){
+        getProduct($(this).children('option:selected').val())
+    })
+    function  getProduct(productId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/product/get_product",
+            data:{colorProductId:productId},// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    $("#productColorId").empty();
+                    if(data.returnMsg.productColorList.length > 0){
+                        for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                            var productColor = data.returnMsg.productColorList[i];
+                            $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
+                        }
+                    }
+
+                }
 
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+        
     function  add() {
 
-        var detectDate = $("#detectDate").val();
-        if( detectDate == null || detectDate == "" ){
+        var itemDate = $("#itemDate").val();
+        if( itemDate == null || itemDate == "" ){
             layer.msg('请选择检测日期',{icon: 5,time:1000});
             return;
         }
-        var detectPhenomenon = $("#detectPhenomenon").val();
-        if( detectPhenomenon == null || detectPhenomenon == "" ){
+        var detectItemPhenomenon = $("#detectItemPhenomenon").val();
+        if( detectItemPhenomenon == null || detectItemPhenomenon == "" ){
             layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
             return;
         }
-        if( detectPhenomenon.length > 300 ){
+        if( detectItemPhenomenon.length > 300 ){
             layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
             return;
         }
-        var detectFailureClassification = $("#detectFailureClassification").val();
-        if( detectFailureClassification == null || detectFailureClassification == "" ){
+        var detectItemClassification = $("#detectItemClassification").val();
+        if( detectItemClassification == null || detectItemClassification == "" ){
             layer.msg('请输入故障分类',{icon: 5,time:1000});
             return;
         }
-        if( detectFailureClassification.length > 50 ){
+        if( detectItemClassification.length > 50 ){
             layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
             return;
         }
-        var detectFailureCause = $("#detectFailureCause").val();
-        if( detectFailureCause == null || detectFailureCause == "" ){
+        var detectItemFailureCause = $("#detectItemFailureCause").val();
+        if( detectItemFailureCause == null || detectItemFailureCause == "" ){
             layer.msg('请输入故障原因',{icon: 5,time:1000});
             return;
         }
-        if( detectFailureCause.length > 100 ){
+        if( detectItemFailureCause.length > 100 ){
             layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectResults = $("#detectResults").val();
-        if( detectResults == null || detectResults == "" ){
+        var detectItemResults = $("#detectItemResults").val();
+        if( detectItemResults == null || detectItemResults == "" ){
             layer.msg('请输入判定结果',{icon: 5,time:1000});
             return;
         }
-        if( detectResults.length > 100 ){
+        if( detectItemResults.length > 100 ){
             layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectPoint = $("#detectPoint").val();
-        if( detectPoint == null || detectPoint == "" ){
+        var detectItemPoint = $("#detectItemPoint").val();
+        if( detectItemPoint == null || detectItemPoint == "" ){
             layer.msg('请输入故障指向',{icon: 5,time:1000});
             return;
         }
-        if( detectPoint.length > 100 ){
+        if( detectItemPoint.length > 100 ){
             layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectAnalysis = $("#detectAnalysis").val();
-        if( detectAnalysis == null || detectAnalysis == "" ){
+        var detectItemNalysis = $("#detectItemNalysis").val();
+        if( detectItemNalysis == null || detectItemNalysis == "" ){
             layer.msg('请输入原因分析',{icon: 5,time:1000});
             return;
         }
-        if( detectAnalysis.length > 100 ){
+        if( detectItemNalysis.length > 100 ){
             layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
+
+        var detectItemContent = $("#detectItemContent").val();
+        if( detectItemContent == null || detectItemContent == "" ){
+            layer.msg('请输入维修内容',{icon: 5,time:1000});
+            return;
+        }
+        if( detectItemContent.length > 300 ){
+            layer.msg('维修内容长度不得大于300个字符',{icon: 5,time:1000});
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",

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

@@ -32,18 +32,18 @@
     <form class="form form-horizontal" id="form-admin-add">
         <div class="input-box"   style="text-align:center;">
             <span class="input-dic spanhidth">备注</span>
-            <#if detectInfo??>
-                <textarea rows="5" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${detectInfo.detectDesc!''}</textarea>
+            <#if detectItem??>
+                <textarea rows="5" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${detectItem.detectItemDesc!''}</textarea>
             <#else>
-                <textarea rows="5" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
+                <textarea rows="5" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
             </#if>
         </div>
-        <div style="text-align:center;">
+        <#--<div style="text-align:center;">
             <span>如果转入生产,则生产部门同事可查看!</span>
-        </div>
+        </div>-->
         <div style="text-align:center;">
-        <#if detectId??>
-            <input type="hidden" value="${detectId!''}" id="detectId" name="detectId">
+        <#if detectItemId??>
+            <input type="hidden" value="${detectItemId!''}" id="detectItemId" name="detectItemId">
         </#if>
            <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
         </div>
@@ -54,9 +54,9 @@
 
 
     function  add() {
-        var detectDesc = $("#detectDesc").val();
-        if( detectDesc != null){
-            if( detectDesc.length > 200 ){
+        var detectItemDesc = $("#detectItemDesc").val();
+        if( detectItemDesc != null){
+            if( detectItemDesc.length > 200 ){
                 layer.msg('备注长度不得大于100个字符',{icon: 5,time:1000});
                 return;
             }
@@ -65,7 +65,7 @@
         $.ajax({
             cache: true,
             type: "POST",
-            url: "${path}/admin/detect/update_complete",
+            url: "${path}/admin/detect/add_remark",
             data:$('#form-admin-add').serialize(),// 你的formid
             async: false,
             success: function(data){

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

@@ -41,6 +41,21 @@
     <div class="text-c">
         <form name="form1" action="${path}/admin/detect/select_detect_list" method="post">
             <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('添加品质检测','${path}/admin/detect/to_add_detect','670','450');">新建品检</button>
+            <select id="productId" name="productId" class="select" style="width: 150px;">
+            <#if (productList?size > 0)>
+                <#list productList as product>
+                <#if productId??>
+                    <option value="${product.productId!""}" <#if product.productId == productId>selected</#if>>${product.productName!""}</option>
+                <#else >
+                    <option value="${product.productId!""}" >${product.productName!""}</option>
+                </#if>
+                </#list>
+            </#if>
+            </select>
+
+            <select id="productColorId" name="productColorId" class="select" style="width: 150px;">
+
+            </select>
             <input class="my-input" style="width: 70px;" type="text" name="customerId" value="${customerId!}" placeholder="客诉编号"/>
             <input class="my-input" style="width: 70px;" type="text" name="questionTitle" value="${questionTitle!}" placeholder="客诉问题"/>
             <input class="my-input" style="width: 70px;" type="text" name="detectItemPhenomenon" value="${detectItemPhenomenon!}" placeholder="工厂检测现象"/>
@@ -73,7 +88,6 @@
             <tr class="text-c">
                 <th width="100">客诉编号</th>
                 <th width="100">产品</th>
-                <th width="100">产品型号</th>
                 <th width="100">状态</th>
                 <th width="60">工厂检测现象</th>
                 <th width="60">故障分类</th>
@@ -95,7 +109,6 @@
                 <tr>
                     <td class="text-c" width="100">${detect.customerId!}</td>
                     <td class="text-c" width="100">${detect.productTypeName!}</td>
-                    <td class="text-c" width="100">${detect.detectProductNumber!}</td>
                     <td class="text-c" width="100">
                         <#if detect.detectItemState == 1>
                             已检测
@@ -130,11 +143,14 @@
                     <td class="text-c" width="100">${(detect.detectItemDate?string("yyyy-MM-dd"))!''}</td>
                     <!-- 遍历操作 -->
                     <td class="td-manage text-c">
-                        <#--<a style="text-decoration:none" href="javascript:;" title="修改备注"
-                           onclick="add_remark('修改备注','${path}/admin/detect/to_add_remark?detectId=${detect.detectId!''}','570','450');">
+                        <a style="text-decoration:none" href="javascript:;" title="修改备注"
+                           onclick="add_remark('修改备注','${path}/admin/detect/to_add_remark?detectItemId=${detect.detectItemId!''}','570','450');">
                             <i class="Hui-iconfont">&#xe6df;</i>
-                        </a>-->
-
+                        </a>
+                        <a style="text-decoration:none" href="javascript:;" title="删除"
+                           onclick="detele(${detect.detectItemId!''});">
+                            <i class="Hui-iconfont">&#xe609;</i>
+                        </a>
                             <a style="text-decoration:none" href="javascript:;" title="修改检测信息"
                                onclick="update_info('修改检测信息','${path}/admin/detect/to_update_complete?detectItemId=${detect.detectItemId!''}','800','550');">
                                 <i class="Hui-iconfont">&#xe60c;</i>
@@ -161,6 +177,10 @@
 <#include "/base/page_util.ftl">
 
 <script type="text/javascript">
+
+    $(function(){
+        getProduct($("#productId").children('option:selected').val())
+    });
     /*添加*/
     function add_detect(title,url,w,h){
         layer_show(title,url,w,h);
@@ -179,6 +199,57 @@
     function getDescribeInfo(customerId) {
         layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
     }
+
+    function  detele(detectItemId) {
+        layer.confirm('确认要删除吗?',function(index){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: "${path}/admin/detect/delete",
+                data:{detectItemId:detectItemId},// 你的formid
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg('删除成功',{icon: 1,time:1000},function () {
+                            location.replace(location.href);
+                        });
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('删除失败',{icon: 5,time:1000});
+                }
+            });
+        });
+    }
+    //查询产品颜色信息
+    $('#productId').change(function(){
+        getProduct($(this).children('option:selected').val())
+    })
+    function  getProduct(productId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/product/get_product",
+            data:{colorProductId:productId},// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    $("#productColorId").empty();
+                    if(data.returnMsg.productColorList.length > 0){
+                        for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                            var productColor = data.returnMsg.productColorList[i];
+                            $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
+                        }
+                    }
+
+                }
+
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
 </script>
 </body>
 </html>

+ 34 - 23
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/init_complaint.ftl

@@ -31,21 +31,39 @@
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
         <div class="input-box"   style="text-align:center;">
-            <span class="input-dic spanhidth">移交产品</span>
-            <input type="text" style="" class="input-text" placeholder="客诉编号" id="signclosedCustomerId" name="signclosedCustomerId">
+            <span class="input-dic spanhidth" style="margin-bottom: 5px;"><strong>移交产品</strong></span>
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
+                <thead>
+                <tr class="text-c">
+                    <th width="160">产品</th>
+                    <th width="120">产品颜色</th>
+                    <th width="120">数量</th>
+                </tr>
+                </thead>
+                <tbody id="listid">
+                <#if (listProductInfo?size > 0)>
+                    <#list listProductInfo as info>
+                    <tr>
+                        <td class="text-c" width="100">${info.productName!}</td>
+                        <td class="text-c" width="100">${info.colorName!}</td>
+                        <td class="text-c" width="100">${info.productNum!}</td>
+                    </tr>
+                    </#list>
+                <#else >
+                <tr><td class="td-manage text-c" colspan = "3">没有产品信息</td></tr>
+                </#if>
+                </tbody>
+            </table>
         </div>
         <div class="input-box"   style="text-align:center;">
-            <span class="input-dic spanhidth">维修编号:</span>
-
-        </div>
+            <span class="input-dic spanhidth"><strong>维修编号:</strong></span>
+            <span class="input-dic spanhidth" style="color:red;">${customerId!'未关联客诉'}</span>
+        </div></br>
         <div class="input-box"   style="text-align:center;">
             <span class="input-dic spanhidth">请将维修编号清晰的写到维修卡上方</span>
-
-        </div>
-        <div style="text-align:center;">
-        <#if signclosedId??>
-            <input type="hidden" value="${signclosedId!''}" id="signclosedId" name="signclosedId">
-        </#if>
+        </div></br>
+        <input type="hidden" name="signclosedId" id="signclosedId" value="${signclosedId!''}">
+        <div >
            <button type="button" class="my-btn-submit" onclick="update();">确认提交</button>
         </div>
     </form>
@@ -55,29 +73,22 @@
 
 
     function  update() {
-        var signclosedCustomerId = $("#signclosedCustomerId").val();
-        if( signclosedCustomerId != null){
-            if( signclosedCustomerId.length > 10 ){
-                layer.msg('编号长度不得大于10个字符',{icon: 5,time:1000});
-                return;
-            }
-        }
-
+        var signclosedId = $("#signclosedId").val();
         $.ajax({
             cache: true,
             type: "POST",
-            url: "${path}/admin/signclosed/associated_customer",
-            data:$('#form-admin-add').serialize(),// 你的formid
+            url: "${path}/admin/signclosed/update_states",
+            data:{"signclosedId" : signclosedId},// 你的formid
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
-                    layer.msg('关联成功',{icon: 1,time:1000},function () {
+                    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});
+                    layer.msg('转入失败',{icon: 5,time:1000});
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){

+ 5 - 23
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl

@@ -172,10 +172,12 @@
                                onclick="add_remark('修改寄件人信息','${path}/admin/signclosed/to_update_sender?signclosedId=${signclosed.signclosedId!''}','570','450');">
                                 <i class="Hui-iconfont">&#xe60c;</i>
                             </a>
+                            <#if signclosed.signclosedState == 1>
                             <a style="text-decoration:none" href="javascript:;" title="转入品检"
-                               onclick="into_complaint('${signclosed.signclosedId!''}');">
+                               onclick="into_complaint('转入品检','${path}/admin/signclosed/to_into_complaint?signclosedId=${signclosed.signclosedId!''}','570','450');">
                                 <i class="Hui-iconfont">&#xe644;</i>
                             </a>
+                            </#if>
                             <#if !signclosed.signclosedCustomerId??>
                                 <a style="text-decoration:none" href="javascript:;" title="关联客诉"
                                    onclick="associated_customer('关联客诉','${path}/admin/signclosed/to_associated_customer?signclosedId=${signclosed.signclosedId!''}','570','450');">
@@ -230,28 +232,8 @@
         layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
     }
     /*转入品检*/
-    function into_complaint(signclosedId){
-        layer.alert('确定转入到品检部门吗?', function () {
-            $.ajax({
-                cache: true,
-                type: "POST",
-                url: "${path}/admin/signclosed/into_complaint",
-                data:{"signclosedId":signclosedId},
-                async: false,
-                success: function(data){
-                    if (data.returnCode == 200) {
-                        layer.msg('转入成功',{icon: 1,time:1000},function () {
-                            location.replace(location.href);
-                        });
-                    } else {
-                        layer.msg('转入失败',{icon: 5,time:1000});
-                    }
-                },
-                error: function(XmlHttpRequest, textStatus, errorThrown){
-                    layer.msg('转入错误',{icon: 5,time:1000});
-                }
-            });
-        });
+    function into_complaint(title,url,w,h){
+        layer_show(title,url,w,h);
     }
 
     /**