<template>
|
<view class="overflow">
|
<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="top" :model="warehouse" ref="warehouseRef">
|
<u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
|
<u-col span="10">
|
<u-form-item label="下架单号:" prop="Code" required
|
style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;">
|
<input v-model="warehouse.Code" placeholder="请录入或扫码" @focus="focu=true" @confirm="query"
|
class="width padding_left25rpx" style="font-weight: bolder;margin-left: 15rpx;">
|
</input>
|
<u-icon name="close-circle-fill" color="#848484" v-if="warehouse.Code && focu"
|
@click="warehouse.Code=''"></u-icon>
|
</u-form-item>
|
</u-col>
|
<u-col span="2">
|
<u-icon class="iconfont icon-saoma fontSize60rpx"></u-icon>
|
</u-col>
|
</u-row>
|
</u-form>
|
<modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
|
<view v-if="singlist.length>0" :style="'height:calc(100vh - '+(CustomBar+155)+'px'">
|
<view class="margin_top10rpx overflow_auto" style="height:calc(100% - 20rpx)">
|
<scroll-view scroll-y="true" style="height: 60vh;">
|
<u-swipe-action :show="item.show" :index="eindex" v-for="(item, eindex) in singlist" :key="eindex"
|
@click="longpress" @open="open" :options="options">
|
<view class="item u-border-bottom">
|
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
<view class="title-wrap">
|
<view :key="eindex+'singlist'" :class="item.edit?'clickactive':''"
|
class=" width margin_auto background_fff padding15 border_radius margin_bottom10rpx relative box_sizing transition">
|
<view class="flex justify-between">
|
<view
|
class="flex justify-center align-end height56rpx align-center padding5_10 fontSize32rpx">
|
<view class="margin_right10rpx flex align-center justify-center"
|
style="background-color: #f18202;color: #fff;border-radius: 50vh;width: 65rpx;height: 45rpx;">
|
{{eindex+1}}
|
</view>
|
<text
|
class="text-gray width23 color_f18202">{{item.wareMaterialCode}}</text>
|
<text class=" width70"></text>
|
</view>
|
<view class=" align-end height56rpx padding5_0 fontSize32rpx color_f18202">
|
<text class="">数量:</text>
|
<text class="text_overflow text-bold ">{{item.quantity}}</text>
|
</view>
|
</view>
|
<view class="flex justify-between align-center
|
flex-wrap fontSize32rpx">
|
<view class="width33 flex align-center">
|
<view class=" text_align_center padding_left25rpx">
|
<text class="text-gray">名称:</text>
|
<text class="text_overflow text-bold ">{{item.wareMaterialName}}</text>
|
</view>
|
</view>
|
<view class="">
|
<!-- 数量 -->
|
<view class=" align-end height56rpx padding5_0">
|
<text class=" padding_left30rpx">单位:</text>
|
<text class="text_overflow text-bold ">{{item.unit}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</u-swipe-action>
|
</scroll-view>
|
</view>
|
<view
|
class="width flex justify-between align-center padding15 fontSize32rpx font_weight_bold fixed background_fff"
|
style="bottom: 140rpx;border-bottom: 1px solid #C8C9CC;" @tap="modalshow=true">
|
<view class="background_fff">
|
<view class="width">
|
下架口:
|
</view>
|
</view>
|
<view class=" flex">
|
<text v-if="loca" class="padding_right10rpx">{{loca}}</text>
|
<u-icon v-else name="arrow-down"></u-icon>
|
</view>
|
</view>
|
<u-select v-model="modalshow" :list="wolist" @confirm="confirm"></u-select>
|
<u-popup v-model="detailshow" border-radius="14" @close="detailshow=false" mode="bottom">
|
<view class="pop ">
|
<h2 class="text_align_center padding_bottom18 padding15">物料信息</h2>
|
<view class="line flex justify-between">
|
<text class="text-gray">物料编号</text>
|
<text>{{materlist.wareMaterialCode}}</text>
|
</view>
|
|
<view class="line flex justify-between">
|
<text class="text-gray">物料名称</text>
|
<text>{{materlist.wareMaterialName}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">物料类型</text>
|
<text>{{materlist.wareMaterialTypeName}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">物料规格</text>
|
<text>{{materlist.specificationModel}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">长(mm)</text>
|
<text>{{materlist.long}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">宽(mm)</text>
|
<text>{{materlist.width}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">高(mm)</text>
|
<text>{{materlist.high}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">重量(kg)</text>
|
<text>{{materlist.weight}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">条码</text>
|
<text>{{materlist.barCode}}</text>
|
</view>
|
<view class="line flex justify-between">
|
<text class="text-gray">单位</text>
|
<text>{{materlist.unit}}</text>
|
</view>
|
</view>
|
</u-popup>
|
</view>
|
<button-modal :subShow='true' garmenTitle='确认下架' @submit='submit' />
|
|
</view>
|
</template>
|
|
<script>
|
import ButtonModal from '../../../components/buttonModal.vue'
|
import ModalCode from '../../../components/ModalCode.vue'
|
import {
|
query,
|
issue
|
} from '../../../api/unpack/plan.js'
|
export default {
|
data() {
|
return {
|
renameFocus: false,
|
modalshow: false,
|
rescode: 0,
|
resmessage: "",
|
detailshow: false,
|
operator: '',
|
loca: '', //下架口
|
focu: false,
|
wolist: [{
|
value: 1,
|
label: 801
|
},
|
{
|
value: 1,
|
label: 802
|
}
|
], //下架列表
|
singlist: [
|
// {
|
// "warematerialCode": "string",
|
// "collectNo": "string",
|
// "purchaseNo": "string",
|
// "category": "string",
|
// "wareMaterialTypeName": "string",
|
// "specificationModel": "string",
|
// "long": "string",
|
// "width": "string",
|
// "high": "string",
|
// "weight": "string",
|
// "barCode": "string",
|
// "company": "string",
|
// "uncollectedQuantity": 0,
|
// "id": 0
|
// }
|
], //物料详情
|
options: [
|
// {
|
// text: '删除',
|
// style: {
|
// backgroundColor: '#ff2323'
|
// }
|
// },
|
{
|
text: '详情',
|
style: {
|
backgroundColor: '#35db00'
|
}
|
}
|
],
|
materlist: [],
|
warehouse: {
|
Code: ''
|
},
|
warehouseRules: {
|
Code: [{
|
required: true,
|
message: '下架单号不能为空',
|
trigger: 'blur'
|
}]
|
},
|
};
|
},
|
components: {
|
ButtonModal,
|
ModalCode
|
},
|
onReady() {
|
this.$refs.warehouseRef.setRules(this.warehouseRules)
|
},
|
mounted() {
|
// this.WarehousChangePort()
|
this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
|
},
|
methods: {
|
//查询物料
|
query(e) {
|
this.$refs.warehouseRef.validate(valid => {
|
if (valid) {
|
setTimeout(() => {
|
this.focu = false
|
query(this.warehouse.Code).then((res) => {
|
if (res.code == 200) {
|
this.singlist = res.data.rows[0].details
|
// this.singlist.forEach(item => {
|
// item.quantity = ''
|
// item.wareMaterialCode = item.warematerialCode
|
// })
|
} else {
|
this.$refs.resmodal.show = true
|
this.rescode = res.code
|
this.resmessage = res.message
|
}
|
})
|
}, 200)
|
}
|
})
|
},
|
//详情
|
longpress(index, eindex) {
|
// if (eindex == 0) {
|
// this.singlist.splice(index, 1)
|
// } else {
|
this.materlist = this.singlist[index]
|
// console.log(this.materlist)
|
this.detailshow = true
|
// }
|
|
},
|
// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
|
open(index) {
|
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
// 原本为'false',再次设置为'false'会无效
|
this.singlist[index].show = true;
|
this.singlist.map((val, idx) => {
|
if (index != idx) this.singlist[idx].show = false;
|
})
|
},
|
//确实下架
|
confirm(e) {
|
this.loca = e[0].label
|
},
|
//确认
|
submit() {
|
this.$refs.warehouseRef.validate(valid => {
|
if (valid) {
|
let params = {
|
gate: this.loca,
|
orderNo: this.warehouse.Code
|
}
|
issue(params).then((res) => {
|
this.$refs.resmodal.show = true
|
this.rescode = res.code
|
this.resmessage = res.message
|
if (res.code == 200) {
|
this.singlist = []
|
this.warehouse.Code = ''
|
}
|
})
|
}
|
})
|
}
|
},
|
|
}
|
</script>
|
|
<style lang="scss">
|
|
</style>
|