4da7ea7d by zrj

8.18 hebing

1 parent 0def89d5
1 <template> 1 <template>
2 <div class="pd20"> 2 <div class="pd20">
3 <div style="margin-bottom: 20px">
4 <el-button type="primary" @click="downloadAll">合并生成缴费单</el-button>
5 <!-- <el-button type="primary" @click="showDialog">合并上传缴费单</el-button>-->
6 </div>
3 <div v-for="b in list" class="item"> 7 <div v-for="b in list" class="item">
4 <div class="title"> 8 <div class="title">
9 <el-checkbox v-model="b.ischeck"></el-checkbox>
5 <label v-if="b.orderType == 0" class="blueTag"> {{ language == 0 ? '酒店' : 'HOTEL' }} </label> 10 <label v-if="b.orderType == 0" class="blueTag"> {{ language == 0 ? '酒店' : 'HOTEL' }} </label>
6 <label v-if="b.orderType == 1" class="purpleTag"> {{ language == 0 ? '车辆' : 'TRANSPORTATION' }} </label> 11 <label v-if="b.orderType == 1" class="purpleTag"> {{ language == 0 ? '车辆' : 'TRANSPORTATION' }} </label>
7 <label v-if="b.orderType == 2" class="orangeTag"> {{ language == 0 ? '餐饮' : 'DINING' }} </label> 12 <label v-if="b.orderType == 2" class="orangeTag"> {{ language == 0 ? '餐饮' : 'DINING' }} </label>
...@@ -140,17 +145,37 @@ ...@@ -140,17 +145,37 @@
140 </el-col> 145 </el-col>
141 </el-row> 146 </el-row>
142 </div> 147 </div>
148 <el-dialog v-model="show" :title="language == 0 ? '上传:' : 'Upload:'" width="1000px">
149 <div>
150 <el-row class="proofBox">
151 <el-col :lg="12">
152 <div class="flex">
153 <label style="width: 10em">
154 {{ language == 0 ? '上传缴费凭证:' : 'Upload proof:' }}
155 </label>
156 <file-upload v-model="pf" :is-show-tip="false" :button-text="language==0?'上传文件':'Upload'"/>
157 </div>
158 </el-col>
159 <!-- 如果没审批通过-->
160 <el-col :lg="24" align="center" justify="center">
161 <el-button round type="primary" @click="submitProofAll">{{ language == '0' ? '提交凭证' : 'Submit Proof' }}
162 </el-button>
163 </el-col>
164 </el-row>
165 </div>
166 </el-dialog>
143 </div> 167 </div>
144 </template> 168 </template>
145 169
146 <script setup> 170 <script setup>
147 import dayjs from "dayjs"; 171 import dayjs from "dayjs";
148 import {useStorage} from "@vueuse/core"; 172 import {useStorage} from "@vueuse/core";
149 import {cancelOrder, cancelOrder2} from "/@/apiPc/booking"; 173 import {cancelOrder, cancelOrder2,renewalProof} from "/@/apiPc/booking";
150 import {ElMessage} from "element-plus"; 174 import {ElMessage} from "element-plus";
151 import {getCurrentInstance} from "@vue/runtime-core"; 175 import {getCurrentInstance} from "@vue/runtime-core";
176 import {ref} from "vue";
152 177
153 defineProps({ 178 const props = defineProps({
154 list: { 179 list: {
155 type: Array, 180 type: Array,
156 default: () => [] 181 default: () => []
...@@ -239,6 +264,69 @@ const downInvoice = (row) => { ...@@ -239,6 +264,69 @@ const downInvoice = (row) => {
239 }, `Invoice_${new Date().getTime()}.pdf`) 264 }, `Invoice_${new Date().getTime()}.pdf`)
240 } 265 }
241 266
267 function downloadAll() {
268 let selectList = props.list.filter(item => item.ischeck==true)
269 if (selectList.length > 0) {
270 let flag = true
271 let pType = selectList[0].paymentType == 1||selectList[0].paymentType == 4 ? 0 : 1
272 selectList.forEach(n => {
273 let nType = n.paymentType == 1||n.paymentType == 4 ? 0 : 1
274 if (nType != pType) {
275 flag = false
276 }
277 })
278 if (!flag) {
279 ElMessage({
280 message: language.value == 0 ? '存在不同货币结算的订单,无法合并!' : 'Orders with different currency settlements cannot be merged!',
281 type: 'warning'
282 })
283 }
284 let ids = selectList.map(item => item.id)
285 downInvoices(ids.join(','), pType)
286 } else {
287 ElMessage({
288 message: language.value == 0 ? '请选择缴费单!' : 'Please select a order!',
289 type: 'warning'
290 })
291 }
292
293
294 }
295
296 const downInvoices = (ids,language) => {
297 proxy.download(`/ota/orderRoom/exportRoomBillPaymentBatch`, {
298 ids: ids,
299 language: language,
300 }, `Invoice_${new Date().getTime()}.pdf`)
301 }
302
303 const show = ref(false)
304 const pf = ref([])
305
306 const submitProofAll = () => {
307 console.log(pf.value)
308 // //提交凭证
309 // if (!pf.value) {
310 // ElMessage.warning(language.value == 0 ? '请上传凭证' : 'Please upload a voucher')
311 // return
312 // }
313 // booking.renewalProof({
314 // id: orderId.value,
315 // pic: form.value.pic[0]?.url
316 // }).then(res => {
317 // ElMessage.success({
318 // message: language.value == 0 ? '凭证提交成功' : 'Voucher submission successful',
319 // type: 'success'
320 // })
321 // getData()
322 // })
323 }
324
325 const showDialog = () => {
326 show.value = true
327 }
328
329
242 </script> 330 </script>
243 331
244 <style lang="scss" scoped> 332 <style lang="scss" scoped>
...@@ -392,4 +480,9 @@ const downInvoice = (row) => { ...@@ -392,4 +480,9 @@ const downInvoice = (row) => {
392 } 480 }
393 } 481 }
394 482
483 .proofBox {
484 padding: 20px;
485 margin: 0 20px;
486 border: 1px dashed #999;
487 }
395 </style> 488 </style>
......
...@@ -51,6 +51,7 @@ function getList() { ...@@ -51,6 +51,7 @@ function getList() {
51 if ( b.status == '0') { 51 if ( b.status == '0') {
52 b.countdown = Number(b.surplus) 52 b.countdown = Number(b.surplus)
53 } 53 }
54 b.ischeck = false
54 } 55 }
55 }) 56 })
56 } 57 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!