<template>
|
<view class="overflow" style="padding-bottom:100px">
|
<!-- 顶部 -->
|
<cu-custom bgColor="bg-white" :isBack="true">
|
<block slot="backText"></block>
|
<block slot="content">点到点</block>
|
</cu-custom>
|
<!-- 操作人 -->
|
<!-- <view class="flex justify-end align-center padding_right30rpx padding_top12rpx">
|
<text class="fontSize12rpx"> 操作人:{{operator}} </text>
|
</view> -->
|
<!-- 遮挡层 -->
|
<modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
|
<view class="">
|
<u-form labelPosition="left" :model="warehouse" label-width="260rpx" ref="warehouseRef">
|
<u-row class="border_bottom margin_top10rpx background_fff padding_left25rpx">
|
<u-col span="12">
|
<u-form-item label="来源库位编号:" class="uFormItem">
|
<u-input v-model.trim="warehouse.placeCode" placeholder="请录入或扫码"
|
@focus="warehouse.placeCode = ''" class="width padding_left25rpx" :focus="true"
|
@confirm="materialBlur(1)">
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
<u-row class="border_bottom margin_top10rpx background_fff padding_left25rpx">
|
<u-col span="12">
|
<u-form-item label="容器编号:" class="uFormItem">
|
<u-input v-model.trim="warehouse.containerCode" placeholder="请录入或扫码"
|
@focus="warehouse.containerCode = ''" class="width padding_left25rpx"
|
@confirm="materialBlur(2)">
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
|
<u-row class="border_bottom margin_top10rpx background_fff padding_left25rpx">
|
<u-col span="12">
|
<u-form-item required label="目标库区/库位:" class="uFormItem">
|
<u-input v-model.trim="placeCodeTrg" placeholder="请录入或扫码"
|
@focus="placeCodeTrg = ''" class="width padding_left25rpx">
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
</u-form>
|
<view v-for="(item, eindex) in singlist" :key="eindex" class="margin_top10rpx">
|
<u-swipe-action :show="item.show" :index="eindex" @click="longpredel" @open="open" @close="close"
|
:options="options">
|
<view v-show="item.placeCode || item.containerCode"
|
class="fontSize32rpx background_fff padding10" :class="item.isYueku == '是' ? 'bg_item' : ''"
|
style="width: 100vw">
|
<u-row v-show="item.placeCode">
|
<u-col span="12">
|
<view class="Wb_box">
|
<text class="el_batchNo padding_left25rpx">
|
来源库位:
|
</text>
|
<text class="el_batchVal">
|
|
{{ item.placeCode }}
|
</text>
|
</view>
|
</u-col>
|
</u-row>
|
<u-row v-show="item.placeCode">
|
<u-col span="12">
|
<view class="Wb_box">
|
<text class="el_batchNo padding_left25rpx">
|
来源库位是否虚拟:
|
</text>
|
<text class="el_batchVal">
|
{{ item.isVirtually ? "是" : "否" }}
|
</text>
|
</view>
|
</u-col>
|
</u-row>
|
<u-row v-show="item.containerCode">
|
<u-col span="12">
|
<view class="Wb_box">
|
<text class="el_batchNo padding_left25rpx">
|
容器编号:
|
</text>
|
<text class="el_batchVal">
|
{{ item.containerCode }}
|
</text>
|
</view>
|
</u-col>
|
</u-row>
|
|
<u-row v-show="item.placeCode || item.placeCode">
|
<u-col span="12">
|
<view class="Wb_box">
|
<text class="el_batchNo padding_left25rpx">
|
目标库位/库区:
|
</text>
|
<text class="el_batchVal">
|
{{ placeCodeTrg }}
|
</text>
|
</view>
|
</u-col>
|
</u-row>
|
|
</view>
|
</u-swipe-action>
|
</view>
|
|
<button-modal :empTytowerShow='true' cleaningTitle="重置" garmenTitle='确认' @submit='submit' @reset='rest' />
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import ButtonModal from '@/components/buttonModal.vue'
|
import ModalCode from '@/components/ModalCode.vue'
|
import { getWmsContainerPage, handlePostToPost } from '@/api/hander/hander.js'
|
import {
|
getwmsPlace
|
} from '@/api/putIn/artificial.js'
|
export default {
|
data() {
|
return {
|
renameFocus: true,
|
detailshow: false,
|
rescode: 0,
|
autoFoucs: true,
|
resmessage: "",
|
current: 0, //滑块默认值
|
singlist: [
|
{
|
placeCode: "",
|
isVirtually: "",
|
containerCode: "",
|
isVirtuallyTrg: "",
|
}
|
], //物料详情
|
placeCodeTrg:"",
|
materlist: {}, //物料详情数据
|
warehouse: {
|
snCode: ''
|
},
|
warehouseRules: {
|
snCode: [{
|
required: true,
|
message: '物料跟踪码不能为空',
|
trigger: 'blur'
|
}]
|
},
|
options: []
|
};
|
},
|
components: {
|
ButtonModal,
|
ModalCode,
|
},
|
onLoad() {
|
},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
},
|
mounted() {
|
this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
|
},
|
methods: {
|
//物料查询
|
materialBlur(pram) {
|
if (this.warehouse.placeCode == "" && this.warehouse.containerCode == "") {
|
this.resmessage = "请扫来源库位编号或者容器编号!";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
return
|
}
|
|
// 1 来源库位编号
|
if (pram == 1 ) {
|
this.singlist[0].containerCode = ""
|
this.warehouse.containerCode =""
|
getwmsPlace({
|
PlaceCodeForpda: this.warehouse.placeCode,
|
page: 1,
|
pageSize: 1
|
}).then((res) => {
|
if (res.code == 200) {
|
var arrList = res.result.items;
|
if (pram == 1) { //1 来源库位编号
|
this.singlist[0].placeCode = "";
|
this.singlist[0].isVirtually = "";
|
}
|
if (arrList.length == 0) {
|
this.resmessage = "暂无数据";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
if (Array.isArray(arrList) && arrList.length >= 1) {
|
if (arrList[0].isDisabled) {
|
this.resmessage = "库位被禁用了";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
return
|
}
|
if (pram == 1) { //1 来源库位编号
|
this.singlist[0].placeCode = arrList[0].placeCode;
|
this.singlist[0].isVirtually = arrList[0].isVirtually;
|
}
|
} else {
|
this.resmessage = "暂无数据";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
} else {
|
this.resmessage = res.message
|
this.rescode = res.code
|
this.$refs.resmodal.show = true
|
}
|
})
|
|
}
|
|
// 容器编号
|
if (pram == 2) {
|
this.singlist[0].containerCode = ""
|
this.singlist[0].placeCode = "";
|
this.singlist[0].isVirtually = "";
|
this.warehouse.placeCode ="";
|
getWmsContainerPage({
|
page: 1,
|
pageSize: 1,
|
containerCode: this.warehouse.containerCode
|
}).then((res) => {
|
if (res.code == 200) {
|
var arrList = res.result.items;
|
if (arrList.length == 0) {
|
this.resmessage = "暂无数据";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
if (Array.isArray(arrList) && arrList.length >= 1) {
|
if (arrList[0].isDisabled) {
|
this.resmessage = "容器被禁用了";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
return
|
}
|
this.singlist[0].containerCode = arrList[0].containerCode;
|
} else {
|
this.resmessage = "暂无数据";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
}
|
});
|
}
|
|
},
|
|
//删除详情
|
longpredel(index, eindex) {
|
if (eindex == 0) {
|
uni.showModal({
|
title: "提示",
|
content: "是否确认删除?",
|
showCancel: true,
|
cancelColor: "#333333",
|
success: (res) => {
|
if (res.confirm) {
|
this.singlist.splice(index, 1)
|
} else if (res.cancel) {
|
}
|
},
|
});
|
} else {
|
this.materlist = this.singlist[index]
|
this.detailshow = true
|
}
|
},
|
//卡片选中
|
click(e) {
|
e.cardNum = true
|
this.$forceUpdate()
|
},
|
// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
|
open(index) {
|
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
// 原本为'false',再次设置为'false'会无效
|
this.singlist[index].cardNum = true;
|
this.singlist[index].show = true;
|
this.singlist.map((val, idx) => {
|
if (index != idx) this.singlist[idx].show = false;
|
})
|
this.$forceUpdate()
|
},
|
close(index) {
|
this.singlist[index].show = false;
|
this.singlist[index].cardNum = false;
|
this.$forceUpdate()
|
},
|
|
//确认
|
submit() {
|
|
if(!this.placeCodeTrg){
|
uni.showToast({
|
title: "请扫码库区/库位",
|
icon: "none",
|
duration: 2000,
|
});
|
}
|
if(!this.warehouse.placeCode && !this.warehouse.containerCode){
|
uni.showToast({
|
title: "请扫码来源库位编号/容器编号",
|
icon: "none",
|
duration: 2000,
|
});
|
}
|
uni.showModal({
|
title: '提示',
|
content: '是否确认点到点?',
|
showCancel: true,
|
cancelColor: '#333333',
|
success: (res => {
|
if (res.confirm) {
|
var param = {
|
"SourcePlaceCode":this.warehouse.placeCode,
|
"ContainerCode":this.warehouse.containerCode,
|
"ToPlaceCode":this.placeCodeTrg,
|
};
|
handlePostToPost(param).then((res) => {
|
this.rescode = res.code
|
this.resmessage = res.message
|
this.$refs.resmodal.show = true
|
if (res.code == 200) {
|
this.resmessage = "点到点成功"
|
this.renameFocus = true
|
this.rest()
|
}
|
})
|
|
} else if (res.cancel) {
|
|
}
|
})
|
});
|
|
},
|
//清楚选中
|
rest() {
|
this.warehouse.placeCode = '';
|
this.warehouse.containerCode = '';
|
this.placeCodeTrg = '';
|
this.autoFoucs = true
|
this.singlist = [
|
{
|
placeCode: "",
|
isVirtually: "",
|
containerCode: "",
|
isVirtuallyTrg: "",
|
}
|
];
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.title-wrap {
|
background-color: white;
|
margin-top: 10px;
|
}
|
</style>
|