Commit 0dc723ee by LJM

js

parent 71aae4ff
......@@ -256,5 +256,13 @@
color: #ffffff;
font-weight: bold;
}
.btn2 {
width: 100%;
height: 75rpx;
background: #f5f5f7;
font-size: 23rpx;
color: #1969f9;
font-weight: bold;
}
}
}
......@@ -10,6 +10,7 @@
border-radius: 10rpx;
margin-bottom: 15rpx;
flex-wrap: wrap;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
......
<template>
<view class="stockRecheck-record">
<view class="list">
<view class="box row curr" v-for="(item, index) in 15">
<view class="check-box-icon"></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="input-box row verCenter">
<text class="label">入库批次号:</text>
<text class="tt">L-ASN2201010001</text>
<text class="tt">{{ item.stock_in_batch_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">状态:</text>
<text class="tt">待确认</text>
<text class="tt">{{ item.stock_out_status_val }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品编码:</text>
<text class="text">C12345</text>
<text class="text">{{ item.goods_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品名称:</text>
<text class="text">2121</text>
<text class="text">{{ item.goods_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">标准品牌:</text>
<text class="text">C12345</text>
<text class="text">{{ item.brand_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">D / C:</text>
<text class="text">2121</text>
<text class="text">{{ item.date_code }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">产 地:</text>
<text class="text">美国</text>
<text class="text">{{ item.coo }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品品质:</text>
<text class="text">良品</text>
<text class="text">{{ item.quality_val }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">入 仓 号:</text>
<text class="text">C12345</text>
<text class="text">{{ item.inhouse }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">其他批次属性:</text>
<text class="text">-</text>
<text class="text">{{ item.other_batch_attr }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">复核数量:</text>
<text class="text" style="color: #F98119;">30000</text>
<text class="text" style="color: #F98119;">{{ item.recheck_qty }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">打包箱号:</text>
<text class="text">RQ0001</text>
<text class="text">{{ item.box_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">复 核 人:</text>
<text class="text">欧阳雪雁</text>
<text class="text">{{ item.create_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">销 售 员:</text>
<text class="text">朱国军</text>
<text class="text">{{ item.sale_name }}</text>
</view>
<view class="input-box row verCenter" style="flex: 0 0 100%;">
<text class="label">复核时间:</text>
<text class="text">2023-04-01 11:28:59</text>
<text class="text">{{ item.create_time }}</text>
</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">
<text class="check-box-icon curr"></text>
<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="text">全选</text>
</view>
<view class="btn2 row rowCenter verCenter">取消复核</view>
<view class="btn2 row rowCenter verCenter" @click="cancelCheck()">取消复核</view>
</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
export default {
data() {
return {};
return {
page: 1,
limit: 10000,
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [] //过滤处理的id
};
},
onShow() {
this.getData();
},
onLoad() {},
methods: {}
methods: {
/**
* 找出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].recheck_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.recheck_item_id;
});
} else {
this.filter_id = [];
}
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllCheckedItemList, 'POST', { page: this.page, limit: this.limit }, 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'
});
}
});
},
/**
* 取消复核
*/
cancelCheck() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
uni.showModal({
title: '提示',
content: '确定要取消复核吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelCheck, 'POST', { recheck_item_id: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消复核成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.filter_id = [];
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
}
}
};
</script>
......
......@@ -128,6 +128,22 @@ const API = {
* */
multiMarkChecked: API_BASE + '/api/stockRecheck/multiMarkChecked',
/**
* 复核记录
* */
getAllCheckedItemList: API_BASE + '/api/stockRecheck/getAllCheckedItemList',
/**
* 取消复核
* */
cancelCheck: API_BASE + '/api/stockRecheck/cancelCheck',
/**
* 获取可打印快递单的出库单列表
* */
getToPrintList: API_BASE + '/api/stockRecheck/getToPrintList',
/**
* 获取出库详情
* */
getStockOutDetail: API_BASE + '/api/stockOut/getStockOutDetail',
/**
* 上传文件
* */
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