完成超时售票选择部分的逻辑

main
RogerWork 11 months ago
parent 9b99b41202
commit af74440f1b
  1. 13
      src/apis/mock.js
  2. 66
      src/views/mock/index.vue

@ -0,0 +1,13 @@
import request from "@/request/index.js";
export const get_overtime_show_info = (params) => {
const req_params = {
ip: params['ip']
}
console.log(req_params)
return request({
url: '/api/get_overtime_show',
method: 'get',
params: req_params
})
}

@ -1,5 +1,6 @@
<script setup> <script setup>
import {cinema_list} from '@/apis/update.js'; import {cinema_list} from '@/apis/update.js';
import {get_overtime_show_info} from "@/apis/mock.js";
import {onMounted} from "vue"; import {onMounted} from "vue";
import {ref, computed} from "vue"; import {ref, computed} from "vue";
import {InfoFilled} from "@element-plus/icons-vue"; import {InfoFilled} from "@element-plus/icons-vue";
@ -38,6 +39,7 @@ const tabs_array = computed(() => {
const activeName = ref(0) const activeName = ref(0)
const handleClick = (tab, event) => { const handleClick = (tab, event) => {
console.log(tab.paneName) console.log(tab.paneName)
if (tab.name === 1) { if (tab.name === 1) {
@ -69,9 +71,14 @@ const mockConfig =
] ]
const handleIpChange = () => { const handleIpChange = () => {
// 退
getOvertimeShowInfo()
handleOvertimeConfigChange()
//
checkedMockConfig.value = [] checkedMockConfig.value = []
checkAll.value = false checkAll.value = false
isIndeterminate.value = false isIndeterminate.value = false
activeName.value = 0
} }
const handleCheckAllChange = (val) => { const handleCheckAllChange = (val) => {
@ -117,6 +124,49 @@ async function get_cinema_items() {
} }
// 退
// select
const selectedOvertimeShowType = ref('')
const selectedShowInfo = ref('')
const selectedStatus = ref('')
// Select
const showInfo = ref([])
const sellShowInfo = ref([])
const refundShowInfo = ref([])
const auditStatusInfo = ref({})
const handleOvertimeShowTypeChange = () => {
if (selectedOvertimeShowType.value === 'sell') {
showInfo.value = sellShowInfo.value
} else {
showInfo.value = refundShowInfo.value
}
selectedShowInfo.value = ''
selectedStatus.value = ''
}
const handleOvertimeConfigChange = () => {
selectedOvertimeShowType.value = ''
selectedShowInfo.value = ''
selectedStatus.value = ''
}
async function getOvertimeShowInfo() {
console.log('getOvertimeShowInfo -- async')
await get_overtime_show_info({ip: select_ip.value}).then(
res => {
sellShowInfo.value = [...res['sell']]
refundShowInfo.value = [...res['sell']]
auditStatusInfo.value = [...res['status']]
}
).catch(
err => {
console.log(err)
}
)
}
onMounted( onMounted(
async () => { async () => {
await get_cinema_items(); await get_cinema_items();
@ -206,20 +256,23 @@ onMounted(
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<label class="api-label">/退</label>&nbsp <label class="api-label">/退</label>&nbsp
<el-select> <el-select style="width: 50%" v-model="selectedOvertimeShowType" placeholder="请选择"
@change="handleOvertimeShowTypeChange">
<el-option key="sell" label="过场售票" value="sell"></el-option>
<el-option key="refund" label="过场退票" value="refund"></el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<label class="api-label">场次</label>&nbsp <label class="api-label">场次</label>&nbsp
<el-select style="width: 75%"> <el-select style="width: 75%" v-model="selectedShowInfo" placeholder="请选择">
<el-option v-for="show in showInfo" :key="show.id" :label="show.show" :value="show.id"></el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<label class="api-label">审核结果</label>&nbsp <label class="api-label">审核结果</label>&nbsp
<el-select> <el-select style="width: 50%" v-model="selectedStatus" placeholder="请选择">
<el-option v-for="status in auditStatusInfo" :key="status.key" :label="status.status"
:value="status.key"></el-option>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
@ -248,6 +301,7 @@ div.api_desc {
width: 75%; width: 75%;
margin-top: 10px; margin-top: 10px;
} }
.api-label { .api-label {
font-size: 14px; font-size: 14px;
} }

Loading…
Cancel
Save