Commit 61db5430 by LJM

新增基础资料--运输资料--快递物流、快递物流配置

parent 514230b2
Showing with 146 additions and 40 deletions
......@@ -129,7 +129,7 @@
</view>
<view class="form-input" style="width: 48%;">
<view class="input-title">
<text class="input-title-t1" v-if="formParams.real_shipping_type != 2">*</text>
<text class="input-title-t1">*</text>
<text class="input-title-t2">物流公司:</text>
</view>
<view class="select-box row">
......@@ -281,20 +281,26 @@
limit: 30,
list: [],
index: 0,
array: ['出库单号'],
detail: {},
real_shipping_type_index: -1,
real_shipping_id_index: -1,
real_shipping_mode_index: -1,
array: ['出库单号'],
detail: {},
real_shipping_type_data: [{ name: '快递', value: 1 }, { name: '自送', value: 2 }, { name: '客户自取', value: 3 }, { name: '同城物流', value: 4 }], //交货方式数据
real_shipping_type_data: [], //交货方式数据
real_shipping_id_data: [], //物流公司数据
real_shipping_mode_data: [{ name: '空运', value: 1 }, { name: '陆运', value: 2 }, { name: '半日达', value: 263 }], //物流模式数据
real_shipping_mode_data: [], //物流模式数据
searchParams: {
stock_out_sn: ''
},
shipping_payment_type_data: [{ name: '寄件月结', value: 1 }, { name: '寄件到付', value: 2 }],
shipping_payment_type_index: -1,
hasMoreData: true, //是否分页加载
shippingListParams: {
warehouse_id: '',
warehouse_name: '',
shipping_type: '',
shipping_id: ''
},
formParams: {
real_shipping_type: '', //交货方式
real_shipping_id: '', //物流公司
......@@ -340,22 +346,14 @@
if (type == 1) {
this.real_shipping_type_index = e.detail.value;
this.formParams.real_shipping_type = this.real_shipping_type_data[e.detail.value].value;
if (this.formParams.real_shipping_type == 2) {
this.real_shipping_id_index = -1;
} else {
this.real_shipping_id_index = 0;
}
this.realShippChage();
this.shippingListParams.shipping_type = this.formParams.real_shipping_type;
this.shippingListParams.shipping_id = '';
this.getShippingList();
} else if (type == 2) {
this.real_shipping_id_index = e.detail.value;
this.formParams.real_shipping_id = this.real_shipping_id_data[e.detail.value].value;
//物流公司为跨越速运更新物流模式
this.updateRealShippingId(this.formParams.real_shipping_id);
if (this.formParams.real_shipping_id == 21) {
this.real_shipping_mode_index = 3; //设置默认为物流模式为陆运件
} else {
this.real_shipping_mode_index = 0; //设置默认为物流模式为空运
}
this.shippingListParams.shipping_id = this.formParams.real_shipping_id;
this.getShippingList();
} else if (type == 3) {
this.real_shipping_mode_index = e.detail.value;
this.formParams.real_shipping_mode = this.real_shipping_mode_data[e.detail.value].value;
......@@ -458,6 +456,108 @@
this.getData();
}, 500),
/**
* 物流联动信息获取
*/
getShippingList(selected_shipping_type, selected_shipping_id, selected_shipping_mode) {
this.request(API.getShippingList, 'POST', this.shippingListParams, true).then(res => {
if (res.code === 0) {
// 第一步:获取交货方式列表
if (this.shippingListParams.warehouse_id && !this.shippingListParams.shipping_type && !this.shippingListParams.shipping_id) {
const shippingTypeList = res.data.shipping_type_list || {};
this.real_shipping_type_data = Object.entries(shippingTypeList).map(([value, name]) => ({
name,
value: parseInt(value)
}));
if(this.real_shipping_type_data.length === 0) {
this.real_shipping_type_data = [];
this.real_shipping_id_data = [];
this.real_shipping_mode_data = [];
this.real_shipping_type_index = 0;
this.real_shipping_id_index = 0;
this.real_shipping_mode_index = 0;
return;
}
// 如果有传入交货方式,则选中对应的值
if (selected_shipping_type) {
this.shippingListParams.shipping_type = selected_shipping_type;
const index = this.real_shipping_type_data.findIndex(item => item.value === selected_shipping_type);
if (index > -1) {
this.real_shipping_type_index = index;
this.formParams.real_shipping_type = selected_shipping_type;
}
} else {
this.shippingListParams.shipping_type = this.real_shipping_type_data[0].value;
}
this.getShippingList(selected_shipping_type, selected_shipping_id, selected_shipping_mode);
return;
}
// 第二步:获取物流公司列表
if (this.shippingListParams.warehouse_id && this.shippingListParams.shipping_type && !this.shippingListParams.shipping_id) {
const shippingList = res.data.shipping_list || [];
this.real_shipping_id_data = shippingList.map(item => ({
name: item.name,
value: item.id
}));
if(this.real_shipping_id_data.length === 0) {
this.real_shipping_id_data = [];
this.real_shipping_mode_data = [];
this.real_shipping_id_index = 0;
this.real_shipping_mode_index = 0;
return;
}
// 如果有传入物流公司,则选中对应的值
if (selected_shipping_id) {
this.shippingListParams.shipping_id = selected_shipping_id;
const index = this.real_shipping_id_data.findIndex(item => item.value === selected_shipping_id);
if (index > -1) {
this.real_shipping_id_index = index;
this.formParams.real_shipping_id = selected_shipping_id;
}
} else {
this.shippingListParams.shipping_id = this.real_shipping_id_data[0].value;
}
this.getShippingList(selected_shipping_type, selected_shipping_id, selected_shipping_mode);
return;
}
// 第三步:获取物流模式列表
if (this.shippingListParams.warehouse_id && this.shippingListParams.shipping_type && this.shippingListParams.shipping_id) {
const shippingMode = res.data.shipping_mode || [];
this.real_shipping_mode_data = shippingMode.map(item => ({
name: item.shipping_mode_name,
value: item.id
}));
if(this.real_shipping_mode_data.length === 0) {
this.real_shipping_mode_data = [];
this.real_shipping_mode_index = 0;
return;
}
// 如果有传入物流模式,则选中对应的值
if (selected_shipping_mode) {
const index = this.real_shipping_mode_data.findIndex(item => item.value === selected_shipping_mode);
if (index > -1) {
this.real_shipping_mode_index = index;
this.formParams.real_shipping_mode = selected_shipping_mode;
}
}
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取列表数据
*/
getData() {
......@@ -485,29 +585,32 @@
if (res.code === 0) {
this.detail = res.data;
this.formParams.client_express_account = res.data.stock_out_address.client_express_account || ''; //客户快递账号
this.formParams.real_shipping_type = res.data.stock_out_address.real_shipping_type; //交货方式
let real_shipping_type_index = this.findIndex(this.real_shipping_type_data, this.formParams.real_shipping_type);
this.real_shipping_type_index = real_shipping_type_index[0];
this.realShippChage(); //更新物流公司
this.updateRealShippingId(res.data.stock_out_address.real_shipping_id); //更新物流模式
this.shippingListParams.warehouse_id = res.data.stock_out_info.warehouse_id;
this.getShippingList(res.data.stock_out_address.real_shipping_type, res.data.stock_out_address.real_shipping_id, res.data.stock_out_address.real_shipping_mode); //物流联动信息获取
setTimeout(() => {
// this.formParams.real_shipping_type = res.data.stock_out_address.real_shipping_type; //交货方式
// let real_shipping_type_index = this.findIndex(this.real_shipping_type_data, this.formParams.real_shipping_type);
// this.real_shipping_type_index = real_shipping_type_index[0];
//显示对应的index的物流公司
this.formParams.real_shipping_id = res.data.stock_out_address.real_shipping_id; //物流公司
let real_shipping_id_index = this.findIndex(this.real_shipping_id_data, this.formParams.real_shipping_id);
this.real_shipping_id_index = real_shipping_id_index[0];
// this.formParams.real_shipping_id = res.data.stock_out_address.real_shipping_id; //物流公司
// let real_shipping_id_index = this.findIndex(this.real_shipping_id_data, this.formParams.real_shipping_id);
// this.real_shipping_id_index = real_shipping_id_index[0];
//显示对应index的物流模式
this.formParams.real_shipping_mode = res.data.stock_out_address.real_shipping_mode; //物流模式
let real_shipping_mode_index = this.findIndex(this.real_shipping_mode_data, this.formParams.real_shipping_mode);
this.real_shipping_mode_index = real_shipping_mode_index[0];
// this.formParams.real_shipping_mode = res.data.stock_out_address.real_shipping_mode; //物流模式
// let real_shipping_mode_index = this.findIndex(this.real_shipping_mode_data, this.formParams.real_shipping_mode);
// this.real_shipping_mode_index = real_shipping_mode_index[0];
//显示对应index的物流付费
this.formParams.shipping_payment_type = res.data.stock_out_address.shipping_payment_type; //物流付费
let shipping_payment_type_index = this.findIndex(this.shipping_payment_type_data, this.formParams.shipping_payment_type);
this.shipping_payment_type_index = shipping_payment_type_index[0];
this.formParams.shipping_code = res.data.stock_out_address.shipping_code; //物流单号
//显示对应的地址栏信息
......
// const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
// const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
// const API_BASE = 'http://wms.liexindev.net'; //WMS系统
// const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
const API_BASE = 'https://wms.ichunt.net'; //WMS系统
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = {
......@@ -403,7 +402,11 @@ const API = {
/**
* 预检单补打标签
* */
stockPreCheckLatePrint: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckLatePrint'
stockPreCheckLatePrint: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckLatePrint',
/**
* 对外开放-物流联动信息获取
* */
getShippingList: API_BASE + '/open/shipping/getShippingList'
}
......
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 sign in to comment