| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
| <head> | 
|     <meta charset="utf-8"> | 
|     <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
|     <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
|     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|     <meta name="viewport" | 
|           content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> | 
|     <meta http-equiv="Cache-Control" content="no-siteapp"/> | 
|     <!-- 本框架基本脚本和样式 --> | 
|     <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> | 
|     <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> | 
|     <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> | 
|     <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> | 
|   | 
|     <!-- 富文本编辑器 --> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/ueditor.config.js}"></script> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/ueditor.all.js}"> | 
|     </script> | 
|     <script type="text/javascript" charset="utf-8" | 
|             th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> | 
|     <style> | 
|         .paginationStyle{ | 
|             background: #ffffff; | 
|             padding: 10px 10px; | 
|             margin: 0px 0px 10px 0px; | 
|             text-align: right; | 
|         } | 
|     </style> | 
| </head> | 
|   | 
| <body> | 
| <div class="ibox-content" id="app" v-cloak> | 
|     <el-row style="padding: 10px;"> | 
|         <el-row :gutter="100"> | 
|             <el-col class="line" :span="8" style="text-align: center"> | 
|                 <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> | 
|                     <div>待计算金额</div> | 
|                     <div style="padding: 5px;font-size: 18px;">¥{{basicdetail.balance}}</div> | 
|                 </el-card > | 
|             </el-col> | 
|             <el-col class="line" :span="8" style="text-align: center"> | 
|                 <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> | 
|                     <div>待结算人数</div> | 
|                     <div style="padding: 5px;font-size: 18px;">{{basicdetail.waitNum}}人</div> | 
|                 </el-card > | 
|             </el-col> | 
|             <el-col class="line" :span="8" style="text-align: center"> | 
|                 <el-card class="box-card" style="background-color: #eee;border-radius: 30px;"> | 
|                     <div>待结算订单</div> | 
|                     <div style="padding: 5px;font-size: 18px;">{{basicdetail.waitOrderNum}}笔</div> | 
|                 </el-card > | 
|             </el-col> | 
|         </el-row> | 
|     </el-row> | 
|     <el-row> | 
|         <el-tabs v-model="activeName" > | 
|             <el-tab-pane label="分销订单" name="first"> | 
|                 <el-row justify="space-between" type="flex"> | 
|                     <el-col :span="6"> | 
|                         <el-button type="primary" @click="setOrderDone()">批量结算</el-button> | 
|                     </el-col> | 
|                     <el-col> | 
|                         <el-form ref="form" :model="form" inline > | 
|                             <el-form-item label="结算状态" prop="orderType"> | 
|                                 <el-select v-model="form.orderType" placeholder="结算状态"> | 
|                                     <el-option | 
|                                             v-for="item in orderTypeList" | 
|                                             :key="item.value" | 
|                                             :label="item.label" | 
|                                             :value="item.value" | 
|                                     > | 
|                                     </el-option> | 
|                                 </el-select> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="请输入推广员名称"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="选择订单时间范围"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="请输入会员姓名"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="请输入结算编号"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="请输入订单号"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item prop="userName" > | 
|                                 <el-input v-model="form.userName" placeholder="请输入客户名称"></el-input> | 
|                             </el-form-item> | 
|                             <el-button type="primary" @click="search" >搜索</el-button> | 
|                             <el-button @click="resetForm('form')">重置</el-button> | 
|                         </el-form> | 
|                     </el-col> | 
|                 </el-row> | 
|                 <el-row class="table-style" > | 
|                     <el-table ref="multipleTable" | 
|                               :data="fxyList.rows" | 
|                               :height="height" | 
|                               stripe:true | 
|                               @sort-change="sortChange" | 
|                               @selection-change="handleSelectionChange"> | 
|                         <el-table-column | 
|                                 type="selection"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="orderNo" | 
|                                 label="订单编号"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="actualBalance" | 
|                                 label="实付金额(元)"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="address" | 
|                                 label="下单门店"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="custom" | 
|                                 label="客户"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="parentSale" | 
|                                 label="推广员"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 label="收益类型"> | 
|                             <template slot-scope="scope"> | 
|                                 <span v-if="scope.row.profitType == 1">推广收益</span> | 
|                                 <span v-if="scope.row.profitType == 2">邀请收益</span> | 
|                             </template> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="profitBalance" | 
|                                 label="收益金额"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 label="结算状态"> | 
|                             <template slot-scope="scope"> | 
|                                 <span v-if="scope.row.settleType == 1">待结算</span> | 
|                                 <span v-if="scope.row.settleType == 2">已结算</span> | 
|                                 <span v-if="scope.row.settleType == 3">已退款</span> | 
|                             </template> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="settleNo" | 
|                                 label="结算编号"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="settleTime" | 
|                                 label="结算时间"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="settler" | 
|                                 label="结算人"> | 
|                         </el-table-column> | 
|                         <el-table-column label="操作" width="240"> | 
|                             <template slot-scope="scope"> | 
|                                 <el-row style="display:flex;"> | 
|                                     <el-button type="primary" size="mini" @click="openExaminesaleMan(scope.row)">查看订单</el-button> | 
|                                 </el-row> | 
|                             </template> | 
|                         </el-table-column> | 
|                     </el-table> | 
|                 </el-row> | 
|                 <el-row class="paginationStyle"  > | 
|                     <el-pagination background | 
|                                    @size-change="changePageSize" | 
|                                    @current-change="changeCurrentPage" | 
|                                    :current-page="fxyList.currentPage" | 
|                                    :page-sizes="[10, 20, 30, 50]" | 
|                                    :page-size="fxyList.pageSize" | 
|                                    layout="total, sizes, prev, pager, next, jumper" | 
|                                    :total="fxyList.total"> | 
|                     </el-pagination> | 
|                 </el-row> | 
|             </el-tab-pane> | 
|   | 
|             <el-tab-pane label="结算记录" name="second"> | 
|                 <el-row style="display:flex;align-items: center;text-align: right;"> | 
|                     <el-col> | 
|                         <el-form ref="formOrder" :model="formOrder" inline > | 
|                             <el-form-item prop="userName"> | 
|                                 <el-input v-model="formOrder.userName" placeholder="请输入结算人姓名"></el-input> | 
|                             </el-form-item> | 
|                             <el-button type="primary" @click="searchFormOrder" >搜索</el-button> | 
|                             <el-button @click="resetFormOrder('formOrder')">重置</el-button> | 
|                         </el-form> | 
|                     </el-col> | 
|                 </el-row> | 
|                 <el-row class="table-style" > | 
|                     <el-table :data="orderLevelList.rows"  :height="height" stripe:true  @sort-change="sortChange"> | 
|                         <el-table-column | 
|                                 prop="orderNo" | 
|                                 label="结算编号"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="actualBalance" | 
|                                 label="结算金额"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="setNum" | 
|                                 label="结算订单数"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="setManNum" | 
|                                 label="结算人数"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="setTime" | 
|                                 label="结算时间"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="setMan" | 
|                                 label="结算人"> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 label="结算方式"> | 
|                             <template slot-scope="scope"> | 
|                                 <span v-if="scope.row.settlementWay == 1">线下结算</span> | 
|                                 <span v-if="scope.row.settlementWay == 2">微信余额结算</span> | 
|                             </template> | 
|                         </el-table-column> | 
|                         <el-table-column | 
|                                 prop="remark" | 
|                                 label="备注"> | 
|                         </el-table-column> | 
|                     </el-table> | 
|                 </el-row> | 
|                 <el-row class="paginationStyle"  > | 
|                     <el-pagination background | 
|                                    @size-change="changePageSizeOrder" | 
|                                    @current-change="changeCurrentPageOrder" | 
|                                    :current-page="orderLevelList.currentPage" | 
|                                    :page-sizes="[10, 20, 30, 50]" | 
|                                    :page-size="orderLevelList.pageSize" | 
|                                    layout="total, sizes, prev, pager, next, jumper" | 
|                                    :total="orderLevelList.total"> | 
|                     </el-pagination> | 
|                 </el-row> | 
|             </el-tab-pane> | 
|         </el-tabs> | 
|     </el-row> | 
| </div> | 
| </body> | 
| <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> | 
| <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> | 
| <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> | 
| <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> | 
| <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> | 
| <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> | 
| <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> | 
|   | 
| <script> | 
|     //获取传输的USERID对象 | 
|     var userId = $.query.get("userId"); | 
|     var applyId = $.query.get("applyId"); | 
|   | 
|     var app = new Vue({ | 
|         el: '#app', | 
|         data: { | 
|             activeName: 'first', | 
|             height:'calc(100vh - 240px)', | 
|             //基本数据 | 
|             basicdetail:{}, | 
|             //--分销订单 | 
|             //选中操作 | 
|             multipleSelection: [], | 
|             orderIds:"", | 
|             orderNums:0, | 
|             // 条件查询结算状态 | 
|             orderTypeList:[ | 
|                 {value:'',label:'全部'}, | 
|                 {value:1,label:'待结算'}, | 
|                 {value:2,label:'已结算'}, | 
|                 {value:3,label:'已退款'} | 
|             ], | 
|             form:{ | 
|                 userName:'', | 
|                 orderType:'', | 
|                 order:'', | 
|                 sort:'' | 
|             }, | 
|             fxyList:{ | 
|                 rows:[], | 
|                 total:0, | 
|                 pageSize:10, | 
|                 currentPage:1, | 
|             }, | 
|             //--结算记录 | 
|             formOrder:{ | 
|                 userName:'', | 
|                 order:'', | 
|                 sort:'' | 
|             }, | 
|             orderLevelList:{ | 
|                 rows:[], | 
|                 total:0, | 
|                 pageSize:10, | 
|                 currentPage:1, | 
|             }, | 
|         }, | 
|         created: function () { | 
|             this.loadInfo(); | 
|         }, | 
|         mounted: function () { | 
|         }, | 
|         methods: { | 
|             //加载分类 | 
|             loadInfo() { | 
|                 let _this = this; | 
|                 _this.loadFenxiaoOrderBasic(); | 
|                 _this.loadFenxiaoOrderList(); | 
|             }, | 
|             //--基础数据 | 
|             loadFenxiaoOrderBasic() { | 
|                 let _this = this; | 
|                 let obj = {}; | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data:obj, | 
|                     url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderBasic', | 
|                     callback: function (data) { | 
|                         _this.basicdetail = data.mapInfo.basicdetail; | 
|                     } | 
|                 }); | 
|             }, | 
|             //--结算记录 | 
|             loadSetOrderList() { | 
|                 let _this = this; | 
|                 let data=_this.getRequestParamOrder(); | 
|                 data.pageSize=_this.orderLevelList.pageSize; | 
|                 data.pageNum=_this.orderLevelList.currentPage; | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data:data, | 
|                     url: basePath + '/fenXiao/fenXiaoOrder/loadSetOrderList', | 
|                     callback: function (data) { | 
|                         _this.orderLevelList.rows = data.rows; | 
|                         _this.orderLevelList.total = data.total; | 
|                     } | 
|                 }); | 
|             }, | 
|             //查询参数 | 
|             getRequestParamOrder(){ | 
|                 let _this = this; | 
|                 return   { | 
|                     userName:_this.formOrder.userName, | 
|                     order:_this.formOrder.order, | 
|                     sort:_this.formOrder.sort, | 
|                 } | 
|             }, | 
|             //查询 | 
|             searchFormOrder:function(){ | 
|                 this.orderLevelList.currentPage=1; | 
|                 this.loadSetOrderList(); | 
|             }, | 
|             //重置 | 
|             resetFormOrder(formName) { | 
|                 this.$refs[formName].resetFields(); | 
|             }, | 
|             changePageSizeOrder(val) { | 
|                 this.orderLevelList.pageSize = val; | 
|                 this.loadSetOrderList(); | 
|             }, | 
|             changeCurrentPageOrder(val) { | 
|                 this.orderLevelList.currentPage = val; | 
|                 this.loadSetOrderList(); | 
|             }, | 
|             //--分销订单 | 
|             loadFenxiaoOrderList() { | 
|                 let _this = this; | 
|                 let data=_this.getRequestParam(); | 
|                 data.pageSize=_this.fxyList.pageSize; | 
|                 data.pageNum=_this.fxyList.currentPage; | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data:data, | 
|                     url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderList', | 
|                     callback: function (data) { | 
|                         _this.fxyList.rows = data.rows; | 
|                         _this.fxyList.total = data.total; | 
|                     } | 
|                 }); | 
|             }, | 
|             //查询参数 | 
|             getRequestParam(){ | 
|                 let _this = this; | 
|                 return   { | 
|                     userName:_this.form.userName, | 
|                     order:_this.form.order, | 
|                     sort:_this.form.sort, | 
|                 } | 
|             }, | 
|             //查询 | 
|             search:function(){ | 
|                 this.fxyList.currentPage=1; | 
|                 this.loadFenxiaoOrderList(); | 
|             }, | 
|             //重置 | 
|             resetForm(formName) { | 
|                 this.$refs[formName].resetFields(); | 
|             }, | 
|             changePageSize(val) { | 
|                 this.fxyList.pageSize = val; | 
|                 this.loadFenxiaoOrderList(); | 
|             }, | 
|             changeCurrentPage(val) { | 
|                 this.fxyList.currentPage = val; | 
|                 this.loadFenxiaoOrderList(); | 
|             }, | 
|             //排序 | 
|             sortChange:function (column){ | 
|                 if(column.order){ | 
|                     if(column.order.indexOf("desc")){ | 
|                         this.form.order="desc"; | 
|                     }else{ | 
|                         this.form.order="asc"; | 
|                     } | 
|                     this.form.sort=column.prop; | 
|                     this.loadInfo(); | 
|                 } | 
|             }, | 
|             //选择 | 
|             handleSelectionChange(val) { | 
|                 let _this = this; | 
|                 _this.multipleSelection = val; | 
|                 //拼接出一个逗号隔开的字符串 | 
|                 let submitDate = ""; | 
|                 let orderNum = 0; | 
|                 for (let i = 0; i < _this.multipleSelection.length; i++) { | 
|                     let order = _this.multipleSelection[i]; | 
|                     let orderId = order.id; | 
|                     orderNum = orderNum + 1; | 
|                     submitDate = submitDate +orderId+","; | 
|                 } | 
|                 _this.orderIds = submitDate; | 
|                 _this.orderNums = orderNum; | 
|             }, | 
|             //批量结算 | 
|             setOrderDone() { | 
|                 if(this.orderNums > 0){ | 
|                     this.$confirm('是否结算选中的'+this.orderNums+'条数据?', '批量结算', { | 
|                         distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 | 
|                         confirmButtonText: '确认', | 
|                         cancelButtonText: '取消', | 
|                         type: 'info' | 
|                     }).then(() => { | 
|                         //通过 | 
|                         this.updateSetOrderDone(); | 
|                     }).catch(action => { | 
|                         //不通过 | 
|                         if(action === 'cancel'){ | 
|                             console.log("cancel"); | 
|                         }else{ | 
|                             //关闭按钮 | 
|                             console.log("close"); | 
|                         } | 
|                     }); | 
|                 }else{ | 
|                     this.$message({ | 
|                         message: '至少需要选中一条数据', | 
|                         type: 'warning' | 
|                     }); | 
|                 } | 
|             }, | 
|             updateSetOrderDone(){ | 
|                 let _this = this; | 
|                 let obj = { | 
|                     orderIds: _this.orderIds, | 
|                 } | 
|                 AjaxProxy.requst({ | 
|                     app: _this, | 
|                     data:obj, | 
|                     url: basePath + '/fenXiao/fenXiaoOrder/updateSetOrderDone', | 
|                     callback: function (data) { | 
|                         _this.$message.success(data.info); | 
|                         _this.loadFenxiaoOrderList(); | 
|                     } | 
|                 }); | 
|             }, | 
|         } | 
|     }) | 
| </script> | 
|   | 
| </body> | 
| </html> |