|
@@ -718,6 +718,12 @@
|
|
|
/> -->
|
|
/> -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template slot="deposit" slot-scope="text, record, index">
|
|
|
|
|
+ <editable-cell
|
|
|
|
|
+ :text="text"
|
|
|
|
|
+ @change="onCellChangeCopy('deposit', index, $event)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
<div
|
|
<div
|
|
|
style="
|
|
style="
|
|
@@ -994,17 +1000,18 @@ const columns = [
|
|
|
{
|
|
{
|
|
|
title: "天数",
|
|
title: "天数",
|
|
|
dataIndex: "day",
|
|
dataIndex: "day",
|
|
|
- width: 60,
|
|
|
|
|
|
|
+ width: 40,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: "房费",
|
|
title: "房费",
|
|
|
dataIndex: "roomFee",
|
|
dataIndex: "roomFee",
|
|
|
- width: 80,
|
|
|
|
|
|
|
+ width: 60,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: "押金",
|
|
title: "押金",
|
|
|
dataIndex: "deposit",
|
|
dataIndex: "deposit",
|
|
|
- // width: 60,
|
|
|
|
|
|
|
+ scopedSlots: { customRender: "deposit" },
|
|
|
|
|
+ width: 120,
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
|
|
|
|
@@ -1025,6 +1032,7 @@ const columns2 = [
|
|
|
title: "应缴",
|
|
title: "应缴",
|
|
|
dataIndex: "receivable",
|
|
dataIndex: "receivable",
|
|
|
width: "25%",
|
|
width: "25%",
|
|
|
|
|
+ scopedSlots: { customRender: "prefPrice" }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: "实收",
|
|
title: "实收",
|
|
@@ -1055,6 +1063,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ editDepositModal: false,
|
|
|
//会员选中数据
|
|
//会员选中数据
|
|
|
vipCustomerData: {},
|
|
vipCustomerData: {},
|
|
|
agreementUnitData: { customerName: "" },
|
|
agreementUnitData: { customerName: "" },
|
|
@@ -2052,6 +2061,68 @@ export default {
|
|
|
// this.amount = sum;
|
|
// this.amount = sum;
|
|
|
// console.log("this.model.roomPrices", this.model.roomPrices);
|
|
// console.log("this.model.roomPrices", this.model.roomPrices);
|
|
|
},
|
|
},
|
|
|
|
|
+ onCellChangeCopy(key, dataIndex, value) {
|
|
|
|
|
+ console.log(key, value);
|
|
|
|
|
+ console.log(this.depositRule);
|
|
|
|
|
+ console.log(this.model.roomPrices[dataIndex]);
|
|
|
|
|
+ const dataSource = [...this.model.roomPrices];
|
|
|
|
|
+ const target = dataSource[dataIndex];
|
|
|
|
|
+ console.log("target", target);
|
|
|
|
|
+ if (target) {
|
|
|
|
|
+ target[key] = value;
|
|
|
|
|
+ // target.roomFee = value * target.day;
|
|
|
|
|
+ // target.deposit = this.compuleDeposit(value);
|
|
|
|
|
+ this.model.roomPrices = dataSource;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var sum = 0;
|
|
|
|
|
+ var money2 = 0;
|
|
|
|
|
+ var deposit2 = 0;
|
|
|
|
|
+ for (var i = 0; i < this.model.roomPrices.length; i++) {
|
|
|
|
|
+ var money = 0;
|
|
|
|
|
+ var item = this.model.roomPrices[i];
|
|
|
|
|
+ if (item.editPrice && item.editPrice.length > 0) {
|
|
|
|
|
+ item.editPrice.forEach((p) => {
|
|
|
|
|
+ money += p;
|
|
|
|
|
+ });
|
|
|
|
|
+ item.roomFee = money;
|
|
|
|
|
+ sum += money + item.deposit;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ sum += item.roomFee + item.deposit;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ money2 += item.roomFee;
|
|
|
|
|
+ deposit2 += item.deposit;
|
|
|
|
|
+ // var find = this.model.orderFees.find(
|
|
|
|
|
+ // (t) =>
|
|
|
|
|
+ // t.subjectType == 2 &&
|
|
|
|
|
+ // t.roomId == this.model.roomPrices[this.editPriceIndex].roomId
|
|
|
|
|
+ // );
|
|
|
|
|
+ // if (find && find.roomId == item.roomId) {
|
|
|
|
|
+ // find.money = money;
|
|
|
|
|
+ // find.receivable = money;
|
|
|
|
|
+ // }
|
|
|
|
|
+ }
|
|
|
|
|
+ var find = this.model.orderFees.find(
|
|
|
|
|
+ (t) => t.subjectType == 2 && t.roomId == this.model.roomIds[0].id
|
|
|
|
|
+ );
|
|
|
|
|
+ if (find) {
|
|
|
|
|
+ find.money = money2;
|
|
|
|
|
+ find.receivable = money2;
|
|
|
|
|
+ if (!this.paymentSplit) {
|
|
|
|
|
+ find.money += deposit2;
|
|
|
|
|
+ find.receivable += deposit2;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ var find2 = this.model.orderFees.find(
|
|
|
|
|
+ (t) => t.subjectType == 1 && t.roomId == this.model.roomIds[0].id
|
|
|
|
|
+ );
|
|
|
|
|
+ if (find2) {
|
|
|
|
|
+ find2.money = deposit2;
|
|
|
|
|
+ find2.receivable = deposit2;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.amount = sum;
|
|
|
|
|
+ },
|
|
|
// handleChange(value, index, column) {
|
|
// handleChange(value, index, column) {
|
|
|
// const newData = [...this.data2];
|
|
// const newData = [...this.data2];
|
|
|
// const target = newData[index];
|
|
// const target = newData[index];
|
|
@@ -2495,7 +2566,7 @@ export default {
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
that.$message.success(res.message);
|
|
|
- that.$emit("ok", {order:res.result, model:that.model});
|
|
|
|
|
|
|
+ that.$emit("ok", { order: res.result, model: that.model });
|
|
|
} else {
|
|
} else {
|
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
|
that.$confirm({
|
|
that.$confirm({
|
|
@@ -2507,7 +2578,10 @@ export default {
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
that.$message.success(res.message);
|
|
that.$message.success(res.message);
|
|
|
- that.$emit("ok", {order:res.result, model:that.model});
|
|
|
|
|
|
|
+ that.$emit("ok", {
|
|
|
|
|
+ order: res.result,
|
|
|
|
|
+ model: that.model,
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
if (res.message.indexOf("与预约时间有冲突") >= 0) {
|
|
|
} else {
|
|
} else {
|