|
|
@@ -7,11 +7,12 @@
|
|
|
switchFullscreen
|
|
|
@ok="handleOk"
|
|
|
@cancel="close">
|
|
|
- <a-form-model >
|
|
|
+ <a-form-model ref="form" :model="newScheme" :rules="validatorRules">
|
|
|
<a-form-model-item
|
|
|
label="房价名称"
|
|
|
:labelCol="labelCol"
|
|
|
- :wrapperCol="wrapperCol">
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
+ prop="name">
|
|
|
<a-col :span="8">
|
|
|
<a-input v-model="newScheme.name"></a-input>
|
|
|
</a-col>
|
|
|
@@ -20,14 +21,14 @@
|
|
|
label="租金标准"
|
|
|
:labelCol="labelCol"
|
|
|
:wrapperCol="wrapperCol"
|
|
|
- prop="">
|
|
|
+ name="rentChargesMoney">
|
|
|
<a-col :span="7">
|
|
|
- <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
|
|
|
- </a-col>
|
|
|
- <a-col :span="1"><span>元/</span></a-col>
|
|
|
- <a-col :span="7">
|
|
|
- <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number> 月
|
|
|
+ <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
|
|
|
</a-col>
|
|
|
+ <a-col :span="3"><span>元/月</span></a-col>
|
|
|
+<!-- <a-col :span="7">-->
|
|
|
+<!-- <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number> -->
|
|
|
+<!-- </a-col>-->
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
label="押金标准"
|
|
|
@@ -46,18 +47,14 @@
|
|
|
:wrapperCol="wrapperCol"
|
|
|
prop="orderInfo.roomPriceSlnId">
|
|
|
<a-col :span="8">
|
|
|
- <a-select v-model="depositCharges.num">
|
|
|
+ <a-select v-model="depositCharges.num" style="width: 80%">
|
|
|
<a-select-option :value="1"> 押1 </a-select-option>
|
|
|
<a-select-option :value="2"> 押2 </a-select-option>
|
|
|
<a-select-option :value="3"> 押3 </a-select-option>
|
|
|
</a-select>
|
|
|
</a-col>
|
|
|
<a-col :span="8">
|
|
|
- <a-select v-model="rentCharges.num">
|
|
|
- <a-select-option :value="1"> 付1 </a-select-option>
|
|
|
- <a-select-option :value="2"> 付2 </a-select-option>
|
|
|
- <a-select-option :value="3"> 付3 </a-select-option>
|
|
|
- </a-select>
|
|
|
+ 付 <a-input-number v-model="rentCharges.num" :min="1" @change="rentNumChange" style="width: 80%"></a-input-number>
|
|
|
</a-col>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
@@ -90,11 +87,11 @@
|
|
|
<a-col :span="5">
|
|
|
<a-input-number v-model="item.money":min="0" placeholder="输入金额" style="width: 90%"></a-input-number>
|
|
|
</a-col>
|
|
|
- <a-col :span="2"><span>{{ item.chargeType == 3 ? '元/吨' : (item.chargeType == 4 ? '元/度' : '元') }}</span></a-col>
|
|
|
- <a-col :span="5" v-if="item.chargeType == 2">
|
|
|
- <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>
|
|
|
- </a-col>
|
|
|
- <a-col :span="1" v-if="item.chargeType == 2"><span>月</span></a-col>
|
|
|
+ <a-col :span="3"><span>{{ getUnitText(item.chargeType) }}</span></a-col>
|
|
|
+<!-- <a-col :span="5" v-if="item.chargeType == 2">-->
|
|
|
+<!-- <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>-->
|
|
|
+<!-- </a-col>-->
|
|
|
+<!-- <a-col :span="1" v-if="item.chargeType == 2"><span>月</span></a-col>-->
|
|
|
</a-row>
|
|
|
</a-col>
|
|
|
</a-form-model-item>
|
|
|
@@ -119,6 +116,10 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ validatorRules: {
|
|
|
+ name: [{ required: true, message: '请输入会员卡号!' }],
|
|
|
+ rentChargesMoney: [{ required: true, message: '请输入等级类型!' }],
|
|
|
+ },
|
|
|
title: '',
|
|
|
visible: false,
|
|
|
url: '',
|
|
|
@@ -137,12 +138,14 @@ export default {
|
|
|
rentCharges: {
|
|
|
name: '租金',
|
|
|
chargeType: 2,
|
|
|
- isMust: true
|
|
|
+ isMust: true,
|
|
|
+ num: 1
|
|
|
},
|
|
|
depositCharges: {
|
|
|
name: '押金',
|
|
|
chargeType: 1,
|
|
|
- isMust: true
|
|
|
+ isMust: true,
|
|
|
+ num: 1
|
|
|
},
|
|
|
newScheme: {}
|
|
|
};
|
|
|
@@ -175,34 +178,58 @@ export default {
|
|
|
this.customChargeList.push(charge)
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
+ rentNumChange() {
|
|
|
+
|
|
|
+ },
|
|
|
/** 移除新增费项目 */
|
|
|
removeCharge(index) {
|
|
|
console.log(index, 'index')
|
|
|
this.customChargeList.splice(index,1)
|
|
|
},
|
|
|
+ getUnitText(val) {
|
|
|
+ if (val == 1) {
|
|
|
+ return '/元'
|
|
|
+ } else if (val === 2) {
|
|
|
+ return '元/月'
|
|
|
+ } else if (val === 3) {
|
|
|
+ return '元/吨'
|
|
|
+ } else if (val === 4) {
|
|
|
+ return '元/度'
|
|
|
+ } else if (val === 5) {
|
|
|
+ return '元/立方'
|
|
|
+ }
|
|
|
+ },
|
|
|
close() {
|
|
|
this.visible = false
|
|
|
Object.assign(this.$data, this.$options.data())
|
|
|
},
|
|
|
handleOk() {
|
|
|
- console.log(this.depositCharges)
|
|
|
- console.log(this.rentCharges)
|
|
|
- console.log(this.customChargeList)
|
|
|
- let chargeList = JSON.parse(JSON.stringify(this.customChargeList))
|
|
|
- chargeList.push(this.depositCharges)
|
|
|
- chargeList.push(this.rentCharges)
|
|
|
- this.newScheme.houseLongRentChargeList = chargeList
|
|
|
- postAction(this.url, this.newScheme
|
|
|
- ).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success(res.message)
|
|
|
- this.$emit('ok')
|
|
|
- this.visible = false
|
|
|
- Object.assign(this.$data, this.$options.data())
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message)
|
|
|
+ const that = this
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let chargeList = JSON.parse(JSON.stringify(that.customChargeList))
|
|
|
+ chargeList.push(that.depositCharges)
|
|
|
+ chargeList.push(that.rentCharges)
|
|
|
+ console.log(chargeList, ' rrrrrrrrrrrr')
|
|
|
+ if (chargeList.some(e => e.money <= 0 || e.name == null || e.name === '')) {
|
|
|
+ this.$message.warning('请输入费项名称和金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ that.newScheme.houseLongRentChargeList = chargeList
|
|
|
+ postAction(that.url, that.newScheme
|
|
|
+ ).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ that.$message.success(res.message)
|
|
|
+ that.$emit('ok')
|
|
|
+ that.visible = false
|
|
|
+ Object.assign(that.$data, that.$options.data())
|
|
|
+ } else {
|
|
|
+ that.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|