Browse Source

修改采购上架批量

hella_online_20240911
lijuncheng 3 months ago
parent
commit
32f5e20fb1
  1. 2
      password.txt
  2. 49
      src/mycomponents/button/comCheckAll.vue
  3. 15
      src/mycomponents/job/jobFilter.vue
  4. 375
      src/pages/putaway/job/quantityPutawayJob.vue
  5. 13
      src/pages/putaway/record/putawayRecord.vue
  6. 5
      src/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue

2
password.txt

@ -1,2 +1,4 @@
别名:testalias
密码: wms3.0
包名:uni.UNI43932FE
id:__UNI__C9CF4BF

49
src/mycomponents/button/comCheckAll.vue

@ -0,0 +1,49 @@
<template>
<view class="flex uni-row">
<view class="" >
<u-checkbox size="50" v-model="checkAll" @change="checkAllItems" >
</u-checkbox>
</view>
<view>
<text style="margin-left: 10rpx; font-size: 35rpx;font-weight: bold;">全选({{checkCount}}/{{allCount}})</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
checkAll: false
}
},
props: {
checkCount: {
type: Number,
default: 0
},
allCount: {
type: Number,
default: 0
},
},
methods: {
checkAllItems() {
let that = this;
that.checkAll = !that.checkAll;
that.$emit("checkAllItems", that.checkAll);
},
changeCheckAllState() {
let that = this;
that.checkAll = that.checkCount == that.allCount
this.$forceUpdate();
}
}
}
</script>
<style>
</style>

15
src/mycomponents/job/jobFilter.vue

@ -46,6 +46,14 @@
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromLocationCode" :border="true"
placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" />
</view>
<view v-if="isShowToLocationCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
目标库位
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="toLocationCode" :border="true"
placeholder="请输入目标库位" />
</view>
<view v-if="isShowFromAreaCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
@ -127,6 +135,10 @@
type: Boolean,
default: false
},
isShowToLocationCode: {
type: Boolean,
default: false
},
isShowProductionLineCode: {
type: Boolean,
default: false
@ -165,6 +177,7 @@
checkedWaitModel: false,
productionLineCode: '', // 线
fromLocationCode: '', //
toLocationCode:"",//
fromAreaCode: '', //
toAreaCode: '', //
itemCode: '', //
@ -197,6 +210,7 @@
let params = {
productionLineCode: this.productionLineCode,
fromLocationCode: this.fromLocationCode,
toLocationCode:this.toLocationCode,
fromAreaCode: this.fromAreaCode, //
toAreaCode: this.toAreaCode, //
itemCode: this.itemCode,
@ -210,6 +224,7 @@
this.checkedWaitModel = false
this.productionLineCode = ''
this.fromLocationCode = ''
this.toLocationCode=""
this.fromAreaCode = '' //
this.toAreaCode = '' //
this.itemCode = ''

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

@ -1,22 +1,34 @@
<template>
<view class="">
<view class="" 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="标题文字" :pageSize='pageSize' @change="changePage" :current="pageNo"/>
<view class="" 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="" style="width: 100%; font-size: 30rpx; align-items: center; text-align: center;">
当前第{{pageNo}}每页{{ pageSize}} 共计{{ totalCount }}
</view>
</view>
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
:isShowToAreaCode="true" :isShowQurery='true' :isShowToday='false' :isShowStatus='false'
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" @onQuery="getListByFilter">
<job-filter ref="filter" otherTitle="ASN" :isShowToAreaCode="true" :isShowQurery='true' :isShowStatus='false'
:isShowToLocationCode="true" :isShowItemCode="true" @onQuery="getListByFilter">
</job-filter>
<view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 100rpx;">
<view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 150rpx;">
<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"
@click="swipeClick($event,item)">
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card>
<view class="flex" style="flex-direction: row; align-items: center;" >
<view class="uni-flex" style="flex-direction: column; align-items: center;" >
<text style="margin-bottom: 10rpx;">({{index+1}})</text>
<u-checkbox v-model="item.checked" :name="item.id" size="50" shape ="circle">
</u-checkbox>
</view>
<view class="" style="width: 100%;">
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card>
</view>
</view>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
@ -26,13 +38,10 @@
<!-- <uni-load-more :status="loadingType" v-if="jobList.length>0" /> -->
</view>
<!-- <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> -->
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'>
</winScanPackJob> -->
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<view class="footer" v-if="jobList.length>0">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="takeAllJob">执行当前</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="takeAllJob">执行当前已选择项</button>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
@ -49,6 +58,7 @@
cancleAllTakePutawayJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
@ -56,7 +66,6 @@
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -67,6 +76,9 @@
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue'
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import comCheckAll from "@/mycomponents/button/comCheckAll.vue"
import {
Exception
} from 'sass';
@ -81,12 +93,14 @@
putawayInfoPopup,
winScanButton,
winScanPackJob,
jobList
jobList,
comCheckAll
},
data() {
return {
jobList: [],
pageNo: 1,
currentPageNo: 1,
pageSize: 30,
totalCount: 0,
loadingType: "nomore",
@ -98,7 +112,11 @@
detailGiveupOptions: [],
title: '',
scanMessage: "",
jobNumberList:[],//
jobNumberList: [], //
creationTime: "",
itemCode: "",
toAreaCode: "",
toLocationCode: ""
};
},
@ -146,7 +164,7 @@
},
methods: {
getList(type,toAreaCode='') {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
@ -159,49 +177,24 @@
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if(this.toAreaCode){
//
filters.push({
column: "toAreaCode",
action: "==",
value: this.toAreaCode
})
}
var queryFiltersParams = this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
this.currentPageNo = this.pageNo
getPutawayJobList(params).then(res => {
uni.hideLoading();
// if (type === "refresh") {
// uni.stopPullDownRefresh();
// this.openScanPopup()
// }
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
list.forEach(item=>{
item.checked=false;
})
this.totalCount = res.data.total
console.log(333,this.totalCount)
updateTitle(this.title + "(" + this.totalCount + ")");
// this.loadingType = "loadmore";
// if (list == null || list.length == 0) {
@ -209,7 +202,6 @@
// return;
// }
this.jobList = list
this.jobNumberList = list.map(item=>item.number)
// this.pageNo++;
}).catch(error => {
@ -230,6 +222,62 @@
this.scanMessage = ""
},
setQueryParam() {
var filterParams = []
var queryParams = {
status: this.status,
creationTime: this.creationTime,
itemCode: this.itemCode,
toAreaCode: this.toAreaCode,
toLocationCode: this.toLocationCode
}
//
if (queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}
//
if (queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: queryParams.itemCode
})
}
//
if (queryParams.toAreaCode) {
filterParams.push({
column: "toAreaCode",
action: "==",
value: queryParams.toAreaCode
})
}
//
if (queryParams.toLocationCode) {
filterParams.push({
column: "toLocationCode",
action: "==",
value: queryParams.toLocationCode
})
}
return filterParams;
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
@ -270,72 +318,14 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
// this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1'
})
filters.push({
column: "number",
action: "==",
value: code
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getPutawayJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
if(this.$refs.scanPopup){
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if(this.$refs.scanPopup){
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
@ -356,121 +346,35 @@
});
this.scanMessage = ""
},
getScanResult(result) {
try {
this.scanMessage = ""
var filters = [{
column: "packingNumber",
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "batch",
action: "==",
value: result.package.batch
},
// {
// column: "qty",
// action: "==",
// value: result.label.qty
// },
{
column: "itemCode",
action: "==",
value: result.package.itemCode
},
{
column: "status",
action: "in",
value: '1',
},
// {
// column: "accept_user_id",
// action: "==",
// value: this.$store.state.user.id
// }
// {
// column: "fromLocationCode",
// action: "==",
// value: result.label.fromLocationCode
// },
]
getPutawayJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length == 1) {
//
if (list[0].status == 1) {
this.selectItem(list[0])
} else if (list[0].status == 2) {
//
if (list[0].acceptUserId == this.$store.state.user.id) {
this.selectItem(list[0])
} else {
this.showMessage("该任务已经被[" + list[0].acceptUserName + "]承接" + "\n任务号[" +
list[0].number + "]扫描[" + result.scanMessage + "]")
}
} else if (list[0].status == 3) {
this.showMessage("该任务已经完成\n承接人[" + list[0].acceptUserName + "]\n任务号[" +
list[0].number + "]扫描[" + result.scanMessage + "]")
}
} else {
this.showMessage("查询到多条任务\n" + "扫描[" + result.scanMessage + "]")
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e + "\n扫描[" + result.scanMessage + "]")
}
},
getListByFilter(params) {
console.log('getListByFilter',params)
console.log('getListByFilter', params)
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.status = "1"
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.toAreaCode) {
//
this.toAreaCode = params.toAreaCode
}else{
this.toAreaCode = ''
}
this.getList('refresh',this.toAreaCode)
this.creationTime = params.creationTime
this.itemCode = params.itemCode
this.toAreaCode = params.toAreaCode
this.toLocationCode = params.toLocationCode
this.getList('refresh')
},
//
takeAllJob(){
takeAllJob() {
uni.showLoading({
title: "加载中­....",
mask: true
});
this.jobNumberList =[]
this.jobList.forEach(item=>{
if(item.checked){
this.jobNumberList.push(item.number)
}
})
takeAllPutawayJob({
jobNumberList:this.jobNumberList
jobNumberList: this.jobNumberList
}).then(res => {
if (res.data) {
this.executeAllJob()
@ -483,15 +387,15 @@
this.showMessage(error)
})
},
executeAllJob(){
executeAllJob() {
putawayJobAllExecute({
jobNumberList:this.jobNumberList
jobNumberList: this.jobNumberList
}).then(res => {
if (res.data) {
uni.hideLoading()
this.$refs.comMessage.showSuccessMessage( "执行任务成功", res => {
this.$refs.comMessage.showSuccessMessage("执行任务成功", res => {
if (res) {
this.getList()
this.getList('refresh')
}
});
} else {
@ -508,9 +412,9 @@
},
//
cancleAllJob(){
cancleAllJob() {
cancleAllTakePutawayJob({
jobNumberList:this.jobNumberList
jobNumberList: this.jobNumberList
}).then(res => {
}).catch(error => {
@ -518,11 +422,19 @@
this.showMessage(error)
})
},
changePage(e){
changePage(e) {
console.log(e)
this.pageNo = e.current
this.status = 1
this.getList()
},
checkAllItems(checkAll){
console.log(checkAll)
},
cancleAll(){
this.jobList.forEach(res=>{
res.checked=false;
})
}
}
@ -530,15 +442,16 @@
</script>
<style scoped lang="scss">
.footer{
position: fixed;
bottom: 0px;
background: white;
width: 100%;
padding:16rpx 20rpx;
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05);
button{
.footer {
position: fixed;
bottom: 0px;
background: white;
width: 100%;
padding: 16rpx 20rpx;
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05);
button {
width: 100%;
}
}
}
</style>

13
src/pages/putaway/record/putawayRecord.vue

@ -124,7 +124,7 @@
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway",
editItem:{}
editItem:{},
};
},
onLoad(option) {
@ -208,9 +208,14 @@
newDetail.poNumber=poNumber;
newDetail.supplierCode=supplierCode;
newDetail.fromInventoryStatus = balance.inventoryStatus;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
if(item.subList&&item.subList.length>0){
if(item.subList[0].batch!=newDetail.batch){
this.showErrorMessage("扫描的批次是["+newDetail.batch+"],请扫描["+item.subList[0].batch+"的批次的箱码")
}
}else {
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
}
});
} else {
if (detail.scaned == true) {

5
src/uni_modules/vk-uview-ui/components/u-checkbox/u-checkbox.vue

@ -257,6 +257,7 @@ export default {
align-items: center;
overflow: hidden;
user-select: none;
margin-left: 10rpx;
line-height: 1.8;
&__icon-wrap {
@ -309,8 +310,8 @@ export default {
&__label {
word-wrap: break-word;
margin-left: 10rpx;
margin-right: 24rpx;
// margin-left: 10rpx;
// margin-right: 24rpx;
color: $u-content-color;
font-size: 30rpx;

Loading…
Cancel
Save