Commit 0743b3bc authored by dragondean@qq.com's avatar dragondean@qq.com

改bug

parent 60227cad
......@@ -4,15 +4,15 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card>
<div slot="header" class="card-title">{{ editMode ? '新建订单' : '编辑订单'}}</div>
<el-form-item label="订单类型" style="margin-bottom: 0">
<!--默认显示类型(selectedRouter==null),如果选择路线后没开通则隐藏-->
<el-form-item label="订单类型" style="margin-bottom: 0" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1">集运服务</el-checkbox>
<el-checkbox label="2">海外仓</el-checkbox>
<el-checkbox label="1" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1">集运服务</el-checkbox>
<el-checkbox label="2" v-if="!selectedRouter || routeOtherServices.indexOf('2') > -1">海外仓</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-descriptions :column="3" border v-if="form.type.indexOf(1) < 0">
<el-descriptions :column="3" border v-if="form.type.indexOf('1') < 0">
<el-descriptions-item label="*发货人" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorContactsId">
<customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" />
......@@ -559,7 +559,7 @@ export default {
},
// 代收货款(非控货订单,且路线开通了代收服务)
collectionProxy(){
return !this.form.isCargoControl && this.selectedRouter && this.selectedRouter.otherService && this.selectedRouter.otherService.indexOf('2') > -1
return !this.form.isCargoControl && this.selectedRouter && this.selectedRouter.otherService && this.selectedRouter.otherService.indexOf('3') > -1
},
// 根据渠道id显示渠道名
getChannelNameById(){
......@@ -622,6 +622,11 @@ export default {
productEditable(){
// 非编辑模式 或者 草稿状态就可以编辑
return !this.editMode || this.form.status == 0
},
// 路线开通的服务
routeOtherServices(){
if(!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(',')
}
},
watch:{
......@@ -661,6 +666,16 @@ export default {
},
fee(){
this.getCoupons()
},
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val){
if(!val) return
['1', '4'].forEach(service => {
if(this.routeOtherServices.indexOf(service) < 0 && this.form.type.indexOf(service) > -1){
this.form.type.splice(this.form.type.findIndex(item => item == service), 1)
}
})
}
},
created() {
......
......@@ -51,7 +51,7 @@
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:product:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" :disabled="multiple" v-hasPermi="['ecw:product:attr']">批量设置商品属性</el-button>
<el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" v-hasPermi="['ecw:product:attr']">批量设置商品属性</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......
......@@ -109,33 +109,16 @@
</el-form-item>
<template v-else>
<el-form-item label="默认运费" prop="transportPrice">
<el-row :gutter="20">
<el-col :span="4">
<selector v-model="form.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
<el-col :span="6">
<inputor default="0" v-model.number="form.transportPrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
/ <selector v-model="form.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
</el-row>
<selector v-model="form.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 mr-10" />
<inputor default="0" v-model.number="form.transportPrice" type="number" placeholder="整数或者两位小数" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="form.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item label="默认清关费" prop="clearancePrice">
<el-row :gutter="20">
<el-col :span="4">
<selector v-model="form.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
<el-col :span="6">
<inputor default="0" v-model.number="form.clearancePrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
/
<selector v-model="form.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 mr-10" />
<inputor default="0" v-model.number="form.clearancePrice" type="number" placeholder="整数或者两位小数" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="form.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
</el-row>
</el-form-item>
</template>
......@@ -146,62 +129,37 @@
v-for="(special, specialIndex) in this.specialProducts"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '全包价'"
:key="specialIndex + 'transport'">
<el-row :gutter="20">
<el-col :span="4">
<selector v-model="special.allPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
<el-col :span="6">
<inputor default="0" v-model.number="special.allPrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
/ <selector v-model="special.allVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
</el-row>
<selector v-model="special.allPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 mr-10" />
<inputor default="0" v-model.number="special.allPrice" type="number" placeholder="整数或者两位小数" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="special.allVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-form-item>
</template>
<template v-else v-for="(special, specialIndex) in this.specialProducts">
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'"
:key="specialIndex + 'transport'">
<el-row :gutter="20">
<el-col :span="4">
<selector v-model="special.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
<el-col :span="6">
<inputor default="0" v-model.number="special.transportPrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
/ <selector v-model="special.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
</el-row>
<selector v-model="special.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 mr-10" />
<inputor default="0" v-model.number="special.transportPrice" type="number" placeholder="整数或者两位小数" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="special.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '清关费'"
:key="specialIndex + 'clearance'">
<el-row :gutter="20">
<el-col :span="4">
<selector v-model="special.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
<el-col :span="6">
<inputor default="0" v-model.number="special.clearancePrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
/ <selector v-model="special.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-col>
</el-row>
<selector v-model="special.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 mr-10" />
<inputor default="0" v-model.number="special.clearancePrice" type="number" placeholder="整数或者两位小数" class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector v-model="special.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-form-item>
</template>
</template>
<!-- <el-form-item label="是否预付" prop="advanceStatus">
<dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
</el-form-item> -->
<el-form-item label="价格有效期">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
-
<el-date-picker v-model="form.validateEndDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-card>
......@@ -245,7 +203,7 @@ import ProductSelector from '@/components/ProductSelector'
import { arrryToKeyedObjectBy } from '@/utils/index'
import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor'
import {parseTime} from '@/utils/ruoyi'
export default {
components: { RoutersSelector, ProductSelector, Selector, Inputor },
data() {
......@@ -256,7 +214,9 @@ export default {
stepPrice: 0,
advanceStatus: 0,
needBook: 0,
dayLimit: 10000
dayLimit: 10000,
validateEndDate: undefined,
validateStartDate: undefined
},
specialProducts: [],
priceStepList: [{},{}], // 阶梯价格
......@@ -410,6 +370,12 @@ export default {
this.setDefaultVolumeUnit(7)
}
// 没有操作标识的就是新建,给有效期默认值
if(!this.$route.query.action){
this.form.validateStartDate = parseTime(Date.now())
this.form.validateEndDate = parseTime(Date.now() + 86400*365*2*1000)
}
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment