Browse Source

修改批量上架修改库位

intex^2
lijuncheng 3 days ago
parent
commit
c63717c3f5
  1. 125
      src/pages/putaway/job/quantityPutawayJob.vue

125
src/pages/putaway/job/quantityPutawayJob.vue

@ -1,19 +1,23 @@
<template> <template>
<view class=""> <view class="">
<view class="" v-if="jobList.length>0" style="background: white;padding: 20rpx;position: fixed;width: 100%;box-shadow: 0px 0px 10px 10px rgba(1, 1, 1, 0.05);z-index: 22; "> <view class="" v-if="jobList.length>0"
<uni-pagination :total="totalCount" title="每页30" :pageSize='pageSize' @change="changePage" :current="pageNo"/> style="background: white;padding: 20rpx;position: fixed;width: 100%;box-shadow: 0px 0px 10px 10px rgba(1, 1, 1, 0.05);z-index: 22; ">
<uni-pagination :total="totalCount" title="每页30" :pageSize='pageSize' @change="changePage"
:current="pageNo" />
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<view class="" > <view class="">
<u-checkbox size="40" v-model="checkAll" @change="checkAllItems" > <u-checkbox size="40" v-model="checkAll" @change="checkAllItems">
</u-checkbox> </u-checkbox>
</view> </view>
<view> <view>
<text style="margin-left: 2rpx; font-size: 32rpx;font-weight: bold;">当前页({{jobList.length}})</text> <text
style="margin-left: 2rpx; font-size: 32rpx;font-weight: bold;">当前页({{jobList.length}})</text>
</view> </view>
</view> </view>
<view class="" style=" margin-left: 10rpx; font-size: 32rpx; align-items: center; text-align: center;"> <view class=""
style=" margin-left: 10rpx; font-size: 32rpx; align-items: center; text-align: center;">
{{pageNo}}每页/{{ pageSize}}, :{{ totalCount }} {{pageNo}}每页/{{ pageSize}}, :{{ totalCount }}
</view> </view>
</view> </view>
@ -26,19 +30,26 @@
</job-filter> </job-filter>
<view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 150rpx;"> <view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 150rpx;">
<view class="" style="padding-left: 60rpx; padding-top: 10rpx; padding-bottom: 10rpx; background-color:#D3D1CC">
<locationCompare ref='comScanLocation' title="目标库位"
:recommendLocationCode="toSubmitLocationCode" @getLocation='scanLocationCode' :isShowEdit="true"
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index" > <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<view class="flex" style="flex-direction: row; align-items: center;" > <view class="flex" style="flex-direction: row; align-items: center;">
<view class="uni-flex" style="flex-direction: column; align-items: center;" > <view class="uni-flex" style="flex-direction: column; align-items: center;">
<text style="margin-bottom: 10rpx;">({{index+1}})</text> <text style="margin-bottom: 10rpx;">({{index+1}})</text>
<u-checkbox v-model="item.checked" :name="item.id" size="50" shape ="circle"> <u-checkbox v-model="item.checked" :name="item.id" size="50" shape="circle">
</u-checkbox> </u-checkbox>
</view> </view>
<view class="" style="width: 100%;"> <view class="" style="width: 100%;">
<com-putaway-job-card :dataContent="item" @click='checkedItem(item)'></com-putaway-job-card> <com-putaway-job-card :dataContent="item"
@click='checkedItem(item)'></com-putaway-job-card>
</view> </view>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -70,6 +81,9 @@
cancleAllTakePutawayJob cancleAllTakePutawayJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getDirectoryItemArray,
} from '@/common/directory.js';
import { import {
goHome, goHome,
@ -89,6 +103,7 @@
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue' import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import comCheckAll from "@/mycomponents/button/comCheckAll.vue" import comCheckAll from "@/mycomponents/button/comCheckAll.vue"
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import { import {
@ -106,7 +121,8 @@
winScanButton, winScanButton,
winScanPackJob, winScanPackJob,
jobList, jobList,
comCheckAll comCheckAll,
locationCompare
}, },
data() { data() {
return { return {
@ -129,7 +145,9 @@
itemCode: "", itemCode: "",
toAreaCode: "", toAreaCode: "",
toLocationCode: "", toLocationCode: "",
checkAll:false checkAll: false,
toSubmitLocationCode: "",
toLocationAreaTypeList: []
}; };
}, },
@ -198,16 +216,17 @@
} }
this.currentPageNo = this.pageNo this.currentPageNo = this.pageNo
getPutawayJobList(params).then(res => { getPutawayJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; var list = res.data.list;
list.forEach(item=>{ list.forEach(item => {
item.checked=false; item.checked = false;
}) })
this.checkAll=false this.checkAll = false
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
// this.loadingType = "loadmore"; // this.loadingType = "loadmore";
@ -216,6 +235,11 @@
// return; // return;
// } // }
this.jobList = list this.jobList = list
if (this.jobList.length > 0) {
this.toLocationAreaTypeList = getDirectoryItemArray(this.jobList[0].toAreaTypes)
}
this.toSubmitLocationCode=""
// this.pageNo++; // this.pageNo++;
}).catch(error => { }).catch(error => {
@ -376,16 +400,34 @@
}, },
// //
takeAllJob() { takeAllJob() {
uni.showLoading({ if(!this.toSubmitLocationCode){
title: "加载中­....", this.$refs.comMessage.showQuestionMessage("是否要修改目标库位?", res => {
mask: true if (res) {
this.$refs.comScanLocation.showLocation()
}else {
this.submitJob()
}
}); });
this.jobNumberList =[] }else {
this.jobList.forEach(item=>{ this.submitJob()
if(item.checked){ }
},
submitJob(){
this.jobNumberList = []
this.jobList.forEach(item => {
if (item.checked) {
this.jobNumberList.push(item.number) this.jobNumberList.push(item.number)
} }
}) })
if(this.jobNumberList.length==0){
this.showMessage("最少选择一条数据")
return
}
uni.showLoading({
title: "加载中­....",
mask: true
});
takeAllPutawayJob({ takeAllPutawayJob({
jobNumberList: this.jobNumberList jobNumberList: this.jobNumberList
@ -401,10 +443,14 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
executeAllJob() { executeAllJob() {
putawayJobAllExecute({ var params ={
jobNumberList: this.jobNumberList toLocationCode:this.toSubmitLocationCode,
}).then(res => { jobNumberList:this.jobNumberList
}
putawayJobAllExecute(params).then(res => {
if (res.data) { if (res.data) {
uni.hideLoading() uni.hideLoading()
this.$refs.comMessage.showSuccessMessage("执行任务成功", res => { this.$refs.comMessage.showSuccessMessage("执行任务成功", res => {
@ -442,25 +488,28 @@
this.status = 1 this.status = 1
this.getList() this.getList()
}, },
checkAllItems(checkAll){ checkAllItems(checkAll) {
if(checkAll.value){ if (checkAll.value) {
this.jobList.forEach(res=>{ this.jobList.forEach(res => {
res.checked=true; res.checked = true;
}) })
}else { } else {
this.jobList.forEach(res=>{ this.jobList.forEach(res => {
res.checked=false; res.checked = false;
}) })
} }
}, },
cancleAll(){ cancleAll() {
this.jobList.forEach(res=>{ this.jobList.forEach(res => {
res.checked=false; res.checked = false;
}) })
}, },
checkedItem(item){ checkedItem(item) {
item.checked =!item.checked item.checked = !item.checked
} },
scanLocationCode(location, code) {
this.toSubmitLocationCode = code
},
} }
} }

Loading…
Cancel
Save