|
@@ -28,10 +28,11 @@
|
|
|
class="rate-text"
|
|
class="rate-text"
|
|
|
@change="onChange">
|
|
@change="onChange">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in chargeTypeOptions"
|
|
|
|
|
- :key="item.chargeTypePk"
|
|
|
|
|
- :label="item.chargeType"
|
|
|
|
|
- :value="item.chargeTypePk">
|
|
|
|
|
|
|
+ v-for="opt in chargeTypeOptions"
|
|
|
|
|
+ :key="opt.chargeTypePk"
|
|
|
|
|
+ :label="opt.chargeType"
|
|
|
|
|
+ :value="opt.chargeTypePk"
|
|
|
|
|
+ v-if="isShowType(opt.chargeTypePk, item.chargeTypePk)">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -63,7 +64,7 @@
|
|
|
@click="handleClickSubButton(item, index)"
|
|
@click="handleClickSubButton(item, index)"
|
|
|
src="../../../assets/form-list-sub.png"/>
|
|
src="../../../assets/form-list-sub.png"/>
|
|
|
<img
|
|
<img
|
|
|
- v-if="chargeRates.length - 1 === index"
|
|
|
|
|
|
|
+ v-if="chargeRates.length - 1 === index && chargeTypeOptions.length > chargeRates.length"
|
|
|
class="list-item-icon"
|
|
class="list-item-icon"
|
|
|
@click="handleClickAddButton"
|
|
@click="handleClickAddButton"
|
|
|
src="../../../assets/form-list-add.png"/>
|
|
src="../../../assets/form-list-add.png"/>
|
|
@@ -90,6 +91,10 @@ export default {
|
|
|
value: {
|
|
value: {
|
|
|
type: Array,
|
|
type: Array,
|
|
|
required: true
|
|
required: true
|
|
|
|
|
+ },
|
|
|
|
|
+ excludeType: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
model: {
|
|
model: {
|
|
@@ -158,6 +163,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ isShowType(type, pk) {
|
|
|
|
|
+ if (this.excludeType && type && type != pk) {
|
|
|
|
|
+ for (let item of this.chargeRates) {
|
|
|
|
|
+ if (type == item.chargeTypePk) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ },
|
|
|
onChange() {
|
|
onChange() {
|
|
|
this.$emit('change', this.chargeRates);
|
|
this.$emit('change', this.chargeRates);
|
|
|
},
|
|
},
|
|
@@ -181,7 +196,7 @@ export default {
|
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
|
if (!this.chargeRates[0].chargeTypePk)
|
|
if (!this.chargeRates[0].chargeTypePk)
|
|
|
this.chargeRates[0].chargeTypePk = res.data[0].chargeTypePk
|
|
this.chargeRates[0].chargeTypePk = res.data[0].chargeTypePk
|
|
|
- this.tempChargeRate.chargeTypePk = res.data[0].chargeTypePk
|
|
|
|
|
|
|
+ //this.tempChargeRate.chargeTypePk = res.data[0].chargeTypePk
|
|
|
this.onChange()
|
|
this.onChange()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|