Commit 6d3b5244 by LJM

预检单--支持移动端作业

parent d891fe63
...@@ -40,7 +40,17 @@ ...@@ -40,7 +40,17 @@
font-size: 24rpx; font-size: 24rpx;
color: #1969f9; color: #1969f9;
} }
.preCheck {
margin-top: 15rpx;
.t1 {
font-size: 18rpx;
color: #292b33;
}
.t2 {
font-size: 19rpx;
color: #1969f9;
}
}
.search-box { .search-box {
height: 60rpx; height: 60rpx;
.search-box-wrap { .search-box-wrap {
...@@ -248,7 +258,7 @@ ...@@ -248,7 +258,7 @@
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
sfont-size: 30rpx; font-size: 30rpx;
color: #292b33; color: #292b33;
} }
.text { .text {
......
.preCheckList {
padding: 15rpx 22rpx;
.search-box {
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
.sn {
width: 164rpx;
height: 35rpx;
border-right: 1px solid #f0f0f2;
.uni-input {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
}
.search-bar {
width: calc(100% - 164rpx);
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
margin-left: 17rpx;
margin-right: 13rpx;
}
.uni-input {
font-size: 18rpx;
color: #484b59;
}
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
}
}
}
.search-params {
margin-top: 15rpx;
.sn {
width: 47%;
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
.uni-input {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
}
}
.list {
margin-top: 15rpx;
padding-bottom: 100rpx;
.box {
position: relative;
padding: 15px 17rpx 18rpx 17rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
margin-bottom: 15rpx;
flex-wrap: wrap;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
top: 17rpx;
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
}
&.curr {
border: 1px solid #1969f9;
.check-box-icon {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.input-box {
margin-bottom: 11rpx;
flex: 0 0 50%;
.bor {
height: 1px;
background-color: #f0f0f2;
color: #f0f0f2;
margin-bottom: 10rpx;
}
.label {
width: 114rpx;
font-size: 17rpx;
color: #919399;
white-space: nowrap;
}
.text {
font-size: 17rpx;
color: #484b59;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.desc {
font-size: 17rpx;
color: #484b59;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.tt {
font-size: 17rpx;
color: #1969f9;
}
.pick_img_list {
flex-wrap: wrap;
.default {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
.iconfont {
font-size: 60rpx;
color: #c6c7cc;
}
}
.img_list {
position: relative;
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.iconfont {
position: absolute;
right: 0;
top: 0;
font-size: 30rpx;
color: #ff3700;
z-index: 9;
}
}
}
}
.btn-box {
position: absolute;
right: 17rpx;
bottom: 13rpx;
.btn1 {
width: 75rpx;
height: 30rpx;
background: #fff;
border-radius: 8rpx;
font-size: 15rpx;
color: #f00;
border: 1px solid #f00;
margin-right: 10rpx;
}
.btn2 {
width: 68rpx;
height: 30rpx;
background: #1969f9;
border-radius: 8rpx;
font-size: 15rpx;
color: #ffffff;
}
}
.status-box {
position: absolute;
right: 50rpx;
top: 5rpx;
.staus_type_val {
font-size: 17rpx;
color: #1969f9;
border: 1px solid #f0f0f2;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 10rpx;
}
}
}
}
.fix-btn {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
z-index: 999;
.btn1 {
width: 128rpx;
height: 75rpx;
background: #ffffff;
border-right: 1px solid #f0f0f2;
.check-box-icon {
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
&.curr {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.text {
margin-left: 10rpx;
font-size: 20rpx;
color: #484b59;
}
}
.btn2 {
width: 300rpx;
height: 75rpx;
background: #02a7f0;
font-size: 23rpx;
color: #ffffff;
}
.btn3 {
width: calc(100% - 428rpx);
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
}
}
::v-deep .uni-drawer__content {
width: 85% !important;
}
.uni-drawer-layer {
width: 100%;
background-color: #ffffff;
padding: 22rpx 22rpx 0 22rpx;
.tip {
color: red;
font-size: 17rpx;
margin-top: 28rpx;
}
.title {
position: relative;
.iconfont {
position: absolute;
left: 0;
top: 0;
font-size: 30rpx;
color: #292b33;
}
.text {
font-size: 23rpx;
color: #292b33;
font-weight: bold;
}
}
.p-text {
margin-top: 38rpx;
margin-bottom: 25rpx;
.tt {
font-size: 20rpx;
color: #484b59;
}
.ed {
font-weight: bold;
font-size: 20rpx;
color: #1969f9;
}
}
.pp {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-bottom: 17rpx;
margin-top: 35rpx;
transition: all 0.2s ease;
&.pt {
margin-bottom: 35rpx;
}
text:first-child {
margin-right: 32rpx;
}
.curr {
position: relative;
color: #1969f9;
font-weight: bold;
&::after {
content: '';
background-color: #1969f9;
width: 51%;
height: 2px;
position: absolute;
bottom: -10rpx;
left: 0;
right: 0;
margin: 0 auto;
}
}
}
.field-item {
flex-wrap: wrap;
margin-top: 16rpx;
.item {
flex: 0 0 50%;
margin-bottom: 8rpx;
.label {
font-size: 16rpx;
color: #919399;
white-space: nowrap;
}
.text {
font-size: 16rpx;
color: #1969f9;
margin-left: 6rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 176rpx;
}
.tt {
font-size: 17rpx;
color: #484b59;
margin-left: 6rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 176rpx;
}
}
}
.input-wrap {
margin-bottom: 25rpx;
.label-title {
font-size: 20rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
}
.input-box {
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
.uni-input {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
.uni-textarea {
width: 100%;
height: 110rpx;
background: #ffffff;
border-radius: 10px;
border: 1px solid #1969f9;
font-size: 17rpx;
padding: 18rpx;
}
}
.sel-box {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-right: 12rpx;
}
}
}
.btn {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
.btn1 {
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
.btn2 {
height: 75rpx;
background: #ffe0d7;
font-size: 23rpx;
color: #ff3700;
font-weight: bold;
}
}
.input-wrap {
margin-bottom: 25rpx;
.label-title {
font-size: 20rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
}
.input-box {
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
.uni-input {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
.uni-textarea {
width: 100%;
height: 110rpx;
background: #ffffff;
border-radius: 10px;
border: 1px solid #1969f9;
font-size: 17rpx;
padding: 18rpx;
}
}
.select-box {
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
.wrap {
padding-left: 15rpx;
padding-right: 25rpx;
height: 40rpx;
}
.uni-input {
font-size: 17rpx;
color: #484b59;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
}
}
.pack {
.h2 {
font-size: 17rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
.tt {
font-size: 17rpx;
color: #919399;
font-weight: normal;
}
.num {
.t1 {
font-size: 13rpx;
color: #1969f9;
}
.t2 {
font-size: 13rpx;
color: #919399;
}
}
}
.icon-box {
width: 75rpx;
height: 55rpx;
border-radius: 10rpx;
border: 1px solid #c6c7cc;
.iconfont {
font-size: 30rpx;
color: #56585e;
}
}
.pic-list {
flex-wrap: wrap;
margin-bottom: 18rpx;
.default {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
.iconfont {
font-size: 60rpx;
color: #c6c7cc;
}
}
.box {
position: relative;
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.iconfont {
position: absolute;
right: 0;
top: 0;
font-size: 30rpx;
color: #ff3700;
z-index: 9;
}
}
}
.textarea-box {
width: 100%;
textarea {
width: 100%;
height: 85rpx;
padding: 10rpx 15rpx;
background: #f5f5f7;
border-radius: 10rpx;
font-size: 16rpx;
box-sizing: border-box;
}
}
.print {
margin-bottom: 27rpx;
.check-box-icon {
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
&.curr {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.tt {
font-size: 17rpx;
color: #484b59;
margin-left: 10rpx;
}
}
}
}
...@@ -423,6 +423,11 @@ ...@@ -423,6 +423,11 @@
"style": { "style": {
"navigationBarTitleText": "分货" "navigationBarTitleText": "分货"
} }
}, {
"path": "pages/preCheck/list",
"style": {
"navigationBarTitleText": "预检单"
}
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
</view> </view>
<view class="print-btn" @click="print()">打印入仓号</view> <view class="print-btn" @click="print()">打印入仓号</view>
</view> </view>
<view class="preCheck row verCenter" v-if="preCheckList.length > 0">
<text class="t1">该搜索内容有相似预检单任务,</text>
<navigator class="t2" :url="'/pages/preCheck/list?mobile_search='+searchParams.mobile_register_all_search">点击查看</navigator>
</view>
<!-- 列表数据 --> <!-- 列表数据 -->
<view class="list row bothSide" v-if="list.length > 0"> <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="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
...@@ -555,7 +559,8 @@ ...@@ -555,7 +559,8 @@
grossWeightSize: ['kg', 'g'], //毛重尺寸 1kg 2g grossWeightSize: ['kg', 'g'], //毛重尺寸 1kg 2g
grossWeightSizeIndex: 0, grossWeightSizeIndex: 0,
otherAttrList: [], //其他属性 otherAttrList: [], //其他属性
swiperCurr: 0 swiperCurr: 0,
preCheckList: [] //预检单列表
}; };
}, },
onReachBottom() { onReachBottom() {
...@@ -833,6 +838,25 @@ ...@@ -833,6 +838,25 @@
this.getData(); this.getData();
}, 500), }, 500),
/** /**
* 获取预检单列表
*/
getStockPreCheckList(mobile_search) {
this.request(API.getStockPreCheckList, 'GET', { page: 1, limit: 100, status: 1, mobile_search: mobile_search }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.preCheckList = res.data.list;
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取仓库 * 获取仓库
*/ */
getWareHouselist() { getWareHouselist() {
...@@ -901,6 +925,7 @@ ...@@ -901,6 +925,7 @@
getData() { getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, true).then(res => { this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.getStockPreCheckList(this.searchParams.mobile_register_all_search); //查询预检单
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.total = res.data.total; this.total = res.data.total;
this.hasMoreData = true; this.hasMoreData = true;
......
...@@ -92,6 +92,12 @@ ...@@ -92,6 +92,12 @@
</view> </view>
<text class="text">分货</text> <text class="text">分货</text>
</navigator> </navigator>
<navigator class="box-li column rowCenter verCenter" url="/pages/preCheck/list" hover-class="none">
<view class="box row rowCenter verCenter">
<image src="/static/home/@2x(5).png"></image>
</view>
<text class="text">预检单</text>
</navigator>
</view> </view>
</view> </view>
</template> </template>
......
<template>
<view class="preCheckList">
<!-- 搜索参数 -->
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange($event,1)" :value="index" :range="array">
<view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter" style="width: 100%;">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入型号/入仓号/来货物流单号查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_search" @input="handleInput" style="width: 100%;" />
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="search-params row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange($event,3)" :value="status_index" :range="status" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input">{{ status_index === -1 ? '预检单状态' : status[status_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange($event,4)" :value="qc_status_index" :range="qc_status" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input">{{ qc_status_index === -1 ? '质检状态' : qc_status[qc_status_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 列表区 -->
<view class="list" v-if="list.length > 0">
<view class="box row" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="status-box row">
<view class="staus_type_val row rowCenter verCenter" v-if="item.is_look_str == '是'"></view>
<view class="staus_type_val row rowCenter verCenter" v-if="item.is_qc"></view>
</view>
<view class="input-box row verCenter curr" style="flex: 0 0 100%;">
<text class="label">预检单号:</text>
<text class="tt">{{ item.precheck_sn }}</text>
</view>
<view class="input-box row verCenter curr" style="flex: 0 0 100%;">
<text class="label">来货物流:</text>
<view class="tt">
{{ item.from_shipping_name }}
<text v-if="from_shipping_name"></text>
{{item.from_shipment_number}}
</view>
</view>
<view class="input-box row verCenter curr" style="flex: 0 0 100%;">
<text class="label">寄出物流:</text>
<view class="text">
{{ item.to_shipping_name }}
<text v-if="to_shipping_name"></text>
{{item.to_shipment_number}}
</view>
</view>
<view class="input-box row verCenter">
<text class="label">入 仓 号:</text>
<text class="text">{{ item.inhouse }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品名称:</text>
<text class="text">{{ item.goods_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">标准品牌:</text>
<text class="text">{{ item.brand_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">供应商:</text>
<text class="text">{{ item.suppiler_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">采 购 员:</text>
<text class="text">{{ item.purchase_user }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品品质:</text>
<text class="text">{{ item.quality_val }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">预检数量:</text>
<text class="text" style="color: #F98119;">{{ item.expect_qty }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">理货数量:</text>
<text class="text" style="color: #F98119;">{{ item.tally_qty }}</text>
</view>
<view class="input-box row">
<text class="label">理货备注:</text>
<text class="desc">{{ item.tally_remark }}</text>
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">理货照片:</text>
<view class="pick_img_list row">
<template v-if="item.precheck_images">
<view class="img_list" v-for="(v, i) in item.precheck_images.split(',')" :key="i">
<image :src="v" mode="aspectFill" @click="previewChange(item.precheck_images.split(','),i)"></image>
</view>
</template>
</view>
</view>
<view class="btn-box row">
<template v-if="item.status == 2 || item.status == 4">
<!-- 针对需求状态为:已理货、待发货 -->
<view class="btn1 row rowCenter verCenter" @click="stockPreCheckCancelTally(item.precheck_id)">取消理货</view>
</template>
<template v-if="item.status == 1">
<!-- 针对需求状态为新创建 -->
<view class="btn2 row rowCenter verCenter" @click="showDrawer(index)">理货</view>
</template>
</view>
</view>
</view>
<!-- 无数据展示 -->
<view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<!-- 底部操作按钮 -->
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="stockPreCheckDeliverLayer">确认发货</view>
<view class="btn3 row rowCenter verCenter" @click="batchTally">一键理货</view>
</view>
<!-- 单个理货 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-layer" v-if="detail">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">预检理货</text>
</view>
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">入仓号:</text>
<text class="tt">{{ detail.inhouse }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品名称:</text>
<text class="tt">{{ detail.goods_name }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">标准品牌:</text>
<text class="tt">{{ detail.brand_name }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">预检数量:</text>
<text class="tt">{{ detail.expect_qty }}</text>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<text class="label-title">理货数量:</text>
<view class="input-box">
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入理货数量" v-model="stockPreCheckTallyParams.tally_num" />
</view>
</view>
<view class="pack">
<view class="h2 row bothSide verCenter" style="margin-top: 25rpx;">
<view>
<text style="color: red;">*</text>
<text>理货照片:</text>
<text class="tt">最多只支持{{ maxNum }}张图</text>
</view>
<view class="num">
<text class="t1">{{ image_list.length }}</text>
<text class="t2">/10</text>
</view>
</view>
<view class="pic-list row">
<template v-if="image_list.length > 0">
<view class="box" v-for="(item, index) in image_list" :key="index">
<image :src="item" mode="aspectFill" @click="previewChange(image_list, index)"></image>
<text class="iconfont icon-a-juxing11" @click="deletePic(index)"></text>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="image_list.length < maxNum"><text class="iconfont icon-a-juxing3"></text></view>
</view>
<p style="color: red;font-size: 17rpx;margin-bottom: 10rpx;" v-if="is_watch">选中包含有采购需看货的物料,建议上传理货照片!</p>
<view class="print row verCenter" @click="toggle()">
<text class="check-box-icon" :class="{ curr: print_flag }"></text>
<text class="tt">打印预检标签</text>
</view>
<view class="h2">理货备注:</view>
<view class="textarea-box"><textarea placeholder-style="color:#919399" placeholder="请输入" v-model="stockPreCheckTallyParams.tally_remark" /></view>
</view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="stockPreCheckTally(detail.precheck_id)">确认理货</view>
</view>
</view>
</uni-drawer>
<!-- 单个发货 -->
<uni-drawer ref="showRightDeliver" mode="right">
<view class="uni-drawer-layer" v-if="detail">
<view class="p-text">
<text class="tt">您已选中</text>
<text class="ed">{{ filter_id.length }}</text>
<text class="tt">条预检单,是否确认发货?</text>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>发货快递:</view>
<view class="select-box row">
<picker @change="bindPickerChange($event,2)" :value="to_shipping_index" :range="to_shipping" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ to_shipping_index === -1 ? '请选择发货快递' : (to_shipping[to_shipping_index] ? to_shipping[to_shipping_index].name : '请选择') }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>发货物流:</view>
<view class="input-box">
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入物流单号" v-model="stockPreCheckDeliverParams.to_shipment_number" />
</view>
</view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="stockPreCheckDeliver(detail.precheck_id)">确认发货</view>
</view>
</view>
</uni-drawer>
<!-- 批量理货 -->
<uni-drawer ref="showRightTallys" mode="right">
<view class="uni-drawer-layer" v-if="detail">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">批量预检理货</text>
</view>
<view class="p-text">
<text class="tt">您已选中</text>
<text class="ed">{{ filter_id.length }}</text>
<text class="tt">个理货任务</text>
</view>
<view class="pack">
<view class="h2 row bothSide verCenter" style="margin-top: 25rpx;">
<view>
<text style="color: red;">*</text>
<text>理货照片:</text>
<text class="tt">最多只支持{{ maxNum }}张图</text>
</view>
<view class="num">
<text class="t1">{{ image_list.length }}</text>
<text class="t2">/10</text>
</view>
</view>
<view class="pic-list row">
<template v-if="image_list.length > 0">
<view class="box" v-for="(item, index) in image_list" :key="index">
<image :src="item" mode="aspectFill" @click="previewChange(image_list, index)"></image>
<text class="iconfont icon-a-juxing11" @click="deletePic(index)"></text>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="image_list.length < maxNum"><text class="iconfont icon-a-juxing3"></text></view>
</view>
<p style="color: red;font-size: 17rpx;margin-bottom: 10rpx;" v-if="is_watch">选中包含有采购需看货的物料,建议上传理货照片!</p>
<view class="print row verCenter" @click="toggle()">
<text class="check-box-icon" :class="{ curr: print_flag }"></text>
<text class="tt">打印预检标签</text>
</view>
<view class="h2">理货备注:</view>
<view class="textarea-box"><textarea placeholder-style="color:#919399" placeholder="请输入" v-model="stockPreCheckTallyParams.tally_remark" /></view>
</view>
<view class="btn row rowCenter verCenter">
<view class="row btn2 row rowCenter verCenter" style="width:50%" @click="closeDrawer()">取消</view>
<view class="row btn1 row rowCenter verCenter" style="width:50%" @click="stockPreCheckTally()">一键理货</view>
</view>
</view>
</uni-drawer>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
img_upload_url: uni.getStorageSync('img_upload_url') || 'http://image.liexindev.net', //oss系统
is_focus: true, //获取焦点动态化
index: 0,
detail: {}, //详情
array: ['全量搜索'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
all_flag: false, //全选标记
page: 1,
limit: 30,
image_list: [], //图片列表
hasMoreData: true, //是否分页加载
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id
filter_status: [], //过滤预检单状态
maxNum: 10, //最大上传图片数量
print_flag: true, //是否打印
status: [
{ name: '全部', value: '' },
{ name: '新创建', value: 1 },
{ name: '已理货', value: 2 },
{ name: '待发货', value: 4 },
{ name: '已完成', value: 10 },
{ name: '作废', value: -1 }
],
status_index: -1,
qc_status: [
{ name: '全部', value: '' },
{ name: '待处理', value: 1 },
{ name: '不质检', value: 0 },
{ name: '正常入库', value: 2 },
{ name: '特批入库', value: 3 },
{ name: '退货', value: 4 }
],
qc_status_index: -1,
to_shipping: [
{ name: '联邦快递', value: 13 },
{ name: 'DHL国际快递', value: 12 },
{ name: '顺丰速运', value: 1 },
{ name: '供应商配送', value: 100 },
{ name: '快递送货', value: 4 },
{ name: '韵达快递', value: 5 },
{ name: '速尔快递', value: 8 },
{ name: 'TNT快递', value: 9 },
{ name: '自提', value: 10 },
{ name: '京东快递', value: 11 },
{ name: '优速物流', value: 15 },
{ name: '顺丰特惠', value: 16 },
{ name: 'UPS', value: 17 }
],
to_shipping_index: -1,
stockPreCheckDeliverParams: {
precheck_ids: '',
to_shipping_id: '',
to_shipment_number: ''
},
stockPreCheckTallyParams: {
precheck_ids: '',
tally_num: '',
tally_remark: '',
preckeck_imgs: '',
is_print_label: 1
},
searchParams: {
mobile_search: '',
status: '',
qc_status: ''
}
};
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onLoad(options) {
this.searchParams.mobile_search = options.mobile_search || '';
},
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
watch: {
image_list(arr) {
if (arr.length > 0) {
this.stockPreCheckTallyParams.preckeck_imgs = arr.join(',');
} else {
this.stockPreCheckTallyParams.preckeck_imgs = '';
}
}
},
methods: {
/**
* 是否打印
*/
toggle() {
this.print_flag = !this.print_flag;
if (this.print_flag) {
this.stockPreCheckTallyParams.is_print_label = 1;
} else {
this.stockPreCheckTallyParams.is_print_label = 0;
}
},
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
this.index = e.detail.value;
this.clearInputAndFocus();
} else if (type == 2) {
this.to_shipping_index = e.detail.value;
this.stockPreCheckDeliverParams.to_shipping_id = this.to_shipping[e.detail.value].value;
} else if (type == 3) {
this.status_index = e.detail.value;
this.searchParams.status = this.status[e.detail.value].value;
this.getData();
} else if (type == 4) {
this.qc_status_index = e.detail.value;
this.searchParams.qc_status = this.qc_status[e.detail.value].value;
this.getData();
}
},
/**
* 全选
*/
allChnage() {
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.id;
});
} else {
this.filter_id = [];
}
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
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].precheck_id);
this.filter_status = filter_arr.map(i => this.list[i].status);
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.mobile_search = '';
this.input_flag = false;
this.clearInputAndFocus();
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
this.searchParams.mobile_search = val;
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getStockPreCheckList, 'GET', { 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);
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 取消理货
*/
stockPreCheckCancelTally(precheck_ids) {
uni.showModal({
title: '',
content: '是否确认取消理货?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.stockPreCheckCancelTally, 'POST', { precheck_ids: precheck_ids }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
/**
* 预检发货弹窗
*/
stockPreCheckDeliverLayer() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选货物',
icon: 'error'
});
return false;
}
//针对需求状态为:待发货
var validData = this.filter_status.every(item => item === 4);
if (!validData) {
uni.showToast({
title: '请勾选预检状态为:待发货',
icon: 'none'
});
return false;
}
if (this.filter_id.length == 1) {
this.$refs.showRightDeliver.open();
var result = this.list.find(item => item.precheck_id === this.filter_id[0]); //筛选单条数据
this.stockPreCheckDeliverParams.to_shipment_number = result.to_shipment_number; //发货物流赋值
var index = this.to_shipping.findIndex(item => item.value === result.to_shipping_id);
this.to_shipping_index = index; //发货快递选择
this.detail = result;
} else {
uni.showModal({
title: '确认发货',
content: `已选中 ${this.filter_id.length} 条预检单,是否按已填写的寄出物流信息确认已发货?`,
showCancel: true,
success: res => {
if (res.confirm) {
this.stockPreCheckDeliverParams.precheck_ids = this.filter_id.join(',');
this.stockPreCheckDeliver();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
},
/**
* 预检发货
*/
stockPreCheckDeliver(precheck_ids) {
if (precheck_ids) {
this.stockPreCheckDeliverParams.precheck_ids = precheck_ids;
}
this.request(API.stockPreCheckDeliver, 'POST', this.stockPreCheckDeliverParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '发货成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 一键理货
*/
batchTally() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选货物',
icon: 'error'
});
return false;
}
//针对需求状态为:新创建'
var validData = this.filter_status.every(item => item === 1);
if (!validData) {
uni.showToast({
title: '请勾选预检状态为:新创建',
icon: 'none'
});
return false;
}
this.stockPreCheckTallyParams.precheck_ids = this.filter_id.join(',');
this.$refs.showRightTallys.open();
},
/**
* 确认理货
*/
stockPreCheckTally(precheck_ids) {
if (precheck_ids) {
this.stockPreCheckTallyParams.precheck_ids = precheck_ids;
}
if (!this.stockPreCheckTallyParams.preckeck_imgs) {
uni.showToast({
title: '理货照片必须上传',
icon: 'none'
});
return false;
}
this.request(API.stockPreCheckTally, 'POST', this.stockPreCheckTallyParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '理货成功',
icon: 'success'
});
setTimeout(() => {
this.closeDrawer();
this.resetChange();
this.getData();
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 选择图片
*/
chooseImageChange() {
this.noexebshowFalg = false;
// 使用 chooseImage选择图片
uni.chooseImage({
count: this.maxNum,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > this.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + this.maxNum + '张',
icon: 'none'
});
return false;
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 60, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: this.img_upload_url + '/uploadImage?sys_type=4',
filePath: compressedImagePath,
name: 'file',
timeout: 10000,
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading();
let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
this.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: data.msg,
icon: 'none'
});
}
},
fail: error => {
uni.showToast({
title: '上传图片失败',
icon: 'none'
});
uni.hideLoading();
}
});
},
fail: err => {
console.log('压缩图片失败:', err);
}
});
});
}
});
},
/**
* 删除图片
* @param {Object} index
*/
deletePic(index) {
this.image_list.splice(index, 1);
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: arr
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
},
showDrawer(index) {
this.detail = this.list[index];
this.stockPreCheckTallyParams.tally_num = '';
this.stockPreCheckTallyParams.tally_remark = '';
this.stockPreCheckTallyParams.preckeck_imgs = '';
this.stockPreCheckTallyParams.is_print_label = 1;
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightTallys.close();
}
}
};
</script>
<style scoped lang="scss">
@import '@/assets/css/preCheck/list.scss';
</style>
\ No newline at end of file
// const API_BASE_USER = 'http://user.liexindev.net'; //用户系统 const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
// const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统 const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
// const API_BASE = 'http://wms.liexindev.net'; //WMS系统 const API_BASE = 'http://wms.liexindev.net'; //WMS系统
// const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统 const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统 // const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统 // const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
const API_BASE = 'https://wms.ichunt.net'; //WMS系统 // const API_BASE = 'https://wms.ichunt.net'; //WMS系统
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统 // const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = { const API = {
...@@ -363,7 +363,23 @@ const API = { ...@@ -363,7 +363,23 @@ const API = {
/** /**
* 标签-入仓号 * 标签-入仓号
* */ * */
printInhouse: API_BASE + '/api/label/printInhouse' printInhouse: API_BASE + '/api/label/printInhouse',
/**
* 获取预检单列表
* */
getStockPreCheckList: API_BASE + '/api/stockIn/stockPreCheck/getStockPreCheckList',
/**
* 预检单-取消理货
* */
stockPreCheckCancelTally: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckCancelTally',
/**
* 预检单-预检发货
* */
stockPreCheckDeliver: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckDeliver',
/**
* 预检单-理货
* */
stockPreCheckTally: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckTally'
} }
......
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