<template>
  <div class="app-containers">
    <!--      礼品卡-->

    <div class="card-box" style="margin-bottom: 20px">

      <div class="top-hang">
        <div class="d-s">
          <el-select v-model="queryParams.cardAmount" clearable style="margin-right: 10px" placeholder="请选择面值">
            <el-option v-for="item in jglist" :key="item.cardAmount" :label="item.cardAmount" :value="item.cardAmount">
            </el-option>
          </el-select>
          <el-select v-model="queryParams.activateStatus" clearable style="margin-right: 10px" placeholder="请选择激活状态">
            <el-option v-for="item in option" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="queryParams.sailStatus" clearable style="margin-right: 10px" placeholder="请选择出售状态">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
        <div class="d-s">
          <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
          <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
          <el-button type="primary" icon="el-icon-search">下载模板</el-button>
          <el-button type="primary" @click="addCertificate">新增优惠券</el-button>
          <!--          <el-upload-->

          <!--            class=""-->
          <!--            v-loading="uploading"-->
          <!--            action="/fuint-application/business/marketingActivity/cardGift/exchangeImport"-->
          <!--            :headers="headers"-->
          <!--            :limit="1"-->
          <!--            :on-change="handleChange"-->
          <!--            style="margin-left: 15px"-->
          <!--            :file-list="fileList">-->
          <!--            <el-button  type="primary" icon="el-icon-upload">点击上传</el-button>-->
          <!--          </el-upload>-->
        </div>
      </div>
      <el-table border :data="tableData" style="width: 100%">
        <el-table-column label="序号" type="index">
        </el-table-column>
        <el-table-column prop="number" label="优惠券编号">
        </el-table-column>
        <el-table-column prop="cardAmount" label="优惠券名称">
        </el-table-column>
        <el-table-column prop="useTime" label="优惠券类型">
        </el-table-column>
        <el-table-column prop="sailTime" label="投放类型">
        </el-table-column>
        <el-table-column prop="createTime" label="优惠内容">
        </el-table-column>
        <el-table-column prop="createTime" label="有效期">
        </el-table-column>
        <el-table-column prop="createTime" label="已领/投放数量">
        </el-table-column>
        <el-table-column prop="createTime" label="已核销">
        </el-table-column>
        <el-table-column prop="sailStatus" label="状态">
          <template slot-scope="scope">
            <span v-if="scope.row.sailStatus == 1">已售</span>
            <span v-if="scope.row.sailStatus != 1">未售</span>
          </template>
        </el-table-column>
        <el-table-column prop="createBy" label="创建人">
        </el-table-column>
        <el-table-column prop="createBy" label="创建时间">
        </el-table-column>
        <el-table-column prop="address" label="操作">
          <template slot-scope="scope">
            <div style="display: flex;">
              <el-button type="text" @click="grounding">修改</el-button>
              <el-button type="text" @click="">下架</el-button>
              <el-button type="text" @click="remindOpen(scope.row)">删除</el-button>
            </div>
          </template>
        </el-table-column>
        <!--          <el-table-column
                    prop="remark"
                    label="备注信息"
                    width="280">
                  </el-table-column>-->
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="pageNo" :limit.sync="pageSize" @pagination="getlist" />
    </div>
    <el-drawer title="订单记录" :visible.sync="orderShow" size="55%" :before-close="handleClose" center>
      <div class="box-der">
        <div class="d-b">
          <div class="d-s">
            <el-input v-model="input" style="width: 200px;margin-right: 10px" placeholder="请输入订单号"></el-input>
            <el-select v-model="value" placeholder="请选择" style="width: 200px;margin-right: 10px">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
          </div>
          <el-button type="primary" icon="el-icon-search">搜索</el-button>
        </div>
        <el-table :data="orderData" border style="width: 100%">
          <el-table-column label="序号" type="index">
          </el-table-column>
          <el-table-column prop="date" label="订单号">
          </el-table-column>
          <el-table-column prop="date" label="会员手机号">
          </el-table-column>
          <el-table-column prop="date" label="礼品卡面值（元）">
          </el-table-column>
          <el-table-column prop="date" label="数量">
          </el-table-column>
          <el-table-column prop="date" label="礼品卡金额">
          </el-table-column>
          <el-table-column prop="date" label="实收金额">
          </el-table-column>
          <el-table-column prop="date" label="订单状态">
          </el-table-column>
          <el-table-column prop="date" label="订单完成时间">
          </el-table-column>
        </el-table>
      </div>
    </el-drawer>

    <el-dialog title="新增/编辑优惠券" :visible.sync="centerDialogVisible" width="90%">
      <!--          表-->
      <el-form :model="ruleForm" :rules="rules" :label-position="labelPosition" ref="ruleForm" label-width="120px"
        class="demo-ruleForm">
        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="优惠券编号" prop="number" style="width: 30%;">
            <el-input v-model="ruleForm.number" placeholder="请输入优惠券编号" style="width: 300px"></el-input>
          </el-form-item>
          <el-form-item label="优惠券名称" prop="name" style="width: 30%;">
            <el-input v-model="ruleForm.name" placeholder="请输入优惠券名称" style="width: 300px"></el-input>
          </el-form-item>
          <el-form-item label="投放类型" prop="putType" style="width: 30%;">
            <el-select v-model="ruleForm.putType" placeholder="请选择投放类型" style="width: 300px">
              <el-option v-for="dict in dict.type.putType_type" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
        </div>
        <div class="d-s" style="justify-content: space-between">

          <el-form-item label="优惠类型" prop="name" style="width: 30%;">
            <el-select v-model="ruleForm.type" placeholder="请选择投放类型" style="width: 300px">
              <el-option v-for="dict in dict.type.CardCoupon_type" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
          <el-form-item label="消费条件" prop="name" style="width: 30%;">
            <div class="d-s">
              <el-select v-model="ruleForm.useType" placeholder="请选择金额">
              </el-select>
              <div style="margin: 0px 5px;">满</div>
              <el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px">
                <template slot="append">元</template>
              </el-input>
              <div style="width: 60px;text-align: center">优惠</div>
              <el-input placeholder="" v-model="ruleForm.reduceAmount" style="width: 140px">
                <template slot="append">元</template>
              </el-input>
            </div>
          </el-form-item>
          <!--  适用油品油号      oilNumber  -->
          <el-form-item label="适用油品油号" prop="name" style="width: 30%;">
            <div class="d-s">
              <el-radio-group v-model="ruleForm.oilLimit">
                <el-radio :label="1">不限</el-radio>
                <el-radio :label="2">自定义</el-radio>
              </el-radio-group>
              <el-select v-model="ruleForm.oilNumber" multiple placeholder="请选择" style="margin-left: 5px">
                <el-option v-for="dict in dict.type.oilNumber_type" :key="dict.value" :label="dict.label"
                  :value="dict.value" />
              </el-select>
            </div>
          </el-form-item>
        </div>

        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="适用会员等级" prop="name" style="width: 30%;">
            <el-select v-model="ruleForm.membershipLevel" multiple placeholder="请选择">
              <el-option v-for="item in membership" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <!-- 生效日期设置 timeType 字段 -->
          <el-form-item label="生效日期设置" prop="name" style="width: 30%;">
            <div class="d-s">
              <el-radio-group v-model="ruleForm.timeType">
                <el-radio :label="1">领取<el-input v-model="ruleForm.validityDay" placeholder="" style="width: 80px"></el-input>
                  <div>天内有效</div></el-radio>
                <el-radio :label="2">指定使用日期</el-radio>

              </el-radio-group>

            </div>
          </el-form-item>
          <!-- 生效日期  effectiveDateStart 字段 -->
          <el-form-item label="生效日期" prop="name" style="width: 30%;">
            <el-date-picker v-model="ruleForm.effectiveDateStart" type="daterange" range-separator="至"
              start-placeholder="开始日期" end-placeholder="结束日期">
            </el-date-picker>
          </el-form-item>
        </div>
        <!-- 是否与其他优惠同时使用 useWithOther -->
        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="是否与其他优惠同时使用" label-width="180px" prop="name" style="width: 30%;">
            <div class="d-s">
              <el-radio-group v-model="ruleForm.useWithOther">
                <el-radio :label="0">不可以</el-radio>
                <el-radio :label="1">可以</el-radio>

              </el-radio-group>

            </div>
          </el-form-item>
          <el-form-item label="使用次数限制" prop="name" style="width: 30%;">
            <div class="d-s">
              <div style="margin: 0px 5px;">每</div>
              <el-input placeholder="" v-model="ruleForm.limitTotalDay" style="width: 140px">
                <template slot="append">天</template>
              </el-input>
              <div style="margin: 0px 5px;">限制使用</div>
              <el-input placeholder="" v-model="ruleForm.limitTotalNum" style="width: 140px">
                <template slot="append">次</template>
              </el-input>
            </div>
          </el-form-item>
          <!-- 每人领卷限制 getNumLimit -->
          <el-form-item label="每人领券限制" prop="name" style="width: 30%;">
            <el-input v-model="ruleForm.getNumLimit" placeholder="请输入内容"></el-input>
          </el-form-item>
        </div>

        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="是否允许收银台送券" label-width="160px" prop="name" style="width: 30%;">
            <div class="d-s">
              <el-radio-group v-model="ruleForm.sySend">
                <el-radio :label="0">否</el-radio>
                <el-radio :label="1">是</el-radio>

              </el-radio-group>
            </div>
          </el-form-item>
          <!-- 每日领卷限制 dayGetLimit -->
          <el-form-item label="每日领券限制" prop="name" style="width: 30%;">
            <el-input v-model="ruleForm.dayGetLimit" placeholder="请输入内容"></el-input>
          </el-form-item>
          <el-form-item label="投放总数" prop="name" style="width: 30%;">
            <el-input v-model="ruleForm.tfTotal" placeholder="请输入内容"></el-input>
          </el-form-item>
        </div>
        <!-- 使用条件  useCondition -->
        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="使用条件" style="width: 30%;">
            <el-input type="textarea" v-model="ruleForm.useCondition"></el-input>
          </el-form-item>
          <el-form-item label="适用时间段" prop="name" style="width: 30%;">
            <el-radio-group v-model="ruleForm.availableType">
              <el-radio :label="1" style="margin-bottom: 15px">每周           <el-select v-model="ruleForm.availableWeek" multiple placeholder="请选择周日期">
                <el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select></el-radio>
              <el-radio :label="2" style="margin-bottom: 15px">每月   <el-select v-model="ruleForm.availableDay" multiple placeholder="请选择每月固定日期">
                <el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select></el-radio>

            </el-radio-group>

            <div class="d-s">
              <div class="malou">时间段</div>
              <el-time-select
                style="margin-right: 10px"
                placeholder="起始时间"
                v-model="ruleForm.availablePeriodStart"
                :picker-options="{
                  start: '00:00',
                  step: '00:15',
                  end: '24:00'
                  }">
              </el-time-select>
              <el-time-select
                placeholder="结束时间"
                v-model="ruleForm.availablePeriodEnd"
                :picker-options="{
                     start: '00:00',
                  step: '00:15',
                  end: '24:00',
                minTime: ruleForm.availablePeriodStart
              }">
              </el-time-select>
            </div>

          </el-form-item>
          <el-form-item label="不适用时间段" prop="name" style="width: 30%;">
            <el-radio-group v-model="ruleForm.unAvailableType">
              <el-radio :label="1" style="margin-bottom: 15px">每周           <el-select v-model="ruleForm.unAvailableWeek" multiple placeholder="请选择周日期">
                <el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select></el-radio >
              <el-radio :label="2" style="margin-bottom: 15px">每月   <el-select v-model="ruleForm.unAvailableDay" multiple placeholder="请选择每月固定日期">
                <el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select></el-radio>

            </el-radio-group>

            <div class="d-s">
              <div class="malou">时间段</div>
              <el-time-select
                style="margin-right: 10px"
                placeholder="起始时间"
                v-model="ruleForm.unAvailablePeriodStart"
                :picker-options="{
                  start: '00:00',
                  step: '00:15',
                  end: '24:00'
                  }">
              </el-time-select>
              <el-time-select
                placeholder="结束时间"
                v-model="ruleForm.unAvailablePeriodEnd"
                :picker-options="{
                     start: '00:00',
                  step: '00:15',
                  end: '24:00',
                minTime: ruleForm.availablePeriodStart
              }">
              </el-time-select>
            </div>

          </el-form-item>

        </div>
        <div class="d-s" style="justify-content: space-between">
          <el-form-item label="背景图" prop="name" style="width: 30%;">
            <imgUpload :limit="1" v-model="ruleForm.backgroundImage"></imgUpload>
          </el-form-item>
          <el-form-item label="备注" prop="name" style="width: 30%;">
            <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="ruleForm.remark">
            </el-input>
          </el-form-item>

        </div>


      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="addBlock(ruleForm)">创建</el-button>
      </span>
    </el-dialog>

  </div>
</template>

<script>
import {
  getList,
  getListtj,
  addList,
  eitList,
  deleteList,
  oilDepotConfiguration,
  getdownload,
  getselectGiftValue,
  getyi,
  getwei,
  getqb,
  getsk
} from "@/api/EventMarketing/giftBlock";
import imgUpload from "@/components/ImageUpload/index.vue"
import { getToken } from "@/utils/auth";
import imgUpload1 from "@/components/map/imgUpload.vue";
import { Row } from "element-ui";

export default {
  name: 'index',
  dicts: ['CardCoupon_type', 'putType_type', 'oilNumber_type'],
  data() {
    return {
      oilTypelist: [
        "不限",
        "自定义"
      ],
      oilTypelistL: [
        "每周",
        "每月"
      ],
      timelist: [
        "指定具体使用日期",
        "领取后",
      ],
      whetherlist: [
        "否",
        "是",
      ],

      tindex: 0,
      timeType: 0,
      //是否可与其他优惠一起使用1可以0不可以
      useWithOther: 0,
      validityDay: 30,
      jglist: [],
      onelist: [],
      twolist: [],
      threelist: [],
      orderShow: false,
      weekList:[
        {
          label:"周一",
          value:"1"
        },
        {
          label:"周二",
          value:"2"
        },
        {
          label:"周三",
          value:"3"
        },
        {
          label:"周四",
          value:"4"
        },
        {
          label:"周五",
          value:"5"
        }, {
          label:"周六",
          value:"6"
        }, {
          label:"周天",
          value:"7"
        }

      ],
      monthList:[
        {
          label:"每月1号",
          value:"01"
        },
        {
          label:"每月2号",
          value:"02"
        },
        {
          label:"每月3号",
          value:"03"
        },
        {
          label:"每月4号",
          value:"04"
        },
        {
          label:"每月5号",
          value:"05"
        }, {
          label:"每月6号",
          value:"06"
        }, {
          label:"每月7号",
          value:"07"
        }, {
          label:"每月8号",
          value:"08"
        }, {
          label:"每月9号",
          value:"09"
        }, {
          label:"每月10号",
          value:"10"
        }, {
          label:"每月11号",
          value:"11"
        }, {
          label:"每月12号",
          value:"12"
        }, {
          label:"每月13号",
          value:"13"
        }, {
          label:"每月14号",
          value:"14"
        }, {
          label:"每月15号",
          value:"15"
        }, {
          label:"每月16号",
          value:"16"
        }, {
          label:"每月17号",
          value:"17"
        }, {
          label:"每月18号",
          value:"18"
        }, {
          label:"每月19号",
          value:"19"
        }, {
          label:"每月20号",
          value:"20"
        }, {
          label:"每月21号",
          value:"21"
        }, {
          label:"每月22号",
          value:"22"
        }, {
          label:"每月23号",
          value:"23"
        }, {
          label:"每月24号",
          value:"24"
        }, {
          label:"每月25号",
          value:"25"
        }, {
          label:"每月26号",
          value:"26"
        }, {
          label:"每月27号",
          value:"27"
        }, {
          label:"每月28号",
          value:"28"
        }, {
          label:"每月29号",
          value:"29"
        }
        , {
          label:"每月30号",
          value:"30"
        }
        , {
          label:"每月31号",
          value:"31"
        }

      ],
      orderData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      },],
      headers: {
        'Access-Token': getToken(),
      },
      uploading: false,
      fileList: [],
      labelPosition: 'left',
      queryParams: {
        number: '',
        remark: '',
        activateStatus: null,
        status: '',
        pageNo: 1,
        pageSize: 10
      },
      centerDialogVisible: false,
      input: '',
      total: 0,
      pageNo: 1,
      effectiveDateStart: '',
      pageSize: 10,
      option: [
        {
          value: '0',
          label: '已激活'
        }, {
          value: '1',
          label: '未激活'
        },],
      options: [
        {
          value: '1',
          label: '已售'
        }, {
          value: '0',
          label: '未售'
        },],
      value: '',
      tjdata: {},
      tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }],
      ruleForm: {
        name:'',
        number:'',
        status: '',
        quantity: '',
        cardAmount: '',
        remark: '',
        putType: '',
        oilNumber: '',
        region: '',
        membershipLevel: '',
        //限制多少天内可使用几次的 天字段
        limitTotalDay: '',
        //限制多少天内可使用几次的 次字段
        ruleForm: '',
        tfTotal: 0,
        dayGetLimit: 0,
        getNumLimit: 0,
        useCondition: "",
        validityDay:30

      },
      membership: [
        {
          label: "普通会员",
          value: '0'
        },
        {
          label: "白金会员",
          value: '1'
        },
        {
          label: "黄金会员",
          value: '2'
        },
        {
          label: "钻石会员",
          value: '3'
        }
      ],
      rules: {
        name: [
          { required: true, message: '此为必填项', trigger: 'blur' },
        ],


      }

    }
  },
  mounted() {
    this.getlist()
    this.gettj()
  },
  components: {
    imgUpload1,
    imgUpload,
  },
  methods: {
    Typeindex(index) {
      this.tindex = index
    },
    TypeindexSet(index) {
      this.timeType = index
    },
    TypeindexOther(index) {
      this.useWithOther = index;
    },
    addCertificate() {
      this.centerDialogVisible = !this.centerDialogVisible
      //   新增优惠券
    },
    getwysk(row) {
      if (row.sailStatus == 1) {
        this.$message.error("此卡已经售出过了呦")
        return
      }
      if (row.activateStatus == 1) {
        this.$message.error("此卡还未激活呦")
        return
      }
      let data = {
        id: row.id,
        sailStatus: 1
      }
      getsk(data).then(res => {
        this.getlist()
        console.log(res)
        this.$message.success("售卡成功")
      })
    },

    // 下载
    handleChange(file, fileList) {
      this.uploading = true;
      console.log(file)
      if (file.status === 'success') {
        this.uploading = false;
        this.openUpload = false;
        this.openUser = false;

        this.fileList.splice(0, 1)
        this.result = file.response.data
        this.getlist()
      }
    },
    putStatus(id) {
      let data = {
        id: 1,
        exchangeStatus: id,
      }
      oilDepotConfiguration(data).then(res => {
        if (res.code == 200) {
          this.$message.success("操作成功")
          this.gettj()
        }
      })

    },
    // 重置按钮操作
    resetQuery() {
      this.queryParams = {
        number: '',
        remark: '',
        activateStatus: null,
        status: '',
        pageNo: 1,
        pageSize: 10
      }
      this.getlist();
    },
    getlist() {
      getselectGiftValue().then(res => {
        console.log(res)
        this.jglist = res.data
      })
      getqb().then(res => {

        this.onelist = res.data
        console.log(this.onelist)
      })
      getyi().then(res => {
        this.twolist = res.data
      })
      getwei().then(res => {
        this.threelist = res.data
      })
      this.queryParams.pageNo = this.pageNo
      this.queryParams.pageSize = this.pageSize
      getList(this.queryParams).then(res => {
        this.tableData = res.data.records
        this.total = res.data.total;
      })
    },
    // 删除
    remindOpen(row) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteList(row.id).then(res => {
          if (res.success) {
            this.$message({
              type: 'success',
              message: '删除成功!'
            });
            // 更新表格数据
            this.updateTableData(row);
          } else {
            console.log(row);
            this.$message.error('删除失败，请稍后重试！' + (response.message || ''));
          }
        }).catch(error => {
          console.error('Delete operation failed:', error);
          this.$message({
            type: 'error',
            message: '删除失败，请稍后重试！'
          });
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    updateTableData(deletedRow) {
      // 更新表格数据，例如移除已删除的行
      this.tableData = this.tableData.filter(item => item.id !== deletedRow.id);
    },
    grounding() {
      this.$confirm('是否上架本条数据', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '上架成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消上架'
        });
      });
    },
    Offshelf() {
      this.$confirm('是否下架本条数据', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    posteid(data) {
      eitList(data).then(res => {
        if (res.code == 200) {
          this.$message.success('操作成功！');
        } else {
          this.$message.error('修改失败请稍后再试');
        }
      })
    },
    gettj() {
      getListtj().then(res => {
        this.tjdata = res.data
      })
    },
    daking() {
      this.centerDialogVisible = true
      this.ruleForm = {
        activateStatus: '0',
        quantity: '1',
        cardAmount: '1',
        remark: '',
      }
    },
    addBlock() {
      if (this.ruleForm.quantity == '' || this.ruleForm.cardAmount == '' || this.ruleForm.status == '') {
        this.$message.error('必填项不能有空')
        return
      }
      let data = this.ruleForm
      console.log(data);

      addList(data).then(res => {
        if (res.code == 200) {
          this.$message.success('添加成功');
          this.gettj()
          this.getlist()
        } else {
          this.$message.error('操作失败请稍后再试');
        }
      })
      .catch().catch(error => {
        this.$message.error('操作失败请稍后再试');
      });
      this.centerDialogVisible = false
    }
  }
}
</script>

<style scoped lang="scss">
.tj {
  width: 100%;
  display: flex;
  justify-content: space-between;

}

.box-der {
  box-sizing: border-box;
  padding: 15px;
}

.kar {
  width: 100%;
  background: #FFFFFF;
  margin-bottom: 10px;

}

.d-b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}

.one-size {
  font-size: 20px;
  font-weight: bold;
  color: #000;
}

.two-size {
  font-size: 20px;
  font-weight: bold;
  color: #78b0fb;
}

.three-size {
  font-size: 20px;
  font-weight: bold;
  color: #f73f3f;
}

.ds {
  width: 100%;
  display: flex;
  align-items: center;
  background: #f4f4f4;
  border-radius: 6px;
  margin-bottom: 15px;
  box-sizing: border-box;
  padding: 15px 5px;
}

.tj-text {
  font-size: 18px;
  font-weight: bold;
}

.tj-num {
  margin: 5px auto;
  //font-size: 28px;
  color: #666;
  text-align: center;
}

.tj-siez {
  margin: 5px auto;
  color: #909399;
  font-size: 14px;
  text-align: center;
}

.top-hang {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.d-s {
  display: flex;
  align-items: center;
}

.butoon {
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid #fe8c4a;
  border-radius: 6px;
  font-size: 16px;
  margin-left: 15px;
}

.sshi {
  width: 33%;
  background: #FFFFFF;
  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  box-sizing: border-box;
  padding: 15px;
  border-radius: 6px;
  //background: #f9f9f9;
}

.tjaocuo {
  width: 100%;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
}

.title_ {
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  justify-content: center;
  margin-bottom: 20px;
}

.card-box {
  width: 100%;
  background: #fff;
  box-sizing: border-box;
  padding: 15px;
  border-radius: 10px;
}

.icon-type {
  display: flex;
  align-items: center;
  font-weight: 400;
  font-size: 14px;
  color: #999999;
  margin-right: 20px;
  cursor: pointer;
}

.acvtive {
  color: #FF770F !important;
}

.malou {
  width: 60px;
}
</style>
