|
|
@@ -4,51 +4,51 @@
|
|
|
<view class="module-com input-line-wrap">
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">基础价格</view>
|
|
|
- <input v-model="form.baseFee" class="tui-input" name="shopName" type="digit"
|
|
|
+ <input v-model="form.baseFee" class="tui-input" name="shopName" type="digit" @focus="form.baseFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">0-3公里部分,每公里加</view>
|
|
|
- <input v-model="form.shortDistanceFee" class="tui-input" name="shortDistanceFee"
|
|
|
+ <input v-model="form.shortDistanceFee" class="tui-input" name="shortDistanceFee" @focus="form.shortDistanceFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" type="digit" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">3-100公里部分,每公里加</view>
|
|
|
- <input v-model="form.longDistanceFee" class="tui-input" name="longDistanceFee" type="digit"
|
|
|
+ <input v-model="form.longDistanceFee" class="tui-input" name="longDistanceFee" type="digit" @focus="form.longDistanceFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">重量6-10公斤,加</view>
|
|
|
- <input v-model="form.smallWeightFee" class="tui-input" name="smallWeightFee" type="digit"
|
|
|
+ <input v-model="form.smallWeightFee" class="tui-input" name="smallWeightFee" type="digit" @focus="form.smallWeightFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">如果重量超过10公斤,加</view>
|
|
|
- <input v-model="form.bigWeightFee" class="tui-input" name="bigWeightFee" type="digit"
|
|
|
+ <input v-model="form.bigWeightFee" class="tui-input" name="bigWeightFee" type="digit" @focus="form.bigWeightFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">特殊时段 00:00-08:00,加</view>
|
|
|
- <input v-model="form.onePeriodFee" class="tui-input" name="onePeriodFee" type="digit"
|
|
|
+ <input v-model="form.onePeriodFee" class="tui-input" name="onePeriodFee" type="digit" @focus="form.onePeriodFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">特殊时段 11:30-12:30,加</view>
|
|
|
- <input v-model="form.twoPeriodFee" class="tui-input" name="twoPeriodFee" type="digit"
|
|
|
+ <input v-model="form.twoPeriodFee" class="tui-input" name="twoPeriodFee" type="digit" @focus="form.twoPeriodFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">特殊时段 22:00-24:00,加</view>
|
|
|
- <input v-model="form.threePeriodFee" class="tui-input" name="threePeriodFee" type="digit"
|
|
|
+ <input v-model="form.threePeriodFee" class="tui-input" name="threePeriodFee" type="digit" @focus="form.threePeriodFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title" style="width:400upx;">临时加价(如遇恶劣天气等)</view>
|
|
|
- <input v-model="form.lsFee" class="tui-input" name="lsFee" type="digit"
|
|
|
+ <input v-model="form.lsFee" class="tui-input" name="lsFee" type="digit" @focus="form.lsFee=''"
|
|
|
style="width:100upx;border:1upx solid #CCCCCC;margin-right:10upx;" />元
|
|
|
</tui-list-cell>
|
|
|
</view>
|
|
|
- <view style="padding-left:30upx;font-size:30upx;">可以将运费设置高一些,发货后再给客户退运费。</view>
|
|
|
+ <view style="padding-left:30upx;font-size:30upx;"></view>
|
|
|
<view class="confirm-btn">
|
|
|
<button class="admin-button-com big blue" formType="submit">提交</button>
|
|
|
</view>
|
|
|
@@ -58,12 +58,13 @@
|
|
|
<script>
|
|
|
import TuiListCell from '@/components/plugin/list-cell'
|
|
|
import {mapActions} from "vuex";
|
|
|
+import { getMainInfo,modifyFreight } from "@/api/main";
|
|
|
export default {
|
|
|
- name: 'add',
|
|
|
+ name: 'freight',
|
|
|
components: {TuiListCell},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ form:{}
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -72,8 +73,57 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ formSubmit(){
|
|
|
+ if(this.$util.isMoney(this.form.baseFee) == false){
|
|
|
+ this.$msg("请输入基础运费")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.shortDistanceFee) == false){
|
|
|
+ this.$msg("请输入0-3公里部分加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.longDistanceFee) == false){
|
|
|
+ this.$msg("请输入3-100公里部分加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.smallWeightFee) == false){
|
|
|
+ this.$msg("请输入重量6-10公斤加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.bigWeightFee) == false){
|
|
|
+ this.$msg("请输入重量超过10公斤加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.onePeriodFee) == false){
|
|
|
+ this.$msg("请输入00:00-08:00加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.twoPeriodFee) == false){
|
|
|
+ this.$msg("请输入11:30-12:30加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.threePeriodFee) == false){
|
|
|
+ this.$msg("请输入22:00-24:00加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(this.$util.isMoney(this.form.lsFee) == false){
|
|
|
+ this.$msg("请输入临时加价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let that = this
|
|
|
+ modifyFreight(this.form).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg('修改成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
init() {
|
|
|
-
|
|
|
+ let that = this
|
|
|
+ getMainInfo().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.form = res.data.info ? res.data.info : []
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|