开票
Showing
4 changed files
with
954 additions
and
0 deletions
| ... | @@ -362,6 +362,18 @@ export const constantRoutes = [ | ... | @@ -362,6 +362,18 @@ export const constantRoutes = [ |
| 362 | meta: {title: 'peopleManage'} | 362 | meta: {title: 'peopleManage'} |
| 363 | }, | 363 | }, |
| 364 | { | 364 | { |
| 365 | path: 'ticket/addInvoice', | ||
| 366 | component: () => import('@/viewsPc/booking/ticket/addInvoice.vue'), | ||
| 367 | name: 'ticketAddInvoice', | ||
| 368 | meta: {title: 'ticketAddInvoice'} | ||
| 369 | }, | ||
| 370 | { | ||
| 371 | path: 'ticket/invoiceDetail', | ||
| 372 | component: () => import('@/viewsPc/booking/ticket/invoiceDetail.vue'), | ||
| 373 | name: 'ticketInvoiceDetail', | ||
| 374 | meta: {title: 'ticketInvoiceDetail'} | ||
| 375 | }, | ||
| 376 | { | ||
| 365 | path: 'hotel/:cptId', | 377 | path: 'hotel/:cptId', |
| 366 | component: () => import('@/viewsPc/booking/hotel'), | 378 | component: () => import('@/viewsPc/booking/hotel'), |
| 367 | name: 'hotel', | 379 | name: 'hotel', | ... | ... |
src/viewsPc/booking/ticket/addInvoice.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div> | ||
| 3 | <div class="box"> | ||
| 4 | |||
| 5 | <el-card :body-style="{ padding: '0px' }" class="mt20"> | ||
| 6 | <div slot="header"> | ||
| 7 | <div class="bg-lineg"> | ||
| 8 | <div class="pl-back" @click="goBack"> | ||
| 9 | <el-icon> | ||
| 10 | <ArrowLeftBold/> | ||
| 11 | </el-icon> | ||
| 12 | 返回 | ||
| 13 | </div> | ||
| 14 | {{ paymentType != 3 ? '发票开具' : 'Invoice application' }} | ||
| 15 | </div> | ||
| 16 | </div> | ||
| 17 | <el-row :gutter="20" class="pd20"> | ||
| 18 | <el-col :span="24"> | ||
| 19 | <!--已选订单--> | ||
| 20 | <div class="border-info"> | ||
| 21 | <label class="blueTag">{{ paymentType != 3 ? '票务订单' : 'Ticket' }}</label> | ||
| 22 | <h3>{{ matchForm.name }}</h3> | ||
| 23 | <div> | ||
| 24 | <p>地址:{{ matchForm.address }}</p> | ||
| 25 | <p>票档:{{ ticketForm.extJson?.ticketType?.name }}</p> | ||
| 26 | <p>时间:{{ ticketForm.extJson?.ticketDate.name }}</p> | ||
| 27 | <p>通票:{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.extJson?.ticketDate.price }}/1张</p> | ||
| 28 | <p>优惠票:{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.extJson?.ticketDate.rebatePrice }}/1张</p> | ||
| 29 | |||
| 30 | <p class="poPrice">{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.total }}</p> | ||
| 31 | </div> | ||
| 32 | <div> | ||
| 33 | <el-row v-for="v in message" style="width: 100%"> | ||
| 34 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 35 | <div>{{ v.name }} | ||
| 36 | </div> | ||
| 37 | </el-col> | ||
| 38 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 39 | <div>{{ v.discount ? '通票' : '优惠票' }} | ||
| 40 | </div> | ||
| 41 | </el-col> | ||
| 42 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 43 | {{ v.discount ? ticketForm.extJson?.ticketDate.price : ticketForm.extJson?.ticketDate.rebatePrice }} | ||
| 44 | {{ paymentType != 3 ? '¥' : '€' }}/张 | ||
| 45 | </el-col> | ||
| 46 | </el-row> | ||
| 47 | <el-row style="width: 100%"> | ||
| 48 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 49 | <div>{{ | ||
| 50 | paymentType != 3 ? '购票数量' : 'Number of tickets purchased' | ||
| 51 | }}:{{ ticketForm.num }}{{ paymentType != 3 ? '张' : 'Tickets' }} | ||
| 52 | </div> | ||
| 53 | </el-col> | ||
| 54 | <el-col :lg="8" :md="12" :sm="12" :xs="24">{{ | ||
| 55 | paymentType != 3 ? '联系方式' : 'Contact Information' | ||
| 56 | }}:{{ ticketForm.phone }} | ||
| 57 | </el-col> | ||
| 58 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 59 | 共计:{{ Number(ticketForm.total).toFixed(2) }}{{ | ||
| 60 | paymentType != 3 ? '¥' : '€' | ||
| 61 | }} | ||
| 62 | </el-col> | ||
| 63 | </el-row> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | |||
| 67 | <div class="leftboderTT"> | ||
| 68 | {{ paymentType != 3 ? '开票信息' : 'Invoice information' }} | ||
| 69 | </div> | ||
| 70 | <div class="border-rr mt20 pd20"> | ||
| 71 | <el-form ref="formRef" :label-width="paymentType != 3 ?'100':'150'" :model="form" :rules="rules" | ||
| 72 | class="mw500"> | ||
| 73 | <el-form-item :label="paymentType != 3 ?'开票金额':'Amount'"> | ||
| 74 | <span v-if="orderType==5||orderType==6" | ||
| 75 | class="bigprice">{{ paymentType != 3 ? '¥' : '€' }}{{ totalMoney }}</span> | ||
| 76 | <span v-else class="bigprice">{{ paymentType != 3 ? '¥' : '€' }}{{ totalMoney }}</span> | ||
| 77 | </el-form-item> | ||
| 78 | |||
| 79 | <el-form-item :label="paymentType != 3 ?`发票形式`:'Invoice Form'" prop="invoiceForm" required> | ||
| 80 | <el-radio-group v-model="form.invoiceForm"> | ||
| 81 | <el-radio value="1">{{ paymentType != 3 ? '电子发票' : 'E-invoice' }}</el-radio> | ||
| 82 | </el-radio-group> | ||
| 83 | </el-form-item> | ||
| 84 | |||
| 85 | <el-form-item :label="paymentType != 3 ?`发票类型`:'Invoice Type'" prop="invoiceType" required> | ||
| 86 | <el-radio-group v-model="form.invoiceType"> | ||
| 87 | <el-radio value="0">{{ paymentType != 3 ? '企业' : 'Company' }}</el-radio> | ||
| 88 | <el-radio value="1">{{ paymentType != 3 ? '个人非企业' : 'Individual' }}</el-radio> | ||
| 89 | </el-radio-group> | ||
| 90 | </el-form-item> | ||
| 91 | <el-form-item v-if="form.invoiceType=='0'" :label="paymentType != 3 ?`发票抬头`:'Invoice Title'" | ||
| 92 | prop="invoiceTitle" | ||
| 93 | required> | ||
| 94 | <el-input v-model="form.invoiceTitle"/> | ||
| 95 | </el-form-item> | ||
| 96 | <el-form-item v-if="form.invoiceType=='0'" :label="paymentType != 3 ?`税号`:'Duty Paragraph'" | ||
| 97 | prop="invoiceTfn" | ||
| 98 | required> | ||
| 99 | <el-input v-model="form.invoiceTfn"/> | ||
| 100 | </el-form-item> | ||
| 101 | <el-form-item v-if="form.invoiceForm=='1'" :label="`邮箱`" prop="invoiceEmail" required> | ||
| 102 | <el-input v-model="form.invoiceEmail"/> | ||
| 103 | </el-form-item> | ||
| 104 | <el-form-item label="备注" prop="remarks"> | ||
| 105 | <el-input v-model="form.remarks" type="textarea"/> | ||
| 106 | </el-form-item> | ||
| 107 | <div v-if="form.invoiceForm=='3'&&form.invoiceType=='0'"> | ||
| 108 | <el-form-item :label="`地址`" prop="invoiceAddress" required> | ||
| 109 | <el-input v-model="form.invoiceAddress"/> | ||
| 110 | </el-form-item> | ||
| 111 | <el-form-item :label="`电话`" prop="invoicePhone" required> | ||
| 112 | <el-input v-model="form.invoicePhone"/> | ||
| 113 | </el-form-item> | ||
| 114 | <el-form-item :label="`开户行`" prop="invoiceBank" required> | ||
| 115 | <el-input v-model="form.invoiceBank"/> | ||
| 116 | </el-form-item> | ||
| 117 | <el-form-item :label="`账户`" prop="invoiceAccount" required> | ||
| 118 | <el-input v-model="form.invoiceAccount"/> | ||
| 119 | </el-form-item> | ||
| 120 | </div> | ||
| 121 | </el-form> | ||
| 122 | |||
| 123 | <div v-if="remark" class="tip"> | ||
| 124 | <label>{{ paymentType != 3 ? '开票须知' : 'Invoice Notice' }}:</label> | ||
| 125 | <div v-html="remark"/> | ||
| 126 | </div> | ||
| 127 | </div> | ||
| 128 | </el-col> | ||
| 129 | </el-row> | ||
| 130 | |||
| 131 | <el-row align="middle" class="pd20" justify="center"> | ||
| 132 | <el-col :span="12" class="text-center"> | ||
| 133 | <el-button class="btn-lineG w200px" round size="large" type="primary" @click="submit"> | ||
| 134 | {{ paymentType != 3 ? '提交' : 'Submit' }} | ||
| 135 | </el-button> | ||
| 136 | </el-col> | ||
| 137 | </el-row> | ||
| 138 | </el-card> | ||
| 139 | <div style="height: 60px;"></div> | ||
| 140 | |||
| 141 | </div> | ||
| 142 | </div> | ||
| 143 | <address-list-dialog ref="dialogAddressListRef" @submit="getAddress"/> | ||
| 144 | <!-- 开票须知 --> | ||
| 145 | </template> | ||
| 146 | |||
| 147 | <script setup> | ||
| 148 | import {useRouter, useRoute} from "vue-router"; | ||
| 149 | import {ref, onMounted} from "vue"; | ||
| 150 | import {useStorage} from "@vueuse/core/index"; | ||
| 151 | import AddressListDialog from "@/viewsPc/booking/component/addressList" | ||
| 152 | import dayjs from 'dayjs' | ||
| 153 | import {ElMessage, ElMessageBox} from "element-plus"; | ||
| 154 | import useUserStore from "@/store/modules/user"; | ||
| 155 | import {getCurrentInstance} from "@vue/runtime-core"; | ||
| 156 | import { | ||
| 157 | addressList, | ||
| 158 | editInvoice, | ||
| 159 | getInvoiceDetail, | ||
| 160 | getBaseInfoByActiveId, | ||
| 161 | getTicketOrderInfo, | ||
| 162 | getTicketInfoByActivityId, submitInvoice, | ||
| 163 | } from "@/apiPc/booking"; | ||
| 164 | |||
| 165 | const {proxy} = getCurrentInstance() | ||
| 166 | const user = useUserStore().user | ||
| 167 | const language = useStorage('language', 0) | ||
| 168 | const router = useRouter() | ||
| 169 | const route = useRoute() | ||
| 170 | const form = ref({ | ||
| 171 | invoiceForm: '1', | ||
| 172 | invoiceType: '0' | ||
| 173 | }) | ||
| 174 | const orderType = ref(1) | ||
| 175 | const paymentType = ref(1) | ||
| 176 | const list = ref([]) | ||
| 177 | const addrList = ref([]) | ||
| 178 | const nowAddress = ref({}) | ||
| 179 | const totalMoney = ref(0) | ||
| 180 | const remark = ref('') | ||
| 181 | const rules = ref({ | ||
| 182 | invoiceType: [ | ||
| 183 | {required: true, message: language.value == 0 ? '请选择发票类型' : 'Please select invoice type', trigger: 'change'} | ||
| 184 | ], | ||
| 185 | invoiceEmail: [ | ||
| 186 | {required: true, message: language.value == 0 ? '请输入邮箱' : 'Please enter email', trigger: 'blur'} | ||
| 187 | ], | ||
| 188 | invoiceForm: [ | ||
| 189 | {required: true, message: language.value == 0 ? '请选择发票形式' : 'Please select invoice form', trigger: 'change'} | ||
| 190 | ], | ||
| 191 | invoiceTitle: [ | ||
| 192 | {required: true, message: language.value == 0 ? '请输入发票抬头' : 'Please enter invoice title', trigger: 'blur'} | ||
| 193 | ], | ||
| 194 | invoiceTfn: [ | ||
| 195 | {required: true, message: language.value == 0 ? '请输入税号' : 'Please enter TFN', trigger: 'blur'} | ||
| 196 | ], | ||
| 197 | invoiceAddress: [ | ||
| 198 | {required: true, message: language.value == 0 ? '请输入地址' : 'Please enter address', trigger: 'blur'} | ||
| 199 | ], | ||
| 200 | invoicePhone: [ | ||
| 201 | {required: true, message: language.value == 0 ? '请输入电话' : 'Please enter phone', trigger: 'blur'} | ||
| 202 | ], | ||
| 203 | invoiceBank: [ | ||
| 204 | {required: true, message: language.value == 0 ? '请输入开户行' : 'Please enter bank', trigger: 'blur'} | ||
| 205 | ], | ||
| 206 | invoiceAccount: [ | ||
| 207 | {required: true, message: language.value == 0 ? '请输入账户' : 'Please enter account', trigger: 'blur'} | ||
| 208 | ], | ||
| 209 | }) | ||
| 210 | const isEdit = ref(false) | ||
| 211 | const ticketForm = ref({}) | ||
| 212 | const matchForm = ref({}) | ||
| 213 | const message = ref([]) | ||
| 214 | const invoiceId = ref() | ||
| 215 | let cptId | ||
| 216 | |||
| 217 | |||
| 218 | onMounted(() => { | ||
| 219 | if (language.value != 0) { | ||
| 220 | router.push('/center/myInfo') | ||
| 221 | } | ||
| 222 | orderType.value = route.query.orderType | ||
| 223 | if (route.query.invoiceId) { | ||
| 224 | invoiceId.value = route.query.invoiceId | ||
| 225 | isEdit.value = true | ||
| 226 | getList() | ||
| 227 | } | ||
| 228 | // 获取票务订单信息 | ||
| 229 | getTickInfo() | ||
| 230 | }) | ||
| 231 | |||
| 232 | // 票务订单详情 | ||
| 233 | async function getTickInfo() { | ||
| 234 | const res = await getTicketOrderInfo({orderId: route.query.orderId}) | ||
| 235 | ticketForm.value = res.data | ||
| 236 | try { | ||
| 237 | ticketForm.value.extJson = JSON.parse(ticketForm.value.extJson) | ||
| 238 | ticketForm.value.extJson.ticketDate = JSON.parse(ticketForm.value.extJson.ticketDate) | ||
| 239 | ticketForm.value.extJson.ticketType = JSON.parse(ticketForm.value.extJson.ticketType) | ||
| 240 | cptId = ticketForm.value.extJson.ticketDate.activityId | ||
| 241 | totalMoney.val = ticketForm.value.extJson.total | ||
| 242 | message.value = JSON.parse(ticketForm.value.extJson.message) | ||
| 243 | totalMoney.value = ticketForm.value.total | ||
| 244 | paymentType.value = ticketForm.value.paymentType | ||
| 245 | await getDetail(ticketForm.value.extJson.ticketDate.activityId) | ||
| 246 | console.log(ticketForm.value) | ||
| 247 | } catch (e) { | ||
| 248 | console.log(e) | ||
| 249 | } finally { | ||
| 250 | |||
| 251 | } | ||
| 252 | } | ||
| 253 | |||
| 254 | async function getDetail(activeId) { | ||
| 255 | const res = await getTicketInfoByActivityId({activityId: activeId}) | ||
| 256 | matchForm.value = res.data | ||
| 257 | console.log(matchForm.value) | ||
| 258 | } | ||
| 259 | |||
| 260 | function getList() { | ||
| 261 | getInvoiceDetail(invoiceId.value).then(res => { | ||
| 262 | form.value = res.data; | ||
| 263 | totalMoney.value = form.value.total | ||
| 264 | }) | ||
| 265 | } | ||
| 266 | |||
| 267 | function getAddrList() { | ||
| 268 | addressList(user.userId).then(res => { | ||
| 269 | addrList.value = res.rows | ||
| 270 | if (addrList.value.length > 0) { | ||
| 271 | nowAddress.value = addrList.value[0] | ||
| 272 | } | ||
| 273 | }) | ||
| 274 | } | ||
| 275 | |||
| 276 | function getAddress(obj) { | ||
| 277 | getAddrList() | ||
| 278 | nowAddress.value = obj | ||
| 279 | } | ||
| 280 | |||
| 281 | function submit() { | ||
| 282 | proxy.$refs['formRef'].validate((valid) => { | ||
| 283 | if (valid) { | ||
| 284 | // 提交确认 | ||
| 285 | ElMessageBox.confirm(language.value == 0 ? '确认提交吗?' : 'Confirm to submit ?', { | ||
| 286 | confirmButtonText: language.value == 0 ? '确定' : 'Confirm', | ||
| 287 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', | ||
| 288 | type: 'warning' | ||
| 289 | }).then(() => { | ||
| 290 | form.value.activeId = cptId | ||
| 291 | form.value.total = totalMoney.value | ||
| 292 | form.value.version = 2 | ||
| 293 | form.value.invoicePhone = paymentType.value | ||
| 294 | form.value.orders = route.query.orderId | ||
| 295 | if (isEdit.value) { | ||
| 296 | update() | ||
| 297 | } else { | ||
| 298 | add() | ||
| 299 | } | ||
| 300 | }) | ||
| 301 | } | ||
| 302 | }) | ||
| 303 | } | ||
| 304 | |||
| 305 | function update() { | ||
| 306 | editInvoice(form.value).then(res => { | ||
| 307 | //返回列表 | ||
| 308 | backList() | ||
| 309 | }) | ||
| 310 | } | ||
| 311 | |||
| 312 | function add() { | ||
| 313 | submitInvoice(form.value).then(res => { | ||
| 314 | //返回列表 | ||
| 315 | backList() | ||
| 316 | }) | ||
| 317 | } | ||
| 318 | |||
| 319 | function backList() { | ||
| 320 | router.push({ | ||
| 321 | name: 'myKP' | ||
| 322 | }) | ||
| 323 | } | ||
| 324 | |||
| 325 | function goBack() { | ||
| 326 | router.go(-1) | ||
| 327 | } | ||
| 328 | |||
| 329 | </script> | ||
| 330 | |||
| 331 | <style lang="scss" scoped> | ||
| 332 | .pl-back { | ||
| 333 | position: absolute; | ||
| 334 | padding: 0 15px; | ||
| 335 | display: flex; | ||
| 336 | align-items: center; | ||
| 337 | cursor: pointer | ||
| 338 | } | ||
| 339 | |||
| 340 | .bigMoney { | ||
| 341 | font-size: 36px !important; | ||
| 342 | font-family: 'DIN Alternate'; | ||
| 343 | font-weight: bold; | ||
| 344 | } | ||
| 345 | |||
| 346 | .btn-lineG { | ||
| 347 | font-size: 16px | ||
| 348 | } | ||
| 349 | |||
| 350 | .bg-lineg { | ||
| 351 | height: 40px; | ||
| 352 | line-height: 40px; | ||
| 353 | font-size: 18px; | ||
| 354 | text-align: center; | ||
| 355 | } | ||
| 356 | |||
| 357 | .border-info { | ||
| 358 | position: relative; | ||
| 359 | |||
| 360 | & > label { | ||
| 361 | position: absolute; | ||
| 362 | right: 0; | ||
| 363 | top: 0; | ||
| 364 | margin: 0; | ||
| 365 | border-radius: 0 0 0px 15px; | ||
| 366 | padding: 5px 15px; | ||
| 367 | font-size: 14px; | ||
| 368 | } | ||
| 369 | |||
| 370 | .poPrice { | ||
| 371 | position: absolute; | ||
| 372 | bottom: 0px; | ||
| 373 | right: 10px; | ||
| 374 | font-size: 24px; | ||
| 375 | line-height: 1; | ||
| 376 | font-family: "DIN Alternate" | ||
| 377 | } | ||
| 378 | } | ||
| 379 | |||
| 380 | .blueTag { | ||
| 381 | color: #fff; | ||
| 382 | background-color: #1EC886; | ||
| 383 | } | ||
| 384 | |||
| 385 | .purpleTag { | ||
| 386 | color: #fff; | ||
| 387 | background-color: #717bef; | ||
| 388 | } | ||
| 389 | |||
| 390 | .orangeTag { | ||
| 391 | color: #fff; | ||
| 392 | background-color: #ff8124; | ||
| 393 | } | ||
| 394 | |||
| 395 | .pinkTag { | ||
| 396 | color: #fff; | ||
| 397 | background-color: #f55497; | ||
| 398 | } | ||
| 399 | |||
| 400 | .yellowTag { | ||
| 401 | color: #fff; | ||
| 402 | background-color: #bad814; | ||
| 403 | } | ||
| 404 | |||
| 405 | .leftboderTT { | ||
| 406 | font-weight: 600; | ||
| 407 | font-size: 16px; | ||
| 408 | color: #453DEA; | ||
| 409 | } | ||
| 410 | |||
| 411 | .border-rr { | ||
| 412 | border-radius: 5px; | ||
| 413 | border: 1px solid #DCDFE6; | ||
| 414 | } | ||
| 415 | |||
| 416 | .room { | ||
| 417 | font-weight: 400; | ||
| 418 | font-size: 14px; | ||
| 419 | color: #929AA0; | ||
| 420 | } | ||
| 421 | |||
| 422 | .ccitemBox { | ||
| 423 | overflow: auto; | ||
| 424 | |||
| 425 | label { | ||
| 426 | margin: 10px 0; | ||
| 427 | display: block; | ||
| 428 | min-height: 30px; | ||
| 429 | |||
| 430 | span { | ||
| 431 | color: #FF8124; | ||
| 432 | font-family: DIN Alternate; | ||
| 433 | font-size: 24px; | ||
| 434 | } | ||
| 435 | } | ||
| 436 | } | ||
| 437 | |||
| 438 | .ccitem { | ||
| 439 | display: flex; | ||
| 440 | justify-content: space-between; | ||
| 441 | font-size: 15px; | ||
| 442 | color: #666; | ||
| 443 | margin: 5px 0 10px; | ||
| 444 | |||
| 445 | label { | ||
| 446 | font-size: 16px; | ||
| 447 | color: #000; | ||
| 448 | } | ||
| 449 | |||
| 450 | span { | ||
| 451 | font-size: 13px; | ||
| 452 | } | ||
| 453 | } | ||
| 454 | |||
| 455 | .red { | ||
| 456 | color: #FF8124; | ||
| 457 | } | ||
| 458 | |||
| 459 | .tip { | ||
| 460 | font-size: 14px; | ||
| 461 | color: #666; | ||
| 462 | padding: 0 10px; | ||
| 463 | } | ||
| 464 | |||
| 465 | .mw500 { | ||
| 466 | max-width: 500px; | ||
| 467 | margin: auto | ||
| 468 | } | ||
| 469 | |||
| 470 | .bigSize { | ||
| 471 | font-size: 16px; | ||
| 472 | margin-bottom: 5px; | ||
| 473 | } | ||
| 474 | |||
| 475 | .smallSize { | ||
| 476 | font-size: 14px; | ||
| 477 | color: #999; | ||
| 478 | } | ||
| 479 | |||
| 480 | .flexCenter { | ||
| 481 | display: flex; | ||
| 482 | width: 100%; | ||
| 483 | align-items: center; | ||
| 484 | justify-content: space-between; | ||
| 485 | background: #f4f4f4; | ||
| 486 | padding: 10px; | ||
| 487 | box-sizing: border-box; | ||
| 488 | } | ||
| 489 | |||
| 490 | .bigprice { | ||
| 491 | font-size: 26px; | ||
| 492 | line-height: 1; | ||
| 493 | font-family: "DIN Alternate"; | ||
| 494 | } | ||
| 495 | </style> |
src/viewsPc/booking/ticket/invoiceDetail.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div> | ||
| 3 | <div class="box"> | ||
| 4 | <el-card :body-style="{ padding: '0px' }" class="mt20"> | ||
| 5 | <div slot="header"> | ||
| 6 | <div class="bg-lineg"> | ||
| 7 | <div class="pl-back" @click="goBack"> | ||
| 8 | <el-icon> | ||
| 9 | <ArrowLeftBold/> | ||
| 10 | </el-icon> | ||
| 11 | 返回 | ||
| 12 | </div> | ||
| 13 | {{ language == 0 ? '发票开具' : 'Invoice application' }} | ||
| 14 | </div> | ||
| 15 | </div> | ||
| 16 | <el-row :gutter="20" class="pd20"> | ||
| 17 | <el-col :span="24"> | ||
| 18 | <!--已选订单--> | ||
| 19 | |||
| 20 | <div class="border-info"> | ||
| 21 | <label class="blueTag">票务订单</label> | ||
| 22 | <h3>{{ matchForm.name }}</h3> | ||
| 23 | <div> | ||
| 24 | <p>地址:{{ matchForm.address }}</p> | ||
| 25 | <p>票档:{{ ticketForm.extJson?.ticketType?.name }}</p> | ||
| 26 | <p>时间:{{ ticketForm.extJson?.ticketDate.name }}</p> | ||
| 27 | <p>通票:{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.extJson?.ticketDate.price }}/1张</p> | ||
| 28 | <p>优惠票:{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.extJson?.ticketDate.rebatePrice }}/1张</p> | ||
| 29 | <p class="poPrice">{{ paymentType != 3 ? '¥' : '€' }}{{ ticketForm.total }}</p> | ||
| 30 | </div> | ||
| 31 | <div> | ||
| 32 | <el-row v-for="v in message" style="width: 100%"> | ||
| 33 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 34 | <div>{{ v.name }} | ||
| 35 | </div> | ||
| 36 | </el-col> | ||
| 37 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 38 | <div>{{ v.discount ? '通票' : '优惠票' }} | ||
| 39 | </div> | ||
| 40 | </el-col> | ||
| 41 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 42 | {{ v.discount ? ticketForm.extJson?.ticketDate.price : ticketForm.extJson?.ticketDate.rebatePrice }} | ||
| 43 | {{ paymentType != 3 ? '¥' : '€' }}/张 | ||
| 44 | </el-col> | ||
| 45 | </el-row> | ||
| 46 | <el-row style="width: 100%"> | ||
| 47 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 48 | <div>{{ | ||
| 49 | language == 0 ? '购票数量' : 'Number of tickets purchased' | ||
| 50 | }}:{{ ticketForm.num }}张 | ||
| 51 | </div> | ||
| 52 | </el-col> | ||
| 53 | <el-col :lg="8" :md="12" :sm="12" :xs="24">{{ | ||
| 54 | language == 0 ? '联系方式' : 'Contact Information' | ||
| 55 | }}:{{ ticketForm.phone }} | ||
| 56 | </el-col> | ||
| 57 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 58 | 共计:{{ Number(ticketForm.total).toFixed(2) }}{{ | ||
| 59 | paymentType != 3 ? '¥' : '€' | ||
| 60 | }} | ||
| 61 | </el-col> | ||
| 62 | </el-row> | ||
| 63 | </div> | ||
| 64 | </div> | ||
| 65 | <div class="leftboderTT">{{ language == 0 ? '开票信息' : 'Invoice information' }}</div> | ||
| 66 | <div class="border-rr mt20 pd20"> | ||
| 67 | <el-form ref="formRef" :label-width="language == 0 ?'100':'150'" :model="form" :rules="rules" | ||
| 68 | class="mw500"> | ||
| 69 | <el-form-item :label="'开票金额'"> | ||
| 70 | <span class="bigprice">{{ paymentType != 3 ? '¥' : '€' }}{{ totalMoney }}</span> | ||
| 71 | </el-form-item> | ||
| 72 | |||
| 73 | <el-form-item :label="`发票形式`" prop="invoiceForm" required> | ||
| 74 | <span v-if="form.invoiceForm=='1'">电子发票</span> | ||
| 75 | <span v-if="form.invoiceForm=='2'">纸质普票</span> | ||
| 76 | <span v-if="form.invoiceForm=='3'">纸质专票</span> | ||
| 77 | </el-form-item> | ||
| 78 | |||
| 79 | <el-form-item :label="`发票类型`" prop="invoiceType" required> | ||
| 80 | <span v-show="form.invoiceType=='0'"> 企业</span> | ||
| 81 | <span v-show="form.invoiceType=='1'"> 个人非企业</span> | ||
| 82 | </el-form-item> | ||
| 83 | <el-form-item :label="`发票抬头`" prop="invoiceTitle" required> | ||
| 84 | {{ form.invoiceTitle }} | ||
| 85 | </el-form-item> | ||
| 86 | <el-form-item v-if="form.invoiceType=='0'" :label="`税号`" prop="invoiceTfn" required> | ||
| 87 | {{ form.invoiceTfn }} | ||
| 88 | </el-form-item> | ||
| 89 | <el-form-item v-if="form.invoiceForm=='1'" :label="`邮箱`" prop="invoiceEmail" required> | ||
| 90 | {{ form.invoiceEmail }} | ||
| 91 | </el-form-item> | ||
| 92 | <el-form-item label="备注" prop="remarks"> | ||
| 93 | {{ form.remarks }} | ||
| 94 | </el-form-item> | ||
| 95 | <div v-if="form.invoiceForm=='3'&&form.invoiceType=='0'"> | ||
| 96 | <el-form-item :label="`地址`" prop="invoiceAddress" required> | ||
| 97 | {{ form.invoiceAddress }} | ||
| 98 | </el-form-item> | ||
| 99 | <el-form-item :label="`电话`" prop="invoicePhone" required> | ||
| 100 | {{ form.invoicePhone }} | ||
| 101 | </el-form-item> | ||
| 102 | <el-form-item :label="`开户行`" prop="invoiceBank" required> | ||
| 103 | {{ form.invoiceBank }} | ||
| 104 | </el-form-item> | ||
| 105 | <el-form-item :label="`账户`" prop="invoiceAccount" required> | ||
| 106 | {{ form.invoiceAccount }} | ||
| 107 | </el-form-item> | ||
| 108 | </div> | ||
| 109 | </el-form> | ||
| 110 | </div> | ||
| 111 | </el-col> | ||
| 112 | </el-row> | ||
| 113 | <div class="text-center mb20"> | ||
| 114 | <el-button plain round type="primary" @click="backList">返回</el-button> | ||
| 115 | </div> | ||
| 116 | </el-card> | ||
| 117 | <div style="height: 60px;"></div> | ||
| 118 | </div> | ||
| 119 | </div> | ||
| 120 | </template> | ||
| 121 | |||
| 122 | <script setup> | ||
| 123 | import {useRouter, useRoute} from "vue-router"; | ||
| 124 | import {ref, onMounted} from "vue"; | ||
| 125 | import {useStorage} from "@vueuse/core/index"; | ||
| 126 | import dayjs from 'dayjs' | ||
| 127 | import {ElMessage, ElMessageBox} from "element-plus"; | ||
| 128 | import useUserStore from "@/store/modules/user"; | ||
| 129 | import {getCurrentInstance} from "@vue/runtime-core"; | ||
| 130 | import { | ||
| 131 | getInvoiceDetail, | ||
| 132 | getTicketOrderInfo, | ||
| 133 | getTicketInfoByActivityId | ||
| 134 | } from "@/apiPc/booking"; | ||
| 135 | import {getOrderDetail} from "@/viewsPc/seat/api/index"; | ||
| 136 | |||
| 137 | const {proxy} = getCurrentInstance() | ||
| 138 | |||
| 139 | const user = useUserStore().user | ||
| 140 | const language = useStorage('language', 0) | ||
| 141 | const paymentType = ref(1) | ||
| 142 | const router = useRouter() | ||
| 143 | const route = useRoute() | ||
| 144 | const list = ref([]) | ||
| 145 | const totalMoney = ref(0) | ||
| 146 | const orderType = ref(0) | ||
| 147 | const form = ref({}) | ||
| 148 | const formDate = ref({}) | ||
| 149 | const ticketForm = ref({}) | ||
| 150 | const message = ref({}) | ||
| 151 | const matchForm = ref({}) | ||
| 152 | let cptId = null | ||
| 153 | const invoiceId = ref() | ||
| 154 | |||
| 155 | const rules = ref({ | ||
| 156 | invoiceType: [ | ||
| 157 | {required: true, message: language.value == 0 ? '请选择发票类型' : 'Please select invoice type', trigger: 'change'} | ||
| 158 | ], | ||
| 159 | invoiceEmail: [ | ||
| 160 | {required: true, message: language.value == 0 ? '请输入邮箱' : 'Please enter email', trigger: 'blur'} | ||
| 161 | ], | ||
| 162 | invoiceForm: [ | ||
| 163 | {required: true, message: language.value == 0 ? '请选择发票形式' : 'Please select invoice form', trigger: 'change'} | ||
| 164 | ], | ||
| 165 | invoiceTitle: [ | ||
| 166 | {required: true, message: language.value == 0 ? '请输入发票抬头' : 'Please enter invoice title', trigger: 'blur'} | ||
| 167 | ], | ||
| 168 | invoiceTfn: [ | ||
| 169 | {required: true, message: language.value == 0 ? '请输入税号' : 'Please enter TFN', trigger: 'blur'} | ||
| 170 | ], | ||
| 171 | invoiceAddress: [ | ||
| 172 | {required: true, message: language.value == 0 ? '请输入地址' : 'Please enter address', trigger: 'blur'} | ||
| 173 | ], | ||
| 174 | invoicePhone: [ | ||
| 175 | {required: true, message: language.value == 0 ? '请输入电话' : 'Please enter phone', trigger: 'blur'} | ||
| 176 | ], | ||
| 177 | invoiceBank: [ | ||
| 178 | {required: true, message: language.value == 0 ? '请输入开户行' : 'Please enter bank', trigger: 'blur'} | ||
| 179 | ], | ||
| 180 | invoiceAccount: [ | ||
| 181 | {required: true, message: language.value == 0 ? '请输入账户' : 'Please enter account', trigger: 'blur'} | ||
| 182 | ], | ||
| 183 | }) | ||
| 184 | onMounted(() => { | ||
| 185 | if (route.query.invoiceId) { | ||
| 186 | invoiceId.value = route.query.invoiceId | ||
| 187 | getList() | ||
| 188 | } | ||
| 189 | // 获取票务订单信息 | ||
| 190 | getTickInfo() | ||
| 191 | }) | ||
| 192 | |||
| 193 | |||
| 194 | // 票务订单详情 | ||
| 195 | async function getTickInfo() { | ||
| 196 | const res = await getTicketOrderInfo({orderId: route.query.orderId}) | ||
| 197 | ticketForm.value = res.data | ||
| 198 | try { | ||
| 199 | ticketForm.value.extJson = JSON.parse(ticketForm.value.extJson) | ||
| 200 | ticketForm.value.extJson.ticketDate = JSON.parse(ticketForm.value.extJson.ticketDate) | ||
| 201 | ticketForm.value.extJson.ticketType = JSON.parse(ticketForm.value.extJson.ticketType) | ||
| 202 | cptId = ticketForm.value.extJson.ticketDate.activityId | ||
| 203 | totalMoney.val = ticketForm.value.extJson.total | ||
| 204 | message.value = JSON.parse(ticketForm.value.extJson.message) | ||
| 205 | totalMoney.value = ticketForm.value.total | ||
| 206 | await getDetail(ticketForm.value.extJson.ticketDate.activityId) | ||
| 207 | console.log(ticketForm.value) | ||
| 208 | } catch (e) { | ||
| 209 | console.log(e) | ||
| 210 | } finally { | ||
| 211 | |||
| 212 | } | ||
| 213 | } | ||
| 214 | |||
| 215 | async function getDetail(activeId) { | ||
| 216 | const res = await getTicketInfoByActivityId({activityId: activeId}) | ||
| 217 | matchForm.value = res.data | ||
| 218 | console.log(matchForm.value) | ||
| 219 | } | ||
| 220 | |||
| 221 | async function getDataInfo() { | ||
| 222 | const res = await getOrderDetail({orderSn: route.query.orderSn}) | ||
| 223 | formDate.value = res.data | ||
| 224 | } | ||
| 225 | |||
| 226 | function getList() { | ||
| 227 | getInvoiceDetail(invoiceId.value).then(res => { | ||
| 228 | form.value = res.data; | ||
| 229 | totalMoney.value = form.value.total | ||
| 230 | }) | ||
| 231 | } | ||
| 232 | |||
| 233 | |||
| 234 | function backList() { | ||
| 235 | router.push({ | ||
| 236 | name: 'myKP' | ||
| 237 | }) | ||
| 238 | } | ||
| 239 | |||
| 240 | function goBack() { | ||
| 241 | router.go(-1) | ||
| 242 | } | ||
| 243 | </script> | ||
| 244 | |||
| 245 | <style lang="scss" scoped> | ||
| 246 | .pl-back { | ||
| 247 | position: absolute; | ||
| 248 | padding: 0 15px; | ||
| 249 | display: flex; | ||
| 250 | align-items: center; | ||
| 251 | cursor: pointer | ||
| 252 | } | ||
| 253 | |||
| 254 | .bigMoney { | ||
| 255 | font-size: 36px !important; | ||
| 256 | font-family: 'DIN Alternate'; | ||
| 257 | font-weight: bold; | ||
| 258 | } | ||
| 259 | |||
| 260 | .btn-lineG { | ||
| 261 | font-size: 16px | ||
| 262 | } | ||
| 263 | |||
| 264 | .bg-lineg { | ||
| 265 | height: 40px; | ||
| 266 | line-height: 40px; | ||
| 267 | font-size: 18px; | ||
| 268 | text-align: center; | ||
| 269 | } | ||
| 270 | |||
| 271 | .border-info { | ||
| 272 | position: relative; | ||
| 273 | |||
| 274 | & > label { | ||
| 275 | position: absolute; | ||
| 276 | right: 0; | ||
| 277 | top: 0; | ||
| 278 | margin: 0; | ||
| 279 | border-radius: 0 0 0px 15px; | ||
| 280 | padding: 5px 15px; | ||
| 281 | font-size: 14px; | ||
| 282 | } | ||
| 283 | |||
| 284 | .poPrice { | ||
| 285 | position: absolute; | ||
| 286 | bottom: 0px; | ||
| 287 | right: 10px; | ||
| 288 | font-size: 24px; | ||
| 289 | line-height: 1; | ||
| 290 | font-family: "DIN Alternate" | ||
| 291 | } | ||
| 292 | } | ||
| 293 | |||
| 294 | .blueTag { | ||
| 295 | color: #fff; | ||
| 296 | background-color: #1EC886; | ||
| 297 | } | ||
| 298 | |||
| 299 | .purpleTag { | ||
| 300 | color: #fff; | ||
| 301 | background-color: #717bef; | ||
| 302 | } | ||
| 303 | |||
| 304 | .orangeTag { | ||
| 305 | color: #fff; | ||
| 306 | background-color: #ff8124; | ||
| 307 | } | ||
| 308 | |||
| 309 | .pinkTag { | ||
| 310 | color: #fff; | ||
| 311 | background-color: #f55497; | ||
| 312 | } | ||
| 313 | |||
| 314 | .yellowTag { | ||
| 315 | color: #fff; | ||
| 316 | background-color: #bad814; | ||
| 317 | } | ||
| 318 | |||
| 319 | .leftboderTT { | ||
| 320 | font-weight: 600; | ||
| 321 | font-size: 16px; | ||
| 322 | color: #453DEA; | ||
| 323 | } | ||
| 324 | |||
| 325 | .border-rr { | ||
| 326 | border-radius: 5px; | ||
| 327 | border: 1px solid #DCDFE6; | ||
| 328 | } | ||
| 329 | |||
| 330 | .room { | ||
| 331 | font-weight: 400; | ||
| 332 | font-size: 14px; | ||
| 333 | color: #929AA0; | ||
| 334 | } | ||
| 335 | |||
| 336 | .ccitemBox { | ||
| 337 | overflow: auto; | ||
| 338 | |||
| 339 | label { | ||
| 340 | margin: 10px 0; | ||
| 341 | display: block; | ||
| 342 | min-height: 30px; | ||
| 343 | |||
| 344 | span { | ||
| 345 | color: #FF8124; | ||
| 346 | font-family: DIN Alternate; | ||
| 347 | font-size: 24px; | ||
| 348 | } | ||
| 349 | } | ||
| 350 | } | ||
| 351 | |||
| 352 | .ccitem { | ||
| 353 | display: flex; | ||
| 354 | justify-content: space-between; | ||
| 355 | font-size: 15px; | ||
| 356 | color: #666; | ||
| 357 | margin: 5px 0 10px; | ||
| 358 | |||
| 359 | label { | ||
| 360 | font-size: 16px; | ||
| 361 | color: #000; | ||
| 362 | } | ||
| 363 | |||
| 364 | span { | ||
| 365 | font-size: 13px; | ||
| 366 | } | ||
| 367 | } | ||
| 368 | |||
| 369 | .red { | ||
| 370 | color: #FF8124; | ||
| 371 | } | ||
| 372 | |||
| 373 | .tip { | ||
| 374 | font-size: 14px; | ||
| 375 | color: #666; | ||
| 376 | padding: 0 10px; | ||
| 377 | } | ||
| 378 | |||
| 379 | .mw500 { | ||
| 380 | max-width: 500px; | ||
| 381 | margin: auto | ||
| 382 | } | ||
| 383 | |||
| 384 | .bigSize { | ||
| 385 | font-size: 16px; | ||
| 386 | margin-bottom: 5px; | ||
| 387 | } | ||
| 388 | |||
| 389 | .smallSize { | ||
| 390 | font-size: 14px; | ||
| 391 | color: #999; | ||
| 392 | } | ||
| 393 | |||
| 394 | .flexCenter { | ||
| 395 | display: flex; | ||
| 396 | width: 100%; | ||
| 397 | align-items: center; | ||
| 398 | justify-content: space-between; | ||
| 399 | background: #f4f4f4; | ||
| 400 | padding: 10px; | ||
| 401 | box-sizing: border-box; | ||
| 402 | } | ||
| 403 | |||
| 404 | .bigprice { | ||
| 405 | font-size: 26px; | ||
| 406 | line-height: 1; | ||
| 407 | font-family: "DIN Alternate"; | ||
| 408 | } | ||
| 409 | </style> |
| ... | @@ -326,6 +326,18 @@ const handleClick = (e) => { | ... | @@ -326,6 +326,18 @@ const handleClick = (e) => { |
| 326 | 326 | ||
| 327 | } | 327 | } |
| 328 | const gokp = (item) => { | 328 | const gokp = (item) => { |
| 329 | if (query.value.orderType) { | ||
| 330 | router.push({ | ||
| 331 | name: 'ticketAddInvoice', | ||
| 332 | query: { | ||
| 333 | orders: encodeURIComponent(JSON.stringify(item)), | ||
| 334 | totalMoney: item.totalStr || item.totalPayAmount || item.payAmount || item.totalAmount, | ||
| 335 | orderId: item.id, | ||
| 336 | paymentType: item.paymentType, | ||
| 337 | orderType: query.value.orderType, | ||
| 338 | } | ||
| 339 | }) | ||
| 340 | } else { | ||
| 329 | router.push({ | 341 | router.push({ |
| 330 | path: '/booking/addInvoice', | 342 | path: '/booking/addInvoice', |
| 331 | query: { | 343 | query: { |
| ... | @@ -337,8 +349,20 @@ const gokp = (item) => { | ... | @@ -337,8 +349,20 @@ const gokp = (item) => { |
| 337 | orderSn: query.value.orderType == 6 ? item.orderSn : null | 349 | orderSn: query.value.orderType == 6 ? item.orderSn : null |
| 338 | } | 350 | } |
| 339 | }) | 351 | }) |
| 352 | } | ||
| 353 | |||
| 340 | } | 354 | } |
| 341 | const editkp = (item) => { | 355 | const editkp = (item) => { |
| 356 | if (query.value.orderType == 6) { | ||
| 357 | router.push({ | ||
| 358 | name: 'ticketAddInvoice', | ||
| 359 | query: { | ||
| 360 | invoiceId: item.invoiceId, | ||
| 361 | orderId: item.id, | ||
| 362 | isEdit: true, | ||
| 363 | } | ||
| 364 | }) | ||
| 365 | } else { | ||
| 342 | router.push({ | 366 | router.push({ |
| 343 | name: 'addInvoice', | 367 | name: 'addInvoice', |
| 344 | query: { | 368 | query: { |
| ... | @@ -351,8 +375,20 @@ const editkp = (item) => { | ... | @@ -351,8 +375,20 @@ const editkp = (item) => { |
| 351 | // orderSn: query.value.orderType == 6 ? item.orderSn : null | 375 | // orderSn: query.value.orderType == 6 ? item.orderSn : null |
| 352 | } | 376 | } |
| 353 | }) | 377 | }) |
| 378 | } | ||
| 379 | |||
| 354 | } | 380 | } |
| 355 | const showDetail = (item) => { | 381 | const showDetail = (item) => { |
| 382 | if (query.value.orderType == 6) { | ||
| 383 | router.push({ | ||
| 384 | name: 'ticketInvoiceDetail', | ||
| 385 | query: { | ||
| 386 | invoiceId: item.invoiceId, | ||
| 387 | orderId: item.id, | ||
| 388 | } | ||
| 389 | }) | ||
| 390 | |||
| 391 | } else { | ||
| 356 | router.push({ | 392 | router.push({ |
| 357 | name: 'invoiceDetail', | 393 | name: 'invoiceDetail', |
| 358 | query: { | 394 | query: { |
| ... | @@ -363,6 +399,8 @@ const showDetail = (item) => { | ... | @@ -363,6 +399,8 @@ const showDetail = (item) => { |
| 363 | // orderSn: query.value.orderType == 6 ? item.orderSn : null | 399 | // orderSn: query.value.orderType == 6 ? item.orderSn : null |
| 364 | } | 400 | } |
| 365 | }) | 401 | }) |
| 402 | |||
| 403 | } | ||
| 366 | } | 404 | } |
| 367 | let nowSj = {} | 405 | let nowSj = {} |
| 368 | const goSj = (item) => { | 406 | const goSj = (item) => { | ... | ... |
-
Please register or sign in to post a comment