|
|
@@ -244,15 +244,22 @@
|
|
|
<a-divider />
|
|
|
<a-table
|
|
|
:columns="columns"
|
|
|
- :data-source="data"
|
|
|
+ :data-source="feesList"
|
|
|
:pagination="false"
|
|
|
- :scroll="{ y: 160, x: 500 }"
|
|
|
+ :scroll="{ y: 160 }"
|
|
|
rowKey="id"
|
|
|
:rowSelection="{
|
|
|
selectedRowKeys: selectedRowKeys,
|
|
|
onChange: onSelectChange,
|
|
|
}"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot="subjectType" slot-scope="text, record, index">
|
|
|
+ {{ getSubjectTypeText(text) }}
|
|
|
+ </template>
|
|
|
+ <template slot="roomId" slot-scope="text, record, index">
|
|
|
+ {{ getRoomName(text) }}
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
<div
|
|
|
style="
|
|
|
color: rgba(255, 87, 51, 1);
|
|
|
@@ -260,7 +267,7 @@
|
|
|
text-align: right;
|
|
|
"
|
|
|
>
|
|
|
- 合计消费:2922:00
|
|
|
+ 合计消费:{{ feesAmount.toFixed(2) }}
|
|
|
</div>
|
|
|
<div
|
|
|
style="
|
|
|
@@ -302,15 +309,22 @@
|
|
|
<a-divider />
|
|
|
<a-table
|
|
|
:columns="columns2"
|
|
|
- :data-source="data2"
|
|
|
+ :data-source="paymentList"
|
|
|
:pagination="false"
|
|
|
- :scroll="{ y: 160, x: 500 }"
|
|
|
+ :scroll="{ y: 160}"
|
|
|
rowKey="id"
|
|
|
:rowSelection="{
|
|
|
selectedRowKeys: selectedRowKeys,
|
|
|
onChange: onSelectChange,
|
|
|
}"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot="payType" slot-scope="text, record, index">
|
|
|
+ {{ getPayTypeText(text) }}
|
|
|
+ </template>
|
|
|
+ <template slot="subjectType" slot-scope="text, record, index">
|
|
|
+ {{ getSubjectTypeText(text) }}
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
<div
|
|
|
style="
|
|
|
color: rgba(255, 87, 51, 1);
|
|
|
@@ -318,19 +332,25 @@
|
|
|
text-align: right;
|
|
|
"
|
|
|
>
|
|
|
- 合计收款:2922:00
|
|
|
+ 合计收款:{{ paymentAmount.toFixed(2) }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="width: 20%">
|
|
|
<h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">财务汇总</h4>
|
|
|
<a-divider />
|
|
|
<a-descriptions :column="1">
|
|
|
- <a-descriptions-item label="合计收款"> + 2500 </a-descriptions-item>
|
|
|
- <a-descriptions-item label="合计消费">-2500 </a-descriptions-item>
|
|
|
- <a-descriptions-item label="结账应退"> 0 </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="合计收款">
|
|
|
+ + {{ paymentAmount.toFixed(2) }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="合计消费"
|
|
|
+ >-{{ feesAmount.toFixed(2) }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="结账应退">
|
|
|
+ {{ (feesAmount - paymentAmount).toFixed(2) }}
|
|
|
+ </a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
|
|
|
- <a-button @click="handleAdd" type="danger" style="margin-left: 100px"
|
|
|
+ <a-button @click="handleAdd" type="danger" style="margin-left: 100px" disabled
|
|
|
>结账退款</a-button
|
|
|
>
|
|
|
</div>
|
|
|
@@ -352,60 +372,73 @@ const columns = [
|
|
|
// },
|
|
|
{
|
|
|
title: "房间号",
|
|
|
- dataIndex: "name",
|
|
|
- width: 80,
|
|
|
+ dataIndex: "roomId",
|
|
|
+ width: 70,
|
|
|
+ scopedSlots: { customRender: "roomId" },
|
|
|
},
|
|
|
{
|
|
|
title: "费项",
|
|
|
- dataIndex: "age",
|
|
|
- width: 80,
|
|
|
+ dataIndex: "subjectType",
|
|
|
+ width: 60,
|
|
|
+ scopedSlots: { customRender: "subjectType" },
|
|
|
},
|
|
|
{
|
|
|
title: "入账日期",
|
|
|
- dataIndex: "address",
|
|
|
- width: 100,
|
|
|
+ dataIndex: "dayTime",
|
|
|
+ width: 110,
|
|
|
},
|
|
|
{
|
|
|
title: "单价",
|
|
|
- dataIndex: "address2",
|
|
|
- width: 60,
|
|
|
+ dataIndex: "id",
|
|
|
+ // width: 60,
|
|
|
+ customRender: function (text, record) {
|
|
|
+ return record.money;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: "优惠价",
|
|
|
- dataIndex: "address3",
|
|
|
- width: 80,
|
|
|
+ dataIndex: "money",
|
|
|
+ // width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: "数量",
|
|
|
- dataIndex: "address4",
|
|
|
- width: 60,
|
|
|
+ dataIndex: "feeType",
|
|
|
+ // width: 60,
|
|
|
+ customRender: function (text) {
|
|
|
+ return 1;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: "小计",
|
|
|
- dataIndex: "address5",
|
|
|
- width: 60,
|
|
|
+ dataIndex: "livingOrderId",
|
|
|
+ // width: 60,
|
|
|
+ customRender: function (text, record) {
|
|
|
+ return record.money;
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
const columns2 = [
|
|
|
{
|
|
|
title: "入账时间",
|
|
|
- dataIndex: "name",
|
|
|
- width: 160,
|
|
|
+ dataIndex: "createTime",
|
|
|
+ // width: 110,
|
|
|
},
|
|
|
{
|
|
|
title: "支付方式",
|
|
|
- dataIndex: "age",
|
|
|
- width: 100,
|
|
|
+ dataIndex: "payType",
|
|
|
+ // width: 100,
|
|
|
+ scopedSlots: { customRender: "payType" },
|
|
|
},
|
|
|
{
|
|
|
title: "备注",
|
|
|
dataIndex: "remark",
|
|
|
- width: 120,
|
|
|
+ // width: 120,
|
|
|
+ scopedSlots: { customRender: "subjectType" },
|
|
|
},
|
|
|
{
|
|
|
title: "金额",
|
|
|
- dataIndex: "amount",
|
|
|
- width: 60,
|
|
|
+ dataIndex: "money",
|
|
|
+ // width: 60,
|
|
|
},
|
|
|
];
|
|
|
const data = [];
|
|
|
@@ -479,12 +512,25 @@ export default {
|
|
|
customerSourceList: [],
|
|
|
warranterList: [],
|
|
|
key: 0,
|
|
|
+ feesList: [],
|
|
|
+ paymentList: [],
|
|
|
+ payTypeList: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
formDisabled() {
|
|
|
return this.disabled;
|
|
|
},
|
|
|
+ feesAmount() {
|
|
|
+ return this.feesList.reduce(function (total, item) {
|
|
|
+ return total + item.money;
|
|
|
+ }, 0);
|
|
|
+ },
|
|
|
+ paymentAmount() {
|
|
|
+ return this.paymentList.reduce(function (total, item) {
|
|
|
+ return total + item.money;
|
|
|
+ }, 0);
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
var _info = JSON.parse(localStorage.getItem("storeInfo"));
|
|
|
@@ -512,6 +558,28 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ getPayTypeText(text) {
|
|
|
+ var find = this.payTypeList.find((t) => (t.id = text));
|
|
|
+ return find ? find.name : "";
|
|
|
+ },
|
|
|
+ getRoomName(id) {
|
|
|
+ var index = this.model.livingRoomIds.findLastIndex((t) => t.roomId == id);
|
|
|
+ var find = this.model.livingRoomIds[index];
|
|
|
+ return find ? find.roomName : "";
|
|
|
+ },
|
|
|
+ getSubjectTypeText(text) {
|
|
|
+ return text == 1 ? "押金" : "房费";
|
|
|
+ },
|
|
|
+ async getbusRoomPayType() {
|
|
|
+ await getAction("/business/busRoomPayType/list", {
|
|
|
+ pageSize: 99999,
|
|
|
+ pageNo: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.payTypeList = res.result.records;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
removeLivingCustomer(id) {
|
|
|
deleteAction("/business/busLivingCustomer/delete", { id: id }).then(
|
|
|
(res) => {
|
|
|
@@ -552,7 +620,10 @@ export default {
|
|
|
var find = this.customerSourceList.find((t) => t.id == customerSource);
|
|
|
return find ? find.itemText : "--";
|
|
|
},
|
|
|
- getBookingOrderInfo() {
|
|
|
+ async getBookingOrderInfo() {
|
|
|
+ if (this.payTypeList == 0) {
|
|
|
+ await this.getbusRoomPayType();
|
|
|
+ }
|
|
|
var obj = {
|
|
|
bookingNo: this.id,
|
|
|
};
|
|
|
@@ -575,6 +646,16 @@ export default {
|
|
|
livingRoomId.livingCustomers = list;
|
|
|
res.result.livingRoomIds.unshift(livingRoomId);
|
|
|
this.model = res.result;
|
|
|
+ getAction("/business/busRoomBookingOrders/living-fees", {
|
|
|
+ bookingOrderId: this.model.orderInfo.id,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result && res.result.length > 0) {
|
|
|
+ this.feesList = res.result.filter((t) => t.feeType === 1);
|
|
|
+ this.paymentList = res.result.filter((t) => t.feeType === 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|