Pārlūkot izejas kodu

添加客户基本信息

dujinyan 7 gadi atpakaļ
vecāks
revīzija
5429e6354c

+ 14 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml

@@ -309,8 +309,8 @@
     </resultMap>
     <!--查询销售产品价格-->
     <resultMap type="com.iamberry.rst.core.order.ProductColor" id="querySupplyPriceResult">
-        <result property="colorId" column="color_id" />
-        <result property="colorPrice" column="color_price" />
+        <result property="colorId" column="supply_product_id" />
+        <result property="colorPrice" column="supply_product_price" />
     </resultMap>
     <!--映射结果集 end-->
 
@@ -549,8 +549,7 @@
         t.product_id ASC
     </select>
     <!--查询销售产品价格-->
-    <select id="querySupplyPriceList" parameterType="java.lang.String" resultMap="querySupplyPriceResult">
-        SELECT
+    <!--   /*SELECT
         t.color_id,
         t.color_price
         FROM
@@ -558,7 +557,17 @@
         WHERE
         t.color_product_id = #{id}
         ORDER BY
-        t.color_id ASC
+        t.color_id ASC*/-->
+    <select id="querySupplyPriceList" parameterType="java.lang.String" resultMap="querySupplyPriceResult">
+        SELECT
+        t.supply_product_id,
+        t.supply_product_price
+        FROM
+        tb_rst_supply_product_info t
+        WHERE
+        t.supply_product_id = #{id}
+        ORDER BY
+        t.supply_product_id ASC
     </select>
 
     <update id="updateCustomerBasic" parameterType="CustomerBasicInfo">

+ 10 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl

@@ -725,12 +725,17 @@
                     var html = '';
                     var chose = "手动输入产品价格"
                     if (data.returnCode == 200) {
-                        for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
-                            var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
-                            html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                        if(data.returnMsg.supplyPriceList.length > 0){
+                            for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
+                                var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
+                                html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                            }
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").hide();
+                        }else{
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").show();
                         }
-                        html += '<option value="00">'+ chose +'</option>';
-                        $("#writeSupplyPrice").hide();
                     }else{
                         html = '';
                     }

+ 10 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/customer/update_customer_info.ftl

@@ -860,12 +860,17 @@
                     var html = '';
                     var chose = "手动输入产品价格"
                     if (data.returnCode == 200) {
-                        for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
-                            var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
-                            html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                        if(data.returnMsg.supplyPriceList.length > 0){
+                            for(var i=0;i<data.returnMsg.supplyPriceList.length;i++){
+                                var supplyPriceInfo = data.returnMsg.supplyPriceList[i];
+                                html += '<option value="'+ supplyPriceInfo.colorPrice/100 +'">'+ supplyPriceInfo.colorPrice/100 +'</option>';
+                            }
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").hide();
+                        }else{
+                            html += '<option value="00">'+ chose +'</option>';
+                            $("#writeSupplyPrice").show();
                         }
-                        html += '<option value="00">'+ chose +'</option>';
-                        $("#writeSupplyPrice").hide();
                     }else{
                         html = '';
                     }