Browse Source

空器具库移和空器具呼叫

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

20
fe/PDA/api/index.js

@ -1401,3 +1401,23 @@ export const getPlasticsList = (params) => request(
data: params 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"
})

36
fe/PDA/common/basic.js

@ -204,6 +204,32 @@ export function getJobType(val) {
else return 'Other' 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) { export function showConfirmMsg(content, callback) {
uni.showModal({ uni.showModal({
@ -332,8 +358,8 @@ export function setRootFontSize(fontSize) {
export function scanErrorAudio() { export function scanErrorAudio() {
var music = null; var music = null;
music = uni.createInnerAudioContext(); //创建播放器对象 music = uni.createInnerAudioContext(); //创建播放器对象
music.src ="../../static/video/error.wav"; music.src = "../../static/video/error.wav";
music.volume=1; music.volume = 1;
music.play(); //执行播放 music.play(); //执行播放
music.onEnded(() => { music.onEnded(() => {
//播放结束 //播放结束
@ -345,8 +371,8 @@ export function scanErrorAudio() {
export function newMessageAudio() { export function newMessageAudio() {
var music = null; var music = null;
music = uni.createInnerAudioContext(); //创建播放器对象 music = uni.createInnerAudioContext(); //创建播放器对象
music.src ="../../static/video/error.wav"; music.src = "../../static/video/error.wav";
music.volume=1; music.volume = 1;
music.play(); //执行播放 music.play(); //执行播放
music.onEnded(() => { music.onEnded(() => {
//播放结束 //播放结束
@ -357,7 +383,7 @@ export function newMessageAudio() {
export function vibrate() { export function vibrate() {
uni.vibrateLong({ uni.vibrateLong({
success:function(){ success: function() {
} }
}) })

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

@ -1,5 +1,5 @@
<template> <template>
<view class="" > <view class="">
<view class="uni-list"> <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 class="" style="color: red; font-size: 40rpx; ">
@ -9,7 +9,8 @@
器具类型 : 器具类型 :
</view> </view>
<view class="uni-list-cell-db"> <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> <view class="uni-input" style="font-size:35rpx">{{containerType}}</view>
</picker> </picker>
</view> </view>
@ -24,18 +25,21 @@
器具规格 : 器具规格 :
</view> </view>
<view class="uni-list-cell-db"> <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> <view class="uni-input" style="font-size:35rpx">{{containerModel}}</view>
</picker> </picker>
</view> </view>
</view> </view>
</view> </view>
<view class="uni-list"> <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 class="" style="color: red; font-size: 40rpx; ">
* *
</view> </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>
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation"> <view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation">
@ -57,9 +61,13 @@
<script> <script>
import { import {
locations, locations,
getDictByCode,
containerRequest
} from '@/api/index.js'; } from '@/api/index.js';
import { import {
goHome, goHome,
getContainerTypeArray,
getISODateTime,
} from '@/common/basic.js'; } from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
@ -70,53 +78,54 @@
}, },
data() { data() {
return { return {
containerTypeList: [ { containerTypeList: [],
name: '内物流', containerModelList: [],
value: "1", typeIndex: 0,
test:"test1" modelIndex: 0,
}, { location: "",
name: '外物流', locationCode: "请扫描库位",
value: "2", locationName: "",
test:"test2" containerType: "请选择器具类型",
}], containerTypeCode: "",
containerModelList: [ { containerModel: "请选择器具规格",
name: '小器具', containerModelCode: ""
value: "1",
test:"test1"
}, {
name: '大器具',
value: "2",
test:"test2"
}],
typeIndex:0,
modelIndex:0,
location:"",
locationCode:"请扫描库位",
locationName:"",
containerType:"请选择器具类型",
containerModel:"请选择器具规格"
} }
}, },
onLoad() {}, onShow() {
this.getContainerModelList();
this.containerTypeList = getContainerTypeArray();
},
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
}else if(e.index === 1){ } else if (e.index === 1) {
window.location.reload(); window.location.reload();
} }
}, },
methods: { methods: {
getContainerModelList() {
getDictByCode("ContainerSpecificationsType").then(res => {
res.items.forEach(item => {
item.value = item.code;
})
this.containerModelList = res.items;
}).catch(error => {
})
},
containerTypeChange(e) { containerTypeChange(e) {
this.typeIndex = e.detail.value this.typeIndex = e.detail.value
var select =this.containerTypeList[this.typeIndex]; var select = this.containerTypeList[this.typeIndex];
this.containerType =select.name this.containerType = select.name
this.containerTypeCode = select.value
console.log(select) console.log(select)
}, },
containerModelChange(e) { containerModelChange(e) {
this.modelIndex = e.detail.value this.modelIndex = e.detail.value
var select =this.containerModelList[this.typeIndex]; var select = this.containerModelList[this.modelIndex];
this.containerModel =select.name this.containerModel = select.name
this.containerModelCode = select.value
console.log(select) console.log(select)
}, },
openScanLocation() { openScanLocation() {
@ -135,15 +144,16 @@
mask: true mask: true
}); });
locations(code).then(res => { locations(code).then(res => {
if (res == null) { uni.hideLoading();
that.scanPopupLoseFocus(); if (res) {
that.showMessage('未查询到库位【' + code + '】');
} else {
that.locationCode = res.code; that.locationCode = res.code;
that.locationName = res.name that.locationName = res.name
that.closeScanLocation(); that.closeScanLocation();
} else {
that.scanPopupLoseFocus();
that.showMessage('未查询到库位【' + code + '】');
} }
uni.hideLoading();
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
that.showMessage(err.message); that.showMessage(err.message);
@ -161,22 +171,77 @@
scanPopupLoseFocus() { scanPopupLoseFocus() {
this.$refs.scanLocation.losefocus(); this.$refs.scanLocation.losefocus();
}, },
submit(){ clearData() {
if(this.containerCode =="请选择器具类型"){ 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("请选择器具类型") this.showMessage("请选择器具类型")
return; return;
} }
if(this.containerModel =="请选择器具规格"){ if (this.containerModel == "请选择器具规格") {
this.showMessage("请选择器具规格") this.showMessage("请选择器具规格")
return; return;
} }
if(this.locationCode =="请扫描库位"){ if (this.locationCode == "请扫描库位") {
this.showMessage("请扫描库位") this.showMessage("请扫描库位")
return; 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);
})
} }
} }

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

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

Loading…
Cancel
Save