运费模板修改
parent
c9c6b1d690
commit
ff85c3f68f
|
@ -1,45 +1,43 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<Row>
|
<Card>
|
||||||
<Col>
|
<Row>
|
||||||
<Card>
|
<Button @click="refresh">刷新</Button>
|
||||||
<Row>
|
<Button @click="add" type="primary">添加</Button>
|
||||||
<Button @click="refresh">刷新</Button>
|
</Row>
|
||||||
<Button @click="add" type="primary">添加</Button>
|
<Tabs @on-click="handleClickType" v-model="currentTab" style="margin-top: 10px">
|
||||||
</Row>
|
<TabPane label="运费模板" name="INFO">
|
||||||
<Tabs @on-click="handleClickType" v-model="currentTab" style="margin-top: 10px">
|
<table class="ncsc-default-table order m-b-30" :key="index" v-for="(item,index) in shipInfo">
|
||||||
<TabPane label="运费模板" name="INFO">
|
<tbody>
|
||||||
<table class="ncsc-default-table order m-b-30" :key="index" v-for="(item,index) in shipInfo">
|
<tr>
|
||||||
<tbody>
|
<td class="sep-row" colspan="20"></td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="sep-row" colspan="20"></td>
|
<tr>
|
||||||
</tr>
|
<th colspan="20">
|
||||||
<tr>
|
<h3>{{item.name}}</h3>
|
||||||
<th colspan="20">
|
<span class="fr m-r-5">
|
||||||
<h3>{{item.name}}</h3>
|
<time style="margin-right: 20px" title="最后编辑时间">
|
||||||
<span class="fr m-r-5">
|
<i class="icon-time"></i>{{item.updateTime}}
|
||||||
<time style="margin-right: 20px" title="最后编辑时间">
|
</time>
|
||||||
<i class="icon-time"></i>{{item.updateTime}}
|
<Button @click="edit(item)" type="info">修改</Button>
|
||||||
</time>
|
<Button @click="remove(item.id)" type="error">删除</Button>
|
||||||
<Button @click="edit(item)" type="info">修改</Button>
|
</span>
|
||||||
<Button @click="remove(item.id)" type="error">删除</Button>
|
</th>
|
||||||
</span>
|
</tr>
|
||||||
</th>
|
<tr v-if="item.pricingMethod!=='FREE'">
|
||||||
</tr>
|
<td class="w10 bdl"></td>
|
||||||
<tr>
|
<td class="cell-area tl">运送到</td>
|
||||||
<td class="w10 bdl"></td>
|
<td class="w150">首件(重)
|
||||||
<td class="cell-area tl">运送到</td>
|
|
||||||
<td class="w150">首件(重)
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="w150">运费</td>
|
<td class="w150">运费</td>
|
||||||
<td class="w150">续件(重)
|
<td class="w150">续件(重)
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="w150 bdr">运费</td>
|
<td class="w150 bdr">运费</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<template v-if="item.pricingMethod!=='FREE'">
|
||||||
<tr v-for="(children,index) in item.freightTemplateChildList">
|
<tr v-for="(children,index) in item.freightTemplateChildList" :key="index">
|
||||||
<td class="bdl"></td>
|
<td class="bdl"></td>
|
||||||
<td class="cell-area tl" style="width: 60%">{{children.area}}</td>
|
<td class="cell-area tl" style="width: 60%">{{children.area}}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -55,104 +53,104 @@
|
||||||
<span class="yuan">¥</span><span class="integer">{{children.continuedPrice | unitPrice}}</span>
|
<span class="yuan">¥</span><span class="integer">{{children.continuedPrice | unitPrice}}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</template>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane v-if="csTab" :label=title :name=operation>
|
<TabPane v-if="csTab" :label=title :name=operation>
|
||||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
<FormItem label="模板名称" prop="name">
|
<FormItem label="模板名称" prop="name">
|
||||||
<Input v-model="form.name" maxlength="10" clearable style="width: 20%" />
|
<Input v-model="form.name" maxlength="10" clearable style="width: 20%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="计价方式" prop="pricingMethod">
|
<FormItem label="计价方式" prop="pricingMethod">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="form.pricingMethod">
|
<RadioGroup type="button" button-style="solid" v-model="form.pricingMethod">
|
||||||
<Radio label="WEIGHT">按重量</Radio>
|
<Radio label="WEIGHT">按重量</Radio>
|
||||||
<Radio label="NUM">按件数</Radio>
|
<Radio label="NUM">按件数</Radio>
|
||||||
<Radio label="FREE">包邮</Radio>
|
<Radio label="FREE">包邮</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="详细设置" v-if="form.pricingMethod !== 'FREE'">
|
<FormItem label="详细设置" v-if="form.pricingMethod !== 'FREE'">
|
||||||
<div class="ncsu-trans-type" data-delivery="TRANSTYPE">
|
<div class="ncsu-trans-type" data-delivery="TRANSTYPE">
|
||||||
<div class="entity">
|
<div class="entity">
|
||||||
<div class="tbl-except">
|
<div class="tbl-except">
|
||||||
<table cellspacing="0" class="ncsc-default-table">
|
<table cellspacing="0" class="ncsc-default-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr style="border-bottom: 1px solid #ddd;">
|
<tr style="border-bottom: 1px solid #ddd;">
|
||||||
<th class="w10"></th>
|
<th class="w10"></th>
|
||||||
<th class="tl">运送到</th>
|
<th class="tl">运送到</th>
|
||||||
<th class="w10"></th>
|
<th class="w10"></th>
|
||||||
<th class="w50">首件(重)</th>
|
<th class="w50">首件(重)</th>
|
||||||
<th class="w110">首费</th>
|
<th class="w110">首费</th>
|
||||||
<th class="w50">续件(重)</th>
|
<th class="w50">续件(重)</th>
|
||||||
<th class="w110">续费</th>
|
<th class="w110">续费</th>
|
||||||
<th class="w150">操作</th>
|
<th class="w150">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="bd-line" data-group="n1" v-for="(item,index) in form.freightTemplateChildList">
|
<tr class="bd-line" data-group="n1" v-for="(item,index) in form.freightTemplateChildList">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="tl cell-area">
|
<td class="tl cell-area">
|
||||||
<span class="area-group">
|
<span class="area-group">
|
||||||
<p style="display:inline-block;white-space:pre;">{{item.area}}</p>
|
<p style="display:inline-block;white-space:pre;">{{item.area}}</p>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<Input class="text w40" type="text" v-model="item.firstCompany" maxlength="3" clearable />
|
<Input class="text w40" type="text" v-model="item.firstCompany" maxlength="3" clearable />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Input class="text w60" type="text" v-model="item.firstPrice" maxlength="6" clearable >
|
<Input class="text w60" type="text" v-model="item.firstPrice" maxlength="6" clearable >
|
||||||
<span slot="append">元</span>
|
<span slot="append">元</span>
|
||||||
</Input>
|
</Input>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Input class="text w40" type="text" v-model="item.continuedCompany" maxlength="6" clearable />
|
<Input class="text w40" type="text" v-model="item.continuedCompany" maxlength="6" clearable />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Input class="text w60" type="text" v-model="item.continuedPrice" maxlength="6" clearable>
|
<Input class="text w60" type="text" v-model="item.continuedPrice" maxlength="6" clearable>
|
||||||
<span slot="append">元</span>
|
<span slot="append">元</span>
|
||||||
</Input>
|
</Input>
|
||||||
</td>
|
</td>
|
||||||
<td class="nscs-table-handle">
|
<td class="nscs-table-handle">
|
||||||
<Button @click="editRegion(item,index)" type="info" size="small" style="margin-bottom: 5px">修改
|
<Button @click="editRegion(item,index)" type="info" size="small" style="margin-bottom: 5px">修改
|
||||||
</Button>
|
</Button>
|
||||||
<Button @click="removeTemplateChildren(index)" :loading="submitLoading" type="error" size="small" style="margin-bottom: 5px">删除
|
<Button @click="removeTemplateChildren(index)" :loading="submitLoading" type="error" size="small" style="margin-bottom: 5px">删除
|
||||||
</Button>
|
</Button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="tbl-attach p-5">
|
||||||
|
<div class="div-error" v-if="saveError">
|
||||||
|
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
指定地区城市为空或指定错误
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
首费应输入正确的金额
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
续费应输入正确的金额
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
首(续)件(重)费应输入大于0的整数
|
||||||
</div>
|
</div>
|
||||||
<div class="tbl-attach p-5">
|
|
||||||
<div class="div-error" v-if="saveError">
|
|
||||||
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
|
|
||||||
<Icon type="ios-information-circle-outline" />
|
|
||||||
指定地区城市为空或指定错误
|
|
||||||
<Icon type="ios-information-circle-outline" />
|
|
||||||
首费应输入正确的金额
|
|
||||||
<Icon type="ios-information-circle-outline" />
|
|
||||||
续费应输入正确的金额
|
|
||||||
<Icon type="ios-information-circle-outline" />
|
|
||||||
首(续)件(重)费应输入大于0的整数
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</FormItem>
|
</div>
|
||||||
<Form-item>
|
</FormItem>
|
||||||
<Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'" icon="ios-create-outline" >为指定城市设置运费模板
|
<Form-item>
|
||||||
</Button>
|
<Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'" icon="ios-create-outline" >为指定城市设置运费模板
|
||||||
<Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">保存
|
</Button>
|
||||||
</Button>
|
<Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">保存
|
||||||
</Form-item>
|
</Button>
|
||||||
</Form>
|
</Form-item>
|
||||||
</TabPane>
|
</Form>
|
||||||
</Tabs>
|
</TabPane>
|
||||||
</Card>
|
</Tabs>
|
||||||
</Col>
|
</Card>
|
||||||
</Row>
|
|
||||||
<multiple-region ref="region" @selected="handleSelect" @closed="handleClose">
|
<multiple-region ref="region" @selected="handleSelect" @closed="handleClose">
|
||||||
|
|
||||||
</multiple-region>
|
</multiple-region>
|
||||||
|
@ -313,37 +311,38 @@ export default {
|
||||||
const regNumber = /^\+?[1-9][0-9]*$/;
|
const regNumber = /^\+?[1-9][0-9]*$/;
|
||||||
const regMoney = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
const regMoney = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
||||||
if (valid) {
|
if (valid) {
|
||||||
debugger;
|
if (this.form.pricingMethod != 'FREE') {
|
||||||
//校验运费模板详细信息
|
//校验运费模板详细信息
|
||||||
for (let i = 0; i < this.form.freightTemplateChildList.length; i++) {
|
for (let i = 0; i < this.form.freightTemplateChildList.length; i++) {
|
||||||
if (
|
if (
|
||||||
this.form.freightTemplateChildList[i].area == "" ||
|
this.form.freightTemplateChildList[i].area == "" ||
|
||||||
this.form.freightTemplateChildList[i].firstCompany == "" ||
|
this.form.freightTemplateChildList[i].firstCompany == "" ||
|
||||||
this.form.freightTemplateChildList[i].firstPrice == "" ||
|
this.form.freightTemplateChildList[i].firstPrice == "" ||
|
||||||
this.form.freightTemplateChildList[i].continuedCompany == "" ||
|
this.form.freightTemplateChildList[i].continuedCompany == "" ||
|
||||||
this.form.freightTemplateChildList[i].continuedPrice == ""
|
this.form.freightTemplateChildList[i].continuedPrice == ""
|
||||||
) {
|
) {
|
||||||
this.saveError = true;
|
this.saveError = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
regNumber.test(
|
regNumber.test(
|
||||||
this.form.freightTemplateChildList[i].firstCompany
|
this.form.freightTemplateChildList[i].firstCompany
|
||||||
) == false ||
|
) == false ||
|
||||||
regNumber.test(
|
regNumber.test(
|
||||||
this.form.freightTemplateChildList[i].continuedCompany
|
this.form.freightTemplateChildList[i].continuedCompany
|
||||||
) == false ||
|
) == false ||
|
||||||
regMoney.test(this.form.freightTemplateChildList[i].firstPrice) ==
|
regMoney.test(this.form.freightTemplateChildList[i].firstPrice) ==
|
||||||
false ||
|
false ||
|
||||||
regMoney.test(
|
regMoney.test(
|
||||||
this.form.freightTemplateChildList[i].continuedPrice
|
this.form.freightTemplateChildList[i].continuedPrice
|
||||||
) == false
|
) == false
|
||||||
) {
|
) {
|
||||||
this.saveError = true;
|
this.saveError = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(1111);
|
|
||||||
|
|
||||||
if (this.operation == "ADD") {
|
if (this.operation == "ADD") {
|
||||||
API_Shop.addShipTemplate(this.form, headers).then((res) => {
|
API_Shop.addShipTemplate(this.form, headers).then((res) => {
|
||||||
|
|
Loading…
Reference in New Issue