Commit c5c259cd by LJM

WMS打印快递单--增加跨越物流打印

parent e4dc1690
......@@ -40,6 +40,13 @@
}
}
}
.filter-checkbox {
margin-top: 15rpx;
label {
margin-right: 10rpx;
font-size: 24rpx;
}
}
.list {
margin-top: 15rpx;
padding-bottom: 150rpx;
......
......@@ -150,7 +150,6 @@
}
}
.form-input {
margin-bottom: 18rpx;
.input-title {
margin-bottom: 10rpx;
.input-title-t1 {
......@@ -180,7 +179,6 @@
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
margin-bottom: 18rpx;
.wrap {
padding-left: 15rpx;
padding-right: 25rpx;
......@@ -223,6 +221,7 @@
}
}
.print {
margin-top: 16rpx;
margin-bottom: 27rpx;
.check-box-icon {
width: 20rpx;
......@@ -247,7 +246,7 @@
margin-bottom: 17rpx;
}
.btn {
margin: 0 auto;
margin: 26rpx auto 0;
.btn1 {
width: 100%;
height: 75rpx;
......
......@@ -607,8 +607,34 @@
}
}
&.box-drawer {
.radio-search-box {
height: 100rpx;
}
.rePrintTag {
.input-box {
margin-bottom: 16rpx;
.tt {
font-size: 16rpx;
color: #484b59;
}
.uni-input {
width: 83%;
height: 43rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
text-indent: 15rpx;
font-size: 16rpx;
margin-left: 2%;
}
.desc {
font-size: 16rpx;
color: #484b59;
margin-left: 5rpx;
}
}
}
.box-list {
margin-top: 50rpx;
.box-title {
margin-bottom: 18rpx;
.t1 {
......
<template>
<view class="stockRecheck">
<!-- 搜索 -->
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
......@@ -17,6 +18,22 @@
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<!-- 出库单状态筛选 -->
<checkbox-group class="row filter-checkbox" @change="checkboxChange">
<label class="row verCenter">
<checkbox value="5" checked="true" color="#1969f9" style="transform:scale(0.7)" />全部拣货
</label>
<label class="row verCenter">
<checkbox value="6" checked="true" color="#1969f9" style="transform:scale(0.7)" />部分复核
</label>
<label class="row verCenter">
<checkbox value="7" checked="true" color="#1969f9" style="transform:scale(0.7)" />全部复核
</label>
<label class="row verCenter">
<checkbox value="8" color="#1969f9" style="transform:scale(0.7)" />已完成
</label>
</checkbox-group>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
......@@ -45,7 +62,9 @@
<text class="label">总 数 量:</text>
<text class="tt">{{ item.total_qty }}</text>
</view>
<view class="btn-box row"><navigator :url="'/pages/stockRecheck/sort?stock_out_id=' + item.stock_out_id + '&stock_out_sn=' + item.stock_out_sn + '&warehouse_id=' + item.warehouse_id" class="btn1 row rowCenter verCenter" hover-class="none">选择</navigator></view>
<view class="btn-box row">
<navigator :url="'/pages/stockRecheck/sort?stock_out_id=' + item.stock_out_id + '&stock_out_sn=' + item.stock_out_sn + '&warehouse_id=' + item.warehouse_id" class="btn1 row rowCenter verCenter" hover-class="none">选择</navigator>
</view>
</view>
</view>
<!-- 无数据展示 -->
......@@ -53,153 +72,161 @@
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<view class="fix-btn row verCenter"><view class="btn2 row rowCenter verCenter" style="width: 100%;" @click="makeStockOutFinish">复核确认</view></view>
<view class="fix-btn row verCenter">
<view class="btn2 row rowCenter verCenter" style="width: 100%;" @click="makeStockOutFinish">复核确认</view>
</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 1000,
index: 0,
array: ['出库单号'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
searchParams: {
stock_out_sn: '' //出库单号
}
};
},
onShow() {
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/stockRecheck/print'
});
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 1000,
index: 0,
array: ['出库单号'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
searchParams: {
stock_out_status: '5,6,7', //出库单状态
stock_out_sn: '' //出库单号
}
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_out_id);
};
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_out_sn = '';
onShow() {
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
setTimeout(() => {
if (this.list.length == 1) {
uni.navigateTo({
url: '/pages/stockRecheck/sort?stock_out_id=' + this.list[0].stock_out_id + '&stock_out_sn=' + this.searchParams.stock_out_sn
});
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/stockRecheck/print'
});
}
},
methods: {
checkboxChange(e) {
console.log('checkbox发送选择改变,携带值为', e.detail.value);
this.searchParams.stock_out_status = e.detail.value.join(',');
this.getData();
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
}, 800);
} else {
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_out_id);
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getToCheckList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.filter_list = createArray(this.list.length, false);
this.searchParams.stock_out_sn = '';
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
setTimeout(() => {
if (this.list.length == 1) {
uni.navigateTo({
url: '/pages/stockRecheck/sort?stock_out_id=' + this.list[0].stock_out_id + '&stock_out_sn=' + this.searchParams.stock_out_sn
});
}
}, 800);
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getToCheckList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 复核确认
*/
makeStockOutFinish() {
if (this.filter_id.length == 0) {
uni.showToast({
title: res.msg,
title: '请勾选货物',
icon: 'error'
});
return false;
}
});
},
/**
* 复核确认
*/
makeStockOutFinish() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选货物',
icon: 'error'
});
return false;
}
if (this.filter_id.length > 5) {
uni.showToast({
title: '批量操作不能超过5条',
icon: 'error'
});
return false;
}
this.request(API.multiMakeStockOutFinish, 'POST', { stock_out_ids: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
if (this.filter_id.length > 5) {
uni.showToast({
title: '复核成功',
icon: 'success'
});
setTimeout(() => {
this.filter_id = [];
this.getData();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
title: '批量操作不能超过5条',
icon: 'error'
});
return false;
}
});
this.request(API.multiMakeStockOutFinish, 'POST', { stock_out_ids: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '复核成功',
icon: 'success'
});
setTimeout(() => {
this.filter_id = [];
this.getData();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/stockRecheck/index.scss';
</style>
@import '@/assets/css/stockRecheck/index.scss';
</style>
\ No newline at end of file
<template>
<view class="stockRecheck-print">
<!-- 搜索 -->
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker :value="index" :range="array">
......@@ -17,6 +18,7 @@
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<!-- 列表 -->
<view class="list" v-if="list.length > 0">
<view class="box row" v-for="(item, index) in list" :key="index">
<view class="input-box row verCenter">
......@@ -102,82 +104,92 @@
</view>
</view>
<view class="bor"></view>
<view class="item-tit row verCenter bothSide">
<view class="item-tit row verCenter bothSide" style="margin-bottom: 0;">
<text>交货信息</text>
<view class="text">
<text class="label">包 裹 数:</text>
<text class="tt">{{ detail.stock_out_info.box_num }}</text>
</view>
</view>
<view class="form-input">
<view class="input-title">
<text class="input-title-t1">*</text>
<text class="input-title-t2">交货方式:</text>
<!-- 交货信息start -->
<view class="row bothSide verCenter">
<view class="form-input" style="width: 48%;">
<view class="input-title">
<text class="input-title-t1">*</text>
<text class="input-title-t2">交货方式:</text>
</view>
<view class="select-box row">
<picker @change="bindPickerChange(1, $event)" :value="real_shipping_type_index" :range="real_shipping_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_type_index == -1 ? '请选择' : real_shipping_type_data[real_shipping_type_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="select-box row">
<picker @change="bindPickerChange(1, $event)" :value="real_shipping_type_index" :range="real_shipping_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_type_index == -1 ? '请选择' : real_shipping_type_data[real_shipping_type_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<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-t2">物流公司:</text>
</view>
<view class="select-box row">
<picker @change="bindPickerChange(2, $event)" :value="real_shipping_id_index" :range="real_shipping_id_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_id_index == -1 ? '请选择' : real_shipping_id_data[real_shipping_id_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
</view>
<view class="form-input">
<view class="input-title">
<text class="input-title-t1" v-if="formParams.real_shipping_type != 2">*</text>
<text class="input-title-t2">物流公司:</text>
</view>
<view class="select-box row">
<picker @change="bindPickerChange(2, $event)" :value="real_shipping_id_index" :range="real_shipping_id_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_id_index == -1 ? '请选择' : real_shipping_id_data[real_shipping_id_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<view class="row bothSide verCenter">
<view class="form-input" style="width: 48%;">
<view class="input-title"><text class="input-title-t2">物流模式:</text></view>
<view class="select-box row">
<picker @change="bindPickerChange(3, $event)" :value="real_shipping_mode_index" :range="real_shipping_mode_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_mode_index == -1 ? '请选择' : real_shipping_mode_data[real_shipping_mode_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t2">物流模式:</text></view>
<view class="select-box row">
<picker @change="bindPickerChange(3, $event)" :value="real_shipping_mode_index" :range="real_shipping_mode_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_mode_index == -1 ? '请选择' : real_shipping_mode_data[real_shipping_mode_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<view class="form-input" style="width: 48%;">
<view class="input-title"><text class="input-title-t2">物流单号:</text></view>
<view class="input-box">
<template v-if="formParams.real_shipping_type == 1 && formParams.real_shipping_id == 1 && company_id == 1">
<input type="text" disabled style="background-color: #f6f6f6;border: 1px solid #eee;" class="uni-input" placeholder-style="color:#919399" placeholder="" v-model="formParams.shipping_code" />
</template>
<template v-else>
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.shipping_code" />
</template>
</view>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t2">物流单号:</text></view>
<view class="input-box">
<template v-if="formParams.real_shipping_type == 1 && formParams.real_shipping_id == 1 && company_id == 1">
<input type="text" disabled style="background-color: #f6f6f6;border: 1px solid #eee;" class="uni-input" placeholder-style="color:#919399" placeholder="" v-model="formParams.shipping_code" />
</template>
<template v-else>
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.shipping_code" />
</template>
<view class="row bothSide verCenter">
<view class="form-input" style="width: 48%;">
<view class="input-title"><text class="input-title-t2">物流付费:</text></view>
<view class="select-box row">
<picker @change="bindPickerChange(4, $event)" :value="shipping_payment_type_index" :range="shipping_payment_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ shipping_payment_type_index == -1 ? '请选择' : shipping_payment_type_data[shipping_payment_type_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t2">物流付费:</text></view>
<view class="select-box row">
<picker @change="bindPickerChange(4, $event)" :value="shipping_payment_type_index" :range="shipping_payment_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ shipping_payment_type_index == -1 ? '请选择' : shipping_payment_type_data[shipping_payment_type_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<view class="form-input" style="width: 48%;">
<view class="input-title"><text class="input-title-t2">客户快递账号:</text></view>
<view class="input-box">
<input type="text" disabled style="background-color: #f6f6f6;border: 1px solid #eee;" class="uni-input" placeholder-style="color:#919399" placeholder="请输入客户快递账号" v-model="formParams.client_express_account" />
</view>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t2">客户快递账号:</text></view>
<view class="input-box"><input type="text" disabled style="background-color: #f6f6f6;border: 1px solid #eee;" class="uni-input" placeholder-style="color:#919399" placeholder="" v-model="formParams.client_express_account" /></view>
</view>
<view class="print row verCenter" v-if="detail.stock_out_info">
<text class="check-box-icon" :class="{ curr: detail.stock_out_info.is_receipt == 1 }"></text>
<text class="tt">签回单</text>
</view>
<!-- 交货信息end -->
<view class="bor"></view>
<view class="item-tit">地址信息</view>
<view class="field-item row">
......@@ -186,6 +198,7 @@
<text class="tt" style="max-width: 100%;">{{ detail.stock_out_info.customer_name }}</text>
</view>
</view>
<!-- 地址信息start -->
<view class="row bothSide verCenter">
<view class="form-input" style="width: 48%;">
<view class="input-title">
......@@ -243,7 +256,10 @@
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.address" /></view>
</view>
</view>
<view class="btn row verCenter bothSide"><view class="btn1 row rowCenter verCenter" style="width: 100%;" @click="updateDeliveryInfo(detail.stock_out_info.stock_out_id)">保存</view></view>
<!-- 地址信息end -->
<view class="btn row verCenter bothSide">
<view class="btn1 row rowCenter verCenter" style="width: 100%;" @click="updateDeliveryInfo(detail.stock_out_info.stock_out_id)">保存</view>
</view>
</scroll-view>
</view>
</uni-drawer>
......@@ -251,317 +267,329 @@
</template>
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
company_id: uni.getStorageSync('company_id') || 1,
input_flag: false,
flag: false,
page: 1,
limit: 30,
list: [],
index: 0,
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_id_data: [], //物流公司数据
real_shipping_mode_data: [{ name: '空运', value: 1 }, { name: '陆运', value: 2 }], //物流模式数据
searchParams: {
stock_out_sn: ''
},
shipping_payment_type_data: [{ name: '寄件月结', value: 1 }, { name: '寄件到付', value: 2 }],
shipping_payment_type_index: -1,
hasMoreData: true, //是否分页加载
formParams: {
real_shipping_type: '', //交货方式
real_shipping_id: '', //物流公司
real_shipping_mode: '', //物流模式
shipping_code: '', //物流单号
is_receipt: '', //是否签回单
shipping_payment_type: '', //物流付费
client_express_account: '', //客户快递账号
consignee: '',
country: '',
mobile: '',
province: '',
city: '',
district: '',
address: ''
}
};
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
onShow() {
this.getData();
},
methods: {
toggel() {
this.flag = !this.flag;
if (this.flag) {
this.formParams.is_receipt = 1;
} else {
this.formParams.is_receipt = -1;
}
},
bindPickerChange: function(type, e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
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;
export default {
data() {
return {
company_id: uni.getStorageSync('company_id') || 1,
input_flag: false,
flag: false,
page: 1,
limit: 30,
list: [],
index: 0,
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_id_data: [], //物流公司数据
real_shipping_mode_data: [{ name: '空运', value: 1 }, { name: '陆运', value: 2 }], //物流模式数据
searchParams: {
stock_out_sn: ''
},
shipping_payment_type_data: [{ name: '寄件月结', value: 1 }, { name: '寄件到付', value: 2 }],
shipping_payment_type_index: -1,
hasMoreData: true, //是否分页加载
formParams: {
real_shipping_type: '', //交货方式
real_shipping_id: '', //物流公司
real_shipping_mode: '', //物流模式
shipping_code: '', //物流单号
is_receipt: '', //是否签回单
shipping_payment_type: '', //物流付费
client_express_account: '', //客户快递账号
consignee: '',
country: '',
mobile: '',
province: '',
city: '',
district: '',
address: ''
}
this.realShippChage();
} 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;
} 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;
} else if (type == 4) {
this.shipping_payment_type_index = e.detail.value;
this.formParams.shipping_payment_type = this.shipping_payment_type_data[e.detail.value].value;
}
};
},
/**
* 根据所选的交货方式,显示对应的物流公司
* @param {Object} value
*/
realShippChage() {
let value = this.formParams.real_shipping_type;
this.real_shipping_id_data = [];
if (value == 1) {
this.real_shipping_id_data.push({ name: '顺丰', value: 1 }, { name: '京东', value: 11 }, { name: '中通', value: 18 }, { name: '韵达', value: 5 });
} else if (value == 2) {
this.real_shipping_id_data = [];
} else if (value == 3) {
this.real_shipping_id_data.push({ name: '自提', value: 10 });
} else if (value == 4) {
this.real_shipping_id_data.push({ name: '顺丰同城', value: 19 }, { name: '货拉拉', value: 20 }, { name: '跨越速运', value: 21 });
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
showDrawer(stock_out_sn) {
this.$refs.showRight.open();
this.getStockOutDetail(stock_out_sn);
},
closeDrawer() {
this.$refs.showRight.close();
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_out_sn = '';
onShow() {
this.getData();
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item.value === target) {
result.push(index);
methods: {
/**
* @param {Object} type 1:交货方式 2:物流公司 3:物流模式 4:物流付费
* @param {Object} e
*/
bindPickerChange: function(type, e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
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();
} 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;
} 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;
} else if (type == 4) {
this.shipping_payment_type_index = e.detail.value;
this.formParams.shipping_payment_type = this.shipping_payment_type_data[e.detail.value].value;
}
});
return result;
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
},
/**
* 根据所选的交货方式,显示对应的物流公司
* @param {Object} value
*/
realShippChage(callback) {
let value = this.formParams.real_shipping_type; //交货方式
this.real_shipping_id_data = []; //物流公司
if (value == 1) {
this.real_shipping_id_data.push({ name: '顺丰', value: 1 }, { name: '京东', value: 11 }, { name: '中通', value: 18 }, { name: '韵达', value: 5 });
} else if (value == 2) {
this.real_shipping_id_data = [];
} else if (value == 3) {
this.real_shipping_id_data.push({ name: '自提', value: 10 });
} else if (value == 4) {
this.real_shipping_id_data.push({ name: '顺丰同城', value: 19 }, { name: '货拉拉', value: 20 }, { name: '跨越速运', value: 21 });
}
typeof callback == 'function' && callback();
},
/**
* 更新物流模式
*/
updateRealShippingId(real_shipping_id) {
//物流公司为跨越速运
if (real_shipping_id == 21) {
this.real_shipping_mode_data = [];
this.real_shipping_mode_data.push({ name: '当天达', value: 10 }, { name: '次日达', value: 20 }, { name: '隔日达', value: 30 }, { name: '陆运件', value: 40 }, { name: '同城次日', value: 50 }, { name: '同城即日', value: 70 }, { name: '省内次日', value: 160 }, { name: '省内即日', value: 170 }, { name: '空运', value: 210 }, { name: '专运', value: 220 });
this.$forceUpdate();
}
},
showDrawer(stock_out_sn) {
this.$refs.showRight.open();
this.getStockOutDetail(stock_out_sn);
},
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getToPrintList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
} else {
this.hasMoreData = false;
this.searchParams.stock_out_sn = '';
this.getData();
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item.value === target) {
result.push(index);
}
});
return result;
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
this.input_flag = false;
}
});
},
/**
* 详情
*/
getStockOutDetail(stock_out_sn) {
this.request(API.getStockOutDetail, 'POST', { stock_out_sn: stock_out_sn }, true).then(res => {
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.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getToPrintList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 详情
*/
getStockOutDetail(stock_out_sn) {
this.request(API.getStockOutDetail, 'POST', { stock_out_sn: stock_out_sn }, true).then(res => {
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.realShippChage(); //更新物流公司
this.updateRealShippingId(res.data.stock_out_address.real_shipping_id); //更新物流模式
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);
console.log(real_shipping_id_index);
this.real_shipping_id_index = real_shipping_id_index[0];
setTimeout(() => {
//显示对应的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_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.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.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];
//显示对应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; //物流单号
this.formParams.shipping_code = res.data.stock_out_address.shipping_code; //物流单号
this.formParams.country = res.data.stock_out_address.country;
this.formParams.consignee = res.data.stock_out_address.consignee;
this.formParams.mobile = res.data.stock_out_address.mobile;
this.formParams.province = res.data.stock_out_address.province;
this.formParams.city = res.data.stock_out_address.city;
this.formParams.district = res.data.stock_out_address.district;
this.formParams.address = res.data.stock_out_address.address;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 更新交货信息
*/
updateDeliveryInfo(stock_out_id) {
if (this.company_id == 1) {
if (!this.formParams.province) {
uni.showToast({
title: '请填写省',
icon: 'none'
});
return false;
}
if (!this.formParams.city) {
uni.showToast({
title: '请填写市',
icon: 'none'
});
return false;
}
if (!this.formParams.district) {
uni.showToast({
title: '请填写区',
icon: 'none'
});
return false;
//显示对应的地址栏信息
this.formParams.country = res.data.stock_out_address.country;
this.formParams.consignee = res.data.stock_out_address.consignee;
this.formParams.mobile = res.data.stock_out_address.mobile;
this.formParams.province = res.data.stock_out_address.province;
this.formParams.city = res.data.stock_out_address.city;
this.formParams.district = res.data.stock_out_address.district;
this.formParams.address = res.data.stock_out_address.address;
}, 500)
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 更新交货信息
*/
updateDeliveryInfo(stock_out_id) {
if (this.company_id == 1) {
if (!this.formParams.province) {
uni.showToast({
title: '请填写省',
icon: 'none'
});
return false;
}
if (!this.formParams.city) {
uni.showToast({
title: '请填写市',
icon: 'none'
});
return false;
}
if (!this.formParams.district) {
uni.showToast({
title: '请填写区',
icon: 'none'
});
return false;
}
}
}
this.request(
API.updateDeliveryInfo,
'POST',
{
stock_out_id: stock_out_id,
real_shipping_type: this.formParams.real_shipping_type,
real_shipping_id: this.formParams.real_shipping_id,
real_shipping_mode: this.formParams.real_shipping_mode,
shipping_code: this.formParams.shipping_code,
shipping_payment_type: this.formParams.shipping_payment_type,
consignee: this.formParams.consignee,
mobile: this.formParams.mobile,
province: this.formParams.province,
city: this.formParams.city,
district: this.formParams.district,
address: this.formParams.address
},
true
).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 打印快递单
*/
printExpress(stock_out_id) {
this.request(API.printExpress, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.showLoading({
title: '正在打印中,请查看打印机'
});
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.request(
API.updateDeliveryInfo,
'POST', {
stock_out_id: stock_out_id,
real_shipping_type: this.formParams.real_shipping_type,
real_shipping_id: this.formParams.real_shipping_id,
real_shipping_mode: this.formParams.real_shipping_mode,
shipping_code: this.formParams.shipping_code,
shipping_payment_type: this.formParams.shipping_payment_type,
consignee: this.formParams.consignee,
mobile: this.formParams.mobile,
province: this.formParams.province,
city: this.formParams.city,
district: this.formParams.district,
address: this.formParams.address
},
true
).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 打印快递单
*/
printExpress(stock_out_id) {
this.request(API.printExpress, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.showLoading({
title: '正在打印中,请查看打印机'
});
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/stockRecheck/print.scss';
</style>
@import '@/assets/css/stockRecheck/print.scss';
</style>
\ No newline at end of file
......@@ -575,39 +575,70 @@
<text class="iconfont icon-juxing2" @click="closeBox()"></text>
<text class="text">箱信息</text>
</view>
<view class="box-list">
<view class="box-wrap" v-for="(item, i) in packList" :key="i">
<view class="box-title row bothSide verCenter">
<text class="t1">打包箱号:{{ item.box_name }}</text>
<view>
<picker @change="bindPickerBoxChange($event, i)" :value="index" :range="packConfigList" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input-show">{{ index == -1 ? '请选择' : packConfigList[index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<!-- 箱类型 -->
<view class="radio-search-box row verCenter">
<radio-group @change="radioChange" class="row verCenter">
<label class="radio row verCenter">
<radio value="0" :checked="custome_box_info_index == 0" style="transform:scale(0.7)" color="#1969F9" />
<text class="tt">按复核数据</text>
</label>
<label class="radio">
<radio value="1" :checked="custome_box_info_index == 1" style="transform:scale(0.7)" color="#1969F9" />
<text class="tt">手动填写</text>
</label>
</radio-group>
</view>
<!-- 按复核数据 -->
<template v-if="custome_box_info_index == 0">
<view class="box-list">
<view class="box-wrap" v-for="(item, i) in packList" :key="i">
<view class="box-title row bothSide verCenter">
<text class="t1">打包箱号:{{ item.box_name }}</text>
<view>
<picker @change="bindPickerBoxChange($event, i)" :value="index" :range="packConfigList" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input-show">{{ index == -1 ? '请选择' : packConfigList[index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="row avarage verCenter box-row">
<text style="flex: 0 0 20%;">长cm</text>
<text style="flex: 0 0 20%;">宽cm</text>
<text style="flex: 0 0 20%;">高cm</text>
<text style="flex: 0 0 20%;">净重kg</text>
<text style="flex: 0 0 20%;">毛量kg</text>
</view>
<view class="row avarage verCenter">
<input type="text" placeholder="长cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].length" />
<input type="text" placeholder="宽cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].width" />
<input type="text" placeholder="高cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].hight" />
<input type="text" placeholder="净重kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].net_weight" />
<input type="text" placeholder="毛量kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].gross_weight" />
</view>
</view>
<view class="row avarage verCenter box-row">
<text style="flex: 0 0 20%;">长cm</text>
<text style="flex: 0 0 20%;">宽cm</text>
<text style="flex: 0 0 20%;">高cm</text>
<text style="flex: 0 0 20%;">净重kg</text>
<text style="flex: 0 0 20%;">毛量kg</text>
</view>
<view class="row avarage verCenter">
<input type="text" placeholder="长cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].length" />
<input type="text" placeholder="宽cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].width" />
<input type="text" placeholder="高cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].hight" />
<input type="text" placeholder="净重kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].net_weight" />
<input type="text" placeholder="毛量kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].gross_weight" />
<view class="no-date column rowCenter verCenter" v-if="packList.length == 0">
<text class="iconfont icon-a-juxing21"></text>
<text class="text">暂无箱信息</text>
</view>
</view>
<view class="no-date column rowCenter verCenter" v-if="packList.length == 0">
<text class="iconfont icon-a-juxing21"></text>
<text class="text">暂无箱信息</text>
</template>
<!-- 手动填写 -->
<template v-else-if="custome_box_info_index == 1">
<view class="rePrintTag">
<view class="input-box row verCenter">
<text class="tt">总箱数</text>
<input class="uni-input" placeholder="请输入总箱数" placeholder-style="color:#919399" v-model="setCustomBoxInfoParams.total_box_num" />
</view>
<view class="input-box row verCenter">
<text class="tt">总重量</text>
<input class="uni-input" placeholder="请输入总箱数" placeholder-style="color:#919399" v-model="setCustomBoxInfoParams.total_weight" />
<text class="desc">kg</text>
</view>
</view>
</view>
</template>
<view class="btn row verCenter bothSide">
<view class="btn0 row rowCenter verCenter" @click="closeBox()">取 消</view>
<view class="btn1 row rowCenter verCenter" style="width: 50%;" @click="updatePackInfo()">确认</view>
......@@ -660,6 +691,7 @@
image_list: [], //图片列表
maxNum: 10, //最大上传图片数量
maxlength: 15, //输入框长度15
custome_box_info_index: 0, //箱规格设置
searchParams: {
stock_out_id: '',
box_name: '001',
......@@ -669,6 +701,12 @@
formParams: {
recheck_qty: ''
},
//手动填写参数集合
setCustomBoxInfoParams: {
stock_out_id: '',
total_box_num: '',
total_weight: ''
},
//打印货品标签参数集合
rePrintTagParams: {
stock_out_item_id: '',
......@@ -686,6 +724,7 @@
},
onLoad(options) {
this.searchParams.stock_out_id = options.stock_out_id || '';
this.setCustomBoxInfoParams.stock_out_id = options.stock_out_id || '';
this.warehouse_id = options.warehouse_id || '';
this.stock_out_sn = options.stock_out_sn || '';
//深圳自营仓-默认选择旧标签
......@@ -701,6 +740,13 @@
methods: {
/**
* @param {Object} e
* 箱信息选择
*/
radioChange(e) {
this.custome_box_info_index = e.detail.value;
},
/**
* @param {Object} e
* @param {Object} type 1旧标签 批量扫描监听
*/
switchChange(e, type) {
......@@ -959,7 +1005,15 @@
getPackList() {
this.request(API.getPackList, 'POST', { stock_out_id: this.searchParams.stock_out_id }, false).then(res => {
if (res.code === 0) {
this.packList = res.data.list;
if (this.company_id == 1 || this.company_id == 3) {
//猎芯和华云
this.packList = res.data.list;
} else if (this.company_id == 2) {
//深茂
this.custome_box_info_index = 1;
this.setCustomBoxInfoParams.total_box_num = res.data.custome_box_info.total_box_num; //更新后台总箱数
this.setCustomBoxInfoParams.total_weight = res.data.custome_box_info.total_weight; //更新后台总重量
}
} else {
uni.showToast({
title: res.msg,
......@@ -1239,14 +1293,36 @@
* 保存打包信息
*/
updatePackInfo() {
if (this.packList.length > 0) {
var parmas = {
pack_list: JSON.stringify(this.packList)
};
this.request(API.updatePackInfo, 'POST', parmas, true).then(res => {
if (this.custome_box_info_index == 0) {
//按复核数据
if (this.packList.length > 0) {
var parmas = {
pack_list: JSON.stringify(this.packList)
};
this.request(API.updatePackInfo, 'POST', parmas, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.closeBox();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
} else if (this.custome_box_info_index == 1) {
//手动填写
this.request(API.setCustomBoxInfo, 'POST', this.setCustomBoxInfoParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
title: '手动填写成功',
icon: 'success'
});
setTimeout(() => {
......@@ -1269,6 +1345,13 @@
this.getPackList(); //获取箱信息
this.getBoxConfigList(); //获取箱配置
this.index = -1;
if (this.company_id == 1 || this.company_id == 3) {
//猎芯和华云
this.custome_box_info_index = 0;
} else if (this.company_id == 2) {
//深茂
this.custome_box_info_index = 1;
}
this.$refs.showBoxInfo.open();
},
/**
......
// 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 = {
......@@ -292,6 +292,10 @@ const API = {
* */
updatePackInfo: API_BASE + '/api/stockRecheck/updatePackInfo',
/**
* 手动填写打包信息
* */
setCustomBoxInfo: API_BASE + '/api/stockRecheck/setCustomBoxInfo',
/**
* 获取产地
* */
getUseOption: API_BASE + '/api/stockIn/getUseOption',
......
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