<template>
|
<view style="padding-bottom: 150px" class="boxTip">
|
<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> -->
|
<u-form
|
labelPosition="left"
|
label-width="180rpx"
|
:model="warehouse"
|
ref="warehouseRef"
|
>
|
<!-- <u-row
|
class="border_bottom margin_top10rpx padding_left25rpx"
|
style="background-color: #fff"
|
>
|
<u-col span="10">
|
<u-form-item
|
label="来源库区:"
|
prop="areaCode"
|
required
|
class="uFormItem"
|
>
|
<u-input
|
v-model="warehouse.areaCode"
|
placeholder="请扫码录入"
|
style="font-weight: bolder; margin-left: 15rpx"
|
class="width padding_left25rpx"
|
>
|
</u-input>
|
</u-form-item>
|
</u-col>
|
<u-col span="2" @tap="containerFocus2">
|
<span class="fontSize15rpx">选择</span>
|
<u-icon name="arrow-right" size="14" class="fontSize15rpx"></u-icon>
|
</u-col>
|
</u-row> -->
|
<u-row
|
class="border_bottom margin_top10rpx padding_left25rpx"
|
style="background-color: #fff"
|
>
|
<u-col span="12">
|
<u-form-item
|
label="目标库位:"
|
prop="placeCode"
|
required
|
class="uFormItem"
|
>
|
<u-input
|
v-model="warehouse.placeCode"
|
placeholder="请扫码录入"
|
style="font-weight: bolder; margin-left: 15rpx"
|
class="width padding_left25rpx"
|
@confirm="getKwDetails"
|
>
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
<view
|
class="boxList"
|
v-show="modalshow2"
|
@click="modalshow2 = false"
|
@touchmove.stop
|
>
|
<view class="innerWrap">
|
<ul v-for="(item, eindex) in containerList" :key="eindex">
|
<li @click="confirm2(eindex)">{{ item.text }}</li>
|
</ul>
|
</view>
|
</view>
|
<u-row
|
class="border_bottom margin_top10rpx padding_left25rpx"
|
style="background-color: #fff"
|
>
|
<u-col span="12">
|
<u-form-item label="物料编号:" class="uFormItem">
|
<u-input
|
v-model="warehouse.snCode"
|
ref="materialRef"
|
placeholder="请扫码录入"
|
@focus="warehouse.snCode = ''"
|
@confirm="getMaterialDetails"
|
style="font-weight: bolder; margin-left: 15rpx"
|
class="width padding_left25rpx"
|
>
|
</u-input>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
|
<!-- 容器类型 -->
|
<u-row
|
class="border_bottom margin_top10rpx padding_left25rpx"
|
style="background-color: #fff"
|
>
|
<u-col span="12">
|
<u-form-item label="容器类型:" prop="typeCode" required class="uFormItem">
|
<input
|
v-model="warehouse.typeCode"
|
type="select"
|
style="font-weight: bolder; margin-left: 15rpx"
|
@focus="containerFocusRqlx"
|
placeholder="请选择容器类型"
|
class="width"
|
/>
|
<u-action-sheet
|
:list="wolistRqlx"
|
v-model="modalshowRqlx"
|
@click="confirmRqlx"
|
></u-action-sheet>
|
</u-form-item>
|
</u-col>
|
</u-row>
|
</u-form>
|
|
<modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" />
|
<view style="margin-bottom: 200rpx" class="margin_top10rpx">
|
<view
|
v-for="(item, eindex) in singlist"
|
:key="eindex"
|
class="margin_bottom10rpx"
|
>
|
<u-swipe-action
|
:show="item.show"
|
:index="eindex"
|
@click="longpress"
|
@open="open"
|
@close="close"
|
:options="options"
|
style="width: 100vw"
|
>
|
<view
|
class="fontSize32rpx background_fff padding10"
|
:class="item.enAbled == 0 ? 'bg_item' : ''"
|
>
|
<u-row>
|
<u-col span="12" class="flex">
|
<text class="flex justify-center align-center circkle06">{{
|
eindex + 1
|
}}</text>
|
<text class="color_f18202 padding_left10rpx">
|
{{ item.containerCode }}
|
</text>
|
</u-col>
|
</u-row>
|
<u-row>
|
<u-col span="8">
|
<text class="color_80 padding_left25rpx">
|
是否虚拟:{{ item.isVirtually ? "是" : "否" }}
|
</text>
|
</u-col>
|
<u-col span="4">
|
<text class="color_80">
|
是否禁用:{{ item.isDisabled ? "是" : "否" }}
|
</text>
|
</u-col>
|
</u-row>
|
<u-row>
|
<u-col span="12">
|
<text class="color_80 padding_left25rpx">
|
类型名称:{{ item.containerTypeName }}
|
</text>
|
</u-col>
|
</u-row>
|
</view>
|
</u-swipe-action>
|
</view>
|
</view>
|
<button-modal
|
:cleaningShow="true"
|
allTitle="重置"
|
cleaningTitle="确认"
|
@allsubmit="reset"
|
@submit="submit"
|
/>
|
</view>
|
</template>
|
<script>
|
import ButtonModal from "../../components/buttonModal.vue";
|
import ModalCode from "../../components/ModalCode.vue";
|
import {
|
addGroupContainerXiajia,
|
getareaTypesList,
|
getwmsPlaceForContainerOff,
|
getRecommendList,
|
putContainerConfirm,
|
getContainerTypeList,
|
getwmsContainerType,
|
} from "../../api/putIn/artificial.js";
|
import { getDate } from "../../utils/dateTime.js";
|
|
export default {
|
data() {
|
return {
|
containerList: [],
|
curFoucus: true,
|
rescode: 0,
|
resmessage: "",
|
putCode: "", //容器二维码
|
detailshow: false,
|
operator: "",
|
focu: false, //清空按钮隐显
|
focuM: false, //物料隐显按钮
|
Datetime: getDate(),
|
singlist: [], //物料详情
|
wolist: [],
|
wolistRqlx: [],
|
|
options: [
|
// {
|
// text: '详情',
|
// style: {
|
// backgroundColor: '#fc9f35'
|
// }
|
// }
|
{
|
text: "删除",
|
style: {
|
backgroundColor: "#fc4b4b",
|
},
|
},
|
],
|
materlist: {},
|
warehouse: {
|
containerCode: "",
|
materialCode: "",
|
storehouseCode: "",
|
snCode: "",
|
},
|
modalshow: false,
|
modalshow2: false,
|
modalshowRqlx: false,
|
|
gridable: true,
|
gridFocus: false,
|
detailable: false,
|
detailableZb: false,
|
warehouseRules: {
|
|
// areaCode: [
|
// {
|
// required: true,
|
// message: "来源库区不能为空",
|
// trigger: "blur",
|
// },
|
// ],
|
placeCode: [
|
{
|
required: true,
|
message: "目标库位不能为空",
|
trigger: "blur",
|
},
|
],
|
typeCode: [
|
{
|
required: true,
|
message: "容器类型不能为空",
|
trigger: "blur",
|
},
|
],
|
},
|
orderType: 1,
|
warhouseTph: "",
|
timerPrint: null,
|
kwbhAllowed: false, //是否禁用库位编号
|
arrD: [],
|
};
|
},
|
components: {
|
ButtonModal,
|
ModalCode,
|
},
|
onLoad(option) {
|
if (option.orderType) {
|
this.orderType = option.orderType;
|
}
|
},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules);
|
},
|
mounted() {
|
this.operator = JSON.parse(uni.getStorageSync("userInfo")).name;
|
// this.getVehicleType()
|
this.getContainerType(); //容器类型
|
},
|
methods: {
|
//容器类型聚焦事件
|
containerFocus() {
|
uni.hideKeyboard();
|
this.modalshow = true;
|
},
|
|
//容器类型聚焦事件
|
containerFocusRqlx() {
|
uni.hideKeyboard();
|
this.modalshowRqlx = true;
|
},
|
|
//容器编号点击
|
containerClick() {
|
uni.scanCode({
|
scanType: ["barCode", "qrCode"],
|
autoDecodeCharset: true,
|
success: (res) => {
|
this.warehouse.containerCode = res.result;
|
this.containerBlur();
|
},
|
fail: (err) => {
|
this.rescode = 400;
|
this.resmessage = `扫描失败${err}`;
|
this.$refs.resmodal.show = true;
|
},
|
});
|
},
|
getKwDetails(pram) {
|
if (!this.warehouse.placeCode) {
|
uni.showToast({
|
title: "目标库位不能为空",
|
icon: "none",
|
duration: 2000,
|
});
|
return;
|
}
|
getwmsPlaceForContainerOff({
|
// 'PlaceCodeForpda': this.warehouse.placeCode,
|
placeCode: this.warehouse.placeCode,
|
page: 1,
|
pageSize: 1,
|
}).then((res) => {
|
if (res.code == 200) {
|
if (!res.result) {
|
return;
|
}
|
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;
|
}
|
} 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;
|
}
|
});
|
},
|
getMaterialDetails() {
|
if (!this.warehouse.snCode) {
|
uni.showToast({
|
title: "物料编号不能为空",
|
icon: "none",
|
duration: 2000,
|
});
|
return;
|
}
|
getwmsContainerType({
|
// 'materialAndSncode': this.warehouse.snCode,
|
MaterialCode: this.warehouse.snCode,
|
page: 1,
|
pageSize: 1,
|
}).then((res) => {
|
if (res.code == 200) {
|
var arrList = [res.result];
|
//debugger
|
if (arrList.length == 0) {
|
this.resmessage = "暂无绑定的容器类型";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
if (Array.isArray(arrList) && arrList.length == 1) {
|
// this.warehouse.typeCode = arrList[0].typeCode || "";
|
this.warehouse.typeCode = arrList[0].containerTypeCode || "";
|
this.$forceUpdate();
|
} else {
|
this.resmessage = "暂无绑定的容器类型";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
} else {
|
this.resmessage = "暂无绑定的容器类型";
|
this.rescode = 400;
|
this.showBtn = 0;
|
this.$refs.resmodal.show = true;
|
}
|
});
|
},
|
//删除详情
|
longpress(index, eindex) {
|
uni.showModal({
|
title: "提示",
|
content: "是否确认删除?",
|
showCancel: true,
|
cancelColor: "#333333",
|
success: (res) => {
|
if (res.confirm) {
|
this.singlist[index].cardNum = true;
|
if (eindex == 0) {
|
//删除
|
this.singlist.splice(index, 1);
|
} else {
|
this.materlist = this.singlist[index];
|
this.detailshow = true;
|
}
|
} else if (res.cancel) {
|
}
|
},
|
});
|
},
|
//编辑状态样式
|
dc(e) {
|
e.cardNum = true;
|
this.$forceUpdate();
|
},
|
//卡片选中
|
clicki(e) {
|
e.cardNum = true;
|
this.$forceUpdate();
|
},
|
// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
|
open(index) {
|
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
// 原本为'false',再次设置为'false'会无效
|
this.singlist[index].cardNum = true;
|
this.$forceUpdate();
|
this.singlist[index].show = true;
|
this.singlist.map((val, idx) => {
|
if (index != idx) this.singlist[idx].show = false;
|
});
|
},
|
close(index) {
|
this.singlist[index].show = false;
|
this.singlist[index].cardNum = false;
|
this.$forceUpdate();
|
},
|
//改变组盘数量
|
changeNum(val) {
|
val.cardNum = false;
|
if (!val.quantity) {
|
uni.showModal({
|
title: "提示",
|
content: "组盘数量不能为空",
|
showCancel: false,
|
});
|
}
|
if (val.quantity < 0) {
|
uni.showModal({
|
title: "提示",
|
content: "组盘数量必须大于0",
|
showCancel: false,
|
});
|
}
|
},
|
//全部取消
|
reset() {
|
this.singlist = [];
|
this.warehouse.containerCode = "";
|
this.warehouse.snCode = "";
|
this.warehouse.areaCode = "";
|
this.warehouse.placeCode = "";
|
this.$refs.warehouseRef.resetFields();
|
this.$forceUpdate();
|
this.kwbhAllowed = false;
|
},
|
//重置页面信息
|
rest() {
|
this.reset();
|
},
|
//确认
|
submit() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules);
|
this.$refs.warehouseRef.validate((valid) => {
|
if (valid) {
|
let arrN1 = this.singlist.findIndex(
|
(v) => v.quantity == "" || v.quantity <= 0
|
);
|
if (arrN1 > -1) {
|
uni.showToast({
|
title: "物料数量需要大于0",
|
icon: "none",
|
duration: 2000,
|
});
|
return;
|
}
|
//物料详情
|
let matatilDetails = this.singlist;
|
// let arrSub = matatilDetails.filter((v) => v.enAbled != 1);
|
//请求参数
|
let params = {
|
areaCode: this.warehouse.areaCode, //来源库区
|
PlaceCode: this.warehouse.placeCode,
|
MaterialCode: this.warehouse.snCode,
|
ContainerTypeCode: this.warehouse.typeCode,
|
// orderDetails: arrSub
|
};
|
uni.showModal({
|
title: "提示",
|
content: "是否确认容器下架?",
|
showCancel: true,
|
cancelColor: "#333333",
|
success: (res) => {
|
if (res.confirm) {
|
addGroupContainerXiajia(params).then((res) => {
|
this.warhouseTph = this.warehouse.containerCode;
|
this.rescode = res.code;
|
this.resmessage = res.message || "下架成功!";
|
this.$refs.resmodal.show = true;
|
this.rest();
|
});
|
} else if (res.cancel) {
|
}
|
},
|
});
|
}
|
});
|
},
|
getVehicleType() {
|
getareaTypesList().then((res) => {
|
var arr = res.result.items;
|
arr.map((item) => {
|
item.text = item.areaCode;
|
return item;
|
});
|
this.wolist = arr;
|
});
|
},
|
//容器类型
|
getContainerType() {
|
getContainerTypeList().then((res) => {
|
var arr = res.result.items;
|
arr.map((item) => {
|
item.text = item.typeCode;
|
return item;
|
});
|
this.wolistRqlx = arr;
|
});
|
},
|
confirmXl(index) {
|
this.warehouse.areaCode = this.wolist[index].areaCode;
|
},
|
|
containerFocus2() {
|
this.modalshow2 = true;
|
getareaTypesList().then((res) => {
|
var arr = res.result.items;
|
this.containerList = arr.reduce((curr, item) => {
|
curr.push({
|
text: item.areaCode,
|
});
|
return curr;
|
}, []);
|
});
|
},
|
|
confirmRqlx(index) {
|
this.warehouse.typeCode = this.wolistRqlx[index].text;
|
},
|
|
confirm2(index) {
|
this.warehouse.areaCode = this.containerList[index].text;
|
},
|
},
|
};
|
</script>
|
<style lang="scss" scoped>
|
.bg_item {
|
background: #ffebcd !important;
|
}
|
|
.inputGray2 {
|
line-height: 30px;
|
border-top: 10rpx solid transparent;
|
}
|
|
.inputGray {
|
border-top: 0rpx solid transparent;
|
}
|
|
.boxList {
|
transition: all ease 2s;
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
top: 0;
|
right: 0;
|
width: 100%;
|
height: 100%;
|
z-index: 999;
|
background: rgba(0, 0, 0, 0.6);
|
|
.innerWrap {
|
max-height: 50%;
|
overflow-y: auto;
|
background: white;
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
|
ul {
|
padding: 0;
|
margin: 0;
|
|
li {
|
padding: 0;
|
margin: 0;
|
border-bottom: 1px solid #e4e7ed;
|
list-style-type: none;
|
display: flex;
|
flex-direction: row;
|
line-height: 1;
|
justify-content: center;
|
align-items: center;
|
font-size: 13px;
|
padding: 14px 0;
|
flex-direction: column;
|
}
|
}
|
}
|
}
|
</style>
|