2a8042bb by zhangmeng

票务

1 parent 008175aa
...@@ -216,6 +216,14 @@ export function editInvoice(form) { ...@@ -216,6 +216,14 @@ export function editInvoice(form) {
216 data: form 216 data: form
217 }) 217 })
218 } 218 }
219 export function editInvoiceMatch(form) {
220 return request({
221 url: `/cpt/invoice`,
222 method: 'put',
223 data: form
224 })
225 }
226
219 export function editCptInvoice(form) { 227 export function editCptInvoice(form) {
220 return request({ 228 return request({
221 url: `/cpt/invoice`, 229 url: `/cpt/invoice`,
...@@ -379,6 +387,13 @@ export function getInvoiceDetail(invoiceId) { ...@@ -379,6 +387,13 @@ export function getInvoiceDetail(invoiceId) {
379 method: 'get' 387 method: 'get'
380 }) 388 })
381 } 389 }
390 export function getInvoiceDetailMatch(invoiceId) {
391 return request({
392 url: `/cpt/invoice/${invoiceId}`,
393 method: 'get'
394 })
395 }
396
382 export function getReceipt(query) { 397 export function getReceipt(query) {
383 // type 1是下载 2是发送到邮箱 398 // type 1是下载 2是发送到邮箱
384 return request({ 399 return request({
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
9 <el-col :span="24"> 9 <el-col :span="24">
10 <!--已选订单--> 10 <!--已选订单-->
11 <div class="border-info" v-for="b in list" :key="b.id"> 11 <div class="border-info" v-for="b in list" :key="b.id">
12 <label class="blueTag" v-if="b.orderType == 0"> {{ language==0?'酒店订单':'HOTEL' }}</label> 12 <label class="blueTag" v-if="orderType == 0"> {{ language==0?'酒店订单':'HOTEL' }}</label>
13 <label class="orangeTag" v-if="b.orderType == 1"> {{ language==0?'车辆订单':'TRANSPORTATION' }}</label> 13 <label class="orangeTag" v-if="b.orderType == 1"> {{ language==0?'车辆订单':'TRANSPORTATION' }}</label>
14 <label class="purpleTag" v-if="b.orderType == 2"> {{ language==0?'餐饮订单':'DINING' }}</label> 14 <label class="purpleTag" v-if="b.orderType == 2"> {{ language==0?'餐饮订单':'DINING' }}</label>
15 <label class="pinkTag" v-if="b.orderType == 3"> {{ language==0?'化妆订单':'MakeUp' }}</label> 15 <label class="pinkTag" v-if="b.orderType == 3"> {{ language==0?'化妆订单':'MakeUp' }}</label>
16 <label class="yellowTag" v-if="b.orderType == 4"> {{ language==0?'拍摄订单':'Shooting'}}</label> 16 <label class="yellowTag" v-if="b.orderType == 4"> {{ language==0?'拍摄订单':'Shooting'}}</label>
17 <label class="yellowTag" v-if="orderType == 6"> {{ language==0?'票务':'Ticket'}}</label> 17 <label class="yellowTag" v-if="orderType == 6"> {{ language==0?'票务':'Ticket'}}</label>
18 <label class="bg-primary" v-if="!b.orderType"> {{ language==0?'赛事报名':'REGISTRATION' }}</label> 18 <label class="bg-primary" v-if="orderType==5"> {{ language==0?'赛事报名':'REGISTRATION' }}</label>
19 19
20 <h3 v-if="b.name">{{ b.name }}</h3> 20 <h3 v-if="b.name">{{ b.name }}</h3>
21 <h3 v-if="b.cptName">{{ b.cptName }}</h3> 21 <h3 v-if="b.cptName">{{ b.cptName }}</h3>
...@@ -153,14 +153,15 @@ import dayjs from 'dayjs' ...@@ -153,14 +153,15 @@ import dayjs from 'dayjs'
153 import {ElMessage,ElMessageBox} from "element-plus"; 153 import {ElMessage,ElMessageBox} from "element-plus";
154 import useUserStore from "@/store/modules/user"; 154 import useUserStore from "@/store/modules/user";
155 import {getCurrentInstance} from "@vue/runtime-core"; 155 import {getCurrentInstance} from "@vue/runtime-core";
156 import {submitTitckInvoice,invoice} from '@/viewsPc/seat/api/index' 156 import {submitTitckInvoice, invoice, TitckUpdateInvoice} from '@/viewsPc/seat/api/index'
157 import { 157 import {
158 addressList, 158 addressList,
159 editInvoice, 159 editInvoice,
160 editInvoiceMatch,
160 submitInvoice, 161 submitInvoice,
161 getInvoiceDetailBills, 162 getInvoiceDetailBills,
162 getInvoiceDetail, 163 getInvoiceDetail,
163 submitCptInvoice, getBaseInfoByActiveId, getLeagueInvoiceDetail, getLeagueInvoiceDetailPC 164 submitCptInvoice, getBaseInfoByActiveId, getLeagueInvoiceDetail, getLeagueInvoiceDetailPC,getInvoiceDetailMatch
164 } from "@/apiPc/booking"; 165 } from "@/apiPc/booking";
165 const {proxy} = getCurrentInstance() 166 const {proxy} = getCurrentInstance()
166 167
...@@ -212,6 +213,8 @@ const rules = ref({ ...@@ -212,6 +213,8 @@ const rules = ref({
212 const isEdit = ref(false) 213 const isEdit = ref(false)
213 let invoiceId 214 let invoiceId
214 let cptId 215 let cptId
216
217
215 onMounted(() => { 218 onMounted(() => {
216 console.log(route.query) 219 console.log(route.query)
217 orderType.value=route.query.orderType 220 orderType.value=route.query.orderType
...@@ -271,6 +274,7 @@ function getList() { ...@@ -271,6 +274,7 @@ function getList() {
271 getLeagueInvoiceDetailPC(invoiceId).then(res => { 274 getLeagueInvoiceDetailPC(invoiceId).then(res => {
272 // 订单 275 // 订单
273 list.value = res.data; 276 list.value = res.data;
277 console.log(list.value)
274 cptId = res.rows[0].activeId||res.rows[0].cptId 278 cptId = res.rows[0].activeId||res.rows[0].cptId
275 getRemark() 279 getRemark()
276 for (var bill of list.value) { 280 for (var bill of list.value) {
...@@ -292,10 +296,20 @@ function getList() { ...@@ -292,10 +296,20 @@ function getList() {
292 // 回显 296 // 回显
293 if (orderType.value==6){ 297 if (orderType.value==6){
294 invoice(invoiceId).then(res=>{ 298 invoice(invoiceId).then(res=>{
295 console.log(res) 299 // console.log(res)
296 // form.value = res.data; 300 form.value = res.data;
297 // totalMoney.value = form.value.total 301 form.value.invoiceForm='1'
302 totalMoney.value = form.value.total
298 }) 303 })
304 }else if(orderType.value==5){
305 getInvoiceDetailMatch(invoiceId).then(res => {
306 form.value = res.data;
307 totalMoney.value = form.value.total
308 // if (form.value.invoiceForm == '1') {
309 // email.value = form.value.address
310 // }
311 // getAddrList()
312 });
299 }else{ 313 }else{
300 getInvoiceDetail(invoiceId).then(res => { 314 getInvoiceDetail(invoiceId).then(res => {
301 form.value = res.data; 315 form.value = res.data;
...@@ -360,10 +374,23 @@ function submit() { ...@@ -360,10 +374,23 @@ function submit() {
360 } 374 }
361 375
362 function update() { 376 function update() {
363 editInvoice(form.value).then(res=>{ 377 if (orderType.value==6){
364 //返回列表 378 TitckUpdateInvoice(form.value).then(res=>{
365 backList() 379 //返回列表
366 }) 380 backList()
381 })
382 }else if(orderType.value==5){
383 editInvoiceMatch(form.value).then(res=>{
384 //返回列表
385 backList()
386 })
387 }else{
388 editInvoice(form.value).then(res=>{
389 //返回列表
390 backList()
391 })
392 }
393
367 } 394 }
368 function add() { 395 function add() {
369 if(orderType.value==6){ 396 if(orderType.value==6){
......
...@@ -61,17 +61,7 @@ ...@@ -61,17 +61,7 @@
61 <span v-if="form.invoiceForm=='2'">纸质普票</span> 61 <span v-if="form.invoiceForm=='2'">纸质普票</span>
62 <span v-if="form.invoiceForm=='3'">纸质专票</span> 62 <span v-if="form.invoiceForm=='3'">纸质专票</span>
63 </el-form-item> 63 </el-form-item>
64 <el-form-item :label="`邮箱`" v-if="form.invoiceForm=='1'" required prop="address"> 64
65 {{form.address}}
66 </el-form-item>
67 <el-form-item :label="`邮寄地址`" v-else required>
68 <div class="flexCenter">
69 <div>
70 <div class="bigSize">{{nowAddress.contact}} {{nowAddress.phone}}</div>
71 <div class="smallSize">{{nowAddress.addName}}</div>
72 </div>
73 </div>
74 </el-form-item>
75 <el-form-item :label="`发票类型`" required prop="invoiceType"> 65 <el-form-item :label="`发票类型`" required prop="invoiceType">
76 <span v-show="form.invoiceType=='0'"> 企业</span> 66 <span v-show="form.invoiceType=='0'"> 企业</span>
77 <span v-show="form.invoiceType=='1'"> 个人非企业</span> 67 <span v-show="form.invoiceType=='1'"> 个人非企业</span>
...@@ -82,6 +72,17 @@ ...@@ -82,6 +72,17 @@
82 <el-form-item :label="`税号`" required v-if="form.invoiceType=='0'" prop="invoiceTfn"> 72 <el-form-item :label="`税号`" required v-if="form.invoiceType=='0'" prop="invoiceTfn">
83 {{form.invoiceTfn}} 73 {{form.invoiceTfn}}
84 </el-form-item> 74 </el-form-item>
75 <el-form-item :label="`邮箱`" v-if="form.invoiceForm=='1'" required prop="invoiceEmail">
76 {{form.invoiceEmail}}
77 </el-form-item>
78 <el-form-item :label="`邮寄地址`" v-else required>
79 <div class="flexCenter">
80 <div>
81 <div class="bigSize">{{nowAddress.contact}} {{nowAddress.phone}}</div>
82 <div class="smallSize">{{nowAddress.addName}}</div>
83 </div>
84 </div>
85 </el-form-item>
85 <div v-if="form.invoiceForm=='3'&&form.invoiceType=='0'"> 86 <div v-if="form.invoiceForm=='3'&&form.invoiceType=='0'">
86 <el-form-item :label="`地址`" required prop="invoiceAddress"> 87 <el-form-item :label="`地址`" required prop="invoiceAddress">
87 {{form.invoiceAddress}} 88 {{form.invoiceAddress}}
...@@ -119,7 +120,9 @@ import dayjs from 'dayjs' ...@@ -119,7 +120,9 @@ import dayjs from 'dayjs'
119 import {ElMessage,ElMessageBox} from "element-plus"; 120 import {ElMessage,ElMessageBox} from "element-plus";
120 import useUserStore from "@/store/modules/user"; 121 import useUserStore from "@/store/modules/user";
121 import {getCurrentInstance} from "@vue/runtime-core"; 122 import {getCurrentInstance} from "@vue/runtime-core";
122 import {addressList, editInvoice, submitInvoice,getInvoiceDetailBills,getInvoiceDetail} from "@/apiPc/booking"; 123 import {addressList, editInvoice, submitInvoice,getInvoiceDetailBills,getInvoiceDetail,getInvoiceDetailMatch} from "@/apiPc/booking";
124 import {submitTitckInvoice, invoice, TitckUpdateInvoice} from '@/viewsPc/seat/api/index'
125
123 const {proxy} = getCurrentInstance() 126 const {proxy} = getCurrentInstance()
124 127
125 const user = useUserStore().user 128 const user = useUserStore().user
...@@ -130,12 +133,13 @@ const list = ref([]) ...@@ -130,12 +133,13 @@ const list = ref([])
130 const addrList = ref([]) 133 const addrList = ref([])
131 const nowAddress = ref({}) 134 const nowAddress = ref({})
132 const totalMoney = ref(0) 135 const totalMoney = ref(0)
136 const orderType=ref(0)
133 const form = ref({}) 137 const form = ref({})
134 const rules = ref({ 138 const rules = ref({
135 invoiceType: [ 139 invoiceType: [
136 {required: true, message: language.value==0?'请选择发票类型':'Please select invoice type', trigger: 'change'} 140 {required: true, message: language.value==0?'请选择发票类型':'Please select invoice type', trigger: 'change'}
137 ], 141 ],
138 address: [ 142 invoiceEmail: [
139 {required: true, message: language.value==0?'请输入邮箱':'Please enter email', trigger: 'blur'} 143 {required: true, message: language.value==0?'请输入邮箱':'Please enter email', trigger: 'blur'}
140 ], 144 ],
141 invoiceForm: [ 145 invoiceForm: [
...@@ -166,6 +170,7 @@ onMounted(() => { ...@@ -166,6 +170,7 @@ onMounted(() => {
166 if(route.query.activeId){ 170 if(route.query.activeId){
167 form.value.activeId = route.query.activeId 171 form.value.activeId = route.query.activeId
168 } 172 }
173 orderType.value=route.query.orderType
169 invoiceId = route.query.invoiceId 174 invoiceId = route.query.invoiceId
170 getList() 175 getList()
171 176
...@@ -178,14 +183,33 @@ function getList() { ...@@ -178,14 +183,33 @@ function getList() {
178 bill.messageObj = JSON.parse(bill.message) 183 bill.messageObj = JSON.parse(bill.message)
179 } 184 }
180 }); 185 });
181 getInvoiceDetail(invoiceId).then(res => { 186 if (orderType.value==6){
182 form.value = res.data; 187 invoice(invoiceId).then(res=>{
183 totalMoney.value = form.value.total 188 // console.log(res)
184 if (form.value.invoiceForm == '1') { 189 form.value = res.data;
185 email.value = form.value.address 190 form.value.invoiceForm=1
186 } 191 totalMoney.value = form.value.total
187 getAddrList() 192 })
188 }); 193 }else if(orderType.value==5){
194 getInvoiceDetailMatch(invoiceId).then(res => {
195 form.value = res.data;
196 totalMoney.value = form.value.total
197 if (form.value.invoiceForm == '1') {
198 email.value = form.value.address
199 }
200 getAddrList()
201 });
202 }else{
203 getInvoiceDetail(invoiceId).then(res => {
204 form.value = res.data;
205 totalMoney.value = form.value.total
206 if (form.value.invoiceForm == '1') {
207 email.value = form.value.address
208 }
209 getAddrList()
210 });
211 }
212
189 } 213 }
190 function getAddrList() { 214 function getAddrList() {
191 addressList(user.userId).then(res=>{ 215 addressList(user.userId).then(res=>{
......
...@@ -248,7 +248,7 @@ onMounted(() => { ...@@ -248,7 +248,7 @@ onMounted(() => {
248 const getList = () => { 248 const getList = () => {
249 loading.value = true 249 loading.value = true
250 if(query.value.orderType=='5'){ 250 if(query.value.orderType=='5'){
251 getCanInvoiceBm().then(res=>{ 251 getCanInvoiceBm(query.value).then(res=>{
252 list.value = res.rows 252 list.value = res.rows
253 loading.value = false 253 loading.value = false
254 }) 254 })
...@@ -294,7 +294,7 @@ const gokp = (item) => { ...@@ -294,7 +294,7 @@ const gokp = (item) => {
294 query: { 294 query: {
295 orders: encodeURIComponent(JSON.stringify(item)), 295 orders: encodeURIComponent(JSON.stringify(item)),
296 totalMoney:item.total||item.totalPayAmount||item.payAmount, 296 totalMoney:item.total||item.totalPayAmount||item.payAmount,
297 paymentType:query.value.orderType==6?item.payType:item.paymentType, 297 paymentType:query.value.orderType==6||query.value.orderType==5?item.payType:item.paymentType,
298 orderType:query.value.orderType 298 orderType:query.value.orderType
299 } 299 }
300 }) 300 })
...@@ -303,11 +303,11 @@ const editkp = (item) => { ...@@ -303,11 +303,11 @@ const editkp = (item) => {
303 router.push({ 303 router.push({
304 name:'addInvoice', 304 name:'addInvoice',
305 query:{ 305 query:{
306 invoiceId:item.invoiceId, 306 invoiceId:query.value.orderType==6?item.invoiceIdStr :item.invoiceId,
307 type:activeName.value, 307 type:activeName.value,
308 isEdit:true, 308 isEdit:true,
309 orderType:query.value.orderType, 309 orderType:query.value.orderType,
310 paymentType:query.value.orderType==6?item.payType:item.paymentType, 310 paymentType:query.value.orderType==6||query.value.orderType==5?item.payType:item.paymentType,
311 } 311 }
312 }) 312 })
313 } 313 }
...@@ -315,8 +315,10 @@ const showDetail = (item) => { ...@@ -315,8 +315,10 @@ const showDetail = (item) => {
315 router.push({ 315 router.push({
316 name:'invoiceDetail', 316 name:'invoiceDetail',
317 query:{ 317 query:{
318 invoiceId:item.invoiceId, 318 invoiceId:query.value.orderType==6?item.invoiceIdStr :item.invoiceId,
319 type:activeName.value, 319 type:activeName.value,
320 orderType:query.value.orderType,
321 paymentType:query.value.orderType==6?item.payType:item.paymentType,
320 } 322 }
321 }) 323 })
322 } 324 }
......
...@@ -60,3 +60,6 @@ export const submitTitckInvoice = (data) => ...@@ -60,3 +60,6 @@ export const submitTitckInvoice = (data) =>
60 // 重新开票回显 60 // 重新开票回显
61 export const invoice = (data) => 61 export const invoice = (data) =>
62 request("GET", `/api/invoice/${data}`); 62 request("GET", `/api/invoice/${data}`);
63
64 export const TitckUpdateInvoice = (data) =>
65 request("POST", `/api/invoice/updateInvoice`,data);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!