Browse Source

修改采购上架批量

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

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

@ -1,22 +1,34 @@
<template> <template>
<view class=""> <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;"> <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"/>
<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> </view>
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" otherTitle="ASN" :isShowToAreaCode="true" :isShowQurery='true' :isShowStatus='false'
:isShowToAreaCode="true" :isShowQurery='true' :isShowToday='false' :isShowStatus='false' :isShowToLocationCode="true" :isShowItemCode="true" @onQuery="getListByFilter">
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" @onQuery="getListByFilter">
</job-filter> </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"> <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)">
<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> </uni-swipe-action-item>
</view> </view>
</uni-swipe-action> </uni-swipe-action>
@ -26,13 +38,10 @@
<!-- <uni-load-more :status="loadingType" v-if="jobList.length>0" /> --> <!-- <uni-load-more :status="loadingType" v-if="jobList.length>0" /> -->
</view> </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> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<view class="footer" v-if="jobList.length>0"> <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> </view>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -49,6 +58,7 @@
cancleAllTakePutawayJob cancleAllTakePutawayJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
updateTitle updateTitle
@ -56,7 +66,6 @@
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption getDetailGiveupOption
} from '@/common/array.js'; } from '@/common/array.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -67,6 +76,9 @@
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue' import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue'
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 { import {
Exception Exception
} from 'sass'; } from 'sass';
@ -81,12 +93,14 @@
putawayInfoPopup, putawayInfoPopup,
winScanButton, winScanButton,
winScanPackJob, winScanPackJob,
jobList jobList,
comCheckAll
}, },
data() { data() {
return { return {
jobList: [], jobList: [],
pageNo: 1, pageNo: 1,
currentPageNo: 1,
pageSize: 30, pageSize: 30,
totalCount: 0, totalCount: 0,
loadingType: "nomore", loadingType: "nomore",
@ -98,7 +112,11 @@
detailGiveupOptions: [], detailGiveupOptions: [],
title: '', title: '',
scanMessage: "", scanMessage: "",
jobNumberList:[],// jobNumberList: [], //
creationTime: "",
itemCode: "",
toAreaCode: "",
toLocationCode: ""
}; };
}, },
@ -146,7 +164,7 @@
}, },
methods: { methods: {
getList(type,toAreaCode='') { getList(type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -159,49 +177,24 @@
this.jobList = []; this.jobList = [];
} }
var filters = [] var queryFiltersParams = this.setQueryParam()
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 params = { var params = {
filters: filters, filters: queryFiltersParams,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
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();
// this.openScanPopup() }
// }
var list = res.data.list; var list = res.data.list;
list.forEach(item=>{
item.checked=false;
})
this.totalCount = res.data.total this.totalCount = res.data.total
console.log(333,this.totalCount)
updateTitle(this.title + "(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
// this.loadingType = "loadmore"; // this.loadingType = "loadmore";
// if (list == null || list.length == 0) { // if (list == null || list.length == 0) {
@ -209,7 +202,6 @@
// return; // return;
// } // }
this.jobList = list this.jobList = list
this.jobNumberList = list.map(item=>item.number)
// this.pageNo++; // this.pageNo++;
}).catch(error => { }).catch(error => {
@ -230,6 +222,62 @@
this.scanMessage = "" 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) { showItemList(itemList) {
this.$refs.scanList.openPopup(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) { showMessage(message) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus() this.$refs.scanPopup.packLoseFocus()
} }
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus() this.$refs.scanPopup.packGetFocus()
} }
} }
@ -356,121 +346,35 @@
}); });
this.scanMessage = "" 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) { getListByFilter(params) {
console.log('getListByFilter',params) console.log('getListByFilter', params)
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
mask: true mask: true
}); });
this.status = "1" this.creationTime = params.creationTime
if(params.creationTime==""){ this.itemCode = params.itemCode
this.checkedToday = false; this.toAreaCode = params.toAreaCode
} this.toLocationCode = params.toLocationCode
if (params.toAreaCode) { this.getList('refresh')
//
this.toAreaCode = params.toAreaCode
}else{
this.toAreaCode = ''
}
this.getList('refresh',this.toAreaCode)
}, },
// //
takeAllJob(){ takeAllJob() {
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
mask: true mask: true
}); });
this.jobNumberList =[]
this.jobList.forEach(item=>{
if(item.checked){
this.jobNumberList.push(item.number)
}
})
takeAllPutawayJob({ takeAllPutawayJob({
jobNumberList:this.jobNumberList jobNumberList: this.jobNumberList
}).then(res => { }).then(res => {
if (res.data) { if (res.data) {
this.executeAllJob() this.executeAllJob()
@ -483,15 +387,15 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
executeAllJob(){ executeAllJob() {
putawayJobAllExecute({ putawayJobAllExecute({
jobNumberList:this.jobNumberList jobNumberList: this.jobNumberList
}).then(res => { }).then(res => {
if (res.data) { if (res.data) {
uni.hideLoading() uni.hideLoading()
this.$refs.comMessage.showSuccessMessage( "执行任务成功", res => { this.$refs.comMessage.showSuccessMessage("执行任务成功", res => {
if (res) { if (res) {
this.getList() this.getList('refresh')
} }
}); });
} else { } else {
@ -508,9 +412,9 @@
}, },
// //
cancleAllJob(){ cancleAllJob() {
cancleAllTakePutawayJob({ cancleAllTakePutawayJob({
jobNumberList:this.jobNumberList jobNumberList: this.jobNumberList
}).then(res => { }).then(res => {
}).catch(error => { }).catch(error => {
@ -518,11 +422,19 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
changePage(e){ changePage(e) {
console.log(e) console.log(e)
this.pageNo = e.current this.pageNo = e.current
this.status = 1 this.status = 1
this.getList() this.getList()
},
checkAllItems(checkAll){
console.log(checkAll)
},
cancleAll(){
this.jobList.forEach(res=>{
res.checked=false;
})
} }
} }
@ -530,15 +442,16 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.footer{ .footer {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
background: white; background: white;
width: 100%;
padding:16rpx 20rpx;
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05);
button{
width: 100%; width: 100%;
padding: 16rpx 20rpx;
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05);
button {
width: 100%;
}
} }
}
</style> </style>

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

@ -124,7 +124,7 @@
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway", businessTypeCode: "PurchasePutaway",
editItem:{} editItem:{},
}; };
}, },
onLoad(option) { onLoad(option) {
@ -208,9 +208,14 @@
newDetail.poNumber=poNumber; newDetail.poNumber=poNumber;
newDetail.supplierCode=supplierCode; newDetail.supplierCode=supplierCode;
newDetail.fromInventoryStatus = balance.inventoryStatus; newDetail.fromInventoryStatus = balance.inventoryStatus;
if(item.subList&&item.subList.length>0){
item.subList.push(newDetail); if(item.subList[0].batch!=newDetail.batch){
calcHandleQty(this.detailSource); this.showErrorMessage("扫描的批次是["+newDetail.batch+"],请扫描["+item.subList[0].batch+"的批次的箱码")
}
}else {
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
}
}); });
} else { } else {
if (detail.scaned == true) { 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; align-items: center;
overflow: hidden; overflow: hidden;
user-select: none; user-select: none;
margin-left: 10rpx;
line-height: 1.8; line-height: 1.8;
&__icon-wrap { &__icon-wrap {
@ -309,8 +310,8 @@ export default {
&__label { &__label {
word-wrap: break-word; word-wrap: break-word;
margin-left: 10rpx; // margin-left: 10rpx;
margin-right: 24rpx; // margin-right: 24rpx;
color: $u-content-color; color: $u-content-color;
font-size: 30rpx; font-size: 30rpx;

Loading…
Cancel
Save