فهرست منبع

feat:付款流水号和凭证截图

xuyongjun 1 سال پیش
والد
کامیت
e0a632e3cc

+ 12 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrder.java

@@ -68,6 +68,10 @@ public class SalesOrder implements Serializable {
      * add 2023-07-18
      */
     private String salesPaymentNo;
+    /**
+     * 支付凭证图片连接
+     */
+    private String salesPaymentVoucher;
     private Integer salesWaitMoney;         //待付金额
     private Integer salesLastMoney;         //本次支付金额
     private Integer salesShippingFee;       //邮费
@@ -567,6 +571,14 @@ public class SalesOrder implements Serializable {
         this.salesPaymentNo = salesPaymentNo;
     }
 
+    public String getSalesPaymentVoucher() {
+        return salesPaymentVoucher;
+    }
+
+    public void setSalesPaymentVoucher(String salesPaymentVoucher) {
+        this.salesPaymentVoucher = salesPaymentVoucher;
+    }
+
     public Integer getSalesWaitMoney() {
         return salesWaitMoney;
     }

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/dm/DealerChannel.java

@@ -20,6 +20,8 @@ public class DealerChannel  implements  Serializable{
     private Integer dealerId;
     //渠道id
     private Integer channelId;
+    //支付凭证 1平台订单 2现结订单 3月结订单
+    private Integer paymentVoucherId;
     //账期
     private String dealChannelAccountPeriod;
     //创建时间'
@@ -184,4 +186,12 @@ public class DealerChannel  implements  Serializable{
     public void setDealerChannelStoreList(List<DealerChannelStore> dealerChannelStoreList) {
         this.dealerChannelStoreList = dealerChannelStoreList;
     }
+
+    public Integer getPaymentVoucherId() {
+        return paymentVoucherId;
+    }
+
+    public void setPaymentVoucherId(Integer paymentVoucherId) {
+        this.paymentVoucherId = paymentVoucherId;
+    }
 }

+ 7 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -21,6 +21,7 @@
     <result column="sales_pay_money" property="salesPayMoney" jdbcType="INTEGER" />
     <result column="sales_pay_type" property="salesPayType" jdbcType="INTEGER" />
     <result column="sales_payment_no" property="salesPaymentNo" jdbcType="VARCHAR" />
+    <result column="sales_payment_voucher" property="salesPaymentVoucher" jdbcType="VARCHAR" />
     <result column="sales_wait_money" property="salesWaitMoney" jdbcType="INTEGER" />
     <result column="sales_last_money" property="salesLastMoney" jdbcType="INTEGER" />
     <result column="sales_shipping_fee" property="salesShippingFee" jdbcType="INTEGER" />
@@ -38,7 +39,7 @@
   <sql id="salesOrderInfo" >
         sales_id,sales_orderId,sales_openId,sales_discount_money,sales_pledge_money,sales_remain_deposit,
         sales_send_type,sales_send_time,sales_sales_time,sales_post_num,sales_post_firm,sales_address_info,sales_address_tel,
-        sales_address_name,sales_amount,sales_pay_money,sales_pay_type,sales_payment_no,sales_wait_money,sales_last_money,sales_shipping_fee,sales_pay_time,
+        sales_address_name,sales_amount,sales_pay_money,sales_pay_type,sales_payment_no,sales_payment_voucher,sales_wait_money,sales_last_money,sales_shipping_fee,sales_pay_time,
         sales_create_time,sales_admin_remark,sales_user_remark,sales_pay_number,sales_store_id,sales_company_id,sales_type,sales_deal_code,sales_order_status,
         sales_status,sales_shipping_status,sales_pay_status,sales_process_status,sales_is_send,sales_is_locked,sales_is_separate,sales_is_download,sales_main_order_id,
         sales_batch_id,sales_add_type,sales_admin_id,sales_deliver,sales_address_postcode,order_case_date
@@ -1202,6 +1203,7 @@
                 sales_pay_money,
                 sales_pay_type,
                 sales_payment_no,
+                sales_payment_voucher,
                 sales_wait_money,
                 sales_last_money,
                 sales_shipping_fee,
@@ -1258,6 +1260,7 @@
                 #{salesPayMoney},
                 #{salesPayType},
                 #{salesPaymentNo},
+                #{salesPaymentVoucher},
                 #{salesWaitMoney},
                 #{salesLastMoney},
                 #{salesShippingFee},
@@ -1436,6 +1439,9 @@
       <if test="salesPaymentNo != null ">
         sales_payment_no = #{salesPaymentNo},
       </if >
+      <if test="salesPaymentVoucher != null ">
+        sales_payment_voucher = #{salesPaymentVoucher},
+      </if>
       <if test="salesWaitMoney != null ">
         sales_wait_money = #{salesWaitMoney},
       </if >

+ 16 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/dm/mapper/dealerChannelMapper.xml

@@ -7,6 +7,7 @@
         <result    column="channel_id"    property="channelId" />
         <result    column="store_id"    property="storeId" />
         <result    column="deal_channel_account_period"    property="dealChannelAccountPeriod" />
+        <result    column="payment_voucher_id"    property="paymentVoucherId" />
         <result    column="create_date"    property="createDate" />
     </resultMap>
     <sql    id="Base_List" >
@@ -16,6 +17,7 @@
         t.channel_id,
         t.store_id,
         t.deal_channel_account_period,
+        t.payment_voucher_id,
         t.create_date
     </sql>
 
@@ -43,6 +45,9 @@
             <if test="channelId != null ">
                 AND t.channel_id = #{channelId}
             </if >
+            <if test="channelId != null ">
+                AND t.payment_voucher_id = #{paymentVoucherId}
+            </if >
             <if test="storeId != null ">
                 AND dcs.store_id = #{storeId}
             </if >
@@ -72,7 +77,8 @@
                 dealer_id,
                 channel_id,
                 store_id,
-                deal_channel_account_period
+                deal_channel_account_period,
+                payment_voucher_id
             )
         values
             (
@@ -81,7 +87,8 @@
                 #{dealerId},
                 #{channelId},
                 #{storeId},
-                #{dealChannelAccountPeriod}
+                #{dealChannelAccountPeriod},
+                #{paymentVoucherId}
             )
     </insert>
 
@@ -92,7 +99,8 @@
         dealer_id,
         channel_id,
         store_id,
-        deal_channel_account_period
+        deal_channel_account_period,
+        payment_voucher_id
         )
         values
         <foreach collection="list" item="node" index="index" separator="," open="" close="">
@@ -100,7 +108,8 @@
             #{node.dealerId},
             #{node.channelId},
             #{node.storeId},
-            #{node.dealChannelAccountPeriod}
+            #{node.dealChannelAccountPeriod},
+            #{node.paymentVoucherId}
             )
         </foreach >
     </insert>
@@ -121,6 +130,9 @@
                 <if test="node.dealChannelAccountPeriod != null and node.dealChannelAccountPeriod != ''">
                     deal_channel_account_period = #{node.dealChannelAccountPeriod},
                 </if >
+                <if test="node.paymentVoucherId != null and node.paymentVoucherId != ''">
+                    payment_voucher_id = #{node.paymentVoucherId},
+                </if >
             </set >
             where deal_channel_id= #{node.dealChannelId}
         </foreach >

+ 24 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/dm/DmDealerController.java

@@ -22,6 +22,7 @@ import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.rst.utils.UploadFileUtils;
 import com.iamberry.wechat.tools.ObjectExcelView;
 import com.iamberry.wechat.tools.ResponseJson;
+import com.iamberry.wechat.tools.payUtil.CollectionUtil;
 import net.sf.ezmorph.object.DateMorpher;
 import net.sf.json.JSONArray;
 import net.sf.json.util.JSONUtils;
@@ -910,4 +911,27 @@ public class DmDealerController {
         }
         return "";
     }
+
+    @RequestMapping("/get_payment_voucher")
+    @ResponseBody
+    public ResponseJson getPaymentVoucherByStoreId(Integer storeId) {
+        ResponseJson success = ResponseJson.getSUCCESS();
+
+        DealerChannelStore dealerChannelStore = new DealerChannelStore();
+        dealerChannelStore.setStoreId(storeId);
+        List<DealerChannelStore> dealerChannelStoreList = dealerChannelStoreService.getDealerChannelStoreList(dealerChannelStore);
+        if (CollectionUtil.isEmpty(dealerChannelStoreList)) {
+            success.addResponseKeyValue("paymentVoucher", null);
+            return success;
+        }
+        DealerChannelStore item = dealerChannelStoreList.get(0);
+        DealerChannel dealerChannel = dealerChannelService.getDealerChannelById(item.getDealChannelId());
+        if (dealerChannel == null) {
+            success.addResponseKeyValue("paymentVoucher", null);
+            return success;
+        }
+
+        success.addResponseKeyValue("paymentVoucher", dealerChannel.getPaymentVoucherId());
+        return success;
+    }
 }

+ 0 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AwaitSendController.java

@@ -1638,7 +1638,6 @@ public class AwaitSendController {
         titles.add("商家编号");
         titles.add("付款类型");
         titles.add("付款渠道流水号");
-        titles.add("商家编号");
         titles.add("订单金额");
         titles.add("订单类型");
         titles.add("姓名");

+ 2 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/dm/dealer/add_dealer.ftl

@@ -161,13 +161,14 @@
                                 <th  width="30" >渠道名称</th>
                                 <th width="30" >渠道类别</th>
                                 <th width="30" >渠道类型</th>
+                                <th width="30" >支付凭证</th>
                                 <th width="30">店铺名称</th>
                                 <th width="10">账期</th>
                                 <th width="5">操作</th>
                             </tr>
                         </thead>
                         <tbody id="add_dealer_channel">
-                            <tr><td colspan="6" class="td-manage text-c" >暂时没有销售渠道信息,请添加!</td></tr>
+                            <tr><td colspan="7" class="td-manage text-c" >暂时没有销售渠道信息,请添加!</td></tr>
                         </tbody>
                     </table>
                 </div>

+ 15 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/dm/dealer/add_dealer_channel.ftl

@@ -87,6 +87,19 @@
                         </span>
                     </div>
                 </div>
+
+                <div class="row cl" id="" style="">
+                    <label class="form-label col-xs-3 col-sm-3" style="text-align: right;"><span class="c-red">*</span>支付凭证:</label>
+                    <div class="formControls col-xs-8 col-sm-8">
+                        <span class="select-box">
+                            <select name="paymentVoucherId" class="select" id="paymentVoucherId">
+                                <option <#if dealerChannel.paymentVoucherId??><#if dealerChannel.paymentVoucherId == 1 >selected="selected"</#if></#if> value="1">平台订单</option>
+                                <option <#if dealerChannel.paymentVoucherId??><#if dealerChannel.paymentVoucherId == 2 >selected="selected"</#if></#if> value="2">现结订单</option>
+                                <option <#if dealerChannel.paymentVoucherId??><#if dealerChannel.paymentVoucherId == 3 >selected="selected"</#if></#if> value="3">月结订单</option>
+                            </select>
+                        </span>
+                    </div>
+                </div>
             </div>
 
             <div class="row cl " id="" style="">
@@ -184,6 +197,8 @@
         channel.channelName=$("#channelId").find("option:selected").text();
         channel.channelTypeName=$("#channelTypeId").find("option:selected").text();
 
+        channel.paymentVoucherId=$("#paymentVoucherId").val();
+        channel.paymentVoucherName=$("#paymentVoucherId option[value='"+ channel.paymentVoucherId +"']").text();
         var storeIdStr = '',storeNameStr='';
         $("#configui1").find("li").each(function (j, item) {
             if(isEmpty(storeIdStr)){

+ 15 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/dm/dealer/update_dealer.ftl

@@ -180,6 +180,7 @@
                             <th style="text-align: center;" width="30" >渠道名称</th>
                             <th style="text-align: center;" width="30" >渠道类别</th>
                             <th style="text-align: center;" width="30" >渠道类型</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="5">操作</th>
@@ -193,10 +194,24 @@
                                         <input type="hidden" class="input-text dealChannelIdStr" value="${dealerChannel.dealChannelId!''}" >
                                         <input type="hidden" class="input-text channelId" value="${dealerChannel.channelId!''}" >
                                         <input type="hidden" class="input-text channelTypeId" value="${dealerChannel.channelTypeId!''}" >
+                                        <input type="hidden" class="input-text paymentVoucherId" value="${dealerChannel.paymentVoucherId!''}" >
                                         <input type="hidden" class="input-text storeIdStr" value="${dealerChannel.storeIdStr!''}" >
                                         <td class="dealChannelName">${dealerChannel.dealChannelName!''}</td>
                                         <td class="channelTypeName">${dealerChannel.channelTypeName!''}</td>
                                         <td class="channelName">${dealerChannel.channelName!''}</td>
+                                        <td class="paymentVoucherName">
+                                            <#if dealerChannel.paymentVoucherId??>
+                                                <#if dealerChannel.paymentVoucherId == 1>
+                                                    平台订单
+                                                <#elseif dealerChannel.paymentVoucherId == 2>
+                                                    现结订单
+                                                <#elseif dealerChannel.paymentVoucherId == 3>
+                                                    月结订单
+                                                <#else>
+                                                    无
+                                                </#if>
+                                            </#if>
+                                        </td>
                                         <td class="storeNameStr">
                                             ${dealerChannel.storeNameStr!''}
                                         </td>

+ 46 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/add_order.ftl

@@ -202,6 +202,19 @@
                 </div>
             </div>
 
+            <div class="row cl" id="paymentVoucherRow" style="display: none">
+                <label class="form-label col-1 col-sm-1">支付流水号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input style="height: 31px" type="text" placeholder="填写流水号" id="salesPaymentNo"  name="salesPaymentNo" class="input-text trim_input" >
+                    <input type="hidden" placeholder="支付凭证截图" id="salesPaymentVoucher"  name="salesPaymentVoucher" class="input-text trim_input" >
+                </div>
+                <label class="form-label col-2 col-sm-2">支付凭证截图:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <button onClick="uploadPaymentVoucher();" type="button"  class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 30px;">上传图片</button>
+                    <span id="uploadState"></span>
+                </div>
+            </div>
+
 
             <div class="row cl">
                 <label class="form-label col-3">
@@ -315,8 +328,12 @@
 <#--时间控件-->
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript" charset="utf-8" src="${path}/common/js/salesOrder/salesOrder.js"></script>
-
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/plain" id="upload_ue"></script>
 <script type="text/javascript">
+    var _editor;
     $(function() {
        $("#salesGive").change(function() {
            select_give_order();
@@ -333,6 +350,29 @@
                $(".give-sales-order").show();
            }
        }
+
+       //初始化图片上传
+        _editor = UE.getEditor('upload_ue',{
+            initialFrameWidth : 375,
+            initialFrameHeight: 600
+        });
+        _editor.ready(function () {
+            _editor.setDisabled("attachment");//设置编辑器不可用
+            _editor.hide();//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
+            //侦听图片上传
+            _editor.addListener('beforeInsertImage', function (t, arg) {
+                // console.log(arg[0].src);
+                // $("#picture").attr("value", arg[0].src);//将地址赋值给相应的input,只去第一张图片的路径
+                // $("#preview").attr("src", arg[0].src);  //图片预览
+            });
+            //侦听文件上传,取上传文件列表中第一个上传的文件的路径
+            _editor.addListener('afterUpfile', function (t, arg) {
+                console.log(arg[0].url);
+                $('#salesPaymentVoucher').val(arg[0].url);
+                $('#uploadState').empty();
+                $('#uploadState').append('<a href="${path}'+ arg[0].url +'" style="text-decoration: underline; color: blue" target="_blank">已上传</a>');
+            });
+        });
     });
     var date = new Date();
     var newyear = date.getFullYear();
@@ -429,6 +469,11 @@
         $("#give-sales-order").text("当前选择:" + selectOrder);
         $("#give-sales-order-input").val(selectOrder);
     }
+
+    function uploadPaymentVoucher() {
+        var myFiles = _editor.getDialog("attachment");
+        myFiles.open();
+    }
 </script>
 </body>
 </html>

+ 10 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_detail.ftl

@@ -154,7 +154,16 @@
             </tr>
             <tr>
                 <th width="10">付款渠道流水号:</th>
-                <td width="10" colspan="4"><span>${order.salesPaymentNo!''}</span></td>
+                <td width="10"><span>${order.salesPaymentNo!''}</span></td>
+                <td width="10"></td>
+                <th width="10">付款凭证截图:</th>
+                <td width="10">
+                    <span>
+                        <#if order.salesPaymentVoucher??>
+                            <a href="${path}${order.salesPaymentVoucher!''}" target="_blank" style="text-decoration: underline; color: blue">点我查看</a>
+                        </#if>
+                    </span>
+                </td>
             </tr>
             <tr>
                 <th width="10">录入人:</th>

+ 52 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/update_order.ftl

@@ -242,6 +242,23 @@
                 </div>
             </div>
 
+            <div class="row cl" id="paymentVoucherRow" style="display: none">
+                <label class="form-label col-1 col-sm-1">支付流水号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input style="height: 31px" type="text" placeholder="填写流水号" id="salesPaymentNo"  name="salesPaymentNo" class="input-text trim_input" value="${order.salesPaymentNo!''}">
+                    <input type="hidden" placeholder="支付凭证截图" id="salesPaymentVoucher"  name="salesPaymentVoucher" class="input-text trim_input" value="${order.salesPaymentVoucher!''}">
+                </div>
+                <label class="form-label col-2 col-sm-2">支付凭证截图:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <button onClick="uploadPaymentVoucher();" type="button"  class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 30px;">上传图片</button>
+                    <span id="uploadState">
+                        <#if order.salesPaymentVoucher??>
+                            <a href="${path}${order.salesPaymentVoucher}" style="text-decoration: underline; color: blue" target="_blank">已上传</a>
+                        </#if>
+                    </span>
+                </div>
+            </div>
+
             <div class="row cl">
                 <label class="form-label col-3">
                     <div class="tit-2">商品信息</div>
@@ -382,7 +399,11 @@
 
 <#--时间控件-->
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
 <script type="text/javascript" charset="utf-8" src="${path}/common/js/salesOrder/salesOrder.js"></script>
+<script type="text/plain" id="upload_ue"></script>
 
 <script type="text/javascript">
     var url_path = "${path}";
@@ -405,6 +426,32 @@
                 $(".give-sales-order").show();
             }
         }
+
+        // 订单类型为正常订单、非赠品订单、店铺结算类型为:现结订单 -> 显示流水号和支付凭证
+        renderPaymentVoucher(${order.salesStoreId!""});
+
+        //初始化图片上传
+        _editor = UE.getEditor('upload_ue',{
+            initialFrameWidth : 375,
+            initialFrameHeight: 600
+        });
+        _editor.ready(function () {
+            _editor.setDisabled("attachment");//设置编辑器不可用
+            _editor.hide();//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
+            //侦听图片上传
+            _editor.addListener('beforeInsertImage', function (t, arg) {
+                // console.log(arg[0].src);
+                // $("#picture").attr("value", arg[0].src);//将地址赋值给相应的input,只去第一张图片的路径
+                // $("#preview").attr("src", arg[0].src);  //图片预览
+            });
+            //侦听文件上传,取上传文件列表中第一个上传的文件的路径
+            _editor.addListener('afterUpfile', function (t, arg) {
+                console.log(arg[0].url);
+                $('#salesPaymentVoucher').val(arg[0].url);
+                $('#uploadState').empty();
+                $('#uploadState').append('<a href="${path}'+ arg[0].url +'" style="text-decoration: underline; color: blue" target="_blank">已上传</a>');
+            });
+        });
     });
 
     /** 选择主订单以后回调 */
@@ -488,6 +535,11 @@
         search_contains:false,
         enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
     });
+
+    function uploadPaymentVoucher() {
+        var myFiles = _editor.getDialog("attachment");
+        myFiles.open();
+    }
 </script>
 </body>
 </html>

+ 6 - 0
watero-rst-web/src/main/webapp/common/js/dealer/dealer.js

@@ -93,10 +93,12 @@ function showChannel(channel) {
         html += ' <input type="hidden" class="input-text dealChannelIdStr" value="'+ cufte(channel.dealChannelIdStr) +'" >';
         html += ' <input type="hidden" class="input-text channelId" value="'+ cufte(channel.channelId) +'" >';
         html += ' <input type="hidden" class="input-text channelTypeId" value="'+ cufte(channel.channelTypeId) +'" >';
+        html += ' <input type="hidden" class="input-text paymentVoucherId" value="'+ cufte(channel.paymentVoucherId) +'" >';
         html += ' <input type="hidden" class="input-text storeIdStr" value="'+ cufte(channel.storeIdStr) +'" >';
         html += '<td class="dealChannelName">'+ cufte(channel.dealChannelName) +'</td>';
         html += '<td class="channelTypeName">'+ cufte(channel.channelTypeName) +'</td>';
         html += '<td class="channelName">'+ cufte(channel.channelName) +'</td>';
+        html += '<td class="paymentVoucherName">'+ cufte(channel.paymentVoucherName) +'</td>';
         html += '<td class="storeNameStr">'+ cufte(channel.storeNameStr) +'</td>';
         html += '<td class="dealChannelAccountPeriod">'+ cufte(channel.dealChannelAccountPeriod) +'</td>';
         html += '<td><a href="javascript:void(0)" onclick="updateDealerChannel($(this))">修改</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="delTableByTr($(this),2)">删除</a></td>';
@@ -121,6 +123,8 @@ function showChannel(channel) {
         $channelTr.find(".channelTypeId").val(cufte(channel.channelTypeId));
         $channelTr.find(".channelTypeName").text(cufte(channel.channelTypeName));
         $channelTr.find(".channelName").text(cufte(channel.channelName));
+        $channelTr.find(".paymentVoucherName").text(cufte(channel.paymentVoucherName));
+        $channelTr.find(".paymentVoucherId").val(cufte(channel.paymentVoucherId));
         $channelTr.find(".storeNameStr").text(cufte(channel.storeNameStr));
         $channelTr.find(".dealChannelAccountPeriod").text(cufte(channel.dealChannelAccountPeriod));
     }
@@ -142,6 +146,7 @@ function updateDealerChannel($this) {
     channel.channelTypeId= $contact.find(".channelTypeId").val();
     channel.storeIdStr=$contact.find(".storeIdStr").val();
     channel.dealChannelAccountPeriod=$contact.find(".dealChannelAccountPeriod").text();
+    channel.paymentVoucherId=$contact.find(".paymentVoucherId").val();
     layer_show_height("修改渠道商",url_path+"/admin/dealer/to_add_dealer_channel?"+parseParam(channel),1);
 }
 //-----------------------渠道商 END -----------------------------
@@ -398,6 +403,7 @@ $(function(){
                     channel.dealChannelIdStr = $contact.find(".dealChannelIdStr").val();
                     channel.channelId= $contact.find(".channelId").val();
                     channel.channelTypeId= $contact.find(".channelTypeId").val();
+                    channel.paymentVoucherId= $contact.find(".paymentVoucherId").val();
                     //channel.storeId=$contact.find(".storeId").val();
                     channel.storeIdStr=$contact.find(".storeIdStr").val();
                     channel.dealChannelAccountPeriod=$contact.find(".dealChannelAccountPeriod").text();

+ 56 - 4
watero-rst-web/src/main/webapp/common/js/salesOrder/salesOrder.js

@@ -7,6 +7,8 @@ var isApportion = 1;    //1(未使用分摊金额,数值变动会自动计算商
 //删除节点-保存对应删除的节点信息 -- 只有修改页面使用
 var deleteArray = new Array();
 
+// 订单类型为正常订单、非赠品订单、店铺结算类型为:现结订单;需要输入流水号或者上传支付凭证
+var isShowPaymentVoucher = false;
 /**
  * 打开商品列表
  */
@@ -32,12 +34,8 @@ function add_customer() {
     layer_show("客诉列表",url_path + "/admin/customer/to_add_customer_list","1000","500");
 }
 
-
-
 $(function(){
 
-
-
     $("#salesOrderStatus").change(function(){
         var status = $(this).val();
         if(status == 1){    //正常订单
@@ -45,14 +43,58 @@ $(function(){
             $("#salesCustomer").hide();
             $("#salesCustomerIdHtml").html("");
             $("#salesCustomerId").val("");
+
         }else{
             $("#selectCustomer").show();
             $("#salesCustomer").show();
             $("#salesCustomerIdHtml").html("未选择客诉编号!");
         }
+        renderPaymentVoucher();
+    })
+
+    // 赠品订单隐藏流水号布局
+    $("#salesOrderStatus").change(function(){
+        renderPaymentVoucher()
     })
+
+    $('#salesStoreId').change(function () {
+        // 处理输入流水号或者上传支付凭证是否显示
+        // var storeId = $(this).val();
+        renderPaymentVoucher();
+    });
 });
 
+function renderPaymentVoucher(storeId) {
+    var salesOrderStatus = $('#salesOrderStatus').val();
+    var salesGive = $('#salesGive').val();
+    if (storeId == null || storeId == '') {
+        storeId = $('#salesStoreId').val();
+    }
+
+    $.ajax({
+        type: "POST",
+        data: {
+            storeId : storeId,
+        },
+        url: url_path + "/admin/dealer/get_payment_voucher",
+        success: function(data){
+            if (data.returnCode == 200) {
+                // 订单类型为正常订单、非赠品订单、店铺结算类型为:现结订单;需要输入流水号或者上传支付凭证
+                var isShowPaymentVoucherRow = salesOrderStatus == 1 && salesGive == 1 && data.returnMsg.paymentVoucher == 2;
+                if (data.returnMsg.paymentVoucher != null && isShowPaymentVoucherRow) {
+                    $('#paymentVoucherRow').show();
+                    isShowPaymentVoucher = true;
+                } else {
+                    $('#paymentVoucherRow').hide();
+                    isShowPaymentVoucher = false;
+                }
+            }
+        },
+        error: function(XmlHttpRequest, textStatus, errorThrown){
+        }
+    });
+}
+
 var isSalesStore = true;
 var isSalesAmountTest = false;
 var isReq = false;
@@ -118,6 +160,16 @@ $(function(){
                 $("#give-sales-order-input").val("");
             }
 
+            // 支付凭证数据
+            if (isShowPaymentVoucher) {
+                var salesPaymentNo = $('#salesPaymentNo').val();
+                var salesPaymentVoucher = $('#salesPaymentVoucher').val();
+                if ((salesPaymentNo == null || salesPaymentNo == '') && (salesPaymentVoucher == null || salesPaymentVoucher == '')) {
+                    layer.msg("请填写支付流水号或者上传支付凭证", {icon: 5, time: 3000});
+                    return false;
+                }
+            }
+
             //检测颜色与店铺之间关系
             if(!storeProductColor()){
                 vailErrorMsg_3($("#product_color"),"店铺与商品信息不匹配!");