| | |
| | | prop="taxRate" |
| | | v-if="currentSupplierType === 1"> |
| | | <el-select v-model="productForm.taxRate" |
| | | placeholder="请选择" |
| | | placeholder="请选择或输入" |
| | | clearable |
| | | filterable |
| | | remote |
| | | :remote-method="handleTaxRateRemote" |
| | | @change="mathNum"> |
| | | <el-option label="1" |
| | | value="1" /> |
| | |
| | | value="6" /> |
| | | <el-option label="13" |
| | | value="13" /> |
| | | <el-option v-if="customTaxRate" |
| | | :label="customTaxRate" |
| | | :value="customTaxRate" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | const productOperationType = ref(""); |
| | | const productOperationIndex = ref(""); |
| | | const currentId = ref(""); |
| | | const customTaxRate = ref(""); |
| | | const productFormData = reactive({ |
| | | productForm: { |
| | | productId: "", |
| | |
| | | const day = String(today.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | // 处理税率远程搜索 |
| | | const handleTaxRateRemote = query => { |
| | | if (query) { |
| | | // 验证输入是否为数字且在0-100之间 |
| | | const num = parseFloat(query); |
| | | if (!isNaN(num) && num > 0 && num < 100) { |
| | | customTaxRate.value = query; |
| | | } else { |
| | | customTaxRate.value = ""; |
| | | } |
| | | } else { |
| | | customTaxRate.value = ""; |
| | | } |
| | | }; |
| | | const mathNum = () => { |
| | | if (!productForm.value.taxRate) { |
| | | proxy.$modal.msgWarning("请先选择税率"); |