MONSTER-ygh před 1 měsícem
rodič
revize
fbbc85d5aa

+ 38 - 1
src/api/ticketMr/schedulingConfiguration.js

@@ -47,7 +47,7 @@ export const deleteById = (params) => {
 }
 
 
-/**  启用和禁用  */
+/**  启用和禁用 场次  */
 export function releaseById(data) {
   return request({
     url: '/merchant/merchantPerformTime/updateStatus',
@@ -86,3 +86,40 @@ export const seatTypeTmpSaleCount = (query) => {
   })
 }
 
+// 批量删除 日期内的演出场次删除
+export const deleteByDateApi = (params) => {
+  return request({
+    url: '/merchant/merchantPerformTime/deleteByDate',
+    method: 'delete',
+    params
+  })
+}
+
+
+// 删除演出场次信息
+export const performTimeDeleteByIdApi = (params) => {
+  return request({
+    url: '/merchant/merchantPerformTime/deleteById',
+    method: 'delete',
+    params
+  })
+}
+
+// 查询演出场次列表
+export const selectListByDateApi = (query) => {
+  return request({
+    url: '/merchant/merchantPerformTime/selectListByDate',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 查询演出场次列表
+export const insertOrUpdateApi = (data) => {
+  return request({
+    url: '/merchant/merchantPerformTime/insertOrUpdate',
+    method: 'post',
+    data
+  })
+}

+ 364 - 0
src/views/ticket/schedulingConfiguration/dialog/PerFormEdit.vue

@@ -0,0 +1,364 @@
+<!--
+ * @Description: 新增/编辑弹框
+ * @Author: Sugar.
+ * @Date: 2023-11-24 13:55:00
+ * @LastEditors: Sugar.
+ * @LastEditTime: 2023-11-24 13:55:00
+ * @FilePath: \cattle_webui\src\views\venue\schedulingMr\dialog\AddOrEditDialog.vue
+ * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
+-->
+<template>
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="70%"
+      class="text-dia-log-class"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="cancel"
+    >
+      <div class="dialog">
+        <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+            <el-form-item label="场次名称" prop="timeSnapshot">
+                <el-input
+                    v-model="form.timeSnapshot"
+                    placeholder="场次名称"
+                    clearable
+                    style="width: 100%;"
+                />
+            </el-form-item>
+            <el-form-item label="场次名称" prop="performTime">
+                <el-time-picker
+                    v-model="form.performTimeStart"
+                    format="HH:mm"
+                    value-format="HH:mm"
+                    placeholder="开始时间">
+                </el-time-picker>
+                <span>—</span>
+                <el-time-picker
+                    v-model="form.performTimeEnd"
+                    format="HH:mm"
+                    value-format="HH:mm"
+                    placeholder="结束时间">
+                </el-time-picker>
+            </el-form-item>
+            <el-form-item label="选择演出厅:" prop="auditoriumId">
+            <el-select
+              v-model="form.auditoriumId"
+              placeholder="选择演出厅"
+              clearable
+              style="width: 100%"
+              @change="(value) =>getInventoryTemplate(value)"
+            >
+              <el-option
+                v-for="dict in merchantList"
+                :key="dict.id"
+                :label="dict.name"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="选择剧目:" prop="performId">
+            <el-select
+              v-model="form.performId"
+              placeholder="选择剧目"
+              clearable
+              @change="changePerform"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="dict in goodsList"
+                :key="dict.id"
+                :label="dict.name"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="票务绑定:" prop="goodsIds">
+            <el-select
+              v-model="form.goodsIds"
+              placeholder="票务绑定"
+              clearable
+              multiple
+              style="width: 100%"
+            >
+              <el-option
+                v-for="dict in goodsPageListS"
+                :key="dict.id"
+                :value="dict.id"
+                :label="dict.status == 1 ? dict.goodsName + '(被禁用)': dict.goodsName"
+                :disabled="dict.status != 0"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="票务绑定:" prop="stockTmpId">
+            <el-select
+                v-model="form.stockTmpId"
+                placeholder="选择库存模板"
+                clearable
+                style="width: 100%"
+                >
+                    <el-option
+                      v-for="dict in inventoryTemplateList"
+                      :key="dict.id"
+                      :label="dict.name"
+                      :value="dict.id"
+                      :disabled="dict.status != 1"
+                    />
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancel">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm"
+          v-loading.fullscreen.lock="loading"
+          element-loading-text="提交中..."
+          element-loading-spinner="el-icon-loading"
+          element-loading-background="rgba(0, 0, 0, 0.8)"
+        >
+          <span v-if="loading">提交中...</span>
+          <span v-else>保存</span>
+        </el-button>
+      </span>
+    </el-dialog>
+  </template>
+  
+  <script>
+  import { insertOrUpdateApi, goodsPageListNew, getPerformTimeById } from "@/api/ticketMr/schedulingConfiguration";
+  import { goodsPageList } from '@/api/programmeMr/programmeMr'
+  import { merchantPageList } from '@/api/performanceHallMr/performanceHallMr'
+  import { pageList as getInventoryTemplateApi } from '@/api/ticketMr/InventoryTemplate'
+  import { getToken } from "@/utils/auth";
+  import moment from "moment"
+  export default {
+    name: "addAndEdit",
+    data() {
+      return {
+        title: "编辑",
+        model: "EDIT",
+        open: false,
+        loading: false,
+        tableType: false,
+        form: {
+          id: undefined,
+          planSessionList: [],
+          insertType: '1',
+          useStock: 0,
+          weekDay: [],
+          weekType: 0
+        },
+        rules: {
+          auditoriumId: [{ required: true, message: "请选择演出厅", trigger: ["change","blur"] }],
+          performId: [{ required: true, message: "请选择剧目", trigger: ["change","blur"] }],
+          performDate: [{ required: true, message: "请选择日期", trigger: ["change","blur"] }],
+          planSessionList: [{ required: true, message: "请添加场次", trigger: ["change","blur"] }],
+          goodsIds: [{ required: true, message: "请选择票务", trigger: ["change","blur"] }],
+          weekType: [{ required: true, message: "请选择星期", trigger: ["change","blur"] }],
+        },
+        uploadObj: {
+          url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
+          Headers: { Authorization: "Bearer " + getToken() },
+        },
+        theatreList: [],
+        goodsList: [],
+        merchantList: [],
+        editType: false,
+        selectPerform: {},
+  
+        goodsPageListS: [], // 票务
+  
+        inventoryTemplateList: []
+      };
+    },
+    created() {
+      /**  获取票务  */
+      this.goodsPageList(); // 剧目列表
+      this.merchantPageList('') // 演出厅
+      //this.getInventoryTemplate()
+    },
+    methods: {
+      /**
+       * 打开弹框
+       * @date 2023-11-22
+       * @param {any} obj
+       * @returns {any}
+       */
+      async openDialog(title, obj, type) {
+        this.open = true;
+        this.editType = false;
+        if (obj && type == "EDIT"){
+          this.title = "编辑排期";
+          if(obj.performId) {
+            await this.goodsPageListFun(obj.performId);
+          }
+          await this.getInventoryTemplate(obj.auditoriumId)
+          this.form = {
+            "id": obj.id,
+            "performId": obj.performId,
+            "auditoriumId": obj.auditoriumId,
+            "performDate": obj.performDate,
+            "performTimeStart": obj.performTimeStart,
+            "performTimeEnd": obj.performTimeEnd,
+            "timeSnapshot": obj.timeSnapshot,
+            "useStock": obj.useStock,
+            "stockTmpId": obj.stockTmpId,  
+            goodsIds: obj.goodsIds ? obj.goodsIds.split(','):[],
+          }
+        }else{
+          this.title = "新增排期";
+          this.form = {};
+        }
+        this.$nextTick(() => {
+          this.$refs["form"].clearValidate();
+        });
+      },
+      /** 剧目选择 */
+      changePerform(id) {
+        this.goodsList.forEach(item => {
+          if(id == item.id){
+            this.selectPerform = item;
+          }
+        })
+        this.goodsPageListS = []
+        if(id) {
+          this.goodsPageListFun(id);
+        }
+        this.$set(this.form, 'goodsIds' , [])
+      },
+      /** 剧目列表查询 */
+      goodsPageList() {
+        goodsPageList(this.addDateRange({pageNum: 1, pageSize: 100, status: 1}))
+          .then(response => {
+              this.goodsList = response.data.rows;
+          });
+      },
+      /** 演出厅列表查询 */
+      merchantPageList(id) {
+        merchantPageList(this.addDateRange({theatreId: id, pageNum: 1, pageSize: 100}))
+          .then(response => {
+              this.merchantList = response.data.rows;
+          });
+      },
+      /**  票务信息  */
+      async goodsPageListFun(value){
+        try {
+          if(!this.form.auditoriumId || !this.form.performId) {
+            this.goodsPageListS = []
+            return
+          }
+          let res = await goodsPageListNew({
+            performId: this.form.performId,
+            auditoriumId: this.form.auditoriumId
+          })
+          if(res.code == 200){
+            this.goodsPageListS = res.data
+          }
+        } catch (error) {      
+        }
+      },
+      /**  获取模板  */
+      async getInventoryTemplate(value,type){
+        try {
+          if(this.form.planSessionList && this.form.planSessionList.length > 0 && type) {
+            let list = JSON.parse(JSON.stringify(this.form.planSessionList))
+            list.forEach((item,index)=>{
+              list[index].stockTmpId = null
+            })
+            this.$set(this.form,'planSessionList',list)
+          }
+          if(!value) {
+            this.inventoryTemplateList = []
+            return 
+          } 
+          await this.goodsPageListFun(value)
+          // 获取库存模板
+          let res = await getInventoryTemplateApi({
+            auditoriumId: value,
+            pageNum: 1,
+            pageSize: 1000,
+          })
+          if(res.code == 200){
+            this.inventoryTemplateList = res.data.rows
+          }
+        } catch (error) {   
+          console.error("error===",error)   
+        }
+      },
+      /**
+       * 保存
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      submitForm() {
+        this.$refs["form"].validate(async (valid) => {
+          if (valid) {
+            try {
+              let postEdit = JSON.parse(JSON.stringify(this.form))
+              postEdit.goodsIds = postEdit.goodsIds.join(',')
+              delete postEdit.performDate
+              this.loading = true;
+              const { code } = await insertOrUpdateApi({ ...postEdit });
+              if (code === 200) {
+                this.$message.success("操作成功!");
+                this.$emit("getList");
+                this.cancel();
+              }
+            } catch (error) {
+              console.error("error====",error)
+            } finally {
+              this.loading = false;
+            }
+          }
+        });
+      },
+      /**
+       * 重置
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      reset() {
+        
+      },
+      /**
+       * 关闭弹框
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      cancel() {
+        this.reset();
+        this.open = false;
+      },
+    },
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .dialog {
+    height: 65vh;
+    overflow-y: auto;
+  }
+  .dialog {
+    .upload-btn {
+      width: 100px;
+      height: 100px;
+      background-color: #fbfdff;
+      border: dashed 1px #c0ccda;
+      border-radius: 5px;
+      i {
+        font-size: 30px;
+        margin-top: 20px;
+      }
+      &-text {
+        margin-top: -10px;
+      }
+    }
+    .avatar {
+      cursor: pointer;
+    }
+  }
+  </style>
+  

+ 5 - 3
src/views/ticket/schedulingConfiguration/dialog/addAndEdit.vue

@@ -20,14 +20,15 @@
     <div class="dialog">
       <el-form :model="form" ref="form" :rules="rules" label-width="120px">
         <el-form-item label="日期范围:"  prop="performDate">
-          <el-date-picker
+          <!-- <el-date-picker
             v-model="form.performDate"
             type="daterange"
             range-separator="至"
             value-format="yyyy-MM-dd"
             start-placeholder="开始日期"
             end-placeholder="结束日期">
-          </el-date-picker>
+          </el-date-picker> -->
+          {{ form.performDate && form.performDate.length == 2?  (form.performDate[0] + '  -  ' + form.performDate[1]):''}}
         </el-form-item>
         <el-form-item label="星期:" prop="weekType">
           <div>
@@ -250,7 +251,7 @@ export default {
     async openDialog(title, obj, type) {
       this.open = true;
       this.editType = false;
-      if (obj){
+      if (obj && type == "EDIT"){
         this.title = "编辑排期";
         if(obj.performId) {
           await this.goodsPageListFun(obj.performId);
@@ -268,6 +269,7 @@ export default {
       }else{
         this.title = "新增排期";
         this.form = {
+            performDate: [obj.prev,obj.next],
             planSessionList: [],
             weekDay: [],
             weekType: 0

+ 91 - 64
src/views/ticket/schedulingConfiguration/dialog/perFormListBox.vue

@@ -3,52 +3,67 @@
         :close-on-click-modal="false" @close="cancel">
         <div class="dialog">
             <div style="padding-bottom: 10px;">
-                <el-button type="primary" v-hasPermi="['ticketMr:schedulingConfiguration:add']" @click="handleAdd('ADD')">新增</el-button>
+                <el-form 
+                :model="queryParams" 
+                ref="queryForm" 
+                size="small" 
+                :inline="true" 
+                label-width="100px">
+                    <el-form-item label="时间:" label-width="60px">
+                        <el-date-picker
+                            v-model="queryParams.performDate"
+                            type="date"
+                            format="yyyy-MM-dd"
+                            value-format = "yyyy-MM-dd"
+                            placeholder="选择日期">
+                            </el-date-picker>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                    </el-form-item>
+                </el-form>
             </div>
             <el-table ref="tables" v-loading="loading" :data="timeList" border>
-                <el-table-column label="序号" align="center" type="index" />
-                <el-table-column label="编号ID" align="center" prop="planNo" />
-                <el-table-column label="日期范围" align="center" prop="dateStart">
-                    <template slot-scope="scope">
-                        {{ moment(scope.row.dateStart).format('YYYY年MM月DD日') }} - {{ moment(scope.row.dateEnd).format('YYYY年MM月DD日') }}
-                    </template>
-                </el-table-column>
-                <el-table-column label="星期" align="center" prop="weekDay">
-                    <template slot-scope="scope">
-                        <div v-if="scope.row.weekDay">
-                            <span :key="item" v-for="(item,index) in scope.row.weekDay.split(',')">{{ weekList[item] }}{{ index == scope.row.weekDay.split(',').length-1?'':', '}}</span>
-                        </div>
-                    </template>
-                </el-table-column>
-                <el-table-column label="票务" align="center" prop="goodsNames" />
+                <el-table-column label="演出日期" align="center" prop="performDate" />
                 <el-table-column label="场次信息" align="center" prop="planSessionList">
                     <template slot-scope="scope">
-                        <div v-if="scope.row.planSessionList">
-                            <span 
-                            v-for="(item,index) in scope.row.planSessionList"
-                            :key="index"
-                            style="margin-right: 10px;"
-                            >{{ item.startInterval }} - {{ item.endInterval }}</span>
+                        <div>
+                            <span>{{ scope.row.timeSnapshot }}</span>
+                            <span>({{ scope.row.performTimeStart }} - {{ scope.row.performTimeEnd }})</span>
                         </div>
                     </template>
                 </el-table-column>
+                <el-table-column label="演出厅" align="center" prop="auditoriumName" />
+                <el-table-column label="剧目信息" align="center" prop="performName" />
+                <el-table-column label="票务信息" align="center" prop="goodsNames" />
+                <el-table-column label="库存模板" align="center" prop="stockTmpName" />
                 <el-table-column label="最后修改时间" align="center" prop="updateTime" />
                 <el-table-column label="最后修改人" align="center" prop="updateBy" />
+                <el-table-column label="状态" align="center">
+                    <template slot-scope="scope">
+                        <switchBoxVue v-model="scope.row.status" @changeFun="ionlineFun(scope.row)" :active-value="1" />
+                    </template>
+                </el-table-column>
                 <el-table-column label="操作" align="center" prop="name">
                     <template slot-scope="scope">
                         <el-button
                             size="mini"
                             type="text"
-                            @click="copyAdd(scope.row)"
-                             v-hasPermi="['ticketMr:schedulingConfiguration:add']"
-                        >复制</el-button>
+                            @click="editFun(scope.row)"
+                            v-hasPermi="['ticketMr:schedulingConfiguration:add']"
+                        >修改</el-button>
                         <el-button
                             size="mini"
                             type="text"
                             style="margin-left: 10px;"
                             @click="deleteFun(scope.row)"
-                             v-hasPermi="['ticketMr:schedulingConfiguration:delect']"
+                            v-hasPermi="['ticketMr:schedulingConfiguration:delect']"
                             >删除</el-button>
+                        <el-button
+                            size="mini"
+                            type="text"
+                            @click="handlePerFormDeatils(scope.row)"
+                        >销售详情</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -67,16 +82,27 @@
         ref="addAndEdit"
         @getList="getPerformTimeByIdFun"
         />
+        <!-- 排期详情  -->
+        <perFormDeatils ref="perFormDeatils" @getList="getPerformTimeByIdFun" />
     </el-dialog>
 </template>
 
 <script>
-import { deleteById,pageList, getPerformTimeById } from "@/api/ticketMr/schedulingConfiguration";
-import addAndEdit from "./addAndEdit";
+import { 
+    deleteById,
+    pageList, 
+    getPerformTimeById,
+    performTimeDeleteByIdApi,
+    selectListByDateApi,
+    releaseById
+ } from "@/api/ticketMr/schedulingConfiguration";
+import addAndEdit from "./PerFormEdit";
+import perFormDeatils from './perFormDeatils.vue';
+import switchBoxVue from '@/components/switchBox.vue';
 import moment from "moment"
 export default {
     name: "PerFormListBox",
-    components: { addAndEdit },
+    components: { perFormDeatils,addAndEdit,switchBoxVue },
     data() {
         return {
             title: "编辑",
@@ -112,13 +138,19 @@ export default {
             this.title = title
             this.form = {}
             this.queryParams.pageNum = 1
+            this.$set(this.queryParams,'performDate',obj.performDate)
             this.getPerformTimeByIdFun()
         },
-        /**  票务信息  */
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getPerformTimeByIdFun()
+        },
+        /**  演出场次时间  */
         async getPerformTimeByIdFun() {
             try {
+                console.log("dsfsdf===",this.queryParams)
                 this.loading = true
-                let res = await pageList({
+                let res = await selectListByDateApi({
                     ...this.queryParams
                 })
                 if (res.code == 200) {
@@ -131,36 +163,13 @@ export default {
                 console.error("error====", error)
             }
         },
-        /** 新增按钮操作 */
-        handleAdd(type) {
-            this.$refs["addAndEdit"].openDialog("新增数据", null, type);
+        /** 排期销售详情  */
+        handlePerFormDeatils(row) {
+            this.$refs["perFormDeatils"].openDialog("排期销售详情", row);
         },
         /** 复刻 */
-        copyAdd(row) {
-            this.$refs["addAndEdit"].openDialog("新增数据", row, "ADD");
-        },
-        /**
-         * 保存
-         * @date 2023-11-22
-         * @returns {any}
-         */
-        async submitForm() {
-            try {
-                this.loading = true
-                let res = await releaseById({
-                    id: this.form.id,
-                    status: this.form.status == 1 ? 2 : 1
-                })
-                if (res.code == 200) {
-                    this.$message.success("操作成功!");
-                    this.$emit("getList")
-                    this.cancel()
-                }
-                this.loading = false
-            } catch (error) {
-                console.error("error===", error)
-                this.loading = false
-            }
+        editFun(row) {
+            this.$refs["addAndEdit"].openDialog("修改场次", row, "EDIT");
         },
         /**
          * 关闭弹框
@@ -172,7 +181,7 @@ export default {
             this.open = false;
         },
         deleteFun(row){
-            this.$modal.confirm(`您确定要删除此次排期计划吗?`).then(()=> {
+            this.$modal.confirm(`您确定要删除此次场次吗?`).then(()=> {
                 this.handleDelete(row)
             }).catch(() => {});
         },
@@ -180,7 +189,7 @@ export default {
         async handleDelete(row) {
             try {
                 this.loading = true
-                let res = await deleteById({
+                let res = await performTimeDeleteByIdApi({
                     id: row.id
                 })
                 if (res.code == 200) {
@@ -193,9 +202,27 @@ export default {
                 console.error("error====", error)
             }
         },
-        openDetails() {
-
-        }
+        /** 警用和启用 */
+        ionlineFun(row) {
+            this.$confirm("您确认要" + (row.priceStatus == 1 ? '禁用该场次吗?' : '启用该场次吗?'), '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                releaseById({
+                    id: row.id,
+                    status: row.status == 1 ? 2 : 1
+                }).then((res) => {
+                if (res.code == 200) {
+                    this.$message({
+                    type: 'success',
+                    message: '操作成功!'
+                    });
+                    this.getPerformTimeByIdFun();
+                }
+                });
+            }).catch(() => {this.getPerformTimeByIdFun();});
+        },
     },
 };
 </script>

+ 218 - 0
src/views/ticket/schedulingConfiguration/dialog/quickQuery.vue

@@ -0,0 +1,218 @@
+<template>
+    <el-dialog :title="title" :visible.sync="open" width="90%" class="text-dia-log-class" append-to-body center
+        :close-on-click-modal="false" @close="cancel">
+        <div class="dialog">
+            <div style="padding-bottom: 10px;">
+                <el-form 
+                :model="queryParams" 
+                ref="queryForm" 
+                size="small" 
+                :inline="true" 
+                label-width="100px">
+                    <el-form-item label="时间:" label-width="60px">
+                        <el-date-picker
+                            v-model="queryParams.performDate"
+                            type="date"
+                            format="yyyy-MM-dd"
+                            value-format = "yyyy-MM-dd"
+                            placeholder="选择日期">
+                            </el-date-picker>
+                    </el-form-item>
+                    <el-form-item label="票务名称:">
+                        <el-select
+                            v-model="queryParams.goodsIds"
+                            placeholder="票务名称"
+                            clearable
+                            multiple
+                            style="width: 100%"
+                        >
+                            <el-option
+                            v-for="dict in goodsPageListS"
+                            :key="dict.id"
+                            :value="dict.id"
+                            :label="dict.status == 1 ? dict.goodsName + '(被禁用)': dict.goodsName"
+                            >
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="库存模板:">
+                        <el-select
+                        v-model="queryParams.stockTmpId"
+                        placeholder="选择库存模板"
+                        clearable
+                        style="width: 100%"
+                        >
+                        <el-option
+                            v-for="dict in inventoryTemplateList"
+                            :key="dict.id"
+                            :label="dict.name"
+                            :value="dict.id"
+                        />
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <el-table ref="tables" v-loading="loading" :data="timeList" border>
+                <el-table-column label="剧目信息" align="center" prop="performName" />
+                <el-table-column label="演出厅" align="center" prop="auditoriumName" />
+                <el-table-column label="日期" align="center" prop="performDate" />
+                <el-table-column label="场次信息" align="center" prop="planSessionList">
+                    <template slot-scope="scope">
+                        <div>
+                            <span>{{ scope.row.timeSnapshot }}</span>
+                            <span>({{ scope.row.performTimeStart }} - {{ scope.row.performTimeEnd }})</span>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column label="库存模板" align="center" prop="stockTmpName" />
+                <el-table-column label="票务名称" align="center" prop="goodsNames" />
+            </el-table>
+        </div>
+        <span slot="footer" class="dialog-footer">
+            <pagination
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getPerformTimeByIdFun"
+            />
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+import { 
+    selectListByDateApi,
+} from "@/api/ticketMr/schedulingConfiguration";
+import { pageList as goodsPageListNew } from '@/api/ticketMr/ticketMr'
+import { pageList as getInventoryTemplateApi } from '@/api/ticketMr/InventoryTemplate'
+import moment from "moment"
+export default {
+    name: "PerFormListBox",
+    data() {
+        return {
+            title: "快速查询",
+            model: "EDIT",
+            open: false,
+            loading: false,
+            timeList: [],
+            total: 0,
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+            },
+            goodsPageListS: [], // 票务
+            inventoryTemplateList: []
+        };
+    },
+    created(){
+        this.goodsPageListFun()
+        this.getInventoryTemplate()
+    },
+    methods: {
+        moment,
+        /**
+         * 打开弹框
+         * @date 2023-11-22
+         * @param {any} obj
+         * @returns {any}
+         */
+        async openDialog(title, obj, type) {
+            this.open = true;
+            this.title = title
+            this.queryParams.pageNum = 1
+            this.getPerformTimeByIdFun()
+        },
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getPerformTimeByIdFun()
+        },
+        /**  演出场次时间  */
+        async getPerformTimeByIdFun() {
+            try {
+                console.log("dsfsdf===",this.queryParams)
+                this.loading = true
+                let res = await selectListByDateApi({
+                    ...this.queryParams
+                })
+                if (res.code == 200) {
+                    this.timeList = res.data.rows
+                    this.total = res.data.total
+                }
+                this.loading = false
+            } catch (error) {
+                this.loading = false
+                console.error("error====", error)
+            }
+        },
+        /**
+         * 关闭弹框
+         * @date 2023-11-22
+         * @returns {any}
+         */
+        cancel() {
+            this.$emit("getList")
+            this.open = false;
+        },
+        /**  票务信息  */
+        async goodsPageListFun(){
+            try {
+                let res = await goodsPageListNew({
+                    pageNum: 1,
+                    pageSize: 1000
+                })
+                if(res.code == 200){
+                    this.goodsPageListS = res.data.rows
+                }
+            } catch (error) {      
+            }
+        },
+        /**  获取模板  */
+        async getInventoryTemplate(){
+            try {
+                // 获取库存模板
+                let res = await getInventoryTemplateApi({
+                    pageNum: 1,
+                    pageSize: 1000,
+                })
+                if(res.code == 200){
+                    this.inventoryTemplateList = res.data.rows
+                }
+            } catch (error) {   
+                console.error("error===",error)   
+            }
+        },
+    },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+    height: 65vh;
+    overflow-y: auto;
+
+    .upload-btn {
+        width: 100px;
+        height: 100px;
+        background-color: #fbfdff;
+        border: dashed 1px #c0ccda;
+        border-radius: 5px;
+
+        i {
+            font-size: 30px;
+            margin-top: 20px;
+        }
+
+        &-text {
+            margin-top: -10px;
+        }
+    }
+
+    .avatar {
+        cursor: pointer;
+    }
+}
+</style>

+ 215 - 34
src/views/ticket/schedulingConfiguration/index.vue

@@ -1,52 +1,66 @@
 <template>
   <div class="app-container app-calendar-container">
     <div>
-      <el-button  type="primary" @click="handlePerFormList('ADD')">排期配置</el-button>
+      <el-button type="primary" v-hasPermi="['ticketMr:schedulingConfiguration:add']" @click="handleAdd('ADD')">配置排期</el-button>
+      <el-button type="primary" v-hasPermi="['ticketMr:schedulingConfiguration:delect']" @click="checkIsClear()">批量清空</el-button>
+      <el-button type="primary" @click="quickQueryFun()">快速查询</el-button>
     </div>
-    <div v-loading="loading">
-      <el-calendar v-model="timeValue" v-if="showCalendar">
+    <div v-loading="loading" class="calendar-dialog">
+      <el-calendar v-model="timeValue">
         <template
           slot="dateCell"
           slot-scope="{date, data}">
-          <div @click.stop="selectTime(data.day)" :class="[data.day == today?'today_yes':'today_no']">
-            <span>{{ data.day.split('-').slice(1).join('-') }}</span>
+          <div 
+          :class="['calendar_box', selectTime(data)]" 
+          @mouseover="mouseoverFun(data)" 
+          @click.stop="clickTimeFun(data)"
+          >
+            <div class="calendar_box-date">
+              <span>{{ data.day.split('-').slice(1).join('-') }}</span>
+              <span @click="handlePerFormList('ADD',data)">详情</span>
+            </div>
+            
             <div style="width: 100%; display: flex;flex-wrap: wrap;" >
               <div 
               :key="index"
               :style="{marginLeft: index%2 == 0?'':'20px',color: item.status == 1 ?'#67c23a':'#909399'}"
               v-for="(item,index) in getPerFormList(data)"
-              @click.stop="handlePerFormDeatils(item)"
               >
               {{ item.performTimeStart }}-{{ item.performTimeEnd }}
               </div>
             </div>
-            
           </div>
-          
         </template>
       </el-calendar>
-      <!-- <calendarBox /> -->
     </div>
-    <!-- 排期详情  -->
-    <perFormDeatils ref="perFormDeatils" @getList="getList" />
-
+    <!-- 排期配置  -->
+     <addAndEdit ref="addAndEdit"  @getList="getList" />
+  
     <!-- 排期列表 -->
     <perFormListBox ref="perFormListBox" @getList="getList" />
+
+    <!-- 快速查询 -->
+     <quickQuery ref="quickQuery" />
   </div>
 </template>
 
 <script>
 
-import { calendarList } from '@/api/ticketMr/schedulingConfiguration'
+import { 
+  calendarList,
+  deleteByDateApi,
+ } from '@/api/ticketMr/schedulingConfiguration'
 
 import moment from "moment"
 import calendarBox from './dialog/calendarBox.vue';
-import perFormDeatils from './dialog/perFormDeatils.vue';
+
 import perFormListBox from './dialog/perFormListBox.vue';
+import addAndEdit from "./dialog/addAndEdit";
+import quickQuery from './dialog/quickQuery.vue';
 export default {
   name: "SchedulingConfiguration",
   dicts: [],
-  components: { calendarBox,perFormDeatils,perFormListBox },
+  components: { calendarBox,perFormListBox,addAndEdit,quickQuery },
   data() {
     return {
       // 遮罩层
@@ -59,6 +73,12 @@ export default {
         endDate: null,
       },
       timeValue: new Date(),
+      timeValueObj: {
+        prev: null,
+        next: null,
+        hover: null
+      },
+
       perFormList: [],
       showCalendar: false,
       today: moment().format("YYYY-MM-DD")
@@ -98,28 +118,95 @@ export default {
       })
       return list
     },
-    selectTime(value){
-      console.log("value====",value)
-      // this.queryParams = {
-      //   startDate: moment(value).startOf('month').format("YYYY-MM-DD"),
-      //   endDate: moment(value).endOf('month').format("YYYY-MM-DD"),
-      // }
-      // this.getList();
+    /** 选中得时间  */
+    selectTime(data) {
+      let srt = ''
+      let newTime = moment(data.day).startOf('day').valueOf()
+      let newTime1 = moment().startOf('day').valueOf()
+      if(newTime < newTime1 ) {
+        return "disable_time"
+      }
+      if( this.timeValueObj ) {
+        if( this.timeValueObj.prev && this.timeValueObj.next ) {
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.next).valueOf()
+          if(newTime == minTime || newTime == maxTime) {
+            return 'is-select_time_self'
+          }
+          if(minTime > maxTime){
+            if(minTime >= newTime && maxTime <= newTime){
+              srt = 'is-select_time'
+            }
+          }else {
+            if(minTime <= newTime && maxTime >= newTime){
+              srt = 'is-select_time'
+            }
+          }
+        }else if( this.timeValueObj.prev && !this.timeValueObj.next && this.timeValueObj.hover ){
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.hover).valueOf()
+          if(newTime == minTime || newTime == maxTime) {
+            return 'is-select_time_self'
+          }
+          if(minTime > maxTime){
+            if(minTime >= newTime && maxTime <= newTime){
+              srt = 'is-select_time_hover'
+            }
+          }else {
+            if(minTime <= newTime && maxTime >= newTime){
+              srt = 'is-select_time_hover'
+            }
+          }
+        }
+      }
+      return srt
+    },
+    clickTimeFun(data) {
+      let newTime1 = moment(data.day).startOf('day').valueOf()
+      let newTime = moment().startOf('day').valueOf()
+      if(newTime1 < newTime ) {
+        return 
+      }
+      if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
+        return
+      }
+      if( !this.timeValueObj || !this.timeValueObj.prev ) {
+        this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
+      }else if( this.timeValueObj.prev && !this.timeValueObj.next ){
+        this.timeValueObj.next = moment(data.day).format("YYYY-MM-DD")
+      }else if( this.timeValueObj.prev && this.timeValueObj.next ) {
+        this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
+        this.timeValueObj.next = null
+      }
+    },
+    mouseoverFun(data) {
+      if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
+        return
+      }
+      if( this.timeValueObj.prev && !this.timeValueObj.next ){
+        this.timeValueObj.hover = moment(data.day).format("YYYY-MM-DD")
+        this.timeValue = new Date(this.timeValueObj.hover)
+      }
     },
     
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.$refs["addAndEdit"].openDialog("修改数据", row);
+    /** 新增按钮操作 */
+    handleAdd(type) {
+      if( this.timeValueObj.prev && this.timeValueObj.next ) {
+        this.openPrice = true
+        this.formPrice = {}
+        this.$nextTick(()=>{
+          this.$refs["addAndEdit"].openDialog("配置排期", this.timeValueObj, type);
+        })
+      }else {
+        this.$message.error("请选择时间区间!!!");
+      }
     },
-
-    /** 排期详情  */
-    handlePerFormDeatils(row) {
-      this.$refs["perFormDeatils"].openDialog("排期详情", row);
+    quickQueryFun(type){
+      this.$refs["quickQuery"].openDialog("快速查询", null, type);
     },
-
     /** 排期列表 */
-    handlePerFormList() {
-      this.$refs["perFormListBox"].openDialog("排期详情", null);
+    handlePerFormList(type,data) {
+      this.$refs["perFormListBox"].openDialog("排期详情", {performDate: data.day},type);
     },
     // 获取日历显示时间范围
     getRange(date){
@@ -177,7 +264,59 @@ export default {
         endDate: lastDay,
       }
       this.getList();
-    }
+    },
+    checkIsClear(){
+      if (this.timeValueObj.prev && this.timeValueObj.next) {
+        let minTime = moment(this.timeValueObj.prev).valueOf()
+        let maxTime = moment(this.timeValueObj.next).valueOf()
+        let startDate = null
+        let endDate = null
+        if (minTime > maxTime) {
+          startDate = this.timeValueObj.next
+          endDate = this.timeValueObj.prev
+        } else {
+          startDate = this.timeValueObj.prev
+          endDate = this.timeValueObj.next
+        }
+        this.$modal.confirm('确定要清空勾选"' + startDate + '——' + endDate + '"的日期范围内的数据吗?').then(()=> {
+          this.clearCalendarPrice()
+        }).catch(() => {});
+      } else {
+        this.$message.error("请选择时间区间!!!");
+      }
+      
+    },
+    /** 一键清除  */
+    async clearCalendarPrice() {
+      try {
+        if( this.timeValueObj.prev && this.timeValueObj.next ) {
+          let minTime = moment(this.timeValueObj.prev).valueOf()
+          let maxTime = moment(this.timeValueObj.next).valueOf()
+          let startDate = null
+          let endDate = null
+          if(minTime > maxTime){
+            startDate = this.timeValueObj.next
+            endDate = this.timeValueObj.prev
+          }else {
+            startDate = this.timeValueObj.prev
+            endDate = this.timeValueObj.next
+          }
+          let res = await deleteByDateApi({
+            startDate: startDate,
+            endDate: endDate
+          })
+          if(res.code == 200) {
+            this.openPrice = false
+            this.$modal.msgSuccess(res.msg);
+            this.getCalendarPrice()
+          }
+        }else {
+          this.$message.error("请选择时间区间!!!");
+        }
+      } catch (error) {
+        
+      }
+    },
   },
   watch:{
     timeValue(newValue,oldValue){
@@ -198,7 +337,8 @@ export default {
     min-height: 86px;
 }
 .app-calendar-container ::v-deep .is-today {
-  background-color: rgba(255, 240, 24, 0.5);
+  background-color: rgba(255, 240, 24, 0);
+  border: 1px solid #0F40F5;
 }
 .app-calendar-container ::v-deep .prev {
   background-color: rgba(223, 230, 236,0.5) !important;
@@ -212,4 +352,45 @@ export default {
 .today_no {
 
 }
+
+/**  今天 */
+.el-calendar-table td.is-today {
+  .calendar_box {
+    color: #0F40F5;
+  }
+}
+
+.calendar_box {
+  width: 100%;
+  min-height: 86px;
+  .calendar_box-date {
+    display: flex;
+    width: 100% ;
+    justify-content: space-between;
+
+  }
+}
+
+.disable_time {
+  user-select: none;
+  cursor: not-allowed;
+}
+
+.is-select_time_self {
+  background-color: #C2D4FF;
+}
+
+.is-select_time {
+  background-color: #E4ECFF;
+}
+
+.is-select_time_hover {
+  background-color: #C2D4FF;
+}
+</style>
+<style lang="scss">
+.calendar-dialog ::v-deep .el-calendar-table .el-calendar-day {
+  padding: none !important;
+  height: auto;
+}
 </style>