Browse Source

fix: 1.batch config id bug;2. static list params

LaveyD 4 tháng trước cách đây
mục cha
commit
a1771fa03e

+ 11 - 8
src/pages/queryReport/checkStatistic.vue

@@ -163,6 +163,7 @@ export default {
         checkTimeEnd: new Date(moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')),
         ticketTypeIdList: [], //
         sourceList: [],
+        groupByList: [],
         pageNum: 1,
         pageSize: 10
       },
@@ -175,7 +176,7 @@ export default {
         { prop: 'checkPrice', label: '检票金额', values: 'checkPrice' },
         { prop: 'orderDateDay', label: '统计日期', values: 'orderDateDay' }
       ],
-      selectKeys: [''], // 默认选中
+      selectKeys: [], // 默认选中
       tableIndex: 1,
       OrderIndexArr: [],
       tableData: [],
@@ -238,13 +239,13 @@ export default {
 
       if (this.selectKeys.length === 0) {
         this.finalGroup = [
-          { prop: 'otaSourceName', label: '订单渠道', values: 'otaSourceName' },
-          { prop: 'ticketTypeName', label: '票种名称', values: 'ticketTypeName' },
-          { prop: 'unitPrice', label: '单价', values: 'unitPrice' },
-          { prop: 'checkCount', label: '检票数量', values: 'checkCount' },
-          { prop: 'checkNum', label: '检票人数', values: 'checkNum' },
-          { prop: 'checkPrice', label: '检票金额', values: 'checkPrice' },
-          { prop: 'orderDateDay', label: '统计日期', values: 'orderDateDay' }
+          // { prop: 'otaSourceName', label: '订单渠道' },
+          // { prop: 'ticketTypeName', label: '票种名称' },
+          // { prop: 'unitPrice', label: '单价' },
+          // { prop: 'checkCount', label: '检票数量' },
+          // { prop: 'checkNum', label: '检票人数' },
+          // { prop: 'checkPrice', label: '检票金额' },
+          // { prop: 'orderDateDay', label: '统计日期' }
         ]
       } else {
         this.finalGroup = [...this.finalGroup].sort((a, b) =>
@@ -268,6 +269,8 @@ export default {
         this.form.ticketTypeIdList = []
       }
 
+      this.form.groupByList = [...this.selectKeys] || []
+
       getCheckerVerifyStatistics(this.form).then(res => {
         this.tableData = res.data
       }).finally(() => {

+ 12 - 9
src/pages/queryReport/refundStatistic.vue

@@ -141,7 +141,8 @@ export default {
         cancelTimeBegin: new Date(moment().format('YYYY-MM-DD') + ' 00:00:00'),
         cancelTimeEnd: new Date(moment().format('YYYY-MM-DD') + ' 23:59:59'),
         ticketTypeIdList: [], // 票种
-        otaSourceNameList: []
+        otaSourceNameList: [],
+        groupByList: []
       },
       groupKeys: [{ value: 'orderDateDay', label: '统计日期' }],
       finalGroup: [
@@ -154,7 +155,7 @@ export default {
         { prop: 'cancelSettlementPrice', label: '退票结算金额' },
         { prop: 'orderDateDay', label: '统计日期' }
       ],
-      selectKeys: [''], // 默认选中
+      selectKeys: [], // 默认选中
       tableData: [],
       otaSourceList: [],
       OrderIndexArr: [],
@@ -264,13 +265,13 @@ export default {
     getList () {
       if (this.selectKeys.length === 0) {
         this.finalGroup = [
-          { prop: 'otaSourceName', label: '订单渠道' },
-          { prop: 'ticketTypeName', label: '票种名称' },
-          { prop: 'unitPrice', label: '单价' },
-          { prop: 'checkCount', label: '检票数量' },
-          { prop: 'checkNum', label: '检票人数' },
-          { prop: 'checkPrice', label: '检票金额' },
-          { prop: 'orderDateDay', label: '统计日期' }
+          // { prop: 'otaSourceName', label: '订单渠道' },
+          // { prop: 'ticketTypeName', label: '票种名称' },
+          // { prop: 'unitPrice', label: '单价' },
+          // { prop: 'checkCount', label: '检票数量' },
+          // { prop: 'checkNum', label: '检票人数' },
+          // { prop: 'checkPrice', label: '检票金额' },
+          // { prop: 'orderDateDay', label: '统计日期' }
         ]
       } else {
         this.finalGroup = [...this.finalGroup].sort((a, b) =>
@@ -278,6 +279,8 @@ export default {
         )
       }
 
+      this.form.groupByList = [...this.selectKeys] || []
+
       this.loading = true
       this.setTime()
       getCancelOrderStatistics(this.form).then(res => {

+ 14 - 3
src/pages/sellManage/common/TicketList.vue

@@ -233,7 +233,7 @@ export default {
         { label: '后天', value: moment().add(2, 'days').format('YYYY-MM-DD') }
       ],
       allBatchList: [],
-      currentBatch: null
+      currentBatch: {}
     }
   },
   computed: {
@@ -391,7 +391,12 @@ export default {
           if (this.allBatchList && this.allBatchList[0]) {
             this.currentBatch = this.allBatchList[0]
             this.$refs.singleTable.setCurrentRow(this.allBatchList[0])
-            this.tableData = this.currentBatch?.ticketTypes || []
+            this.tableData = (this.currentBatch?.ticketTypes || []).map(item => {
+              return {
+                ...item,
+                batchConfigId: this.currentBatch.batchConfigId
+              }
+            })
             this.changeTicket(this.tableData[0])
             this.$emit('set-batch', this.currentBatch)
           }
@@ -438,6 +443,7 @@ export default {
       if (!ticket) {
         return
       }
+
       const playDate = moment(this.playDate).format('YYYY-MM-DD')
       this.$emit('changePlayDate', playDate)
       const res = await getTicketTypeByDate({
@@ -486,7 +492,12 @@ export default {
       }
 
       this.currentBatch = row
-      this.tableData = this.currentBatch?.ticketTypes || []
+      this.tableData = (this.currentBatch?.ticketTypes || []).map(item => {
+        return {
+          ...item,
+          batchConfigId: row.batchConfigId
+        }
+      })
       this.$emit('set-batch', row)
     },
     formatDate (input) {

+ 8 - 1
src/pages/sellManage/common/orderItemMixin.js

@@ -49,12 +49,19 @@ export default {
       this.currentRecord.total = this.$NP.times(this.currentRecord.price, this.currentRecord.count)
     },
     handleConfirm () {
+      const currentBatch = this.$parent.$refs.formInfo.currentBatch
+
       if (this.category === 'batch') {
-        if (this.tickets.some(i => !i.batchConfigId)) {
+        console.log('当前选择的场次', this.currentTicket)
+        console.log('当前选择的批次', currentBatch)
+
+        if (!this.currentTicket?.id || !currentBatch?.batchConfigId) {
           return this.$message.error('请选择场次')
         }
       }
       this.formData = this.$parent.$refs.formInfo.form
+      this.formData.batchConfigId = currentBatch?.batchConfigId || ''
+      this.currentTicket.batchConfigId = currentBatch?.batchConfigId || ''
       this.formData.remark = this.remark
       this.formData.pictureRemarks = this.pictureRemarks