  <template>
    <div class="app-container calendar-list-container">
      <el-form :rules="rules" ref="addForm" :model="updateOrderInfo" label-position="left" label-width="100px"
                style='width:100%;'>
              <div class = "userbox">
                <div class = "boxtitle" id="footer">订单信息</div>
                <el-row :gutter="24" style="margin-bottom:25px;margin-top:25px;">
                <el-col :xs="23" :sm="23" :md="22" :lg="12" :xl="12">
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.orderno')" >
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_no" :disabled="true" style="width: 100%;" > </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.user')" prop="od_user_name">
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_username" :disabled="true" style="width: 100%;"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                  <el-col :xs="23" :sm="23" :md="11" :lg="5" :xl="5">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.date')" prop="od_phone" >
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_date" :disabled="true"  style="width: 100%;" @blur="queryDcIntroducers"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                </el-row>
              </div>

              <div class = "userbox2">
                <div class = "boxtitle" id="footer">用户信息</div>
                <el-row :gutter="24" style="margin-bottom:20px;margin-top:20px;">
                <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple">
                    <el-form-item :label="$t('order.userInfo')">
                    <div class="block">
                      <el-select v-model="source_information" placeholder="请选择用户" filterable clearable remote
                        v-el-select-loadmore="loadmore" :remote-method="selectedRemoteMethod" :loading="selectedLoading"
                        @change="selectedChange" @clear="clearUser">
                        <el-option v-for="item in options" :key="item.id"
                          :label="item.fb_customer_name + ' ' + item.fb_customer_phone" :value="item">
                        </el-option>
                      </el-select>
                    </div>
                  </el-form-item>
                  </div>
                </el-col>
                <!-- <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.cmphone')" prop="od_phone">
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_phone"  @blur="clearnDc" style="width:100%;"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col> -->
                <el-col :xs="22" :sm="22" :md="10" :lg="6" :xl="6">
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.od_user_address')">
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_user_address" style="width:100%;"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :xs="22" :sm="22" :md="10" :lg="5" :xl="5">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.od_expected_date')"  >
                      <div class="block">
                         <el-date-picker v-model="updateOrderInfo.od_expected_date" value-format="yyyy-MM-dd"  align="right" type="date" placeholder="选择日期" :picker-options="pickerOptions1" style="width:100%;">
                        </el-date-picker>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
              </el-row>
              </div>
              
              <div class = "userbox2">
                <div class = "boxtitle" id="footer">服务范围</div>
                <el-row :gutter="24" style="margin-top: 25px;">
                <el-col :xs="23" :sm="23" :md="12" :lg="6" :xl="6">
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.cityid')" prop="od_cityid">
                      <div class="block">
                        <el-select v-if="mktEnable" disabled  class="filter-item" style="width:100%;" v-model="updateOrderInfo.od_cityid" default-first-optionplaceholder="请选择城市">
                            <el-option v-for="item in citysOptions" :key="item.branche_code" :label="item.branche_name" :value="item.branche_code">
                            </el-option>
                          </el-select>
                          <el-select v-else class="filter-item" style="width:100%;" v-model="updateOrderInfo.od_cityid" default-first-optionplaceholder="请选择城市" @change="cityChange">
                            <el-option v-for="item in citysOptions" :key="item.branche_code" :label="item.branche_name" :value="item.branche_code">
                            </el-option>
                          </el-select>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.contract')" prop="od_contract" >
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_contract" style="width:100%;"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                  <el-col :xs="23" :sm="23" :md="12" :lg="6" :xl="6" >
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.packageid')" prop="od_product_id" >
                      <div class="block">
                        <el-select class="filter-item" v-model="updateOrderInfo.od_product_id" default-first-optionplaceholder="请选择套餐" style="width: 100%;" @change="productChange">
                          <el-option v-for="item in packageoptions" :key="item.p_code" :label="item.p_name" :value="item.p_code">
                          </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                  <el-col :xs="23" :sm="23" :md="11" :lg="5" :xl="5">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.days')" prop="od_product_item_id" >
                      <div class="block">
                        <el-input v-model="updateOrderInfo.od_product_item_id" style="width:100%;" @blur="dateChange"> </el-input>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
              </el-row>
                <el-row :gutter="24">
                <el-col :xs="23" :sm="23" :md="12" :lg="6" :xl="6">
                  <div class="grid-content bg-purple">
                    <el-form-item  :label="$t('order.startdate')" prop="od_startdate" >
                      <div class="block">
                        <el-date-picker v-model="updateOrderInfo.od_startdate" @change="dateChange" value-format="yyyy-MM-dd" align="right" type="date" placeholder="选择日期" :picker-options="pickerOptions1" style="width:100%;">
                        </el-date-picker>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                  <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.enddate')" >
                      <div class="block">
                        <el-date-picker v-model="updateOrderInfo.od_enddate" value-format="yyyy-MM-dd" :disabled="true" align="right" type="date" placeholder="选择日期" :picker-options="pickerOptions1" style="width: 100%;">
                        </el-date-picker>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :xs="23" :sm="23" :md="12" :lg="6" :xl="6">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.mmid')" prop="od_mmid">
                      <div class="block">
                        <el-select class="filter-item" filterable v-model="updateOrderInfo.od_mmid" style="width:100%;">
                        <el-option v-for="item in mmsoptions" :key="item.id" :label="item.truename" :value="item.id">
                        </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :xs="23" :sm="23" :md="11" :lg="5" :xl="5">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.consultant')" prop="od_consultantid" >
                      <div class="block">
                    <el-select class="filter-item" v-if="isvisit" v-model="updateOrderInfo.od_consultantid" filterable  style="width:100%;">
                    <el-option v-for="item in consultantOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                    </el-select>
                    <el-select class="filter-item" v-else disabled v-model="updateOrderInfo.od_consultantid" filterable  style="width:100%;">
                    <el-option v-for="item in consultantOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                    </el-select>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                </el-row>
                <el-row :gutter="24" >
                <el-col :xs="23" :sm="23" :md="11" :lg="6" :xl="6">
                  <div class="grid-content bg-purple" >
                    <el-form-item  :label="$t('order.introducer')" prop="od_introducer_phone" >
                      <div class="block">
                        <el-select class="filter-item" v-model="updateOrderInfo.od_introducer_phone" filterable  @focus="queryDcIntroducers" @change="changeIntroducer" style="width:100%;">
                        <el-option v-for="item in IntroducerOptions" :key="item.wv_phone" :label="item.wv_phone" :value="item.wv_phone">
                        </el-option>
                        </el-select>
                      </div>
                    </el-form-item>
                  </div>
                </el-col>
                </el-row>
              </div>
              <div class = "userbox2">
                <div class = "boxtitle" id="footer">优惠信息</div>
                <el-row :gutter="24" style="margin-bottom: 20px;">
                  <el-col :xs="23" :sm="23" :md="23" :lg="12" :xl="12">
                    <div style="margin-top:20px;"></div>
                    <el-radio v-model="discountItem" label="活动优惠" style="margin-left:3%;" @change="choseDiscount"/>
                      <el-select class="filter-item" v-model="updateOrderInfo.od_promotion_id" filterable style="width: 35%;margin-left:2%;">
                        <el-option v-for="item in promotionOptions" :key="item.id" :label="item.po_name" :value="item.id">
                        </el-option>
                      </el-select>
                      <el-input-number v-model="promotion_discount_show" style="width: 22%;margin-left:2%;" :controls=false :precision="2" :max="9999999" @blur="changeDiscount"> </el-input-number>
                  </el-col>
                    <el-col :xs="23" :sm="23" :md="23" :lg="11" :xl="11">
                      <div style="margin-top:20px;"></div>
                      <el-radio v-model="discountItem" label="介绍优惠" style="margin-left:3%;" @change="choseDiscount"/>
                      <el-input-number v-model="mgm_discount_show" :disabled="true" style="width: 60%;margin-left:2%;"  :controls=false :precision="2" :max="9999999" @blur="changeDiscount"> </el-input-number>
                    </el-col>
                </el-row>
                <el-row :gutter="24" style="margin-top: 25px;margin-bottom: 25px;">
                  <el-col :xs="23" :sm="23" :md="23" :lg="12" :xl="12">
                    <el-radio v-model="discountItem" label="其他优惠" style="margin-left:3%;" @change="choseDiscount" />
                    <el-input-number v-model="other_discount_show" style="width: 60%;margin-left:2%;" :controls=false :precision="2" :max="9999999" @blur="changeDiscount"> </el-input-number>
                  </el-col>
                </el-row>
              </div>
              <div class = "userbox2">
                <div class = "boxtitle" id="footer">订单金额</div>
                 <el-row  :gutter="24" style="margin-top: 20px;">
                  <el-col :xs="23" :sm="23" :md="23" :lg="12" :xl="12">
                    <div class="grid-content bg-purple">
                      <el-form-item  :label="$t('order.packageamount')" prop="od_order_amount">
                        <div class="block">
                          <el-input-number v-model="updateOrderInfo.od_order_amount" style="width: 74.5%;margin-left:2.5%;" :controls=false :precision="2" :max="9999999" @blur="getDiscount"> </el-input-number>
                        </div>
                      </el-form-item>
                    </div>
                  </el-col>
                  <el-col :xs="23" :sm="23" :md="23" :lg="12" :xl="12">
                    <div class="grid-content bg-purple">
                      <el-form-item  :label="$t('order.od_vip_cash')">
                        <div class="block">
                          <el-input-number v-model="od_discount_show" :disabled="true" style="width: 74.5%;margin-left:2.5%;" :controls=false :precision="2" :max="9999999"> </el-input-number>
                        </div>
                      </el-form-item>
                    </div>
                  </el-col>
                  <el-col :xs="23" :sm="23" :md="23" :lg="12" :xl="12" >
                    <div class="grid-content bg-purple" >
                      <el-form-item  :label="$t('order.payamount')" prop="od_order_pay_amount" >
                        <div class="block">
                          <el-input-number v-model="updateOrderInfo.od_order_pay_amount" style="width: 74.5%;margin-left:2.5%;" :controls=false :precision="2" :max="9999999"> </el-input-number>
                        </div>
                      </el-form-item>
                    </div>
                  </el-col>
                </el-row>
              </div>
              <el-row :gutter="24" style="margin-top: 15px; width:100%;">
                <el-col :span="24" style="margin-top:10px;">
                  &nbsp;<span style="color:red;font-size:14px;">{{tips}}</span>
                </el-col>
              </el-row>
              <el-row :gutter="24" style="margin-top: 15px; width:100%;">
              <el-col ::span="24" style="text-align: center;">
                <div>
                  <el-button  type="primary" :loading ="buttonloading" @click="UpdateYsOrder">{{$t('table.confirm')}}</el-button>
                  <el-button @click="handleref()">{{$t('navbar.reset')}}</el-button>
                </div>
              </el-col>
            </el-row>
          </el-form>
      <el-dialog title="Reading statistics" :visible.sync="dialogPvVisible">
        <el-table :data="pvData" border fit highlight-current-row style="width: 100%">
          <el-table-column prop="key" label="Channel"></el-table-column>
          <el-table-column prop="pv" label="Pv"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="dialogPvVisible = false">{{$t('table.confirm')}}</el-button>
        </span>
      </el-dialog>
    </div>
  </template>
  <script>
    import { getBranches, createArticle, queryServiceUserStockCondition, checkStockDate } from '@/api/article'
    import { updateYSOrder, getYSOrder, mdjCalculate, queryDcIntroducersByUser } from '@/api/order'
    import { listAllInfoBasic } from '@/api/customers'
    import { getPackageSelect } from '@/api/couponapi'
    import { getQueryPromotionOfflines } from '@/api/promotion'
    import { getConsultants } from '@/api/dc'
    import waves from '@/directive/waves' // 水波纹指令
    import { parseTime } from '@/utils'
    import { getPackageDetail } from '@/api/packageapi'
    import regex from '@/utils/regex'
    // arr to obj ,such as { CN : "China", US : "USA" }
    export default {
      name: 'ysorderedit123', // 不使用keep-alive 故意写错名
      directives: {
        waves,
        'el-select-loadmore': {

          bind(el, binding) {
            // 获取element-ui定义好的scroll盒子
            const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
            SELECTWRAP_DOM.addEventListener('scroll', function() {
              /**
             * scrollHeight 获取元素内容高度(只读)
             * scrollTop 获取或者设置元素的偏移值,常用于, 计算滚动条的位置, 当一个元素的容器没有产生垂直方向的滚动条, 那它的scrollTop的值默认为0.
             * clientHeight 读取元素的可见高度(只读)
             * 如果元素滚动到底, 下面等式返回true, 没有则返回false:
             * ele.scrollHeight - ele.scrollTop === ele.clientHeight;
             */
              const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
              if (condition) {
                binding.value()
              }
            })
          }
        }
      },
      filters: {
        numFilter(value) {
          return parseFloat(value).toFixed(2)
        }
      },
      data() {
        return {
          userMkt: null,
          mktEnable: null,
          isvisit: true,
          tableKey: 0,
          list: null,
          total: null,
          selectedLoading: false,
          page: 1,
          limit: 10,
          queryType: 'list',
          listLoading: true,
          buttonloading: false,
          ordertempQuery: {
            id: undefined
          },
          checkCouponCreate: 0,
          checkCouponbatch: {
            id: null
          },
          updateOrderInfo: {
            od_no: null,
            od_user_name: null,
            od_phone: null,
            od_user_address: null,
            od_expected_date: null,
            od_status: null,
            od_cityid: null,
            od_contract: null,
            od_startdate: null,
            od_enddate: null,
            od_mmid: null,
            od_consultantid: null,
            od_product_id: null,
            od_product_item_id: null,
            od_introducer_phone: null,
            od_introducer_consultant: null,
            od_order_amount: 0,
            od_order_pay_amount: null,
            od_mgm_discount: null,
            od_promotion_discount: null,
            od_other_discount: null,
            od_rebate_amount: null,
            od_promotion_id: 999001,
            od_date: null
          },
          mdjCalculateInfo: {
            odCityCode: null,
            odAmount: null,
            odNo: null,
            odPhone: null,
            odStatus: null,
            odIntroducerPhone: null,
            odProductItem: null
          },
          updateOrderInfoOld: {
            od_no: null,
            od_user_name: null,
            od_phone: null,
            od_user_address: null,
            od_expected_date: null,
            od_status: null,
            od_cityid: null,
            od_contract: null,
            od_startdate: null,
            od_enddate: null,
            od_mmid: null,
            od_consultantid: null,
            od_product_id: null,
            od_product_item_id: null,
            od_introducer_phone: null,
            od_introducer_consultant: null,
            od_order_amount: 0,
            od_order_pay_amount: null,
            od_mgm_discount: null,
            od_promotion_discount: null,
            od_other_discount: null,
            od_rebate_amount: null,
            od_promotion_id: 999001,
            od_date: null
          },
          od_discount_show: 0,
          promotion_discount_show: 0,
          mgm_discount_show: 0,
          other_discount_show: 0,
          od_rebate_amount: 0,
          discountItem: null,
          tips: null,
          od_discount_showOld: 0,
          promotion_discount_showOld: 0,
          mgm_discount_showOld: 0,
          other_discount_showOld: 0,
          od_rebate_amountOld: 0,
          discountItemOld: null,
          pickerOptions1: {
            shortcuts: [{
              text: '今天',
              onClick(picker) {
                picker.$emit('pick', new Date())
              }
            }, {
              text: '昨天',
              onClick(picker) {
                const date = new Date()
                date.setTime(date.getTime() - 3600 * 1000 * 24)
                picker.$emit('pick', date)
              }
            }, {
              text: '一周前',
              onClick(picker) {
                const date = new Date()
                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
                picker.$emit('pick', date)
              }
            }]
          },
          sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
          branchesOptions: [],
          IntroducerOptions: [],
          citysOptions: [],
          packageoptions: [],
          consultantOptions: [],
          mmsoptions: [],
          promotionOptions: [],
          showReviewer: false,
          ethnicgroupptions: '',
          provinceoptions: '',
          dialogFormVisible: false,
          checkidcard: {
            idcard: undefined
          },
          orderQuer: {
            id: null
          },
          checkdate: {
            servant_code: undefined,
            stock_status: undefined,
            start_date: undefined,
            end_date: undefined
          },
          queryIntroducer: {
            xul_phone: null
          },
          querPackage: {
            p_code: null
          },
          dialogStatus: '',
          dialogPvVisible: false,
          pvData: [],
          updateStatus: {
            id: undefined,
            status: undefined
          },
          rules: {
            od_phone: [{ required: true, message: '请输入手机号码！', trigger: 'blur' },
              { pattern: regex.REPHONE, message: '手机号格式错误！', trigger: 'blur' }],
            od_user_name: [{ required: true, message: '请输入用户姓名！', trigger: 'blur' }],
            od_cityid: [{ required: true, message: '请选择服务城市！', trigger: 'blur' }],
            od_contract: [{ required: true, message: '请选输入合同号！', trigger: 'blur' }],
            od_startdate: [{ required: true, message: '请输入开始日期！', trigger: 'blur' }],
            od_enddate: [{ required: true, message: '请输入结束日期！', trigger: 'blur' }],
            od_mmid: [{ required: true, message: '请选择月嫂！', trigger: 'blur' }],
            od_consultantid: [{ required: true, message: '请选择顾问！', trigger: 'blur' }],
            od_product_id: [{ required: true, message: '请选择套餐！', trigger: 'blur' }],
            od_product_item_id: [{ required: true, message: '请输入服务天数！', trigger: 'blur' },
              { pattern: regex.NUMBER, message: '服务天数格式错误！', trigger: 'blur' }],
            od_order_amount: [{ required: true, message: '请输入订单金额！', trigger: 'blur' }],
            od_order_pay_amount: [{ required: true, message: '支付金额不能为空！', trigger: 'blur' },
              { pattern: regex.MONEY, message: '支付金额不能为空！', trigger: 'blur' }]
          },
          textMap: {
            update: 'Edit',
            create: '添加介绍人'
          },
          source_information: '',
          source_information_old: '',
          formData: {
            page: 1,
            limit: 10,
            selectedPage: ''
          },
          options: [],
          downloadLoading: false,
          view: {
            name: undefined,
            path: undefined,
            title: undefined
          }
        }
      },
      destroyed() {
        this.view.name = 'ysorderedit'
        this.view.path = '/order/ysorder_edit'
        this.view.title = 'ysorderedit'
        this.$store.dispatch('delVisitedViews', this.view)
      },
      created() {
        if (this.$store.getters.isvisit === 1) {
          this.updateOrderInfo.od_consultantid = this.$store.getters.id
          this.isvisit = false
        }
        this.userMkt = this.$store.getters.mkt
        if (this.userMkt !== 'ALL') {
          this.updateOrderInfo.od_cityid = this.userMkt
          this.mktEnable = true
        }
        getBranches().then(response5 => {
          this.branchesOptions = response5.data
          this.citysOptions = response5.data
        })
        getPackageSelect().then(response6 => {
          this.packageoptions = response6.data
        })
        getConsultants().then(response => {
          this.consultantOptions = response.data
        })
        getQueryPromotionOfflines().then(response6 => {
          this.promotionOptions = response6.data
          this.promotionOptions.push({ id: 999001, po_name: '临时活动' })
        })
        this.orderQuer.id = this.$route.params.orderid
        this.getList()
      },
      mounted() {
        this.getSelectList(this.formData)
      },
      methods: {
        clearnDc() {
          this.updateOrderInfo.od_introducer_phone = null
        },
        handleClose(done) {
          this.$confirm('确认关闭？').then(_ => {
            done()
          }).catch(_ => {})
        },
        getList() {
          getYSOrder(this.orderQuer).then(response => {
            var queryStock = {}
            queryStock.service_start = response.data.orderInfo.od_startdate
            queryStock.days = response.data.orderInfo.od_product_item_id
            queryStock.status = 1
            queryStock.limit = 100
            queryStock.cityname = response.data.orderInfo.od_cityid
            queryStock.page = 1
            queryServiceUserStockCondition(queryStock).then(response666 => {
              this.mmsoptions = response666.data.items
            })
            this.updateOrderInfo.od_no = response.data.orderInfo.od_no
            this.updateOrderInfo.od_user_name = response.data.orderInfo.od_user_name
            this.updateOrderInfo.od_phone = response.data.orderInfo.od_phone
            this.updateOrderInfo.od_user_address = response.data.orderInfo.od_user_address
            this.updateOrderInfo.od_expected_date = response.data.orderInfo.od_expected_date
            this.updateOrderInfo.od_status = response.data.orderInfo.od_status
            this.updateOrderInfo.od_cityid = String(response.data.orderInfo.od_cityid)
            this.updateOrderInfo.od_contract = response.data.orderInfo.od_contract
            this.updateOrderInfo.od_startdate = response.data.orderInfo.od_startdate
            this.updateOrderInfo.od_enddate = response.data.orderInfo.od_enddate
            this.updateOrderInfo.od_mmid = Number(response.data.orderInfo.od_mmid)
            this.updateOrderInfo.od_consultantid = Number(response.data.orderInfo.od_consultantid)
            this.updateOrderInfo.od_product_id = String(response.data.orderInfo.od_product_id)
            this.updateOrderInfo.od_product_item_id = response.data.orderInfo.od_product_item_id
            this.updateOrderInfo.od_introducer_phone = response.data.orderInfo.od_introducer_phone
            this.updateOrderInfo.od_introducer_consultant = response.data.orderInfo.od_introducer_consultant
            this.updateOrderInfo.od_order_amount = response.data.orderInfo.od_order_amount
            this.updateOrderInfo.od_order_pay_amount = response.data.orderInfo.od_order_pay_amount
            this.updateOrderInfo.od_mgm_discount = response.data.orderInfo.od_mgm_discount
            this.updateOrderInfo.od_other_discount = response.data.orderInfo.od_other_discount
            this.updateOrderInfo.od_promotion_discount = response.data.od_promotion_discount
            this.updateOrderInfo.od_rebate_amount = response.data.orderInfo.od_rebate_amount
            this.updateOrderInfo.od_promotion_id = response.data.orderInfo.od_promotion_id
            this.updateOrderInfo.od_username = response.data.orderInfo.od_username
            this.updateOrderInfo.od_date = response.data.orderInfo.od_date
            // ----------------------
            this.updateOrderInfoOld.od_user_name = response.data.orderInfo.od_user_name
            this.updateOrderInfoOld.od_phone = response.data.orderInfo.od_phone
            this.updateOrderInfoOld.od_user_address = response.data.orderInfo.od_user_address
            this.updateOrderInfoOld.od_expected_date = response.data.orderInfo.od_expected_date
            this.updateOrderInfoOld.od_status = response.data.orderInfo.od_status
            this.updateOrderInfoOld.od_cityid = String(response.data.orderInfo.od_cityid)
            this.updateOrderInfoOld.od_contract = response.data.orderInfo.od_contract
            this.updateOrderInfoOld.od_startdate = response.data.orderInfo.od_startdate
            this.updateOrderInfoOld.od_enddate = response.data.orderInfo.od_enddate
            this.updateOrderInfoOld.od_mmid = Number(response.data.orderInfo.od_mmid)
            this.updateOrderInfoOld.od_consultantid = Number(response.data.orderInfo.od_consultantid)
            this.updateOrderInfoOld.od_product_id = String(response.data.orderInfo.od_product_id)
            this.updateOrderInfoOld.od_product_item_id = response.data.orderInfo.od_product_item_id
            this.updateOrderInfoOld.od_introducer_phone = response.data.orderInfo.od_introducer_phone
            this.updateOrderInfoOld.od_introducer_consultant = response.data.orderInfo.od_introducer_consultant
            this.updateOrderInfoOld.od_order_amount = response.data.orderInfo.od_order_amount
            this.updateOrderInfoOld.od_order_pay_amount = response.data.orderInfo.od_order_pay_amount
            this.updateOrderInfoOld.od_mgm_discount = response.data.orderInfo.od_mgm_discount
            this.updateOrderInfoOld.od_other_discount = response.data.orderInfo.od_other_discount
            this.updateOrderInfoOld.od_promotion_discount = response.data.orderInfo.od_promotion_discount
            this.updateOrderInfoOld.od_promotion_id = response.data.orderInfo.od_promotion_id
            this.updateOrderInfoOld.od_rebate_amount = response.data.orderInfo.od_rebate_amount
            this.updateOrderInfoOld.od_date = response.data.orderInfo.od_date
            this.source_information = response.data.orderInfo.od_user_name + ' ' + response.data.orderInfo.od_phone
            this.source_information_old = response.data.orderInfo.od_user_name + ' ' + response.data.orderInfo.od_phone
            this.listLoading = false
            this.buttonloading = false
            // ----------------
            this.od_discount_show = response.data.orderInfo.od_mgm_discount + response.data.orderInfo.od_promotion_discount + response.data.orderInfo.od_other_discount
            this.promotion_discount_show = response.data.orderInfo.od_promotion_discount
            this.mgm_discount_show = response.data.orderInfo.od_mgm_discount
            this.other_discount_show = response.data.orderInfo.od_other_discount
            this.od_rebate_amount = response.data.orderInfo.od_rebate_amount
            this.od_discount_showOld = response.data.orderInfo.od_mgm_discount + response.data.orderInfo.od_promotion_discount + response.data.orderInfo.od_other_discount
            this.promotion_discount_showOld = response.data.orderInfo.od_promotion_discount
            this.mgm_discount_showOld = response.data.orderInfo.od_mgm_discount
            this.other_discount_showOld = response.data.orderInfo.od_other_discount
            this.od_rebate_amountOld = response.data.orderInfo.od_rebate_amount
            if (response.data.orderInfo.od_promotion_discount > 0) {
              this.discountItem = '活动优惠'
              this.discountItemOld = '活动优惠'
            } else if (response.data.orderInfo.od_mgm_discount > 0) {
              this.discountItem = '介绍优惠'
              this.discountItemOld = '介绍优惠'
            } else if (response.data.orderInfo.od_other_discount > 0) {
              this.discountItem = '其他优惠'
              this.discountItemOld = '其他优惠'
            } else {
              this.updateOrderInfo.od_promotion_id = 999001
            }
            this.discountInit()
            // this.getMMStock()
          })
        },
        UpdateYsOrder() {
          this.$refs['addForm'].validate((valid) => {
            if (valid) {
              // const date1 = Date.parse(this.updateOrderInfo.od_startdate)
              // const date2 = Date.parse(this.updateOrderInfo.od_enddate)
              // const diffDays = date2 - date1
              // if (diffDays < 0) {
              //   this.$message.error('请正确输入开始和结束日期')
              // } else {
              this.$confirm('请确正确录入订单信息！', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(() => {
                this.checkdate.servant_code = this.updateOrderInfo.od_mmid
                this.checkdate.start_date = this.updateOrderInfo.od_startdate
                this.checkdate.end_date = this.updateOrderInfo.od_enddate
                checkStockDate(this.checkdate).then(response3 => {
                  if (response3.data === 1) {
                    this.buttonloading = true
                    var date1 = new Date()
                    this.updateOrderInfo.id = this.$route.params.orderid
                    this.updateOrderInfo.od_user = this.$store.getters.introduction
                    this.updateOrderInfo.od_date = date1.getFullYear() + '-' + (date1.getMonth() + 1) + '-' + date1.getDate() + ' ' + date1.getHours() + ':' + date1.getMinutes() + ':' + date1.getSeconds()
                    updateYSOrder(this.updateOrderInfo).then(response => {
                      this.buttonloading = false
                      if (response.data !== 1) {
                        createArticle(this.temp).then(() => {
                          this.$notify({
                            title: '失败',
                            message: '保存失败',
                            type: 'warning',
                            duration: 2000
                          })
                        })
                      } else {
                        this.getList()
                        createArticle(this.temp).then(() => {
                          this.$notify({
                            title: '成功',
                            message: '保存成功',
                            type: 'success',
                            duration: 2000
                          })
                        })
                      }
                    })
                  } else {
                    this.$notify({
                      title: '失败',
                      message: '该月嫂无档期！',
                      type: 'warning',
                      duration: 2000
                    })
                  }
                })
              }).catch(() => {})
              // }
            }
          })
        },
        handleref() {
          var queryStock = {}
          queryStock.service_start = this.updateOrderInfoOld.od_startdate
          queryStock.days = this.updateOrderInfoOld.od_product_item_id
          queryStock.status = 1
          queryStock.limit = 100
          queryStock.cityname = this.updateOrderInfoOld.od_cityid
          queryStock.page = 1
          queryServiceUserStockCondition(queryStock).then(response => {
            this.mmsoptions = response.data.items
          })
          this.updateOrderInfo.od_user_name = this.updateOrderInfoOld.od_user_name
          this.updateOrderInfo.od_phone = this.updateOrderInfoOld.od_phone
          this.updateOrderInfo.od_user_address = this.updateOrderInfoOld.od_user_address
          this.updateOrderInfo.od_cityid = this.updateOrderInfoOld.od_cityid
          this.updateOrderInfo.od_contract = this.updateOrderInfoOld.od_contract
          this.updateOrderInfo.od_startdate = this.updateOrderInfoOld.od_startdate
          this.updateOrderInfo.od_enddate = this.updateOrderInfoOld.od_enddate
          this.updateOrderInfo.od_mmid = this.updateOrderInfoOld.od_mmid
          this.updateOrderInfo.od_consultantid = this.updateOrderInfoOld.od_consultantid
          this.updateOrderInfo.od_product_id = this.updateOrderInfoOld.od_product_id
          this.updateOrderInfo.od_product_item_id = this.updateOrderInfoOld.od_product_item_id
          this.updateOrderInfo.od_introducer_phone = this.updateOrderInfoOld.od_introducer_phone
          this.updateOrderInfo.od_introducer_consultant = this.updateOrderInfoOld.od_introducer_consultant
          this.updateOrderInfo.od_order_amount = this.updateOrderInfoOld.od_order_amount
          this.updateOrderInfo.od_order_pay_amount = this.updateOrderInfoOld.od_order_pay_amount
          this.updateOrderInfo.od_mgm_discount = this.updateOrderInfoOld.od_mgm_discount
          this.updateOrderInfo.od_other_discount = this.updateOrderInfoOld.od_other_discount
          this.updateOrderInfo.od_promotion_discount = this.updateOrderInfoOld.od_promotion_discount
          this.updateOrderInfo.od_promotion_id = this.updateOrderInfoOld.od_promotion_id
          this.updateOrderInfo.od_rebate_amount = this.updateOrderInfoOld.od_rebate_amount
          this.source_information = this.source_information_old
          // ----------
          this.od_discount_show = this.od_discount_showOld
          this.promotion_discount_show = this.promotion_discount_showOld
          this.mgm_discount_show = this.mgm_discount_showOld
          this.other_discount_show = this.other_discount_showOld
          this.od_rebate_amount = this.od_rebate_amountOld
          this.discountItem = this.discountItemOld
        },
        resetForm(formName) {
          this.$refs[formName].resetFields()
        },
        productChange() {
          this.querPackage.p_code = this.updateOrderInfo.od_product_id
          getPackageDetail(this.querPackage).then(response => {
            this.updateOrderInfo.od_order_amount = response.data.p_amount
            if (this.discountItem === '活动优惠') {
              this.updateOrderInfo.od_order_pay_amount = (Number(response.data.p_amount) - Number(this.promotion_discount_show))
            } else if (this.discountItem === '介绍优惠') {
              this.updateOrderInfo.od_order_pay_amount = (Number(response.data.p_amount) - Number(this.mgm_discount_show))
            } else if (this.discountItem === '其他优惠') {
              this.updateOrderInfo.od_order_pay_amount = (Number(response.data.p_amount) - Number(this.other_discount_show))
            } else {
              this.updateOrderInfo.od_order_pay_amount = Number(response.data.p_amount)
            }
            this.updateOrderInfo.od_product_item_id = response.data.p_days
            this.dateChange()
            this.getDiscount()
          })
        },
        queryDcIntroducers() {
          this.mgm_discount_show = 0
          this.od_rebate_amount = 0
          this.updateOrderInfo.od_mgm_discount = 0
          this.updateOrderInfo.od_rebate_amount = 0
          this.tips = null
          var reg = regex.REPHONE
          this.IntroducerOptions = []
          this.updateOrderInfo.od_introducer_phone = ''
          if (reg.test(this.updateOrderInfo.od_phone)) {
            this.queryIntroducer.xul_phone = this.updateOrderInfo.od_phone
            queryDcIntroducersByUser(this.queryIntroducer).then(response => {
              this.IntroducerOptions = response.data
            })
          }
          this.getDiscount()
        },
        changeIntroducer() {
          this.tips = null
          this.mgm_discount_show = 0
          this.od_rebate_amount = 0
          this.updateOrderInfo.od_mgm_discount = 0
          this.updateOrderInfo.od_rebate_amount = 0
          this.getDiscount()
        },
        changeDiscount() {
          this.getDiscount()
        },
        choseDiscount() {
          this.getDiscount()
        },
        getDiscount() {
          this.od_discount_show = 0
          this.updateOrderInfo.od_order_pay_amount = 0
          this.updateOrderInfo.od_promotion_discount = 0
          this.updateOrderInfo.od_mgm_discount = 0
          this.updateOrderInfo.od_other_discount = 0
          this.updateOrderInfo.od_rebate_amount = 0
          if (this.promotion_discount_show === null || this.promotion_discount_show === undefined) {
            this.promotion_discount_show = null
          }
          if (this.mgm_discount_show === null || this.mgm_discount_show === undefined) {
            this.mgm_discount_show = null
          }
          if (this.other_discount_show === null || this.other_discount_show === undefined) {
            this.other_discount_show = null
          }
          // 如果城市,套餐金额,订单编号,用户手机,介绍人手机,服务天数不为空的话 调用MDJ 给出tips
          if (this.updateOrderInfo.od_cityid !== null && this.updateOrderInfo.od_cityid !== '' && this.updateOrderInfo.od_order_amount !== null && this.updateOrderInfo.od_order_amount !== '' && this.updateOrderInfo.od_no !== null && this.updateOrderInfo.od_no !== '' && this.updateOrderInfo.od_phone !== null && this.updateOrderInfo.od_phone !== '' && this.updateOrderInfo.od_introducer_phone !== null && this.updateOrderInfo.od_introducer_phone !== '' && this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_product_item_id !== '') {
            this.mdjCalculateInfo.odCityCode = this.updateOrderInfo.od_cityid
            this.mdjCalculateInfo.odAmount = this.updateOrderInfo.od_order_amount
            this.mdjCalculateInfo.odNo = this.updateOrderInfo.od_no
            this.mdjCalculateInfo.odPhone = this.updateOrderInfo.od_phone
            this.mdjCalculateInfo.odStatus = 1
            this.mdjCalculateInfo.odIntroducerPhone = this.updateOrderInfo.od_introducer_phone
            this.mdjCalculateInfo.odProductItem = this.updateOrderInfo.od_product_id
            mdjCalculate(this.mdjCalculateInfo).then(response => {
              if (response.data.data.benefitAmount !== 0 && response.data.data.rebateAmount !== 0) {
                this.updateOrderInfo.od_mgm_discount = response.data.data.benefitAmount
                this.updateOrderInfo.od_other_discount = 0
                this.updateOrderInfo.od_promotion_discount = 0
                this.updateOrderInfo.od_rebate_amount = response.data.data.rebateAmount
                this.od_rebate_amount = response.data.data.rebateAmount
                this.mgm_discount_show = Number(response.data.data.benefitAmount)
                this.tips = '介绍人享受优惠活动,介绍人预计返现金额:' + response.data.data.rebateAmount + ',本单优惠' + response.data.data.benefitAmount
              } else {
                this.tips = ''
                this.mgm_discount_show = 0
                this.updateOrderInfo.od_mgm_discount = 0
              }
              if (this.updateOrderInfo.od_order_amount > 0 && this.discountItem === '介绍优惠') {
                this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
              }
              this.updateOrderInfo.od_order_pay_amount = (this.updateOrderInfo.od_order_amount - this.od_discount_show)
              if (this.discountItem === '活动优惠') { // promotion_discount_show
                this.updateOrderInfo.od_promotion_discount = this.promotion_discount_show
                this.updateOrderInfo.od_mgm_discount = 0
                this.updateOrderInfo.od_other_discount = 0
                this.updateOrderInfo.od_rebate_amount = 0
                this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
                // this.tips = null
              } else if (this.discountItem === '介绍优惠') { // od_mgm_discount
                this.updateOrderInfo.od_promotion_discount = 0
                this.updateOrderInfo.od_mgm_discount = this.mgm_discount_show
                this.updateOrderInfo.od_rebate_amount = this.od_rebate_amount
                this.updateOrderInfo.od_other_discount = 0
                this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
              } else if (this.discountItem === '其他优惠') { // other_discount_show
                this.updateOrderInfo.od_promotion_discount = 0
                this.updateOrderInfo.od_mgm_discount = 0
                this.updateOrderInfo.od_other_discount = this.other_discount_show
                this.updateOrderInfo.od_rebate_amount = 0
                this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
                // this.tips = null
              }
              // this.updateOrderInfo.od_order_pay_amount = (this.updateOrderInfo.od_order_amount - this.od_discount_show) * 0.5
            })
          } else {
            // 什么也不干
            if (this.discountItem === '活动优惠') { // promotion_discount_show
              this.updateOrderInfo.od_promotion_discount = this.promotion_discount_show
              this.updateOrderInfo.od_mgm_discount = 0
              this.updateOrderInfo.od_other_discount = 0
              this.updateOrderInfo.od_rebate_amount = 0
              // this.tips = null
            } else if (this.discountItem === '介绍优惠') { // od_mgm_discount
              this.updateOrderInfo.od_promotion_discount = 0
              this.updateOrderInfo.od_mgm_discount = this.mgm_discount_show
              this.updateOrderInfo.od_rebate_amount = this.od_rebate_amount
              this.updateOrderInfo.od_other_discount = 0
            } else if (this.discountItem === '其他优惠') { // other_discount_show
              this.updateOrderInfo.od_promotion_discount = 0
              this.updateOrderInfo.od_mgm_discount = 0
              this.updateOrderInfo.od_other_discount = this.other_discount_show
              this.updateOrderInfo.od_rebate_amount = 0
              // this.tips = null
            }
            this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
            this.updateOrderInfo.od_order_pay_amount = (this.updateOrderInfo.od_order_amount - this.od_discount_show)
          }
        },
        discountInit() {
          if (this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_product_item_id !== '' && this.updateOrderInfo.od_startdate !== null) {
            this.updateOrderInfo.od_enddate = this.addDate(this.updateOrderInfo.od_product_item_id, this.updateOrderInfo.od_startdate)
          }
          if (this.updateOrderInfo.od_cityid !== null && this.updateOrderInfo.od_cityid !== '' && this.updateOrderInfo.od_order_amount !== null && this.updateOrderInfo.od_order_amount !== '' && this.updateOrderInfo.od_no !== null && this.updateOrderInfo.od_no !== '' && this.updateOrderInfo.od_phone !== null && this.updateOrderInfo.od_phone !== '' && this.updateOrderInfo.od_introducer_phone !== null && this.updateOrderInfo.od_introducer_phone !== '' && this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_product_item_id !== '') {
            this.mdjCalculateInfo.odCityCode = this.updateOrderInfo.od_cityid
            this.mdjCalculateInfo.odAmount = this.updateOrderInfo.od_order_amount
            this.mdjCalculateInfo.odNo = this.updateOrderInfo.od_no
            this.mdjCalculateInfo.odPhone = this.updateOrderInfo.od_phone
            this.mdjCalculateInfo.odStatus = 1
            this.mdjCalculateInfo.odIntroducerPhone = this.updateOrderInfo.od_introducer_phone
            this.mdjCalculateInfo.odProductItem = this.updateOrderInfo.od_product_id
            mdjCalculate(this.mdjCalculateInfo).then(response => {
              if (response.data.data.benefitAmount !== 0 && response.data.data.rebateAmount !== 0) {
                this.od_rebate_amount = response.data.data.benefitAmount
                this.updateOrderInfo.od_mgm_discount = response.data.data.benefitAmount
                this.updateOrderInfo.od_other_discount = 0
                this.updateOrderInfo.od_promotion_discount = 0
                this.updateOrderInfo.od_rebate_amount = response.data.data.rebateAmount
                this.mgm_discount_show = Number(response.data.data.benefitAmount)
                this.tips = '介绍人享受优惠活动,介绍人预计返现金额:' + response.data.data.rebateAmount + ',本单优惠' + response.data.data.benefitAmount
              }
              if (this.updateOrderInfo.od_order_amount > 0 && this.discountItem === '介绍优惠') {
                if (this.discountItem === '介绍优惠') {
                  this.od_discount_show = this.updateOrderInfo.od_promotion_discount + this.updateOrderInfo.od_mgm_discount + this.updateOrderInfo.od_other_discount
                }
                // this.updateOrderInfo.od_order_pay_amount = (this.updateOrderInfo.od_order_amount - this.od_discount_show) * 0.5
              }
            })
          }
        },
        addDate(dd, dadd) {
          var today, ms, thatDay, y, m, d, endDate
          today = new Date(dadd).getTime()
          ms = today + dd * 24 * 60 * 60 * 1000
          thatDay = new Date(ms)
          y = thatDay.getFullYear()
          m = thatDay.getMonth() + 1
          d = thatDay.getDate()
          endDate = y + '-' + m + '-' + d
          return endDate
        },
        dateChange() {
          var reg = regex.NUMBER
          if (reg.test(this.updateOrderInfo.od_product_item_id)) {
            if (this.updateOrderInfo.od_product_id !== null && this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_startdate !== null) {
              var datejs = new Date(this.updateOrderInfo.od_startdate).getTime()
              datejs += Number(this.updateOrderInfo.od_product_item_id) * (24 * 3600 * 1000)
              var datetemp = new Date(datejs)
              this.updateOrderInfo.od_enddate = datetemp.getFullYear() + '-' + (datetemp.getMonth() + 1) + '-' + datetemp.getDate()
            }
            if (this.updateOrderInfo.od_product_id !== null && this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_startdate !== null && this.updateOrderInfo.od_cityid !== null) {
              // 调用月嫂接口queryServiceUserStockCondition
              this.getMMStock()
            }
          }
        },
        cityChange() {
          if (this.updateOrderInfo.od_product_id !== null && this.updateOrderInfo.od_product_item_id !== null && this.updateOrderInfo.od_startdate !== null && this.updateOrderInfo.od_cityid !== null) {
            // 调用月嫂接口queryServiceUserStockCondition
            this.getMMStock()
          }
          this.getDiscount()
        },
        getMMStock() {
          var queryStock = {}
          queryStock.service_start = this.updateOrderInfo.od_startdate
          queryStock.days = this.updateOrderInfo.od_product_item_id
          queryStock.status = 1
          queryStock.limit = 1000
          queryStock.cityname = this.updateOrderInfo.od_cityid
          queryStock.page = 1
          queryServiceUserStockCondition(queryStock).then(response => {
            this.mmsoptions = response.data.items
          })
        },
        getFormatDate(arg) {
          if (arg === undefined || arg === '') {
            return ''
          }
          var re = arg + ''
          if (re.length < 2) {
            re = '0' + re
          }
          return re
        },
        loadmore() {
          this.formData.page++
          this.getSelectList(this.formData)
        },
        selectedRemoteMethod(query) {
          if (query !== '') {
            this.selectedLoading = true
            setTimeout(() => {
              this.selectedLoading = false
              this.formData.page = 1
              this.formData.fb_customer_phone = query
              this.options = []
              this.getSelectList(this.formData)
            }, 200)
          }
        },
        getSelectList(formData) {
          // 这里是接口请求数据, 带分页条件
          listAllInfoBasic(formData).then(response => {
            this.options.push.apply(this.options, response.data.items)
          })
        },
        selectedChange(data) {
          this.source_information = data.fb_customer_name + ' ' + data.fb_customer_phone
          var city = ''
          var address = ''
          if (data.branche_name !== null) {
            city = data.branche_name
          }
          if (data.address_detail !== null) {
            address = data.address_detail
          }
          this.updateOrderInfo.od_user_name = data.fb_customer_name
          this.updateOrderInfo.od_phone = data.fb_customer_phone
          this.updateOrderInfo.od_user_address = city + address
          this.updateOrderInfo.od_expected_date = data.edc_date
          // 再保存个id
        },
        clearUser() {
          this.source_information = ''
          this.updateOrderInfo.od_user_name = null
          this.updateOrderInfo.od_phone = null
          this.updateOrderInfo.od_introducer_phone = null
        },
        formatJson(filterVal, jsonData) {
          return jsonData.map(v => filterVal.map(j => {
            if (j === 'timestamp') {
              return parseTime(v[j])
            } else {
              return v[j]
            }
          }))
        }
      }
    }
  </script>
<style>
  .el-form--label-left .el-form-item__label{
    text-align:right
  }
  .el-rate{
    line-height: 0;
    margin-top:8px;
  }
  .el-checkbox.el-checkbox {
      margin-left: 30px;
  }
  .el-input-number .el-input__inner {
    text-align: right;
  }
  .userbox {
    width: 100%;
    border: 1px solid #ebebeb;
  }
  .userbox2 {
    margin-top: 28px;
    width: 100%;
    border: 1px solid #ebebeb;
  }
  .boxtitle {
    width: 15%;
    background-color: #ffffff;
    height: 20px;
    font-size:1rem;
    margin-top: -10px;
    margin-left: 2%;
    margin-right: 2%;
    text-align: center;
  }
   .discountBox {
    margin-top: 20rpx;
  }
  #footer{
    font-size: 0.4rem;
  }
  @media only screen and (min-width:768px){
    #footer{font-size: 0.8rem;}
  }
  @media only screen and (min-width:992px){
    #footer{font-size:1rem;}
  }
  @media only screen and (min-width:2000px){
    #footer{font-size:1.4rem;}
  }
  #discount{
    font-size: 0.8rem;
    color: #606266;
    font-weight: 700;
  }
  @media only screen and (min-width:768px){
    #discount{
      font-size: 0.9rem;
      color: #606266;
      font-weight: 700;
    }
  }
  @media only screen and (min-width:992px){
    #discount{
      font-size:0.9rem;
      color: #606266;
      font-weight: 700;
    }
  }
  @media only screen and (min-width:2000px){
    #discount{
      font-size:0.9rem;
      color: #606266;
      font-weight: 700;
    }
  }
  </style>