|
|
@@ -12,7 +12,12 @@
|
|
|
<!-- </div>-->
|
|
|
<!-- </template>-->
|
|
|
<!-- </a-calendar>-->
|
|
|
- <div>
|
|
|
+<!-- <ul class="events">-->
|
|
|
+ <!-- <li v-for="item in getListData(value)" :key="item.content">-->
|
|
|
+ <!-- <a-badge :status="'success'" :text="item.classify_rname +'('+item.num+')'" />-->
|
|
|
+ <!-- </li>-->
|
|
|
+ <!-- </ul>-->
|
|
|
+ <!-- <div>
|
|
|
<a-calendar style="background: #fff" @select="handleSelecrt" @panelChange="onPanelChange" :header-render="headerRender">
|
|
|
<div slot="dateFullCellRender" slot-scope="value" class="ant-fullcalendar-date" :class="{'ant-fullcalendar-date-has-content':getListData(value).length>0}">
|
|
|
<div class="ant-fullcalendar-value">{{getCaledarDate(value)}}</div>
|
|
|
@@ -22,19 +27,65 @@
|
|
|
{{item.content}}
|
|
|
</a-button>
|
|
|
</div>
|
|
|
- <!-- <ul class="events">-->
|
|
|
- <!-- <li v-for="item in getListData(value)" :key="item.content">-->
|
|
|
- <!-- <a-badge :status="'success'" :text="item.classify_rname +'('+item.num+')'" />-->
|
|
|
- <!-- </li>-->
|
|
|
- <!-- </ul>-->
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
- </a-calendar>
|
|
|
+ </a-calendar> -->
|
|
|
|
|
|
<a-modal v-model="visibleMoney" title="修改房价" @ok="handleOk" :width="300">
|
|
|
<a-input-number style="width: 100%;margin: auto" v-model="updateMoney" :min="0" :precision="2" />
|
|
|
</a-modal>
|
|
|
- </div>
|
|
|
+ <!-- </div> -->
|
|
|
+ <a-table :columns="columns" :alert="true" :data-source="calendarData" :rowKey="(record, index) => index + 1">
|
|
|
+ <!-- 111 -->
|
|
|
+ <!-- <template slot="layoutName" slot-scope="text, record">
|
|
|
+ <a-button type="primary">Primary Button</a-button>
|
|
|
+ </template> -->
|
|
|
+ <!-- <div slot-scope="text, record" v-for="item in columns"> -->
|
|
|
+ <template v-for="item in columns" :slot="item.dataIndex" slot-scope="text, record">
|
|
|
+ <!-- {{ }} -->
|
|
|
+ <div :class="isWeekend(new Date(item.dataIndex)) ? 'cell_style' : 'cell_stylez'">
|
|
|
+ <!-- <div class="cell_style"> -->
|
|
|
+ {{ record[item.dataIndex] }}
|
|
|
+ <!-- <a-button block></a-button> -->
|
|
|
+ </div>
|
|
|
+ <!-- <a-button type="primary">Primary Button</a-button> -->
|
|
|
+ </template>
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <template slot-scope="text, record">
|
|
|
+ -->
|
|
|
+ <!-- 111 -->
|
|
|
+ <!-- <template :slot="item.dataIndex" slot-scope="text, record">
|
|
|
+ 111
|
|
|
+ </template> -->
|
|
|
+ <!-- {{ record[index] }}111 -->
|
|
|
+ <!-- {{ record[index] = 1 }} -->
|
|
|
+
|
|
|
+ <!-- <template :slot="record[index]" slot-scope="text, record">
|
|
|
+ {{ record[index] }}
|
|
|
+ </template>
|
|
|
+ <template :slot="record[index]" slot-scope="text, record">
|
|
|
+ {{ record[index] }}
|
|
|
+ </template>
|
|
|
+ <template :slot="record[index]" slot-scope="text, record">
|
|
|
+ {{ record[index] }}
|
|
|
+ </template> -->
|
|
|
+ <!-- </div>
|
|
|
+ </template> -->
|
|
|
+ <!-- <template slot-scope="scopes">
|
|
|
+ {{ calendarData }}
|
|
|
+ <div v-for="item in scopes">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+
|
|
|
+
|
|
|
+ <!-- {{ record.dataIndex }} -->
|
|
|
+ <!-- <div>
|
|
|
+ 111
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ </a-table>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -59,6 +110,15 @@
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '房型',
|
|
|
+ dataIndex: 'layoutName',
|
|
|
+ scopedSlots: { customRender: 'layoutName' }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 表格数据
|
|
|
+ calendarData: [],
|
|
|
labelCol: {
|
|
|
xs: { span: 24 },
|
|
|
sm: { span: 5 },
|
|
|
@@ -131,26 +191,126 @@
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
- this.getDateList()
|
|
|
+ // this.getDateList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 修改价格
|
|
|
+ // editPrice(record,item) {
|
|
|
+ // console.log(record);
|
|
|
+ // console.log(item);
|
|
|
+ // this.visibleMoney = true
|
|
|
+ // },
|
|
|
// 获取数据
|
|
|
- getDateList() {
|
|
|
+ async getDateList() {
|
|
|
console.log(this.dataSource);
|
|
|
- getAction('/business/busHousePriceSchemeLayout/layoutPricePage', {
|
|
|
+ await getAction('/business/busHousePriceSchemeLayout/layoutPricePage', {
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
schemeId: this.model.schemeId
|
|
|
}).then(res => {
|
|
|
console.log(res);
|
|
|
+ if (res.success) {
|
|
|
+ let tmeplist = res.result.records
|
|
|
+ let tempcol = []
|
|
|
+ tmeplist[0].schemeLayoutDailyPriceList.forEach(index => {
|
|
|
+ let tempindex = {
|
|
|
+ title: index.date,
|
|
|
+ // schemeLayoutId: schemeLayoutId,
|
|
|
+ dataIndex: index.date,
|
|
|
+ align: 'center',
|
|
|
+ // key: 'key',
|
|
|
+ // customCell: (record) => {
|
|
|
+ // for (let item in record) {
|
|
|
+ // const d1 = new Date(item);
|
|
|
+ // let tempcolor = this.isWeekend(d1)
|
|
|
+ // console.log(tempcolor);
|
|
|
+ // if (tempcolor) {
|
|
|
+ // return {
|
|
|
+ // style:{
|
|
|
+ // color:'red'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ 'scopedSlots': { 'customRender': index.date }
|
|
|
+ // customRender(text, record) {
|
|
|
+ // // return record.layoutPrice
|
|
|
+ // record.forEach(item => {
|
|
|
+
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const d1 = new Date(item);
|
|
|
+ // let tempcolor = this.isWeekend(d1)
|
|
|
+ }
|
|
|
+ tempcol.push(tempindex)
|
|
|
+ });
|
|
|
+ // console.log(tempcol);
|
|
|
+ this.columns = this.columns.concat(tempcol)
|
|
|
+ // console.log(this.columns);
|
|
|
+ let temprol = []
|
|
|
+ tmeplist.forEach(item => {
|
|
|
+ console.log(item);
|
|
|
+ // let
|
|
|
+ let tempindex = {}
|
|
|
+ item.schemeLayoutDailyPriceList.forEach(index => {
|
|
|
+ // var tempdate = index.date
|
|
|
+ // tempindex = {
|
|
|
+ tempindex[index.date] = index.money
|
|
|
+ tempindex['schemeLayoutId'] = index.schemeLayoutId
|
|
|
+ tempindex['layoutName'] = item.layoutName
|
|
|
+ // tempdate: index.money,
|
|
|
+ // dataIndex: ,
|
|
|
+ // schemeLayoutId: index.schemeLayoutId
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ temprol.push(tempindex)
|
|
|
+ });
|
|
|
+ console.log(temprol);
|
|
|
+ console.log(this.columns);
|
|
|
+ this.calendarData = temprol
|
|
|
+ // temprol.forEach(cust => [
|
|
|
+
|
|
|
+ // ])
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
+ // 处理周末
|
|
|
+ isWeekend(date = new Date()) {
|
|
|
+ return date.getDay() === 6 || date.getDay() === 0;
|
|
|
+ },
|
|
|
+ // // 处理周末
|
|
|
+ // exitCustomRow(record, index) {
|
|
|
+ // console.log(record);
|
|
|
+ // for (let item in record) {
|
|
|
+ // console.log(item);
|
|
|
+ // const d1 = new Date(item);
|
|
|
+ // let tempcolor = this.isWeekend(d1)
|
|
|
+ // // console.log(this.isWeekend(d1));
|
|
|
+ // console.log(tempcolor);
|
|
|
+ // if (this.isWeekend(d1)) {
|
|
|
+ // // console.log(123);
|
|
|
+ // return 'table-color-dust'
|
|
|
+ // }
|
|
|
+ // // if (!this.isWeekend(d1)) {
|
|
|
+ // // // console.log(123);
|
|
|
+ // // return {
|
|
|
+ // // style: {
|
|
|
+ // // background: 'red',
|
|
|
+ // // },
|
|
|
+ // // }
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
+ // console.log(index);
|
|
|
+ // },
|
|
|
edit (record) {
|
|
|
console.log(record);
|
|
|
this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
this.schemeLayoutId = record.id
|
|
|
+ this.getDateList()
|
|
|
},
|
|
|
+
|
|
|
handleMoney(e,value,item){
|
|
|
var _time = moment(new Date(value)).format('YYYY-MM-DD 00:00:00')
|
|
|
this.visibleMoney = true
|
|
|
@@ -472,4 +632,15 @@
|
|
|
letter-spacing: 5px;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+ .table-color-dust {
|
|
|
+ background-color: #F5222D;
|
|
|
+ }
|
|
|
+ .cell_style {
|
|
|
+ color: red !important;
|
|
|
+ /* color: #f6de90; */
|
|
|
+ }
|
|
|
+ .cell_stylez {
|
|
|
+ color: #000 !important;
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|