MONSTER-ygh 10 месяцев назад
Родитель
Сommit
dcb125d0ca

+ 37 - 0
src/api/schedulingMr/schedulingMr.js

@@ -73,3 +73,40 @@ export const ionline = (data) => {
     data: data
   })
 }
+
+
+// 获取渠道库存设置信息
+export const commonConfigAllApi = (query) => {
+  return request({
+    url: '/merchant/merchantPerTimeStock/commonConfig',
+    method: 'get',
+    params: query
+  })
+}
+
+// 批量添加排期
+export const saveCommonConfigApi = (data) => {
+  return request({
+    url: '/merchant/merchantPerTimeStock/saveCommonConfig',
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取渠道库存设置信息
+export const commonConfigSingleApi = (query) => {
+  return request({
+    url: '/merchant/merchantPerTimeStock/queryPerformTimeConfig',
+    method: 'get',
+    params: query
+  })
+}
+
+// 批量添加排期
+export const saveCommonConfigSingleApi = (data) => {
+  return request({
+    url: '/merchant/merchantPerTimeStock/savePerformTimeConfig',
+    method: 'post',
+    data: data
+  })
+}

+ 160 - 0
src/views/venue/schedulingMr/dialog/addStock.vue

@@ -0,0 +1,160 @@
+<!--
+ * @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="900px"
+      class="text-dia-log-class"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="cancel"
+    >
+      <div class="dialog" v-loading="loading">
+        <div v-for="(item,index) in tableData" :key="index" :style="{display: 'flex',marginBottom: '10px',alignItems:tableId ? 'flex-start' : 'center'}">
+          <div :style="{display: 'flex',minWidth: '150px',justifyContent: 'flex-end',padding: tableId ? '8px 0 0 0' : '0px'}">
+            <dict-tag :options="dict.type.order_form_type" :value="item.source"/>:
+          </div>
+          <div v-if="!tableId" style="display: flex;margin-left: 20px;align-items: center;">
+            <span style="margin-right: 10px;">库存</span>
+            <el-input-number placeholder="请输入库存" v-model="tableData[index].stock" controls-position="right"></el-input-number>
+          </div>
+          <div v-if="tableId" style="margin-left: 20px;">
+            <el-radio-group v-model="tableData[index].status">
+              <div>
+                <el-radio :label="0">在售</el-radio>
+                <el-input-number placeholder="请输入库存" :disabled="tableData[index].status == 1" v-model="tableData[index].stock" controls-position="right"></el-input-number>
+              </div>
+              <div style="margin-top: 10px;">
+                <el-radio :label="1">售罄</el-radio>
+              </div>
+            </el-radio-group>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button v-if="!loading" @click="cancel">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm"
+          :loading="loading"
+        >
+          <span v-if="loading">提交中...</span>
+          <span v-else>保存</span>
+        </el-button>
+      </span>
+    </el-dialog>
+  </template>
+  
+  <script>
+  import { saveCommonConfigApi,saveCommonConfigSingleApi } from "@/api/schedulingMr/schedulingMr";
+  export default {
+    name: "stockAll",
+    dicts: ['order_form_type'],
+    data() {
+      return {
+        title: "渠道默认库存设置",
+        model: "EDIT",
+        open: false,
+        loading: false,
+        tableData: [], // 票务
+        stock: {},
+        tableId: ''
+      };
+    },
+    methods: {
+      /**
+       * 打开弹框
+       * @date 2023-11-22
+       * @param {any} obj
+       * @returns {any}
+       */
+      async openDialog(title,data,id) {
+        this.open = true;
+        this.tableId = id
+        this.stock = JSON.parse(JSON.stringify(data))
+        this.tableData = JSON.parse(JSON.stringify(data.chennelStock))
+      },
+      /**  票务信息  */
+      async saveCommonConfigFun(value){
+        try {
+          let res = await saveCommonConfigApi()
+          if(res.code == 200){
+            this.tableData = res.data.stock
+          }
+        } catch (error) {      
+        }
+      },
+      /**
+       * 关闭弹框
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      cancel() {
+        this.open = false;
+      },
+      /**
+       * 保存
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      async submitForm() {
+        try {
+          this.loading = true;
+          let params = JSON.parse(JSON.stringify(this.stock))
+          params.chennelStock = this.tableData
+          let res = null
+          if(this.tableId) {
+            res = await saveCommonConfigSingleApi({ stock: [{...params}] });
+          }else {
+            res = await saveCommonConfigApi({ stock: [{...params}] });
+          }
+          if (res.code === 200) {
+            this.$message.success("操作成功!");
+            this.loading = false;
+            this.$emit("getList");
+            this.cancel();
+          }
+        } catch (error) {
+          this.loading = false;
+        }
+      },
+    },
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .dialog {
+    padding: 0 30px;
+    max-height: 65vh;
+    overflow-y: auto;
+  }
+  .dialog {
+    padding: 0 30px;
+    .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>
+  

+ 157 - 0
src/views/venue/schedulingMr/dialog/stockAll.vue

@@ -0,0 +1,157 @@
+<!--
+ * @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="900px"
+      class="text-dia-log-class"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="cancel"
+    >
+      <div 
+      class="dialog"
+      v-loading="loading"
+      >
+      <span style="padding: 0 0 10px;display: flex;font-size: 16px;font-weight: 600;">可售总库存:{{ stockAllNum }}</span>
+        <el-table
+            :data="tableData"
+            style="width: 100%">
+            <el-table-column
+                prop="seatTypeName"
+                label="座位类型">
+            </el-table-column>
+            <el-table-column
+                prop="stock"
+                label="可售库存(个)">
+            </el-table-column>
+            <el-table-column
+                prop="address"
+                label="操作项">
+                <template slot-scope="scope">
+                    <el-button type="text" size="small" @click="addStockFun(scope.row)">修改渠道库存</el-button>
+                </template>
+            </el-table-column>
+            </el-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancel">取消</el-button>
+      </span>
+      <addStock ref="addStock" @getList="commonConfigAllFun" />
+    </el-dialog>
+  </template>
+  
+  <script>
+  import { commonConfigAllApi,commonConfigSingleApi } from "@/api/schedulingMr/schedulingMr";
+  import addStock from "./addStock.vue";
+  export default {
+    name: "stockAll",
+    components: { addStock },
+    data() {
+      return {
+        title: "场次库存设置",
+        model: "EDIT",
+        open: false,
+        loading: false,
+        tableData: [], // 票务
+        tableId: '',
+        stockAllNum: 0
+      };
+    },
+    methods: {
+      
+      /**
+       * 打开弹框
+       * @date 2023-11-22
+       * @param {any} obj
+       * @returns {any}
+       */
+      async openDialog(title,row) {
+        this.open = true;
+        this.title = "场次库存设置";
+        this.loading = true;
+        this.tableId = row && row.id ? row.id : ''
+        await this.commonConfigAllFun()
+        this.loading = false;
+      },
+      /**  票务信息  */
+      async commonConfigAllFun(){
+        try {
+          this.loading = true;
+          let res = null
+          if(this.tableId) {
+            res = await commonConfigSingleApi({id: this.tableId })
+          }else {
+            res = await commonConfigAllApi()
+          }
+          
+
+          if(res.code == 200){
+            this.tableData = res.data.stock
+            let stockAllNum = 0
+            this.tableData.forEach((item,index)=>{
+              if(item.stock){
+                stockAllNum = stockAllNum + item.stock
+              }
+            })
+            this.stockAllNum = stockAllNum
+          }
+          this.loading = false;
+        } catch (error) {   
+            this.loading = false;
+            this.open = false
+        }
+      },
+      /**
+       * 关闭弹框
+       * @date 2023-11-22
+       * @returns {any}
+       */
+      cancel() {
+        this.$emit('getList')
+        this.open = false;
+      },
+      /**  场次库存设置   */
+      addStockFun(row) {
+        this.$refs["addStock"].openDialog('',row,this.tableId);
+      }
+    },
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .dialog {
+    padding: 0 30px;
+    max-height: 65vh;
+    overflow-y: auto;
+  }
+  .dialog {
+    padding: 0 30px;
+    .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>
+  

+ 26 - 1
src/views/venue/schedulingMr/index.vue

@@ -97,6 +97,15 @@
           v-hasPermi="['schedulingMr:schedulingMr:batchDelete']"
         >批量删除</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          size="mini"
+          @click="handleStockAll"
+          v-hasPermi="['schedulingMr:schedulingMr:stock']"
+        >渠道库存设置</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -124,6 +133,7 @@
           <span>{{ scope.row.performTimeEnd }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="可售总库存" align="center" prop="saleSeatNum" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
           <el-tag type="success" v-if="scope.row.status == '1'">启用</el-tag>
@@ -147,6 +157,15 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['schedulingMr:schedulingMr:edit']"
           >修改</el-button>
+          <span v-hasPermi="['schedulingMr:schedulingMr:stock']" style="display: inline-block;">
+            <el-button
+              size="mini"
+              type="text"
+              v-if="scope.row.status == 1"
+              @click="handleStockAll(scope.row)"
+              style="margin-left: 10px;margin-right: 10px;"
+            >库存设置</el-button>
+          </span>
           <el-button
             size="mini"
             type="text"
@@ -194,6 +213,7 @@
         <el-button type="primary" @click="visibleStatus = false">确 定</el-button>
       </div>
     </el-dialog>
+    <stockAll ref="stockAll" @getList="getList" />
   </div>
 </template>
 
@@ -202,10 +222,12 @@
 import { pageList, deleteById, deleteBatchById,ionline } from '@/api/schedulingMr/schedulingMr'
 import addAndEdit from "./dialog/addAndEdit";
 import { pageList as goodsIdsListApi } from '@/api/ticketMr/ticketMr'
+import stockAll from "./dialog/stockAll.vue"
+import { row } from 'mathjs';
 export default {
   name: "SchedulingMr1",
   dicts: ['agreement_type'],
-  components: { addAndEdit },
+  components: { addAndEdit,stockAll },
   data() {
     return {
       // 遮罩层
@@ -379,6 +401,9 @@ export default {
       this.visibleStatus = true
       this.visibleType = type;
       this.newObj = obj;
+    },
+    handleStockAll(row) {
+      this.$refs["stockAll"].openDialog("新增数据",row);
     }
   }
 };

Разница между файлами не показана из-за своего большого размера
+ 1211 - 0
src/views/windowTicketSales/model/increaseViewers copy 2.vue


Разница между файлами не показана из-за своего большого размера
+ 1228 - 0
src/views/windowTicketSales/model/increaseViewers copy.vue