diff --git a/common/api/order.js b/common/api/order.js
index df7e6c4..aa70986 100644
--- a/common/api/order.js
+++ b/common/api/order.js
@@ -41,7 +41,7 @@ export const getSalemanList = (data = {})=> {
// 报价试算
export const preCalcWaybillFee = (data = {})=> {
- return coreRequest(url.preCalcWaybillFee, { ...data, postCode: 'RSD' }, {}, "GET")
+ return coreRequest(url.preCalcWaybillFee, { ...data, postCode: 'RSD' }, {})
}
// 物流轨迹
diff --git a/pages/login/login.vue b/pages/login/login.vue
index edaf2ec..09954d4 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -54,7 +54,7 @@
return {
submitParams: {
username: '25001108',
- password: '123456'
+ password: 'q123456'
},
remberPassport: [true]
}
diff --git a/pages/post/freightCalculate.vue b/pages/post/freightCalculate.vue
index ad796f5..3a001b8 100644
--- a/pages/post/freightCalculate.vue
+++ b/pages/post/freightCalculate.vue
@@ -6,32 +6,29 @@
-
-
-
-
+
+ {{submitParam.sendSiteName}}
+
-
-
+
-
+
-
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+ {{submitParam.dispatchUnderlingSiteName}}
+
@@ -84,27 +79,29 @@
-
- 产品类型TODO
+
+ 产品类型
-
+
-
-
+
+
-
-
+
@@ -115,7 +112,7 @@
-
+
@@ -125,7 +122,7 @@
-
+
@@ -156,30 +153,30 @@
// }
},
computed: {
- sendPostParam(){
- return {}
- },
+
waySearchParam() {
- return { country: this.submitParam.reciever.country, fromCountry: this.submitParam.sender.country }
+ return { country: this.submitParam.reciever.country, fromCountry: '' }
},
- productSearchParam() {
+ countrySearchParam() {
return { transLineCode: this.submitParam.transLine }
},
- destPostParam(){
+ provParam(){
const { country } = this.submitParam.reciever
- return { lineCode: this.submitParam.transLine, countryCode: country }
+ return { countryCode: country, regionType: 1 }
},
dicData() {
return this.$store.getters.dicData
},
+ checkedEstFee() {
+ let item = this.proTypeList.filter(t=> t.val == this.submitParam.productType)[0] || {}
+ return item.estFee
+ },
},
data() {
return this.getDefaultData()
},
onShareAppMessage() {
return {
- // title: '',
- // path: 'TODO'
}
},
onLoad(option) {
@@ -192,31 +189,36 @@
},
methods: {
getDefaultData() { // data的默认数据
+ let { ownerSiteCode, ownerSiteName } = this.$store.getters.userInfo
return {
pageLoading: true,
queryOption: {
},
- sendPostRes: { list: [] },
+ proTypeList: [],
+ countryRes: { list: [] },
+ provRes: { list: [] },
wayRes: { list: [] },
- productRes: { list: [] },
- destPostRes: { list: [] },
submitParam: {
+ reciever: {
+ country: '',
+ province: ''
+ },
transLine: "", // 线路编码
+ productType: "", // 产品类型code
calcFeeType: "", // 计费类型 1-重量计费 2-体积计费
billWeight: "", // 实际重量
totalVolume: "", // 总体积
dispatchUnderlingSiteCode: "", // 目的地站点
customsClear: "", // 清关方式
customsEclaration:"", // 清关方式
- sendSiteCode: this.$store.getters.userInfo.ownerSiteCode, // 发件站点
+ sendSiteCode: ownerSiteCode, // 发件站点
+ sendSiteName: ownerSiteName, // 发件站点名称
}
}
},
- getSendPositionList: apiService.getDestPositionList,
+ getEmisCountry: apiService.getEmisCountry,
getTransLineList: apiService.getTransLineList,
- getTransProductList: apiService.getTransProductList,
- getRSDStaffList: apiService.getRSDStaffList,
- getDestPositionList: apiService.getDestPositionList,
+ getEmisRegion: apiService.getEmisRegion,
async initData() { // 初始化
this.pageLoading = false
},
@@ -224,52 +226,50 @@
initEvent() {
},
-
- handleAddressChange() { // 地址切换
- let { wayRes, submitParam } = this.getDefaultData()
- if(this.submitParam.reciever.country && this.submitParam.sender.country) {
- this.submitParam.transLine = submitParam.transLine
- this.submitParam.transLineTypeName = submitParam.transLineTypeName
- this.handleWayChange() // 调用线路切换,清空后续数据
- }
+ handleCountryChange(val) {
+ this.submitParam.reciever.province = ''
+ this.submitParam.reciever.provinceName = ''
+ this.handlePrvChange()
+ },
+ handlePrvChange(val){
+ this.submitParam.transLine = ''
+ this.submitParam.transLineTypeName = ''
+ this.handleWayChange() // 调用线路切换,清空后续数据
},
handleWayChange(val) { // 线路切换
- let { productRes, submitParam } = this.getDefaultData()
- // 清空产品类型数据
- this.submitParam.productType = submitParam.productType
- this.submitParam.productTypeName = submitParam.productTypeName
const item = this.wayRes.list.filter(t=> t.val == val)[0]
- this.updateDltDestSite({ lineCode: val })
- },
- handleDestPostChange(val) {
- const item = this.destPostRes.list.filter(t=> t.val == val)[0]
- this.submitParam.dispatchUnderlingSiteCode = item.siteCode;
- this.submitParam.dispatchUnderlingSiteName = item.siteName;
+ if(val) {
+ this.updateDltDestSite({ lineCode: val })
+ } else {
+ this.submitParam.dispatchUnderlingSiteCode = ''
+ this.submitParam.dispatchUnderlingSiteName = ''
+ }
},
+
handleDialogClick(curModal){
curModal.show = true
},
async updateDltDestSite({ lineCode }) {
- const { country, province, city, county, address } = this.submitParam.reciever
- let res = await apiService.getCaculteDestSite({ lineCode, country, province, city, county, address })
+ const { country, province } = this.submitParam.reciever
+ let res = await apiService.getCaculteDestSite({ lineCode, country, province })
// 更新路线推荐的默认目的地
let data = res.data || {}
- this.submitParam.destinationCode = data.destCode
- this.submitParam.destinationName = data.destName
this.submitParam.dispatchUnderlingSiteCode = data.siteCode;
this.submitParam.dispatchUnderlingSiteName = data.siteName;
},
- async handleGoodInfoSure() {
- // 校验各个组件的参数
- let res = await this.$refs.goodSize.validData()
- },
async handleCalPost(type) {
let params = JSON.parse(JSON.stringify(this.submitParam));
- params.goodsPics = params.goodsPics.join(",")
- await saveServerHand(params)
- this.showToast('操作成功')
- // TOTO
- debugger
+ params.calcFeeType = 1 // "计费类型 1-重量计费 2-体积计费"
+ let res = await apiService.preCalcWaybillFee({ ...params, _loading: true })
+ this.proTypeList = res.data || []
+ if(this.proTypeList.length > 0) {
+ this.showToast('试算成功')
+ } else {
+ this.showToast('未匹配到产品信息,请切换条件重新试算')
+ }
+ },
+ handleGoXiaDan() {
+ this.goto(`post/openorder?defaultSubParams=${encodeURIComponent(JSON.stringify(this.submitParam))}`)
}
}
}
diff --git a/pages/post/openorder.vue b/pages/post/openorder.vue
index 91b9f4d..6104f11 100644
--- a/pages/post/openorder.vue
+++ b/pages/post/openorder.vue
@@ -337,6 +337,7 @@
pageLoading: true,
isEdit: false,
queryOption: {
+ defaultSubParams: '', // 提交默认参数
billCode: '', // 运单id
orderSn: '', // 订单id
},
@@ -371,6 +372,14 @@
getSalemanList: apiService.getSalemanList,
async initData() { // 初始化
this.isEdit = Boolean(this.queryOption.billCode || this.queryOption.orderSn)
+ if(this.queryOption.defaultSubParams) {
+ try{
+ this.queryOption.defaultSubParams = JSON.parse(decodeURIComponent(this.queryOption.defaultSubParams))
+ Object.assign(this.submitParam, this.queryOption.defaultSubParams)
+ }catch(e){
+ console.error("queryOption.defaultSubParams=====转换失败===", this.queryOption.defaultSubParams)
+ }
+ }
if(this.isEdit) {
let res = await apiService.getOrderDetail({...this.queryOption, _loading: true})
let data = res.data || {}