货无忧
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1331 lines
31 KiB

<template>
<BasicContainer :option="option">
<!-- 主体内容 -->
<view class="main">
<!-- 顶部 -->
<view class="main_top">
<input type="text" v-model="details.searchText" placeholder="请输入库位码" class="main_top_search" />
<view class="button" @click="submitSearch">搜索</view>
</view>
<!-- 库位信息 -->
<view class="main_info">
<view class="main_info_row">
<view class="main_info_item">
<text>库位号:</text>
<text>{{ tabBarCode === 1 ? article.allocationCode : (tabBarCode === 2 ? zero.allocationCode : stock.allocationCode) }}</text>
</view>
</view>
<view class="main_info_row">
<view class="main_info_item">
<text>库位总数:</text>
<text>{{ tabBarCode === 1 ? article.allNum : (tabBarCode === 2 ? zero.allNum : stock.allNum) }}</text>
</view>
<view class="main_info_item">
<text>库位已盘数:</text>
<text>{{article.finishNum}}</text>
</view>
<view class="main_info_item">
<text>库位未盘数:</text>
<text>{{ tabBarCode === 1 ? (article.allNum - article.finishNum) : (tabBarCode === 2 ? (zero.allNum - zero.finishNum) : (stock.allNum- stock.finishNum)) }}</text>
</view>
</view>
</view>
<!-- tabBar选项卡 -->
<view class="tabBar">
<view :class="{'tabBar-item': true, 'active': tabBarCode === 1}" @click="handleTabBarCode(1)">
定制品 <text v-if='tabBarCode==1'>({{article.total}})</text>
</view>
<view :class="{'tabBar-item': true, 'active': tabBarCode === 2}" @click="handleTabBarCode(2)">
零担<text v-if='tabBarCode==2'> ({{zero.total}})</text>
</view>
<view :class="{'tabBar-item': true, 'active': tabBarCode === 3}" @click="handleTabBarCode(3)">
库存品<text v-if='tabBarCode==3'> ({{stock.total}})</text>
</view>
</view>
<!-- 控件 -->
<view class="control">
<view class="button" @click="showControl = true" v-show="!showControl">批量操作</view>
<view class="button" @click="grounding" v-show="!showControl">添加物料</view>
<template v-if="showControl">
<view class="button" @click="handleInvertSelection">反选</view>
<view class="controlList">
<view class="button" @click="handleBatchDel">
批量删除
</view>
<view class="button" @click="handleBatchUp">
批量上架
</view>
<view class="button" @click="handleBatchState">
状态修改
</view>
</view>
</template>
</view>
<!-- 列表 -->
<scroll-view class="scvmabx" @scrolltolower="reachBottomInitPage" scroll-y="true" @touchmove.stop>
<!-- 按库位盘点 -->
<template v-if="renderList.length !== 0">
<view class="list" v-for="(item, index) in renderList"
:class="`list ${details.activeColor[item.questStatus]}`" :key="item">
<!-- 复选框 -->
<view class="leftIcon" v-if="item.questStatus !== 3">
<!-- 定制品 -->
<template v-if="tabBarCode === 1">
<image class="checkImage" @click="articleCheckList[index] = !articleCheckList[index]"
:src="articleCheckList[index]?'/pagesHome/static/check.png':'/pagesHome/static/nocheck.png'">
</image>
</template>
<!-- 零担 -->
<template v-if="tabBarCode === 2">
<image class="checkImage" @click="zeroCheckList[index] = !zeroCheckList[index]"
:src="zeroCheckList[index]?'/pagesHome/static/check.png':'/pagesHome/static/nocheck.png'">
</image>
</template>
<!-- 库存品 -->
<template v-if="tabBarCode === 3">
<image class="checkImage" @click="stockCheckList[index] = !stockCheckList[index]"
:src="stockCheckList[index]?'/pagesHome/static/check.png':'/pagesHome/static/nocheck.png'">
</image>
</template>
</view>
<!-- 定制品 -->
<template v-if="tabBarCode === 1">
<view class="rightMsg">
<view class="tpbx" v-if="item.questStatus !== 3">
<view style="flex: none;">
操作:
</view>
<view style="display: flex; justify-content: space-around;">
<text class="button" @click="handleState(item)">处理</text>
<text class="button" @click="upDataItem(item)">上架</text>
</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>包条码:{{item.ordePackageCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>合同号:{{item.orderCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>库位:{{item.positionCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>状态:在库</view>
</view>
</view>
</template>
<!-- 零担 -->
<template v-else-if="tabBarCode === 2">
<view class="rightMsg">
<view class="tpbx" v-if="item.questStatus !== 3">
<view style="flex: none;">
操作:
</view>
<view style="display: flex; justify-content: space-around;">
<text class="button" @click="handleState(item)">处理</text>
<text class="button" @click="upDataItem(item)">上架</text>
</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>物料编码:{{item.materialCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>物料名称:{{item.marketName}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>数量:{{item.stockNum}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>库位:{{item.positionCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>状态:在库</view>
</view>
</view>
</template>
<!-- 库存品 -->
<template v-else-if="tabBarCode === 3">
<view class="rightMsg">
<view class="tpbx" v-if="item.questStatus !== 3">
<view style="flex: none;">
操作:
</view>
<view style="display: flex; justify-content: space-around;">
<text class="button" @click="handleState(item)">处理</text>
<text class="button" @click="upDataItem(item)">上架</text>
</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>订单号:{{item.orderCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>运单号:{{''}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>数量:{{item.stockNum}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>库位:{{item.positionCode}}</view>
</view>
<view class="tpbx">
<image src="/pagesHome/static/kuweiicon.png"></image>
<view>状态:在库</view>
</view>
</view>
</template>
</view>
</template>
</scroll-view>
<!-- 提交 -->
<button @click="submitCheck" class="submitButton" type="primary">提交盘点</button>
</view>
<saomiao2></saomiao2>
<tiplist ref="tiplists"></tiplist>
<view class="popUp" @click="details.showUpData = false" v-if="details.showUpData">
<view class="container" @click.stop>
<view style="text-align: center;" class="">
上架
</view>
<view class="up" style="height: 100px;">
<input style="padding: 10px; border: 1px solid #000;" type="text" v-model="details.scancode"
placeholder="扫描或输入库位码" id="">
</view>
<view style="display: flex; align-items: center;" class="">
<button style="flex: 1;" @click.stop="details.showUpData = false" class="button">取消</button>
<button style="flex: 1;" @click.stop="upDataForm" class="button">上架</button>
</view>
</view>
</view>
</BasicContainer>
</template>
<script setup lang="ts">
import {
onShow,
onLoad,
onHide,
} from '@dcloudio/uni-app'
import { ref, reactive, toRefs, watch } from "vue";
import utils from '@/utils/utils.js';
import {
getWarehouseTaskAllocationDetailByStrip,
getallocationDetailByZeroWaList,
getallocationDetailByStockList,
postqueryupdateQuestDetailAllocation,
getWarehouseUpdateQuestDetail,
getWarehouseDeleteQuestDetail,
getWarehouseSaveNewQuestDetail
} from '@/api/user.js';
const option = reactive({
// 页面标题
title: '库位盘点',
isEnd: false,
haveData: true,
async pullDownRefreshInitPage() {
console.log('下拉刷新')
// 页面信息清空
article.articleList = []
return await initPage()
},
async reachBottomInitPage() {
console.log('触底加载')
return true
}
})
const details = reactive({
// 选项卡页码
tabBarCode: 1,
// 是否显示控件
showControl: false,
// 搜索框的值
searchText: '',
// 扫描后的值
scancode: '',
// 是否为扫描
isScan: false,
// 渲染的列表
renderList: [],
allocationId: '',
questId: '',
showUpData: false,
isUpScan: false,
// 是否为批量操作
isBatch: false,
// 单一上架的数据
upItme: {},
// 状态样式
activeColor: [
'normal',
'green',
'',
'red'
],
marketName: []
})
// 定制品
const article = reactive({
// 定制品列表
articleList: [],
// 定制品复选框列表
articleCheckList: [],
articlePage: {
current: 1,
size: 10,
},
total: 0,
// 库位号
allocationCode: '',
// 总数
allNum: '',
// 已盘点
finishNum: ''
})
// 零担
const zero = reactive({
// 零担列表
zeroList: [],
// 零担复选框列表
zeroCheckList: [],
zeroPage: {
current: 1,
size: 10,
},
// 总数
total: 0,
// 库位号
allocationCode: '',
// 总数
allNum: '',
// 已盘点
finishNum: ''
})
// 库存品
const stock = reactive({
// 库存品列表
stockList: [],
// 库存品复选框列表
stockCheckList: [],
stockPage: {
current: 1,
size: 10,
},
total: 0,
// 库位号
allocationCode: '',
// 总数
allNum: '',
// 已盘点
finishNum: ''
})
const {
showControl,
tabBarCode,
renderList,
} = toRefs(details)
const {
articleList,
articleCheckList,
} = toRefs(article)
const {
zeroList,
zeroCheckList,
} = toRefs(zero)
const {
stockList,
stockCheckList,
} = toRefs(stock)
const tiplists = ref(null)
// 页面初始化执行回调
onLoad((info) => {
details.allocationId = info.allocationId
details.questId = info.questId
console.log('info :>> ', info.marketName);
details.marketName = JSON.parse(info.marketName)
initArticle()
initZero()
initStock()
})
// 开启监听扫描
onShow(() => {
uni.$on('scancodedate', function (code) {
if (code) {
// console.log(code);
details.scancode = code
if (details.isUpScan) return
scandata()
}
})
})
// 关闭扫描监听
onHide(() => {
uni.$off('scancodedate')
})
// // 添加防抖函数
// let antiShake : any = null
// // 触底加载
// function reachBottomInitPage() {
// // 数据请求完毕, 不再请求
// if (option.isEnd) {
// return uni.showToast({
// icon: 'success',
// title: '数据已加载完毕'
// })
// }
// if (antiShake) {
// uni.hideLoading()
// // 清空定时器
// clearTimeout(antiShake)
// return antiShake = null
// }
// // 显示Loading, 并阻止点击屏幕
// uni.showLoading({
// title: '正在加载',
// mask: true
// })
// antiShake = setTimeout(async () => {
// // 触底请求
// console.log('触底')
// // 定制品
// if (tabBarCode.value === 1) { initPage() }
// // 零担
// if (tabBarCode.value === 2) { initPage() }
// // 库存品
// if (tabBarCode.value === 3) { initPage() }
// // 关闭Loading效果
// uni.hideLoading()
// // 清空定时器
// antiShake = null
// }, 1000)
// }
// 请求页面数据
async function initPage() {
// 请求定制品数据
if (tabBarCode.value === 1) return initArticle()
// 请求零担数据
if (tabBarCode.value === 2) return initZero()
// 请求库存品数据
if (tabBarCode.value === 3) return initStock()
}
/**
* 请求定制品数据
*/
async function initArticle() {
const submitData = {
code: details.searchText,
...article.articlePage,
questId: details.questId,
allocationId: details.allocationId,
type: 1,
}
try {
const res = await getWarehouseTaskAllocationDetailByStrip(submitData)
console.log('res :>>1 ', res)
const { code, data } = res
if (code === 200) {
article.total = data.allNum //总数
article.allocationCode = data.allocationCode//库位号
article.allNum = data.allNum //总数
article.finishNum = data.finishNum //已盘点
article.articleList = data.list
article.articleCheckList = data.list.map(() => false)
}
} catch (err) {
console.log('err :>> ', err)
//TODO handle the exception
}
}
/**
* 请求零担数据
*/
async function initZero() {
const submitData = {
code: details.searchText,
...zero.zeroPage,
questId: details.questId,
allocationId: details.allocationId,
type: 2,
}
try {
const res = await getallocationDetailByZeroWaList(submitData)
console.log('res :>>0蛋 ', res)
const { code, data } = res
if (code === 200) {
zero.total = data.allNum //总数
zero.allocationCode = data.allocationCode //库位号
zero.allNum = data.allNum //总数
zero.finishNum = data.finishNum //已盘点
zero.zeroList = data.list
zero.zeroCheckList = data.list.map(() => false)
}
} catch (err) {
console.log('err :>> ', err)
//TODO handle the exception
}
}
/**
* 请求库存品数据
*/
async function initStock() {
const submitData = {
code: details.searchText,
...stock.stockPage,
questId: details.questId,
allocationId: details.allocationId,
type: 3,
}
try {
const res = await getallocationDetailByStockList(submitData)
console.log('res :>>库存 ', res)
const { code, data } = res
if (code === 200) {
stock.total = data.allNum //总数
stock.allocationCode = data.allocationCode //库位号
stock.allNum = data.allNum//总数
stock.finishNum = data.finishNum //已盘点
stock.stockList = data.list
stock.stockCheckList = data.list.map(() => false)
}
} catch (err) {
console.log('err :>> ', err)
//TODO handle the exception
}
}
// 扫描后执行的回调
async function scandata() {
if (details.tabBarCode !== 1) return
details.scancode
const flag = article.articleList.find(val => val.ordePackageCode === details.scancode)
console.log('flag :>> ', flag);
// 当包件存在
if (flag) {
const questDetailList = [{
id: flag.id,
// 在库数
stockNum: flag.stockNum,
// 丢失
lossNum: 0,
// 配送
deliveNum: 0,
// 破损
wornNum: 0,
// 不可修复
noRepairNum: 0,
// 未入库
noReceivedNum: 0,
}]
const res = await getWarehouseUpdateQuestDetail({ questDetailList, questId: details.questId })
const { code, msg } = res
console.log('res :>> ', res);
if (code === 200) {
initPage()
utils.ttsspke(msg)
}
} else {
grounding()
}
}
// 改变选项卡激活状态
function handleTabBarCode(code : number) {
showControl.value = false
tabBarCode.value = code
}
/**
* 提交搜索请求
*/
function submitSearch() {
uni.showToast({
title: '功能开发中'
})
}
/**
* 提交盘点
*/
function submitCheck() {
// 返回上一级
uni.navigateBack()
}
/**
* 复选框反选
*/
function handleInvertSelection() {
if (tabBarCode.value === 1) {
articleCheckList.value = articleCheckList.value.map(val => !val)
return
}
if (tabBarCode.value === 2) {
zeroCheckList.value = zeroCheckList.value.map(val => !val)
return
}
if (tabBarCode.value === 3) {
stockCheckList.value = stockCheckList.value.map(val => !val)
return
}
}
/**
* 批量删除
*/
function handleBatchDel() {
let checkList = []
if (tabBarCode.value === 1) checkList = article.articleCheckList
if (tabBarCode.value === 2) checkList = zero.zeroCheckList
if (tabBarCode.value === 3) checkList = stock.stockCheckList
if (!checkList.some(val => val)) {
return uni.showToast({
icon: 'none',
title: '最少选择一条数据'
})
}
const questDetailList = []
details.renderList.forEach((val, index) => { if (checkList[index]) questDetailList.push({ id: val.id }) })
tiplists.value.setdetails({
title: '确认批量删除',
isshow: true,
tipstate: 2,
list: [],
confirmTxt: '确认删除',
isonecheck: true,
success: (deta) => {
// const res = getWarehouseUpdateQuestDetail({ ids })
// console.log('res :>> ', res);
try {
getWarehouseDeleteQuestDetail({ questDetailList, questId: details.questId }).then(res => {
initPage()
utils.ttsspke(res.msg)
})
} catch (e) {
//TODO handle the exception
} finally {
tiplists.value.setdetails({ isshow: false })
}
},
cancel: () => {
tiplists.value.setdetails({ isshow: false })
},
close: () => {
tiplists.value.setdetails({ isshow: false })
}
})
}
/**
* 批量上架
*/
function handleBatchUp() {
details.isUpScan = true
details.showUpData = true
details.isBatch = true
}
/**
* 修改单个状态
*/
function handleState(item) {
try {
const checkSectionList = [
{
title: '丢失',
isCheck: false,
value: 0,
disabled: true
},
{
title: '配送',
isCheck: false,
value: 0,
disabled: true
},
{
title: '破损',
isCheck: false,
value: 0,
disabled: true
},
{
title: '不可修复',
isCheck: false,
value: 0,
disabled: true
},
{
title: '未入库',
isCheck: false,
value: 0,
disabled: true
}
]
// 定制品
if (tabBarCode.value !== 1) {
tiplists.value.setdetails({
title: '修改状态',
isshow: true,
tipstate: 6,
list: [{ title: '在库', value: item.stockNum }],
checkSectionList,
checklist: [],
inputtext: '',
confirmTxt: '确认选择',
isonecheck: true,
success: async (deta) => {
const { checklist, checkSectionList } = deta
if (checklist.length == 0) {
uni.showToast({
title: '请选择修改的状态',
icon: 'none'
})
return
}
if (checkSectionList[checklist[0]].value === 0) {
return uni.showToast({
title: '请输入修改的数量',
icon: 'none'
})
}
const questDetailList = [{
id: item.id,
// 在库数
stockNum: item.stockNum,
// 丢失
lossNum: checkSectionList[0].value,
// 配送
deliveNum: checkSectionList[1].value,
// 破损
wornNum: checkSectionList[2].value,
// 不可修复
noRepairNum: checkSectionList[3].value,
// 未入库
noReceivedNum: checkSectionList[4].value,
}]
const res = await getWarehouseUpdateQuestDetail({ questDetailList, questId: details.questId })
const { code } = res
if (code === 200) initPage()
tiplists.value.setdetails({ isshow: false })
},
cancel: () => {
tiplists.value.setdetails({ isshow: false })
},
close: () => {
tiplists.value.setdetails({ isshow: false })
}
})
// 零担和库存品
} else {
tiplists.value.setdetails({
title: '修改状态',
isshow: true,
tipstate: 6,
list: [{ title: '在库', value: item.stockNum }],
checkSectionList,
checklist: [],
inputtext: '',
confirmTxt: '确认选择',
isonecheck: false,
success: async (deta) => {
const { checklist, checkSectionList } = deta
if (checklist.length == 0) {
uni.showToast({
title: '请选择修改的状态',
icon: 'none'
})
return
}
if (checkSectionList[checklist[0]].value === 0) {
return uni.showToast({
title: '请输入修改的数量',
icon: 'none'
})
}
const questDetailList = [{
id: item.id,
// 在库数
stockNum: item.stockNum,
// 丢失
lossNum: checkSectionList[0].value,
// 配送
deliveNum: checkSectionList[1].value,
// 破损
wornNum: checkSectionList[2].value,
// 不可修复
noRepairNum: checkSectionList[3].value,
// 未入库
noReceivedNum: checkSectionList[4].value,
}]
const res = await getWarehouseUpdateQuestDetail({ questDetailList, questId: details.questId })
const { code } = res
if (code === 200) initPage()
tiplists.value.setdetails({ isshow: false })
},
cancel: () => {
tiplists.value.setdetails({ isshow: false })
},
close: () => {
tiplists.value.setdetails({ isshow: false })
}
})
}
} catch (e) {
//TODO handle the exception
} finally { }
}
/**
* 新增物料
*/
function grounding() {
const marketName = Array.from(details.marketName)
console.log('marketName :>> ', marketName);
const goodsType = ['定制品', '零担', '库存品']
tiplists.value.setdetails({
title: '新增',
isshow: true,
tipstate: 5,
upform: {
article: {
// 合同号
contractNumber: '',
// 包条码
orderPackageCode: details.scancode
},
stock: {}
},
marketName,
// goodsType: '库存品',
goodsType: goodsType[tabBarCode.value - 1],
confirmTxt: '确认新增',
isonecheck: true,
success: async (deta) => {
let submitData : any = {}
if (tabBarCode.value === 1) submitData = articleAdd(deta)
if (tabBarCode.value === 2) {
uni.showToast({
title: '功能还在开发中'
})
tiplists.value.setdetails({ isshow: false })
return submitData = zeroAdd(deta)
}
if (tabBarCode.value === 3) submitData = stockAdd(deta)
const res = await getWarehouseSaveNewQuestDetail(submitData)
console.log('res :>> ', res);
const { code } = res
if (code === 200) {
initPage()
uni.showToast({
title: '操作成功',
icon: 'success'
})
}
tiplists.value.setdetails({ isshow: false })
},
cancel: () => {
tiplists.value.setdetails({ isshow: false })
},
close: () => {
tiplists.value.setdetails({ isshow: false })
}
})
}
// 定制品添加
function articleAdd(deta) {
const { upform: { article: { contractNumber, orderPackageCode } } } = deta
if (!contractNumber) return uni.showToast({
title: '请输入合同号',
icon: 'none'
})
if (!orderPackageCode) return uni.showToast({
title: '请输入或扫描包条码',
icon: 'none'
})
const submitData = {
questDetail: {
ordePackageCode: orderPackageCode,
orderCode: contractNumber,
stockNum: 1,
},
allocationId: details.allocationId,
questTarget: 1,
questType: 2,
questId: details.questId,
}
return submitData
}
// 零担添加
function zeroAdd(deta) { }
// 库存品添加
function stockAdd(deta) {
console.log('deta :>> ', deta);
const { upform: { stock: { orderCode, stockNum, marketName, incomingBatch } } } = deta
// if (!contractNumber) return uni.showToast({
// title: '请输入合同号',
// icon: 'none'
// })
// if (!orderPackageCode) return uni.showToast({
// title: '请输入或扫描包条码',
// icon: 'none'
// })
console.log('data :>> ', deta);
const submitData = {
questDetail: {
orderCode: orderCode,
stockNum: stockNum,
marketName,
incomingBatch
},
allocationId: details.allocationId,
questTarget: 3,
questType: 2,
questId: details.questId,
}
return submitData
}
/**
* 批量修改状态
*/
function handleBatchState() {
let checkList = []
if (tabBarCode.value === 1) checkList = article.articleCheckList
if (tabBarCode.value === 2) checkList = zero.zeroCheckList
if (tabBarCode.value === 3) checkList = stock.stockCheckList
if (!checkList.some(val => val)) {
return uni.showToast({
icon: 'none',
title: '最少选择一条数据'
})
}
const questDetailList = []
details.renderList.forEach((val, index) => {
if (checkList[index]) {
questDetailList.push({
id: val.id,
// 在库数
stockNum: val.stockNum,
// 丢失
lossNum: 0,
// 配送
deliveNum: 0,
// 破损
wornNum: 0,
// 不可修复
noRepairNum: 0,
// 未入库
noReceivedNum: 0,
})
}
})
tiplists.value.setdetails({
title: '确定批量修改',
isshow: true,
tipstate: 2,
list: [],
confirmTxt: '确认修改',
isonecheck: true,
success: (deta) => {
// const res = getWarehouseUpdateQuestDetail({ ids })
// console.log('res :>> ', res);
try {
getWarehouseUpdateQuestDetail({ questDetailList, questId: details.questId }).then(res => {
utils.ttsspke(res.msg)
initPage()
})
} catch (e) {
//TODO handle the exception
} finally {
tiplists.value.setdetails({ isshow: false })
}
},
cancel: () => {
tiplists.value.setdetails({ isshow: false })
},
close: () => {
tiplists.value.setdetails({ isshow: false })
}
})
}
/**
* 单个上架
*/
function upDataItem(item) {
// 开启上架扫描
details.isUpScan = true
details.showUpData = true
details.isBatch = false
details.upItme = item
}
/**
* 提交上架
*/
async function upDataForm() {
try {
if (!details.scancode) return uni.showToast({
title: '请输入或扫描库位码',
icon: 'none'
})
let arr : any = []
// 批量操作
if (details.isBatch) {
// arr = details.renderList.filter((v, i) => )
// 定制品
if (tabBarCode.value === 1) arr = details.renderList.filter((v, i) => article.articleCheckList[i])
if (tabBarCode.value === 2) arr = details.renderList.filter((v, i) => zero.zeroCheckList[i])
if (tabBarCode.value === 3) arr = details.renderList.filter((v, i) => stock.stockCheckList[i])
} else {
arr = [details.upItme]
}
if (arr.length === 0) {
uni.showToast({
title: '最少选择一条数据',
icon: 'none'
})
utils.ttsspke('最少选择一条数据')
return
}
const questDetailList = arr.map(val => { return { id: val.id } })
const res = await postqueryupdateQuestDetailAllocation({ allocationId: details.scancode, questId: details.questId, questDetailList })
if (res.code === 200) {
initPage()
}
utils.ttsspke(res.msg)
} catch (err) {
console.log('err :>> ', err);
//TODO handle the exception
} finally {
// 关闭弹窗
details.showUpData = false
details.isBatch = false
}
}
watch([articleList, zeroList, stockList, tabBarCode], () => {
// 定制品
if (tabBarCode.value === 1) {
return renderList.value = articleList.value
}
// 零担
if (tabBarCode.value === 2) {
return renderList.value = zeroList.value
}
// // 库存品
if (tabBarCode.value === 3) {
return renderList.value = stockList.value
}
})
</script>
<style lang="scss" scoped>
$buttonColor: #d3832a;
// 本页按钮样式
.button {
font-size: 28upx;
padding: 10upx 20upx;
border: 1upx solid $buttonColor;
background-color: #fff;
color: #d3832a;
border-radius: 5upx;
}
.main {
padding: 10upx;
font-size: 28upx; // 本页字体大小
}
.main_top {
display: flex;
// align-items: center;
justify-content: space-between;
margin-bottom: 10upx;
// 顶部搜索框
&_search {
flex: 1;
padding-left: 20upx;
margin-right: 20upx;
box-sizing: border-box;
height: 28upx * 2;
border-radius: 28upx;
border: 1upx solid #000;
}
.button {
background-color: $buttonColor;
color: #fff;
padding: 0 60upx;
display: inline-flex;
align-items: center;
}
}
// 顶部信息区
.main_info {
margin-bottom: 10upx;
padding: 10upx;
background-color: #fff;
&_row {
padding: 10upx 0;
display: flex;
justify-content: space-between;
border-bottom: 2upx solid #000;
&:last-child {
border-bottom: none;
}
}
&_item {
flex: 1;
flex-basis: 0;
display: inline-flex;
text:first-child {
margin-right: 10upx;
}
}
}
// tabBar选项卡
.tabBar {
display: flex;
justify-content: space-evenly;
background-color: #fff;
margin-bottom: 10upx;
&-item {
position: relative;
flex: 1;
flex-basis: 0;
padding: 20upx 0;
text-align: center;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
display: block;
width: 0;
box-sizing: border-box;
border: 1upx solid $buttonColor;
transition: all 0.5s;
}
&.active {
color: $buttonColor;
&::after {
left: 0;
width: 100%;
}
}
}
}
// 控件区
.control {
display: flex;
justify-content: space-between;
.controlList {
display: flex;
.button {
margin: 0 5upx;
&:last-child {
margin-right: 0;
}
}
}
}
// 滚动区
.scvmabx {
width: 100%;
height: 60vh;
}
.list {
display: flex;
margin: 20upx 0;
padding: 0 10upx;
border-radius: 10upx;
box-shadow: 0 0 20upx #d3832a;
&.normal {
background-color: none;
}
&.green {
background: #eaffc9;
}
&.red {
background: #ffc9c9;
}
.leftIcon {
flex: none;
margin-right: 30upx;
// padding-top: 18upx;
.checkImage {
width: 48upx;
height: 48upx;
}
}
.rightMsg {
flex: 1;
}
}
// 列表
.tpbx {
display: flex;
align-items: center;
// padding: 18upx 24upx;
box-sizing: border-box;
border-bottom: 4upx solid #EEEEEE;
>image {
flex: none;
width: 64upx;
height: 64upx;
margin-right: 15upx;
}
>view {
flex: 1;
font-size: 28upx;
font-weight: 400;
color: #020B18;
.numb {
font-size: 28upx;
color: #178AF2;
}
}
}
.viewnum {
height: 100upx;
display: flex;
align-items: center;
justify-content: space-around;
>view {
font-size: 28upx;
font-weight: 400;
color: #020B18;
}
}
// 提交按钮
.submitButton {
position: fixed;
color: #fff;
background-color: $buttonColor;
width: 50%;
bottom: 30upx;
left: 50%;
transform: translateX(-50%);
}
// 弹出层
.popUp {
width: 100vw;
height: 100vh;
background: #00000033;
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
.container {
width: 70%;
height: 35%;
background: #fff;
border-radius: 10upx;
padding: 20upx;
display: flex;
flex-direction: column;
justify-content: space-between;
.button {
margin: 0 20upx;
}
}
}
</style>