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

修复部分bug

parent 71575d7c
......@@ -6,6 +6,10 @@ export default {
value:{
type:Array,
default:[]
},
readonly:{
type:Boolean,
default:false
}
},
data(){
......@@ -61,19 +65,19 @@ export default {
<radio-group @change="changeDrawee(item.name, $event)" class="flex">
<label class="flex">
<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>{{$lang.lang.create.consignee}}</view>
</label>
<label class="flex">
<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>{{$lang.lang.create.consignor}}</view>
</label>
</radio-group>
</view>
<view class="flex action">
<view class="flex action" v-if="!readonly">
<button @click="close">{{$lang.lang.create.cancel}}</button>
<button @click="submit" type="primary">{{$lang.lang.create.submit}}</button>
</view>
......
......@@ -514,8 +514,11 @@
<!--收货方式-->
<view class="corder-v5-v corder-picker">
<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>
</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>
<image class="rgt" src="../../static/img/rgt.png" mode="widthFix"></image>
</view>
......@@ -936,6 +939,9 @@
format: true
})
return {
// 收货方式
harvestList: [],
currentHarvestIndex: null,
// 始发城市
startCityList:[],
currentStartCityIndex: null,
......@@ -1173,6 +1179,7 @@
await this.getDstCountryList()
await this.getTransport()
await this.getStartCity()
await this.getHarvestMethod()
// this.getZd()
this.getTreeList()
this.getCurrencyData()
......@@ -1195,6 +1202,7 @@
this.getCountrySn()
this.getClientaData()
if(op.id){
await this.$nextTick()
this.getOrderData(op.id)
this.orderId = op.id
}
......@@ -1229,6 +1237,18 @@
isOverSearWarehouse(){
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(){
return this.$lang.locale == 'zh' ? 'label' : 'labelEn'
},
......@@ -1246,6 +1266,9 @@
},
startCityRangeKey(){
return this.$lang.locale == 'zh' ? 'titleZh' : 'titleEn'
},
harvestRangeKey(){
return this.$lang.locale == 'zh' ? 'label' : 'labelEn'
}
},
watch:{
......@@ -1678,6 +1701,7 @@
getPackageType(e){
this.params.packageType = e.detail.value.join(',')
},
addOrder(){
// 如果勾选了海外仓给提示
if(this.params.type.indexOf('2') > -1){
......@@ -1853,7 +1877,8 @@
}
this.isClick = false
},
async creatOrder(){
// 校验目的国和手机区号
async validateCountryAndAreaCode(){
if(this.hasConsignee){
const res = await this.$request.get('/app-api/ecw/region/check/dest-currency/area-code/', {
areaCode: this.params.countryCode,
......@@ -1868,10 +1893,13 @@
})
console.log("确认结果", res)
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.isClick = false
if(res.code == 0&&res.data){
......@@ -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.getOpenedRouter()
}
that.getConfigIndex('transport',that.params.transportId)
that.getConfigIndex('channel',that.params.channelId)
that.getConfigIndex('tradeCity2',that.params.objectiveId)
that.getConfigIndex('tradeCity1',that.params.departureId)
that.getConfigIndex('tradeCity1',that.params.departureId)*/
that.setPackType()
if(that.params.shippingCompany){
that.getConfigIndex('clientaData',that.params.shippingCompany)
......@@ -1981,7 +2009,31 @@
await this.$nextTick()
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(){
......@@ -2039,7 +2091,8 @@
that.channeled = false
}
},
updateOrder(){
async updateOrder(){
await this.validateCountryAndAreaCode()
this.$request.put('/app-api/my/order/update',this.params).then(res => {
this.isClick = false
if(res.code == 0){
......@@ -3128,6 +3181,10 @@
changeBillPrice(e){
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(){
const res = await this.$request.get("/app-api/ecw/warehouse/getGuojiaAndShiAndWarehouseList", {tradeType: 1})
console.log("getDstCountryList", res)
......@@ -3219,10 +3276,11 @@
}
}
},
changeRoute(e){
async changeRoute(e){
this.currentRouteIndex = e.detail.value
this.params.lineId = this.routerList[this.currentRouteIndex].id
// 如果没有始发城市则回显
if(this.currentStartCityIndex === null){
const startCityIndex = this.startCityList.findIndex(item => item.id == this.routerList[this.currentRouteIndex].startCityId)
......@@ -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){
this.currentStartCityIndex = e.detail.value
......@@ -3259,6 +3333,11 @@
this.currentRouteIndex = null
this.params.lineId = ''
this.getOpenedRouter()
},
// 更换收货方式
changeHarvestMethod(e){
this.currentHarvestIndex = e.detail.value
this.params.harvestMethod = this.harvestList[this.currentHarvestIndex].value
}
}
}
......
......@@ -163,7 +163,7 @@
</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>{{$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.create.special}}:{{packageTypeName||''}}</view>
</view>
......@@ -363,7 +363,8 @@
</view>
</uni-popup>
<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>
<script>
......@@ -372,9 +373,11 @@
import declarationDocuments from '../../components/declarationDocuments/index.vue'
//#ifdef H5
import FileSaver from 'file-saver'
import Drawee from "@/pages/create_order/components/drawee.vue";
//#endif
export default {
components: {
Drawee,
steper,declarationDocuments
},
data() {
......@@ -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