Commit 79a04d13 by LJM

bug

parent bd603d15
.picking-record { .picking-record {
padding: 15rpx 22rpx; 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;
}
}
}
.list { .list {
margin-top: 15rpx;
padding-bottom: 100rpx; padding-bottom: 100rpx;
.box { .box {
position: relative; position: relative;
......
.stockRecheck-record { .stockRecheck-record {
padding: 15rpx 22rpx; 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;
}
}
}
.list { .list {
margin-top: 15rpx;
padding-bottom: 100rpx; padding-bottom: 100rpx;
.box { .box {
position: relative; position: relative;
......
{ {
"name" : "wms", "name": "wms",
"appid" : "__UNI__655E80D", "appid": "__UNI__655E80D",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.1",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : { "modules": {
"Camera" : {}, "Camera": {},
"Barcode" : {}, "Barcode": {},
"Bluetooth" : {} "Bluetooth": {}
}, },
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute": {
/* android打包配置 */ /* android打包配置 */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
...@@ -45,85 +45,86 @@ ...@@ -45,85 +45,86 @@
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : { "ios": {
"dSYMs" : false "dSYMs": false
}, },
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : { "sdkConfigs": {
"ad" : {} "ad": {}
}, },
"icons" : { "icons": {
"android" : { "android": {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi": "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png", "xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png", "xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png" "xxxhdpi": "unpackage/res/icons/192x192.png"
}, },
"ios" : { "ios": {
"appstore" : "unpackage/res/icons/1024x1024.png", "appstore": "unpackage/res/icons/1024x1024.png",
"ipad" : { "ipad": {
"app" : "unpackage/res/icons/76x76.png", "app": "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png", "app@2x": "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png", "notification": "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png", "proapp@2x": "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png", "settings": "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png", "spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png" "spotlight@2x": "unpackage/res/icons/80x80.png"
}, },
"iphone" : { "iphone": {
"app@2x" : "unpackage/res/icons/120x120.png", "app@2x": "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png", "app@3x": "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png", "notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png", "settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png", "spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png" "spotlight@3x": "unpackage/res/icons/120x120.png"
} }
} }
} }
}, },
"nvueLaunchMode" : "" "nvueLaunchMode": ""
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp": {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin": {
"appid" : "wx060bcd34e30d0db2", "appid": "wx060bcd34e30d0db2",
"setting" : { "setting": {
"urlCheck" : false, "urlCheck": false,
"postcss" : true, "postcss": true,
"es6" : false, "es6": false,
"minified" : true "minified": true
}, },
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "2", "vueVersion": "2",
"quickapp-webview" : { "quickapp-webview": {
"icon" : "wms", "icon": "wms",
"package" : "com.liexin.wms", "package": "com.liexin.wms",
"versionName" : "1.0", "versionName": "1.0",
"minPlatformVersion" : "1.0" "minPlatformVersion": "1.0"
}, },
"fallbackLocale" : "zh-Hans", "fallbackLocale": "zh-Hans",
"softinput" : { "softinput": {
//可选,JSON对象,软键盘相关配置 //可选,JSON对象,软键盘相关配置
"navBar" : "auto", //可选,字符串类型,iOS平台软键盘上导航条的显示模式,可取值auto、none "navBar": "auto", //可选,字符串类型,iOS平台软键盘上导航条的显示模式,可取值auto、none
"auxiliary" : true, //可选,Boolean类型,是否开启辅助输入功能 "auxiliary": true, //可选,Boolean类型,是否开启辅助输入功能
"mode" : "adjustPan" //可选,字符串类型,弹出系统软键盘模式,可取值adjustResize、adjustPan "mode": "adjustPan" //可选,字符串类型,弹出系统软键盘模式,可取值adjustResize、adjustPan
} },
} "locale": "zh-Hans"
}
\ No newline at end of file
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
<text class="label">状 态:</text> <text class="label">状 态:</text>
<text class="t1">{{ item.stock_out_status_val }}</text> <text class="t1">{{ item.stock_out_status_val }}</text>
</view> </view>
<view class="text-item row verCenter">
<text class="label" style="white-space: nowrap;width: 100rpx;">待拣货任务:</text>
<text class="t1">{{ item.no_pick_task_num }}</text>
</view>
<view class="bor row"></view> <view class="bor row"></view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
<text class="label">任 务 数:</text> <text class="label">任 务 数:</text>
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
<text class="label">状 态:</text> <text class="label">状 态:</text>
<text class="t1">{{ item.stock_out_status_val }}</text> <text class="t1">{{ item.stock_out_status_val }}</text>
</view> </view>
<view class="text-item row verCenter">
<text class="label" style="white-space: nowrap;width:100rpx;">待拣货任务:</text>
<text class="t1">{{ item.no_pick_task_num }}</text>
</view>
<view class="bor row"></view> <view class="bor row"></view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
<text class="label">任 务 数:</text> <text class="label">任 务 数:</text>
...@@ -37,7 +41,7 @@ ...@@ -37,7 +41,7 @@
<text class="tt">{{ item.total_qty }}</text> <text class="tt">{{ item.total_qty }}</text>
</view> </view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
<text class="label">上游备注:</text> <text class="label" style="white-space: nowrap;width: 110rpx;">主单仓库备注:</text>
<text class="tt">{{ item.upstream_remark }}</text> <text class="tt">{{ item.upstream_remark }}</text>
</view> </view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
......
<template> <template>
<view class="picking-record"> <view class="picking-record">
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :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">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
</view>
<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="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="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="check-box-icon" @click="filterChange(index)"></view>
...@@ -78,7 +95,7 @@ ...@@ -78,7 +95,7 @@
</view> </view>
<view class="input-box row" style="flex: 0 0 100%;"> <view class="input-box row" style="flex: 0 0 100%;">
<text class="label">拣货照片:</text> <text class="label">拣货照片:</text>
<view class="pick_img_list row"><image @click="previewChange(item.pick_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.pick_img_list" :key="i" mode="aspectFill"></image></view> <view class="pick_img_list row"><image :lazy-load="true" @click="previewChange(item.pick_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.pick_img_list" :key="i" mode="aspectFill"></image></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -105,6 +122,8 @@ import debounce from 'lodash/debounce'; ...@@ -105,6 +122,8 @@ import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
index: 0,
array: ['全量搜索'],
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false, input_flag: false,
all_flag: false, //全选标记 all_flag: false, //全选标记
...@@ -115,7 +134,8 @@ export default { ...@@ -115,7 +134,8 @@ export default {
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id filter_id: [], //过滤id
searchParams: { searchParams: {
stock_out_sn: '' stock_out_sn: '',
all_search_keyword: ''
} }
}; };
}, },
...@@ -127,7 +147,7 @@ export default { ...@@ -127,7 +147,7 @@ export default {
this.getData(); this.getData();
}, },
onLoad(options) { onLoad(options) {
this.searchParams.stock_out_sn = options.stock_out_sn; this.searchParams.stock_out_sn = options.stock_out_sn || '';
}, },
onShow() { onShow() {
if (this.noexebshowFalg) { if (this.noexebshowFalg) {
...@@ -136,6 +156,10 @@ export default { ...@@ -136,6 +156,10 @@ export default {
} }
}, },
methods: { methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/** /**
* 全选 * 全选
*/ */
...@@ -177,11 +201,28 @@ export default { ...@@ -177,11 +201,28 @@ export default {
*/ */
clearInput() { clearInput() {
this.resetChange(); this.resetChange();
this.input_flag = false; this.searchParams.all_search_keyword = '';
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
this.input_flag = false;
this.getData(); this.getData();
}, },
/** /**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
}
this.getData();
}, 500),
/**
* 预览图片 * 预览图片
* @param {Object} img * @param {Object} img
* @param {Object} index * @param {Object} index
...@@ -197,20 +238,6 @@ export default { ...@@ -197,20 +238,6 @@ export default {
}); });
}, },
/** /**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 取消拣货 * 取消拣货
*/ */
cancelPicking() { cancelPicking() {
......
...@@ -545,52 +545,60 @@ export default { ...@@ -545,52 +545,60 @@ export default {
//入库批次号 开启批量扫描 //入库批次号 开启批量扫描
if (this.is_batch) { if (this.is_batch) {
this.input_flag_stock_in_batch_sn = false; this.input_flag_stock_in_batch_sn = false;
//记录历史搜索批次号 //记录历史搜索批次号
if (!this.history_id.includes(val)) { if (!this.history_id.includes(val)) {
this.history_id.push(val); this.history_id.push(val);
} }
this.searchParams.stock_in_batch_sn = this.history_id.join(','); this.searchParams.stock_in_batch_sn = this.history_id.join(',');
this.getData(data => {
this.getData((data, msg) => {
//如果后台有消息返回,就提示
if (msg) {
uni.showModal({
title: '提示',
content: msg,
confirmText: '关闭',
showCancel: false,
success: res => {
let index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
try {
//再次获取焦点
this.isFocus = false;
setTimeout(() => {
this.isFocus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
} catch (e) {
//TODO handle the exception
}
}
});
return false;
}
//回调data里数据,加是否选中交互
if (data.length > 0) { if (data.length > 0) {
const list = data;
this.is_batch_active = true; this.is_batch_active = true;
const list = data;
list.forEach((item, index) => { list.forEach((item, index) => {
this.filterChange(index); this.filterChange(index);
}); });
this.search_keyword = ''; }
//若识别物料标签不在上架任务中,则弹窗提示:该物料不在上架任务中,需关闭弹窗才可继续操作
let isInList = list.some(function(item) {
return item.stock_in_batch_sn === val;
});
if (!isInList) {
uni.showModal({
title: '提示',
content: '该物料不在拣货任务中',
confirmText: '关闭',
showCancel: false,
success: res => {
var index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
}
});
} else {
uni.showToast({
icon: 'success'
});
}
try { //执行最后再次获取焦点
//再次获取焦点 try {
this.isFocus = false; this.isFocus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
this.$forceUpdate(); this.search_keyword = ''; //清空入库批次号
}, 500); this.$forceUpdate();
} catch (e) { }, 500);
//TODO handle the exception } catch (e) {
} //TODO handle the exception
} }
}); });
} else { } else {
...@@ -850,15 +858,19 @@ export default { ...@@ -850,15 +858,19 @@ export default {
* 获取列表数据 * 获取列表数据
*/ */
getData(callback) { getData(callback) {
var URL = '';
if (this.curr == 0) { if (this.curr == 0) {
URL = API.getLockedList; //按货品拣货
var URL = API.getLockedList;
} else if (this.curr == 1) { } else if (this.curr == 1) {
URL = API.getLockedContainerList; //按容器拣货
var URL = API.getLockedContainerList;
} }
//赋值title
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.stock_out_sn + '拣货' title: this.stock_out_sn + '拣货'
}); });
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
//过滤出应拣数量不为0的数据 //过滤出应拣数量不为0的数据
...@@ -869,8 +881,8 @@ export default { ...@@ -869,8 +881,8 @@ export default {
var filteredList = res.data.list.filter(item => item.total_lock_num - item.total_pick_num > 0); var filteredList = res.data.list.filter(item => item.total_lock_num - item.total_pick_num > 0);
this.list = filteredList; this.list = filteredList;
} }
this.filter_list = createArray(this.list.length, false); this.filter_list = createArray(this.list.length, false); //创建状态数组
typeof callback == 'function' && callback(res.data.list); typeof callback == 'function' && callback(res.data.list, res.data.notice_msg);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
......
...@@ -327,52 +327,61 @@ export default { ...@@ -327,52 +327,61 @@ export default {
this.search_keyword = ''; this.search_keyword = '';
this.search_keyword = val; this.search_keyword = val;
this.input_flag = false; this.input_flag = false;
//记录历史搜索批次号 //记录历史搜索批次号
if (!this.history_id.includes(val)) { if (!this.history_id.includes(val)) {
this.history_id.push(val); this.history_id.push(val);
} }
this.searchParams.search_keyword = this.history_id.join(','); this.searchParams.search_keyword = this.history_id.join(',');
//搜索之后添加选择状态
this.getData(data => { this.getData((data, msg) => {
//如果后台有消息返回,就提示
if (msg) {
uni.showModal({
title: '提示',
content: msg,
confirmText: '关闭',
showCancel: false,
success: res => {
let index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
try {
//再次获取焦点
this.isFocus = false;
setTimeout(() => {
this.isFocus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
} catch (e) {
//TODO handle the exception
}
}
});
return false;
}
//回调data里数据,加是否选中交互
if (data.length > 0) { if (data.length > 0) {
this.is_batch_active = true;
const list = data; const list = data;
list.forEach((item, index) => { list.forEach((item, index) => {
this.filterChange(index); this.filterChange(index);
}); });
this.search_keyword = ''; }
//若识别物料标签不在上架任务中,则弹窗提示:该物料不在上架任务中,需关闭弹窗才可继续操作
let isInList = list.some(function(item) {
return item.stock_in_batch_sn === val;
});
if (!isInList) {
uni.showModal({
title: '提示',
content: '该物料不在上架任务中',
confirmText: '关闭',
showCancel: false,
success: res => {
var index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
}
});
} else {
uni.showToast({
icon: 'success'
});
}
try { //执行最后再次获取焦点
//再次获取焦点 try {
this.isFocus = false; this.isFocus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
this.$forceUpdate(); this.search_keyword = ''; //清空入库批次号
}, 500); this.$forceUpdate();
} catch (e) { }, 500);
//TODO handle the exception } catch (e) {
} //TODO handle the exception
} }
}); });
} else { } else {
...@@ -410,7 +419,7 @@ export default { ...@@ -410,7 +419,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.list = res.data.list; this.list = res.data.list;
this.filter_list = createArray(this.list.length, false); this.filter_list = createArray(this.list.length, false);
typeof callback == 'function' && callback(res.data.list); typeof callback == 'function' && callback(res.data.list, res.data.msg);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
......
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
<text class="label">复核确认:</text> <text class="label">复核确认:</text>
<text class="t1">{{ item.stock_out_status != 8 ? '待确认' : '已确认' }}</text> <text class="t1">{{ item.stock_out_status != 8 ? '待确认' : '已确认' }}</text>
</view> </view>
<view class="text-item row verCenter">
<text class="label" style="white-space: nowrap;width: 100rpx;">待复核任务:</text>
<text class="t1">{{ item.no_checked_task_num }}</text>
</view>
<view class="bor row"></view> <view class="bor row"></view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
<text class="label">任 务 数:</text> <text class="label">任 务 数:</text>
......
<template> <template>
<view class="stockRecheck-record"> <view class="stockRecheck-record">
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :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">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
</view>
<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="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="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="check-box-icon" @click="filterChange(index)"></view>
...@@ -99,18 +116,25 @@ ...@@ -99,18 +116,25 @@
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js'; import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
index: 0,
array: ['全量搜索'],
input_flag: false,
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
page: 1, page: 1,
limit: 50, limit: 50,
list: [], list: [],
stock_out_sn: '',
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [] //过滤处理的id filter_id: [], //过滤处理的id
searchParams: {
stock_out_sn: '',
all_search_keyword: ''
}
}; };
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
...@@ -128,7 +152,7 @@ export default { ...@@ -128,7 +152,7 @@ export default {
this.getData(); this.getData();
}, },
onLoad(options) { onLoad(options) {
this.stock_out_sn = options.stock_out_sn; this.searchParams.stock_out_sn = options.stock_out_sn || '';
}, },
onShow() { onShow() {
if (this.noexebshowFalg) { if (this.noexebshowFalg) {
...@@ -137,6 +161,35 @@ export default { ...@@ -137,6 +161,35 @@ export default {
} }
}, },
methods: { methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.all_search_keyword = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
}
this.getData();
}, 500),
/** /**
* 找出false对应的下标 * 找出false对应的下标
* @param {Object} arr * @param {Object} arr
...@@ -192,7 +245,7 @@ export default { ...@@ -192,7 +245,7 @@ export default {
* 获取列表数据 * 获取列表数据
*/ */
getData() { getData() {
this.request(API.getAllCheckedItemList, 'POST', { page: this.page, limit: this.limit, stock_out_sn: this.stock_out_sn }, true).then(res => { this.request(API.getAllCheckedItemList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.hasMoreData = true; this.hasMoreData = true;
......
...@@ -895,46 +895,53 @@ export default { ...@@ -895,46 +895,53 @@ export default {
this.searchParams.stock_in_batch_sn = this.history_id.join(','); this.searchParams.stock_in_batch_sn = this.history_id.join(',');
this.getData(data => { this.getData((data, msg) => {
//如果后台有消息返回,就提示
if (msg) {
uni.showModal({
title: '提示',
content: msg,
confirmText: '关闭',
showCancel: false,
success: res => {
let index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
try {
//再次获取焦点
this.isFocus = false;
setTimeout(() => {
this.isFocus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
} catch (e) {
//TODO handle the exception
}
}
});
return false;
}
//回调data里数据,加是否选中交互
if (data.length > 0) { if (data.length > 0) {
this.is_batch_active = true;
const list = data; const list = data;
list.forEach((item, index) => { list.forEach((item, index) => {
this.filterChange(index); this.filterChange(index);
}); });
this.search_keyword = ''; }
//若识别物料标签不在上架任务中,则弹窗提示:该物料不在上架任务中,需关闭弹窗才可继续操作
let isInList = list.some(function(item) {
return item.stock_in_batch_sn === val;
});
if (!isInList) {
uni.showModal({
title: '提示',
content: '该物料不在复核任务中',
confirmText: '关闭',
showCancel: false,
success: res => {
var index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
}
});
} else {
uni.showToast({
icon: 'success'
});
}
try { //执行最后再次获取焦点
//再次获取焦点 try {
this.isFocus = false; this.isFocus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.isFocus = true;
this.$forceUpdate(); this.search_keyword = ''; //清空入库批次号
}, 500); this.$forceUpdate();
} catch (e) { }, 500);
//TODO handle the exception } catch (e) {
} //TODO handle the exception
} }
}); });
} else { } else {
...@@ -974,32 +981,29 @@ export default { ...@@ -974,32 +981,29 @@ export default {
* 获取列表数据 * 获取列表数据
*/ */
getData(callback) { getData(callback) {
var URL = '';
if (this.curr == 0) { if (this.curr == 0) {
URL = API.getRecheckTaskItems; //按货品复核
var URL = API.getRecheckTaskItems;
} else if (this.curr == 1) { } else if (this.curr == 1) {
URL = API.getContainerTaskList; //按容器复核
var URL = API.getContainerTaskList;
} }
//赋值title
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.stock_out_sn + '复核' title: this.stock_out_sn + '复核'
}); });
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.list.length > 0) { //过滤出待复核不为0的数据
//过滤出待复核不为0的数据 if (this.curr == 0) {
if (this.curr == 0) { var filteredList = res.data.list.filter(item => item.no_recheck_qty > 0);
var filteredList = res.data.list.filter(item => item.no_recheck_qty > 0); this.list = filteredList;
this.list = filteredList; } else if (this.curr == 1) {
} else if (this.curr == 1) { var filteredList = res.data.list.filter(item => item.total_check_num > 0);
var filteredList = res.data.list.filter(item => item.total_check_num > 0); this.list = filteredList;
this.list = filteredList;
}
this.filter_list = createArray(filteredList.length, false);
typeof callback == 'function' && callback(filteredList);
} else {
this.list = [];
} }
this.filter_list = createArray(filteredList.length, false); //创建状态数组
typeof callback == 'function' && callback(filteredList, res.data.notice_msg);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
......
// 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 = {
......
...@@ -32,6 +32,7 @@ const request = (url = '', type = 'GET', param = {}, Loading) => { ...@@ -32,6 +32,7 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
dataType: 'json', dataType: 'json',
}).then((response) => { }).then((response) => {
let [error, res] = response; let [error, res] = response;
//未登录拦截
if (res.data.code == 101) { if (res.data.code == 101) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/login' url: '/pages/mine/login'
......
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