<!--订单列表-->
<template>
  <div class="b2bclassorder">
    <q-table
      :pagination="msg"
      :loading="loading"
      no-data-label="暂无相关数据"
      flat
      class="sticky-column-table"
      separator="none"
      :data="dataList"
      :columns="columns"
      row-key="Id"
    >
      <template v-slot:body-cell-OrderId="props">
        <q-td auto-width :props="props">
           <div style="color:var(--q-color-primary)"  @click="goOrderdetails(props.row,1)">
              {{ props.row.OrderId}}
           </div> 
        </q-td>
      </template>
      <template v-slot:body-cell-GuestList="props">
        <q-td auto-width :props="props" class="flex">
           <div class="q-ma-xs" v-for="(item,index) in props.row.GuestList" :key="index">
              {{item.GuestName}}
           </div> 
        </q-td>
      </template>
      <template v-slot:bottom>
      </template>
    </q-table>
    <!--修改课程订单-->
    <editorder-form v-if="isShowEditOrderForm" :save-obj="orderObj" :orderType="orderObj.OrderType"
      @close="closeOrderSaveForm" @success="refreshOrder" :isChaBan="isChaBan" :modityOrderType="newModityOrderType">
    </editorder-form>

    <!--修改留学就业订单-->
    <studyorder-form v-if="isShowStudyOrderForm" :save-obj="orderObj" :orderType="orderObj.OrderType"
      @close="closeOrderSaveForm" @success="refreshOrder" :modityOrderType="newModityOrderType">
    </studyorder-form>

    <!--修改订单备注-->
    <orderremark-form v-if="isShowRemarkOrderForm" :save-obj="orderObj" :remarkType="remarkType"
      @close="closeRemarkForm" @success="refreshOrder"></orderremark-form>

    <!--转交订单-->
    <transOrder-form v-if="isShowTransOrderForm" :save-obj="orderObj" :employeeList="EmployeeList"
      @close="closeTransOrderForm" @success="refreshOrder"></transOrder-form>

    <myOrder-form v-if="isShowmyorderForm" :save-obj="myorderObjOption" @close="closeMOSaveForm"></myOrder-form>

    <!--班级详情-->
    <classinfo-form v-if="isShowClassInfo" :seting-obj="classObjOption" :isShowEditBtn="isShowEditBtn"
      @close="closeClass" @success="refreshOrder">
    </classinfo-form>

    <!--退课申请-->
    <backclass-form v-if="isShowBackClassForm" :save-obj="orderObj" @close="closeBackClassForm" @success="refreshOrder">
    </backclass-form>

    <!-- 修改提成和额外奖励 -->
    <money-form v-if="isShowMoney" :data="moneyObj" :type="CommonType" @close="closeMoneyForm" @success="refreshOrder">
    </money-form>

    <!--续课申请-->
    <continueclass-form v-if="isShowContinueClass" :save-obj="orderObj" @close="closeContinueClassForm"
      @success="refreshOrder"></continueclass-form>

    <!-- 转班申请 -->
    <transferclass-form v-if="isShowTransferClass" :save-obj="orderObj" :ChangeType="ChangeType"
      @close="closeTransferClassForm" @success="refreshOrder"></transferclass-form>

    <!-- 查看报价单 -->
    <viewquotation-form v-if="isShowviewQuo" :rId="offerId" :isShowCancle="1" @close="closeQuota"
      @success="refreshOrder">
    </viewquotation-form>

    <!--合同信息-->
    <eduinfo-form v-if="isShowEduForm" :seting-obj="eduObj" @close="closeEdudia" @success="refreshPage" style="margin:0">
    </eduinfo-form>
    <div v-if="isShowContract" class="_show_img_box" @click="(isShowContract = false), (imgViewList = [])">
      <div style="
            position: absolute;
            max-width: 800px;
            height: auto;
            left: 50%;
            top: 50%;
            margin-left: -400px;
            margin-top: -300px;
          ">
        <el-image style="width: 100%; height: 100%" fit="cover" v-for="(item, index) in imgViewList" :key="index"
          :src="item" :preview-src-list="imgViewList">
        </el-image>
      </div>
    </div>
  </div>
</template>

<script>
  import editorderForm from '../../sale/editorder-form' //修改订单
  import studyorderForm from '../../sale/studyOrder-form' //留学就业订单
  import orderremarkForm from '../../sale/orderremark-form' //订单备注
  import transOrderForm from '../../sale/transOrder-form' //转交订单
  import backclassForm from '../../sale/backclass-form' //退课申请
  import moneyForm from '../../sale/money-form' //修改提成和额外奖励
  import myOrderForm from '../../../components/sale/myOrder-form'
  import classinfoForm from '../../../components/course/classinfo-form'; //班级信息
  import continueclassForm from '../../sale/continueclass-form' //续课申请
  import viewquotationForm from '../../sale/viewquotation-form' //报价单信息
  import transferclassForm from '../../sale/transferclass-form' //转班信息

  import eduinfoForm from '../../sale/eduinfo-form'

  import {
    setOrderHelpEnterId, //老师关联
    cancelClassOrder, //取消订单
    regressSourceClass, //拆分订单回到原班
    setStudyAboradOrderConfirm, //留学订单确认
  } from '../../../api/sale/sale'

  import {
    queryEmployee //员工列表
  } from '../../../api/users/user'
  import {
    SetOrderReceiveContract, //领取合同
    SetEducationContractAudit
  } from '../../../api/sale/contract'
  import {
    getTeacherDropDownList
  } from '../../../api/school/index'
  export default {
    components: {
      editorderForm,
      orderremarkForm,
      transOrderForm,
      myOrderForm,
      classinfoForm,
      backclassForm,
      moneyForm,
      continueclassForm,
      viewquotationForm,
      eduinfoForm,
      studyorderForm,
      transferclassForm
    },
    props: {
      //正常订单
      dataList: {
        type: Array,
        default: ()=>[]
      },
      //取消订单
      cancelList: {
        type: Array,
        default: null
      },
      //权限数据
      authObj: {
        type: Object,
      },
      //修改订单类型
      modityOrderType: {
        type: Number,
        default: 0, //1-销售修改，2-OP修改，3-总经理修改
      },
      isShowEditBtn: {
        type: Number,
        default: null
      },
      viewType: {
        type: Number,
        default: 0
      },
      //因为今天订单 取消了一些操作
      comefrom: { //来自 1是来自 学管今日订单
        type: Number,
        default: 0
      },
    },
    data() {
      return {
        isShowEditOrderForm: false, //是否显示订单修改
        isShowStudyOrderForm: false, //是否显示留学就业订单
        isShowRemarkOrderForm: false, //是否线下修改订单备注
        isShowTransOrderForm: false, //是否显示转交订单
        isShowBackClassForm: false, //是否显示退课申请
        isShowContinueClass: false, //是否显示续课申请
        orderObj: {}, //订单信息
        isShowCancel: false, //是否显示取消订单
        remarkType: 0, //备注类型
        isShowmyorderForm: false, //显示详情
        myorderObjOption: {}, //详情的数据
        classObjOption: null,
        isShowClassInfo: false, //是否显示课程信息
        isShowMoney: false, //是否显示修改提成和额外奖励
        moneyObj: {}, //额外提成
        CommonType: -1, //用于判断是修改提成还是额外奖励
        EmployeeList: [], //员工列表
        isShowviewQuo: false, //是否显示报价单
        offerId: 0, //报价单编号
        //权限显示对象
        AuthorityObj: {
          isShowName: true, //是否显示班级、留学就业产品名称【默认显示】
          isShowGuestBtn: 0, //是否显示学员名单新增按钮【0-不显示，1-显示】
          isShowFinanceBtn: false, //是否显示财务单据录入按钮【true显示，false不显示】
          isShowTransOrder: false, //是否显示转交订单【true显示，false不显示】
          isShowEditSale: false, //是否显示修改销售按钮【true显示，false不显示】
          isShowSaleRemark: false, //是否显示修改销售备注按钮
          isShowEducationRemark: false, //是否显示修改教务备注按钮
          isShowPrincipalRemark: false, //是否显示修改校长备注按钮
          isShowManagerRemark: false, //是都显示总经理备注
          isShowCommissionEdit: false, //是否显示修改提成按钮
          isShowRewardEdit: false, //是否显示修改额外提成按钮
          isShowBackClass: false, //是否显示退课按钮
          isShowRenewClass: false, //是否显示续课按钮
          isShowContract: true, //是否显示合同
          isShowEdit: true, //是否显示修改订单按钮
          isShowTransClassOrder: false, //是否显示转班按钮
          isShowSeparater: false, //是否显示分拆
          isshoworderconfirm: false, //留学的订单确认按钮
        },

        isShowEduForm: false, //是否显示新增修改合同弹窗
        eduObj: {}, //合同信息
        isShowPop: false, //是否显示查看合同
        showChooseStudent: false, //收款单据，是否显示单选学生
        chooseStudent: "", //收款单据，单选学生
        isShowReward: false, // 是否可以修改额外金额
        isEditOrder: false, //是否有【总经理】修改订单但权限
        newModityOrderType: 0,
        isChaBan: 0, //是否插班(0-正常报入，1-插班报入)
        isShowTransferClass: false, //是否显示转班
        ChangeType: 1, //1-转班 2-分拆
        isShowteacher: false, //关联教师显示
        teacherMsg: {
          OrderId: 0,
          HelpEnterId: '',
        }, //关联老师参数
        TeacherList: [], //下拉老师
        isShowContract: false,
        imgViewUrl: '',
        imgViewList: [],
        initialIndex: 0,
        loading:false,
         columns: [
        {
          name: "OrderId",
          label: "订单号",
          field: "OrderId",
          align: "left"
        },
        {
          name: "ClassName",
          label: "班级",
          align: "left",
          field: "ClassName"
        },
        {
          name: "CourseName",
          label: "课程",
          field: "CourseName",
          align: "left"
        },
        {
          name: "PreferPrice",
          label: "应收",
          field: "PreferPrice",
          align: "left",
        },
        {
          name: "DiscountMoney",
          label: "实收",
          field: "DiscountMoney",
          align: "left"
        },
        {
          name: "OrderStateName",
          label: "状态",
          field: "OrderStateName",
          align: "left"
        },
        {
          name: "GuestList",
          label: "学生名单",
          field: "GuestList",
          align: "left",
          style: 'width: 200px',
        },
        ],
        msg:{
             pageIndex: 1,
             pageSize: 10,
             rowsPerPage: 10,
        },
      }
    },
    created() {
      this.initAuth();
      this.Employee();
      this.GetTeacherList() //获取老师数据
      var localStorageData = window.localStorage["loginUserInfo"];
      let ActionMenuList = JSON.parse(localStorageData).data.ActionMenuList
      if (ActionMenuList && ActionMenuList.length > 0) {
        ActionMenuList.forEach(x => {
          if (x.FunctionCode == 'Edit_OrderExtraMoney') {
            this.isShowReward = true
          }
          if (x.FunctionCode == 'Edit_Order') {
            this.isEditOrder = true
          }
        })
      }
    },
    watch: {
      modityOrderType: {
        handler(newValue) {
          var localStorageData = window.localStorage["loginUserInfo"];
          let ActionMenuList = JSON.parse(localStorageData).data.ActionMenuList
          var isNewEditOrder = false;
          if (ActionMenuList && ActionMenuList.length > 0) {
            ActionMenuList.forEach(x => {
              if (x.FunctionCode == 'Edit_Order') {
                isNewEditOrder = true
              }
            })
          }
          if (isNewEditOrder) {
            this.newModityOrderType = 3;
          } else {
            this.newModityOrderType = newValue;
          }
        },
        immediate: true
      }
    },
    mounted() {},
    methods: {
      //点击合同编号预览
      getShowContract(item) {
        this.isShowPop = false;
        if (item.ContractUrlList.length > 0) {
          //预览图片
          if (item.ContractType == 2) {
            this.isShowContract = true;
            this.imgViewUrl = item.ContractUrlList[0];
            this.imgViewList = item.ContractUrlList;
          }
          if (item.ContractType == 1) {
            this.previewPDF(item.ContractUrlList[0]);
          }
        }
      },
      //初始化权限信息
      initAuth() {
        if (this.authObj) {
          if (this.authObj.isShowName != null && !this.authObj.isShowName) {
            this.AuthorityObj.isShowName = this.authObj.isShowName;
          }
          if (this.authObj.isShowGuestBtn != null && this.authObj.isShowGuestBtn > 0) {
            this.AuthorityObj.isShowGuestBtn = this.authObj.isShowGuestBtn;
          }
          if (this.authObj.isShowFinanceBtn != null && this.authObj.isShowFinanceBtn) {
            this.AuthorityObj.isShowFinanceBtn = this.authObj.isShowFinanceBtn;
          }
          if (this.authObj.isShowTransOrder != null && this.authObj.isShowTransOrder) {
            this.AuthorityObj.isShowTransOrder = this.authObj.isShowTransOrder;
          }
          if (this.authObj.isShowEditSale != null && this.authObj.isShowEditSale) {
            this.AuthorityObj.isShowEditSale = this.authObj.isShowEditSale;
          }
          if (this.authObj.isShowSaleRemark != null && this.authObj.isShowSaleRemark) {
            this.AuthorityObj.isShowSaleRemark = this.authObj.isShowSaleRemark;
          }
          if (this.authObj.isShowEducationRemark != null && this.authObj.isShowEducationRemark) {
            this.AuthorityObj.isShowEducationRemark = this.authObj.isShowEducationRemark;
          }
          if (this.authObj.isShowPrincipalRemark != null && this.authObj.isShowPrincipalRemark) {
            this.AuthorityObj.isShowPrincipalRemark = this.authObj.isShowPrincipalRemark;
          }
          if (this.authObj.isShowManagerRemark != null && this.authObj.isShowManagerRemark) {
            this.AuthorityObj.isShowManagerRemark = this.authObj.isShowManagerRemark;
          }
          if (this.authObj.isShowCommissionEdit != null && this.authObj.isShowCommissionEdit) {
            this.AuthorityObj.isShowCommissionEdit = this.authObj.isShowCommissionEdit;
          }
          if (this.authObj.isShowRewardEdit != null && this.authObj.isShowRewardEdit) {
            this.AuthorityObj.isShowRewardEdit = this.authObj.isShowRewardEdit;
          }
          if (this.authObj.isShowBackClass != null && this.authObj.isShowBackClass) {
            this.AuthorityObj.isShowBackClass = this.authObj.isShowBackClass;
          }
          if (this.authObj.isShowRenewClass != null && this.authObj.isShowRenewClass) {
            this.AuthorityObj.isShowRenewClass = this.authObj.isShowRenewClass;
          }
          if (this.authObj.isShowEdit != null && !this.authObj.isShowEdit) {
            this.AuthorityObj.isShowEdit = this.authObj.isShowEdit;
          }
          if (this.authObj.isShowTransClassOrder != null && this.authObj.isShowTransClassOrder) {
            this.AuthorityObj.isShowTransClassOrder = this.authObj.isShowTransClassOrder;
          }
          if (this.authObj.isShowSeparater != null && this.authObj.isShowSeparater) {
            this.AuthorityObj.isShowSeparater = this.authObj.isShowSeparater;
          }
          if (this.authObj.isshoworderconfirm != null && this.authObj.isshoworderconfirm) {
            this.AuthorityObj.isshoworderconfirm = this.authObj.isshoworderconfirm;
          }

        }
      },
      //回归原班
      backSourceClass(item) {
        var backMsg = {
          OrderId: item.OrderId
        };
        var that = this;
        this.$q.dialog({
          title: "回归原班",
          message: "你正在进行订单回归原班级操作，是否确认执行",
          persistent: true,
          cancel: {
            label: "取消",
            flat: true
          },
          ok: {
            label: "确认执行",
            flat: true,
            focus: true
          }
        }).onOk(() => {
          regressSourceClass(backMsg).then(res => {
            if (res.Code == 1) {
              that.$q.notify({
                icon: 'iconfont icon-chenggong',
                color: 'accent',
                timeout: 2000,
                message: '操作成功',
                position: 'top'
              })
              that.refreshOrder();
            }
          })
        });
      },
      //关闭报价单
      closeQuota() {
        this.isShowviewQuo = false;
      },
      //跳转到报价单
      goQuotation(Id) {
        this.OpenNewUrl("/sale/quotation", {
          Id: Id
        });
      },
      //跳转到预约单号
      goVisitorReser(Id) {
        this.OpenNewUrl("/sale/appointManagement", {
          Id: Id
        });
      },
      //弹出退课名单
      getTkshow(data) {
        let Tkshow = false;
        if (data && data.length > 0) {
          data.forEach(x => {
            if (x.GuestState == 2) {
              Tkshow = true
            }
          });
        }
        return Tkshow
      },
      //关闭退课申请
      closeBackClassForm() {
        this.orderObj = {};
        this.isShowBackClassForm = false;
      },
      //显示退课申请
      showBackClassForm(item) {
        this.orderObj = item;
        this.isShowBackClassForm = true;
      },
      //显示续课申请
      showContinueClass(item) {
        this.orderObj = item;
        this.isShowContinueClass = true;
      },
      //关闭续课申请
      closeContinueClassForm() {
        this.orderObj = {};
        this.isShowContinueClass = false;
      },
      //转班
      transferClass(item, type) {
        this.orderObj = item;
        this.ChangeType = type;
        this.isShowTransferClass = true;
      },
      //关闭转班
      closeTransferClassForm() {
        this.orderObj = {};
        this.isShowTransferClass = false;
      },
      //获取员工列表
      Employee() {
        var qMsg = {
          EmployeeName: ''
        }
        queryEmployee(qMsg).then(res => {
          if (res.Code == 1) {
            this.EmployeeList = res.Data;
          }
        })
      },
      //获取财务单据
      getOrderFinanceList(msg, type) {
        this.apipost('sellorder_post_GetOrderFinanceListForEdu', {
          OrderIds: msg
        }, res => {
          if (res.data.resultCode === 1) {
            let data = res.data.data;
            if (type == 1) {
              if (this.dataList) {
                this.dataList.forEach(x => {
                  data.forEach(j => {
                    if (x.OrderId == j.OrderId) {
                      x.FinanceList = j.FinanceList
                      x.RefundFinanceList = j.RefundFinanceList
                    }
                  })
                })
              }
            } else if (type == 2) {
              if (this.cancelList && this.cancelList.length > 0) {
                this.cancelList.forEach(x => {
                  data.forEach(j => {
                    if (x.OrderId == j.OrderId) {
                      x.FinanceList = j.FinanceList
                      x.RefundFinanceList = j.RefundFinanceList
                    }
                  })
                })
              }
            }
            this.$forceUpdate()
          } else {
            this.$message.error(res.data.message);
          }
        }, err => {})
      },
      //显示订单详情
      goOrderdetails(item, tab) {
        item.tab = tab
        this.myorderObjOption = item;
        this.isShowmyorderForm = true;
      },
      //关闭订单详情
      closeMOSaveForm() {
        this.isShowmyorderForm = false;
      },
      //订单转交
      transferOrder(item, type) {
        item.type = type
        this.orderObj = item;
        this.isShowTransOrderForm = true;
      },
      //关闭转订单弹窗
      closeTransOrderForm() {
        this.isShowTransOrderForm = false;
      },
      //跳转到学生名单
      gostudent(item) {
        var tempStr = '/sale/studentList';
        this.$router.push({
          path: tempStr,
          query: {
            OrderId: item.OrderId,
            ClassId: item.ClassId,
            SourceId: item.SourceId,
            isShow: this.AuthorityObj.isShowGuestBtn
          }
        });
      },
      //修改订单备注
      editOrderRemark(item, Type) {
        this.orderObj = item;
        this.remarkType = Type;
        this.isShowRemarkOrderForm = true;
      },
      //关闭备注
      closeRemarkForm() {
        this.isShowRemarkOrderForm = false;
      },
      //关闭订单修改
      closeOrderSaveForm() {
        this.isShowEditOrderForm = false;
        this.isShowStudyOrderForm = false;
      },
      //显示修改订单
      editOrder(item) {
        this.orderObj = item;
        //课程订单
        if (item.OrderType == 1) {
          this.isShowEditOrderForm = true;
        } else { //留学就业订单
          this.isShowStudyOrderForm = true;
        }
        this.isChaBan = item.JoinType == 2 ? 1 : 0;
      },
      //刷新页面
      refreshOrder() {
        this.isShowEditOrderForm = false;
        this.isShowMoney = false;
        this.isShowStudyOrderForm = false;
        //调用父页面成功方法
        this.$emit('success');
      },
      //关闭修改提成和额外奖励
      closeMoneyForm() {
        this.moneyObj = {};
        this.isShowMoney = false;
      },
      //取消订单
      CancelOrder(item) {
        let that = this
        this.$q.dialog({
          title: '提示信息',
          message: '<span style="color: var(--q-color-negative)">是否取消此订单</span>',
          cancel: true,
          persistent: true,
          html: true,
          ok: "确定",
          cancel: "取消",
        }).onOk(() => {
          cancelClassOrder({
            OrderId: item.OrderId
          }).then(res => {
            if (res.Code == 1) {
              that.$q.notify({
                icon: 'iconfont icon-chenggong',
                color: 'accent',
                timeout: 2000,
                message: '操作成功',
                position: 'top'
              })
              //调用父页面成功方法
              this.$emit('success');
            }
          })
        })
      },
      //财务单据
      chanceType(obj, type) {
        let TCIDARR = []
        if (obj && obj.OrderType == 2) {
          //留学就业订单
          TCIDARR.push(obj.SourceId);
        } else {
          //班级课程订单
          TCIDARR.push(obj.ClassId);
        }
        var orderObj = {
          OrderID: obj.OrderId,
          OrderSource: 17,
          Obj: {},
          SourceID: 0,
          TCIDList: TCIDARR
        }
        if (obj.OfferId > 0) {
          orderObj.OtherType = 29;
          orderObj.ReFinanceId = obj.OfferId;
        }
        if (obj.OrderType == 1 && this.chooseStudent == "") {
          this.$q.notify({
            icon: 'close',
            color: 'accent',
            timeout: 2000,
            message: '请选择学生',
            position: 'top'
          })
          return
        }
        if (obj.OrderType == 1 && this.chooseStudent == "") {
          this.$q.notify({
            icon: 'close',
            color: 'accent',
            timeout: 2000,
            message: '请选择学生',
            position: 'top'
          })
          return
        }
        let ContractNo = ''
        if (obj && obj.GuestList.length > 0) {
          obj.GuestList.forEach(x => {
            if (this.chooseStudent == x.Id) {
              ContractNo = x.ContractNo
            }
          })
        }
        if (obj.OrderType == 1 && ContractNo == '') {
          this.$q.notify({
            icon: 'close',
            color: 'accent',
            timeout: 2000,
            message: '请完善合同信息',
            position: 'top'
          })
          return
        }
        //留学就业订单
        if (obj && obj.OrderType == 2) {
          //财务单据类型【教育留学】
          orderObj.OrderSource = 18;
        }
        var guestId = 0;
        if (this.chooseStudent != "") {
          guestId = this.chooseStudent;
        }
        this.$router.push({
          path: '/financial/financalDocument/ChoiceAddFinancialDocuments',
          query: {
            "Type": type,
            "companyID": obj.ClassSchoolId,
            "path": "",
            'blank': 'y',
            'orderObj': JSON.stringify(orderObj),
            'tradeWay': obj.tradeWay,
            "GuestId": guestId
          }
        });
      },
      chanceType_lx(obj) { //留学的时 成本制单
        let TCIDARR = []
        if (obj && obj.OrderType == 2) {
          //留学就业订单
          TCIDARR.push(obj.SourceId);
        } else {

        }
        var orderObj = {
          OrderID: obj.OrderId,
          OrderSource: 17,
          Obj: {},
          SourceID: 0,
          TCIDList: TCIDARR
        }
        orderObj.OtherType = 45; //成本单据
        if (obj.OfferId > 0) {
          orderObj.ReFinanceId = obj.OfferId;

        }

        let ContractNo = ''
        if (obj && obj.GuestList.length > 0) {
          obj.GuestList.forEach(x => {
            if (this.chooseStudent == x.Id) {
              ContractNo = x.ContractNo
            }
          })
        }
        //留学就业订单
        if (obj && obj.OrderType == 2) {
          //财务单据类型【教育留学】
          orderObj.OrderSource = 18;
        }
        var guestId = 0;
        if (this.chooseStudent != "") {
          guestId = this.chooseStudent;
        }
        this.$router.push({
          path: '/financial/financalDocument/ChoiceAddFinancialDocuments',
          query: {
            "Type": 2,
            "companyID": obj.ClassSchoolId,
            "path": "",
            'blank': 'y',
            'orderObj': JSON.stringify(orderObj),
            'tradeWay': obj.tradeWay,
            "GuestId": guestId
          }
        });
      },
      //打开班级详情组件
      getClassInfo(obj) {
        this.classObjOption = obj;
        this.classObjOption.School_Id = this.classObjOption.ClassSchoolId
        this.isShowClassInfo = true;
      },
      //关闭班级信息弹窗
      closeClass() {
        this.isShowClassInfo = false
      },
      //修改提成-奖励
      upDateMoney(item, type) {
        this.moneyObj = item;
        this.CommonType = type;
        this.isShowMoney = true;
      },
      //关闭弹窗
      closeEdudia() {
        this.isShowEduForm = false
      },
      //刷新页面
      refreshPage() {
        this.refreshOrder();
      },
      //领取合同
      takeContract(item) {
        let msg = {
          OrderId: item.OrderId,
          GuestId: 0
        }
        SetOrderReceiveContract(msg).then(res => {
          if (res.Code == 1) {
            this.$q.notify({
              icon: 'iconfont icon-chenggong',
              color: 'accent',
              timeout: 2000,
              message: '操作成功',
              position: 'top'
            })
            //调用父页面成功方法
            this.$emit('success');
          }
        }).catch(() => {})
      },
      takeContractTwo(item, subItem) {
        let obj = {
          OrderId: item.OrderId,
          GuestId: subItem.Id,
          ContractId: subItem.ContractId
        }
        this.eduObj = obj;
        this.isShowPop = false;
        this.isShowEduForm = true;
      },
      //跳转至合同管理
      goContractMannage(subItem) {
        this.OpenNewUrl("/contractView", {
          ContractId: subItem.ContractId
        });
      },
      gourltx(obj) {
        if (obj.OrderType == 1) {
          this.OpenNewUrl("/financial/cycleOrderList", {
            OrderId: obj.OrderId
          });
        } else {
          this.OpenNewUrl("/financial/studyabroad/ordercommission", {
            OrderId: obj.OrderId
          });
        }

      },
      //合同提交审核
      goContractAudit(subItem) {
        let msg = {
          ContractId: subItem.ContractId,
          State: 1
        }
        SetEducationContractAudit(msg).then(res => {
          if (res.Code == 1) {
            this.$q.notify({
              icon: 'iconfont icon-chenggong',
              color: 'accent',
              timeout: 2000,
              message: '修改成功！',
              position: 'top'
            })
            this.$emit('success');
          }
        })
      },
      //获取教师下拉
      GetTeacherList() {
        var qMsg = {
          AccountTypeStr: 2
        }
        queryEmployee(qMsg).then(res => {
          if (res.Code == 1) {
            this.TeacherList = res.Data;
          }
        })
      },
      gettanchuteacher(item) {
        this.isShowteacher = true
        this.teacherMsg.OrderId = item.OrderId;
        this.teacherMsg.HelpEnterId = item.HelpEnterId > 0 ? item.HelpEnterId : '';
      },
      setCheckStatus() {
        if (this.teacherMsg.HelpEnterId == 0 || this.teacherMsg.HelpEnterId == '') {
          this.$q.notify({
            icon: 'close',
            color: 'accent',
            timeout: 2000,
            message: '请选择关联老师',
            position: 'top'
          })
          return
        }
        setOrderHelpEnterId(this.teacherMsg).then(res => {
          if (res.Code == 1) {
            this.$q.notify({
              icon: 'iconfont icon-chenggong',
              color: 'accent',
              timeout: 2000,
              message: '操作成功',
              position: 'top'
            })
            //调用父页面成功方法
            this.isShowteacher = false
            this.$emit('success');
          }
        })
      },
      studyabroadorderconfirmation(item) { //留学订单确认
        let that = this
        this.$q.dialog({
          title: '提示信息',
          message: '<span style="color: var(--q-color-negative)">是否完成此订单</span>',
          cancel: true,
          persistent: true,
          html: true,
          ok: "确定",
          cancel: "取消",
        }).onOk(() => {
          setStudyAboradOrderConfirm({
            OrderId: item.OrderId
          }).then(res => {
            if (res.Code == 1) {
              that.$q.notify({
                icon: 'iconfont icon-chenggong',
                color: 'accent',
                timeout: 2000,
                message: '操作成功',
                position: 'top'
              })
              //调用父页面成功方法
              this.$emit('success');
            }
          })
        })
      },
    }
  }

</script>
<style>
  li {
    list-style-type: none;
  }

  .b2bclassorder ul {
    padding: 0px
  }

  .b2bclassorder .price-popup {
    border-radius: 4px;
  }

  .b2bclassorder .el-range-editor .el-range-input {
    background: none;
  }

  .b2bclassorder .el-range-editor.el-input__inner {
    background-color: transparent;
  }

  .b2bclassorder .q-mb-md {
    margin-bottom: 0;
  }

  .b2bclassorder .stics {
    padding: 10px 20px;
    background: #DDDEE0;
    border-radius: 4px;
    font-size: 14px;
    color: #000000;
    font-weight: bold
  }

  .b2bclassorder .stics .stics-name {
    color: #2D2D2D;
    font-weight: 600;
    margin-right: 10px
  }

  .b2bclassorder .tis {
    margin: 10px 0;
    align-items: center
  }

  .b2bclassorder .tis .tis-k {
    width: 10px;
    height: 10px;
    margin-right: 8px
  }

  .b2bclassorder .tis span {
    font-size: 14px;
    color: #2D2D2D;
    font-weight: 600;
    margin-right: 20px
  }

  .b2bclassorder .enrollTotalSearchTable {
    width: 100%;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #cccccc;
    border-right: 1px solid #cccccc;
    border-collapse: collapse;
  }

  .b2bclassorder .enrollTotalSearchTable tr {
    /* border-bottom: 2px solid #333; */
  }

  .b2bclassorder .enrollTotalSearchTable tr th {
    background: #DDDEE0;
    height: 30px;
    font-size: 12px;
    text-align: center;
  }

  .b2bclassorder .enrollTotalSearchTable tr {
    background: #fff;
    text-align: left;
  }

  .b2bclassorder .enrollTotalSearchTable tbody tr:last-child {
    border-bottom: 2px solid #333;
  }

  .b2bclassorder .enrollTotalSearchTable tr:first-child td:first-child {
    border-bottom: 2px solid #333;
  }

  .b2bclassorder .enrollTotalSearchTable tr td {
    height: 66px;
    padding: 10px;
    /*border-top: 1px solid #cccccc;*/
    /*border-left: 1px solid #cccccc;*/
  }

  .b2bclassorder .enrollTotalSearchTable tr td>img {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    vertical-align: middle;
    margin-right: 5px;
  }

  .b2bclassorder .enrollTotalSearchTable tr td p {
    line-height: 20px;
  }

  .b2bclassorder .remarks {
    font-size: 14px;
    color: #2D2D2D;
  }

  .b2bclassorder .remarks-b {
    width: 100%;
    height: 94px;
    background: #F0F5FB;
    margin-top: 10px;
    padding: 15px;
    font-size: 12px;
    color: #999999;
    position: relative;
    overflow: hidden;
    display: -webkit-box;
    line-height: 20px;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .b2bclassorder .remarks-b-b {
    text-align: right;
    position: absolute;
    right: 0px;
    bottom: 0px
  }

  .b2bclassorder .on-left {
    margin-right: 5px;
  }

  .b2bclassorder .finance {
    padding: 1px 10px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin: 5px 3px 3px 0;
  }

  .b2bclassorder .order_OfferId {
    font-size: 18px;
    color: #2961FE;
    margin-bottom: 10px;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer
  }

  .takeContract {
    cursor: pointer;
    color: rgb(41, 97, 254);
  }

  .Contract_Table {
    width: 100%;
    border-collapse: collapse;
  }

  .Contract_Table th,
  .Contract_Table td {
    padding: 5px;
    color: #000;
    text-align: center;
  }

  .table-body {
    height: 590px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .b2bclassorder .redstyle {
    color: var(--q-color-negative);
  }

  .order_OferTitle {
    font-size: 14px;
    color: #333333;
    margin-bottom: 10px;
  }

</style>
<style lang="scss">
.b2bclassorder ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.b2bclassorder ::-webkit-scrollbar-track {
  background: #fff;
  border-radius: 2px;
}
.b2bclassorder ::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 10px;
}
.b2bclassorder ::-webkit-scrollbar-thumb:hover {
  background: #999;
}
.b2bclassorder ::-webkit-scrollbar-corner {
  background: #204754;
}
.b2bclassorder .q-table__bottom {
  min-height:0px;
}
</style>