| | |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="位置标签" prop="locationTagIds"> |
| | | <el-select v-model="form.locationTagIds" multiple placeholder="请选择位置标签" style="width: 100%;"> |
| | | <el-select v-model="form.locationTagIds" multiple placeholder="请选择位置标签" style="width: 100%;" @change="handleLocationTagChange"> |
| | | <el-option v-for="item in locationTagList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-tab-pane label="门店分成" name="profit"> |
| | | <div class="profit-section"> |
| | | <h4 class="section-title">就地寄存模式</h4> |
| | | <el-form-item label="在订单中作为寄件点时,分成比例为" label-suffix=":*"> |
| | | <el-form-item label="在订单中作为寄件点时,分成比例为" prop="localDeposit" label-suffix=":*" :rules="[{ validator: this.validateDepositRate, trigger: 'blur' }]"> |
| | | <div class="profit-input"> |
| | | <el-input v-model.number="form.localDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <el-input v-model="form.localDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <span class="unit">%</span> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | |
| | | <div class="profit-section"> |
| | | <h4 class="section-title">同城寄送模式</h4> |
| | | <el-form-item label="在订单中作为寄件点时,分成比例为" label-suffix=":*"> |
| | | <el-form-item label="在订单中作为寄件点时,分成比例为" prop="remoteTake" label-suffix=":*" :rules="[{ validator: this.validateDepositRate, trigger: 'blur' }]"> |
| | | <div class="profit-input"> |
| | | <el-input v-model.number="form.remoteTake" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <el-input v-model="form.remoteDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <span class="unit">%</span> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="在订单中作为收件点时,分成比例为" label-suffix=":*"> |
| | | <el-form-item label="在订单中作为收件点时,分成比例为" prop="remoteDeposit" label-suffix=":" :rules="[{ validator: this.validateDepositRate, trigger: 'blur' }]"> |
| | | <div class="profit-input"> |
| | | <el-input v-model.number="form.remoteDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <el-input v-model="form.remoteTake" placeholder="请输入分成比例" style="width: 150px;"></el-input> |
| | | <span class="unit">%</span> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | this.getLocationTagList() |
| | | }, |
| | | methods: { |
| | | validateDepositRate (rule, value, callback) { |
| | | if (value !== null && value !== '' && value !== undefined) { |
| | | const num = Number(value) |
| | | if (isNaN(num)) { |
| | | callback(new Error('请输入有效数字')) |
| | | } else if (num < 1) { |
| | | callback(new Error('必须大于等于1')) |
| | | } else { |
| | | const str = String(num) |
| | | if (str.includes('.')) { |
| | | const decimal = str.split('.')[1] |
| | | if (decimal.length > 1) { |
| | | callback(new Error('最多支持一位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } else { |
| | | callback() |
| | | } |
| | | }, |
| | | handleLocationTagChange (val) { |
| | | if (val.length > 2) { |
| | | this.$message.warning('位置标签最多只能选择2个') |
| | | this.form.locationTagIds = val.slice(0, 2) |
| | | } |
| | | }, |
| | | open (title, row) { |
| | | this.isWorking.save = false |
| | | detail(row.id) |
| | |
| | | const res = await fetchList({ |
| | | capacity: 9999, |
| | | page: 1, |
| | | model: {} |
| | | model: { |
| | | type: 5 |
| | | } |
| | | }) |
| | | this.locationTagList = res.records |
| | | } catch (e) { |