feat: 集成顺丰平台,发货,查询物流,打印面单

master
chc 2023-03-06 18:00:11 +08:00
parent 4fd419fcfe
commit f7a9bff2ba
5 changed files with 437 additions and 415 deletions

View File

@ -5,21 +5,40 @@
<RadioGroup v-model="formValidate.type" type="button">
<Radio label="KDNIAO">快递鸟</Radio>
<Radio label="KUAIDI100">快递100</Radio>
<Radio label="SHUNFENG">顺丰</Radio>
</RadioGroup>
</FormItem>
<FormItem v-if="formValidate.type==='KDNIAO'" label="快递鸟 商户ID" prop="kdniaoEbusinessID">
<FormItem v-if="formValidate.type === 'KDNIAO'" label="快递鸟 商户ID" prop="kdniaoEbusinessID">
<Input v-model="formValidate.kdniaoEbusinessID" />
</FormItem>
<FormItem v-if="formValidate.type==='KDNIAO'" label="快递鸟 AppKey" prop="kdniaoAppKey">
<FormItem v-if="formValidate.type === 'KDNIAO'" label="快递鸟 AppKey" prop="kdniaoAppKey">
<Input class="label-appkey" v-model="formValidate.kdniaoAppKey" />
</FormItem>
<FormItem v-if="formValidate.type==='KUAIDI100'" label="快递100 授权码" prop="kuaidi100Customer">
<FormItem v-if="formValidate.type === 'KUAIDI100'" label="快递100 授权码" prop="kuaidi100Customer">
<Input class="label-appkey" v-model="formValidate.kuaidi100Customer" />
</FormItem>
<FormItem v-if="formValidate.type==='KUAIDI100'" label="快递100 Key" prop="kuaidi100Key">
<FormItem v-if="formValidate.type === 'KUAIDI100'" label="快递100 Key" prop="kuaidi100Key">
<Input class="label-appkey" v-model="formValidate.kuaidi100Key" />
</FormItem>
<div v-if="formValidate.type === 'SHUNFENG'">
<FormItem label="顾客编码" prop="clientCode">
<Input v-model="formValidate.clientCode" />
</FormItem>
<FormItem label="校验码" prop="checkWord">
<Input v-model="formValidate.checkWord" />
</FormItem>
<FormItem label="请求地址" prop="callUrl">
<Input class="label-appkey" v-model="formValidate.callUrl" />
</FormItem>
<FormItem label="打印模板" prop="templateCode">
<Input class="label-appkey" v-model="formValidate.templateCode" />
</FormItem>
<FormItem label="月结号" prop="monthlyCardNo">
<Input class="label-appkey" v-model="formValidate.monthlyCardNo" />
</FormItem>
</div>
<div class="label-btns">
<Button type="primary" @click="submit('formValidate')"></Button>
</div>
@ -36,12 +55,13 @@ export default {
formValidate: { //
type: "",
kdniaoEbusinessID: "",
kdniaoAppKey: "" ,
kuaidi100Customer: "" ,
kuaidi100Key: "" ,},
kdniaoAppKey: "",
kuaidi100Customer: "",
kuaidi100Key: "",
},
};
},
props: ["res",'type'],
props: ["res", 'type'],
created() {
this.init();
},
@ -49,7 +69,7 @@ export default {
//
submit(name) {
let that = this;
if( handleSubmit(that, name )){
if (handleSubmit(that, name)) {
this.setupSetting()
}
},
@ -83,15 +103,17 @@ export default {
<style lang="scss" scoped>
@import "./style.scss";
.label-item {
display: flex;
}
/deep/ .ivu-input {
width: 300px !important;
margin: 0 10px;
}
.ivu-input-wrapper {
width: 300px;
margin-right: 10px;
}
</style>
}</style>

View File

@ -4,6 +4,7 @@ import {
postRequest,
putRequest,
deleteRequest,
getRequestHasHeader,
importRequest,
getRequestWithNoToken
} from "@/libs/axios";
@ -35,4 +36,13 @@ export const getCheckedOn = params =>{
return getRequest(`/other/logistics/getCheckedFaceSheet`,params);
}
//获取物流设置
export const getLogisticsSetting = () =>{
return getRequest(`/other/logistics/setting`);
}
export const getShunFengFaceSheet = (url,headers) =>{
return getRequestHasHeader(`${url}`,null,headers);
}

View File

@ -81,6 +81,11 @@ export const orderDelivery = (sn, params) => {
return postRequest(`/order/order/${sn}/delivery`, params);
};
// 订单发货
export const orderShunFengDelivery = (sn) => {
return postRequest(`/order/order/${sn}/shunfeng/delivery`);
};
// 获取商家选中的物流公司
export const getLogisticsChecked = () => {
return getRequest(`/other/logistics/getChecked`);

View File

@ -188,6 +188,38 @@ export const getRequest = (url, params, resBlob) => {
return service(data);
};
export const getRequestHasHeader = (url, params, headers) => {
let accessToken = getStore("accessToken");
let data = {
method: "get",
url: `${url}`,
params: params,
transformRequest: headers
? undefined
: [
function(data) {
let ret = "";
for (let it in data) {
ret +=
encodeURIComponent(it) +
"=" +
encodeURIComponent(data[it]) +
"&";
}
ret = ret.substring(0, ret.length - 1);
return ret;
}
],
headers: {
"Content-Type": "application/x-www-form-urlencoded",
accessToken: accessToken,
...headers
},
responseType: "blob"
};
return service(data);
};
export const postRequest = (url, params, headers) => {
let accessToken = getStore("accessToken");
return service({

File diff suppressed because it is too large Load Diff