|
|
@@ -924,8 +924,12 @@
|
|
|
|
|
|
<!-- 修改每日单价弹窗 -->
|
|
|
<a-modal :visible="editPriceModal" title="调价" @cancel="editPriceModal = false" :width="800" @ok="editPriceOk">
|
|
|
- <table>
|
|
|
- <tr>
|
|
|
+ <template v-if="editPriceData.length>0">
|
|
|
+ <table v-for="(item, index) in editPriceData" :key="index">
|
|
|
+ <tr v-if="index==0">
|
|
|
+ <td style="text-align:center;background:#722ed1;color:#fff;">
|
|
|
+ <!-- 房号 -->
|
|
|
+ </td>
|
|
|
<td style="text-align:center;background:#722ed1;color:#fff;">
|
|
|
批量调价
|
|
|
</td>
|
|
|
@@ -934,24 +938,37 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<th>
|
|
|
- <td style="text-align:center;color:#722ed1;">
|
|
|
- <div>每日房价</div>
|
|
|
- <div v-if="model.roomPrices.length>0 && model.roomPrices[editPriceIndex]">
|
|
|
- <a-input-number v-model="model.roomPrices[editPriceIndex].prefPrice" @change="batchPrice"></a-input-number>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align:center;color:#722ed1;height:60px;width:100px;">
|
|
|
+ <div>房号</div>
|
|
|
+ <div style="line-height:30px">
|
|
|
+ {{item.roomNo}}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align:center;color:#722ed1;height:60px">
|
|
|
+ <div>每日房价</div>
|
|
|
+ <div>
|
|
|
+ <a-input-number :placeholder="item.marketPrice.toString()" @change="batchPrice($event, index)"></a-input-number>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
</th>
|
|
|
- <th style="display:flex;flex-wrap:wrap;">
|
|
|
- <td v-for="(item, index) in editPriceData" :key="index">
|
|
|
+ <th style="display:flex;flex-wrap:wrap;height:60px;overflow: auto;">
|
|
|
+ <td v-for="(sItem, sIndex) in item.edit" :key="sIndex">
|
|
|
<div style="text-align:center;">
|
|
|
- {{item.day}}
|
|
|
+ {{sItem.day}}
|
|
|
</div>
|
|
|
<div>
|
|
|
- <a-input-number v-model="item.price"></a-input-number>
|
|
|
+ <a-input-number v-model="sItem.price" />
|
|
|
</div>
|
|
|
</td>
|
|
|
</th>
|
|
|
</table>
|
|
|
+ </template>
|
|
|
</a-modal>
|
|
|
<member-card-modal ref="modalMemberCardInfo"></member-card-modal>
|
|
|
<agreement-unit-modal ref="modalAgreementUnitInfo"></agreement-unit-modal>
|
|
|
@@ -1000,12 +1017,12 @@ const columns = [
|
|
|
{
|
|
|
title: "天数",
|
|
|
dataIndex: "day",
|
|
|
- width: 40,
|
|
|
+ width: 50,
|
|
|
},
|
|
|
{
|
|
|
title: "房费",
|
|
|
dataIndex: "roomFee",
|
|
|
- width: 60,
|
|
|
+ width: 80,
|
|
|
},
|
|
|
{
|
|
|
title: "押金",
|
|
|
@@ -1173,30 +1190,58 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
editPriceData() {
|
|
|
- let arr = [];
|
|
|
- arr.length = this.model.orderInfo.dayCount;
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- arr[i] = {
|
|
|
- day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
- price:
|
|
|
- (this.model.roomPrices[this.editPriceIndex] &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].prefPrice) ||
|
|
|
- 0,
|
|
|
- };
|
|
|
- let idx =
|
|
|
- this.model.roomPrices[this.editPriceIndex] &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime &&
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex(
|
|
|
- (item) => item == arr[i].day
|
|
|
- );
|
|
|
- if (idx > -1) {
|
|
|
- console.log(idx);
|
|
|
- arr[i].price =
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice[idx];
|
|
|
+ // let arr = [];
|
|
|
+ // arr.length = this.model.orderInfo.dayCount;
|
|
|
+ // for (let i = 0; i < arr.length; i++) {
|
|
|
+ // arr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:
|
|
|
+ // (this.model.roomPrices[this.editPriceIndex] &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].prefPrice) ||
|
|
|
+ // 0,
|
|
|
+ // };
|
|
|
+ // let idx =
|
|
|
+ // this.model.roomPrices[this.editPriceIndex] &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime &&
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime.findIndex(
|
|
|
+ // (item) => item == arr[i].day
|
|
|
+ // );
|
|
|
+ // if (idx > -1) {
|
|
|
+ // console.log(idx);
|
|
|
+ // arr[i].price = this.model.roomPrices[this.editPriceIndex].editPrice[idx];
|
|
|
+ // }
|
|
|
+ // arr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:0
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ let copy = JSON.parse(JSON.stringify(this.model.roomPrices));
|
|
|
+ for (let i = 0; i < copy.length; i++) {
|
|
|
+ let money = copy[i].prefPrice;
|
|
|
+ let brr = []
|
|
|
+ brr.length = this.model.orderInfo.dayCount;
|
|
|
+ for (let j = 0; j < brr.length; j++) {
|
|
|
+ brr[j] = {
|
|
|
+ day: this.addDate(this.model.orderInfo.arrivalTime2, j),
|
|
|
+ price:money
|
|
|
+ };
|
|
|
+ if (this.model.roomPrices[i].editPriceTime && this.model.roomPrices[i].editPriceTime.length > 0) {
|
|
|
+ let idx = this.model.roomPrices[i].editPriceTime.findIndex((item) => item == brr[j].day);
|
|
|
+ if (idx > -1) {
|
|
|
+ brr[j].price = this.model.roomPrices[i].editPrice[idx];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ // brr.fill({day: this.addDate(this.model.orderInfo.arrivalTime2, i),price:money})
|
|
|
+ // brr[i] = {
|
|
|
+ // day: this.addDate(this.model.orderInfo.arrivalTime2, i),
|
|
|
+ // price:money
|
|
|
+ // };
|
|
|
+ copy[i].edit = brr
|
|
|
+ copy[i].day = this.model.orderInfo.dayCount
|
|
|
}
|
|
|
- this.PriceData = arr;
|
|
|
- return arr;
|
|
|
+ this.PriceData = copy;
|
|
|
+ return copy;
|
|
|
},
|
|
|
|
|
|
formDisabled() {
|
|
|
@@ -1472,6 +1517,10 @@ export default {
|
|
|
// this.getcesRoomLayout();
|
|
|
},
|
|
|
methods: {
|
|
|
+ priceInput(e,idx,sidx){
|
|
|
+ console.log(e, idx, sidx);
|
|
|
+ this.editPriceData[idx].edit[sidx].price = e;
|
|
|
+ },
|
|
|
handleSearchAgreementUnit(value) {
|
|
|
let result;
|
|
|
if (!value) {
|
|
|
@@ -1713,9 +1762,12 @@ export default {
|
|
|
this.$refs.modalAgreementUnitTable.disableSubmit = true;
|
|
|
},
|
|
|
//批量调价
|
|
|
- batchPrice(e) {
|
|
|
+ batchPrice(e,index) {
|
|
|
console.log(e);
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // ele.price = e;
|
|
|
+ // });
|
|
|
+ this.editPriceData[index].edit.forEach((ele) => {
|
|
|
ele.price = e;
|
|
|
});
|
|
|
},
|
|
|
@@ -1743,7 +1795,7 @@ export default {
|
|
|
this.editPriceIndex = idx;
|
|
|
console.log(
|
|
|
"11111111111111111111111",
|
|
|
- this.model.roomPrices[this.editPriceIndex]
|
|
|
+ this.model.roomPrices
|
|
|
);
|
|
|
this.editPriceModal = true;
|
|
|
},
|
|
|
@@ -1753,24 +1805,57 @@ export default {
|
|
|
*/
|
|
|
editPriceOk() {
|
|
|
console.log(this.editPriceData);
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice = [];
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day);
|
|
|
- this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price);
|
|
|
- });
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime = [];
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPrice = [];
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPriceTime.push(ele.day);
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].editPrice.push(ele.price);
|
|
|
+ // });
|
|
|
+ // console.log(this.model.roomPrices);
|
|
|
+ // this.model.roomPrices[this.editPriceIndex].prefPrice =
|
|
|
+ // this.editPriceData[0].price;
|
|
|
+ // this.onCellChange(
|
|
|
+ // "prefPrice",
|
|
|
+ // this.editPriceIndex,
|
|
|
+ // this.editPriceData[0].price
|
|
|
+ // );
|
|
|
+ // this.editPriceData.forEach((ele) => {
|
|
|
+ // ele.price = 0;
|
|
|
+ // });
|
|
|
+ this.model.roomPrices = JSON.parse(JSON.stringify(this.editPriceData));
|
|
|
+ this.model.roomPrices.forEach((ele,index)=>{
|
|
|
+ ele.editPriceTime = [];
|
|
|
+ ele.editPrice = [];
|
|
|
+ ele.edit.forEach((t,tdx)=>{
|
|
|
+ // console.log(t.price);
|
|
|
+ ele.editPriceTime.push(t.day),
|
|
|
+ ele.editPrice.push(t.price)
|
|
|
+ this.onCellChange(
|
|
|
+ "prefPrice",
|
|
|
+ index,
|
|
|
+ ele.edit[tdx].price
|
|
|
+ );
|
|
|
+ })
|
|
|
+ ele.prefPrice = ele.edit[0].price;
|
|
|
+
|
|
|
+ })
|
|
|
+ // this.editPriceData.forEach((ele, index) => {
|
|
|
+ // if (this.model.roomPrices[index].roomId==ele.roomId) {
|
|
|
+ // this.model.roomPrices[index].editPriceTime = [];
|
|
|
+ // this.model.roomPrices[index].editPrice = [];
|
|
|
+ // ele.edit.forEach(t=>{
|
|
|
+ // this.model.roomPrices[index].editPriceTime.push(t.day);
|
|
|
+ // this.model.roomPrices[index].editPrice.push(t.price);
|
|
|
+ // this.model.roomPrices[index].prefPrice = ele.edit[0].price;
|
|
|
+ // })
|
|
|
+ // this.onCellChange(
|
|
|
+ // "prefPrice",
|
|
|
+ // index,
|
|
|
+ // ele.edit[0].price
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // });
|
|
|
console.log(this.model.roomPrices);
|
|
|
- this.model.roomPrices[this.editPriceIndex].prefPrice =
|
|
|
- this.editPriceData[0].price;
|
|
|
- this.onCellChange(
|
|
|
- "prefPrice",
|
|
|
- this.editPriceIndex,
|
|
|
- this.editPriceData[0].price
|
|
|
- );
|
|
|
- this.editPriceData.forEach((ele) => {
|
|
|
- ele.prcie = 0;
|
|
|
- });
|
|
|
- console.log(this.editPriceData);
|
|
|
this.editPriceModal = false;
|
|
|
|
|
|
var sum = 0;
|
|
|
@@ -1957,6 +2042,7 @@ export default {
|
|
|
this.editPriceOk();
|
|
|
i++;
|
|
|
});
|
|
|
+ console.log(this.model.roomPrices);
|
|
|
},
|
|
|
disabledDate(current) {
|
|
|
return current && current < moment().add(-1, "days").endOf("day");
|