Browse Source

空器具库移和空器具呼叫

pda_nev
李俊城 1 year ago
parent
commit
7d30846621
  1. 20
      fe/PDA/api/index.js
  2. 40
      fe/PDA/common/basic.js
  3. 165
      fe/PDA/pages/container/containerCall.vue
  4. 199
      fe/PDA/pages/container/containerMove.vue

20
fe/PDA/api/index.js

@ -1400,4 +1400,24 @@ export const getPlasticsList = (params) => request(
method: 'get',
data: params
});
//空器具呼叫
export const containerRequest = (params) => request(
devUrl + "/api/pda/store/container-request", { //
data: params,
method: "post"
})
//空器具库移列表
export const getContainerList = (params) => request(
devUrl + "/api/pda/job/container/list", {
method: 'get',
data: params
});
//空器具库移完成
export const finshContainerJob = (id, params) => request(
devUrl + "/api/pda/job/container/finish/" + id, { //
data: params,
method: "post"
})

40
fe/PDA/common/basic.js

@ -170,7 +170,7 @@ export function getLocationType(val) {
else if (val == 8) return 'noc'
else if (val == 9) return 'overflow'
else if (val == 10) return 'customer'
else return 'other'
else return 'other'
}
//获取库位类型描述
@ -204,6 +204,32 @@ export function getJobType(val) {
else return 'Other'
}
export function getContainerTypeArray() {
let array = [{
name: '内物流',
value: "InLogistics",
}, {
name: '外物流',
value: "OutLogistics",
}];
return array;
}
export function getContainerTypeName(val) {
let array = [{
name: '内物流',
value: "InLogistics",
}, {
name: '外物流',
value: "OutLogistics",
}];
let item = array.find(r => r.value == val);
return item.name;
}
//提示是否消息
export function showConfirmMsg(content, callback) {
uni.showModal({
@ -332,8 +358,8 @@ export function setRootFontSize(fontSize) {
export function scanErrorAudio() {
var music = null;
music = uni.createInnerAudioContext(); //创建播放器对象
music.src ="../../static/video/error.wav";
music.volume=1;
music.src = "../../static/video/error.wav";
music.volume = 1;
music.play(); //执行播放
music.onEnded(() => {
//播放结束
@ -345,8 +371,8 @@ export function scanErrorAudio() {
export function newMessageAudio() {
var music = null;
music = uni.createInnerAudioContext(); //创建播放器对象
music.src ="../../static/video/error.wav";
music.volume=1;
music.src = "../../static/video/error.wav";
music.volume = 1;
music.play(); //执行播放
music.onEnded(() => {
//播放结束
@ -357,8 +383,8 @@ export function newMessageAudio() {
export function vibrate() {
uni.vibrateLong({
success:function(){
success: function() {
}
})
}

165
fe/PDA/pages/container/containerCall.vue

@ -1,7 +1,7 @@
<template>
<view class="" >
<view class="">
<view class="uni-list">
<view class="uni-list-cell " style="padding:10rpx; ">
<view class="uni-list-cell " style="padding:10rpx; ">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
@ -9,7 +9,8 @@
器具类型 :
</view>
<view class="uni-list-cell-db">
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList" range-key="name" >
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList"
range-key="name">
<view class="uni-input" style="font-size:35rpx">{{containerType}}</view>
</picker>
</view>
@ -24,21 +25,24 @@
器具规格 :
</view>
<view class="uni-list-cell-db">
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList" range-key="name">
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList"
range-key="name">
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view>
</picker>
</view>
</view>
</view>
<view class="uni-list">
<view class="uni-list-cell" style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;">
<view class="uni-list-cell"
style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
<view class="uni-list-cell-left" style="font-size:35rpx; align-items: center;display: flex; text-align: center;">
<view class="uni-list-cell-left"
style="font-size:35rpx; align-items: center;display: flex; text-align: center;">
呼叫库位 :
</view>
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation">
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation">
<text>{{locationCode}}</text>
<text v-if="locationName!=''">({{locationName}})</text>
</view>
@ -57,9 +61,13 @@
<script>
import {
locations,
getDictByCode,
containerRequest
} from '@/api/index.js';
import {
goHome,
getContainerTypeArray,
getISODateTime,
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
@ -70,53 +78,54 @@
},
data() {
return {
containerTypeList: [ {
name: '内物流',
value: "1",
test:"test1"
}, {
name: '外物流',
value: "2",
test:"test2"
}],
containerModelList: [ {
name: '小器具',
value: "1",
test:"test1"
}, {
name: '大器具',
value: "2",
test:"test2"
}],
typeIndex:0,
modelIndex:0,
location:"",
locationCode:"请扫描库位",
locationName:"",
containerType:"请选择器具类型",
containerModel:"请选择器具规格"
containerTypeList: [],
containerModelList: [],
typeIndex: 0,
modelIndex: 0,
location: "",
locationCode: "请扫描库位",
locationName: "",
containerType: "请选择器具类型",
containerTypeCode: "",
containerModel: "请选择器具规格",
containerModelCode: ""
}
},
onLoad() {},
onShow() {
this.getContainerModelList();
this.containerTypeList = getContainerTypeArray();
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
} else if (e.index === 1) {
window.location.reload();
}
},
methods: {
getContainerModelList() {
getDictByCode("ContainerSpecificationsType").then(res => {
res.items.forEach(item => {
item.value = item.code;
})
this.containerModelList = res.items;
}).catch(error => {
})
},
containerTypeChange(e) {
this.typeIndex = e.detail.value
var select =this.containerTypeList[this.typeIndex];
this.containerType =select.name
var select = this.containerTypeList[this.typeIndex];
this.containerType = select.name
this.containerTypeCode = select.value
console.log(select)
},
containerModelChange(e) {
this.modelIndex = e.detail.value
var select =this.containerModelList[this.typeIndex];
this.containerModel =select.name
var select = this.containerModelList[this.modelIndex];
this.containerModel = select.name
this.containerModelCode = select.value
console.log(select)
},
openScanLocation() {
@ -135,15 +144,16 @@
mask: true
});
locations(code).then(res => {
if (res == null) {
that.scanPopupLoseFocus();
that.showMessage('未查询到库位【' + code + '】');
} else {
uni.hideLoading();
if (res) {
that.locationCode = res.code;
that.locationName = res.name
that.closeScanLocation();
} else {
that.scanPopupLoseFocus();
that.showMessage('未查询到库位【' + code + '】');
}
uni.hideLoading();
}).catch(err => {
uni.hideLoading();
that.showMessage(err.message);
@ -161,23 +171,78 @@
scanPopupLoseFocus() {
this.$refs.scanLocation.losefocus();
},
submit(){
if(this.containerCode =="请选择器具类型"){
clearData() {
this.containerType = "请选择器具类型"
this.containerModel = "请选择器具规格";
this.locationCode = "请扫描库位"
this.locationName ="";
this.containerTypeCode = ""
this.containerModelCode = ""
this.modelIndex =0;
this.typeIndex =0;
},
setParams() {
var data = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
activeDate: getISODateTime(),
autoSubmit: true,
autoAgree: true,
autoHandle: true,
autoCompleteJob: true,
directCreateNote: true,
containerType: this.containerTypeCode,
specificationsType: this.containerModelCode,
requestLocationCode: this.locationCode,
details: [{
remark: "string",
itemCode: "string",
itemName: "string",
itemDesc1: "string",
itemDesc2: "string",
uom: "string",
qty: 0,
stdPackQty: 0,
toLocationCode: "string",
}]
}
return data;
},
submit() {
if (this.containerType == "请选择器具类型") {
this.showMessage("请选择器具类型")
return;
}
if(this.containerModel =="请选择器具规格"){
if (this.containerModel == "请选择器具规格") {
this.showMessage("请选择器具规格")
return;
}
if(this.locationCode =="请扫描库位"){
if (this.locationCode == "请扫描库位") {
this.showMessage("请扫描库位")
return;
}
console.log(this.containerTypeCode)
console.log(this.containerModelCode)
console.log(this.locationCode)
uni.showLoading({
title: '提交中...',
mask: true
});
var params = this.setParams();
containerRequest(params).then(res => {
uni.hideLoading();
this.showMessage("提交成功");
this.clearData();
}).catch(err => {
uni.hideLoading();
this.showMessage(err.message);
})
}
}
}

199
fe/PDA/pages/container/containerMove.vue

@ -1,68 +1,86 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-empty-view v-if="deliverList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id"
@click="openDetail(item)">
<com-deliver :dataContent="item"></com-deliver>
<view style="padding: 15rpx;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button"
activeColor="#007AFF"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index">
<view class="device-detail" style="font-size: 32rpx;">
<com-job-top-info :jobContent="item"></com-job-top-info>
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view>
<view>器具规格 : {{item.specificationsTypeName}}</view>
<view>库位 : {{item.requestLocationCode}} </view>
<view>操作人 : {{item.worker}} </view>
<view>创建时间 : {{item.creationTime| formatDate}} </view>
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;"
@click="complete(item)">完成</button>
</view>
</view>
</view>
<view v-show="current === 1">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index">
<view class="device-detail" style="font-size: 32rpx;">
<com-job-top-info :jobContent="item"></com-job-top-info>
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view>
<view>器具规格 : {{item.specificationsTypeName}}</view>
<view>库位 : {{item.requestLocationCode}} </view>
<view>操作人 : {{item.worker}} </view>
<view>创建时间 : {{item.creationTime| formatDate}} </view>
</view>
</view>
</view>
</view>
<uni-load-more :status="loadingType" v-if="deliverList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan> -->
<comMessage ref="comMessage"></comMessage>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getPlasticsList,
getDeliverJobByNumber
getContainerList,
getDictByCode,
finshContainerJob
} from '@/api/index.js';
import {
goHome
goHome,
dateFormat,
getContainerTypeName,
showConfirmMsg
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comDeliver from '@/mycomponents/coms/task/comDeliver.vue';
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
name: 'deliver',
components: {
winEmptyView,
winScanButton,
winMulitScan,
comDeliver,
comJobTopInfo,
comMessage
},
data() {
return {
deliverList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
items: ['未完成', '已完成'],
current: 0,
pageSize: this.modelConfig,
pageIndex: 1,
isTimeWindowSorting: false,
isToday: true,
titleArray: ['任务编号'],
loadingType: "nomore"
loadingType: "nomore",
dataList: [],
containerModelList: [],
isFinished:false
};
},
props: {
datacontent: {
type: Object,
value: null
}
filters: {
formatDate: function(val) {
return dateFormat(val)
},
getContainerTypeName: function(val) {
return getContainerTypeName(val)
},
},
onShow: function() {
onShow() {
this.getList('refresh');
},
onReachBottom() {
@ -87,24 +105,32 @@
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
} else if (e.index === 1) {
window.location.reload();
}
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
complete(item) {
showConfirmMsg("是否确认完成?", callback => {
if (callback) {
this.submit(item)
} else {
console.log('cancel')
}
})
},
//
timeSortingChange: function(e) {
this.isTimeWindowSorting = e.detail.value
this.getList()
onClickItem(item) {
this.current = item.currentIndex;
console.log("点击", this.current)
if(this.current==0){
this.isFinished =false;
}else {
this.isFinished =true;
}
this.getList("refresh");
},
//
isTodayChange: function(e) {
this.isToday = e.detail.value
this.getList()
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
//
@ -117,15 +143,16 @@
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.deliverList = [];
this.dataList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isFinished:that.isFinished
// isCreationTimeSorting: that.isTimeWindowSorting,
// isToday: that.isToday
};
getPlasticsList(params)
getContainerList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
@ -138,8 +165,8 @@
this.loadingType = "nomore";
return;
}
// that.deliverList = [...that.deliverList, ...list];
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list);
// that.dataList = [...that.dataList, ...list];
that.dataList = type === "refresh" ? list : this.dataList.concat(list);
that.pageIndex++;
})
.catch(err => {
@ -151,42 +178,32 @@
}
});
},
getScanResult(type, result) {
if (type == '任务编号') {
this.getByNumber(type, result.data.code);
}
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
getByNumber(type, code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getDeliverJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的盘点任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
openDetail(item) {
uni.navigateTo({
url: './containerMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
submit(item) {
uni.showLoading({
title: "提交中...",
mask:true
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
let params = this.dataList.find(r => r.id == item.id);
console.log("测试",JSON.stringify(params));
finshContainerJob(item.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
this.showCommitSuccessMessage();
this.getList("refresh")
}
})
.catch(err => {
this.showMessage(err.message);
uni.hideLoading();
});
},
}
};
</script>
<style scoped lang="scss">
</style>
</script>
Loading…
Cancel
Save