瀏覽代碼

修改客户信息

liujiankang 7 年之前
父節點
當前提交
c81f9c494f

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

@@ -430,7 +430,8 @@
     <select id="queryProvinceList" parameterType="java.lang.String" resultMap="queryProvinceResult">
         SELECT
         t.province_id,
-        t.province
+        t.province,
+        t.division_code
         FROM
         tb_rst_address_province t
         ORDER BY
@@ -440,7 +441,8 @@
     <select id="queryCityList" parameterType="java.lang.String" resultMap="queryCityResult">
         SELECT
         t.city_id,
-        t.city
+        t.city,
+        t.division_code
         FROM
         tb_rst_address_city t
         WHERE
@@ -503,4 +505,104 @@
         ORDER BY
         t.color_id ASC
     </select>
+
+    <update id="updateCustomerBasic" parameterType="CustomerBasicInfo">
+        UPDATE tb_rst_customer_basic_info
+        <set >
+            <if test="customerName != null and customerName !='' " >
+                customer_name = #{customerName}
+            </if>
+            <if test="customerIndustry != null and customerIndustry !='' " >
+                customer_industry = #{customerIndustry}
+            </if>
+            <if test="customerType != null and customerType !='' " >
+                customer_type = #{customerType}
+            </if>
+            <if test="cooperativeState != null and cooperativeState !='' " >
+                cooperative_state = #{cooperativeState}
+            </if>
+            <if test="customerProvinceCode != null and customerProvinceCode !='' " >
+                customer_province_code = #{customerProvinceCode}
+            </if>
+            <if test="customerCityCode != null and customerCityCode !='' " >
+                customer_city_code = #{customerCityCode}
+            </if>
+            <if test="customerAddress != null and customerAddress !='' " >
+                customer_address = #{customerAddress}
+            </if>
+            <if test="customerStatus != null and customerStatus !='' " >
+                customer_status = #{customerStatus}
+            </if>
+            <if test="updateDate != null and updateDate !='' " >
+                update_date = #{updateDate}
+            </if>
+            <if test="idUpdateBy != null and idUpdateBy !='' " >
+                id_update_by = #{idUpdateBy}
+            </if>
+            <if test="customerRemarks != null and customerRemarks !='' " >
+                customer_remarks = #{customerRemarks}
+            </if>
+        </set>
+        where customer_id = #{customerId}
+    </update>
+
+    <update id="updateBillingInfo" parameterType="BillingInfo">
+        UPDATE tb_rst_billing_info
+        <set >
+            <if test="accountOpeningBranch != null and accountOpeningBranch !='' " >
+                account_opening_branch = #{accountOpeningBranch}
+            </if>
+            <if test="accountName != null and accountName !='' " >
+                account_name = #{accountName}
+            </if>
+            <if test="accountNum != null and accountNum !='' " >
+                account_num = #{accountNum}
+            </if>
+            <if test="receivablesName != null and receivablesName !='' " >
+                receivables_name = #{receivablesName}
+            </if>
+            <if test="receivablesPhone != null and receivablesPhone !='' " >
+                receivables_phone = #{receivablesPhone}
+            </if>
+        </set>
+        where customer_id = #{customerId}
+    </update>
+
+    <update id="updateOpeningInfo" parameterType="TicketOpeningInfo">
+        UPDATE tb_rst_ticket_opening_info
+        <set >
+            <if test="ticketType != null and ticketType !='' " >
+                ticket_type = #{ticketType}
+            </if>
+            <if test="accountOpeningBranch != null and accountOpeningBranch !='' " >
+                account_opening_branch = #{accountOpeningBranch}
+            </if>
+            <if test="ticketOpeningAccount != null and ticketOpeningAccount !='' " >
+                ticket_opening_account = #{ticketOpeningAccount}
+            </if>
+            <if test="enterpriseName != null and enterpriseName !='' " >
+                enterprise_name = #{enterpriseName}
+            </if>
+            <if test="taxpayerIdentificationNum != null and taxpayerIdentificationNum !='' " >
+                taxpayer_identification_num = #{taxpayerIdentificationNum}
+            </if>
+            <if test="ticketOpeningPhone != null and ticketOpeningPhone !='' " >
+                ticket_opening_phone = #{ticketOpeningPhone}
+            </if>
+            <if test="enterpriseAddress != null and enterpriseAddress !='' " >
+                enterprise_address = #{enterpriseAddress}
+            </if>
+        </set>
+        where customer_id = #{customerId}
+    </update>
+
+    <delete id="deleteContactInfo" parameterType="Integer">
+        DELETE FROM tb_rst_docked_contact_info WHERE customer_id = #{customerId}
+    </delete>
+    <delete id="deleteSaleInfo" parameterType="Integer">
+        DELETE FROM tb_rst_channel_sale_info WHERE customer_id = #{customerId}
+    </delete>
+    <delete id="deleteDivisionInfo" parameterType="Integer">
+        DELETE FROM tb_rst_channel_division_info WHERE channel_division_id = #{channelDivisionId}
+    </delete>
 </mapper>

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

@@ -130,6 +130,9 @@
                                 <#if !isSelectAll?? ||(isSelectAll != 2) || (adminId == list.idCreateBy)>
                                         <a href="#" onclick="customerDetail(${list.customerId!''})">详情</a>
                                 </#if>
+                                <#--<#if adminId == list.idCreateBy>-->
+                                    <a href="#" onclick="customerupdate(${list.customerId!''})">修改</a>
+                                <#--</#if>-->
                             </td>
 						</tr>
 					</#list>
@@ -183,6 +186,13 @@
             function customerDetail(customerId) {
                 window.location.href= "${path}/admin/customerBasic/customer_Basic_Detail?customerId="+customerId;
             }
+            /**
+             *跳转到修改页面
+             * @param employee
+             */
+            function customerupdate(customerId) {
+                window.location.href= "${path}/admin/customerBasic/to_update_customer_Basic?customerId="+customerId;
+            }
         </script>
 	</body>
 </html>

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

@@ -75,12 +75,8 @@
             <div class="formControls col-4 col-sm-4">
                  <span class="select-box">
                         <select name="customerType" class="select">
-                            <#if customerBasicInfo.customerType == 1>
-                                <option value="1">个人</option>
-                            </#if>
-                            <#if customerBasicInfo.customerType == 2>
-                                <option value="2">公司</option>
-                            </#if>
+                                <option value="1" <#if customerBasicInfo.customerType == 1>selected</#if>>个人</option>
+                                <option value="2"<#if customerBasicInfo.customerType == 2>selected</#if>>公司</option>
                         </select>
                  </span>
             </div>
@@ -88,15 +84,9 @@
             <div class="formControls col-4 col-sm-4">
                 <span class="select-box">
                         <select name="cooperativeState" class="select">
-                            <#if customerBasicInfo.cooperativeState == 1>
-                                <option value="1">意向合作</option>
-                            </#if>
-                            <#if customerBasicInfo.cooperativeState == 2>
-                                <option value="2">已经合作</option>
-                            </#if>
-                            <#if customerBasicInfo.cooperativeState == 3>
-                                <option value="3">停止合作</option>
-                            </#if>
+                            <option value="1"<#if customerBasicInfo.cooperativeState == 1>selected</#if>>意向合作</option>
+                            <option value="2"<#if customerBasicInfo.cooperativeState == 2>selected</#if>>已经合作</option>
+                            <option value="3"<#if customerBasicInfo.cooperativeState == 3>selected</#if>>停止合作</option>
                         </select>
                 </span>
             </div>
@@ -115,14 +105,14 @@
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>客户地址:</label>
             <div class="formControls col-4 col-sm-4">
                 <span class="select-box">
-                        <select name="customerProvinceCode" class="select">
+                        <select name="customerProvinceCode" id="customerProvinceCode" class="select">
                             <option value="">请选择省份</option>
                         </select>
                 </span>
             </div>
             <div class="formControls col-4 col-sm-4">
                 <span class="select-box">
-                        <select name="customerCityCode" class="select">
+                        <select name="customerCityCode" id="customerCityCode" class="select">
                             <option value="">请选择城市</option>
                         </select>
                 </span>
@@ -171,7 +161,7 @@
                             <td>${list.contactPhone!''}</td>
                             <td>${list.contactType!''}</td>
                             <td>${list.contactEmail!''}</td>
-                            <td><a>删除</a></td>
+                            <td><a href='javascript:;' onclick='deleteContact(this)'>删除</a></td>
                         </tr>
                         </#list>
                     <#else>
@@ -262,11 +252,12 @@
             <div class="formControls col-9">
             </div>
         </div>
+        <#if billingInfo??>
         <div class="row cl" style="margin-bottom: 10px;">
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开户支行:</label>
             <div class="formControls col-2 col-sm-2">
                 <input type="text" class="input-text trim_input" placeholder="开户支行" id="accountOpeningBranch" name="accountOpeningBranch" value="${billingInfo.accountOpeningBranch!''}">
-            </div>
+            </div>1
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>账户名称:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
                 <input type="text" class="input-text trim_input" placeholder="账户名称" id="accountName" name="accountName" value="${billingInfo.accountName!''}">
@@ -286,15 +277,41 @@
                 <input type="text" class="input-text trim_input" placeholder="收款人手机" id="receivablesPhone" name="receivablesPhone" value="${billingInfo.receivablesPhone!''}">
             </div>
         </div>
-
+        <#else >
+            <div class="row cl" style="margin-bottom: 10px;">
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开户支行:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" placeholder="开户支行" id="accountOpeningBranch" name="accountOpeningBranch" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>账户名称:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="账户名称" id="accountName" name="accountName" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>账号:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="填写账号" id="accountNum" name="accountNum" value="">
+                </div>
+            </div>
+            <div class="row cl" style="margin-bottom: 10px;">
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>收款人姓名:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="收款人姓名" id="receivablesName" name="receivablesName" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>收款人手机:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="收款人手机" id="receivablesPhone" name="receivablesPhone" value="">
+                </div>
+            </div>
+        </#if>
         <#--开票信息-->
         <div class="row cl" style="margin-bottom: 10px;">
             <label class="form-label col-3">
-                <div class="tit-2">开票信息<span> *是否开票<input type="radio" value="1" checked="checked">开票</input><input type="radio" value="2">不开票</input></span></div>
+                <div class="tit-2">开票信息<span>*是否开票<input type="radio" value="1" name="outInvoice" checked="checked">开票</input><input type="radio" name="outInvoice" value="2">不开票</input></span></div>
             </label>
             <div class="formControls col-9">
             </div>
         </div>
+        <#if ticketOpeningInfo??>
         <div class="row cl" style="margin-bottom: 10px;">
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>发票类型:</label>
             <div class="formControls col-2 col-sm-2">
@@ -334,7 +351,47 @@
                 <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="${ticketOpeningInfo.enterpriseAddress!''}">
             </div>
         </div>
-
+        <#else >
+            <div class="row cl" style="margin-bottom: 10px;">
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>发票类型:</label>
+                <div class="formControls col-2 col-sm-2">
+                <span class="select-box">
+                    <select name="ticketType" class="select">
+                    <option value="1">专票</option>
+                    <option value="2">普票</option>
+                    </select>
+                </span>
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开户支行:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="accountOpeningBranch" name="accountOpeningBranch" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开票账户:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="">
+                </div>
+            </div>
+            <div class="row cl" style="margin-bottom: 10px;">
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>企业名称:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="企业名称" id="enterpriseName" name="enterpriseName" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>纳税人识别号:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="taxpayerIdentificationNum" name="taxpayerIdentificationNum" value="">
+                </div>
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开票电话:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="">
+                </div>
+            </div>
+            <div class="row cl" style="margin-bottom: 10px;">
+                <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>企业地址:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="">
+                </div>
+            </div>
+        </#if>
         <#--客户备注-->
 
         <div class="row cl">
@@ -360,6 +417,8 @@
                 <p><span onclick="addCustomerBasicInfo()">添加客户信息</span></p>
             </div>
         </div>
+        <input type="hidden" id="provinceCode" value="${customerBasicInfo.customerProvinceCode!''}">
+        <input type="hidden" id="cityCode" value="${customerBasicInfo.customerCityCode!''}">
     </form>
 </div>
 
@@ -373,6 +432,8 @@
 
         /*初始化省份(大类)*/
         initProvince();
+        //初始化市
+        initCity('${customerBasicInfo.customerProvinceCode!''}');
 
         /*初始化渠道类别(大类)*/
         initChannelCategory();
@@ -422,14 +483,15 @@
                     for(var i=0;i<data.returnMsg.provinceList.length;i++){
                         provinceListInfo = data.returnMsg.provinceList[i];
                         if(i == 0 ){
-                            id = provinceListInfo.provinceId;
+                            id = provinceListInfo.divisionCode;
                         }
-                        html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.province +'</option>';
+                        html += '<option value="'+ provinceListInfo.divisionCode +'">'+ provinceListInfo.province +'</option>';
                     }
                 }else{
                     html = '';
                 }
                 $("[name='customerProvinceCode']").html(html);
+                $("#customerProvinceCode").val($("#provinceCode").val());
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
@@ -455,12 +517,13 @@
                     if (data.returnCode == 200) {
                         for(var i=0;i<data.returnMsg.cityList.length;i++){
                             cityListInfo = data.returnMsg.cityList[i];
-                            html += '<option value="'+ cityListInfo.cityId +'">'+ cityListInfo.city +'</option>';
+                            html += '<option value="'+ cityListInfo.divisionCode +'">'+ cityListInfo.city +'</option>';
                         }
                     }else{
                         html = '';
                     }
                     $("[name='customerCityCode']").html(html);
+                    $("#customerCityCode").val($("#cityCode").val());
                 },
                 error: function(XmlHttpRequest, textStatus, errorThrown){
                 }
@@ -629,8 +692,8 @@
         var promotingProducts = document.getElementById("promotingProducts").value;
         var supplyPrice = document.getElementById("supplyPrice").value;
         var accountPeriod = document.getElementById("accountPeriod").value;
-        var operation = "删除";
-        //var operation = var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)'>删除</a>";
+        //var operation = "删除";
+         var operation = "<a href='javascript:;' onclick='deleteChannelSale(this)'>删除</a>";
         row = document.getElementById("saleTable").insertRow();
         if(row!=null){
             cell=row.insertCell();