Commit f9b13669 authored by dragondean@qq.com's avatar dragondean@qq.com

修复部分bug

parent 71575d7c
...@@ -6,6 +6,10 @@ export default { ...@@ -6,6 +6,10 @@ export default {
value:{ value:{
type:Array, type:Array,
default:[] default:[]
},
readonly:{
type:Boolean,
default:false
} }
}, },
data(){ data(){
...@@ -61,19 +65,19 @@ export default { ...@@ -61,19 +65,19 @@ export default {
<radio-group @change="changeDrawee(item.name, $event)" class="flex"> <radio-group @change="changeDrawee(item.name, $event)" class="flex">
<label class="flex"> <label class="flex">
<view class="checkbox-item"> <view class="checkbox-item">
<radio value="1" :checked="item.value == 1" style="transform:scale(0.8)"/> <radio value="1" :checked="item.value == 1" :disabled="readonly" style="transform:scale(0.8)"/>
</view> </view>
<view>{{$lang.lang.create.consignee}}</view> <view>{{$lang.lang.create.consignee}}</view>
</label> </label>
<label class="flex"> <label class="flex">
<view class="checkbox-item"> <view class="checkbox-item">
<radio value="2" :checked="item.value == 2" style="transform:scale(0.8)"/> <radio value="2" :checked="item.value == 2" :disabled="readonly" style="transform:scale(0.8)"/>
</view> </view>
<view>{{$lang.lang.create.consignor}}</view> <view>{{$lang.lang.create.consignor}}</view>
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="flex action"> <view class="flex action" v-if="!readonly">
<button @click="close">{{$lang.lang.create.cancel}}</button> <button @click="close">{{$lang.lang.create.cancel}}</button>
<button @click="submit" type="primary">{{$lang.lang.create.submit}}</button> <button @click="submit" type="primary">{{$lang.lang.create.submit}}</button>
</view> </view>
......
...@@ -514,8 +514,11 @@ ...@@ -514,8 +514,11 @@
<!--收货方式--> <!--收货方式-->
<view class="corder-v5-v corder-picker"> <view class="corder-v5-v corder-picker">
<view class="corder-v5-label"><span class="redcolor">*</span>{{$lang.lang.create.consignorType}}</view> <view class="corder-v5-label"><span class="redcolor">*</span>{{$lang.lang.create.consignorType}}</view>
<picker class="date-picker" :value="config.harvestMethod.index" :range="config.harvestMethod.label" data-config="harvestMethod" data-key="harvestMethod" @change="configChange" v-if="config.harvestMethod.value.length > 0"> <!--<picker class="date-picker" :value="config.harvestMethod.index" :range="config.harvestMethod.label" data-config="harvestMethod" data-key="harvestMethod" @change="configChange" v-if="config.harvestMethod.value.length > 0">
<view class="uni-input">{{config.harvestMethod.label[config.harvestMethod.index]}}</view> <view class="uni-input">{{config.harvestMethod.label[config.harvestMethod.index]}}</view>
</picker>-->
<picker class="date-picker" :value="currentHarvestIndex" :range="enabledHarvestList" :range-key="harvestRangeKey" @change="changeHarvestMethod">
<view class="uni-input">{{currentHarvestIndex !== null && enabledHarvestList[currentHarvestIndex] ? enabledHarvestList[currentHarvestIndex][harvestRangeKey] : $lang.lang.create.choose}}</view>
</picker> </picker>
<image class="rgt" src="../../static/img/rgt.png" mode="widthFix"></image> <image class="rgt" src="../../static/img/rgt.png" mode="widthFix"></image>
</view> </view>
...@@ -936,6 +939,9 @@ ...@@ -936,6 +939,9 @@
format: true format: true
}) })
return { return {
// 收货方式
harvestList: [],
currentHarvestIndex: null,
// 始发城市 // 始发城市
startCityList:[], startCityList:[],
currentStartCityIndex: null, currentStartCityIndex: null,
...@@ -1173,6 +1179,7 @@ ...@@ -1173,6 +1179,7 @@
await this.getDstCountryList() await this.getDstCountryList()
await this.getTransport() await this.getTransport()
await this.getStartCity() await this.getStartCity()
await this.getHarvestMethod()
// this.getZd() // this.getZd()
this.getTreeList() this.getTreeList()
this.getCurrencyData() this.getCurrencyData()
...@@ -1195,6 +1202,7 @@ ...@@ -1195,6 +1202,7 @@
this.getCountrySn() this.getCountrySn()
this.getClientaData() this.getClientaData()
if(op.id){ if(op.id){
await this.$nextTick()
this.getOrderData(op.id) this.getOrderData(op.id)
this.orderId = op.id this.orderId = op.id
} }
...@@ -1229,6 +1237,18 @@ ...@@ -1229,6 +1237,18 @@
isOverSearWarehouse(){ isOverSearWarehouse(){
return this.params.type?.indexOf('2') != -1 return this.params.type?.indexOf('2') != -1
}, },
// 可用的收货方式
enabledHarvestList(){
const currentRoute = this.currentRouteIndex !== null ? this.routerList[this.currentRouteIndex] : null
const otherService = currentRoute?.otherService?.split(",") || []
console.log("enabledHarvestList", otherService, currentRoute)
// 开通了送货上门才显示全部
if(otherService?.indexOf("2") > -1){
return this.harvestList
}
// 否则隐藏送货上门服务
return this.harvestList.filter(item => item.value != 2)
},
transportRangeKey(){ transportRangeKey(){
return this.$lang.locale == 'zh' ? 'label' : 'labelEn' return this.$lang.locale == 'zh' ? 'label' : 'labelEn'
}, },
...@@ -1246,6 +1266,9 @@ ...@@ -1246,6 +1266,9 @@
}, },
startCityRangeKey(){ startCityRangeKey(){
return this.$lang.locale == 'zh' ? 'titleZh' : 'titleEn' return this.$lang.locale == 'zh' ? 'titleZh' : 'titleEn'
},
harvestRangeKey(){
return this.$lang.locale == 'zh' ? 'label' : 'labelEn'
} }
}, },
watch:{ watch:{
...@@ -1678,6 +1701,7 @@ ...@@ -1678,6 +1701,7 @@
getPackageType(e){ getPackageType(e){
this.params.packageType = e.detail.value.join(',') this.params.packageType = e.detail.value.join(',')
}, },
addOrder(){ addOrder(){
// 如果勾选了海外仓给提示 // 如果勾选了海外仓给提示
if(this.params.type.indexOf('2') > -1){ if(this.params.type.indexOf('2') > -1){
...@@ -1853,7 +1877,8 @@ ...@@ -1853,7 +1877,8 @@
} }
this.isClick = false this.isClick = false
}, },
async creatOrder(){ // 校验目的国和手机区号
async validateCountryAndAreaCode(){
if(this.hasConsignee){ if(this.hasConsignee){
const res = await this.$request.get('/app-api/ecw/region/check/dest-currency/area-code/', { const res = await this.$request.get('/app-api/ecw/region/check/dest-currency/area-code/', {
areaCode: this.params.countryCode, areaCode: this.params.countryCode,
...@@ -1868,10 +1893,13 @@ ...@@ -1868,10 +1893,13 @@
}) })
console.log("确认结果", res) console.log("确认结果", res)
if(!res[1].confirm){ if(!res[1].confirm){
return throw new Error("目的国手机号校验不通过且用户点击取消")
} }
} }
} }
},
async creatOrder(){
await this.validateCountryAndAreaCode()
this.$request.post('/app-api/my/order/create', {...this.params, hasConsignee: this.hasConsignee}).then(res => { this.$request.post('/app-api/my/order/create', {...this.params, hasConsignee: this.hasConsignee}).then(res => {
this.isClick = false this.isClick = false
if(res.code == 0&&res.data){ if(res.code == 0&&res.data){
...@@ -1928,14 +1956,14 @@ ...@@ -1928,14 +1956,14 @@
}) })
} }
if(that.params.transportId != 0 ||that.params.lineId!=0 ||(that.params.departureId != 0 && that.params.objectiveId != 0)){ /*if(that.params.transportId != 0 ||that.params.lineId!=0 ||(that.params.departureId != 0 && that.params.objectiveId != 0)){
that.openedRouterF = false that.openedRouterF = false
that.getOpenedRouter() that.getOpenedRouter()
} }
that.getConfigIndex('transport',that.params.transportId) that.getConfigIndex('transport',that.params.transportId)
that.getConfigIndex('channel',that.params.channelId) that.getConfigIndex('channel',that.params.channelId)
that.getConfigIndex('tradeCity2',that.params.objectiveId) that.getConfigIndex('tradeCity2',that.params.objectiveId)
that.getConfigIndex('tradeCity1',that.params.departureId) that.getConfigIndex('tradeCity1',that.params.departureId)*/
that.setPackType() that.setPackType()
if(that.params.shippingCompany){ if(that.params.shippingCompany){
that.getConfigIndex('clientaData',that.params.shippingCompany) that.getConfigIndex('clientaData',that.params.shippingCompany)
...@@ -1981,7 +2009,31 @@ ...@@ -1981,7 +2009,31 @@
await this.$nextTick() await this.$nextTick()
this.currentDstCityIndex = dstCityIndex this.currentDstCityIndex = dstCityIndex
} }
}
// 回显始发城市
const startCityIndex = this.startCityList.findIndex(item => item.id == that.params.departureId)
console.log("startCityIndex", startCityIndex, this.startCityList.length)
if(startCityIndex > -1){
this.currentStartCityIndex = startCityIndex
}
// 回显运输方式
const transIndex = this.transportList.findIndex(item => item.value == that.params.transportId)
if(transIndex > -1){
this.currentTransportIndex = transIndex
}
// 回显路线
await that.getOpenedRouter()
const currentRouteIndex = this.routerList.findIndex(item => item.id == this.params.lineId)
if(currentRouteIndex > -1){
this.currentRouteIndex = currentRouteIndex
}
// 回显收货方式
const harvestIndex = this.enabledHarvestList.findIndex(item => item.value == that.params.harvestMethod)
if(harvestIndex > -1){
this.currentHarvestIndex = harvestIndex
}
}
}) })
}, },
setPackType(){ setPackType(){
...@@ -2039,7 +2091,8 @@ ...@@ -2039,7 +2091,8 @@
that.channeled = false that.channeled = false
} }
}, },
updateOrder(){ async updateOrder(){
await this.validateCountryAndAreaCode()
this.$request.put('/app-api/my/order/update',this.params).then(res => { this.$request.put('/app-api/my/order/update',this.params).then(res => {
this.isClick = false this.isClick = false
if(res.code == 0){ if(res.code == 0){
...@@ -3128,6 +3181,10 @@ ...@@ -3128,6 +3181,10 @@
changeBillPrice(e){ changeBillPrice(e){
this.params.displayBillLadingPrice = e.detail.value == 1 ? true : false this.params.displayBillLadingPrice = e.detail.value == 1 ? true : false
}, },
async getHarvestMethod(){
const res = await this.$request.getConfig("harvest_method")
this.harvestList = res.data.list || []
},
async getDstCountryList(){ async getDstCountryList(){
const res = await this.$request.get("/app-api/ecw/warehouse/getGuojiaAndShiAndWarehouseList", {tradeType: 1}) const res = await this.$request.get("/app-api/ecw/warehouse/getGuojiaAndShiAndWarehouseList", {tradeType: 1})
console.log("getDstCountryList", res) console.log("getDstCountryList", res)
...@@ -3219,10 +3276,11 @@ ...@@ -3219,10 +3276,11 @@
} }
} }
}, },
changeRoute(e){ async changeRoute(e){
this.currentRouteIndex = e.detail.value this.currentRouteIndex = e.detail.value
this.params.lineId = this.routerList[this.currentRouteIndex].id this.params.lineId = this.routerList[this.currentRouteIndex].id
// 如果没有始发城市则回显 // 如果没有始发城市则回显
if(this.currentStartCityIndex === null){ if(this.currentStartCityIndex === null){
const startCityIndex = this.startCityList.findIndex(item => item.id == this.routerList[this.currentRouteIndex].startCityId) const startCityIndex = this.startCityList.findIndex(item => item.id == this.routerList[this.currentRouteIndex].startCityId)
...@@ -3250,6 +3308,22 @@ ...@@ -3250,6 +3308,22 @@
} }
} }
} }
await this.$nextTick()
const currentRoute = this.routerList[this.currentRouteIndex]
const otherService = currentRoute.otherService?.split(",") || []
// 如果不支持送货上门则设置为自提,2表示送货上门,10表示默认送货上门
if(otherService.indexOf("2") == -1){
this.params.harvestMethod = 1
this.currentHarvestIndex = 0
}
// 支持送货上门,且默认送货上门
if(otherService.indexOf("2") > -1 && otherService.indexOf("10") > -1){
// value == 1 表示自提 2 表示送货上门
this.currentHarvestIndex = this.enabledHarvestList.findIndex(item => item.value == 2)
this.params.harvestMethod = 2
}
}, },
changeStartCity(e){ changeStartCity(e){
this.currentStartCityIndex = e.detail.value this.currentStartCityIndex = e.detail.value
...@@ -3259,6 +3333,11 @@ ...@@ -3259,6 +3333,11 @@
this.currentRouteIndex = null this.currentRouteIndex = null
this.params.lineId = '' this.params.lineId = ''
this.getOpenedRouter() this.getOpenedRouter()
},
// 更换收货方式
changeHarvestMethod(e){
this.currentHarvestIndex = e.detail.value
this.params.harvestMethod = this.harvestList[this.currentHarvestIndex].value
} }
} }
} }
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</view> </view>
<view style="height: 36px;" v-if="orderData.drawee==1">{{$lang.lang.create.payer}}{{$lang.lang.create.consignor}}</view> <view style="height: 36px;" v-if="orderData.drawee==1">{{$lang.lang.create.payer}}{{$lang.lang.create.consignor}}</view>
<view style="height: 36px;" v-else-if="orderData.drawee==2">{{$lang.lang.create.payer}}{{$lang.lang.create.consignee}}</view> <view style="height: 36px;" v-else-if="orderData.drawee==2">{{$lang.lang.create.payer}}{{$lang.lang.create.consignee}}</view>
<view style="height: 36px;" v-else>{{$lang.lang.create.payer}}{{orderData.customDraweeVOList?orderData.customDraweeVOList[0].name:''}}</view> <view style="height: 36px;" v-else @click="showCustomDrawee">{{$lang.lang.create.payer}}{{$lang.lang.create.customDrawee}}</view>
<view style="height: 36px;">{{$lang.lang.orderInfo.objectport}}:{{orderData.productRecord==1?$lang.lang.orderInfo.ourUndertakes:$lang.lang.orderInfo.customerUndertakes}}</view> <view style="height: 36px;">{{$lang.lang.orderInfo.objectport}}:{{orderData.productRecord==1?$lang.lang.orderInfo.ourUndertakes:$lang.lang.orderInfo.customerUndertakes}}</view>
<view style="height: 36px;">{{$lang.lang.create.special}}:{{packageTypeName||''}}</view> <view style="height: 36px;">{{$lang.lang.create.special}}:{{packageTypeName||''}}</view>
</view> </view>
...@@ -363,7 +363,8 @@ ...@@ -363,7 +363,8 @@
</view> </view>
</uni-popup> </uni-popup>
<declaration-documents ref="declaration" :orderId="orderData.orderId" :isoper="orderData.customsType==2" :orderNo="orderData.orderNo" @open="open"></declaration-documents> <declaration-documents ref="declaration" :orderId="orderData.orderId" :isoper="orderData.customsType==2" :orderNo="orderData.orderNo" @open="open"></declaration-documents>
</view> <drawee ref="drawee" :value="orderData.customDraweeVOList" readonly></drawee>
</view>
</template> </template>
<script> <script>
...@@ -372,9 +373,11 @@ ...@@ -372,9 +373,11 @@
import declarationDocuments from '../../components/declarationDocuments/index.vue' import declarationDocuments from '../../components/declarationDocuments/index.vue'
//#ifdef H5 //#ifdef H5
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
import Drawee from "@/pages/create_order/components/drawee.vue";
//#endif //#endif
export default { export default {
components: { components: {
Drawee,
steper,declarationDocuments steper,declarationDocuments
}, },
data() { data() {
...@@ -871,6 +874,9 @@ ...@@ -871,6 +874,9 @@
}) })
} }
}) })
},
showCustomDrawee(){
this.$refs.drawee.open()
} }
} }
} }
......
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