<template>
  <div class="app-container">
     <el-tabs v-model="activeName" @tab-click="handleClick" >
      <el-tab-pane label="云存储配置" name="sys.oss.cloudStorage">
          <el-form ref="form1" :model="form1" :rules="rules1" label-width="160px">
            <el-form-item label="类型" prop="type">
               <el-radio-group v-model="form1.type">
                <el-radio :label="1">七牛云</el-radio>
                <el-radio :label="2">阿里云</el-radio>
                <el-radio :label="3">腾讯云</el-radio>
                 <el-radio :label="4">华为云</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item v-if="form1.type==1" label="七牛绑定的域名" prop="qiniuDomain">
                <el-input  v-model="form1.qiniuDomain"  label="请输入七牛绑定的域名"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==1" label="七牛路径前缀" prop="qiniuPrefix">
                <el-input  v-model="form1.qiniuPrefix" label="请输入七牛路径前缀"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==1" label="七牛ACCESS_KEY" prop="qiniuAccessKey">
                <el-input  v-model="form1.qiniuAccessKey" label="请输入七牛ACCESS_KEY"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==1" label="七牛SecretKey" prop="qiniuSecretKey">
                <el-input  v-model="form1.qiniuSecretKey" label="七牛SecretKey不能为空"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==1" label="七牛空间名" prop="qiniuBucketName">
                <el-input  v-model="form1.qiniuBucketName" label="七牛空间名不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==2" label="阿里云绑定的域名" prop="aliyunDomain">
                <el-input  v-model="form1.aliyunDomain" label="阿里云绑定的域名不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==2" label="阿里云路径前缀" prop="aliyunPrefix">
                <el-input  v-model="form1.aliyunPrefix" label="阿里云路径前缀不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==2" label="阿里云EndPoint" prop="aliyunEndPoint">
                <el-input  v-model="form1.aliyunEndPoint" label="阿里云EndPoint不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==2" label="阿里云AccessKeyId" prop="aliyunAccessKeyId">
                <el-input  v-model="form1.aliyunAccessKeyId" label="阿里云AccessKeyId不能为空"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==2" label="阿里云AccessKeySecret" prop="aliyunAccessKeySecret">
                <el-input  v-model="form1.aliyunAccessKeySecret" label="阿里云AccessKeySecret不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==2" label="阿里云BucketName" prop="aliyunBucketName">
                <el-input  v-model="form1.aliyunBucketName" label="阿里云BucketName不能为空"></el-input>
            </el-form-item>
              <el-form-item v-if="form1.type==3" label="腾讯云绑定的域名" prop="qcloudDomain">
                <el-input  v-model="form1.qcloudDomain" label="腾讯云绑定的域名格式不正确"></el-input>
            </el-form-item>
              <el-form-item v-if="form1.type==3" label="腾讯云前缀" prop="qcloudPrefix">
                <el-input  v-model="form1.qcloudPrefix" label="腾讯云前缀不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==3" label="腾讯云SecretId" prop="qcloudSecretId">
                <el-input  v-model="form1.qcloudSecretId" label="腾讯云SecretId不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==3" label="腾讯云SecretKey" prop="qcloudSecretKey">
                <el-input  v-model="form1.qcloudSecretKey" label="腾讯云SecretKey不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==3" label="腾讯云BucketName" prop="qcloudBucketName">
                <el-input  v-model="form1.qcloudBucketName" label="腾讯云BucketName不能为空"></el-input>
            </el-form-item>
             <el-form-item v-if="form1.type==3" label="所属地区" prop="qcloudRegion">
                <el-input  v-model="form1.qcloudRegion" label="所属地区不能为空"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==4" label="华为云绑定的域名" prop="huaweiDomain">
              <el-input  v-model="form1.huaweiDomain" label="华为云绑定的域名格式不正确"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==4" label="华为云Endpoint" prop="huaweiBucketName">
              <el-input  v-model="form1.huaweiEndpoint" label="华为云Endpoint不能为空"></el-input>
            </el-form-item>

            <el-form-item v-if="form1.type==4" label="华为云AK" prop="huaweiAK">
              <el-input  v-model="form1.huaweiAK" label="华为云AK不能为空"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==4" label="华为云SK" prop="huaweiSK">
              <el-input  v-model="form1.huaweiSK" label="华为云SK不能为空"></el-input>
            </el-form-item>
            <el-form-item v-if="form1.type==4" label="华为云BucketName" prop="huaweiBucketName">
              <el-input  v-model="form1.huaweiBucketName" label="华为云BucketName不能为空"></el-input>
            </el-form-item>
             <div   class="footer">
              <el-button type="primary" @click="submitForm1">提  交</el-button>
            </div>
          </el-form>
      </el-tab-pane>


      <el-tab-pane label="问诊配置" name="his.inquiryConfig">
          <el-form   label-width="180px">
            <el-form-item  :label="item.type==1?'图文问诊价格':'视频问诊价格'" prop="price" v-for="item in form2.prices">
                  <el-input-number v-model="item.price" :precision="2" :step="0.1"></el-input-number>
            </el-form-item>
            <el-form-item  label="问诊费扣款" prop="companyPrice">
                  <el-input-number v-model="form2.companyPrice" :precision="2" :step="0.1"></el-input-number>
            </el-form-item>
            <el-form-item  label="开药问诊费扣款" prop="companyPrescribePrice">
                  <el-input-number v-model="form2.companyPrescribePrice" :precision="2" :step="0.1"></el-input-number>
            </el-form-item>
            <el-form-item label="待支付订单取消时间(分钟)" prop="unPayCancelTime">
              <el-tooltip class="item" effect="dark" content="待支付订单取消时间(分钟)" placement="top-end">
                   <el-input-number v-model="form2.unPayCancelTime" :min="0"  ></el-input-number>
              </el-tooltip>
            </el-form-item>
            <el-form-item label="问诊未接单取消时间(分钟)" prop="unReceiveCancelTime">
              <el-tooltip class="item" effect="dark" content="问诊未接单取消时间(分钟)" placement="top-end">
                   <el-input-number v-model="form2.unReceiveCancelTime" :min="0"  ></el-input-number>
              </el-tooltip>
            </el-form-item>
            <el-form-item label="是否自动审方" prop="doctorRegister">
              <el-switch
                v-model="form2.isAutoPrescribeAudit"
                active-color="#13ce66"
                  inactive-color="#ff4949">
              </el-switch>
            </el-form-item>
            <el-form-item label="会诊类型" prop="inquirySubType">
                <div>
                  <el-button plain  type="primary" icon="el-icon-plus" @click="addInquirySubType" style="margin-bottom: 5px;">添加会诊类型</el-button>
                  <el-table border :data="form2.inquirySubType"  style="width: 701px;">

                    <el-table-column prop="lable"label="名称" width="300px">
                      <template slot-scope="scope"><el-input  v-model="scope.row.lable"    ></el-input>  </template>
                    </el-table-column>
                    <el-table-column prop="value"label="类型" width="300px">

                      <template slot-scope="scope">
                        <el-select v-model="scope.row.value" placeholder="类型" clearable size="small">
                             <el-option
                               v-for="dict in inquirySubTypeOptions"
                               :key="dict.dictValue"
                               :label="dict.dictLabel"
                               :value="dict.dictValue"
                             />
                         </el-select>
                      </template>
                    </el-table-column>
                    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
                      <template slot-scope="scope">
                        <el-button
                          size="mini"
                          type="text"
                          icon="el-icon-delete"
                          @click="deleteInquirySubType(scope.$index, scope.row)"
                        >删除</el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
            </el-form-item>


             <div   class="footer">
              <el-button type="primary" @click="submitform2">提  交</el-button>
            </div>
          </el-form>
      </el-tab-pane>

      <el-tab-pane label="协议配置" name="his.agreementConfig" :rules="rules3">
          <el-form ref="form3" :model="form3"  label-width="150px">
            <el-form-item label="医生注册协议" prop="doctorRegister">
              <editor v-model="form3.doctorRegister" :min-height="292"/>
            </el-form-item>
            <el-form-item label="医生多机构备案协议" prop="doctorFiling">
              <editor v-model="form3.doctorFiling" :min-height="292"/>
            </el-form-item>
            <el-form-item label="用户协议" prop="userRegister">
              <editor v-model="form3.userRegister" :min-height="292"/>
            </el-form-item>
            <el-form-item label="隐私协议" prop="userPrivacy">
              <editor v-model="form3.userPrivacy" :min-height="292"/>
            </el-form-item>
            <el-form-item label="健康客服协议" prop="userHealth">
              <editor v-model="form3.userHealth" :min-height="292"/>
            </el-form-item>
            <el-form-item label="会员服务协议" prop="vipService">
              <editor v-model="form3.vipService" :min-height="292"/>
            </el-form-item>

            <div class="footer">
              <el-button type="primary" @click="submitForm3">提  交</el-button>
            </div>
          </el-form>
      </el-tab-pane>

    <el-tab-pane label="资质证明" name="his.certs" >
        <el-form ref="form4" :model="form4"  label-width="150px">
         <el-form-item   label="资质证明" prop="certs">
             <Material v-model="photoArr" type="image" :num="10" :width="150" :height="150" />
         </el-form-item>

          <div class="footer">
            <el-button type="primary" @click="submitForm4">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>
     <el-tab-pane label="品牌介绍" name="his.brand" >
       <el-form ref="form16" :model="form16"  label-width="150px">
         <el-form-item   label="品牌介绍" prop="brandInfo">
           <ImageUpload v-model="form16.brandInfo" type="image" :num="10" :width="150" :height="150" />
         </el-form-item>

         <div class="footer">
           <el-button type="primary" @click="submitForm16">提  交</el-button>
         </div>
       </el-form>
     </el-tab-pane>
    <el-tab-pane label="佣金配置" name="his.brokerage" style="width: 100%;">

      <div  >
        <el-table border :data="form5"  style="width: 100%;">
          <el-table-column prop="type" label="类型" width="300px"/>
          <el-table-column prop="doctorMedicineBrokerage"label="医生中药佣金%" width="300px">
            <template slot-scope="scope"><el-input-number  v-model="scope.row.doctorMedicineBrokerage" :min="0" :max="100"    ></el-input-number>  </template>
          </el-table-column>
          <el-table-column prop="doctorInquiryBrokerage"label="医生服务佣金%" width="300px">
            <template slot-scope="scope"><el-input-number  v-model="scope.row.doctorInquiryBrokerage" :min="0" :max="100"    ></el-input-number>  </template>
          </el-table-column>
          <el-table-column prop="tuiMedicineBrokerage" label="推广人员中药佣金%" width="300px">
            <template slot-scope="scope">  <el-input-number  v-model="scope.row.tuiMedicineBrokerage" :min="0" :max="100"    > </el-input-number> </template>
          </el-table-column>
        </el-table>
        <div style="float: right;"  class="footer">
          <el-button type="primary" @click="submitForm5">提  交</el-button>
        </div>
      </div>
    </el-tab-pane>

    <el-tab-pane label="优惠券" name="his.coupon" >
        <el-form ref="form6" :model="form6"  label-width="150px">
        <el-form-item label="用户注册优惠券" prop="inquiryBrokerage">
           <el-select v-model="form6.registerCoupon" multiple placeholder="请选择" style="width: 300px;">
             <el-option
               v-for="item in couponList"
               :key="item.couponId"
               :label="item.title"
               :value="item.couponId"
             ></el-option>
           </el-select>
        </el-form-item>
        <el-form-item label="新手任务优惠券" prop="userTaskCoupon">
          <el-select v-model="form6.userTaskCoupon" placeholder="请选择" style="width: 300px;">
            <el-option
              v-for="item in couponList"
              :key="item.couponId"
              :label="item.title"
              :value="item.couponId"
            ></el-option>
          </el-select>
        </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm6">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>

    <el-tab-pane label="商城配置" name="his.store" >
        <el-form ref="form1" :model="form7"  label-width="180px">

          <el-form-item  label="货到付款支付比例" prop="payRate">
            <el-tooltip class="item" effect="dark" content="货到付款支付比例(%)" placement="top-end">
              <el-input-number  v-model="form7.payRate"   ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="待支付订单取消时间" prop="unPayTime">
            <el-tooltip class="item" effect="dark" content="待支付订单取消时间(分钟)" placement="top-end">
              <el-input-number  v-model="form7.unPayTime" :min="1"    ></el-input-number>
            </el-tooltip>

          </el-form-item>
          <el-form-item  label="公司推广佣金比例" prop="tuiMoneyRate">
            <el-tooltip class="item" effect="dark" content="公司推广佣金比例(%)" placement="top-end">
              <el-input-number  v-model="form7.tuiMoneyRate" :min="1" :max="100"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="公司发货扣除成本比例" prop="deductMoneyRate">
            <el-tooltip class="item" effect="dark" content="公司发货扣除成本比例(%)" placement="top-end">
              <el-input-number  v-model="form7.deductMoneyRate" :min="1" :max="100"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="申请售后有效天数" prop="storeAfterSalesDay">
            <el-tooltip class="item" effect="dark" content="确认收货后申请售后天数" placement="top-end">
              <el-input-number  v-model="form7.storeAfterSalesDay" :min="0" :max="100"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="坐席自动回收天数" prop="storeCall">
            <el-tooltip class="item" effect="dark" content="坐席自动回收天数" placement="top-end">
              <el-input-number  v-model="form7.storeCall" :min="0" :max="100"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="退货收货人" prop="refundConsignee">
            <el-tooltip class="item" effect="dark" content="退货收货人" placement="top-end">
              <el-input style="width:200px"  v-model="form7.refundConsignee"   ></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="退货手机号" prop="refundPhoneNumber">
            <el-tooltip class="item" effect="dark" content="退货手机号" placement="top-end">
              <el-input  style="width:200px"  v-model="form7.refundPhoneNumber"   ></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="退货地址" prop="refundAddress">
            <el-tooltip class="item" effect="dark" content="退货地址" placement="top-end">
              <el-input    v-model="form7.refundAddress"   ></el-input>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="随访模板" prop="followTempId">
            <el-select v-model="form7.followTempId" placeholder="请选择模板" clearable size="small">
                    <el-option
                      v-for="dict in tempOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    />
            </el-select>
          </el-form-item>
          <el-form-item label="基础疾病随访" prop="oneFollowTempId">
            <el-select v-model="form7.oneFollowTempId" placeholder="请选择模板" clearable size="small">
                    <el-option
                      v-for="dict in tempOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    />
            </el-select>
          </el-form-item>
          <el-form-item  label="随访频率(天)" prop="followRate">
            <el-tooltip class="item" effect="dark" content="followRate" placement="top-end">
              <el-input-number  v-model="form7.followRate" :min="0" :max="1000"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
         <div   class="footer">
            <el-button type="primary" @click="submitForm7">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>
    <el-tab-pane label="套餐包" name="his.package" >
        <el-form ref="form8" :model="form8"  label-width="150px">
          <el-form-item  label="物流代收定金比例(%)" prop="payRate">
            <el-tooltip class="item" effect="dark" content="公司推广佣金比例(%)" placement="top-end">
              <el-input-number  v-model="form8.payRate" :min="1" :max="100"    ></el-input-number>
            </el-tooltip>
          </el-form-item>

          <el-form-item  label="货到付款加收运费(元)" prop="payDelivery">
            <el-tooltip class="item" effect="dark" content="货到付款加收运费" placement="top-end">
              <el-input-number  v-model="form8.payDelivery" :min="0" :max="1000"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="随访频率(天)" prop="followRate">
            <el-tooltip class="item" effect="dark" content="followRate" placement="top-end">
              <el-input-number  v-model="form8.followRate" :min="0" :max="1000"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item  label="全款支付赠品" prop="gift">
            <div ><el-button plain  type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button></div>
           <el-table border width="100%" style="margin-top:5px;"  :data="form8.gift">
             <el-table-column label="商品图片" align="center" width="100">
               <template slot-scope="scope">
                 <el-popover
                   placement="right"
                   title=""
                   trigger="hover">
                   <img slot="reference" :src="scope.row.image" width="50">
                   <img :src="scope.row.image" style="max-width: 50px;">
                 </el-popover>
               </template>
             </el-table-column>
             <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
             <el-table-column label="商品编号" align="center" prop="barCode" />
             <el-table-column label="商品规格" align="center" prop="sku" />
             <el-table-column label="店铺名称" align="center" prop="storeName" />
             <el-table-column label="售价" align="center"  prop="price"  />
           </el-table>
          </el-form-item>
          <el-form-item  label="物流代收赠品" prop="gift">
            <div ><el-button plain  type="primary" icon="el-icon-plus" @click="handleDeliveryGift">添加商品</el-button></div>
           <el-table border width="100%" style="margin-top:5px;"  :data="form8.deliveryGift">
             <el-table-column label="商品图片" align="center" width="100">
               <template slot-scope="scope">
                 <el-popover
                   placement="right"
                   title=""
                   trigger="hover">
                   <img slot="reference" :src="scope.row.image" width="50">
                   <img :src="scope.row.image" style="max-width: 50px;">
                 </el-popover>
               </template>
             </el-table-column>
             <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
             <el-table-column label="商品编号" align="center" prop="barCode" />
             <el-table-column label="商品规格" align="center" prop="sku" />
             <el-table-column label="店铺名称" align="center" prop="storeName" />
             <el-table-column label="售价" align="center"  prop="price"  />
           </el-table>
          </el-form-item>
          <el-form-item label="赠品店铺" prop="giftStoreId">
            <el-select v-model="form8.giftStoreId" placeholder="赠品店铺" clearable size="small">
                    <el-option
                      v-for="dict in storeOPtions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    />
                  </el-select>
          </el-form-item>
          <el-form-item  label="赠品起送金额(元)" prop="giftPrice">
            <el-tooltip class="item" effect="dark" content="赠品起送金额" placement="top-end">
              <el-input-number  v-model="form8.giftPrice" :min="0" :max="10000"    ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm8">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>
    <el-tab-pane label="支付配置" name="his.pay">
        <el-form ref="form9" :model="form9"  label-width="160px">
          <el-form-item label="支付类型" prop="type">
             <el-radio-group v-model="form9.type">
              <el-radio label="yb">易宝</el-radio>
              <el-radio label="tz">台州银行</el-radio>
              <el-radio label="wx">微信</el-radio>
               <el-radio label="hf">汇付</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item   label="appId" prop="appId">
              <el-input   v-model="form9.appId"  label="请输入appId"></el-input>
          </el-form-item>
          <el-form-item  v-if="form9.type=='yb'" label="易宝商户号" prop="ybAccount">
              <el-input   v-model="form9.ybAccount"  label="请输入易宝商户号"></el-input>
          </el-form-item>
           <el-form-item v-if="form9.type=='yb'" label="易宝Key" prop="ybKey">
              <el-input  v-model="form9.ybKey" label="请输入易宝Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='yb'" label="易宝回调地址" prop="ybNotifyUrl">
              <el-input  v-model="form9.ybNotifyUrl" label="易宝回调地址"></el-input>
          </el-form-item>
          <el-form-item  v-if="form9.type=='tz'" label="台州商户号" prop="tzPlatMerCstNo">
              <el-input   v-model="form9.tzPlatMerCstNo"  label="请输入台州商户号"></el-input>
          </el-form-item>
           <el-form-item v-if="form9.type=='tz'" label="台州appSecret" prop="tzAppSecret">
              <el-input  v-model="form9.tzAppSecret" label="请输入台州appSecret"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州私钥" prop="tzPrivateKey">
              <el-input  v-model="form9.tzPrivateKey" label="请输入台州私钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州平台公钥" prop="tzPlatformPublicKey">
              <el-input  v-model="form9.tzPlatformPublicKey" label="请输入台州平台公钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州appKey" prop="tzAppKey">
              <el-input  v-model="form9.tzAppKey" label="请输入台州appKey"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="台州支付回调地址" prop="tzPayDecrypt">
              <el-input  v-model="form9.tzPayDecrypt" label="请输入台州支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="退款回调地址" prop="tzRefundDecrypt">
              <el-input  v-model="form9.tzRefundDecrypt" label="请输入退款回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='tz'" label="分账回调地址" prop="tzOrderShareDecrypt">
              <el-input  v-model="form9.tzOrderShareDecrypt" label="请输入台州分账回调地址"></el-input>
          </el-form-item>
          <el-form-item  v-if="form9.type=='wx'" label="微信商户号" prop="wxMchId">
              <el-input   v-model="form9.wxMchId"  label="请输入微信商户号"></el-input>
          </el-form-item>
           <el-form-item v-if="form9.type=='wx'" label="微信Key" prop="wxMchKey">
              <el-input  v-model="form9.wxMchKey" label="请输入微信Key"></el-input>
          </el-form-item>


          <el-form-item  v-if="form9.type=='hf'" label="汇付产品号" prop="hfProductId">
              <el-input   v-model="form9.hfProductId"  label="汇付产品号"></el-input>
          </el-form-item>
           <el-form-item v-if="form9.type=='hf'" label="系统号" prop="hfSysId">
              <el-input  v-model="form9.hfSysId" label="系统号Key"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="商户号" prop="huifuId">
              <el-input  v-model="form9.huifuId" label="商户号"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="服务商私钥" prop="hfRsaPrivateKey">
              <el-input  v-model="form9.hfRsaPrivateKey" label="服务商私钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付公钥" prop="hfRsaPublicKey">
              <el-input  v-model="form9.hfRsaPublicKey" label="汇付公钥"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付支付回调地址" prop="hfPayNotifyUrl">
              <el-input  v-model="form9.hfPayNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="大额支付回调地址" prop="hfPayOnlineNotifyUrl">
              <el-input  v-model="form9.hfPayOnlineNotifyUrl" label="汇付支付回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付退款回调地址" prop="hfRefundNotifyUrl">
              <el-input  v-model="form9.hfRefundNotifyUrl" label="汇付退款回调地址"></el-input>
          </el-form-item>
          <el-form-item v-if="form9.type=='hf'" label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">
              <el-input  v-model="form9.hfOnlineRefundNotifyUrl" label="汇付分账回调地址"></el-input>
          </el-form-item>
           <div   class="footer">
            <el-button type="primary" @click="submitForm9">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>
    <el-tab-pane label="布局配置" name="his.appShow" >
        <div >
          <el-table border :data="form10">
            <el-table-column prop="name" label="模块名称" width="300">
             <template slot-scope="scope"> <el-input    v-model="scope.row.name"   ></el-input></template>
            </el-table-column>
            <el-table-column prop="sort"label="排序号" width="300">
              <template slot-scope="scope"><el-input-number  v-model="scope.row.sort" :min="0" :max="100"    ></el-input-number>  </template>
            </el-table-column>
            <el-table-column prop="isShow" label="是否展示" width="100">
              <template slot-scope="scope">  <el-switch
              v-model="scope.row.isShow"
              active-color="#13ce66"
                inactive-color="#ff4949">
            </el-switch> </template>
            </el-table-column>
          </el-table>
          <div style="float: right;" class="footer">
            <el-button type="primary" @click="submitForm10">提  交</el-button>
          </div>
        </div>
    </el-tab-pane>
    <el-tab-pane label="积分配置" name="his.integral">
        <el-form ref="form11" :model="form11" :rules="rules3" label-width="180px">
          <el-row>
            <el-col :span="12">
              <el-form-item  label="新手任务积分" prop="integralNewTask">
                <el-tooltip class="item" effect="dark" content="首次app内下单公域疗法，赠送多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralNewTask"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item  label="购买消费" prop="integralRatio">
                <el-tooltip class="item" effect="dark" content="实付多少元得1积分" placement="top-end">
                  <el-input-number  v-model="form11.integralRatio"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item  label="分享获得积分" prop="integralShare">
                <el-tooltip class="item" effect="dark" content="分享获得多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralShare"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item  label="完成随访获得积分" prop="integralFollow">
                <el-tooltip class="item" effect="dark" content="完成随访获得多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralFollow"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item  label="观看课程获得积分" prop="integralCourse">
                <el-tooltip class="item" effect="dark" content="每小节观看>=50%获得多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralCourse"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item  label="浏览商品获得积分" prop="integralProduct">
                <el-tooltip class="item" effect="dark" content="浏览商品每30秒获得多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralProduct"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item  label="短视频/直播 获得积分" prop="integralFirstVideo">
                <el-tooltip class="item" effect="dark" content="首次浏览每10秒获得多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralFirstVideo"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item  label="短视频/直播 获得积分" prop="integralFinishVideo">
                <el-tooltip class="item" effect="dark" content="每10秒获得最低多少积分" placement="top-end">
                  <el-input-number  v-model="form11.integralFinishVideo"   ></el-input-number>
                </el-tooltip>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item  label="单日可获总积分" prop="integralByOneDay">
            <el-tooltip class="item" effect="dark" content="每天最多可获得多少积分" placement="top-end">
              <el-input-number  v-model="form11.integralByOneDay"   ></el-input-number>
            </el-tooltip>
          </el-form-item>
          <el-form-item label="单日可获总积分类型" prop="integralTypeByOneDay">
            <el-select v-model="form11.integralTypeByOneDay" multiple placeholder="请选择类型" filterable clearable size="small">
              <el-option
                v-for="dict in integralLogTypeOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>

         <div   class="footer">
            <el-button type="primary" @click="submitForm11">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>
    <el-tab-pane label="签到配置" name="his.sign">
    <el-table border :data="form12">
      <el-table-column prop="day" label="名称" width="300">
       <template slot-scope="scope"> <el-input    v-model="scope.row.day"   ></el-input></template>
      </el-table-column>
      <el-table-column prop="signNum"label="获得积分" width="300">
        <template slot-scope="scope"><el-input-number  v-model="scope.row.signNum" :min="0" :max="100"    ></el-input-number>  </template>
      </el-table-column>
      <el-table-column prop="sort"label="排序" width="300">
        <template slot-scope="scope"><el-input-number  v-model="scope.row.sort" :min="0" :max="100"    ></el-input-number>  </template>
      </el-table-column>
    </el-table>
    <div style="float: right;" class="footer">
      <el-button type="primary" @click="submitForm12">提  交</el-button>
    </div>
    </el-tab-pane>
    <el-tab-pane label="短信配置" name="his.sms" >

        <el-form ref="form14" :model="form14"  label-width="150px">
          <el-form-item label="短信服务商" prop="type">
             <el-radio-group v-model="form14.type">
              <el-radio label="rf">重庆润芳</el-radio>
              <el-radio label="dh">重庆大汉</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知账号" prop="rfAccount1">
              <el-input   v-model="form14.rfAccount1"  label="请输入润芳通知账号"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知code" prop="rfCode1">
              <el-input   v-model="form14.rfCode1"  label="请输入润芳通知code"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知密码" prop="rfPassword1">
              <el-input   v-model="form14.rfPassword1"  label="请输入润芳通知密码"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知地址" prop="rfUrl1">
              <el-input   v-model="form14.rfUrl1"  label="请输入润芳通知地址"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳营销账号" prop="rfAccount2">
              <el-input   v-model="form14.rfAccount2"  label="请输入润芳营销账号"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳营销code" prop="rfCode2">
              <el-input   v-model="form14.rfCode2"  label="请输入润芳营销code"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知密码" prop="rfPassword2">
              <el-input   v-model="form14.rfPassword2"  label="请输入润芳通知密码"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳通知地址" prop="rfUrl2">
              <el-input   v-model="form14.rfUrl2"  label="请输入润芳营销地址"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='rf'" label="润芳签名" prop="rfSign">
              <el-input   v-model="form14.rfSign"  label="请输入润芳签名"></el-input>
          </el-form-item>

          <el-form-item  v-if="form14.type=='dh'" label="大汉通知账号" prop="dhAccount1">
              <el-input   v-model="form14.dhAccount1"  label="请输入大汉通知账号"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='dh'" label="大汉通知密码" prop="dhPassword1">
              <el-input   v-model="form14.dhPassword1"  label="请输入大汉通知密码"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='dh'" label="大汉营销账号" prop="dhAccount2">
              <el-input   v-model="form14.dhAccount2"  label="请输入大汉营销账号"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='dh'" label="大汉通知密码" prop="dhPassword2">
              <el-input   v-model="form14.dhPassword2"  label="请输入大汉通知密码"></el-input>
          </el-form-item>
          <el-form-item  v-if="form14.type=='dh'" label="大汉签名" prop="dhSign">
              <el-input   v-model="form14.dhSign"  label="请输入大汉签名"></el-input>
          </el-form-item>
          <div class="footer">
            <el-button type="primary" @click="submitForm14">提  交</el-button>
          </div>
        </el-form>
    </el-tab-pane>



    <el-tab-pane label="系统配置" name="his.config">
     <el-form ref="form11" :model="form13"  label-width="160px">
      <el-form-item   label="腾讯云sdkAppId" prop="sdkAppId">
          <el-input   v-model="form13.sdkAppId"  label="请输入sdkAppId"></el-input>
      </el-form-item>
      <el-form-item   label="腾讯云sdkAppKey" prop="sdkAppKey">
          <el-input   v-model="form13.sdkAppKey"  label="请输入sdkAppKey"></el-input>
      </el-form-item>
      <el-form-item   label="快递鸟Id" prop="kdnId">
          <el-input   v-model="form13.kdnId"  label="请输入kdnId"></el-input>
      </el-form-item>
      <el-form-item   label="快递鸟Key" prop="kdnKeyId">
          <el-input   v-model="form13.kdnKeyId"  label="请输入kdnKeyId"></el-input>
      </el-form-item>
      <el-form-item   label="快递鸟Url" prop="kdnUrl">
          <el-input   v-model="form13.kdnUrl"  label="请输入kdnUrl"></el-input>
      </el-form-item>
      <el-form-item   label="快递鸟订阅url" prop="kdnSubscribeUrl">
          <el-input   v-model="form13.kdnSubscribeUrl"  label="请输入kdnSubscribeUrl"></el-input>
      </el-form-item>
      <el-form-item   label="快递鸟地址url" prop="kdnAddressUrl">
          <el-input   v-model="form13.kdnAddressUrl"  label="请输入kdnAddressUrl"></el-input>
      </el-form-item>
      <el-form-item   label="erpOpen" prop="erpOpen">
          <el-input   v-model="form13.erpOpen"  label="请输入erpOpen"></el-input>
      </el-form-item>
      <el-form-item   label="erpAppKey" prop="erpAppKey">
          <el-input   v-model="form13.erpAppKey"  label="请输入erpAppKey"></el-input>
      </el-form-item>
      <el-form-item   label="erpSessionKey" prop="erpSessionKey">
          <el-input   v-model="form13.erpSessionKey"  label="请输入erpSessionKey"></el-input>
      </el-form-item>
      <el-form-item   label="erpSecret" prop="erpSecret">
          <el-input   v-model="form13.erpSecret"  label="请输入erpSecret"></el-input>
      </el-form-item>
      <el-form-item   label="erpUrl" prop="erpUrl">
          <el-input   v-model="form13.erpUrl"  label="请输入erpUrl"></el-input>
      </el-form-item>
      <el-form-item   label="erpShopCode" prop="erpShopCode">
          <el-input   v-model="form13.erpShopCode"  label="请输入erpShopCode"></el-input>
      </el-form-item>
      <el-form-item   label="appid" prop="appid">
          <el-input   v-model="form13.appid"  label="请输入appid"></el-input>
      </el-form-item>
      <el-form-item   label="secret" prop="secret">
          <el-input   v-model="form13.secret"  label="请输入secret"></el-input>
      </el-form-item>
      <el-form-item   label="token" prop="token">
          <el-input   v-model="form13.token"  label="请输入token"></el-input>
      </el-form-item>
      <el-form-item   label="aesKey" prop="aesKey">
          <el-input   v-model="form13.aesKey"  label="请输入aesKey"></el-input>
      </el-form-item>
      <el-form-item   label="msgDataFormat" prop="msgDataFormat">
          <el-input   v-model="form13.msgDataFormat"  label="请输入msgDataFormat"></el-input>
      </el-form-item>
      <el-form-item   label="极光appKey" prop="appKey">
          <el-input   v-model="form13.appKey"  label="请输入appKey"></el-input>
      </el-form-item>
      <el-form-item   label="极光secret" prop="masterSecret">
          <el-input   v-model="form13.masterSecret"  label="请输入masterSecret"></el-input>
      </el-form-item>
      <el-form-item   label="极光过期时间" prop="liveTime">
          <el-input   v-model="form13.liveTime"  label="请输入liveTime"></el-input>
      </el-form-item>
      <el-form-item   label="处方上传token" prop="prescribeToken">
          <el-input   v-model="form13.prescribeToken"  label="请输入masterSecret"></el-input>
      </el-form-item>
      <el-form-item   label="处方上传地址" prop="prescribeUrl">
          <el-input   v-model="form13.prescribeUrl"  label="请输入masterSecret"></el-input>
      </el-form-item>
      <el-form-item   label="二维码地址" prop="codeUrl">
          <el-input   v-model="form13.codeUrl"  label="请输入masterSecret"></el-input>
      </el-form-item>
       <el-form-item   label="hook地址" prop="hookUrl">
         <el-input   v-model="form13.hookUrl"  label="请输入hook域名"></el-input>
       </el-form-item>
      <div   class="footer">
         <el-button type="primary" @click="submitForm13">提  交</el-button>
       </div>
     </el-form>

    </el-tab-pane>
    <el-tab-pane label="企微客服配置" name="qw:config">
      <el-form ref="form15" :model="form15" label-width="120px">
        <el-form-item label="企业CoripID">
          <el-input v-model="form15.corpId" style="width:400px"   ></el-input>
        </el-form-item>
        <el-form-item label="Secret">
          <el-input v-model="form15.secret" style="width:400px"   ></el-input>
        </el-form-item>
        <el-form-item label="Token">
          <el-input v-model="form15.token" style="width:400px"   ></el-input>
        </el-form-item>
        <el-form-item label="EncodingAESKey">
          <el-input v-model="form15.encodingAESKey" style="width:400px"   ></el-input>
        </el-form-item>
        <el-form-item label="回调地接">
          <el-input disabled v-model="form15.notifyUrl" style="width:600px"   ></el-input>
        </el-form-item>
        <div class="line"></div>
        <div style="float:right;margin-right:20px">
          <el-button type="primary" @click="submitForm15">提交</el-button>
        </div>
      </el-form>
    </el-tab-pane>
    <el-tab-pane label="商城配置小程序" name="store.config" >
      <el-form ref="form17" :model="form17"  label-width="150px">


        <el-form-item   label="erpOpen" prop="erpOpen">
            <el-input   v-model="form17.erpOpen"  label="请输入erpOpen"></el-input>
        </el-form-item>
        <el-form-item   label="erpAppKey" prop="erpAppKey">
            <el-input   v-model="form17.erpAppKey"  label="请输入erpAppKey"></el-input>
        </el-form-item>
        <el-form-item   label="erpSessionKey" prop="erpSessionKey">
            <el-input   v-model="form17.erpSessionKey"  label="请输入erpSessionKey"></el-input>
        </el-form-item>
        <el-form-item   label="erpSecret" prop="erpSecret">
            <el-input   v-model="form17.erpSecret"  label="请输入erpSecret"></el-input>
        </el-form-item>
        <el-form-item   label="erpUrl" prop="erpUrl">
            <el-input   v-model="form17.erpUrl"  label="请输入erpUrl"></el-input>
        </el-form-item>
        <el-form-item   label="erpShopCode" prop="erpShopCode">
            <el-input   v-model="form17.erpShopCode"  label="请输入erpShopCode"></el-input>
        </el-form-item>
        <el-form-item   label="appid" prop="appid">
            <el-input   v-model="form17.appid"  label="请输入appid"></el-input>
        </el-form-item>
        <el-form-item   label="secret" prop="secret">
            <el-input   v-model="form17.secret"  label="请输入secret"></el-input>
        </el-form-item>
        <el-form-item   label="token" prop="token">
            <el-input   v-model="form17.token"  label="请输入token"></el-input>
        </el-form-item>
        <el-form-item   label="aesKey" prop="aesKey">
            <el-input   v-model="form17.aesKey"  label="请输入aesKey"></el-input>
        </el-form-item>

        <el-form-item   label="msgDataFormat" prop="msgDataFormat">
            <el-input   v-model="form17.msgDataFormat"  label="请输入msgDataFormat"></el-input>
        </el-form-item>

        <el-form-item   label="汇付产品号" prop="hfProductId">
            <el-input   v-model="form17.hfProductId"  label="汇付产品号"></el-input>
        </el-form-item>
         <el-form-item v label="系统号" prop="hfSysId">
            <el-input  v-model="form17.hfSysId" label="系统号Key"></el-input>
        </el-form-item>
        <el-form-item  label="商户号" prop="huifuId">
            <el-input  v-model="form17.huifuId" label="商户号"></el-input>
        </el-form-item>
        <el-form-item  label="服务商私钥" prop="hfRsaPrivateKey">
            <el-input  v-model="form17.hfRsaPrivateKey" label="服务商私钥"></el-input>
        </el-form-item>
        <el-form-item  label="汇付公钥" prop="hfRsaPublicKey">
            <el-input  v-model="form17.hfRsaPublicKey" label="汇付公钥"></el-input>
        </el-form-item>
        <el-form-item  label="汇付支付回调地址" prop="hfPayNotifyUrl">
            <el-input  v-model="form17.hfPayNotifyUrl" label="汇付支付回调地址"></el-input>
        </el-form-item>
        <el-form-item  label="大额支付回调地址" prop="hfPayOnlineNotifyUrl">
            <el-input  v-model="form17.hfPayOnlineNotifyUrl" label="汇付支付回调地址"></el-input>
        </el-form-item>
        <el-form-item  label="汇付退款回调地址" prop="hfRefundNotifyUrl">
            <el-input  v-model="form17.hfRefundNotifyUrl" label="汇付退款回调地址"></el-input>
        </el-form-item>
        <el-form-item  label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">
            <el-input  v-model="form17.hfOnlineRefundNotifyUrl" label="汇付大额退款回调地址"></el-input>
        </el-form-item>

        <div class="footer">
          <el-button type="primary" @click="submitForm17">提  交</el-button>
        </div>
      </el-form>
    </el-tab-pane>
       <el-tab-pane label="点播配置" name="course.config">
         <el-form ref="form18" :model="form18" label-width="120px">
           <el-form-item label="完课进度(%)">
             <el-tooltip class="item" effect="dark" content="看多少百分比算完课" placement="top-end">
               <el-input-number  v-model="form18.answerRate" :min="1" :max="100"    ></el-input-number>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="短链有效期(天)">
             <el-tooltip class="item" effect="dark" content="短链有效期(天)" placement="top-end">
               <el-input-number  v-model="form18.videoLinkExpireDate" :min="1"    ></el-input-number>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="答题允许错误次数(次)">
             <el-tooltip class="item" effect="dark" content="课程答题允许错误次数(次)" placement="top-end">
               <el-input-number  v-model="form18.answerErrorCount" :min="1"     ></el-input-number>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="每十分钟获取积分">
             <el-tooltip class="item" effect="dark" content="每十分钟获取多少积分" placement="top-end">
               <el-input-number  v-model="form18.videoIntegral" :min="1"    ></el-input-number>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="答题获得积分">
             <el-tooltip class="item" effect="dark" content="答题获得积分" placement="top-end">
               <el-input-number  v-model="form18.answerIntegral" :min="1"    ></el-input-number>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="看课默认线路" prop="defaultLine">
             <el-radio-group v-model="form18.defaultLine">
               <el-radio label="0">线路一</el-radio>
               <el-radio label="1">线路二</el-radio>
             </el-radio-group>
           </el-form-item>
           <el-form-item label="通用看课域名">
             <el-tooltip class="item" effect="dark" content="真链域名" placement="top-end">
               <el-input  v-model="form18.realLinkDomainName"     ></el-input>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="网页授权域名">
             <el-tooltip class="item" effect="dark" content="公众号网页授权域名" placement="top-end">
               <el-input  v-model="form18.authDomainName"  ></el-input>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="公众号appId">
             <el-tooltip class="item" effect="dark" content="授权公众号appId" placement="top-end">
               <el-input  v-model="form18.mpAppId"  ></el-input>
             </el-tooltip>
           </el-form-item>

           <el-form-item label="小程序appid">
             <el-tooltip class="item" effect="dark" content="小程序appid" placement="top-end">
               <el-input  v-model="form18.miniprogramAppid"  ></el-input>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="小程序page路径">
             <el-tooltip class="item" effect="dark" content="小程序消息打开后的路径" placement="top-end">
               <el-input  v-model="form18.miniprogramPage"  ></el-input>
             </el-tooltip>
           </el-form-item>

           <el-form-item label="奖励类型">
             <el-radio-group v-model="form18.rewardType">
               <el-radio label="1">红包</el-radio>
               <el-radio label="2">积分</el-radio>
             </el-radio-group>
           </el-form-item>

           <el-form-item label="红包模式" v-if="form18.rewardType==1">
             <el-radio-group v-model="form18.redPacketMode">
               <el-radio label="1">总公司</el-radio>
               <el-radio label="2">分公司</el-radio>
             </el-radio-group>
           </el-form-item>

           <div class="line"></div>
           <div style="float:right;margin-right:20px">
             <el-button type="primary" @click="submitForm18">提交</el-button>
           </div>
         </el-form>
       </el-tab-pane>
       <el-tab-pane label="红包商户配置" name="redPacket.config" >
         <el-form ref="form19" :model="form19"  label-width="150px">
           <el-form-item   label="红包接口类型" prop="isNew">
             <el-radio-group v-model="form19.isNew">
               <el-radio label="0">商家转账到零钱(旧)</el-radio>
               <el-radio label="1">商家转账(新)</el-radio>
             </el-radio-group>
           </el-form-item>
           <el-form-item   label="公众号appid" prop="appId">
             <el-input   v-model="form19.appId"  label="请输入appId"></el-input>
           </el-form-item>
           <el-form-item   label="小程序appid" prop="appId">
             <el-input   v-model="form19.miniappId"  label="请输入appId"></el-input>
           </el-form-item>
           <el-form-item   label="商户号" prop="mchId">
             <el-input   v-model="form19.mchId"  label="请输入mchId"></el-input>
           </el-form-item>
           <el-form-item   label="商户密钥" prop="mchKey">
             <el-input   v-model="form19.mchKey"  label="mchKey"></el-input>
           </el-form-item>
           <el-form-item   label="p12证书路径" prop="keyPath">
             <el-input   v-model="form19.keyPath"  label="请输入keyPath"></el-input>
           </el-form-item>
           <el-form-item   label="apiV3密钥" prop="apiV3Key">
             <el-input   v-model="form19.apiV3Key"  label="请输入apiV3Key"></el-input>
           </el-form-item>
           <el-form-item   label="公钥ID" prop="publicKeyId">
             <el-input   v-model="form19.publicKeyId"  label="请输入公钥ID"></el-input>
           </el-form-item>
           <el-form-item   label="公钥证书" prop="publicKeyPath">
             <el-input   v-model="form19.publicKeyPath"  label="请输入publicKeyPath"></el-input>
           </el-form-item>
           <el-form-item   label="key路径" prop="privateKeyPath">
             <el-input   v-model="form19.privateKeyPath"  label="请输入"></el-input>
           </el-form-item>
           <el-form-item   label="cert路径" prop="privateCertPath">
             <el-input   v-model="form19.privateCertPath"  label="请输入"></el-input>
           </el-form-item>
           <el-form-item   label="回调地址" prop="notifyUrl">
             <el-input   v-model="form19.notifyUrl"  label="请输入"></el-input>
           </el-form-item>

           <div class="footer">
             <el-button type="primary" @click="submitForm19">提  交</el-button>
           </div>
         </el-form>
       </el-tab-pane>
       <el-tab-pane label="企微Sop客户评级配置" name="qwRating:config">
         <el-form ref="form20" :model="form20" :rules="rules20" label-width="120px">
           <el-form-item label="评级天数(天)" prop="levelDay">
             <el-tooltip class="item" effect="dark" content="最小评级天数(天)" placement="top-end">
               <el-input-number v-model="form20.levelDay" :min="7" :max="365"></el-input-number>
             </el-tooltip>
           </el-form-item>

           <!-- A级范围 -->
           <el-form-item label="A级范围(%)" prop="aLevelMin">
             <el-tooltip class="item" effect="dark" content="A级客户范围最小值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.aLevelMin"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
             <span style="margin: 0 10px;">-</span>
             <span>100</span> <!-- aLevelMax 固定为 100 -->
           </el-form-item>

           <!-- B级范围 -->
           <el-form-item label="B级范围(%)" prop="bLevelMin">
             <el-tooltip class="item" effect="dark" content="B级客户范围最小值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.bLevelMin"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
             <span style="margin: 0 10px;">-</span>
             <el-tooltip class="item" effect="dark" content="B级客户范围最大值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.bLevelMax"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
           </el-form-item>

           <!-- C级范围 -->
           <el-form-item label="C级范围(%)" prop="cLevelMin">
             <el-tooltip class="item" effect="dark" content="C级客户范围最小值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.cLevelMin"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
             <span style="margin: 0 10px;">-</span>
             <el-tooltip class="item" effect="dark" content="C级客户范围最大值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.cLevelMax"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
           </el-form-item>

           <!-- D级范围 -->
           <el-form-item label="D级范围(%)" prop="dLevelMin">
             <span>0</span> <!-- dLevelMin 固定为 0 -->
             <span style="margin: 0 10px;">-</span>
             <el-tooltip class="item" effect="dark" content="D级客户范围最大值(%)" placement="top-end">
               <el-input-number
                 v-model="form20.dLevelMax"
                 :min="0"
                 :max="100"
               ></el-input-number>
             </el-tooltip>
           </el-form-item>

           <div class="line"></div>
           <div style="float: right; margin-right: 20px">
             <el-button type="primary" @click="submitForm20">提交</el-button>
           </div>
         </el-form>
       </el-tab-pane>
    </el-tabs>


    <el-dialog :title="product.title" v-if="product.open"  :visible.sync="product.open" width="1000px" append-to-body>
        <product-attr-value-select  ref="Details"  @selectProduct="selectProduct" />
    </el-dialog>
    <el-dialog :title="deliveryGift.title" v-if="deliveryGift.open"  :visible.sync="deliveryGift.open" width="1000px" append-to-body>
        <productDeliveryGiftValueSelect  ref="DeliveryGiftDetails"  @selectDeliveryGift="selectDeliveryGift" />
    </el-dialog>
  </div>
</template>

<script>
import {   getConfigByKey,updateConfigByKey, clearCache } from "@/api/system/config";
import {listStore} from "@/api/his/storeProduct";
import { js } from "js-beautify";
import Material from '@/components/Material'
import { allList} from "@/api/his/coupon";
import {getAllFollowTempName } from "@/api/his/followTemp";
import productAttrValueSelect from "../../components/his/productGiftValueSelect.vue";
import productDeliveryGiftValueSelect from "../../components/his/productDeliveryGiftValueSelect.vue";
import { Col } from "element-ui";
export default {
  name: "Config",
  components: {
    Material,productAttrValueSelect,productDeliveryGiftValueSelect
  },
  data() {
    return {
      deliveryGift:{
        open:false,
        title:"商品选择"
      },
      product:{
        open:false,
        title:"商品选择"
      },
      tempOptions:[],
      integralLogTypeOptions:[],
      activeName:"sys.oss.cloudStorage",
      configId:null,
      storeOPtions:[],
      // 表单参数
      form1: {
      },
      form2:{
      },
      form3:{
      },
      form4:{
      },
      form5:[],
      form6:{
      },
      form7:{
      },
      form8:{
      },
      form9:{
      },
      form10:[],
      form11:{
      },
      form12:[],
      form13:{
      },
      form14:{
      },
      form15:{
      },
      form16:{
      },
      form17:{
      },
      form18:{
      },
      form19:{
      },
      form20:{
        levelDay: 7,
        aLevelMin: 80,
        aLevelMax: 100,
        bLevelMin: 40,
        bLevelMax: 80,
        cLevelMin: 10,
        cLevelMax: 40,
        dLevelMin: 0,
        dLevelMax: 10,
      },
      photoArr:[],
      couponList:[],
      inquirySubTypeOptions:[],
      // 表单校验
      rules1: {
      },
      rules3: {
      },
      rules20:{
        levelDay: [{ required: true, message: '请输入评级天数', trigger: 'blur' }],
        aLevelMin: [{ required: true, message: '请输入A级最小值', trigger: 'blur' }],
        bLevelMin: [{ required: true, message: '请输入B级最小值', trigger: 'blur' }],
        bLevelMax: [{ required: true, message: '请输入B级最大值', trigger: 'blur' }],
        cLevelMin: [{ required: true, message: '请输入C级最小值', trigger: 'blur' }],
        cLevelMax: [{ required: true, message: '请输入C级最大值', trigger: 'blur' }],
        dLevelMax: [{ required: true, message: '请输入D级最大值', trigger: 'blur' }],
      },
    };
  },
  created() {

    this.getConfigByKey(this.activeName);
    listStore().then(response => {
      this.storeOPtions = response.rows;
    });
    this.getDicts("sys_inquiry_sub_type").then(response => {
      this.inquirySubTypeOptions = response.data;
    });
    this.getDicts("sys_integral_log_type").then(response => {
      this.integralLogTypeOptions = response.data;
    });
  },
  watch: {
    photoArr: function(val) {
      this.form4.certs = val.join(',')
    },
  },
  methods: {
      deleteInquirySubType(index,row){
        this.form2.inquirySubType.splice(index, 1);
      },
      handleClick(tab, event){
        this.getConfigByKey(tab.name);

      },
      handleAddProduct(){
          setTimeout(() => {
               this.$refs.Details.getDetails();
          }, 1);
          this.product.open=true;

      },
      addInquirySubType(){

        this.form2.inquirySubType.push({lable:"名称",value:null})
      },
      handleDeliveryGift(){
          setTimeout(() => {
               this.$refs.DeliveryGiftDetails.getDetails();
          }, 1);
          this.deliveryGift.open=true;
      },

      selectProduct(row){

        this.form8.gift=[row];
        this.product.open=false;
        this.$message({
                  message: '添加成功',
                  type: 'success'
                });
      },

      selectDeliveryGift(row){

        this.form8.deliveryGift=[row];
        this.deliveryGift.open=false;
        this.$message({
                  message: '添加成功',
                  type: 'success'
                });
      },
      close(){
        this.product.open=false;
      },
      getConfigByKey(key){
        getConfigByKey(key).then(response => {
          this.configId=response.data.configId;
          this.configKey=response.data.configKey;
          if(key=="sys.oss.cloudStorage"){
            this.form1 =JSON.parse(response.data.configValue);
          }
          if(key=="his.inquiryConfig"){
            this.form2 =JSON.parse(response.data.configValue);
          }
          if(key=="his.agreementConfig"){
             this.form3 =JSON.parse(response.data.configValue);
          }
          if(key=="his.certs"){
              this.form4 =JSON.parse(response.data.configValue);
              if(this.form4.certs!=null){
                  this.photoArr=this.form4.certs.split(",");
              }
          }
          if(key=="his.brokerage"){
              this.form5 =JSON.parse(response.data.configValue);
          }
          if(key=="his.coupon"){
                allList().then(response => {
                  this.couponList = response.data;
                });
              this.form6 =JSON.parse(response.data.configValue);

          }
          if(key=="his.store"){
              this.form7 =JSON.parse(response.data.configValue);
              getAllFollowTempName().then(response => {
                this.tempOptions = response.rows;
              });
          }
          if(key=="his.store"){
              this.form7 =JSON.parse(response.data.configValue);
          }
          if(key=="his.package"){
              this.form8 =JSON.parse(response.data.configValue);
          }
          if(key=="his.pay"){
              this.form9 =JSON.parse(response.data.configValue);
          }
          if(key=="his.appShow"){
              this.form10 =JSON.parse(response.data.configValue);
          }
          if(key=="his.integral"){
              this.form11 =JSON.parse(response.data.configValue);
          }
          if(key=="his.sign"){
              this.form12 =JSON.parse(response.data.configValue);
          }
          if(key=="his.config"){
              this.form13 =JSON.parse(response.data.configValue);
          }
          if(key=="store.config"){
             this.form17 =JSON.parse(response.data.configValue);
          }
          if(key=="his.sms"){
              this.form14 =JSON.parse(response.data.configValue);
          }
          if(key=="qw:config"){
              this.form15 =JSON.parse(response.data.configValue);
          }
          if(key=="his.brand"){
            this.form16 =JSON.parse(response.data.configValue);
            console.log(this.form16)
          }
          if(key=="course.config"){
              this.form18 =JSON.parse(response.data.configValue);
          }
          if(key=="redPacket.config"){
            this.form19 =JSON.parse(response.data.configValue);
          }
          if(key=="qwRating.config"){
            this.form20 =JSON.parse(response.data.configValue);
          }
        });
     },
    /** 提交按钮 */
    submitForm1: function() {
      this.$refs["form1"].validate(valid => {
        if (valid) {
          var param={configId:this.configId,configValue:JSON.stringify(this.form1)}
           updateConfigByKey(param).then(response => {
              if (response.code === 200) {
                this.msgSuccess("修改成功");
              }
            });
        }
      });
    },
    submitForm3(){
      this.$refs["form3"].validate(valid => {
        if (valid) {
           var param={configId:this.configId,configValue:JSON.stringify(this.form3)}
          updateConfigByKey(param).then(response => {
             if (response.code === 200) {
               this.msgSuccess("修改成功");
             }
           });
           }
           });
        },
  submitForm4(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form4)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm5(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form5)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm6(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form6)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm7(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form7)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm8(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form8)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm9(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form9)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm10(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form10)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm11(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form11)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm12(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form12)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm13(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form13)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm14(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form14)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
  submitForm15(){
    var param={configId:this.configId,configValue:JSON.stringify(this.form15)}
    updateConfigByKey(param).then(response => {
       if (response.code === 200) {
         this.msgSuccess("修改成功");
       }
     });
  },
    submitForm16(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form16)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm17(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form17)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm18(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form18)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm19(){
      var param={configId:this.configId,configValue:JSON.stringify(this.form19)}
      updateConfigByKey(param).then(response => {
        if (response.code === 200) {
          this.msgSuccess("修改成功");
        }
      });
    },
    submitForm20(){

      this.$refs['form20'].validate((valid) => {
        if (valid) {
          const { aLevelMin, aLevelMax, bLevelMin, bLevelMax, cLevelMin, cLevelMax, dLevelMin, dLevelMax } = this.form20;

          // 检查范围是否连续且总长度为100%
          const totalLength = (100 - aLevelMin) + (bLevelMax - bLevelMin) + (cLevelMax - cLevelMin) + (dLevelMax);
          console.log("totalLength",totalLength)
          if (totalLength!==100) {
            this.$message.error('所有等级范围必须连续且总长度为100%');
            return;
          }

          var param={configId:this.configId,configValue:JSON.stringify(this.form20)}
          updateConfigByKey(param).then(response => {
            if (response.code === 200) {
              this.msgSuccess("修改成功");
            }
          });

        } else {
          this.$message.error('请检查输入');
          return false;
        }
      });

    },
    submitform2(){
      // 将对象转换为JSON字符串并保留两位小数
      var json_data = JSON.stringify(this.form2, function(key, value) {
        if ( key == "price") {
          return value.toFixed(2);
        }
        return value;
      });
// 将对象转换为 JSON 字符串
           var param={configId:this.configId,configValue:json_data};
           updateConfigByKey(param).then(response => {
              if (response.code === 200) {
                this.msgSuccess("修改成功");
              }
            });
    },
    /** 清理缓存按钮操作 */
    handleClearCache() {
      clearCache().then(response => {
        if (response.code === 200) {
          this.msgSuccess("清理成功");
        }
      });
    }
  }
};
</script>
<style scoped>
.footer{
  width: 100%;
  display: flex;
  margin-top: 50px;
  align-items: flex-end;
  justify-content: flex-end;
}
</style>
