Forráskód Böngészése

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

wangxiaoming 6 éve
szülő
commit
73fa74b379

+ 1 - 4
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintSignclosedInfoService.java

@@ -17,10 +17,7 @@ public interface ComplaintSignclosedInfoService {
      * 添加单个签收记录
      * @return
      */
-    boolean insert(ComplaintSignclosedInfo record,
-               Map<String,Integer> alreadyColorMap,
-               Map<String,String[]> machineNumberMap,
-               Map<String,Integer> alreadyFittingsMap);
+    boolean insert(ComplaintSignclosedInfo record,String orderItemString);
     /**
      * 查询单个签收记录
      * @return

+ 27 - 42
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintSignclosedInfoServiceImpl.java

@@ -4,6 +4,7 @@ package com.iamberry.rst.service.cm;
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
@@ -11,6 +12,8 @@ import com.iamberry.rst.faces.cm.ComplaintSignclosedInfoService;
 import com.iamberry.rst.service.cm.mapper.*;
 import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.util.PageUtil;
+import com.iamberry.wechat.tools.ResponseJson;
+import net.sf.json.JSONArray;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,54 +43,36 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     @Override
     @Transactional
     public boolean insert(ComplaintSignclosedInfo record,
-                      Map<String,Integer> alreadyColorMap,
-                      Map<String,String[]> machineNumberMap,
-                      Map<String,Integer> alreadyFittingsMap) {
+                          String orderItemString) {
         boolean msg = true;
         int num = complaintSignclosedInfoMapper.insert(record);
         if(num < 1){
             msg = false;
         }else{
-            if(alreadyColorMap != null || alreadyColorMap.size() != 0){
-                for (Map.Entry<String,Integer> entry : alreadyColorMap.entrySet()) {
-                    int i = 0;
-                    SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
-                    //根据颜色id获取产品信息获取产品信息
-                    Product product = productMapper.getProductById(Integer.valueOf(entry.getKey()));
-                    if(product == null){
-                        return false;
-                    }
-                    for (int j = 0;j<entry.getValue();j++){
-                        signclosedProductInfo.setSignclosedId(record.getSignclosedId());
-                        signclosedProductInfo.setProductName(product.getProductName());
-                        signclosedProductInfo.setProductNum(1);
-                        signclosedProductInfo.setSignclosedProductType(1);
-                        signclosedProductInfo.setSignclosedProductId(product.getProductId());
-                        signclosedProductInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
-                        signclosedProductInfo.setSignclosedCreateTime(new Date());
-                        complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
-                        i++;
-                    }
+            if(orderItemString != null){
+                JSONArray jsonArray = JSONArray.fromObject(orderItemString);
+                List<SalesOrderItem> salesOrderItemList = (List) JSONArray.toCollection(jsonArray, SalesOrderItem.class);
+                    for (SalesOrderItem salesOrderItem:salesOrderItemList) {
+                        if(salesOrderItem.getItemNum() > 0 && salesOrderItem.getItemColorId() > 0){
+                        int i = 0;
+                        SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
+                        //根据颜色id获取产品信息获取产品信息
+                            ProductColor productColor = productMapper.getProduceColor(salesOrderItem.getItemColorId());
+                            if(productColor == null){
+                                msg = false;
+                            }
+                        for (int j = 0;j<salesOrderItem.getItemNum();j++){
+                            signclosedProductInfo.setSignclosedId(record.getSignclosedId());
+                            signclosedProductInfo.setProductName(productColor.getProductName());
+                            signclosedProductInfo.setProductNum(1);
+                            signclosedProductInfo.setSignclosedProductType(1);
+                            signclosedProductInfo.setSignclosedProductId(productColor.getColorProductId());
+                            signclosedProductInfo.setSignclosedProductColor(salesOrderItem.getItemColorId());
+                            signclosedProductInfo.setSignclosedCreateTime(new Date());
+                            complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                            i++;
+                        }
 
-                }
-            }
-            if(alreadyFittingsMap != null || alreadyFittingsMap.size() != 0){
-                for (Map.Entry<String,Integer> entry : alreadyFittingsMap.entrySet()) {
-                    SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
-                    //根据配件id获取配件信息
-                    FittingsInfo fittingsInfo = fittingsInfoMapper.getFittingsById(Integer.valueOf(entry.getKey()));
-                    if(fittingsInfo == null){
-                        return false;
-                    }
-                    for (int j = 0;j<entry.getValue();j++){
-                        signclosedProductInfo.setSignclosedId(record.getSignclosedId());
-                        signclosedProductInfo.setProductName(fittingsInfo.getFittingsName());
-                        signclosedProductInfo.setProductNum(1);
-                        signclosedProductInfo.setSignclosedProductType(2);
-                        signclosedProductInfo.setSignclosedProductId(fittingsInfo.getFittingsId());
-                        signclosedProductInfo.setSignclosedProductColor(null);
-                        signclosedProductInfo.setSignclosedCreateTime(new Date());
-                        complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
                     }
                 }
             }

+ 4 - 41
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -154,56 +154,19 @@ public class AdminSignclosedController {
     @RequiresPermissions("signclosed:add:signclosed")
     @ResponseBody
     @RequestMapping("/add_signclosed")
-    public ResponseJson addSignclosed(HttpServletRequest request,ComplaintSignclosedInfo signclosedInfo) throws Exception {
+    public ResponseJson addSignclosed(HttpServletRequest request,ComplaintSignclosedInfo signclosedInfo,String orderItemString) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(signclosedInfo == null){
             msg.setResultCode(200);
             msg.setReturnCode(500);
             return msg;
         }
-        /**签收产品**/
-        String[] alreadyColorName = request.getParameterValues("alreadyColorName");
-        String[] alreadyFittingsName = request.getParameterValues("alreadyFittingsName");
-        if(alreadyColorName == null && alreadyFittingsName == null){
+
+        if(orderItemString == null){
             msg.setResultCode(200);
             msg.setReturnCode(502);
             return msg;
         }
-        Map<String,Integer> alreadyColorMap = new HashMap<>();
-        Map<String,String[]> machineNumberMap = new HashMap<>();
-        if(alreadyColorName != null && alreadyColorName.length> 0){
-            for (int i = 0;i<alreadyColorName.length;i++){
-                /**获取机器数量**/
-                String number = request.getParameter("alreadyColorId"+alreadyColorName[i]);
-                if(number == null || number.equals("")){
-                    msg.setResultCode(200);
-                    msg.setReturnCode(503);
-                    return msg;
-                }
-                alreadyColorMap.put(alreadyColorName[i],Integer.valueOf(number));
-                /**获取机器编号数组**/
-                /*String[] machineNumbers = request.getParameterValues("machineNumber"+alreadyColorName[i]);
-                if(machineNumbers.length != Integer.valueOf(number)){
-                    msg.setResultCode(200);
-                    msg.setReturnCode(501);
-                    return msg;
-                }
-                machineNumberMap.put("machineNumber"+alreadyColorName[i],machineNumbers);*/
-            }
-        }
-        Map<String, Integer> alreadyFittingsMap = new HashMap<>();
-        if(alreadyFittingsName != null && alreadyFittingsName.length> 0) {
-            for (int i = 0; i < alreadyFittingsName.length; i++) {
-              String afId =   request.getParameter("alreadyFittingsId" + alreadyFittingsName[i]);
-                if(afId == null || afId.equals("")){
-                    msg.setResultCode(200);
-                    msg.setReturnCode(504);
-                    return msg;
-                }else{
-                    alreadyFittingsMap.put(alreadyFittingsName[i], Integer.valueOf(afId));
-                }
-            }
-        }
         String signclosedDate = request.getParameter("signclosed_date");
         if(signclosedDate != null){
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@@ -211,7 +174,7 @@ public class AdminSignclosedController {
         }
         signclosedInfo.setSignclosedCreateTime(new Date());
         signclosedInfo.setSignclosedState(1);
-        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,alreadyColorMap,machineNumberMap,alreadyFittingsMap);
+        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,orderItemString);
 
 
         if (!num) {

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

@@ -17,7 +17,7 @@
         .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
         .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: 65%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
         .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%;}
@@ -33,14 +33,14 @@
     <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 class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
+                <input class="my-input" 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 huanhang" style="margin-bottom: 15px;">
-                <select id="productId" name="productId" class="select" style="width: 150px;">
+                <select id="productId" name="productId" class="select" style="width: 158px;">
                     <#if (productList?size > 0)>
                             <#list productList as product>
                                 <option value="${product.productId!""}">${product.productName!""}</option>
@@ -48,14 +48,14 @@
                     </#if>
                 </select>
 
-                <select id="productColorId" name="productColorId" class="select" style="width: 150px;">
+                <select id="productColorId" name="productColorId" class="select" style="width: 158px;">
 
                 </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%;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;width: 402px;">
                 <input class="my-input-date" type="text"  name="itemDate" id="itemDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
             </div>
         </div>
@@ -75,8 +75,8 @@
         </div>
         <div class="input-box" >
             <label class="col-3 col-sm-3 huanhang"  style="text-align: right;margin: 10px 0px;"></label>
-            <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
-                <input class="my-input-date" list="contentlist" type="text" onchange="inputSelect()" name="content" id="content"  placeholder="输入关键字查询,如果没有请直接在问题简述填写"/>
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
+                <input class="my-input" list="contentlist" type="text" onchange="inputSelect()" name="content" id="content"  placeholder="输入关键字查询,如果没有请直接在问题简述填写"/>
                 <datalist id="contentlist">
                     <#if (detectionBasisList?size > 0)>
                         <#list detectionBasisList as detectionBasis>
@@ -89,49 +89,49 @@
 
         <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="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
                     <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;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
                 <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;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
             <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;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
             <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;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
             <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;">
+            <div class="formControls col-xs-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
             <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;">
+            <div class="formControls col-xs-8 col-sm-8 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="formControls col-xs-8 col-sm-8 skin-minimal">
                 <div class="radio-box">
                     <input type="radio" id="radio-5" name="isMaintenance" value="1" checked/>
                     <label for="radio-5">需要维修</label>
@@ -208,10 +208,6 @@
         });
     };
 
-    $(document).on('click','#contentlist option',function(){
-        alert("11");
-    });
-
     /*初始化单选框样式*/
         $(function(){
             $('.skin-minimal input').iCheck({

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

@@ -41,7 +41,7 @@
     <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;">
+            <select id="productId" name="productId" class="select" style="width: 120px;">
             <#if (productList?size > 0)>
                 <#list productList as product>
                 <#if productId??>
@@ -53,7 +53,7 @@
             </#if>
             </select>
 
-            <select id="productColorId" name="productColorId" class="select" style="width: 150px;">
+            <select id="productColorId" name="productColorId" class="select" style="width: 120px;">
 
             </select>
             <input class="my-input" style="width: 70px;" type="text" name="customerId" value="${customerId!}" placeholder="客诉编号"/>
@@ -86,7 +86,7 @@
         <table class="table table-border table-bordered table-bg table-hover table-sort">
             <thead>
             <tr class="text-c">
-                <th width="100">客诉编号</th>
+                <#--<th width="100">客诉编号</th>-->
                 <th width="100">产品</th>
                 <th width="100">状态</th>
                 <th width="60">工厂检测现象</th>
@@ -96,7 +96,7 @@
                 <th width="60">故障指向</th>
                 <th width="60">原因分析</th>
                 <th width="60">维修内容</th>
-                <th width="150">客诉描述</th>
+                <#--<th width="150">客诉描述</th>-->
                 <#--<th width="150">是否转入生产部门</th>-->
                 <th width="150">备注</th>
                 <th width="150">检测日期</th>
@@ -107,7 +107,7 @@
             <#if (page.dataList?size > 0)>
                 <#list page.dataList as detect>
                 <tr>
-                    <td class="text-c" width="100">${detect.customerId!}</td>
+                    <#--<td class="text-c" width="100">${detect.customerId!}</td>-->
                     <td class="text-c" width="100">${detect.productTypeName!}</td>
                     <td class="text-c" width="100">
                         <#if detect.detectItemState == 1>
@@ -124,7 +124,7 @@
                     <td class="text-c" width="60"><div class="txt" title="${detect.detectItemPoint!}">${detect.detectItemPoint!}</div></td>
                     <td class="text-c" width="60"><div class="txt" title="${detect.detectItemNalysis!}">${detect.detectItemNalysis!}</div></td>
                     <td class="text-c" width="60"><div class="txt" title="${detect.detectItemContent!}">${detect.detectItemContent!}</div></td>
-                    <td class="text-c" width="100"><span class="label txt2" title="${detect.questionTitle!}" >${detect.questionTitle!}</span><br><#if detect.questionTitle??><#if detect.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detect.customerId!});" style="color : #4149FF;">查看详情</a></#if></#if></td>
+                    <#--<td class="text-c" width="100"><span class="label txt2" title="${detect.questionTitle!}" >${detect.questionTitle!}</span><br><#if detect.questionTitle??><#if detect.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detect.customerId!});" style="color : #4149FF;">查看详情</a></#if></#if></td>-->
                    <#-- <td class="text-c" width="100">
                     <#if detect.detectIsMaintenance??>
                         <#if detect.detectIsMaintenance == 2>
@@ -167,7 +167,7 @@
                 </tr>
                 </#list>
             <#else >
-            <tr><td class="td-manage text-c" colspan = "14">暂时没有品质检测信息</td></tr>
+            <tr><td class="td-manage text-c" colspan = "12">暂时没有品质检测信息</td></tr>
             </#if>
             </tbody>
         </table>
@@ -240,6 +240,8 @@
                             var productColor = data.returnMsg.productColorList[i];
                             $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
                         }
+                    }else{
+                        $("#productColorId").append('<option>暂无产品颜色</option>');
                     }
 
                 }

+ 121 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

@@ -142,7 +142,32 @@
             </div>
 
 
-            <div class="row cl" id="renewedProduct">
+                <div class="row cl" id="" style="">
+                    <label class="form-label col-3 col-sm-3">商品信息:</label>
+                    <div class="formControls col-8 col-sm-8">
+                        <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加商品" >
+
+                        <table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="all_add_product">
+                            <thead>
+                            <tr class="text-c" id="table1">
+                                <th style="text-align: center;" width="30" >产品名称</th>
+                                <th style="text-align: center;" width="25" >产品颜色</th>
+                                <th style="text-align: center;" width="10">售价</th>
+                                <th style="text-align: center;" width="10">产品编码</th>
+                                <th style="text-align: center;" width="10">数量</th>
+                                <th style="text-align: center;" width="10">操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="add_product">
+                            </tbody>
+                        </table>
+
+                        <input type="hidden" id="orderItemString" name="orderItemString" value="" >
+
+                    </div>
+                </div>
+
+          <#--  <div class="row cl" id="renewedProduct">
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收产品:</label>
                 <div class="formControls col-8 col-sm-8 text-c" id="produceSelect">
                     <div>
@@ -162,7 +187,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>-->
 
                 <div class="row cl">
                     <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件人信息:</label>
@@ -468,6 +493,25 @@
         $("#signclosedAddrProvinces").val(provinces);
         $("#signclosedAddrCity").val(city);
         $("#signclosedAddrArea").val(area);
+
+        //选择产品
+        var flag = false;
+        /*封装订单项*/
+        var orderItemArray = new Array();
+        $("#add_product").find("tr").each(function(){
+            var orderItem = new Object();
+            orderItem.itemColorId = $(this).find(".color_id").val();
+            orderItem.itemNum = $(this).find(".item-num").val();
+            orderItemArray.push(orderItem);
+            flag = true;
+        })
+        if(!flag){
+            vailErrorMsg($(".add-order-button"),"必须要有一个产品");
+            return false;
+        }
+
+        $("#orderItemString").val(JSON.stringify(orderItemArray));
+
         $.ajax({
             cache: true,
             type: "POST",
@@ -495,6 +539,81 @@
             }
         });
     }
+
+    /**
+     * 打开订单
+     */
+    function add_product() {
+        layer_show("商品列表","${path}/admin/salesOrder/to_add_product","1000","500");
+    }
+
+    /**
+     *  删除商品
+     */
+    function delProduct($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 选择商品回调
+     * @param colorIds
+     */
+    function setSelectProduct(colorIds){
+        var index = layer.load(1, {
+            shade: [0.5,'#fff'] //0.1透明度的白色背景
+        });
+
+        $("#all_add_product").show();
+
+        var colorIdArray = colorIds.split("_");
+        for(var i=0;i<colorIdArray.length;i++){
+            var colorId = colorIdArray[i];
+            if(colorId == ""){
+                break;
+            }
+
+            var flag = true;
+            $("#add_product").find("tr").each(function (){
+                var colId = $(this).find(".color_id").eq(0).val();
+                if(colId == colorId){
+                    flag  = false;
+                }
+            })
+            if(!flag){
+                continue;
+            }
+            $.ajax({
+                type: "POST",
+                data: { colorId : colorId},
+                url: "${path}/admin/product/get_product",
+                success: function(data){
+                    var html = "";
+                    if (data.returnCode == 200 && data.returnMsg.productColorList.length > 0 ) {
+                        for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                            var productColor = data.returnMsg.productColorList[i];
+                            html += '<tr class="text-c">' +
+                                    '<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
+                                    '<input type="hidden" class="color_price" id="" value="'+ productColor.colorPrice +'" >' +
+                                    '<input type="hidden" class="color_discount" id="" value="'+ productColor.colorDiscount +'" >' +
+                                    ' <td>'+ cufte(productColor.productName) +'</td>' +
+                                    ' <td>'+ cufte(productColor.colorName) +'</td>' +
+                                    ' <td>'+ cufte(productColor.colorPrice)/100 +'</td>' +
+                                    ' <td>'+ cufte(productColor.colorBar) +'</td>' +
+                                    ' <td><input type="text" class="input-text input-number item-num"  style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
+                                    ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>' +
+                                    ' </tr>';
+                        }
+                    }else{
+                        html = '<tr class="text-c"><td colspan="12">没有搜索到商品,请重试!</td></tr>';
+                    }
+                    $("#add_product").append(html);
+                    /*计算价格*/
+                    calculatePrice();
+                }
+            });
+        }
+        layer.close(index);
+    }
 </script>
 <!--/请在上方写此页面业务相关的脚本-->
 </body>

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

@@ -38,6 +38,7 @@
                     <th width="160">产品</th>
                     <th width="120">产品颜色</th>
                     <th width="120">数量</th>
+                    <th width="120">维修编号</th>
                 </tr>
                 </thead>
                 <tbody id="listid">
@@ -47,6 +48,7 @@
                         <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>
+                        <td class="text-c" width="100">${customerId!signclosedId}${info.productId!}</td>
                     </tr>
                     </#list>
                 <#else >
@@ -55,10 +57,10 @@
                 </tbody>
             </table>
         </div>
-        <div class="input-box"   style="text-align:center;">
+        <#--<div class="input-box"   style="text-align:center;">
             <span class="input-dic spanhidth"><strong>维修编号:</strong></span>
             <span class="input-dic spanhidth" style="color:red;">${customerId!'未关联客诉'}</span>
-        </div></br>
+        </div></br>-->
         <div class="input-box"   style="text-align:center;">
             <span class="input-dic spanhidth">请将维修编号清晰的写到维修卡上方</span>
         </div></br>