| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <template>
- <a-card :bordered="false" :schemeId="schemeId">
- <a-radio-group v-model="tablemode" :style="{ marginBottom: '8px' }">
- <a-radio-button value="ordinaryDays">平日房价</a-radio-button>
- <a-radio-button value="weekend">周末房价</a-radio-button>
- </a-radio-group>
- <div>
- <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
- :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
- selectedRowKeys: selectedRowKeys,
- onChange: onSelectChange,
- }" class="j-table-force-nowrap" @change="handleTableChange"
- :rowKey="(record, index) => index + 1">
- <template slot="openSlot" slot-scope="text, record, index">
- <a-switch checked-children="开" un-checked-children="关" default-checked :checked="record.open == 1"
- @change="e=>changeOpenState(e,record)" />
- </template>
- <template slot="moneySlot" slot-scope="text, record">
- <div>
- <a-input-number v-model="record.money" :step="1" :min="0" :precision="2"
- @blur="onMoneyChange(record)" />
- </div>
- </template>
- <template slot="breakfastNumberSlot" slot-scope="text, record">
- <div>
- <a-input-number v-model="record.breakfastNumber" :step="1" :min="0" :precision="0"
- @blur="onNumberChange(record)" />
- </div>
- </template>
- <template slot="departureTimeSlot" slot-scope="text, record">
- <div>
- <a-time-picker :default-value="moment(record.departureTime, 'HH:mm')" format="HH:mm"
- @change="e=>onDepartureTimeChange(e,record)">
- </a-time-picker>
- </div>
- </template>
- <template slot="imgSlot" slot-scope="text, record">
- <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
- <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
- style="max-width: 80px; font-size: 12px; font-style: italic" />
- </template>
- <template slot="fileSlot" slot-scope="text">
- <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
- <a-button v-else :ghost="true" type="primary" icon="download" size="small"
- @click="downloadFile(text)">
- 下载
- </a-button>
- </template>
- <span slot="action" slot-scope="text, record">
- <a @click="handleReset(record)">重置</a>
- <a @click="handleMoney(record)">房价日历</a>
- </span>
- </a-table>
- </div>
- <house-price-scheme-layout-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-layout-modal>
- </a-card>
- </template>
- <script>
- import '@/assets/less/TableExpand.less'
- import { mixinDevice } from '@/utils/mixin'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import moment from 'moment';
- import { httpAction } from '@/api/manage'
- import HousePriceSchemeLayoutModal from "./housePriceSchemeLayout/housePriceSchemeLayoutModal";
- export default {
- name: 'housePriceSchemeDetailList',
- mixins:[JeecgListMixin, mixinDevice],
- components: {
- HousePriceSchemeLayoutModal
- },
- props: {
- schemeId: {
- type: String,
- default: () => {
- return ""
- }
- }
- },
- data () {
- return {
- description: '房价方案-房型关联表管理页面',
- // 表头
- columns: [
- {
- title: "序号",
- align: 'center',
- customRender: (text, record, index) => index + 1,
- },
- {
- title:'房型',
- align:"center",
- dataIndex: 'layoutName'
- },
- {
- title:'间数(间)1',
- align:"center",
- dataIndex: 'layoutName'
- },
- // {
- // title:'门市价',
- // align:"center",
- // dataIndex: 'layoutPrice'
- // },
- {
- title:'挂牌价(元)1',
- align:"center",
- dataIndex: 'layoutPrice'
- },
- {
- title:'前台价(散客)1',
- align:"center",
- dataIndex: 'layoutPrice'
- },
- {
- title:'微信小程序(散客)1',
- align:"center",
- dataIndex: 'layoutPrice'
- },
- {
- title:'钟点房间(元/小时)1',
- align:"center",
- dataIndex: 'layoutPrice'
- },
- // {
- // title:'执行房价',
- // align:"center",
- // dataIndex: 'money',
- // scopedSlots: {customRender: "moneySlot"},
- // },
- // {
- // title:'早餐数量',
- // align:"center",
- // dataIndex: 'breakfastNumber',
- // scopedSlots: {customRender: "breakfastNumberSlot"},
- // },
- // {
- // title:'默认离店时间',
- // align:"center",
- // dataIndex: 'departureTime',
- // // customRender:function (text) {
- // // return !text?"":(text.length>10?text.substr(0,10):text)
- // // },
- // scopedSlots: {customRender: "departureTimeSlot"},
- // },
- {
- title: '查看每日房价',
- dataIndex: 'action',
- align:"center",
- fixed:"right",
- width:147,
- scopedSlots: { customRender: 'action' }
- }
- ],
- url: {
- list: "/business/busHousePriceSchemeLayout/list",
- delete: "/business/busHousePriceSchemeLayout/delete",
- deleteBatch: "/business/busHousePriceSchemeLayout/deleteBatch",
- exportXlsUrl: "/business/busHousePriceSchemeLayout/exportXls",
- importExcelUrl: "business/busHousePriceSchemeLayout/importExcel",
- editMoney: "/business/busHousePriceSchemeLayout/editMoney",
- editNumber: "/business/busHousePriceSchemeLayout/editNumber",
- editTime: "/business/busHousePriceSchemeLayout/editTime",
- },
- dictOptions:{},
- superFieldList:[],
- queryParam: {
- schemeId: this.schemeId
- },
- tablemode: 'ordinaryDays'
- }
- },
- created() {
- this.getSuperFieldList();
- },
- computed: {
- importExcelUrl: function(){
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
- },
- },
- methods: {
- moment,
- initDictConfig(){
- },
- getSuperFieldList(){
- let fieldList=[];
- fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
- fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
- fieldList.push({type:'string',value:'schemeId',text:'关联房价方案'})
- fieldList.push({type:'string',value:'layoutId',text:'关联房型'})
- fieldList.push({type:'number',value:'money',text:'执行房价'})
- fieldList.push({type:'date',value:'departureTime',text:'默认离店时间'})
- fieldList.push({type:'int',value:'breakfastNumber',text:'早餐数量'})
- fieldList.push({type:'int',value:'lunchNumber',text:'中餐数量'})
- fieldList.push({type:'int',value:'dinnerNumber',text:'晚餐数量'})
- fieldList.push({type:'int',value:'delFlag',text:'删除状态'})
- this.superFieldList = fieldList
- },
- onMoneyChange(record){
- var that = this;
- //修改执行房价
- var param = {
- money: record.money,
- id: record.id
- }
- console.log(param)
- httpAction(this.url.editMoney, param, 'post').then((res) => {
- if (res.success) {
- that.$message.success('操作成功')
- that.$emit('ok')
- } else {
- that.$message.warning(res.message)
- }
- }).finally(() => {
- that.confirmLoading = false
- })
- },
- onNumberChange(record){
- //修改早餐数量
- var that = this;
- var param = {
- breakfastNumber: record.breakfastNumber,
- id: record.id
- }
- console.log(param)
- httpAction(this.url.editNumber, param, 'post').then((res) => {
- if (res.success) {
- that.$message.success('操作成功')
- that.$emit('ok')
- } else {
- that.$message.warning(res.message)
- }
- }).finally(() => {
- that.confirmLoading = false
- })
- },
- onDepartureTimeChange(e,record){
- var _time = moment(new Date(e)).format('HH:mm:ss')
- console.log(_time)
- //修改时间
- var that = this;
- var param = {
- departureTime: _time,
- id: record.id
- }
- console.log(param)
- httpAction(this.url.editTime, param, 'post').then((res) => {
- if (res.success) {
- that.$message.success('操作成功')
- that.$emit('ok')
- } else {
- that.$message.warning(res.message)
- }
- }).finally(() => {
- that.confirmLoading = false
- })
- },
- handleMoney(record){
- this.$refs.modalForm.title="每日房价"
- this.$refs.modalForm.visible = true
- this.$refs.modalForm.edit(record);
- },
- // 重置按钮
- handleReset() {
-
- }
- }
- }
- </script>
- <style scoped>
- </style>
|