lex-xin 10 meses atrás
pai
commit
871449c84a

+ 5 - 1
src/router/index.js

@@ -653,6 +653,10 @@ export const asyncRoutes = {
   schoolPatrol: () => import("@/views/schoolManager/patrol.vue"),
   accountManager: () => import("@/views/schoolManager/accountManager.vue"),
   // 课件配置
-  coursewareConfig: () => import("@/views/courseware-config/index.vue")
+  coursewareConfig: () => import("@/views/courseware-config/index.vue"),
+  // 乐队指导特训营
+  bandGuidanceTraining: () => import("@/views/band-guidance-training"),
+  // 乐队指导特训营详情
+  bandGuidanceTrainingDetail: () => import("@/views/band-guidance-training/detail"),
 };
 export default router;

+ 15 - 1
src/store/modules/permission.js

@@ -1171,7 +1171,21 @@ function setDetailRoute(accessedRoutes) {
             activeMenu: "/groupChatManager",
             id: "xx19"
           }
-        }
+        },
+        {
+          name: "bandGuidanceTrainingDetail",
+          path: "/bandGuidanceTrainingDetail",
+          component: () =>
+            import("@/views/band-guidance-training/detail"),
+          hidden: true,
+          meta: {
+            noCache: "1",
+            title: "乐队指导训练营详情",
+            belongTopMenu: "/operateManager",
+            activeMenu: "/activeMarketing",
+            id: "5269"
+          }
+        },
       ]);
     }
     if (route.path == "/financialManager") {

+ 10 - 0
src/utils/vueFilter.js

@@ -969,3 +969,13 @@ Vue.filter("rangeType", value => {
   };
   return obj[value];
 });
+
+
+Vue.filter("trainingStatus", value => {
+  let obj = {
+    NOT_START: "未开始",
+    APPLY: "报名中",
+    END: "已结束"
+  };
+  return obj[value];
+});

+ 79 - 0
src/views/band-guidance-training/api.js

@@ -0,0 +1,79 @@
+import request2 from '@/utils/request2'
+import qs from 'qs'
+
+/**
+ * 乐队指导训练营列表
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingCampPage(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingCamp/queryPage',
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 乐队指导训练营添加
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingCampAdd(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingCamp/add',
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 乐队指导训练营修改
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingCampModify(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingCamp/modify',
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 乐队指导训练营 详情列表
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingDetailCampPage(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingDetailCamp/queryPage',
+    method: 'post',
+    data
+  })
+}
+/**
+ * 乐队指导训练营 详情统计
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingDetailCampPageStat(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingDetailCamp/queryPageStat',
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 乐队指导训练营 详情导出
+ * @param {*} data 
+ * @returns 
+ */
+export function api_tempDirectorTrainingDetailCampExport(data) {
+  return request2({
+    url: '/api-web/tempDirectorTrainingDetailCamp/export',
+    method: 'post',
+    data
+  })
+}

+ 355 - 0
src/views/band-guidance-training/detail.vue

@@ -0,0 +1,355 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <el-page-header
+      @back="onCancel"
+      :content="name"
+      style="margin-bottom: 16px"
+    ></el-page-header>
+
+    <div class="m-core">
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item prop="search" style="margin-bottom: 0;">
+          <el-input
+            class="search"
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="
+              e => {
+                e.target.blur();
+                $refs.searchForm.save();
+                search();
+              }
+            "
+            placeholder="用户姓名/手机号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="organId" style="margin-bottom: 0;">
+          <el-select
+            class="multiple"
+            style="width: 180px !important"
+            v-model.trim="searchForm.organId"
+            filterable
+            clearable
+            placeholder="请选择城市"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="paymentStatus" style="margin-bottom: 0;">
+          <el-select
+            class="multiple"
+            style="width: 180px !important"
+            v-model.trim="searchForm.paymentStatus"
+            filterable
+            clearable
+            placeholder="请选择状态"
+          >
+            <el-option label="已缴费" value="PAID"></el-option>
+            <el-option label="未缴费" value="NO"></el-option>
+            <el-option label="已退费" value="REFUND"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item style="margin-bottom: 0;">
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+          <el-button v-auth="'tempDirectorTrainingDetailCamp/export'" type="primary" @click="onExport">导出</el-button>
+        </el-form-item>
+      </save-form>
+
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <statistic :col="6" class="statistic" :cols="12">
+              <statistic-item>
+                <span>
+                  报名人数
+                </span>
+                <span> <count-to :endVal="head.applyCount || 0" /> </span>
+              </statistic-item>
+              <statistic-item>
+                <span>
+                  缴费人数
+                </span>
+                <span> <count-to :endVal="head.payCount || 0" /> </span>
+              </statistic-item>
+              <statistic-item>
+                <span>
+                  早鸟人数
+                </span>
+                <span> <count-to :endVal="head.birdCount || 0" /> </span>
+              </statistic-item>
+              <statistic-item>
+                <span>
+                  收款金额
+                </span>
+                <span>
+                  <count-to
+                    :endVal="head.payAmount || 0"
+                    :duration="300"
+                    :decimals="2"
+                    :class="'des'"
+                  />
+                </span>
+              </statistic-item>
+            </statistic>
+        </el-col>
+      </el-row>
+      
+
+      <div class="tableWrap" style="margin-bottom: 0;">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column align="center" label="姓名" prop="username">
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="mobile"
+            label="联系电话"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="cardNo"
+            label="身份证号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="organName"
+            label="所在城市"
+          >
+            <template slot-scope="scope">
+              {{ scope.row.province || '--' }}/{{ scope.row.city || '--' }}/{{ scope.row.region || '--' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="job"
+            label="目前从事职业"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="subjectName"
+            label="第一主专业"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="study"
+            label="之前乐队指导基础"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="studyTarget"
+            label="目标效果"
+          >
+            <template slot-scope="scope">
+              <Tooltip :content="scope.row.studyTarget" />
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="suggestion"
+            label="需求或建议"
+          >
+            <template slot-scope="scope">
+              <Tooltip :content="scope.row.suggestion" />
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="paymentStatus"
+            label="缴费状态"
+          >
+            <template slot-scope="scope">
+              {{ scope.row.paymentStatus | paymentStatus }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="buyAmount" label="缴费金额">
+            <template slot-scope="scope">
+              <div>{{ scope.row.paymentAmount | moneyFormat }}元</div>
+            </template></el-table-column
+          >
+          <el-table-column
+            align="center"
+            prop="organName"
+            label="缴费时间"
+          ></el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Tooltip from "@/components/Tooltip/index";
+import CountTo from "vue-count-to";
+import pagination from "@/components/Pagination/index";
+import { getCountCloudTeacherList } from "./api";
+import { Export } from "@/utils/downLoadFile";
+import cleanDeep from "clean-deep";
+import qs from "qs";
+import { areaQueryTree } from '../organManager/api'
+import { api_tempDirectorTrainingDetailCampPage, api_tempDirectorTrainingDetailCampPageStat, api_tempDirectorTrainingDetailCampExport } from './api' 
+export default {
+  components: { pagination, CountTo, Tooltip },
+  data() {
+    return {
+      name: this.$route.query.name,
+      searchForm: {
+        search: null,
+        paymentStatus: null,
+      },
+      head: {
+        applyCount: null,
+        payCount: null,
+        birdCount: null,
+        payAmount: null
+      },
+      tableList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
+    };
+  },
+  async mounted() {
+    // this.getArea()
+    this.getListStat()
+    this.getList();
+  },
+  methods: {
+    async getArea() {
+      try {
+        const { data } = await areaQueryTree({
+          delFlag: 0
+        })
+        console.log(data)
+      } catch {}
+    },
+    async getListStat() {
+      try {
+        const { data } = await api_tempDirectorTrainingDetailCampPageStat({
+          tempDirectorTrainingCampId: this.$route.query.id,
+          ...this.searchForm
+        });
+        this.head = {
+          applyCount: data.applyCount || 0,
+          payCount: data.payCount || 0,
+          birdCount: data.birdCount || 0,
+          payAmount: data.payAmount || 0 
+        };
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    async getList() {
+      try {
+        const res = await api_tempDirectorTrainingDetailCampPage({
+          tempDirectorTrainingCampId: this.$route.query.id,
+          ...this.searchForm
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = row.data.total || 0
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getListStat()
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = null
+      this.searchForm.paymentStatus = null
+      this.search();
+    },
+    async onExport() {
+      
+      this.$confirm(`您确定导出${this.name}?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(async () => {
+        try {
+          let obj = {
+            tempDirectorTrainingCampId: this.$route.query.id,
+            ...this.searchForm
+          };
+          const { data } = await api_tempDirectorTrainingDetailCampExport(obj)
+          let link = document.createElement("a");
+          let fname = data.fileName || "导出文件.xls"; //下载文件的名字
+          link.href = data.downloadPath;
+          link.setAttribute("download", fname);
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link)
+        } catch {
+          // 
+        }
+      }).catch(error => {
+        that.$message.error('下载失败,请联系管理员');
+      });
+    },
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      this.$router.push("/bandGuidanceTraining");
+    }
+  },
+  filters: {
+    paymentStatus(val) {
+      let template = {
+        PAID: "已缴费",
+        NO: "未缴费",
+        REFUND: "已退费"
+      };
+      return template[val];
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.titleCell {
+  display: inline-block;
+}
+.tableWrap {
+  margin-top: 20px;
+}
+.qrcode {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  img {
+    width: 200px;
+    height: 200px;
+    margin: 0 auto;
+  }
+}
+.code-url {
+  font-size: 18px;
+  text-align: center;
+  padding: 15px 15px 0 15px;
+}
+</style>

+ 249 - 0
src/views/band-guidance-training/index.vue

@@ -0,0 +1,249 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      乐队指导特训营
+    </h2>
+    <div class="m-core">
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item>
+          <el-input
+            class="search"
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="
+              e => {
+                e.target.blur();
+                $refs.searchForm.save();
+                search();
+              }
+            "
+            placeholder="特训营名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model.trim="searchForm.status"
+            placeholder="请选择状态"
+            clearable
+            filterable
+          >
+            <el-option value="NOT_START" label="未开始"></el-option>
+            <el-option value="APPLY" label="报名中"></el-option>
+            <el-option value="END" label="已结束"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="danger" native-type="submit">搜索</el-button>
+          <el-button native-type="reset" type="primary">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <!-- @click="onQuestionOperation('create')"
+            v-if="$helpers.permission('/operateManager/questionOperation/create')" -->
+      <el-button
+        @click="onOperation('create')"
+        type="primary"
+        style="margin-bottom:20px"
+        v-auth="'/tempDirectorTrainingCamp/add'"
+      >
+        新建特训营
+      </el-button>
+      <div class="tableWrap">
+        <el-table
+          :data="tableList"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        >
+          <el-table-column align="center" prop="name" label="特训营名称">
+          </el-table-column>
+          <el-table-column align="center" prop="applyStartDate" label="开始报名时间">
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="birdPriceEndDate"
+            label="早鸟优惠截止时间"
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="applyEndDate"
+            label="报名截止时间"
+          >
+          </el-table-column>
+          <el-table-column align="center" prop="birdPrice" label="早鸟价">
+            <template slot-scope="scope">
+              <div>{{ scope.row.birdPrice | moneyFormat }}元</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="currentPrice" label="优惠价">
+          <template slot-scope="scope">
+              <div>{{ scope.row.currentPrice | moneyFormat }}元</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="originalPrice" label="原价">
+          <template slot-scope="scope">
+              <div>{{ scope.row.originalPrice | moneyFormat }}元</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="applyCount"
+            label="报名人数"
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="payCount"
+            label="缴费人数"
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="payAmount"
+            label="收款金额"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.payAmount | moneyFormat }}元</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="状态" prop="expectTotalSalary">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.status | trainingStatus }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="updateByName"
+            label="更新人"
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="updateTime"
+            label="更新时间"
+          >
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <el-button type="text" @click="onDetail(scope.row)" v-auth="'/bandGuidanceTrainingDetail'"
+                  >详情</el-button
+                >
+                <el-button type="text" @click="onOperation('update', scope.row)"
+                  v-auth="'/tempDirectorTrainingCamp/modify'">修改</el-button
+                >
+                <el-button type="text" @click="getCode(scope.row)"
+                  >二维码</el-button
+                >
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+
+    <qr-code v-model="qrcodeStatus" title="乐队指导特训营二维码" :codeUrl="codeUrl" />
+    <TrainingOperation ref="trainingOperationRef" @getList="getList" />
+  </div>
+</template>
+<script>
+import {
+  getEmployeeOrgan,
+  teacherCourseStatistics,
+  getTeacher
+} from "@/api/buildTeam";
+import pagination from "@/components/Pagination/index";
+import { vaildStudentUrl } from '@/utils/validate'
+import TrainingOperation from './modal/training-operation'
+import QrCode from "@/components/QrCode/index";
+import { api_tempDirectorTrainingCampPage } from './api'
+export default {
+  name: "band-guidance-training",
+  components: { pagination, QrCode, TrainingOperation },
+  data() {
+    return {
+      qrcodeStatus: false,
+      codeUrl: '',
+      searchForm: {
+        search: null,
+        status: null
+      },
+      tableList: [],
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    search() {
+      this.pageInfo.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm = {
+        search: null,
+        status: null
+      };
+      this.getList();
+    },
+    async getList() {
+      try {
+        let params = this.searchForm;
+        const { data } = await api_tempDirectorTrainingCampPage({
+          ...params,
+          page: this.pageInfo.page,
+          rows: this.pageInfo.limit
+        })
+        this.tableList = data.rows;
+        this.pageInfo.total = data.total;
+      } catch {}
+    },
+    getCode(row){
+      // 获取学生端
+      let str = vaildStudentUrl()
+      str+=`/#/bandGuidanceTraining?id=${row.id}`
+      this.codeUrl =str
+      this.qrcodeStatus = true
+    },
+    onDetail(row) {
+      // 
+      this.$router.push({
+        path: '/bandGuidanceTrainingDetail',
+        query: {
+          id: row.id,
+          name: row.name
+        }
+      })
+    },
+    onOperation(type, row) {
+      if (type === "create") {
+        this.$refs.trainingOperationRef.openDialog();
+      } else if (type === "update") {
+        this.$refs.trainingOperationRef.openDialog(row);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped></style>

+ 264 - 0
src/views/band-guidance-training/modal/training-operation.vue

@@ -0,0 +1,264 @@
+<template>
+  <el-dialog
+    :title="agentForm.userId ? '修改特训营' : '新建特训营'"
+    width="800px"
+    :visible.sync="trainingVisible"
+  >
+    <el-form
+      :model="agentForm"
+      label-position="top"
+      label-width="120px"
+      ref="trainingForm"
+    >
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item
+            style="height: 82px !important"
+            label="特训营名称"
+            prop="name"
+            :rules="[
+              { required: true, message: '请输入特训营名称', trigger: 'blur' }
+            ]"
+          >
+            <el-input
+              placeholder="请选择特训营名称"
+              v-model.trim="agentForm.name"
+              :maxlength="16"
+              show-word-limit
+              class="w100"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            style="height: 82px !important"
+            label="报名时间"
+            prop="times"
+            :rules="[
+              { required: true, message: '请选择报名时间', trigger: 'blur' }
+            ]"
+          >
+            <el-date-picker
+              v-model="agentForm.times"
+              type="daterange"
+              value-format="yyyy-MM-dd"
+              range-separator="至"
+              start-placeholder="报名开始时间"
+              end-placeholder="报名结束时间"
+              :picker-options="{ firstDayOfWeek: 1 }"
+              style="width: 100% !important"
+              @change="agentForm.birdPriceEndDate = null"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item
+            style="height: 82px !important"
+            label="优惠价"
+            prop="currentPrice"
+            :rules="[
+              { required: true, message: '请输入优惠价', trigger: 'blur' }
+            ]"
+          >
+            <el-input-number
+              v-model="agentForm.currentPrice"
+              class="number-input"
+              :controls="false"
+              :precision="0"
+              :min="0"
+              :max="999999999"
+              placeholder="请输入优惠价"
+            /> </el-form-item
+        ></el-col>
+        <el-col :span="12"
+          ><el-form-item
+            style="height: 82px !important"
+            label="原价(元)"
+            prop="originalPrice"
+            :rules="[
+              { required: true, message: '请输入原价', trigger: 'blur' }
+            ]"
+          >
+            <el-input-number
+              v-model="agentForm.originalPrice"
+              class="number-input"
+              :controls="false"
+              :precision="0"
+              :min="0"
+              :max="999999999"
+              placeholder="请输入原价"
+            /> </el-form-item
+        ></el-col>
+        <el-col :span="24"
+          ><el-form-item label="是否配置早鸟价" prop="hasBirdPrice">
+            <el-radio-group v-model="agentForm.hasBirdPrice">
+              <el-radio :label="true">是</el-radio>
+              <el-radio :label="false">否</el-radio>
+            </el-radio-group>
+          </el-form-item></el-col
+        >
+        <el-col :span="12" v-if="agentForm.hasBirdPrice"
+          ><el-form-item
+            style="height: 82px !important"
+            label="早鸟价"
+            prop="birdPrice"
+            :rules="[
+              { required: true, message: '请输入早鸟价', trigger: 'blur' }
+            ]"
+          >
+            <el-input-number
+              v-model="agentForm.birdPrice"
+              class="number-input"
+              :controls="false"
+              :precision="0"
+              :min="0"
+              :max="999999999"
+              placeholder="请输入早鸟价"
+            /> </el-form-item
+        ></el-col>
+        <el-col :span="12" v-if="agentForm.hasBirdPrice"
+          ><el-form-item
+            style="height: 82px !important"
+            label="早鸟价截止时间"
+            prop="birdPriceEndDate"
+            :rules="[
+              {
+                required: true,
+                message: '请选择早鸟价截止时间',
+                trigger: 'blur'
+              }
+            ]"
+          >
+            <el-date-picker
+              v-model="agentForm.birdPriceEndDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="请选择早鸟价截止时间"
+              :disabled="agentForm.times.length > 0 ? false : true"
+              :picker-options="onPickerOptions(agentForm.times[1])"
+              style="width: 100% !important"
+            ></el-date-picker> </el-form-item
+        ></el-col>
+      </el-row>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="trainingVisible = false">取 消</el-button>
+      <el-button type="primary" @click="subEditTraining">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import {
+  api_tempDirectorTrainingCampAdd,
+  api_tempDirectorTrainingCampModify
+} from "../api";
+import { getTimes } from "@/utils";
+export default {
+  data() {
+    return {
+      trainingVisible: false,
+      agentForm: {
+        name: "",
+        id: "",
+        times: [],
+        applyStartDate: null,
+        applyEndDate: null,
+        hasBirdPrice: true,
+        birdPriceEndDate: null,
+        birdPrice: null,
+        currentPrice: null,
+        originalPrice: null
+      }
+    };
+  },
+  mounted() {},
+  methods: {
+    onPickerOptions(end) {
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          if (end) {
+            return new Date(end).getTime() < time.getTime();
+          }
+        }
+      };
+    },
+    openDialog(row) {
+      if (row && row.id) {
+        this.agentForm = {
+          name: row.name,
+          id: row.id,
+          times: [row.applyStartDate, row.applyEndDate],
+          applyStartDate: row.applyStartDate,
+          applyEndDate: row.applyEndDate,
+          hasBirdPrice: row.hasBirdPrice,
+          birdPriceEndDate: row.birdPriceEndDate,
+          birdPrice: row.birdPrice,
+          currentPrice: row.currentPrice,
+          originalPrice: row.originalPrice
+        };
+      } else {
+        this.agentForm = {
+          name: "",
+          id: "",
+          times: [],
+          applyStartDate: null,
+          applyEndDate: null,
+          hasBirdPrice: true,
+          birdPriceEndDate: null,
+          birdPrice: null,
+          currentPrice: null,
+          originalPrice: null
+        };
+      }
+      this.trainingVisible = true;
+    },
+    subEditTraining() {
+      this.$refs.trainingForm.validate(async flag => {
+        if (flag) {
+          const { times, ...more } = this.agentForm;
+          const params = {
+            ...more,
+            ...getTimes(this.agentForm.times, ['applyStartDate', 'applyEndDate'])
+          };
+          if (this.agentForm.userId) {
+            // 修改
+            try {
+              const res = await api_tempDirectorTrainingCampModify({
+                ...params
+              });
+              this.$message.success("修改成功");
+              this.$emit("getList");
+              this.trainingVisible = false;
+            } catch (e) {
+              console.log(e);
+            }
+          } else {
+            // 新增
+            try {
+              const res = await api_tempDirectorTrainingCampAdd({
+                ...params
+              });
+              this.$message.success("新增成功");
+              this.$emit("getList");
+              this.trainingVisible = false;
+            } catch (e) {
+              console.log(e);
+            }
+          }
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.number-input {
+  width: 100% !important;
+  ::v-deep .el-input__inner {
+    text-align: left;
+  }
+}
+</style>