<style scoped>
    .customerDialogBox.add-box .add-tit {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 20px;
    }
    
    .customerDialogBox.add-box .add-tit p {
        display: flex;
        align-items: center;
        font-weight: bold;
        color: rgba(17, 17, 17, 1);
        font-size: 14px;
    }
    
    .customerDialogBox.add-box .add-tit p span {
        display: inline-block;
        width: 6px;
        height: 6px;
        background: #409efe;
        border-radius: 50%;
        margin-right: 10px;
    }
    
    .customerDialogBox.add-box .el-dialog__header {
        padding: 15px 20px;
        background: rgba(255, 255, 255, 1);
    }
    
    .customerDialogBox.add-box .dialog-footer {
        text-align: center;
        background-color: rgba(248, 250, 251, 1);
        padding-bottom: 20px;
    }
    
    .customerDialogBox.add-box .el-dialog__footer {
        padding: 0;
    }
    
    .customerDialogBox.add-box .el-dialog__body {
        background-color: rgba(248, 250, 251, 1);
        padding-top: 20px;
        max-height: 500px;
        overflow: auto;
    }
    
    .customerDialogBox .add-box-btn.el-button {
        border-radius: 0;
        background-color: #409efecc;
        border-color: #409efecc;
        color: white;
        padding: 12px 43px;
    }
    
    .customerDialogBox .add-box-btn.el-button:hover {
        background-color: #409efe;
        border-color: #409efe;
        color: white;
    }
    
    .customerDialogBox .add-box-btn.el-button.add-box-cancel {
        color: #409efecc;
        background-color: white;
    }
    
    .customerDialogBox .add-box-btn.el-button.add-box-cancel:hover {
        color: #409efe;
        background-color: white;
    }
    
    .customerDialogBox .el-input .el-input-group__append {
        background-color: #409efe;
        border-color: #409efe;
        color: #fff;
    }
    
    .customerDialogBox .form-box .form-box-tit {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .customerDialogBox .form-box .radius {
        display: flex;
        width: 4px;
        height: 4px;
        background: rgba(255, 164, 117, 1);
        border-radius: 50%;
        margin-right: 10px;
    }
    
    .customerDialogBox .up-img-box .uib-item {
        margin-right: 30px;
        width: 120px;
        height: 120px;
        background-color: white;
        position: relative;
        margin-bottom: 30px;
    }
    
    .customerDialogBox .up-img-box .uib-item p {
        position: absolute;
        bottom: -30px;
        font-size: 12px;
        text-align: center;
        width: 100%;
    }
    
    .customerDialogBox .up-img-box .uib-item:hover .imgzhe-btn {
        opacity: 1;
    }
    
    .customerDialogBox .imgzhe {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
    }
    
    .customerDialogBox .imgzhe .imgzhe-btn {
        background: rgba(0, 0, 0, 0.6);
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 120px;
        position: absolute;
        top: 0;
        opacity: 1;
        transition: all linear 0.5s;
    }
    
    .customerDialogBox .imgzhe .imgzhe-btn i {
        font-size: 22px;
        margin-right: 5px;
        color: white;
        cursor: pointer;
    }
    
    .customerDialogBox .up-ctrl {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }
    
    .customerDialogBox .up-ctrl>div {
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 140px;
    }
    
    .el-upload-dragger {
        width: 100% !important;
    }
    
    .certificate-img-box {
        display: flex;
        flex-wrap: wrap;
    }
    
    .img-box {
        width: 100px;
        height: 100px;
        margin-right: 10px;
    }
    
    .form-box-log {
        border-left: 1px solid #E9E9E9;
    }
    
    .form-log-title {
        width: 100%;
        position: relative;
    }
    
    .form-log-text {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    .form-log-text span:first-child {
        color: #409efe;
        font-size: 15px;
    }
    
    .form-log-text span:last-child {
        color: #555;
    }
    
    .form-log-text,
    .form-log-center {
        padding: 0 0 0 20px;
    }
    
    .log-radius {
        position: absolute;
        width: 5px;
        height: 5px;
        left: -8px;
        border-radius: 100%;
        top: 15px;
        background: rgba(255, 164, 117, 1);
        border-radius: 50%;
        margin-right: 10px;
    }
    
    .form-log-center {
        margin-bottom: 20px;
        letter-spacing: 2px;
    }
    
    .Credentials-box {
        /* display: flex; */
    }
    
    .Credentials-box .el-image {
        width: 80px;
        height: 80px;
        margin-right: 10px;
        margin-bottom: 10px;
    }
    
    .Credentials-text {
        display: flex;
        align-items: flex-start;
    }
    
    .Credentialstext-box {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    
    .Credentialstext-box p {
        margin-bottom: 10px;
        color: #409efe;
    }
    
    .Credentialsimg-box {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .MultipleChoice-outerLayer {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
        background: #fff;
    }
    
    .MultipleChoice-item {
        display: flex;
    }
    
    .MultipleChoice-item.bottom0 {
        margin-bottom: 0;
    }
    
    .MultipleChoice-OrderType {
        padding: 9px 19px 0 19px;
    }
    
    .el-form-item.MultipleChoice-OrderType {
        margin-bottom: 0 !important;
    }
    
    .MultipleChoice-left {}
    
    .MultipleChoice-left .el-checkbox-group {
        display: flex;
        flex-direction: column;
    }
    
    .MultipleChoice-left .el-checkbox-group .el-checkbox {
        flex: 1;
        padding: 30px 19px 20px 19px;
    }
    
    .MultipleChoice-right {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        padding: 15px 0 0 0;
    }
    
    .MultipleChoice-right-box {
        background: #fff;
        flex: 1;
        padding: 9px 19px;
        margin-bottom: 10px;
    }
    
    .MultipleChoice-right-box.active {
        background: #F5F7FA;
    }
    
    .MultipleChoice-right-box .el-form-item {
        margin-bottom: 0;
    }
    
    .combo-box {
        display: flex;
        justify-content: space-between;
    }
    
    .combo-center.active {
        background: #F5F7FA;
    }
    
    .combo-center {
        flex: 1;
        padding: 9px 19px 0 19px;
    }
    
    .combo-center:last-child {
        margin-right: 0;
    }
    .combo-center {
        margin-right: 30px;
    }
    .BillMaking-box{
        display: flex;
        flex-direction: column;
    }
    .BillMaking-header{
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .BillMaking-header-center{
        width: 167px;
        display: flex;
        align-items: center;
        margin-right: 20px;
        margin-bottom: 10px;
    }
    .BillMaking-header-center:last-child{
        margin-right: 0px;
    }
    .BillMaking-header-center span{
        flex-shrink: 0;
        margin-left: 10px;
    }
    .BillMaking-header-center span:first-child{
        margin-left: 0;
    }
    .BillMakingType-box{
        display: flex;
        flex-direction: row;
        /* margin: 20px 0; */
        padding: 10px 10px 0 10px;
        background-color: #fff;
    }
    .BillMakingType-left{
        flex-shrink: 0;
        margin-right: 20px;
        padding: 3px 0;
        line-height: 25px;
    }
    .BillMakingType-right{
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .BillMakingType-right-list{
        display: flex;
        flex-direction: row;
        margin-bottom: 5px;
    }
    .BillMakingType-right-box{
        flex-grow: 1;
        display: flex;
        flex-wrap: wrap;
    }
    .BillMakingType-right-center{
        width: 150px;
        display: flex;
        align-items: center;
        margin-right: 10px;
        margin-bottom: 5px;
    }
    .BillMakingType-right-center span:first-child{
        flex-shrink: 0;
    }
    .clickJia{
        color: #409efe;
        display: block;
        padding: 5px;
    }
    .clickJia:hover{
        cursor: pointer;
        flex-shrink: 0;
    }
    .BillingTotal-box{ 
        display: flex;
        justify-content: flex-end;
        background-color: #fff;
        padding: 0 10px 10px 0;
        margin-bottom: 20px;
    }
    .BillingTotal-center{
        display: flex;
        align-items: center;
        margin-left: 20px;
    }
    .BillingTotal-center span{
        flex-shrink: 0;
    }
    .appendix-box{
        display: flex;
        flex-direction: column;
    }
    .appendix-top{
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
        background-color: #fff;
        padding: 20px 10px;
    }
    .appendix-top-img{
        /* width: 120px;
        height: 80px; */
        margin-bottom: 10px;
        margin-right: 10px;
        position: relative;
        display: flex;
        border: 1px solid #eee;
    }
    .appendix-img{
        width: 120px;
        height: 80px;
    }
    .appendix-img .icon-excel,.appendix-img .icon-pdf {
        text-align: center;
        font-size: 38px;
        color: green;
        line-height: 75px;
        
    }
    .imgdelete{
        position: absolute;
        right: 0px;
        top: -10px;
        color: red;
        z-index: 2;
        font-size: 25px;
        cursor: pointer;
    }
    .appendix-bottom{
        width: 120px;
        height: 80px;
        overflow: hidden;
        margin-bottom: 10px;
    }
    /deep/.appendix-upload-demo .el-upload-dragger{
        width: 120px !important;
        height: 80px !important;
    }
    /deep/.appendix-upload-demo .el-upload-dragger .el-icon-upload{
        margin: 0px !important;
        font-size: 20px;
    }
    .RemittanceInformation-box{
        display: flex;
    }
    .RemittanceInformation-center{
        flex: 1;
        display: flex;
        align-items: center;
        margin-left: 20px;
    }
    .RemittanceInformation-center:first-child{
        margin-left: 0;
    }
    .RemittanceInformation-center span{
        flex-shrink: 0;
        margin-right: 10px;
    }
    .RemittanceInformation-center-right{
        flex: 1;
    }
    .BillMaking-header-center-right{
        display: flex;
        justify-content: space-between;
    }
    .BillMaking-header-center.width{
        width: 357px;
    }
    
</style>
<template>
      <el-dialog :visible.sync="dialogTableVisible" 
      @closed="closedDialog" 
      :close-on-click-modal="false" 
      class="add-box add-box1 customerDialogBox"
      :width="width">
          <div class="add-tit" slot="title">
              <p><span></span>{{name}}</p>
              <span icon="el-icon-close"></span>
          </div>
          <div class="form-box" v-if="show">
              <el-form :model="form" ref="form" class="MyEditForm" :rules="rules">
                  <template v-if="name!='订单收损'&&name!='出签凭证图'">
                    <p class="form-box-tit" v-if="name!='操作日志'&&name!='凭证图'&&name!='制单'"><span class="radius"></span>
                    {{name!='修改出票状态'&&name!='修改出签状态'?' 基本信息':' 上传'+text+'凭证'}}</p>
                    </template>
                  <el-row :gutter="30">
                    <el-col :span="8" v-if="name=='新建机票订单'||name=='编辑机票订单'">
                          <div class="MyEditForm-item">
                              <el-form-item label="预计人数" prop="GuestCount">
                                  <el-input placeholder="请输入预计人数" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" v-model="form.GuestCount"></el-input>
                              </el-form-item>
                          </div>
                      </el-col>
                      <el-col :span="8" v-if="name=='新建机票订单'||name=='编辑机票订单'">
                          <div class="MyEditForm-item">
                              <el-form-item label="出行概述" prop="StartCityName">
                                  <el-input placeholder="出发时间、出发地、目的地" v-model="form.StartCityName"></el-input>
                              </el-form-item>
                          </div>
                      </el-col>
                      <el-col :span="8" v-if="name=='新建机票订单'||name=='编辑订单金额'||name=='编辑机票订单'">
                          <div class="MyEditForm-item">
                              <el-form-item label="报价总金额" prop="Money">
                                  <el-input :value="form.Money" disabled></el-input>
                              </el-form-item>
                          </div>
                      </el-col>
                  </el-row>
                    <el-row :gutter="30" v-if="name=='新建机票订单'||name=='编辑订单金额'||name=='编辑机票订单'">
                        <el-col :span="24">
                            <div class="MultipleChoice-outerLayer">
                                <el-form-item class="MultipleChoice-OrderType" label="订单类型" prop="OrderType">
                                    <p style="opacity: 0;">{{form.OrderType}}</p>
                                </el-form-item>
                                <div class="MultipleChoice-item"> 
                                    <div class="MultipleChoice-left">
                                        <el-checkbox-group v-model="checkList" @change="clickMultipleChoice">
                                        <el-checkbox v-for="(item,index) in MultipleChoiceList" :key="index"
                                        :label="item.Id">{{item.Name}}</el-checkbox>
                                        </el-checkbox-group>
                                    </div>
                                    <div class="MultipleChoice-right">
                                        <div class="MultipleChoice-right-box"
                                            :class="AirTicketsShow?'active':''">
                                            <el-form-item label="机票金额" prop="TicketMoney">
                                                <el-input placeholder="请输入机票金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="form.TicketMoney"
                                                :disabled="AirTicketsShow"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="MultipleChoice-right-box"
                                            :class="visaShow?'active':''">
                                            <el-form-item label="签证金额" prop="VisaMoney">
                                                <el-input placeholder="请输入签证金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="form.VisaMoney"
                                                :disabled="visaShow"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="MultipleChoice-right-box"
                                            :class="groundShow?'active':''">
                                            <el-form-item label="地接金额" prop="DiJieMoney">
                                                <el-input placeholder="请输入地接金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="form.DiJieMoney"
                                                :disabled="groundShow"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="combo-box"
                                            >
                                            <div class="combo-center"
                                            :class="comboShow?'active':''">
                                                <el-form-item label="套餐金额" prop="MealMoney">
                                                    <el-input placeholder="请输入套餐金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.MealMoney"
                                                    :disabled="comboShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="comboShow?'active':''">
                                                <el-form-item label="说明" prop="MealDescription"
                                                :rules="comboShow?[{ required: false}]:rules.MealDescription">
                                                    <el-input placeholder="请输入套餐说明" 
                                                    v-model="form.MealDescription"
                                                    :disabled="comboShow"></el-input>
                                                </el-form-item>
                                            </div>
                                        </div>
                                    </div>
                                </div> 
                            </div> 
                            
                        </el-col>
                    </el-row>
                    <el-row :gutter="30" v-if="name=='订单收损'">
                        <el-col :span="24">
                            <div class="MultipleChoice-outerLayer">
                                <el-form-item class="MultipleChoice-OrderType" label="订单类型" prop="OrderType">
                                    <p style="opacity: 0;">{{form.OrderType}}</p>
                                </el-form-item>
                                <div class="MultipleChoice-item"> 
                                    <div class="MultipleChoice-left">
                                        <el-checkbox-group v-model="checkList" @change="clickLossMultipleChoice">
                                        <el-checkbox v-for="(item,index) in lossMultipleChoiceList" :key="index"
                                        :label="item.Id">{{item.Name}}</el-checkbox>
                                        </el-checkbox-group>
                                    </div>
                                    <div class="MultipleChoice-right">
                                        <div class="combo-box" v-if="obj.OrderType.indexOf(1) != -1">
                                            <div class="combo-center"
                                            :class="AirTicketsShow?'active':''">
                                                <el-form-item label="机票金额" prop="">
                                                    <br/>
                                                    {{form.TicketMoney}}
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="AirTicketsShow?'active':''">
                                                <el-form-item label="收损金额" prop="LossAirTicketMoney">
                                                    <el-input :min="0" :max="form.TicketMoney" placeholder="请输入收损金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.LossAirTicketMoney"
                                                    :disabled="AirTicketsShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="AirTicketsShow?'active':''">
                                                <el-form-item label="备注" prop="">
                                                    <el-input placeholder="请输入备注" 
                                                    v-model="AirTicketLoss.Remark"
                                                    :disabled="AirTicketsShow"></el-input>
                                                </el-form-item>
                                            </div>
                                        </div>
                                        <div class="combo-box" v-if="obj.OrderType.indexOf(2) != -1">
                                            <div class="combo-center"
                                            :class="visaShow?'active':''">
                                                <el-form-item label="签证金额" prop="">
                                                    <br/>
                                                    {{form.VisaMoney}}
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="visaShow?'active':''">
                                                <el-form-item label="收损金额" prop="LossVisaMoney">
                                                    <el-input :min="0" :max="form.VisaMoney" placeholder="请输入收损金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.LossVisaMoney"
                                                    :disabled="visaShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="visaShow?'active':''">
                                                <el-form-item label="备注" prop="">
                                                    <el-input placeholder="请输入说明" 
                                                    v-model="visaLoss.Remark"
                                                    :disabled="visaShow"></el-input>
                                                </el-form-item>
                                            </div>
                                        </div>
                                        <div class="combo-box" v-if="obj.OrderType.indexOf(3) != -1"
                                            :class="groundShow?'active':''">
                                            <div class="combo-center"
                                            :class="groundShow?'active':''">
                                                <el-form-item label="地接金额" prop="">
                                                    <br/>
                                                    {{form.DiJieMoney}}
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="groundShow?'active':''">
                                                <el-form-item label="收损金额" prop="LossGroundMoney">
                                                    <el-input :min="0" :max="form.MealMoney" placeholder="请输入收损金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.LossGroundMoney"
                                                    :disabled="groundShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="groundShow?'active':''">
                                                <el-form-item label="备注" prop="">
                                                    <el-input placeholder="请输入备注" 
                                                    v-model="groundLoss.Remark"
                                                    :disabled="groundShow"></el-input>
                                                </el-form-item>
                                            </div>
                                        </div>
                                        <div class="combo-box" v-if="obj.OrderType.indexOf(4) != -1"
                                            >
                                            <div class="combo-center"
                                            :class="comboShow?'active':''">
                                                <el-form-item label="套餐金额" prop="">
                                                    <el-input placeholder="请输入套餐金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.MealMoney"
                                                    :disabled="comboShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="comboShow?'active':''">
                                                <el-form-item label="收损金额" prop="LossComboMoney">
                                                    <el-input :min="0" :max="form.MealMoney" placeholder="请输入收损金额" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                    v-model="form.LossComboMoney"
                                                    :disabled="comboShow"></el-input>
                                                </el-form-item>
                                            </div>
                                            <div class="combo-center"
                                            :class="comboShow?'active':''">
                                                <el-form-item label="备注" prop="">
                                                    <el-input placeholder="请输入备注" 
                                                    v-model="comboLoss.Remark"
                                                    :disabled="comboShow"></el-input>
                                                </el-form-item>
                                            </div>
                                        </div>
                                    </div>
                                </div> 
                            </div> 
                            
                        </el-col>
                    </el-row>
                  <el-row v-if="name=='新建机票订单'||name=='编辑订单金额'||name=='编辑机票订单'">
                      <el-col :span="24">
                          <div class="MyEditForm-item label-pad-left">
                              <el-form-item v-if="name=='新建机票订单'||name=='编辑机票订单'" label="备注">
                                  <el-input type="textarea" placeholder="订单备注" v-model="form.Remark"></el-input>
                              </el-form-item>
                              <el-form-item v-if="name=='编辑订单金额'" label="备注" prop="Remark">
                                  <el-input type="textarea" placeholder="订单备注" v-model="form.Remark"></el-input>
                              </el-form-item>
                          </div>
                      </el-col>
                  </el-row>
                  <el-row v-if="name=='修改出票状态'">
                    <el-col v-if="obj.TicketStatus==2" :span="24">
                      <div class="MyEditForm-item">
                        <el-form-item label="出票状态" prop="Type">
                            <el-radio-group v-model="form.Type">
                              <el-radio v-for="(item,index) in radioList"
                              @change="radioChange"
                              :key="index"
                              :label="item.id">{{item.name}}</el-radio>
                          </el-radio-group>
                        </el-form-item> 
                      </div>
                    </el-col>
                    <el-col :span="24">
                      <div class="MyEditForm-item">
                        <el-form-item label="凭证/图片" prop="">
                          <div class="certificate-img-box">
                            <div class="img-box" :loding="imgShow" v-for="(item,index) in form.Voucher" :key="index">
                                <el-image 
                                  style="width: 100px; height: 100px"
                                  :src="item" 
                                  :preview-src-list="form.Voucher">
                                </el-image>
                              </div>
                          </div>    
                        </el-form-item> 
                      </div>
                    </el-col>
                    <el-col :span="24">
                      <div class="MyEditForm-item">
                        <el-form-item label="上传图片" prop="Voucher">
                            <el-upload
                              ref="ticketUpload"
                              class="upload-demo"
                              drag
                              action=""
                              :show-file-list="false"
                              :file-list="fileList"
                              :http-request="uploadImg"
                              :multiple="true"
                              accept="image/jpeg,image/gif,image/png,image/bmp"
                              :before-upload="handleAvatarUpload"
                              :on-success="handleAvatarSuccess"
                              >
                              <i class="el-icon-upload"></i>
                              <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                          </el-upload>
                        </el-form-item> 
                      </div>
                    </el-col>
                  </el-row>
                  <el-row v-if="name=='修改出签状态'">
                    <el-col :span="24">
                      <div class="MyEditForm-item">
                        <el-form-item label="凭证/图片" prop="">
                          <div class="certificate-img-box">
                            <div class="img-box" :loding="imgShow" v-for="(item,index) in form.Voucher" :key="index">
                                <el-image 
                                  style="width: 100px; height: 100px"
                                  :src="item" 
                                  :preview-src-list="form.Voucher">
                                </el-image>
                              </div>
                          </div>    
                        </el-form-item> 
                      </div>
                    </el-col>
                    <el-col :span="24">
                      <div class="MyEditForm-item">
                        <el-form-item label="上传图片" prop="Voucher">
                            <el-upload
                              ref="ticketUpload"
                              class="upload-demo"
                              drag
                              action=""
                              :show-file-list="false"
                              :file-list="fileList"
                              :http-request="uploadImg"
                              :multiple="true"
                              accept="image/jpeg,image/gif,image/png,image/bmp"
                              :before-upload="handleAvatarUpload"
                              :on-success="handleAvatarSuccess"
                              >
                              <i class="el-icon-upload"></i>
                              <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                          </el-upload>
                        </el-form-item> 
                      </div>
                    </el-col>
                  </el-row>
                  <el-row v-if="name=='订单转交'">
                       <el-col>
                          <div class="MyEditForm-item">
                              <el-form-item label="转交业务员" prop="EnterId">
                                <el-select 
                                  size="mini"
                                  filterable
                                  v-model="form.EnterId" 
                                  clearable
                                  placeholder="请选择业务员">
                                      <el-option 
                                          v-for="item in EmployeeList"
                                          :label='item.EmName'
                                          :value='item.EmployeeId'
                                          :key='item.EmployeeId'>
                                      </el-option>
                                  </el-select>
                              </el-form-item>
                          </div>
                      </el-col>
                  </el-row>
              </el-form>
              <div v-if="name=='凭证图'" class="Credentials-box">
                <div class="Credentials-text">
                  <div class="Credentialstext-box">
                    <p>熔断/取消凭证</p>
                    <div class="Credentialsimg-box">
                      <el-image v-for="(items,index) in obj.CancelVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})" :key="index"
                      :src="items"
                      :preview-src-list="obj.CancelVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})"></el-image>
                    </div>
                    
                  </div>
                  <div class="Credentialstext-box">
                    <p>出票凭证</p>
                    <div class="Credentialsimg-box">
                      <el-image v-for="(items,index) in obj.TicketVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})" :key="index"
                      :src="items"
                      :preview-src-list="obj.TicketVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})">
                      </el-image>
                    </div>
                    
                  </div>
                </div>
              </div>
              <div v-if="name=='出签凭证图'" class="Credentials-box">
                <div class="Credentials-text">
                  <div class="Credentialstext-box">
                    <!-- <p>出签凭证</p> -->
                    <div class="Credentialsimg-box">
                      <el-image v-for="(items,index) in obj.VisaVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})" :key="index"
                      :src="items"
                      :preview-src-list="obj.VisaVoucherList.map(item=>{return domainManager().ViittoFileUrl + item})"></el-image>
                    </div>
                  </div>
                </div>
              </div>
              <div v-if="name=='操作日志'">
                <div v-for="(item,index) in logData" :key="index">
                  <div class="form-box-log">
                    <div class="form-log-title">
                      <span class="log-radius"></span>
                      <div class="form-log-text">
                        <span>
                          {{item.CreateByName}}
                        </span>
                        <span>
                          {{item.CreateTime}}
                        </span>
                      </div>
                    </div>
                    <div class="form-log-center">
                      {{item.LogContent}}
                    </div>
                  </div>
                </div>
              </div>
              <div v-if="name=='制单'" class="BillMaking-box">
                <div class="BillMaking-header">
                    <div class="BillMaking-header-center">
                        <span>流程：</span>
                        <el-select size="mini" v-model="BillMaking.TemplateId" filterable clearable placeholder="请选择流程"
                        @change="Financial_post_GetCostTypeList">
                            <el-option
                                v-for="item in processList"
                                :key="item.Id"
                                :label="item.Name"
                                :value="item.Id">
                            </el-option>
                        </el-select>
                    </div>
                    <div class="BillMaking-header-center">
                        <span>所属公司：</span>
                        <el-select size="mini" 
                        v-model="BillMaking.RB_Branch_Id" filterable placeholder="请选择公司"
                        @change="admin_get_DepartmentGetList">
                            <el-option
                                v-for="item in companyList"
                                :key="item.Id"
                                :label="item.BName"
                                :value="item.Id ">
                            </el-option>
                            </el-select>
                    </div>
                    <div class="BillMaking-header-center">
                        <span>费用部门：</span>
                        <el-select size="mini" v-model="BillMaking.RB_Depart_Id" filterable placeholder="请选择部门">
                            <el-option
                                v-for="(item,index) in departmentList"
                                :key="index"
                                :label="item.DepartmentName"
                                :value="item.DepartmentID">
                            </el-option>
                            </el-select>
                    </div>
                    <div class="BillMaking-header-center width">
                        <span>收款账户：</span>
                        <div class="BillMaking-header-center-right">
                            <el-select size="mini" v-model="BillMaking.IsPublic" filterable placeholder="选择收款账户"
                            @change="getAccountList">
                                <el-option
                                    v-for="(item,index) in AccList"
                                    v-if="item.Name =='私帐账户' || item.Name =='公帐账户' || item.Name =='现金账户' || item.Name =='平台账户' || item.Name =='微信支付宝'"
                                    :key="index"
                                    :label="item.Name"
                                    :value="item.ID" >
                                </el-option>
                            </el-select>
                            <el-select style="margin-left: 10px;" size="mini" v-model="BillMaking.AccountId" filterable placeholder="收款账号"
                            @change="getReceivingAccount">
                                <el-option
                                    v-for="(item,index) in accountList"
                                    :key="index"
                                    :label="item.Alias+' '+item.BackNo"
                                    :value="item.ID">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                </div>
                <!-- 机票 -->
                <div v-if="obj.checkList.indexOf('1')!=-1">
                    <div class="BillMakingType-box">
                        <div class="BillMakingType-left">{{airTickets.title}}</div>
                        <div class="BillMakingType-right">
                            <div class="BillMakingType-right-list" v-for="(item,index) in airTickets.detailList" :key="index">
                                <div class="BillMakingType-right-box">
                                <div class="BillMakingType-right-center">
                                    <el-select size="mini" filterable v-model='item.CostTypeId' placeholder="请选择费用">
                                        <el-option v-for='item in GetCostTypeList' :label='item.Name' :value='item.ID' :key='item.ID'>
                                        </el-option>
                                    </el-select>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>数量：</span>
                                    <el-input size="mini" placeholder="请输入数量" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                        v-model="item.Number"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>单价：</span>
                                    <el-input size="mini" placeholder="请输入单价" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.UnitPrice"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>原币：</span>
                                    <!-- <span>{{item.OriginalMoney}}</span> -->
                                    
                                    <el-input size="mini" placeholder="" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.OriginalMoney" disabled></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <el-input
                                        size="mini"
                                        type="textarea"
                                        :rows="1"
                                        placeholder="备注"
                                        v-model="item.Remark"></el-input>
                                </div>
                            </div>
                                <i class="iconfont clickJia" v-if="index==0" @click="addTypeList(1)">&#xe615;</i>
                                <i class="iconfont clickJia" v-if="index!=0" @click="deleteTypeList(item,index,1)">&#xe67a;</i>
                            </div>
                        </div>
                        
                    </div>
                    <div class="BillingTotal-box">
                        <div class="BillingTotal-center">
                            <span>手续费：</span>
                            <el-input size="mini" placeholder="请输入手续费" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="airTickets.OriginalFee"></el-input>
                        </div>
                        <!-- <div class="BillingTotal-center">
                            <span>总价：</span>
                            <span>{{airTickets.TotalCost}}</span>
                        </div> -->
                        <div class="BillingTotal-center">
                            <span>应收金额：</span>
                            <span style="min-width:50px">{{airTickets.WBMoney}}</span>
                        </div>
                    </div>
                </div>
                <!-- 签证 -->
                <div v-if="obj.checkList.indexOf('2')!=-1">
                    <div class="BillMakingType-box">
                        <div class="BillMakingType-left">{{visa.title}}</div>
                        <div class="BillMakingType-right">
                            <div class="BillMakingType-right-list" v-for="(item,index) in visa.detailList" :key="index">
                                <div class="BillMakingType-right-box">
                                <div class="BillMakingType-right-center">
                                    
                                    <el-select size="mini" filterable v-model='item.CostTypeId' placeholder="请选择费用">
                                        <el-option v-for='item in GetCostTypeList' :label='item.Name' :value='item.ID' :key='item.ID'>
                                        </el-option>
                                    </el-select>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>数量：</span>
                                    <el-input size="mini" placeholder="请输入数量" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                        v-model="item.Number"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>单价：</span>
                                    <el-input size="mini" placeholder="请输入单价" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.UnitPrice"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>原币：</span>
                                    <el-input size="mini" placeholder="" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.OriginalMoney" disabled></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <el-input
                                        size="mini"
                                        type="textarea"
                                        :rows="1"
                                        placeholder="备注"
                                        v-model="item.Remark"></el-input>
                                </div>
                            </div>
                                <i class="iconfont clickJia" v-if="index==0" @click="addTypeList(2)">&#xe615;</i>
                                <i class="iconfont clickJia" v-if="index!=0" @click="deleteTypeList(item,index,2)">&#xe67a;</i>
                            </div>
                        </div>
                        
                    </div>
                    <div class="BillingTotal-box">
                        <div class="BillingTotal-center">
                            <span>手续费：</span>
                            <el-input size="mini" placeholder="请输入手续费" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="visa.OriginalFee"></el-input>
                        </div>
                        <div class="BillingTotal-center">
                            <span>应收金额：</span>
                            <span style="min-width:50px">{{visa.WBMoney}}</span>
                        </div>
                    </div>
                </div>
                <!-- 地接 -->
                <div v-if="obj.checkList.indexOf('3')!=-1">
                    <div class="BillMakingType-box">
                        <div class="BillMakingType-left">{{ground.title}}</div>
                        <div class="BillMakingType-right">
                            <div class="BillMakingType-right-list" v-for="(item,index) in ground.detailList" :key="index">
                                <div class="BillMakingType-right-box">
                                <div class="BillMakingType-right-center">
                                    
                                    <el-select size="mini" filterable v-model='item.CostTypeId' placeholder="请选择费用">
                                        <el-option v-for='item in GetCostTypeList' :label='item.Name' :value='item.ID' :key='item.ID'>
                                        </el-option>
                                    </el-select>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>数量：</span>
                                    <el-input size="mini" placeholder="请输入数量" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                        v-model="item.Number"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>单价：</span>
                                    <el-input size="mini" placeholder="请输入单价" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.UnitPrice"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>原币：</span>
                                    <el-input size="mini" placeholder="" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.OriginalMoney" disabled></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <el-input
                                        size="mini"
                                        type="textarea"
                                        :rows="1"
                                        placeholder="备注"
                                        v-model="item.Remark"></el-input>
                                </div>
                                </div>
                                <i class="iconfont clickJia" v-if="index==0" @click="addTypeList(3)">&#xe615;</i>
                                <i class="iconfont clickJia" v-if="index!=0" @click="deleteTypeList(item,index,3)">&#xe67a;</i>
                            </div>
                        </div>
                        
                    </div>
                    <div class="BillingTotal-box">
                        <div class="BillingTotal-center">
                            <span>手续费：</span>
                            <el-input size="mini" placeholder="请输入手续费" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="ground.OriginalFee"></el-input>
                        </div>
                        <div class="BillingTotal-center">
                            <span>应收金额：</span>
                            <span style="min-width:50px">{{ground.WBMoney}}</span>
                        </div>
                    </div>
                </div>
                <!-- 套餐 -->
                <div v-if="obj.checkList.indexOf('4')!=-1">
                    <div class="BillMakingType-box">
                        <div class="BillMakingType-left">{{combo.title}}</div>
                        <div class="BillMakingType-right">
                            <div class="BillMakingType-right-list" v-for="(item,index) in combo.detailList" :key="index">
                                <div class="BillMakingType-right-box">
                                <div class="BillMakingType-right-center">
                                    
                                    <el-select size="mini" filterable v-model='item.CostTypeId' placeholder="请选择费用">
                                        <el-option v-for='item in GetCostTypeList' :label='item.Name' :value='item.ID' :key='item.ID'>
                                        </el-option>
                                    </el-select>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>数量：</span>
                                    <el-input size="mini" placeholder="请输入数量" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                        v-model="item.Number"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>单价：</span>
                                    <el-input size="mini" placeholder="请输入单价" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.UnitPrice"></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <span>原币：</span>
                                    <el-input size="mini" placeholder="" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                        v-model="item.OriginalMoney" disabled></el-input>
                                </div>
                                <div class="BillMakingType-right-center">
                                    <el-input
                                        size="mini"
                                        type="textarea"
                                        :rows="1"
                                        placeholder="备注"
                                        v-model="item.Remark"></el-input>
                                </div>
                                </div>
                                <i class="iconfont clickJia" v-if="index==0" @click="addTypeList(4)">&#xe615;</i>
                                <i class="iconfont clickJia" v-if="index!=0" @click="deleteTypeList(item,index,4)">&#xe67a;</i>
                            </div>
                        </div>
                        
                    </div>
                    <div class="BillingTotal-box">
                        <div class="BillingTotal-center">
                            <span>手续费：</span>
                            <el-input size="mini" placeholder="请输入手续费" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" 
                                                v-model="combo.OriginalFee"></el-input>
                        </div>
                        <div class="BillingTotal-center">
                            <span>应收金额：</span>
                            <span style="min-width:50px">{{combo.WBMoney}}</span>
                        </div>
                    </div>
                </div>
                <div class="appendix-box">
                    <div class="appendix-top">
                        <template v-for="(items,index) in vorcherInos">
                            <div v-show="items.type==1" class="appendix-top-img">
                                <div v-loading="imgShow" class="appendix-img">
                                    <div class="iconfont"
                                    :class="items.Content.substring(items.Content.lastIndexOf('.')+1,items.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'">
                                        {{items.Content.substring(items.Content.lastIndexOf('.')+1,items.Content.length).toUpperCase()=='PDF'?'&#xe679;':'&#xe61a;'}}
                                    </div>
                                </div>
                                <i class="iconfont imgdelete" @click="deleteImg(items,index)">&#xe608;</i>
                            </div>
                            <div v-show="items.type==3" class="appendix-top-img">
                                <el-image v-loading="imgShow" v-show="items.type==3"  class="appendix-img"
                                :src="items.Content" :preview-src-list="form.Voucher">
                                    <div slot="placeholder" class="image-slot">
                                    加载中<span class="dot">...</span>
                                    </div>
                                </el-image>
                                <i class="iconfont imgdelete" @click="deleteImg(index)">&#xe608;</i>
                            </div>
                        </template>
                          <div class="appendix-bottom">
                              <!-- accept=".gif,.jpg,.jpeg,.png,.bmp,.docx,.doc,.xlsx,.xls,.ppt,.pptx,.pdf" -->
                            <el-upload
                            ref="ticketUpload"
                            class="appendix-upload-demo"
                            drag
                            action=""
                            :http-request="uploadImg"
                            :multiple="true"
                            :before-upload="handleAvatarUploadType"
                            :on-success="handleAvatarSuccess"
                            >
                            <i class="el-icon-upload"></i>
                            <div class="el-upload__text"><em>拖拽/点击上传</em></div>
                        </el-upload>
                        </div>
                    </div>
                    
                    
                  </div>
                  <div class="RemittanceInformation-box">
                      <div class="RemittanceInformation-center">
                        <span>汇款人：</span>
                        <div class="RemittanceInformation-center-right">
                            <el-input size="mini" placeholder="请输入汇款人"
                            v-model="BillMaking.RemitterName"></el-input>
                        </div>
                      </div>
                      <div class="RemittanceInformation-center">
                            <span>交易流水号：</span>
                            <div class="RemittanceInformation-center-right">
                                <el-input size="mini" placeholder="请输入流水号"
                                v-model="BillMaking.AccountNumber"></el-input> 
                            </div>
                        </div>
                      <div class="RemittanceInformation-center">
                        <span>汇款时间：</span>
                        <div class="RemittanceInformation-center-right">
                            <el-date-picker
                            style="width: 100%;"
                            size="mini"
                                v-model="BillMaking.TradeDate"
                                value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="选择汇款时间">
                            </el-date-picker>
                        </div>
                        </div>
                  </div>
              </div>
              <div v-if="total>0">
                <el-pagination class="Mypagination" background @current-change="handleCurrentChange"
                    :page-sizes="[10, 20, 60, 90, 100]" :page-size="msg.pageSize" layout="total, sizes, prev, pager, next"
                    @size-change="handleSizeChange" :total="total">
                </el-pagination>
            </div>
          </div>
          <div slot="footer" class="dialog-footer">
              <el-button type="primary" class="add-box-btn" @click="submitForm('form')" :loading="clickShow">确 定</el-button>
              <el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false, resetForm('form')">取 消</el-button>
          </div>
      </el-dialog>
  </template>
<script>
    export default {
        props: {
            ID: {
                type: Number,
                default: 0
            },
            name: {
                type: String,
                default: ""
            },
            CustomerId: {
                type: Number,
                default: 0
            },
            GuestId: {
                type: Number,
                default: 0
            },
            OrderId: {
                type: String,
                default: ""
            },
            obj: {
                type: Object,
                default: {}
            }
        },
        data() {
            return {
                // 收损
                msgLoss:{
                    OrderId:'',
                    OrderLoss:[]
                },
                comboLoss:{
                    OrderType:'4',
                    LossMoney:null,
                    Remark:''
                },
                groundLoss:{
                    OrderType:'3',
                    LossMoney:null,
                    Remark:''
                },
                visaLoss:{
                    OrderType:'2',
                    LossMoney:null,
                    Remark:''
                },
                AirTicketLoss:{
                    OrderType:'1',
                    LossMoney:null,
                    Remark:''
                },
                lossRadioList:[{Name:'禁用',Id:'1'},{Name:'激活',Id:'2'}],
                lossMultipleChoiceList: [],//订单收损选项目
                imgShow:false,
                clickShow:false,
                GetCostTypeList:[],//费用类型
                accountList:[],//账号类别
                AccList:[],//账户类型
                departmentList:[],// 部门
                companyList:[],// 公司
                // 流程
                processList:[],
                combo:{
                    title:"套餐",
                    WBMoney:0,//原币总金额
                    OriginalFee:0,//原币手续费
                    RelevanceFrId:"4",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    TotalCost:"",
                    detailList:[
                        {
                            CostTypeId:"",//费用ID
                            Number:"",//数量
                            UnitPrice:"",//单价
                            OriginalMoney:"",//金额
                            Remark:"",//备注
                        }
                    ]
                },
                ground:{
                    title:"地接",
                    WBMoney:0,//原币总金额
                    OriginalFee:0,//原币手续费
                    RelevanceFrId:"3",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    TotalCost:"",
                    detailList:[
                        {
                            CostTypeId:"",//费用ID
                            Number:"",//数量
                            UnitPrice:"",//单价
                            OriginalMoney:"",//金额
                            Remark:"",//备注
                        }
                    ]
                },
                visa:{
                    title:"签证",
                    WBMoney:0,//原币总金额
                    OriginalFee:0,//原币手续费
                    RelevanceFrId:"2",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    TotalCost:"",
                    detailList:[
                        {
                            CostTypeId:"",//费用ID
                            Number:"",//数量
                            UnitPrice:"",//单价
                            OriginalMoney:"",//金额
                            Remark:"",//备注
                        }
                    ]
                },
                airTickets:{
                    title:"机票",
                    WBMoney:0,//原币总金额
                    OriginalFee:0,//原币手续费
                    RelevanceFrId:"1",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    TotalCost:"",
                    detailList:[
                        {
                            CostTypeId:"",//费用ID
                            Number:"",//数量
                            UnitPrice:"",//单价
                            OriginalMoney:"",//金额
                            Remark:"",//备注
                        }
                    ]
                },
                vorcherInos:[],//制单凭证图
                BillMaking:{
                    IsPublic:"",//	账户类型 0私账 1公账
                    BType:"",//银行类型 看财务单据那边有枚举列表
                    AccountId:"",//	账户ID
                    WBMoney:"",//原币总金额
                    OriginalFee:"",//原币手续费
                    RB_Branch_Id:"1245",//公司ID
                    RB_Depart_Id:"357",//部门ID
                    RemitterName:"",//	汇款人
                    TradeDate:"",//交易日期
                    AccountNumber:"",//流水号
                    TemplateId:"",//流程ID
                    OtherType:55,//默认=55
                    ReFinanceId:"",//订单ID
                    ReFinanceId2:"",//类型 1收款
                    GuestId:"",//客人ID
                    RelevanceFrId:"",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    vorcherInos:[
                        {Content:''}
                    ],//array凭证列表
                    detailList:[
                        {
                            CostTypeId:"",//费用ID
                            Number:"",//数量
                            UnitPrice:"",//单价
                            OriginalMoney:"",//金额
                            Remark:"",//备注
                        }
                    ]
                },
                options:[],
                value:"",
                RelevanceFrId:'',//制单类型
                comboShow: true,
                groundShow: true,
                visaShow: true,
                AirTicketsShow: true,
                checkList: [], //已选存储
                MultipleChoiceList: [ //多选项目
                    {
                        Name: '机票',
                        Id: '1'
                    }, {
                        Name: '签证',
                        Id: '2'
                    }, {
                        Name: '地接',
                        Id: '3'
                    }, {
                        Name: '套餐',
                        Id: '4'
                    }
                ],
                EmployeeList: [],
                width: "",
                logData: [],
                total: 0,
                msg: {
                    pageIndex: 1,
                    pageSize: 10,
                    OrderId: "",
                },
                msgList:[],
                Voucher: [],
                fileList: [],
                radioList: [{
                    name: '航班熔断',
                    id: '3'
                }, {
                    name: '用户取消航班',
                    id: '4'
                }, ],
                text: '',
                CustomerList: [],
                LineList: [],
                LineTeamList: [],
                dialogTableVisible: false,
                form: {
                    OrderId: 0,
                    GuestId: null,
                    GuestCount: 1,
                    StartCityName: "",
                    EndCityName: "",
                    Money: null,
                    Remark: "",
                    Type: "",
                    Voucher: [],
                    EnterId: "",
                    OrderType: "", //类型
                    MealDescription: "", //说明
                    TicketMoney: 0, //机票应收
                    VisaMoney: 0, //签证应收
                    DiJieMoney: 0, //地接应收
                    MealMoney: 0, //套餐应收
                    LossComboMoney: null,
                    LossGroundMoney: null,
                    LossVisaMoney: null,
                    LossAirTicketMoney: null,
                },
                BusinessStatusEnum: [],
                rules: {
                    GuestCount: [{
                        required: true,
                        message: "请选择客户",
                        trigger: "change"
                    }, ],
                    StartCityName: [{
                        required: true,
                        message: "请输入出发时间、出发地、目的地",
                        trigger: "blur"
                    }, ],
                    // EndCityName: [
                    //   { required: true, message: "请输入到达城市", trigger: "blur" },
                    // ],
                    Money: [{
                        required: true,
                        message: "请在勾选的类型后面里输入金额",
                        trigger: "change"
                    }, ],
                    Remark: [{
                        required: true,
                        message: "请输入备注",
                        trigger: "blur"
                    }],
                    Type: [{
                        required: true,
                        message: "选择出票状态",
                        trigger: "change"
                    }, ],
                    Voucher: [{
                        required: true,
                        message: "上传凭据",
                        trigger: "blur"
                    }],
                    EnterId: [{
                        required: true,
                        message: "请选择转交人",
                        trigger: "blur"
                    }],
                    OrderType: [{
                        required: true,
                        message: "请选择订单类型",
                        trigger: "blur"
                    }],
                    MealDescription: [{
                        required: true,
                        message: "请输入套餐说明",
                        trigger: "blur"
                    }],
                    MealMoney: [{
                        required: true,
                        message: "请输入套餐金额",
                        trigger: "blur"
                    }],
                    TicketMoney: [{
                        required: true,
                        message: "请输入机票金额",
                        trigger: "blur"
                    }],
                    VisaMoney: [{
                        required: true,
                        message: "请输入签证金额",
                        trigger: "blur"
                    }],
                    DiJieMoney: [{
                        required: true,
                        message: "请输入地接金额",
                        trigger: "blur"
                    }],
                    LossAirTicketMoney: [{
                        required: true,
                        message: "请输入机票收损金额",
                        trigger: "blur"
                    }],
                    LossVisaMoney: [{
                        required: true,
                        message: "请输入签证收损金额",
                        trigger: "blur"
                    }],
                    LossGroundMoney: [{
                        required: true,
                        message: "请输入地接收损金额",
                        trigger: "blur"
                    }],
                    LossComboMoney: [{
                        required: true,
                        message: "请输入套餐收损金额",
                        trigger: "blur"
                    }],
                },
                show: true,
            };
        },
        computed: {
            monthCombo(){
                return this.combo.detailList
            },
            monthGround(){
                return this.ground.detailList
            },
            monthVisa(){
                return this.visa.detailList
            },
            monthAirTickets(){
                return this.airTickets.detailList
            },
            monthComboTotalCost(){
                return this.combo.OriginalFee
            },
            monthGroundTotalCost(){
                return this.ground.OriginalFee
            },
            monthVisaTotalCost(){
                return this.visa.OriginalFee
            },
            monthAirTicketsTotalCost(){
                return this.airTickets.OriginalFee
            },
        },
        watch: {
            ID: {
                handler(val, oldVal) {

                },
                deep: true,
            },
            GuestId: {
                handler(val, oldVal) {
                    this.form.GuestId = val
                },
                deep: true,
            },
            CustomerId: {
                handler(val, oldVal) {

                },
                deep: true,
            },
            obj: {
                handler(val, oldVal) {
                    if (this.name == '操作日志') {
                        this.getList()
                    }
                },
                deep: true,
            },
            form: {
                handler(val, oldVal) {
                    val.TicketMoney = val.TicketMoney - 0
                    val.VisaMoney = val.VisaMoney - 0
                    val.DiJieMoney = val.DiJieMoney - 0
                    val.MealMoney = val.MealMoney - 0
                    this.form.Money = val.MealMoney + val.TicketMoney + val.VisaMoney + val.DiJieMoney
                },
                deep: true,
            },
            monthCombo:{
                handler(val, oldVal) {
                    this.sum(4)
                },
                deep: true, 
            },
            monthGround:{
                handler(val, oldVal) {
                    this.sum(3)
                },
                deep: true, 
            },
            monthVisa:{
                handler(val, oldVal) {
                    this.sum(2)
                },
                deep: true, 
            },
            monthAirTickets:{
                handler(val, oldVal) {
                    this.sum(1)
                },
                deep: true, 
            },
            monthComboTotalCost:{
                handler(val, oldVal) {
                    this.TotalCost(4)
                },
                deep: true, 
            },
            monthGroundTotalCost:{
                handler(val, oldVal) {
                    this.TotalCost(3)
                },
                deep: true, 
            },
            monthVisaTotalCost:{
                handler(val, oldVal) {
                    this.TotalCost(2)
                },
                deep: true, 
            },
            monthAirTicketsTotalCost:{
                handler(val, oldVal) {
                    this.TotalCost(1)
                },
                deep: true, 
            }
        },
        mounted() {
            let $this = this;
            setTimeout(() => {
                $this.dialogTableVisible = true;
            }, 50);
            this.form.GuestId = this.GuestId
            if (this.name == "编辑机票订单") {
                this.checkList = this.obj.OrderType!=null&&this.obj.OrderType.split(',')
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(1) != -1) {
                    this.AirTicketsShow = false
                } else {
                    this.AirTicketsShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(2) != -1) {
                    this.visaShow = false
                } else {
                    this.visaShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(3) != -1) {
                    this.groundShow = false
                } else {
                    this.groundShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(4) != -1) {
                    this.comboShow = false
                } else {
                    this.comboShow = true
                }
                this.form = {
                    GuestId: this.GuestId,
                    OrderId: this.obj.OrderId,
                    GuestCount: this.obj.GuestCount,
                    StartCityName: this.obj.StartCityName,
                    EndCityName: this.obj.EndCityName,
                    Money: this.obj.Money,
                    Remark: this.obj.Remark,
                    OrderType: this.obj.OrderType, //类型
                    MealDescription: this.obj.MealDescription, //说明
                    TicketMoney: this.obj.TicketMoney, //机票应收
                    VisaMoney: this.obj.VisaMoney, //签证应收
                    DiJieMoney: this.obj.DiJieMoney, //地接应收
                    MealMoney: this.obj.MealMoney, //套餐应收
                }

            }
            if (this.obj.TicketStatus == 1) {
                this.text = '出票'
            }
            if (this.name == '操作日志') {
                this.width = "600px"
                this.getList()
            }
            if (this.name == '订单转交') {
                this.width = "400px"
                this.Employee()
            }
            if (this.name == '编辑订单金额') {
                this.width = "600px"
                this.checkList = this.obj.OrderType&&this.obj.OrderType.split(',')
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(1) != -1) {
                    this.AirTicketsShow = false
                } else {
                    this.AirTicketsShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(2) != -1) {
                    this.visaShow = false
                } else {
                    this.visaShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(3) != -1) {
                    this.groundShow = false
                } else {
                    this.groundShow = true
                }
                if (this.obj.OrderType&&this.obj.OrderType.indexOf(4) != -1) {
                    this.comboShow = false
                } else {
                    this.comboShow = true
                }
                this.form = {
                    TicketMoney:this.obj.TicketMoney,
                    VisaMoney:this.obj.VisaMoney,
                    DiJieMoney:this.obj.DiJieMoney,
                    MealMoney:this.obj.MealMoney,
                    MealDescription:this.obj.MealDescription
                }
            }
            if (this.name == '凭证图') {
                this.width = "600px"
            }
            if (this.name == '出签凭证图') {
                this.width = "400px"
            }
            if(this.name=='制单'){
                this.BillMaking = {
                    IsPublic:this.BillMaking.IsPublic,//	账户类型 0私账 1公账
                    BType:this.BillMaking.BType,//银行类型 看财务单据那边有枚举列表
                    AccountId:this.BillMaking.AccountId,//	账户ID
                    WBMoney:"",//原币总金额
                    OriginalFee:"",//原币手续费
                    RB_Branch_Id:this.BillMaking.RB_Branch_Id,//公司ID
                    RB_Depart_Id:this.BillMaking.RB_Depart_Id,//部门ID
                    RemitterName:this.BillMaking.RemitterName,//	汇款人
                    TradeDate:this.BillMaking.TradeDate,//交易日期
                    AccountNumber:this.BillMaking.AccountNumber,//流水号
                    TemplateId:this.BillMaking.TemplateId,//流程ID
                    OtherType:this.BillMaking.OtherType,//默认=55
                    ReFinanceId:this.obj.OrderId,//订单ID
                    ReFinanceId2:this.obj.ReFinanceId2,//类型 1收款
                    GuestId:this.obj.GuestId,//客人ID
                    RelevanceFrId:"",//订单类型 1机票 2签证 3地接 4套餐 5其他
                    vorcherInos:[],
                    detailList:[]
                }
                if(!this.BillMaking.IsPublic){
                    this.accountList = []
                }
                this.Financial_post_GetList()
                this.getCompany()
                this.admin_get_DepartmentGetList()
                this.AccountType_post_GetList()
                this.Financial_post_GetCostTypeList()
            }
            if (this.name == '修改出签状态') {
                this.text = '出签'
            }
            if(this.name == '订单收损'){
                this.msgLoss.OrderId = this.obj.OrderId
                this.form.TicketMoney = this.obj.TicketMoney //机票应收
                this.form.VisaMoney = this.obj.VisaMoney //签证应收
                this.form.DiJieMoney = this.obj.DiJieMoney //地接应收
                this.form.MealMoney = this.obj.MealMoney //套餐应收
                let list = this.obj.OrderType&&this.obj.OrderType.split(',')
                list = list.sort()
                for(let j=0;j<list.length;j++){
                    for(let i=0;i<this.MultipleChoiceList.length;i++){
                        if(list[j]==this.MultipleChoiceList[i].Id){
                            this.lossMultipleChoiceList.push(this.MultipleChoiceList[i])
                        }
                    }
                }
                this.GetOrderLossInfo()
                
            }
            
            
        },
        methods: {
            // 订单收损情况
            GetOrderLossInfo(){
                let data = {
                    OrderId: this.msgLoss.OrderId
                }
                this.apipost("/api/Order/GetOrderLossInfo",data,(res)=>{
                    if (res.data.resultCode == 1) {
                        res.data.data&&res.data.data.forEach(item=>{
                            this.checkList.push(item.OrderType.toString())
                            if(item.OrderType=='1'){
                                this.form.TicketMoney = item.Money //机票应收
                                this.form.LossAirTicketMoney = item.LossMoney
                                this.AirTicketsShow = false
                                this.AirTicketLoss.Remark = item.Remark
                            }
                            if(item.OrderType=='2'){
                                this.form.VisaMoney = item.Money//签证应收
                                this.form.LossVisaMoney = item.LossMoney
                                this.visaLoss.Remark = item.Remark
                                this.visaShow = false
                            }
                            if(item.OrderType=='3'){
                                this.form.DiJieMoney = item.Money //地接应收
                                this.form.LossGroundMoney = item.LossMoney
                                this.groundLoss.Remark = item.Remark
                                this.groundShow = false
                                
                            }
                            if(item.OrderType=='4'){
                                this.form.MealMoney = item.Money //套餐应收
                                this.form.LossComboMoney = item.LossMoney
                                this.comboLoss.Remark = item.Remark
                                this.comboShow = false
                            }
                        })
                    } else {
                        
                    }
                })
            },
            // 获取对应的银行类型
            getReceivingAccount(value){
                this.accountList.forEach(item=>{
                    if(item.ID==value){
                        this.BillMaking.BType = item.BankType
                    }
                })
            },
            // 应收
            TotalCost(num){
                if(num=='1'){
                    this.airTickets.WBMoney = 0
                    this.airTickets.WBMoney = this.airTickets.TotalCost-this.airTickets.OriginalFee
                }
                if(num=='2'){
                    this.visa.WBMoney = 0
                    this.visa.WBMoney = this.visa.TotalCost-this.visa.OriginalFee
                }
                if(num=='3'){
                    this.ground.WBMoney = 0
                    this.ground.WBMoney = this.ground.TotalCost-this.ground.OriginalFee
                }
                if(num=='4'){
                    this.combo.WBMoney = 0
                    this.combo.WBMoney = this.combo.TotalCost-this.combo.OriginalFee
                }
            },
            // 合计
            sum(num){
                if(num=='1'){
                    for(let i=0;i<this.airTickets.detailList.length;i++){
                        this.airTickets.detailList[i].OriginalMoney = this.airTickets.detailList[i].Number*this.airTickets.detailList[i].UnitPrice
                        
                    }
                    let OriginalMoney =  this.airTickets.detailList.map(item=>{
                        return item.OriginalMoney
                    })
                    this.airTickets.TotalCost= 0
                    for(let j=0;j<OriginalMoney.length;j++){
                        this.airTickets.TotalCost += OriginalMoney[j] 
                    }
                    this.TotalCost(num)
                }
                if(num=='2'){
                    for(let i=0;i<this.visa.detailList.length;i++){
                        this.visa.detailList[i].OriginalMoney = this.visa.detailList[i].Number*this.visa.detailList[i].UnitPrice
                    }
                    let OriginalMoney =  this.visa.detailList.map(item=>{
                        return item.OriginalMoney
                    })
                    this.visa.TotalCost= 0
                    for(let j=0;j<OriginalMoney.length;j++){
                        this.visa.TotalCost += OriginalMoney[j]
                        
                    }
                    this.TotalCost(num)
                }
                if(num=='3'){
                    for(let i=0;i<this.ground.detailList.length;i++){
                        this.ground.detailList[i].OriginalMoney = this.ground.detailList[i].Number*this.ground.detailList[i].UnitPrice
                        
                    }
                    let OriginalMoney =  this.ground.detailList.map(item=>{
                        return item.OriginalMoney
                    })
                    this.ground.TotalCost= 0
                    for(let j=0;j<OriginalMoney.length;j++){
                        this.ground.TotalCost += OriginalMoney[j]  
                    }
                    this.TotalCost(num)
                }
                if(num=='4'){
                    for(let i=0;i<this.combo.detailList.length;i++){
                        this.combo.detailList[i].OriginalMoney = this.combo.detailList[i].Number*this.combo.detailList[i].UnitPrice
                        
                    }
                    let OriginalMoney =  this.combo.detailList.map(item=>{
                        return item.OriginalMoney
                    })
                    this.combo.TotalCost= 0
                    for(let j=0;j<OriginalMoney.length;j++){
                        this.combo.TotalCost += OriginalMoney[j]  
                    }
                    this.TotalCost(num)
                }
            },
            // 删除
            deleteTypeList(item,index,num){
                if(num=='1'){
                   this.airTickets.detailList.splice(index,1) 
                }if(num=='2'){
                   this.visa.detailList.splice(index,1) 
                }if(num=='3'){
                   this.ground.detailList.splice(index,1) 
                }
                
            },
            // 添加
            addTypeList(item){
                let data = {
                    CostTypeId:"",//费用ID
                    Number:"",//数量
                    UnitPrice:"",//单价
                    OriginalMoney:"",//总金额
                    Remark:"",//备注
                }
                if(item=='1'){
                    this.airTickets.detailList.push(data)
                }
                if(item=='2'){
                    this.visa.detailList.push(data)
                }
                if(item=='3'){
                    this.ground.detailList.push(data)
                }
                if(item=='4'){
                    this.combo.detailList.push(data)
                }
            },
            Financial_post_GetCostTypeList() { //获取支出费用类型
                if(this.BillMaking.TemplateId){
                    this.apipost2('Financial_post_GetCostTypeList', {
                        ID: this.BillMaking.TemplateId
                    }, res => {
                    if (res.data.resultCode == 1) {
                        this.GetCostTypeList = res.data.data;
                        
                    }
                    
                    }, err => {})
                }
            },
            getAccountList() { //获取账户类型对应下的账户列表
                if(this.BillMaking.IsPublic){
                    this.apipost2('FinancialInstitutions_post_GetALLAccountList', {
                        TypeId: this.BillMaking.IsPublic
                        }, res => {
                        if (res.data.resultCode == 1) {
                            let data = res.data.data;
                            this.accountList = data;
                        }
                    }, err => {})
                }
            },
            AccountType_post_GetList() { //获取账户类型下拉
                let queryAccMsg = {
                        IsPublic: -1,
                        Is_Open: true,
                    }
                this.apipost2('AccountType_post_GetList', queryAccMsg, res => {
                if (res.data.resultCode == 1) {
                    this.AccList = res.data.data;
                } else {
                    this.$message.error(res.data.message);
                }
                }, err => {})
            },
            admin_get_DepartmentGetList() { // 获取部门
                let departmentMsg ={
                    RB_Branch_Id: this.BillMaking.RB_Depart_Id
                }
                this.apipost2('admin_get_DepartmentGetList', this.departmentMsg, res => {
                    if (res.data.resultCode == 1) {
                        this.departmentList = res.data.data;
                    }
                }, err => {})
            },
            getCompany() { // 获取公司
                let companyMsg = {
                    RB_Group_Id: this.getLocalStorage().RB_Group_id,
                    Status: 0,
                }
                this.apipost2('admin_get_BranchGetList', companyMsg, res => {
                    let data = res.data.data;
                    let Status = false;
                    this.companyList = data;
                }, err => {})
            },
            // 获取流程
            Financial_post_GetList(){ //获取
                let msg = {
                    Type:1
                }
                this.apipost2('Financial_post_GetList',msg,res=>{
                if(res.data.resultCode==1){
                    let data = res.data.data;
                    if(data){
                        data.forEach(item=>{
                            if(item.Type==1){
                                this.processList.push(item) 
                            }
                        })
                    }
                }else{
                    this.$message.error(res.data.message)
                }
                },err=>{})
            },
            // 多选发生变化
            clickMultipleChoice() {
                if (this.checkList.length > 0) {
                    this.checkList.forEach(item => {
                        if (item == '1') {
                            this.AirTicketsShow = false
                        }
                        if (item == '2') {
                            this.visaShow = false
                        }
                        if (item == '3') {
                            this.groundShow = false
                        }
                        if (item == '4') {
                            this.comboShow = false
                        }
                    });
                    if (this.checkList.indexOf('1') == -1) {
                        this.AirTicketsShow = true
                        this.form.TicketMoney = 0
                    }
                    if (this.checkList.indexOf('2') == -1) {
                        this.visaShow = true
                        this.form.VisaMoney = 0
                    }
                    if (this.checkList.indexOf('3') == -1) {
                        this.groundShow = true
                        this.form.DiJieMoney = 0
                    }
                    if (this.checkList.indexOf('4') == -1) {
                        this.comboShow = true
                        this.form.MealMoney = 0
                        this.form.MealDescription = ""
                    }
                    this.form.OrderType = this.checkList.join(',')
                } else if (this.checkList.length == 0) {
                    this.AirTicketsShow = true
                    this.visaShow = true
                    this.groundShow = true
                    this.comboShow = true
                    this.form.TicketMoney = 0
                    this.form.VisaMoney = 0
                    this.form.DiJieMoney = 0
                    this.form.MealMoney = 0
                    this.form.MealDescription = ""
                    this.form.OrderType = ""
                }

            },
            // 删除套餐值
            delType(item) {
                for (let i = 0; i < this.checkList.length; i++) {
                    if (this.checkList[i] == item) {
                        this.checkList.splice(i, 1)
                    }
                }
            },
            clickLossMultipleChoice() {
                if (this.checkList.length > 0) {

                    this.checkList.forEach(item => {
                        if (item == '1') {
                            this.AirTicketsShow = false
                        }
                        if (item == '2') {
                            this.visaShow = false
                        }
                        if (item == '3') {
                            this.groundShow = false
                        }
                        if (item == '4') {
                            this.comboShow = false
                        }
                    });
                    if (this.checkList.indexOf('1') == -1) {
                        this.AirTicketsShow = true
                    }
                    if (this.checkList.indexOf('2') == -1) {
                        this.visaShow = true
                    }
                    if (this.checkList.indexOf('3') == -1) {
                        this.groundShow = true
                    }
                    if (this.checkList.indexOf('4') == -1) {
                        this.comboShow = true
                    }

                    this.form.OrderType = this.checkList.join(',')
                } else if (this.checkList.length == 0) {
                    this.AirTicketsShow = true
                    this.visaShow = true
                    this.groundShow = true
                    this.comboShow = true
                    this.form.MealDescription = ""
                    this.form.OrderType = ""
                }

            },
            // 获取业务员
            Employee() {
                let userInfo = this.getLocalStorage();
                let msg = {
                    RB_Group_id: userInfo.RB_Group_id,
                    BranchId: -1,
                    DepartmentId: 0,
                    PostId: 0,
                    IsLeave: 0,
                };
                this.apipost2(
                    "admin_get_EmployeeGetList",
                    msg,
                    (res) => {
                        if (res.data.resultCode == 1) {
                            this.EmployeeList = res.data.data;
                        } else {}
                    },
                    (err) => {}
                );
            },
            closedDialog() {
                this.MsgBus.$emit("closeTicketOrderDialogBox");
                this.MsgBus.$emit("closeBillMaking");
            },
            // 操作日志
            getList() {
                if (this.name == '操作日志') {
                    this.msg.OrderId = this.obj.OrderId

                }
                this.apipost("/api/Order/GetOrderLogPageList", this.msg, (res) => {
                    if (res.data.resultCode == 1) {
                        this.logData = res.data.data.pageData
                        this.total = res.data.data.count
                    } else {
                        this.$message.error(res.data.message);
                    }
                });
            },
            //上传文件后清空文件队列
            handleAvatarSuccess(res, file) {
                this.$refs.ticketUpload.clearFiles();
                if (res.resultCode == 1) {
                    
                    this.Success(res.message);
                }
            },
            // 文件上传时钩子
            handleAvatarprogress(){
                this.imgShow = true
                this.$message.info('上传中...')
            },
            // 图片文件上传前钩子
            handleAvatarUploadType(file){
                if (file.size > 1024 * 1024 * 10) {
                    this.$message.warning('文件大小不能超过10M！')
                    return
                }
                var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
                  const extension =
                    testmsg === "gif" ||
                    testmsg === "jpg" ||
                    testmsg === "jpeg" ||
                    testmsg === "png" ||
                    testmsg === "bmp" ||
                    testmsg === "docx"||
                    testmsg === "doc"||
                    testmsg === "xlsx"||
                    testmsg === "xls"||
                    testmsg === "ppt"||
                    testmsg === "pptx"||
                    testmsg === "pdf";

                  if (!extension) {
                    this.$message.error("上传只能是gif,jpg,jpeg,png,bmp,docx,doc,xlsx,xls,ppt,pptx,pdf格式!");
                  }
                return extension;
                
            },
            // 图片上传前钩子
            handleAvatarUpload(file){
                this.imgShow = true
                this.$message.info('上传中...')
                
            },
            // 删除图片
            deleteImg(items,index){
                this.vorcherInos.splice(index,1)
                this.BillMaking.vorcherInos.splice(index,1)
            },
            //上传图片
            uploadImg(file) {
                let newArr = [];
                newArr.push(file.file);
                let path = "/Upload/Temporary/";
                this.imgShow = true
                this.$message.info('上传中...')
                this.UploadSelfFileT(path, newArr, (x) => {
                    let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
                    let data = x.data.FilePath
                    this.Voucher.push(data)
                    
                    this.form.Voucher.push(url);

                    let ContentUrl = {
                        Content: url,
                        type:''
                    }
                    let Content = {
                        Content: data,
                        type:''
                    }
                    var name = x.data.FileName;
                    var idx =  name.lastIndexOf("."); 
                    if (idx != -1){
                        var ext = name.substr(idx+1).toUpperCase();   
                        ext = ext.toLowerCase( ); 
                        if (ext!=='docx'&&ext!=='doc'&&ext!=='xlsx'&&ext!=='xls'&&ext!=='ppt'&&ext!=='pptx'&&ext!=='pdf'){
                            ContentUrl.type = 3
                            Content.type = 3
                        }else{
                            ContentUrl.type = 1
                            Content.type = 1
                        } 
                        this.vorcherInos.push(ContentUrl)
                        this.BillMaking.vorcherInos.push(Content)  
                    }
                    
                    if(x.data.StatusCode==1){
                        this.imgShow = false
                        this.$message.success('上传成功！')
                    }
                });
                
            },
            radioChange() {
                if (this.form.Type == '3') {
                    this.text = '航班熔断'
                }
                if (this.form.Type == '4') {
                    this.text = '用户取消航班'
                }
            },
            // 修改订单状态
            reviseData() {
                if (this.obj.TicketStatus == 1) {
                    this.form.Type = '2'
                }
                if (this.obj.OrderId) {
                    this.form.OrderId = this.obj.OrderId
                }
                let data = {
                    OrderId: this.form.OrderId,
                    Type: this.form.Type,
                    Voucher: this.Voucher
                }
                this.clickShow = true
                this.apipost("/api/Order/SetGuestOrderState", data, (res) => {
                    if (res.data.resultCode == 1) {
                        this.dialogTableVisible = false;
                        this.$message.success("操作成功");
                        this.MsgBus.$emit("closeTicketOrderDialogBox");
                        this.MsgBus.$emit("closeGetList");
                        this.resetForm("form");
                        this.clickShow = false
                    } else {
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                });
            },
            // 编辑金额
            editData() {
                if (this.obj.OrderId) {
                    this.form.OrderId = this.obj.OrderId
                }
                let data = {
                    OrderId: this.form.OrderId,
                    Money: this.form.Money,
                    Remark: this.form.Remark
                }
                this.clickShow = true
                this.apipost("/api/Order/SetGuestOrderMoney", data, (res) => {
                    if (res.data.resultCode == 1) {
                        this.dialogTableVisible = false;
                        this.$message.success("操作成功");
                        this.MsgBus.$emit("closeTicketOrderDialogBox");
                        this.MsgBus.$emit("closeGetList");
                        this.resetForm("form");
                        this.clickShow = false
                    } else {
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                });
            },
            // 新增订单
            addData() {
                if (this.checkList.indexOf('1') != -1 || this.checkList.indexOf('2') != -1 || this.checkList.indexOf('3') != -1 || this.checkList.indexOf('4') != -1) {
                    if (this.checkList.indexOf('1') != -1 && this.form.TicketMoney <= 0) {
                        this.$message({
                            type: 'warning',
                            message: '机票金额请输入大于0的金额!'
                        });
                        return
                    }
                    if (this.checkList.indexOf('2') != -1 && this.form.VisaMoney <= 0) {
                        this.$message({
                            type: 'warning',
                            message: '签证金额请输入大于0的金额!'
                        });
                        return
                    }
                    if (this.checkList.indexOf('3') != -1 && this.form.DiJieMoney <= 0) {
                        this.$message({
                            type: 'warning',
                            message: '地接金额请输入大于0的金额!'
                        });
                        return
                    }
                    if (this.checkList.indexOf('4') != -1 && this.form.MealMoney <= 0) {
                        this.$message({
                            type: 'warning',
                            message: '套餐金额请输入大于0的金额!'
                        });
                        return
                    }
                }
                let data
                if (this.name == '新建机票订单') {
                    data = {
                        OrderId: this.form.OrderId,
                        GuestId: this.form.GuestId,
                        GuestCount: this.form.GuestCount,
                        StartCityName: this.form.StartCityName,
                        EndCityName: this.form.EndCityName,
                        Money: this.form.Money,
                        Remark: this.form.Remark,
                        OrderType: this.form.OrderType, //类型
                        MealDescription: this.form.MealDescription, //说明
                        TicketMoney: this.form.TicketMoney, //机票应收
                        VisaMoney: this.form.VisaMoney, //签证应收
                        DiJieMoney: this.form.DiJieMoney, //地接应收
                        MealMoney: this.form.MealMoney, //套餐应收
                    }
                }
                if (this.name == '编辑机票订单') {
                    data = {
                        OrderId: this.form.OrderId,
                        GuestId: this.form.GuestId,
                        GuestCount: this.form.GuestCount,
                        StartCityName: this.form.StartCityName,
                        EndCityName: this.form.EndCityName,
                        Money: this.form.Money,
                        Remark: this.form.Remark,
                        OrderType: this.form.OrderType, //类型
                        MealDescription: this.form.MealDescription, //说明
                        TicketMoney: this.form.TicketMoney, //机票应收
                        VisaMoney: this.form.VisaMoney, //签证应收
                        DiJieMoney: this.form.DiJieMoney, //地接应收
                        MealMoney: this.form.MealMoney, //套餐应收
                    }
                }
                this.clickShow = true
                this.apipost("/api/Order/SetGuestOrderInfo", data, (res) => {
                    if (res.data.resultCode == 1) {
                        this.dialogTableVisible = false;
                        this.$message.success("操作成功");
                        this.MsgBus.$emit("closeTicketOrderDialogBox");
                        this.MsgBus.$emit("closeGetList");
                        this.checkList = []
                        this.AirTicketsShow = true
                        this.visaShow = true
                        this.groundShow = true
                        this.comboShow = true
                        this.clickShow = false
                        this.resetForm("form");
                    } else {
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                });
            },
            ConvertData() {
                if (this.obj.OrderId) {
                    this.form.OrderId = this.obj.OrderId
                }
                let data = {
                    OrderId: this.form.OrderId,
                    EnterId: this.form.EnterId,
                }
                this.clickShow = true
                this.apipost("/api/Order/SetGuestOrderCareOf", data, (res) => {
                    if (res.data.resultCode == 1) {
                        this.dialogTableVisible = false;
                        this.$message.success("操作成功");
                        this.MsgBus.$emit("closeTicketOrderDialogBox");
                        this.MsgBus.$emit("closeGetList");
                        this.resetForm("form");
                        this.clickShow = false
                    } else {
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                });
            },
            // 制单
            Financial_post_SetFinanceInfoForCRMIn(){
                if(!this.BillMaking.TemplateId){
                    this.$message.warning('请选择流程');
                    return
                }
                if(!this.BillMaking.IsPublic){
                    this.$message.warning('请选择收款账户');
                    return
                }
                if(!this.BillMaking.AccountId){
                    this.$message.warning('请选择收款账号');
                    return
                }
                this.obj.checkList.indexOf('1')!=-1&&this.airTickets.detailList.forEach(item=>{
                    if(!item.CostTypeId){
                        this.$message.warning('请选择费用说明');
                        return
                    }
                    if(!item.Number){
                        this.$message.warning('请输入机票数量');
                        return
                    }
                    if(!item.UnitPrice){
                        this.$message.warning('请输入机票单价');
                        return
                    }
                })
                this.obj.checkList.indexOf('2')!=-1&&this.visa.detailList.forEach(item=>{
                    if(!item.CostTypeId){
                        this.$message.warning('请选择费用说明');
                        return
                    }
                    if(!item.Number){
                        this.$message.warning('请输入签证数量');
                        return
                    }
                    if(!item.UnitPrice){
                        this.$message.warning('请输入签证单价');
                        return
                    }
                })
                this.obj.checkList.indexOf('3')!=-1&&this.ground.detailList.forEach(item=>{
                    if(!item.CostTypeId){
                        this.$message.warning('请选择费用说明');
                        return
                    }
                    if(!item.Number){
                        this.$message.warning('请输入地接数量');
                        return
                    }
                    if(!item.UnitPrice){
                        this.$message.warning('请输入地接单价');
                        return
                    }
                })
                this.obj.checkList.indexOf('4')!=-1&&this.combo.detailList.forEach(item=>{
                    if(!item.CostTypeId){
                        this.$message.warning('请选择费用说明');
                        return
                    }
                    if(!item.Number){
                        this.$message.warning('请输入套餐数量');
                        return
                    }
                    if(!item.UnitPrice){
                        this.$message.warning('请输入套餐单价');
                        return
                    }
                })
                if(this.BillMaking.vorcherInos.length==0){
                    this.$message.warning('请上传凭证');
                    return
                }
                if(!this.BillMaking.RemitterName){
                    this.$message.warning('请输入汇款人');
                    return
                }
                if(!this.BillMaking.TradeDate){
                    this.$message.warning('请选择汇款时间');
                    return
                }
                if(!this.BillMaking.AccountNumber){
                    this.$message.warning('请输入流水号');
                    return
                }
                if(this.obj.checkList.indexOf('1')!=-1&&this.airTickets.detailList){
                    this.BillMaking = {
                        IsPublic:this.BillMaking.IsPublic,//	账户类型 0私账 1公账
                        BType:this.BillMaking.BType,//银行类型 看财务单据那边有枚举列表
                        AccountId:this.BillMaking.AccountId,//	账户ID
                        WBMoney:this.airTickets.WBMoney,//原币总金额
                        OriginalFee:this.airTickets.OriginalFee,//原币手续费
                        RB_Branch_Id:this.BillMaking.RB_Branch_Id,//公司ID
                        RB_Depart_Id:this.BillMaking.RB_Depart_Id,//部门ID
                        RemitterName:this.BillMaking.RemitterName,//	汇款人
                        TradeDate:this.BillMaking.TradeDate,//交易日期
                        AccountNumber:this.BillMaking.AccountNumber,//流水号
                        TemplateId:this.BillMaking.TemplateId,//流程ID
                        OtherType:this.BillMaking.OtherType,//默认=55
                        ReFinanceId:this.BillMaking.ReFinanceId,//订单ID
                        ReFinanceId2:this.BillMaking.ReFinanceId2,//类型 1收款
                        GuestId:this.BillMaking.GuestId,//客人ID
                        RelevanceFrId:'1',
                        vorcherInos:this.BillMaking.vorcherInos,
                        detailList:this.airTickets.detailList
                    }
                    this.msgList.push(this.BillMaking)
                }
                if(this.obj.checkList.indexOf('2')!=-1&&this.visa.detailList){
                    this.BillMaking = {
                        IsPublic:this.BillMaking.IsPublic,//	账户类型 0私账 1公账
                        BType:this.BillMaking.BType,//银行类型 看财务单据那边有枚举列表
                        AccountId:this.BillMaking.AccountId,//	账户ID

                        WBMoney:this.visa.WBMoney,//原币总金额
                        OriginalFee:this.visa.OriginalFee,//原币手续费

                        RB_Branch_Id:this.BillMaking.RB_Branch_Id,//公司ID
                        RB_Depart_Id:this.BillMaking.RB_Depart_Id,//部门ID
                        RemitterName:this.BillMaking.RemitterName,//	汇款人
                        TradeDate:this.BillMaking.TradeDate,//交易日期
                        AccountNumber:this.BillMaking.AccountNumber,//流水号
                        TemplateId:this.BillMaking.TemplateId,//流程ID
                        OtherType:this.BillMaking.OtherType,//默认=55
                        ReFinanceId:this.BillMaking.ReFinanceId,//订单ID
                        ReFinanceId2:this.BillMaking.ReFinanceId2,//类型 1收款
                        GuestId:this.BillMaking.GuestId,//客人ID
                        RelevanceFrId:'2',
                        vorcherInos:this.BillMaking.vorcherInos,

                        detailList:this.visa.detailList
                    }
                    this.msgList.push(this.BillMaking)
                }
                if(this.obj.checkList.indexOf('3')!=-1&&this.ground.detailList){
                    this.BillMaking = {
                        IsPublic:this.BillMaking.IsPublic,//	账户类型 0私账 1公账
                        BType:this.BillMaking.BType,//银行类型 看财务单据那边有枚举列表
                        AccountId:this.BillMaking.AccountId,//	账户ID

                        WBMoney:this.ground.WBMoney,//原币总金额
                        OriginalFee:this.ground.OriginalFee,//原币手续费

                        RB_Branch_Id:this.BillMaking.RB_Branch_Id,//公司ID
                        RB_Depart_Id:this.BillMaking.RB_Depart_Id,//部门ID
                        RemitterName:this.BillMaking.RemitterName,//	汇款人
                        TradeDate:this.BillMaking.TradeDate,//交易日期
                        AccountNumber:this.BillMaking.AccountNumber,//流水号
                        TemplateId:this.BillMaking.TemplateId,//流程ID
                        OtherType:this.BillMaking.OtherType,//默认=55
                        ReFinanceId:this.BillMaking.ReFinanceId,//订单ID
                        ReFinanceId2:this.BillMaking.ReFinanceId2,//类型 1收款
                        GuestId:this.BillMaking.GuestId,//客人ID
                        RelevanceFrId:'3',
                        vorcherInos:this.BillMaking.vorcherInos,
                        
                        detailList:this.ground.detailList
                    }
                    this.msgList.push(this.BillMaking)
                }
                if(this.obj.checkList.indexOf('4')!=-1&&this.combo.detailList){
                    this.BillMaking = {
                        IsPublic:this.BillMaking.IsPublic,//	账户类型 0私账 1公账
                        BType:this.BillMaking.BType,//银行类型 看财务单据那边有枚举列表
                        AccountId:this.BillMaking.AccountId,//	账户ID

                        WBMoney:this.combo.WBMoney,//原币总金额
                        OriginalFee:this.combo.OriginalFee,//原币手续费

                        RB_Branch_Id:this.BillMaking.RB_Branch_Id,//公司ID
                        RB_Depart_Id:this.BillMaking.RB_Depart_Id,//部门ID
                        RemitterName:this.BillMaking.RemitterName,//	汇款人
                        TradeDate:this.BillMaking.TradeDate,//交易日期
                        AccountNumber:this.BillMaking.AccountNumber,//流水号
                        TemplateId:this.BillMaking.TemplateId,//流程ID
                        OtherType:this.BillMaking.OtherType,//默认=55
                        ReFinanceId:this.BillMaking.ReFinanceId,//订单ID
                        ReFinanceId2:this.BillMaking.ReFinanceId2,//类型 1收款
                        GuestId:this.BillMaking.GuestId,//客人ID
                        RelevanceFrId:'4',
                        vorcherInos:this.BillMaking.vorcherInos,
                        
                        detailList:this.combo.detailList
                    }
                    this.msgList.push(this.BillMaking)
                }
                this.clickShow = true
                this.apipost2("Financial_post_SetFinanceInfoForCRMIn",this.msgList,(res)=>{
                    if (res.data.resultCode == 1) {
                        this.clickShow = false
                        this.dialogTableVisible = false;
                        this.MsgBus.$emit("closeBillMaking");
                        this.MsgBus.$emit("closeGetList");
                        this.msgList=[]
                        this.$confirm(res.data.message, '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '',
                            type: 'warning'
                            }).then(() => {
                                
                            }).catch(() => {
                                
                        });
                    } else {
                        this.msgList=[]
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                })
            },
            // 修改出签状态
            SetOrderVisaState(){
                if(this.Voucher.length==0){
                    this.$message.warning('请上传凭证！');
                    return
                }
                let data = {
                    OrderId:this.obj.OrderId,//订单ID
                    Voucher:this.Voucher
                }
                this.clickShow = true
                this.apipost("/api/Order/SetOrderVisaState",data,(res)=>{
                    if (res.data.resultCode == 1) {
                        this.clickShow = false
                        this.dialogTableVisible = false;
                        this.Voucher = []
                        this.MsgBus.$emit("closeBillMaking");
                        this.MsgBus.$emit("closeGetList");
                        this.$message.success(res.data.message);
                    } else {
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                })
            },
            // 订单收损
            SetOrderLoss(){
                if(this.checkList.indexOf('1')!=-1){
                    if(!this.form.LossAirTicketMoney){
                        this.$message.warning('请输入机票收损金额');
                        return
                    }else if(this.form.LossAirTicketMoney>this.form.TicketMoney){
                        this.$message.warning('机票收损金额不得超出应收金额');
                        return
                    }else{
                        this.AirTicketLoss.LossMoney = this.form.LossAirTicketMoney
                        this.msgLoss.OrderLoss.push(this.AirTicketLoss)
                    }
                    
                }
                if(this.checkList.indexOf('2')!=-1){
                    if(!this.form.LossVisaMoney){
                        this.$message.warning('请输入签证收损金额');
                        return
                    }else if(this.form.LossVisaMoney>this.form.VisaMoney){
                        this.$message.warning('签证收损金额不得超出应收金额');
                        return
                    }else{
                        this.visaLoss.LossMoney = this.form.LossVisaMoney
                        this.msgLoss.OrderLoss.push(this.visaLoss)
                    }
                }
                if(this.checkList.indexOf('3')!=-1){
                    if(!this.form.LossGroundMoney){
                        this.$message.warning('请输入地接损金额');
                        return
                    }else if(this.form.LossGroundMoney>this.form.DiJieMoney){
                        this.$message.warning('地接收损金额不得超出应收金额');
                        return
                    }else{
                        this.groundLoss.LossMoney = this.form.LossGroundMoney
                        this.msgLoss.OrderLoss.push(this.groundLoss)
                    }
                }
                if(this.checkList.indexOf('4')!=-1){
                    if(!this.form.LossComboMoney){
                        this.$message.warning('请输入套餐收损金额');
                        return
                    }else if(this.form.LossComboMoney>this.form.MealMoney){
                        this.$message.warning('套餐收损金额不得超出应收金额');
                        return
                    }else{
                        this.comboLoss.LossMoney = this.form.LossComboMoney
                        this.msgLoss.OrderLoss.push(this.comboLoss)
                    }
                }
                this.msgLoss.OrderLoss = this.msgLoss.OrderLoss.sort((a,b)=>a.OrderType-b.OrderType)
                this.clickShow = true
                this.apipost("/api/Order/SetOrderLoss",this.msgLoss,(res)=>{
                    if (res.data.resultCode == 1) {
                        this.clickShow = false
                        this.dialogTableVisible = false;
                        this.msgLoss.OrderLoss = []
                        this.MsgBus.$emit("closeBillMaking");
                        this.MsgBus.$emit("closeGetList");
                        this.$message.success(res.data.message);
                    } else {
                        this.msgLoss.OrderLoss = []
                        this.clickShow = false
                        this.$message.error(res.data.message);
                    }
                })
            },
            submitForm(addMsg) {
                //提交创建、修改表单
                if (this.name == '新建机票订单' || this.name == '编辑机票订单') {
                    this.$refs[addMsg].validate((valid) => {
                        if (valid) {
                            this.addData();
                        } else {
                            return false;
                        }
                    });
                }
                if (this.name == '编辑订单金额') {
                    this.$refs[addMsg].validate((valid) => {
                        if (valid) {
                            this.editData();
                        } else {
                            return false;
                        }
                    });
                }
                if (this.name == '修改出票状态') {
                    this.$refs[addMsg].validate((valid) => {
                        if (valid) {
                            this.reviseData();
                        } else {
                            return false;
                        }
                    });
                }
                if (this.name == '操作日志') {
                    this.dialogTableVisible = false;
                    this.MsgBus.$emit("closeTicketOrderDialogBox");
                }
                if (this.name == '订单转交') {
                    this.$refs[addMsg].validate((valid) => {
                        if (valid) {
                            this.ConvertData();
                        } else {
                            return false;
                        }
                    });
                }
                if(this.name=='制单'){
                    this.Financial_post_SetFinanceInfoForCRMIn()
                }
                if(this.name=='修改出签状态'){
                    this.SetOrderVisaState()
                }
                if(this.name=='凭证图'||this.name=='出签凭证图'){
                    this.dialogTableVisible = false;
                    this.MsgBus.$emit("closeTicketOrderDialogBox");
                }
                if(this.name=='订单收损'){
                    this.SetOrderLoss()
                }

            },
            resetForm(formName) {
                this.dialogTableVisible = false;
                this.MsgBus.$emit("closeTicketOrderDialogBox");
                this.MsgBus.$emit("closeBillMaking");
                // 重置表单
                this.form = {
                    OrderId: 0,
                    GuestId: null,
                    GuestCount: 1,
                    StartCityName: "",
                    EndCityName: "",
                    Money: null,
                    Remark: "",
                    EnterId: ""
                };
                this.$refs[formName].resetFields();
            },
            handleSizeChange(val) {
                this.msg.pageSize = val;
                this.getList();
            },
            handleCurrentChange(val) {
                this.msg.pageIndex = val;
                this.getList();
            },
        },
    };
</script>