MONSTER-ygh hai 9 meses
pai
achega
fb35a382fe

+ 1 - 0
src/views/distribution/ticketMr/dialog/addAndEdit.vue

@@ -47,6 +47,7 @@
               :key="dict.id"
               :label="dict.goodsName"
               :value="dict.goodsId"
+              :disabled="dict.channelPersonSale == 1"
             />
           </el-select>
         </el-form-item>

+ 46 - 2
src/views/order/groupBuyingMr/index.vue

@@ -263,7 +263,28 @@
                 @click="openDetails(scope.row)"
                 v-hasPermi="['groupBuyingMr:groupBuyingMr:details']"
               >详情</el-button>
-              <span v-hasPermi="['groupBuyingMr:groupBuyingMr:details']" style="display: inline-block;">
+              <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
+                <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item 
+                  command="1" 
+                  
+                  v-if="hasPermi('groupBuyingMr:groupBuyingMr:details') && (scope.row.payWay == 'corporate'||scope.row.status === 0)">对公转账</el-dropdown-item>
+                  <el-dropdown-item 
+                  command="2" 
+                  
+                  v-if="hasPermi('groupBuyingMr:groupBuyingMr:cancel') && scope.row.status == 0">关闭订单</el-dropdown-item>
+                  <el-dropdown-item 
+                  command="3" 
+                  
+                  v-if="hasPermi('groupBuyingMr:groupBuyingMr:print') && (scope.row.status == 3 || scope.row.status == 7)">打印小票</el-dropdown-item>
+                  <el-dropdown-item 
+                  command="4" 
+                  
+                  v-if="hasPermi('groupBuyingMr:groupBuyingMr:reset') && scope.row.status == 0">修改订单</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+              <!-- <span v-hasPermi="['groupBuyingMr:groupBuyingMr:details']" style="display: inline-block;">
                 <el-button
                 v-if="scope.row.payWay == 'corporate'||scope.row.status === 0"
                   size="mini"
@@ -299,7 +320,7 @@
                   style="margin-left: 10px;"
                   @click="handleResetOpen(scope.row)"
                 >修改订单</el-button>
-              </span>
+              </span> -->
             </template>
           </el-table-column>
         </el-table>
@@ -416,6 +437,7 @@
 
 <script>
 import { getToken } from "@/utils/auth";
+import auth from '@/plugins/auth'
 import { pageList,gotoCorporatePay, downOrderListXls } from '@/api/order/groupBuyingMr';
 import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
 import detailsDia from "./dialog/details.vue";
@@ -577,6 +599,9 @@ export default {
     this.resizeObserver.observe(this.$refs.queryFormBox);
   },
   methods: {
+    hasPermi(value){
+      return auth.hasPermi(value)
+    },
     /** 查询列表 */
     getList() {
       this.loading = true;
@@ -991,6 +1016,25 @@ export default {
     handleRemove(index) {
       this.form.photoList.splice(index,1)
     },
+    // 更多操作触发
+    handleCommand(command, row) {
+      switch (command) {
+        case "1":
+          this.handleCorporatePay(row);
+          break;
+        case "2":
+          this.handleCancelOrder(row);
+          break;
+        case "3":
+          this.handleOpen(row);
+          break;
+          case "4":
+          this.handleResetOpen(row);
+          break;
+        default:
+          break;
+      }
+    },
   },
   beforeDestroy() {
     this.resizeObserver.unobserve(this.$refs.queryFormBox);

+ 28 - 19
src/views/venue/schedulingMr/dialog/addStock.vue

@@ -21,14 +21,14 @@
         <el-button type="primary" v-if="tableData.length == 0 " @click="addTable()">添加</el-button>
         <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 v-if="useStock == 1" :options="dict.type.order_form_type" :value="item.source"/>
+            <dict-tag v-if="useStock == 1 || !tableId" :options="dict.type.order_form_type" :value="item.source"/>
             <el-select
                 v-model="tableData[index].source"
                 placeholder="请选择渠道"
-                clearable
                 style="width: 100%"
-                v-if="useStock == 0"
-                @click="(value)=>selectSource(value,index)"
+                clearable
+                v-if="useStock == 0 && tableId"
+                @change="(value)=>selectSource(value,index)"
               >
                 <el-option
                   v-for="dict in dict.type.order_form_type"
@@ -112,7 +112,7 @@
         this.stock = JSON.parse(JSON.stringify(data))
         this.tableData = JSON.parse(JSON.stringify(data.chennelStock))
         this.chennelStock = JSON.parse(JSON.stringify(data.chennelStock))
-        this.sourceList = []
+        this.sourceList = [];
         this.stockAllNum = 0
         let stockAllNum = 0
         this.chennelStock.forEach(item=>{
@@ -153,12 +153,12 @@
         let flog = false
         this.tableData.forEach((item,index)=>{
           count = count + (item.stock?item.stock:0) // + (item.soldNum?item.soldNum:0)
-          if((!item.source && item.source !=0) || (!item.stock && item.stock !=0)) {
+          if((!item.source && item.source !== 0) || (!item.stock && item.stock !=0)) {
             flog = true
           }
         })
         if( flog ) {
-          this.$message.error("渠道和售库存不能为空!");
+          this.$message.error("渠道和售库存不能为空!");
           return
         }
         console.log("count====",count)
@@ -207,6 +207,7 @@
         //   this.loading = false;
         // }
       },
+      //  在售 已售
       changeRadio(value,index) {
         if(value == 1){
           this.$set(this.tableData[index],'stock',0)
@@ -221,28 +222,36 @@
           "soldNum": 0,
           "status": 0
         })
+        this.sourceList.push('')
+        console.log("value===",this.sourceList)
       },
       /** 谁是我  */
       clearTable(index){
         let list = JSON.parse(JSON.stringify(this.sourceList))
-        list.forEach((item,i)=>{
-          if(this.tableData[index].source == item) {
-            this.sourceList.splice(i,1)
-          }
-        })
-        console.log("this.sourceList===",this.sourceList)
+        // list.forEach((item,i)=>{
+        //   if(this.tableData[index].source == item) {
+        //     this.sourceList.splice(i,1)
+        //   }
+        // })
         this.tableData.splice(index,1)
+        this.sourceList.splice(index,1)
+        console.log("value===",index,this.sourceList)
         this.$forceUpdate()
       },
       /**   */
       selectSource(value,i) {
-        this.sourceList.push(value)
+        console.log("value===",value,i,this.sourceList)
+        this.$set(this.sourceList,i,value)
+        //this.sourceList.push(value)
         this.$set(this.tableData[i],'soldNum',0)
-        this.chennelStock.forEach((item,index)=>{
-          if(value == item.source) {
-            this.$set(this.tableData[i],'soldNum',item.soldNum)
-          }
-        })
+        if(value || value === 0){
+          this.chennelStock.forEach((item,index)=>{
+            if(value == item.source) {
+              this.$set(this.tableData[i],'soldNum',item.soldNum)
+            }
+          })
+        }
+        this.$forceUpdate()
       }
     },
   };

+ 4 - 4
src/views/venue/schedulingMr/dialog/stockAll.vue

@@ -99,12 +99,12 @@
         this.title = title;
         this.loading = true;
         this.tableId = row && row.id ? row.id : ''
-        this.useStock = row.useStock
-        await this.commonConfigAllFun(this.tableId)
+        this.useStock = row && (row.useStock || row.useStock == 0) ? row.useStock : ''
+        await this.commonConfigAllFun(this.tableId,true)
         this.loading = false;
       },
       /**  票务信息  */
-      async commonConfigAllFun(id){
+      async commonConfigAllFun(id,type){
         try {
           this.loading = true;
           let res = null
@@ -125,7 +125,7 @@
                   "performTimeId": item.performTimeId?item.performTimeId:this.tableId,
                   "seatTypeId": item.seatTypeId,
                   "stock": item.stock,
-                  "chennelStock": item.chennelStock ? this.setData(item.chennelStock) : []
+                  "chennelStock": this.useStock == 0 && !type ? [] : item.chennelStock ? this.setData(item.chennelStock) : []
                 })
               }else {
                 listCopy.push({

+ 3 - 2
src/views/venue/schedulingMr/index.vue

@@ -94,7 +94,8 @@
           icon="el-icon-delete"
           size="mini"
           @click="handleBatchDelete"
-          v-hasPermi="['schedulingMr:schedulingMr:batchDelete']"
+          :disabled="ids.length == 0"
+          v-hasPermi="['schedulingMr:schedulingMr:delete']"
         >批量删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -149,7 +150,7 @@
             size="mini"
             type="text"
             @click="ionlineApi(scope.row)"
-            v-hasPermi="['schedulingMr:schedulingMr:edit']"
+            v-hasPermi="['schedulingMr:schedulingMr:disable']"
           >{{scope.row.status == '1' ? '禁用' : '启用'}}</el-button>
           <el-button
             size="mini"