Commit 9388f1ec by LJM

取消理货

parent 9d63572f
......@@ -98,6 +98,7 @@
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
......
......@@ -83,7 +83,7 @@
</view>
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: this.filter_list.length == this.filter_id.length }"></text>
<text class="check-box-icon" :class="{ curr: filter_list.length == filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive()">一键理货</view>
......
......@@ -12,14 +12,22 @@
<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" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" focus v-model="searchParams.tracking_no" @input="handleInput(1, $event)" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入入库单号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_sn" @input="handleInput(2, $event)" />
</template>
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(3, $event)" />
</template>
</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 curr" @click="showDrawer()">
<view class="check-box-icon"></view>
<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>
......@@ -49,49 +57,16 @@
<text class="label">理货数量:</text>
<text class="ttt">3000</text>
</view>
<view class="btn-box row"><view class="detail-btn row rowCenter verCenter">详情</view></view>
</view>
<view class="box" v-for="item in 20">
<view class="check-box-icon"></view>
<view class="text-item row verCenter">
<text class="label">入库单号:</text>
<text class="t1">ASN2201010001</text>
</view>
<view class="text-item row verCenter">
<text class="label">物流单号:</text>
<text class="t1">SF2135661465161</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">入仓号:</text>
<text class="tt">A65512、A65512、A65512、A65512、A65512、</text>
</view>
<view class="text-item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">TI</text>
</view>
<view class="text-item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">TI</text>
</view>
<view class="text-item row verCenter">
<text class="label">入库批次号:</text>
<text class="tt">1000</text>
</view>
<view class="text-item row verCenter">
<text class="label">理货数量:</text>
<text class="ttt">3000</text>
</view>
<view class="btn-box row"><view class="detail-btn row rowCenter verCenter">详情</view></view>
<view class="btn-box row"><view class="detail-btn row rowCenter verCenter" @click="showDrawer()">详情</view></view>
</view>
</view>
<view class="no-date column rowCenter verCenter">
<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" style="width: 127rpx;">
<text class="check-box-icon curr"></text>
<view class="btn1 row rowCenter verCenter" style="width: 127rpx;" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length == filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn3 row rowCenter verCenter">取消理货</view>
......@@ -211,24 +186,129 @@
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
import { createArray } from '@/util/util.js';
export default {
data() {
return {
input_flag: false,
index: 0,
array: ['物流单号', '入库单号', '入仓号']
array: ['物流单号', '入库单号', '入仓号'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //入库单列表的入库登记
detail: {}, //详情的数据
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '', //入仓单号
container_id: '' //容器
}
};
},
onLoad() {},
onShow() {
this.getData();
},
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);
}
});
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_in_item_id);
},
/**
* 全选
*/
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.stock_in_item_id;
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
if (this.index == 0) {
this.searchParams.tracking_no = '';
} else if (this.index == 1) {
this.searchParams.stock_in_sn = '';
} else if (this.index == 2) {
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
}
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, event) {
var val = event.target.value;
this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
if (val) {
if (type == 1) {
this.searchParams.tracking_no = val;
} else if (type == 2) {
this.searchParams.stock_in_sn = val;
} else if (type == 3) {
this.searchParams.stock_in_with_stock_in_items_inhouse = val;
}
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 获取列表数据
*/
getData() {
this.request(API.haveTallyReceiveList, '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'
});
}
});
}
}
};
......
......@@ -40,6 +40,10 @@ const API = {
* */
haveTallyReceiveList: API_BASE + '/api/stockIn/tallyReceive/haveTallyReceiveList',
/**
* 取消理货
* */
cancelTallyReceive: API_BASE + '/api/stockIn/tallyReceive/cancelTallyReceive',
/**
* 获取容器下拉列表
* */
getTallyContainer: API_BASE + '/api/stockIn/tallyReceive/getTallyContainer',
......
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