admin
2020-11-10 e130e13ef0cc4a827aa2c8d9e47d619a4cea40d0
childPath/dingDan/dingDan.html
@@ -1,393 +1,710 @@
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8" />
      <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
      <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
      <title>订单总览</title>
      <link rel="stylesheet" type="text/css" href="../../css/doui.min.css"/>
      <script src="../../js/doui.min.js" type="text/javascript" charset="utf-8"></script>
      <script src="../../js/requestHost.js" type="text/javascript" charset="utf-8"></script>
      <script type="text/javascript">
         doui.importLoad({
            importArray: [
               // 雷打不动
               getHostPath() + "js/jquery.min.js",
               getHostPath() + "js/vue.min.js",
               // 字体图标
               getHostPath() + "fontAdmin/iconfont.css",
               getHostPath() + "font/iconfont.css",
               // dom模板
               getHostPath() + "css/admin-all.css",
               getHostPath() + "js/admin-creat.js",
            ],
         });
      </script>
   </head>
   <body class="fontPC" style="display:none;">
      <div class="winSizeBox">
         <!-- =============================================================== 搜索筛选(顶部) -->
         <div id="thisHeader" style="width:7.5rem;"></div>
         <!-- =============================================================== 表格 -->
         <div id="thisTable" class="admin-main-overHeader"></div>
         <!-- =============================================================== 文件上传 弹框 -->
         <div v-show="fileWork.show" id="fileUpload" class="layer-dark fboxRow Xcenter Ycenter">
            <div class="admin-tan-box" style="height:auto;">
               <!-- 关闭按钮 -->
               <div class="admin-btn-arcS admin-tan-close" @click="fileWork.action_close()"><i class="fi fi-no"></i></div>
               <!-- 标题 -->
               <div class="fboxRow Xcenter Ycenter admin-margin"><div class="font18 font-blue">文件上传</div></div>
               <!-- 文件选择 -->
               <div class="fboxRow Xcenter Ycenter admin-margin">
                  <div class="font-cyan">订单表格:</div>
                  <div class="inputShell border-1px border-round" style="width:1.2rem;">
                     <input id="myimg" type="file" accept="application/vnd.ms-excel" @change="fileWork.action_change()"/>
                  </div>
               </div>
               <!-- 提交 按钮 -->
               <div class="fboxRow Xcenter Ycenter admin-margin">
                  <div class="admin-btn-roundL bg-green click-scale" @click="fileWork.action_sub()">确定上传</div>
               </div>
            </div>
         </div>
      </div>
   </body>
</html>
<script type="text/javascript">
   // 文件上传vue
   var vm_file = null;
   // ==================================================================================== 页面数据
   doui.onReady({
      success: function ()
      {
         // ----------------------------------------------------- 顶部
         // 创建顶部dom
         adminDom.header.creat({ el: "#thisHeader", });
         // 输入类型
         adminDom.header.select({
            show: true,
            list: [
               { key: "1", value: "订单号" },
               { key: "2", value: "用户ID" },
            ],
         });
         // 输入搜索
         adminDom.header.input({ placeholder: "根据选择填写", })
         // 筛选项
         adminDom.header.screen({
            show: true,
            list: [
               {
                  title: "订单类型",
                  muchCheck: false, // 是否可以多选
                  child: [
                     { key: [1], value: "自购订单", check: false },
                     { key: [2], value: "分享订单", check: false },
                     { key: [3], value: "团队订单", check: false },
                  ],
                  input: { type: "number", num: 0 },
               },
               {
                  title: "订单状态",
                  muchCheck: false, // 是否可以多选
                  child: [
                     { key: [1], value: "有效", check: false },
                     { key: [2], value: "售后", check: false },
                     { key: [3], value: "失效", check: false },
                  ],
                  input: { type: "number", num: 0 },
               },
               {
                  title: "到账状态",
                  muchCheck: false, // 是否可以多选
                  child: [
                     { key: [1], value: "未到账", check: false },
                     { key: [2], value: "已到账", check: false },
                     { key: [3], value: "已失效", check: false },
                  ],
                  input: { type: "number", num: 0 },
               },
               {
                  title: "支付时间",
                  muchCheck: false, // 是否可以多选
                  child: [],
                  input: { type: "date", num: 2 },
               },
               {
                  title: "渠道来源",
                  muchCheck: false, // 是否可以多选
                  child: [
                     { key: [1], value: "淘宝", check: false },
                     { key: [2], value: "京东", check: false },
                     { key: [3], value: "拼多多", check: false },
                  ],
                  input: { type: "number", num: 0 },
               },
               {
                  title: "订单风险",
                  muchCheck: false, // 是否可以多选
                  child: [
                     { key: [1], value: "同商品", check: false },
                     { key: [2], value: "同店铺", check: false },
                     { key: [3], value: "高额返利", check: false },
                  ],
                  input: { type: "number", num: 0 },
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8" />
      <meta http-equiv="X-UA-Compatible" content="chrome=1" />
      <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
      <title>订单总览</title>
      <link rel="stylesheet" type="text/css" href="../../css/doui.min.css" />
      <script src="../../js/doui.min.js" type="text/javascript" charset="utf-8"></script>
      <script src="../../js/requestHost.js" type="text/javascript" charset="utf-8"></script>
      <script type="text/javascript">
         doui.importLoad({
            importArray: [
               // 雷打不动
               getHostPath() + "js/jquery.min.js",
               getHostPath() + "js/vue.min.js",
               // 字体图标
               getHostPath() + "fontAdmin/iconfont.css",
               getHostPath() + "font/iconfont.css",
               // dom模板
               getHostPath() + "css/admin-all.css",
               getHostPath() + "js/admin-creat.js",
            ],
         });
      </script>
   </head>
   <body class="fontPC" style="display:none;">
      <div class="winSizeBox">
         <!-- =============================================================== 搜索筛选(顶部) -->
         <div id="thisHeader" style="width:7.5rem;"></div>
         <!-- =============================================================== 表格 -->
         <div id="thisTable" class="admin-main-overHeader"></div>
         <!-- =============================================================== 文件上传 弹框 -->
         <div v-show="fileWork.show" id="fileUpload" class="layer-dark fboxRow Xcenter Ycenter">
            <div class="admin-tan-box" style="height:auto;">
               <!-- 关闭按钮 -->
               <div class="admin-btn-arcS admin-tan-close" @click="fileWork.action_close()"><i class="fi fi-no"></i></div>
               <!-- 标题 -->
               <div class="fboxRow Xcenter Ycenter admin-margin">
                  <div class="font18 font-blue">文件上传</div>
               </div>
               <!-- 文件选择 -->
               <div class="fboxRow Xcenter Ycenter admin-margin">
                  <div class="font-cyan">订单表格:</div>
                  <div class="inputShell border-1px border-round" style="width:1.2rem;">
                     <input id="myimg" type="file" accept="application/vnd.ms-excel" @change="fileWork.action_change()" />
                  </div>
               </div>
               <!-- 提交 按钮 -->
               <div class="fboxRow Xcenter Ycenter admin-margin">
                  <div class="admin-btn-roundL bg-green click-scale" @click="fileWork.action_sub()">确定上传</div>
               </div>
            </div>
         </div>
      </div>
   </body>
</html>
<script type="text/javascript">
   // 文件上传vue
   var vm_file = null;
   // ==================================================================================== 页面数据
   doui.onReady({
      success: function() {
         // ----------------------------------------------------- 顶部
         // 创建顶部dom
         adminDom.header.creat({
            el: "#thisHeader",
         });
         // 输入类型
         adminDom.header.select({
            show: true,
            list: [{
                  key: "1",
                  value: "订单号"
               },
               {
                  title: "付款金额(最大值)",
                  muchCheck: false, // 是否可以多选
                  child: [],
                  input: { type: "number", num: 1 },
               },
            ],
         });
         // ----------------------------------------------------- 表格
         // 创建表格dom
         adminDom.table.creat({
            el: "#thisTable",
            touchSearch: function(optC)
            {
               // 发起请求
               doui.showLoading({ content: "加载列表" });
               doui.request({
                  type: "jsonp",
                  url: gethttp() + "/admin/new/api/v1/order/getUserOrderList",
                  data: {
                     pageIndex: optC.table.page, // 页码
                     pageSize: optC.table.pageSize, // 每页数量
                     keyType: optC.select.result, // 搜索类型
                     key: optC.input[0].result, // 搜索关键字
                     type: optC.screen[0].result[0], // 订单类型
                     orderState: optC.screen[1].result[0], // 订单状态
                     state: optC.screen[2].result[0], // 到账状态
                     startTime: optC.screen[3].result[0], // 时间最小
                     endTime: optC.screen[3].result[1]?optC.screen[3].result[1]:'', // 时间最大
                     sourceType:optC.screen[4].result[0],
                     riskType:optC.screen[5].result[0],
                     payment: optC.screen[6].result[0], // 付款金额
                  },
                  success: function (res)
                  {
                     doui.hideLoading();
                     if (res.code != 0) { doui.showToast({ content: res.msg }); }
                     else
                     {
                        // 申明 表格内容数据
                        var mo_tr = []; // tr组
                        for (var i = 0, mo = res.data.result_list; i < mo.length; i++)
                        {
                           // 当前行
                           var thatTr = {
                              check: false,
                              td: [
                                 { title: "商品图片", key: mo[i].commonOrderGoods?mo[i].commonOrderGoods.picture:"", value: mo[i].commonOrderGoods?mo[i].commonOrderGoods.picture:"", dataType: "img" },
                                 { title: "商品标题", key:mo[i].commonOrderGoods.goodsId, value: mo[i].commonOrderGoods.title ,dataType:'link'},
                                 { title: "订单号", key: mo[i].orderNo, value: mo[i].orderNo },
                                 { title: "订单类型", key: mo[i].hongBaoType, value: mo[i].hongBaoType },
                                 { title: "支付金额", key: mo[i].payment, value: "¥"+mo[i].payment },
                                 { title: "支付时间", key: mo[i].downTime, value: mo[i].downTime, "class": "font13 font-gray" },
                                 { title: "订单状态", key: mo[i].state, value: mo[i].state },
                                 { title: "收货时间", key: mo[i].receiveTime, value: mo[i].receiveTime, "class": "font13 font-gray" },
                                 { title: "收益金额", key: mo[i].hongBao, value: "¥"+mo[i].hongBao },
                                 { title: "收益状态", key: mo[i].hongBaoState, value: mo[i].hongBaoState },
                                 { title: "收益时间", key: mo[i].hongBaoDate, value: mo[i].hongBaoDate, "class": "font13 font-gray" },
                                 { title: "用户头像", key: mo[i].userPortrait, value: mo[i].userPortrait, dataType: "img", "class": "admin-imgS" },
                                 { title: "用户昵称", key: mo[i].userName, value: mo[i].userName },
                                 { title: "用户ID", key: mo[i].userId, value: mo[i].userId },
                                 { title: "直接邀请人", key: mo[i].levelOneId, value: "ID:"+mo[i].levelOneId+"  ¥"+mo[i].levelOneMoney },
                                 { title: "间接邀请人", key: mo[i].levelTwoId, value: "ID:"+mo[i].levelTwoId+"  ¥"+mo[i].levelTwoMoney },
                                 { title: "一级分类", key:mo[i].commonOrderGoods.category1, value: mo[i].commonOrderGoods.category1},
                              ],
                           };
                           // 订单类型
                           if (thatTr.td[3].key == 1) { thatTr.td[3].value = "自购"; thatTr.td[3]["class"] = "font-blue"; }
                           else if (thatTr.td[3].key == 2) { thatTr.td[3].value = "分享"; thatTr.td[3]["class"] = "font-green"; }
                           else if (thatTr.td[3].key == 3) { thatTr.td[3].value = "团队"; thatTr.td[3]["class"] = "font-green"; }
                           //渠道标识
                           // 订单号分析
                           if (i >= 1)
                           {
                              if (thatTr.td[2].key == mo[i-1].orderNo) { thatTr.td[2].value = "(同上)"; thatTr.td[2]["class"] = "font-gray"; }
                           }
                           //商品链接
                           if(mo[i].sourceType==1)
                           {
                              thatTr.td[3].value=thatTr.td[3].value+" (淘宝)";
                              thatTr.td[1].key="https://detail.tmall.com/item.htm?id="+thatTr.td[1].key;
                           }
                           else if(mo[i].sourceType==2)
                           {
                              thatTr.td[3].value=thatTr.td[3].value+" (京东)";
                              thatTr.td[1].key="https://item.jd.com/"+thatTr.td[1].key+".html";
                           }
                           else if(mo[i].sourceType==3)
                           {
                              thatTr.td[3].value=thatTr.td[3].value+" (拼多多)";
                              thatTr.td[1].key="http://yangkeduo.com/goods.html?goods_id="+thatTr.td[1].key;
                           }
                           // 订单状态
                           if (thatTr.td[6].key == 1) { thatTr.td[6].value = "已付款"; thatTr.td[6]["class"] = "font-orange"; }
                           else if (thatTr.td[6].key == 2) { thatTr.td[6].value = "已收货"; thatTr.td[6]["class"] = "font-green"; }
                           else if (thatTr.td[6].key == 3) {
                              var drawbackMoney="";
                              if(mo[i].weiQuanBackMoney!=null&&mo[i].weiQuanBackMoney!=undefined)
                              {
                                 if(mo[i].weiQuanBackMoney>0)
                                 {
                                    drawbackMoney="已扣除:"+mo[i].weiQuanBackMoney;
                                 }else{
                                    drawbackMoney="未扣除:"+Math.abs(mo[i].weiQuanBackMoney);
                                 }
                              }
                              thatTr.td[6].value = "订单售后#"+ mo[i].weiQuanState+"#"+ drawbackMoney   ; thatTr.td[6]["class"] = "font-red";
                           }
                           else if (thatTr.td[6].key == 4) { thatTr.td[6].value = "已失效"; thatTr.td[6]["class"] = "font-gray"; }
                           if(mo[i].otherState==1)
                           {
                              thatTr.td[6].value=thatTr.td[6].value+"(免单中)";
                  key: "2",
                  value: "用户ID"
               },
            ],
         });
         // 输入搜索
         adminDom.header.input({
            placeholder: "根据选择填写",
         })
         var choiceList = [{
               title: "订单类型",
               muchCheck: true, // 是否可以多选
               child: [{
                     key: [1],
                     value: "自购订单",
                     check: false
                  },
                  {
                     key: [2],
                     value: "分享订单",
                     check: false
                  },
                  {
                     key: [3],
                     value: "团队订单",
                     check: false
                  },
               ],
               input: {
                  type: "number",
                  num: 0
               },
            },
            {
               title: "订单状态",
               muchCheck: false, // 是否可以多选
               child: [{
                     key: [1],
                     value: "有效",
                     check: false
                  },
                  {
                     key: [2],
                     value: "售后",
                     check: false
                  },
                  {
                     key: [3],
                     value: "失效",
                     check: false
                  },
               ],
               input: {
                  type: "number",
                  num: 0
               },
            },
            {
               title: "到账状态",
               muchCheck: false, // 是否可以多选
               child: [{
                     key: [1],
                     value: "未到账",
                     check: false
                  },
                  {
                     key: [2],
                     value: "已到账",
                     check: false
                  },
                  {
                     key: [3],
                     value: "已失效",
                     check: false
                  },
               ],
               input: {
                  type: "number",
                  num: 0
               },
            },
            {
               title: "支付时间",
               muchCheck: false, // 是否可以多选
               child: [],
               input: {
                  type: "date",
                  num: 2
               },
            },
            {
               title: "渠道来源",
               muchCheck: false, // 是否可以多选
               child: [{
                     key: [1],
                     value: "淘宝",
                     check: false
                  },
                  {
                     key: [2],
                     value: "京东",
                     check: false
                  },
                  {
                     key: [3],
                     value: "拼多多",
                     check: false
                  },
                  {
                     key: [4],
                     value: "唯品会",
                     check: false
                  },
                  {
                     key: [5],
                     value: "苏宁",
                     check: false
                  },
               ],
               input: {
                  type: "number",
                  num: 0
               },
            },
            {
               title: "订单风险",
               muchCheck: false, // 是否可以多选
               child: [{
                     key: [1],
                     value: "同商品",
                     check: false
                  },
                  {
                     key: [2],
                     value: "同店铺",
                     check: false
                  },
                  {
                     key: [3],
                     value: "高额返利",
                     check: false
                  },
               ],
               input: {
                  type: "number",
                  num: 0
               },
            },
            {
               title: "付款金额(最大值)",
               muchCheck: false, // 是否可以多选
               child: [],
               input: {
                  type: "number",
                  num: 1,
                  value:''
               },
            }
         ];
         // 筛选项
         adminDom.header.screen({
            show: true,
            list: choiceList,
            btns:[{name:'刷单风险',actionClick:function(){
                  choiceList[0].child[0].check=true;
                  choiceList[0].child[1].check=true
                  choiceList[1].child[0].check=true;
                  choiceList[4].child[0].check=true;
                  choiceList[6].input.value="9";
            }},{name:'清除所选',actionClick:function(){
               choiceList[0].child[0].check=false;
               choiceList[0].child[1].check=false
               choiceList[1].child[0].check=false;
               choiceList[4].child[0].check=false;
               choiceList[6].input.value="";
            }}]
         });
         // setTimeout(function(){
         //    choiceList[0].child[0].check=true;
         // },10000);
         // ----------------------------------------------------- 表格
         // 创建表格dom
         adminDom.table.creat({
            el: "#thisTable",
            touchSearch: function(optC) {
               // 发起请求
               doui.showLoading({
                  content: "加载列表"
               });
               var types=optC.screen[0].result;
               console.log("订单类型:"+optC.screen[0].result);
               doui.request({
                  type: "jsonp",
                  url: gethttp() + "/admin/new/api/v1/order/getUserOrderList",
                  data: {
                     pageIndex: optC.table.page, // 页码
                     pageSize: optC.table.pageSize, // 每页数量
                     keyType: optC.select.result, // 搜索类型
                     key: optC.input[0].result, // 搜索关键字
                     type: types, // 订单类型
                     orderState: optC.screen[1].result[0], // 订单状态
                     state: optC.screen[2].result[0], // 到账状态
                     startTime: optC.screen[3].result[0], // 时间最小
                     endTime: optC.screen[3].result[1] ? optC.screen[3].result[1] : '', // 时间最大
                     sourceType: optC.screen[4].result[0],
                     riskType: optC.screen[5].result[0],
                     payment: optC.screen[6].result[0], // 付款金额
                  },
                  success: function(res) {
                     doui.hideLoading();
                     if (res.code != 0) {
                        doui.showToast({
                           content: res.msg
                        });
                     } else {
                        // 申明 表格内容数据
                        var mo_tr = []; // tr组
                        for (var i = 0, mo = res.data.result_list; i < mo.length; i++) {
                           // 当前行
                           var thatTr = {
                              check: false,
                              td: [{
                                    title: "商品图片",
                                    key: mo[i].commonOrderGoods ? mo[i].commonOrderGoods.picture : "",
                                    value: mo[i].commonOrderGoods ? mo[i].commonOrderGoods.picture : "",
                                    dataType: "img"
                                 },
                                 {
                                    title: "商品标题",
                                    key: mo[i].commonOrderGoods.goodsId,
                                    value: mo[i].commonOrderGoods.title,
                                    dataType: 'link'
                                 },
                                 {
                                    title: "订单号",
                                    key: mo[i].orderNo,
                                    value: mo[i].orderNo
                                 },
                                 {
                                    title: "订单类型",
                                    key: mo[i].hongBaoType,
                                    value: mo[i].hongBaoType
                                 },
                                 {
                                    title: "支付金额",
                                    key: mo[i].payment,
                                    value: "¥" + mo[i].payment
                                 },
                                 {
                                    title: "支付时间",
                                    key: mo[i].downTime,
                                    value: mo[i].downTime,
                                    "class": "font13 font-gray"
                                 },
                                 {
                                    title: "订单状态",
                                    key: mo[i].state,
                                    value: mo[i].state
                                 },
                                 {
                                    title: "收货时间",
                                    key: mo[i].receiveTime,
                                    value: mo[i].receiveTime,
                                    "class": "font13 font-gray"
                                 },
                                 {
                                    title: "收益金额",
                                    key: mo[i].hongBao,
                                    value: "¥" + mo[i].hongBao
                                 },
                                 {
                                    title: "收益状态",
                                    key: mo[i].hongBaoState,
                                    value: mo[i].hongBaoState
                                 },
                                 {
                                    title: "收益时间",
                                    key: mo[i].hongBaoDate,
                                    value: mo[i].hongBaoDate,
                                    "class": "font13 font-gray"
                                 },
                                 {
                                    title: "用户头像",
                                    key: mo[i].userPortrait,
                                    value: mo[i].userPortrait,
                                    dataType: "img",
                                    "class": "admin-imgS"
                                 },
                                 {
                                    title: "用户昵称",
                                    key: mo[i].userName,
                                    value: mo[i].userName
                                 },
                                 {
                                    title: "用户ID",
                                    key: mo[i].userId,
                                    value: mo[i].userId
                                 },
                                 {
                                    title: "直接邀请人",
                                    key: mo[i].levelOneId,
                                    value: "ID:" + mo[i].levelOneId + "  ¥" + mo[i].levelOneMoney
                                 },
                                 {
                                    title: "间接邀请人",
                                    key: mo[i].levelTwoId,
                                    value: "ID:" + mo[i].levelTwoId + "  ¥" + mo[i].levelTwoMoney
                                 },
                                 {
                                    title: "一级分类",
                                    key: mo[i].commonOrderGoods.category1,
                                    value: mo[i].commonOrderGoods.category1
                                 },
                              ],
                           };
                           // 订单类型
                           if (thatTr.td[3].key == 1) {
                              thatTr.td[3].value = "自购";
                              thatTr.td[3]["class"] = "font-blue";
                           } else if (thatTr.td[3].key == 2) {
                              thatTr.td[3].value = "分享";
                              thatTr.td[3]["class"] = "font-green";
                           } else if (thatTr.td[3].key == 3) {
                              thatTr.td[3].value = "团队";
                              thatTr.td[3]["class"] = "font-green";
                           }
                           //渠道标识
                           // 订单号分析
                           if (i >= 1) {
                              if (thatTr.td[2].key == mo[i - 1].orderNo) {
                                 thatTr.td[2].value = "(同上)";
                                 thatTr.td[2]["class"] = "font-gray";
                              }
                           }
                           //商品链接
                           if (mo[i].sourceType == 1) {
                              thatTr.td[3].value = thatTr.td[3].value + " (淘宝)";
                              thatTr.td[1].key = "https://detail.tmall.com/item.htm?id=" + thatTr.td[1].key;
                           } else if (mo[i].sourceType == 2) {
                              thatTr.td[3].value = thatTr.td[3].value + " (京东)";
                              thatTr.td[1].key = "https://item.jd.com/" + thatTr.td[1].key + ".html";
                           } else if (mo[i].sourceType == 3) {
                              thatTr.td[3].value = thatTr.td[3].value + " (拼多多)";
                              thatTr.td[1].key = "http://yangkeduo.com/goods.html?goods_id=" + thatTr.td[1].key;
                           }
                           // 订单状态
                           if (thatTr.td[6].key == 1) {
                              thatTr.td[6].value = "已付款";
                              thatTr.td[6]["class"] = "font-orange";
                           }else if(mo[i].otherState==2)
                           {
                              thatTr.td[6].value=thatTr.td[6].value+"(免单成功)";
                           } else if (thatTr.td[6].key == 2) {
                              thatTr.td[6].value = "已收货";
                              thatTr.td[6]["class"] = "font-green";
                           } else if (thatTr.td[6].key == 5) {
                              thatTr.td[6].value = "已收货,待入账";
                              thatTr.td[6]["class"] = "font-green";
                           } else if (thatTr.td[6].key == 3) {
                              var drawbackMoney = "";
                              if (mo[i].weiQuanBackMoney != null && mo[i].weiQuanBackMoney != undefined) {
                                 if (mo[i].weiQuanBackMoney > 0) {
                                    drawbackMoney = "已扣除:" + mo[i].weiQuanBackMoney;
                                 } else {
                                    drawbackMoney = "未扣除:" + Math.abs(mo[i].weiQuanBackMoney);
                                 }
                              }
                              thatTr.td[6].value = "订单售后#" + mo[i].weiQuanState + "#" + drawbackMoney;
                              thatTr.td[6]["class"] = "font-red";
                           } else if (thatTr.td[6].key == 4) {
                              thatTr.td[6].value = "已失效";
                              thatTr.td[6]["class"] = "font-gray";
                           }
                           if (mo[i].otherState == 1) {
                              thatTr.td[6].value = thatTr.td[6].value + "(免单中)";
                              thatTr.td[6]["class"] = "font-orange";
                           } else if (mo[i].otherState == 2) {
                              thatTr.td[6].value = thatTr.td[6].value + "(免单成功)";
                              thatTr.td[6]["class"] = "font-orange";
                           }
                           // 收益状态
                           if (thatTr.td[9].key == 1) { thatTr.td[9].value = "未到账"; thatTr.td[9]["class"] = "font-orange"; }
                           else if (thatTr.td[9].key == 2) { thatTr.td[9].value = "已到账"; thatTr.td[9]["class"] = "font-green"; }
                           else if (thatTr.td[9].key == 3) { thatTr.td[9].value = "已失效"; thatTr.td[9]["class"] = "font-gray"; }
                           // 受益人分析
                           if (!thatTr.td[14].key) { thatTr.td[14].value = "(无)"; thatTr.td[14]["class"] = "font-gray"; }
                           if (!thatTr.td[15].key) { thatTr.td[15].value = "(无)"; thatTr.td[15]["class"] = "font-gray"; }
                           // 收益状态
                           if (thatTr.td[9].key == 1) {
                              thatTr.td[9].value = "未到账";
                              thatTr.td[9]["class"] = "font-orange";
                           } else if (thatTr.td[9].key == 2) {
                              thatTr.td[9].value = "已到账";
                              thatTr.td[9]["class"] = "font-green";
                           } else if (thatTr.td[9].key == 3) {
                              thatTr.td[9].value = "已失效";
                              thatTr.td[9]["class"] = "font-gray";
                           }
                           // 受益人分析
                           if (!thatTr.td[14].key) {
                              thatTr.td[14].value = "(无)";
                              thatTr.td[14]["class"] = "font-gray";
                           }
                           if (!thatTr.td[15].key) {
                              thatTr.td[15].value = "(无)";
                              thatTr.td[15]["class"] = "font-gray";
                           }
                           if (mo[i].commonOrderGoods.category3 != null && mo[i].commonOrderGoods.category3.length > 0) {
                              thatTr.td[16].value = mo[i].commonOrderGoods.category3;
                           } else if (mo[i].commonOrderGoods.category2 != null && mo[i].commonOrderGoods.category2.length > 0) {
                              thatTr.td[16].value = mo[i].commonOrderGoods.category2;
                           }
                           // 将当前行放入tr组
                           mo_tr.push(thatTr);
                        }
                        // 更新表格的数据
                        adminDom.table.opt({ pageMax: res.data.pe.totalPage }); // 最大页码
                        adminDom.table.tbody({ tr: mo_tr }); // 内容数据
                     }
                  }
               });
            }
         });
         // 表格设置
         adminDom.table.opt({ showCheck: false, pageSize: 20, });
         // 表格头排
         adminDom.table.thead({
            th: [
               { title: "商品图片", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "商品标题", width: "1rem", orderUp: "", orderDown: "" },
               { title: "订单号", width: "1rem", orderUp: "", orderDown: "" },
               { title: "订单类型", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "支付金额", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "支付时间", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "订单状态", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "收货时间", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "收益金额", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "收益状态", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "收益时间", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "用户头像", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "用户昵称", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "用户ID", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "直接邀请人", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "间接邀请人", width: "0.6rem", orderUp: "", orderDown: "" },
               { title: "商品分类", width: "0.6rem", orderUp: "", orderDown: "" },
            ]
         });
         // 工具栏
         adminDom.table.tools({
            show: true,
            list: [
               { "title": "上传订单", "name": "add", "icon": "fi fi-cloud-upload" },
            ],
            touch: function (back)
            {
               // 上传订单
               if (back.toolName == "add")
               {
                  // 显示弹框
                  vm_file.fileWork.show = true;
               }
            },
         });
         // ----------------------------------------------------- 文件上传弹框
         vm_file = new Vue({
            el: "#fileUpload",
            data: {
               // 文件工作
               fileWork: {
                  show: false, // 是否显示
                  "file": null,
                  // 关闭按钮
                  action_close: function () { vm_file.fileWork["file"] = null; $("#myimg").val(); vm_file.fileWork.show = false; },
                  // 文件改变
                  action_change: function () { vm_file.fileWork["file"] = $("#myimg")[0].files[0]; },
                  // 确定上传按钮 点击
                  action_sub: function ()
                  {
                     if (vm_file.fileWork["file"])
                     {
                        // 发情请求
                        doui.showLoading("正在上传");
                        doui.upload({
                           url: gethttp() + "/admin/new/api/v1/upload/uploadOrderFile",
                           data: {
                              file: vm_file.fileWork["file"],
                           },
                           // 进度
                           progress: function (res) { doui.showLoading("已上传"+res.percentage); },
                           // 成功
                           success: function (res)
                           {
                              doui.hideLoading();
                              if (res.code != 0) { doui.showToast(res.msg); }
                              else { vm_file.fileWork.action_close(); doui.showToast("上传成功"); vm_table.search(); }
                           },
                        });
                     }
                     else { doui.showToast("请选择文件"); }
                  },
               },
            },
         });
         // ----------------------------------------------------- 初始行为
         // 模拟搜索点击
         vm_table.search();
         document.body.style.display = "block";
      }
   });
</script>
                           }
                           // 将当前行放入tr组
                           mo_tr.push(thatTr);
                        }
                        // 更新表格的数据
                        adminDom.table.opt({
                           pageMax: res.data.pe.totalPage
                        }); // 最大页码
                        adminDom.table.tbody({
                           tr: mo_tr
                        }); // 内容数据
                     }
                  }
               });
            }
         });
         // 表格设置
         adminDom.table.opt({
            showCheck: false,
            pageSize: 20,
         });
         // 表格头排
         adminDom.table.thead({
            th: [{
                  title: "商品图片",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "商品标题",
                  width: "1rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "订单号",
                  width: "1rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "订单类型",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "支付金额",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "支付时间",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "订单状态",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "收货时间",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "收益金额",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "收益状态",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "收益时间",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "用户头像",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "用户昵称",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "用户ID",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "直接邀请人",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "间接邀请人",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
               {
                  title: "商品分类",
                  width: "0.6rem",
                  orderUp: "",
                  orderDown: ""
               },
            ]
         });
         // 工具栏
         adminDom.table.tools({
            show: true,
            list: [{
               "title": "上传订单",
               "name": "add",
               "icon": "fi fi-cloud-upload"
            }, ],
            touch: function(back) {
               // 上传订单
               if (back.toolName == "add") {
                  // 显示弹框
                  vm_file.fileWork.show = true;
               }
            },
         });
         // ----------------------------------------------------- 文件上传弹框
         vm_file = new Vue({
            el: "#fileUpload",
            data: {
               // 文件工作
               fileWork: {
                  show: false, // 是否显示
                  "file": null,
                  // 关闭按钮
                  action_close: function() {
                     vm_file.fileWork["file"] = null;
                     $("#myimg").val();
                     vm_file.fileWork.show = false;
                  },
                  // 文件改变
                  action_change: function() {
                     vm_file.fileWork["file"] = $("#myimg")[0].files[0];
                  },
                  // 确定上传按钮 点击
                  action_sub: function() {
                     if (vm_file.fileWork["file"]) {
                        // 发情请求
                        doui.showLoading("正在上传");
                        doui.upload({
                           url: gethttp() + "/admin/new/api/v1/upload/uploadOrderFile",
                           data: {
                              file: vm_file.fileWork["file"],
                           },
                           // 进度
                           progress: function(res) {
                              doui.showLoading("已上传" + res.percentage);
                           },
                           // 成功
                           success: function(res) {
                              doui.hideLoading();
                              if (res.code != 0) {
                                 doui.showToast(res.msg);
                              } else {
                                 vm_file.fileWork.action_close();
                                 doui.showToast("上传成功");
                                 vm_table.search();
                              }
                           },
                        });
                     } else {
                        doui.showToast("请选择文件");
                     }
                  },
               },
            },
         });
         // ----------------------------------------------------- 初始行为
         // 模拟搜索点击
         vm_table.search();
         document.body.style.display = "block";
      }
   });
</script>