|
|
@@ -35,17 +35,19 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="减免比例" prop="reductionRadio">
|
|
|
- <el-input
|
|
|
- v-model="unit.reductionRadio"
|
|
|
+ <el-select
|
|
|
+ v-model="reductionRadioModel"
|
|
|
:disabled="unit.isExempt == '1'"
|
|
|
- placeholder="请输入减免比例"
|
|
|
- @input="handleInput"
|
|
|
- type="number"
|
|
|
- :min="0"
|
|
|
- :max="100"
|
|
|
+ placeholder="请选择或输入减免比例"
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
- <template #append>%</template>
|
|
|
- </el-input>
|
|
|
+ <el-option :value="0" label="全收" />
|
|
|
+ <el-option :value="50" label="减免一半" />
|
|
|
+ <el-option v-if="unit.isExempt == '1'" :value="100" label="免征" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
@@ -534,18 +536,21 @@ const rules = ref({
|
|
|
socialCreditCode: [{ required: true, message: '请输入统一社会信用代码', trigger: 'blur' }],
|
|
|
name: [{ required: true, message: '请输入单位名称', trigger: 'blur' }]
|
|
|
})
|
|
|
-const handleInput = (value) => {
|
|
|
- if (value === '') return
|
|
|
-
|
|
|
- let num = parseFloat(value)
|
|
|
-
|
|
|
- // 限制范围
|
|
|
- if (num < 0) {
|
|
|
- unit.reductionRadio = 0
|
|
|
- } else if (num > 100) {
|
|
|
- unit.reductionRadio = 100
|
|
|
+// 减免比例:支持选择"全收"(0)、"减免一半"(50),也允许自定义输入 0-100
|
|
|
+const reductionRadioModel = computed({
|
|
|
+ get: () => {
|
|
|
+ const val = Number(unit.reductionRadio)
|
|
|
+ return isNaN(val) ? 0 : val
|
|
|
+ },
|
|
|
+ set: (val) => {
|
|
|
+ let num = Number(val)
|
|
|
+ if (isNaN(num)) num = 0
|
|
|
+ // 限制范围 0-100
|
|
|
+ if (num < 0) num = 0
|
|
|
+ if (num > 100) num = 100
|
|
|
+ unit.reductionRadio = num
|
|
|
}
|
|
|
-}
|
|
|
+})
|
|
|
|
|
|
// 获取省市区数据
|
|
|
const loadAreaData = () => {
|