| | |
| | | <div class="price-items"> |
| | | <div class="price-item" v-for="(item, index) in shareTableData" :key="index"> |
| | | <span class="price-label">{{item.fieldTypeName}}{{item.fieldType === 4 ? '在订单中作为配送员时,' : '门店'}}分成比例为</span> |
| | | <el-input style="width: 100px;" v-model="item.ratio" type="number" placeholder="请输入"></el-input> |
| | | <el-input style="width: 100px;" v-model="item.ratio" placeholder="请输入"></el-input> |
| | | <span class="price-unit">%</span> |
| | | </div> |
| | | </div> |
| | |
| | | this.$message.error('请填写所有分成比例') |
| | | return false |
| | | } |
| | | const num = Number(item.ratio) |
| | | if (isNaN(num) || num < 1) { |
| | | this.$message.error(item.fieldTypeName + '分成比例必须大于等于1') |
| | | return false |
| | | } |
| | | const str = String(item.ratio) |
| | | if (str.includes('.')) { |
| | | const decimal = str.split('.')[1] |
| | | if (decimal.length > 1) { |
| | | this.$message.error(item.fieldTypeName + '分成比例最多支持一位小数') |
| | | return false |
| | | } |
| | | } |
| | | } |
| | | return true |
| | | } |