|
@@ -1,746 +0,0 @@
|
|
|
-<template>
|
|
|
|
|
- <div class>
|
|
|
|
|
- <el-form
|
|
|
|
|
- :model="formData"
|
|
|
|
|
- :rules="rules"
|
|
|
|
|
- ref="form"
|
|
|
|
|
- label-width="100px"
|
|
|
|
|
- label-position="right"
|
|
|
|
|
- size="small"
|
|
|
|
|
- style="max-width:810px;"
|
|
|
|
|
- >
|
|
|
|
|
- <el-form-item prop="contractNumber" label="退宿方式">
|
|
|
|
|
- <el-radio-group v-model="info.residenceType">
|
|
|
|
|
- <el-radio-button v-for="(item, index) in residenceTypeOptions" :key="index" :label="item.value"
|
|
|
|
|
- >{{ item.label }}
|
|
|
|
|
- </el-radio-button>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="contractNumber" label="合同编号">
|
|
|
|
|
- <el-input disabled v-model="info.contractNumber" style="width:215px"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- prop="InformAgreementNo"
|
|
|
|
|
- :label="info.residenceType == 'RETIREMENT' ? '补充协议编号' : '告知函编号'"
|
|
|
|
|
- >
|
|
|
|
|
- <el-input v-model="info.InformAgreementNo"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="residenceTime" label="退宿时间">
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
- v-model="info.residenceTime"
|
|
|
|
|
- type="datetime"
|
|
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
- placeholder="选择日期时间"
|
|
|
|
|
- ></el-date-picker>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="退宿房型" v-if="info.residenceType == 'RETIREMENT'">
|
|
|
|
|
- <div
|
|
|
|
|
- class="stepInfo"
|
|
|
|
|
- v-for="(contractStore, index) in formData.contractStoreList"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- style="width:360px"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="step-title">门店{{ index + 1 }}</div>
|
|
|
|
|
-
|
|
|
|
|
- <el-form label-width="80px" label-position="left">
|
|
|
|
|
- <el-form-item class="form-item" label="门店名称">
|
|
|
|
|
- <el-select
|
|
|
|
|
- filterable
|
|
|
|
|
- v-model="contractStore.storeId"
|
|
|
|
|
- @change="getRoomTyeInfo(contractStore, index)"
|
|
|
|
|
- disabled
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in storeInfo"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :label="item.storeName"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- prop="monthlyRent"
|
|
|
|
|
- label="月租金"
|
|
|
|
|
- v-if="formData.checkInType == 'INDIVIDUAL' || formData.checkInType == 'TEAM_POST_PAID'"
|
|
|
|
|
- >
|
|
|
|
|
- <el-input-number type="number" v-model="contractStore.monthlyRent"></el-input-number>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- prop="monthlyRent"
|
|
|
|
|
- label="日租金"
|
|
|
|
|
- v-if="formData.checkInType == 'INDIVIDUAL' || formData.checkInType == 'TEAM_POST_PAID'"
|
|
|
|
|
- >
|
|
|
|
|
- <el-input-number type="number" v-model="contractStore.dayRent"></el-input-number>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- prop="monthlyRent"
|
|
|
|
|
- label="日租金最大天数"
|
|
|
|
|
- v-if="formData.checkInType == 'INDIVIDUAL' || formData.checkInType == 'TEAM_POST_PAID'"
|
|
|
|
|
- >
|
|
|
|
|
- <el-input-number type="number" v-model="contractStore.daySize"></el-input-number>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label="房型信息"
|
|
|
|
|
- v-if="formData.checkInType == 'TEAM' || formData.checkInType == 'SCATTERED_BEDS'"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="houseInfo" v-for="(room, index) in contractStore.roomTypes" :key="index">
|
|
|
|
|
- <div class="step-title">房型{{ index + 1 }}</div>
|
|
|
|
|
- <el-form-item label="房间类型" class="form-item">
|
|
|
|
|
- <el-select
|
|
|
|
|
- filterable
|
|
|
|
|
- v-model="room.roomTypeId"
|
|
|
|
|
- @change="setRoomBeds(contractStore, room)"
|
|
|
|
|
- disabled
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in contractStore.roomTypeInfo"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :label="item.typeName"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="床位数" class="form-item">
|
|
|
|
|
- <el-input-number
|
|
|
|
|
- type="number"
|
|
|
|
|
- v-model="room.beds"
|
|
|
|
|
- @change="getMoney"
|
|
|
|
|
- :max="room.maxBeds"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- ></el-input-number>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="单价" class="form-item">
|
|
|
|
|
- <el-input-number disabled type="number" v-model="room.price"></el-input-number>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="surplusRoomFee" label="剩余房费">
|
|
|
|
|
- <el-input type="number" v-model="info.surplusRoomFee" disabled></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="deposit" label="押金">
|
|
|
|
|
- <el-input type="number" v-model="info.deposit" disabled></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="falsifyType" label="违约金方式">
|
|
|
|
|
- <!-- <el-input type="number" v-model="info.falsifyType"></el-input> -->
|
|
|
|
|
- <el-select v-model="info.falsifyType" placeholder="请选择违约金方式">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in falsifyTypes"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="rent" label="金额">
|
|
|
|
|
- <el-input type="number" v-model="info.rent"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="residenceReason" label="退宿原因">
|
|
|
|
|
- <el-input v-model="info.residenceReason"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="customerLoss" label="客户是否流失">
|
|
|
|
|
- <el-select v-model="info.customerLoss" clearable filterable placeholder="请选择">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in customerLossOptions"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item prop="attach" :label="info.residenceType == 'RETIREMENT' ? '上传补充协议' : '上传告知函'">
|
|
|
|
|
- <el-upload
|
|
|
|
|
- drag
|
|
|
|
|
- class="single-upload"
|
|
|
|
|
- :action="uploadUrl"
|
|
|
|
|
- :show-file-list="true"
|
|
|
|
|
- :on-success="onSuccess"
|
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
|
- :limit="1"
|
|
|
|
|
- multiple
|
|
|
|
|
- >
|
|
|
|
|
- <div></div>
|
|
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
|
|
- <div class="el-upload__text">
|
|
|
|
|
- 将文件拖到此处,或
|
|
|
|
|
- <em>点击上传</em>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-upload>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
|
|
|
|
|
- <el-button @click="close">取消</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </div>
|
|
|
|
|
-</template>
|
|
|
|
|
-<script>
|
|
|
|
|
-import resolveUrl from 'resolve-url';
|
|
|
|
|
-import { addSeconds, parse } from 'date-fns';
|
|
|
|
|
-
|
|
|
|
|
-export default {
|
|
|
|
|
- name: 'ContractEdit',
|
|
|
|
|
- created() {
|
|
|
|
|
- this.uploadUrl = resolveUrl(this.$baseUrl, 'upload/file');
|
|
|
|
|
-
|
|
|
|
|
- this.getStoreInfo();
|
|
|
|
|
-
|
|
|
|
|
- this.info = {
|
|
|
|
|
- ...this.residenceData,
|
|
|
|
|
- residenceTime: '',
|
|
|
|
|
- falsifyType: 1,
|
|
|
|
|
- attach: ''
|
|
|
|
|
- };
|
|
|
|
|
- this.getMoney();
|
|
|
|
|
- },
|
|
|
|
|
- props: {
|
|
|
|
|
- residenceData: {
|
|
|
|
|
- type: Object,
|
|
|
|
|
- default: () => {
|
|
|
|
|
- return {};
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- watch: {
|
|
|
|
|
- residenceData() {
|
|
|
|
|
- this.info = {
|
|
|
|
|
- ...this.residenceData,
|
|
|
|
|
- residenceTime: '',
|
|
|
|
|
- falsifyType: 1,
|
|
|
|
|
- attach: ''
|
|
|
|
|
- };
|
|
|
|
|
- this.getMoney();
|
|
|
|
|
- },
|
|
|
|
|
- 'info.residenceType'() {
|
|
|
|
|
- this.getMoney();
|
|
|
|
|
- },
|
|
|
|
|
- 'info.residenceTime'() {
|
|
|
|
|
- this.getMoney();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- saving: false,
|
|
|
|
|
- showCycle: false,
|
|
|
|
|
- uploadUrl: '',
|
|
|
|
|
- loading: false,
|
|
|
|
|
- imageUrl: '',
|
|
|
|
|
- text: '',
|
|
|
|
|
- textarea: '',
|
|
|
|
|
- saleEdit: false, //disables 为false
|
|
|
|
|
- formData: {
|
|
|
|
|
- bedsAmount: 0,
|
|
|
|
|
- bet: 1,
|
|
|
|
|
- checkInType: 'TEAM',
|
|
|
|
|
- bills: [],
|
|
|
|
|
- contactList: [],
|
|
|
|
|
- contractStoreList: [
|
|
|
|
|
- {
|
|
|
|
|
- fixedFeeTypes: [],
|
|
|
|
|
- storeId: '',
|
|
|
|
|
- freeFeeTypes: [],
|
|
|
|
|
- roomTypeInfo: [],
|
|
|
|
|
- roomTypes: [],
|
|
|
|
|
- reserveRooms: []
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- monthlyRent: 0,
|
|
|
|
|
- deposit: 0,
|
|
|
|
|
- contractMonthly: 0,
|
|
|
|
|
- contractDays: 0
|
|
|
|
|
- },
|
|
|
|
|
- rules: {
|
|
|
|
|
- residenceTime: [{ required: true, message: '请填写退宿时间', trigger: 'blur' }]
|
|
|
|
|
- },
|
|
|
|
|
- CustomerCooperationType: [
|
|
|
|
|
- {
|
|
|
|
|
- value: 'TEAM',
|
|
|
|
|
- label: '团队包房'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: 'SCATTERED_BEDS',
|
|
|
|
|
- label: '团队床位'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: 'TEAM_POST_PAID',
|
|
|
|
|
- label: '团散'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: 'INDIVIDUAL',
|
|
|
|
|
- label: '散客'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- saleUser: [],
|
|
|
|
|
- storeInfo: [],
|
|
|
|
|
- roomTyeInfo: [],
|
|
|
|
|
- personalFeeTypes: [],
|
|
|
|
|
- contractId: 0,
|
|
|
|
|
- residenceTypeOptions: [
|
|
|
|
|
- { value: 'AllRETIREMENT', label: '全部退宿' },
|
|
|
|
|
- { value: 'RETIREMENT', label: '部分退宿' }
|
|
|
|
|
- // { value: 'BREAK_STOP', label: '违约' }
|
|
|
|
|
- ],
|
|
|
|
|
- falsifyTypes: [
|
|
|
|
|
- { value: 1, label: '房费' },
|
|
|
|
|
- { value: 2, label: '押金' }
|
|
|
|
|
- ],
|
|
|
|
|
- info: {
|
|
|
|
|
- contractNumber: '',
|
|
|
|
|
- residenceRoomType: '',
|
|
|
|
|
- residenceTime: '',
|
|
|
|
|
- residenceType: 'AllRETIREMENT',
|
|
|
|
|
- residenceReason: '',
|
|
|
|
|
- customerLoss: ''
|
|
|
|
|
- },
|
|
|
|
|
- customerLossOptions: [
|
|
|
|
|
- { value: 'YES', label: '是' },
|
|
|
|
|
- { value: 'NO', label: '否' }
|
|
|
|
|
- ]
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- days() {
|
|
|
|
|
- var day = 0;
|
|
|
|
|
- if (this.info.residenceTime) {
|
|
|
|
|
- var bills = [...this.bills];
|
|
|
|
|
- for (var i = 0; i < bills.length; i++) {
|
|
|
|
|
- var time1 = addSeconds(parse(bills[i].endTime, 'yyyy-MM-dd HH:mm:ss', new Date()), 1).getTime();
|
|
|
|
|
- var time2 = parse(this.info.residenceTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime();
|
|
|
|
|
- console.log(time1);
|
|
|
|
|
- console.log(time2);
|
|
|
|
|
- if (time1 > time2) {
|
|
|
|
|
- day = (time1 - time2) / 3600 / 24 / 1000;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return day;
|
|
|
|
|
- },
|
|
|
|
|
- bills() {
|
|
|
|
|
- return this.formData.bills || [];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- getMoney() {
|
|
|
|
|
- var money = 0;
|
|
|
|
|
- var list = [...this.formData.contractStoreList];
|
|
|
|
|
- list.forEach(item => {
|
|
|
|
|
- console.log(item);
|
|
|
|
|
- if (item.roomTypes) {
|
|
|
|
|
- item.roomTypes.forEach(room => {
|
|
|
|
|
- var unitPrice = this.Div(room.price, 30);
|
|
|
|
|
- var price = this.Mul(unitPrice, this.days);
|
|
|
|
|
- if (this.info.residenceType == 'RETIREMENT') {
|
|
|
|
|
- money = this.Add(money, this.Mul(price, room.beds));
|
|
|
|
|
- } else {
|
|
|
|
|
- money = this.Add(money, this.Mul(price, room.maxBeds));
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- // var payMoney = 0;
|
|
|
|
|
- // if (this.formData.pay) {
|
|
|
|
|
- // payMoney = this.Mul(this.formData.pay, this.formData.monthlyRent);
|
|
|
|
|
- // }
|
|
|
|
|
- // money = this.Sub(payMoney, money);
|
|
|
|
|
-
|
|
|
|
|
- this.info.surplusRoomFee = Number(money.toFixed(2));
|
|
|
|
|
- },
|
|
|
|
|
- refreash() {
|
|
|
|
|
- if (this.residenceData.contractId) {
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/contract/get/${this.residenceData.contractId}`)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.getUser();
|
|
|
|
|
- if (!res.contactList) {
|
|
|
|
|
- res.push({
|
|
|
|
|
- contactList: [
|
|
|
|
|
- {
|
|
|
|
|
- name: '',
|
|
|
|
|
- mobile: ''
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- if (!res.contractStoreList) {
|
|
|
|
|
- res.push({
|
|
|
|
|
- contractStoreList: [
|
|
|
|
|
- {
|
|
|
|
|
- storeId: '',
|
|
|
|
|
- personalFeeTypes: [],
|
|
|
|
|
- roomTypes: [
|
|
|
|
|
- {
|
|
|
|
|
- price: '',
|
|
|
|
|
- beds: '',
|
|
|
|
|
- storeId: '',
|
|
|
|
|
- roomTypeId: '',
|
|
|
|
|
- reserveRooms: [],
|
|
|
|
|
- maxBeds: 0
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- for (var i = res.contractStoreList.length - 1; i >= 0; i--) {
|
|
|
|
|
- let index = i;
|
|
|
|
|
- if (!res.contractStoreList[index].storeId) {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- let query = {
|
|
|
|
|
- query: {
|
|
|
|
|
- storeId: res.contractStoreList[index].storeId
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/roomTypeInfo/getChooseAll`, {
|
|
|
|
|
- size: 1000,
|
|
|
|
|
- query: { storeId: res.contractStoreList[index].storeId }
|
|
|
|
|
- })
|
|
|
|
|
- .then(room => {
|
|
|
|
|
- res.contractStoreList[index].roomTypeInfo = room.content;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- //减免项信息
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/personalFeeType/all`, query)
|
|
|
|
|
- .then(per => {
|
|
|
|
|
- res.contractStoreList[index].personalFeeTypesData = per.content;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- res.contractStoreList.forEach(item => {
|
|
|
|
|
- if (item.roomTypes) {
|
|
|
|
|
- item.roomTypes.forEach(room => {
|
|
|
|
|
- room.maxBeds = room.beds;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- this.formData = res;
|
|
|
|
|
-
|
|
|
|
|
- this.getMoney();
|
|
|
|
|
- if (this.$route.query.firstContractNumber) {
|
|
|
|
|
- this.formData.contractNumber = '';
|
|
|
|
|
- this.$delete(this.formData, 'id');
|
|
|
|
|
- this.formData.firstContractNumber = this.$route.query.firstContractNumber;
|
|
|
|
|
- this.showCycle = false;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- console.log(e);
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getUser() {
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get('/user/my')
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.position != '销售经理') {
|
|
|
|
|
- this.saleEdit = true;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- setRoomBeds(contractStore, room) {
|
|
|
|
|
- console.log('setRoomBeds');
|
|
|
|
|
- var index = this.formData.contractStoreList.indexOf(contractStore);
|
|
|
|
|
-
|
|
|
|
|
- var roomIndex = this.formData.contractStoreList[index].roomTypes.indexOf(room);
|
|
|
|
|
-
|
|
|
|
|
- var roomType = {};
|
|
|
|
|
-
|
|
|
|
|
- var storeList = [...contractStore.roomTypeInfo];
|
|
|
|
|
- storeList.forEach(item => {
|
|
|
|
|
- if (item.id == room.roomTypeId) {
|
|
|
|
|
- roomType = item;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- this.formData.contractStoreList[index].roomTypes[roomIndex].beds = roomType.bedCount;
|
|
|
|
|
- },
|
|
|
|
|
- getRoomTyeInfo(room, index) {
|
|
|
|
|
- //房型信息
|
|
|
|
|
- let query = {
|
|
|
|
|
- size: 1000,
|
|
|
|
|
- query: { storeId: room.storeId }
|
|
|
|
|
- };
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/roomTypeInfo/getChooseAll`, query)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- var index = this.formData.contractStoreList.indexOf(room);
|
|
|
|
|
- this.formData.contractStoreList[index].roomTypeInfo = res.content;
|
|
|
|
|
- console.log(this.formData.contractStoreList[index].roomTypeInfo);
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- this.formData.contractStoreList[index].personalFeeTypes = [];
|
|
|
|
|
- this.formData.contractStoreList[index].reserveRooms = [];
|
|
|
|
|
- this.formData.contractStoreList[index].roomTypes = [];
|
|
|
|
|
- },
|
|
|
|
|
- getRoomInfo(room, index) {
|
|
|
|
|
- //房型信息
|
|
|
|
|
- let query = {
|
|
|
|
|
- query: { storeId: room.storeId }
|
|
|
|
|
- };
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/roomTypeInfo/getChooseAll`, query)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- var index = this.formData.contractStoreList.indexOf(room);
|
|
|
|
|
- this.formData.contractStoreList[index].roomTypeInfo = res.content;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- this.formData.contractStoreList[index].personalFeeTypes = [];
|
|
|
|
|
- this.formData.contractStoreList[index].reserveRooms = [];
|
|
|
|
|
- },
|
|
|
|
|
- getStoreInfo() {
|
|
|
|
|
- this.$http
|
|
|
|
|
- .get(`/storeInfo/all`, { size: 1000 })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.storeInfo = res.content;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- onSave() {
|
|
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- this.submit();
|
|
|
|
|
- } else {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- submit() {
|
|
|
|
|
- this.$store.commit('updateFetchingData', true);
|
|
|
|
|
- let data = { ...this.info, residenceRoomTypes: [], contractStoreList: [], roomTypes: [] };
|
|
|
|
|
- if (this.info.residenceType == 'RETIREMENT') {
|
|
|
|
|
- var list = [...this.formData.contractStoreList];
|
|
|
|
|
- var residenceRoomTypes = [];
|
|
|
|
|
- list.forEach(item => {
|
|
|
|
|
- if (item.roomTypes) {
|
|
|
|
|
- item.roomTypes.forEach(room => {
|
|
|
|
|
- residenceRoomTypes.push({
|
|
|
|
|
- contractRoomId: room.id,
|
|
|
|
|
- residenceBeds: room.beds,
|
|
|
|
|
- storeId: room.storeId
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- data.residenceRoomTypes = residenceRoomTypes;
|
|
|
|
|
- }
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- this.$http
|
|
|
|
|
- .post('/residence/save', data, { body: 'json' })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.$store.commit('updateFetchingData', false);
|
|
|
|
|
- this.$message.success('成功');
|
|
|
|
|
- this.$emit('close');
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- this.$store.commit('updateFetchingData', false);
|
|
|
|
|
- console.log(e);
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- close() {
|
|
|
|
|
- this.$emit('close');
|
|
|
|
|
- },
|
|
|
|
|
- onSuccess(res, file) {
|
|
|
|
|
- this.info.attach = res;
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- this.imageUrl = URL.createObjectURL(file.raw);
|
|
|
|
|
- var newVal = '';
|
|
|
|
|
- if (res instanceof Array) {
|
|
|
|
|
- newVal = res[0];
|
|
|
|
|
- } else {
|
|
|
|
|
- newVal = res;
|
|
|
|
|
- }
|
|
|
|
|
- this.$emit('input', newVal);
|
|
|
|
|
- },
|
|
|
|
|
- onError(err, file, fileList) {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- },
|
|
|
|
|
- beforeUpload(file) {
|
|
|
|
|
- this.loading = true;
|
|
|
|
|
- return true;
|
|
|
|
|
- },
|
|
|
|
|
- Add(arg1, arg2) {
|
|
|
|
|
- (arg1 = arg1.toString()), (arg2 = arg2.toString());
|
|
|
|
|
- var arg1Arr = arg1.split('.'),
|
|
|
|
|
- arg2Arr = arg2.split('.'),
|
|
|
|
|
- d1 = arg1Arr.length == 2 ? arg1Arr[1] : '',
|
|
|
|
|
- d2 = arg2Arr.length == 2 ? arg2Arr[1] : '';
|
|
|
|
|
- var maxLen = Math.max(d1.length, d2.length);
|
|
|
|
|
- var m = Math.pow(10, maxLen);
|
|
|
|
|
- var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen));
|
|
|
|
|
- var d = arguments[2];
|
|
|
|
|
- return typeof d === 'number' ? Number(result.toFixed(d)) : result;
|
|
|
|
|
- },
|
|
|
|
|
- /*
|
|
|
|
|
- 函数:减法函数,用来得到精确的减法结果
|
|
|
|
|
- 说明:函数返回较为精确的减法结果。
|
|
|
|
|
- 参数:arg1:第一个加数;arg2第二个加数;d要保留的小数位数(可以不传此参数,如果不传则不处理小数位数
|
|
|
|
|
- 调用:Calc.Sub(arg1,arg2)
|
|
|
|
|
- 返回值:两数相减的结果
|
|
|
|
|
- */
|
|
|
|
|
- Sub(arg1, arg2) {
|
|
|
|
|
- return this.Add(arg1, -Number(arg2), arguments[2]);
|
|
|
|
|
- },
|
|
|
|
|
- /*
|
|
|
|
|
- 函数:乘法函数,用来得到精确的乘法结果
|
|
|
|
|
- 说明:函数返回较为精确的乘法结果。
|
|
|
|
|
- 参数:arg1:第一个乘数;arg2第二个乘数;d要保留的小数位数(可以不传此参数,如果不传则不处理小数位数)
|
|
|
|
|
- 调用:Calc.Mul(arg1,arg2)
|
|
|
|
|
- 返回值:两数相乘的结果
|
|
|
|
|
- */
|
|
|
|
|
- Mul(arg1, arg2) {
|
|
|
|
|
- var r1 = arg1.toString(),
|
|
|
|
|
- r2 = arg2.toString(),
|
|
|
|
|
- m,
|
|
|
|
|
- resultVal,
|
|
|
|
|
- d = arguments[2];
|
|
|
|
|
- m = (r1.split('.')[1] ? r1.split('.')[1].length : 0) + (r2.split('.')[1] ? r2.split('.')[1].length : 0);
|
|
|
|
|
- resultVal = (Number(r1.replace('.', '')) * Number(r2.replace('.', ''))) / Math.pow(10, m);
|
|
|
|
|
- return typeof d !== 'number' ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d)));
|
|
|
|
|
- },
|
|
|
|
|
- /*
|
|
|
|
|
- 函数:除法函数,用来得到精确的除法结果
|
|
|
|
|
- 说明:函数返回较为精确的除法结果。
|
|
|
|
|
- 参数:arg1:除数;arg2被除数;d要保留的小数位数(可以不传此参数,如果不传则不处理小数位数)
|
|
|
|
|
- 调用:Calc.Div(arg1,arg2)
|
|
|
|
|
- 返回值:arg1除于arg2的结果
|
|
|
|
|
- */
|
|
|
|
|
- Div(arg1, arg2) {
|
|
|
|
|
- var r1 = arg1.toString(),
|
|
|
|
|
- r2 = arg2.toString(),
|
|
|
|
|
- m,
|
|
|
|
|
- resultVal,
|
|
|
|
|
- d = arguments[2];
|
|
|
|
|
- m = (r2.split('.')[1] ? r2.split('.')[1].length : 0) - (r1.split('.')[1] ? r1.split('.')[1].length : 0);
|
|
|
|
|
- resultVal = (Number(r1.replace('.', '')) / Number(r2.replace('.', ''))) * Math.pow(10, m);
|
|
|
|
|
- return typeof d !== 'number' ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d)));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-</script>
|
|
|
|
|
-<style lang="less" scoped>
|
|
|
|
|
-.stepInfo {
|
|
|
|
|
- // background: rgba(242, 244, 245, 1);
|
|
|
|
|
- border: 1px solid #f2f4f5;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- padding: 20px;
|
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
-
|
|
|
|
|
- .step-title {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: rgba(72, 87, 106, 1);
|
|
|
|
|
- line-height: 16px;
|
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .btnList {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .houseInfo {
|
|
|
|
|
- padding: 15px;
|
|
|
|
|
- border: 1px solid #ccc;
|
|
|
|
|
- border-radius: 3px;
|
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .loading {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- margin: auto;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- background: rgba(255, 255, 255, 0.6);
|
|
|
|
|
- color: @text1;
|
|
|
|
|
- font-size: 24px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .avatar-uploader-icon {
|
|
|
|
|
- font-size: 28px;
|
|
|
|
|
- color: #8c939d;
|
|
|
|
|
- width: 178px;
|
|
|
|
|
- height: 178px;
|
|
|
|
|
- line-height: 178px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- background-color: #fbfdff;
|
|
|
|
|
-
|
|
|
|
|
- &:hover {
|
|
|
|
|
- border-color: #409eff;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .avatar {
|
|
|
|
|
- width: 178px;
|
|
|
|
|
- height: 178px;
|
|
|
|
|
- display: block;
|
|
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
-
|
|
|
|
|
- &:hover {
|
|
|
|
|
- border-color: #409eff;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .wrapper {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .single-upload .el-upload {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|