Commit 2dfba80f by 韩达
parents 6e5044e3 71aae4ff
......@@ -100,6 +100,14 @@
font-size: 15rpx;
color: #1969f9;
}
.btn3 {
width: 68rpx;
height: 30rpx;
background-color: #1969f9;
border-radius: 8rpx;
font-size: 15rpx;
color: #ffffff;
}
}
}
}
......
......@@ -10,6 +10,7 @@
border-radius: 10rpx;
margin-bottom: 15rpx;
flex-wrap: wrap;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
......
......@@ -53,6 +53,7 @@
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
border: 1px solid transparent;
&:nth-of-type(2n) {
margin-right: 0;
}
......
......@@ -49,8 +49,10 @@
color: #484b59;
}
.icon-a-juxing11 {
position: relative;
font-size: 30rpx;
color: #c6c7cc;
z-index: 99;
}
.icon-juxing3 {
font-size: 30rpx;
......@@ -119,6 +121,24 @@
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%;
......@@ -443,7 +463,7 @@
margin-bottom: 11rpx;
flex: 0 0 50%;
.label {
width: 98rpx;
width: 112rpx;
font-size: 17rpx;
color: #919399;
white-space: nowrap;
......
......@@ -287,23 +287,36 @@ export default {
} else if (type == 2) {
stock_in_id[0] = id;
}
this.request(API.delStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.closeDrawer();
this.filter_id = [];
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
uni.showModal({
title: '提示',
content: '确定要取消登记吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.delStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.closeDrawer();
this.filter_id = [];
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
},
......
......@@ -18,7 +18,7 @@
</view>
</view>
<view class="list row bothSide" v-if="list.length > 0">
<navigator class="box" v-for="(item, index) in list" :key="index" :url="'/pages/picking/sort?stock_out_id=' + item.stock_out_id + '&stock_out_sn=' + item.stock_out_sn" hover-class="none">
<view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter">
<text class="label">出库单号:</text>
<text class="t1">{{ item.stock_out_sn }}</text>
......@@ -44,8 +44,8 @@
<text class="label">销售员:</text>
<text class="tt">{{ item.sale_name }}</text>
</view>
<view class="btn-box row"><view class="btn row rowCenter verCenter">领取</view></view>
</navigator>
<view class="btn-box row"><view class="btn row rowCenter verCenter" @click="take(item.stock_out_id, item.stock_out_sn)">领取</view></view>
</view>
</view>
<!-- 无数据展示 -->
<view class="no-date column rowCenter verCenter" v-else>
......@@ -104,6 +104,24 @@ export default {
});
},
/**
* 领取
*/
take(stock_out_id, stock_out_sn) {
this.request(API.take, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.navigateTo({
url: '/pages/picking/sort?stock_out_id=' + stock_out_id + '&stock_out_sn=' + stock_out_sn
});
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 清空数据
*/
clearInput() {
......
......@@ -12,48 +12,66 @@
<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" />
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" v-model="searchParams.stock_out_sn" @input="handleInput" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="list row bothSide">
<view class="box" v-for="(item, index) in 10" :key="index">
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter">
<text class="label">出库单号:</text>
<text class="t1">ASN2201010001</text>
<text class="t1">{{ item.stock_out_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">状 态:</text>
<text class="t1">全部锁库</text>
<text class="t1">{{ item.stock_out_status_val }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">任 务 数:</text>
<text class="tt">8</text>
<text class="tt">{{ item.items_num }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">总 数 量:</text>
<text class="tt">5000</text>
<text class="tt">{{ item.total_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">上游备注:</text>
<text class="tt">我是一条备注我是一条备注我是一条备注我是一条备注</text>
<text class="tt">{{ item.upstream_remark }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">领取时间:</text>
<text class="tt">2023-04-01 11:28:59</text>
<text class="tt">{{ item.take_time }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">销售员:</text>
<text class="tt">朱国军</text>
<text class="tt">{{ item.sale_name }}</text>
</view>
<view class="btn-box row verCenter">
<view class="btn1 row rowCenter verCenter">释放</view>
<view class="btn2 row rowCenter verCenter">详情</view>
<!-- 出库单状态为全部锁库,则显示【释放】、【选择】按钮 -->
<template v-if="item.stock_out_status == 3">
<view class="btn1 row rowCenter verCenter" @click="cancelTake(item.stock_out_id)">释放</view>
<navigator :url="'/pages/picking/sort?stock_out_id=' + item.stock_out_id + '&stock_out_sn=' + item.stock_out_sn" hover-class="none" class="btn3 row rowCenter verCenter">选择</navigator>
</template>
<!--出库单状态为部分拣货-->
<template v-if="item.stock_out_status == 4">
<navigator :url="'/pages/picking/sort?stock_out_id=' + item.stock_out_id + '&stock_out_sn=' + item.stock_out_sn" hover-class="none" class="btn3 row rowCenter verCenter">选择</navigator>
</template>
<!--出库单状态为全部拣货-->
<template v-if="item.stock_out_status == 5">
<navigator url="/pages/picking/record" hover-class="none" class="btn2 row rowCenter verCenter">详情</navigator>
</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>
</template>
......@@ -63,15 +81,81 @@ import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
index: 0,
array: ['出库单号']
array: ['出库单号'],
list: [],
searchParams: {
stock_out_sn: '' //出库单号
}
};
},
onLoad() {},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = 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;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 释放已领取拣货单
*/
cancelTake(stock_out_id) {
this.request(API.cancelTake, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '释放成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.filter_id = [];
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getTakedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}
}
};
......
......@@ -197,7 +197,7 @@
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t1">拣货数量:</text></view>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.pick_qty"/></view>
<view class="input-box"><input type="number" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.pick_qty"/></view>
</view>
<view class="bor"></view>
<view class="field-item row">
......
......@@ -12,78 +12,83 @@
<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" />
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" focus v-model="searchParams.stock_out_sn" @input="handleInput" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="list row bothSide">
<view class="box" v-for="(item, index) in 10" :key="index">
<template v-if="index == 1">
<view class="check-box-icon"></view>
</template>
<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>
<view class="text-item row verCenter">
<text class="label">出库单号:</text>
<text class="t1">ASN2201010001</text>
<text class="t1">{{ item.stock_out_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">状 态:</text>
<text class="t1">全部锁库</text>
<text class="t1">{{ item.stock_out_status_val }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">复核确认:</text>
<text class="t1">待确认</text>
<text class="t1">{{ item.stock_out_status != 8 ? '待确认' : '已确认' }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">任 务 数:</text>
<text class="tt">8</text>
<text class="tt">{{ item.items_num }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">总 数 量:</text>
<text class="tt">5000</text>
<text class="tt">{{ item.total_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">上游备注:</text>
<text class="tt">我是一条备注我是一条备注我是一条备注我是一条备注</text>
</view>
<view class="text-item row verCenter">
<text class="label">销售员:</text>
<text class="tt">朱国军</text>
<text class="tt">{{ item.upstream_remark }}</text>
</view>
<view class="btn-box row">
<template v-if="index == 0">
<navigator url="/pages/stockRecheck/sort" class="btn1 row rowCenter verCenter" hover-class="none">选择</navigator>
</template>
<template v-else-if="index == 1">
<!-- 出库单状态为全部复核时,则显示【详情】按钮 -->
<template v-if="item.stock_out_status == 7">
<navigator class="btn2 row rowCenter verCenter" url="/pages/stockRecheck/record" hover-class="none">详情</navigator>
</template>
<template v-else>
<navigator url="/pages/stockRecheck/sort" class="btn1 row rowCenter verCenter" hover-class="none">选择</navigator>
<template v-else-if="item.stock_out_status == 5 || item.stock_out_status == 6">
<navigator :url="'/pages/stockRecheck/sort?stock_out_id=' + item.stock_out_id" class="btn1 row rowCenter verCenter" hover-class="none">选择</navigator>
</template>
</view>
</view>
</view>
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter">
<text class="check-box-icon curr"></text>
<text class="text">全选</text>
</view>
<view class="btn2 row rowCenter verCenter">复核确认</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="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';
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 1000,
index: 0,
array: ['出库单号']
array: ['出库单号'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
searchParams: {
stock_out_sn: '' //出库单号
}
};
},
onLoad() {},
onShow() {
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
......@@ -95,6 +100,102 @@ export default {
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);
}
});
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 = '';
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
} 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: '请勾选货物',
icon: 'error'
});
return false;
}
if (this.filter_id.length > 1) {
uni.showToast({
title: '请勾选一条',
icon: 'error'
});
return false;
}
this.request(API.makeStockOutFinish, 'POST', { stock_out_id: this.filter_id[0] }, 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
});
}
});
}
}
};
......
......@@ -84,6 +84,50 @@ const API = {
* */
makeMultiPickingFinish: API_BASE + '/api/stockOut/makeMultiPickingFinish',
/**
* 我的拣货
* */
getTakedList: API_BASE + '/api/stockOut/getTakedList',
/**
* 领取拣货单
* */
take: API_BASE + '/api/stockOut/take',
/**
* 获取我的拣货记录
* */
getAllPickedList: API_BASE + '/api/stockOut/getAllPickedList',
/**
* 取消拣货
* */
cancelPicking: API_BASE + '/api/stockOut/cancelPicking',
/**
* 释放已领取拣货单
* */
cancelTake: API_BASE + '/api/stockOut/cancelTake',
/**
* 复核列表
* */
getToCheckList: API_BASE + '/api/stockRecheck/getToCheckList',
/**
* 复核确认
* */
makeStockOutFinish: API_BASE + '/api/stockRecheck/makeStockOutFinish',
/**
* 按货品复核列表
* */
getRecheckTaskItems: API_BASE + '/api/stockRecheck/getRecheckTaskItems',
/**
* 按容器复核列表
* */
getContainerTaskList: API_BASE + '/api/stockRecheck/getContainerTaskList',
/**
* 标记复核
* */
markChecked: API_BASE + '/api/stockRecheck/markChecked',
/**
* 一键复核
* */
multiMarkChecked: API_BASE + '/api/stockRecheck/multiMarkChecked',
/**
* 上传文件
* */
upload: API_BASE_LIEXIN + '/oss/upload',
......
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