You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

322 lines
11 KiB

2 months ago
<template>
<view class="">
<!-- 自定义导航栏 -->
<u-navbar bgColor="#ffffff" :placeholder="true" :autoBack="true" titleStyle="font-weight:600">
<view slot="center" style="display: flex;align-items: center;flex-direction: column;">
<view>
<span style="font-size: 30rpx; font-weight: 600;color: #333333;margin-right: 10rpx;">{{ changku }}</span>
<!-- <image style="width: 32rpx; height: 32rpx;" src="../../../../static/images/wuzhi/zhuanhuan.png"></image> -->
</view>
<span style="font-size: 20rpx; font-weight: 600;color: #b1b1b1;margin-right: 10rpx;">入库明细</span>
</view>
<view slot="right" style="display: flex;align-items: center;flex-direction: column;" @click="popCheBian()">
<image style="width: 48rpx; height: 48rpx;" src="../../../../static/images/wuzhi/qiehuancangku.png"></image>
<span style="font-size: 18rpx; font-weight: 600;margin-right: 10rpx;color: #1296db;">切换仓库</span>
</view>
</u-navbar>
<view class="paibanBox">
<view class="paiban"><u-search placeholder="请输入物资名称" v-model="keyword2" :clearabled="false" :showAction="false"></u-search></view>
<scroll-view scroll-y="true" style="height: 89vh;padding: 20rpx;" @scrolltolower="scrolltolower" refresher-background="#f6f7fb" scroll-with-animation="true">
<view v-for="item in ruKuMxList" :key="item.id" style="margin-bottom: 10rpx;border-bottom: 1rpx solid #dfdfdf;">
<view style="display: flex;width: 100%;padding-bottom: 15rpx; align-items: center;justify-content: space-between;padding: 12rpx;">
<u-album
singleSize="72"
multipleMode="scaleToFill"
singleMode="scaleToFill"
multipleSize="72"
rowCount="1"
style="width: 145rpx;height: 145rpx;border: 1px solid #EFEFEF;background-color:#EFEFEF ;"
:urls="item.showUrls == null ? [] : item.showUrls"
maxCount="1"
></u-album>
<view style="display: flex;width: 80%;" @click="openDetail(item)">
<view style=" width: 75%;display: flex;flex-direction: column;justify-content: space-between; align-items: flex-start;margin-left: 10rpx;">
<span style="font-weight: 600;font-size: 24rpx;">
{{ item.materialName }} ({{ item.materialUnit }})
<span v-if="item.text3" style="font-weight: 600;font-size: 21rpx;color: #ff4c11;margin-left: 10rpx;">{{ item.text3 }}</span>
</span>
<span style="font-weight: 600;font-size: 21rpx;color: #999999;">{{ item.text1 == null ? '暂无规格' : item.text1 }}</span>
<span style="align-self: flex-start;font-size: 21rpx;color: #4c4c4c;margin-right: 20rpx;">{{ item.materialCategory }}</span>
<span style="font-size: 24rpx;color: #080808;font-weight: 600;">{{ item.inOutDbId }}</span>
</view>
<view style="display: flex;align-items: flex-end;justify-content: space-between;flex-direction: row;">
<span style="color: #f5bc44;font-size: 40rpx;font-weight: 900;">+{{ item.realNum }}</span>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 侧边栏 -->
<u-popup :show="wuzhiCheBian" mode="left" :customStyle="{ width: '70vw' }" :safeAreaInsetBottom="true" @close="offPop()">
<view style="height: 50px;margin-bottom: 10rpx;"></view>
<u-search placeholder="请输入仓库名称搜索" v-model="keyword" :clearabled="false" :showAction="false"></u-search>
<scroll-view scroll-y="true" style="height: 95vh;" scroll-with-animation="true">
<view class="status_bar"></view>
<uni-list>
<uni-list-item v-for="(item, index) in titlelist" :title="`${index + 1}.${item.name}`" :clickable="true" @click="xuanZheChangKu(item)"></uni-list-item>
</uni-list>
<view style="height: 50px;"></view>
</scroll-view>
</u-popup>
<u-popup :round="10" mode="bottom" :show="Detailshow" @close="closeDetail">
<!-- @click="toPage" -->
<view>
<view class="ruKuInfo">
<view style="color: #3c6fd2;font-size: 36rpx;font-weight: 600;">入库单</view>
<view style="color: #646a6f;font-size: 29rpx;font-weight: 600;">入库单号{{ ruKuMxDetail.waterNum }}</view>
<view class="process">
<span style="text-align: center; margin-right: 25rpx;background-color: #EFEFEF;width: 170rpx;border-radius: 10px;">
{{ setDict(ruKuMxDetail.inOutType) }}
</span>
<u-icon style="margin-right: 25rpx;" color="#5cc0ae" name="play-right-fill"></u-icon>
<span style="text-align: center;background-color: #EFEFEF;width: 170rpx;border-radius: 10px;">入库完成</span>
</view>
</view>
<view style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
<view class="textInfo">
入库仓库
<span style="color: #85898c;">{{ ruKuMxDetail.houseName }}</span>
</view>
<view class="textInfo">
登记人员
<span style="color: #85898c;">{{ ruKuMxDetail.djUserName }}</span>
</view>
<view class="textInfo">
创建时间
<span style="color: #85898c;">{{ ruKuMxDetail.year }}-{{ ruKuMxDetail.month }}-{{ ruKuMxDetail.day }}</span>
</view>
</view>
<scroll-view scroll-y="true" style="height: 800rpx;" scroll-with-animation="true">
<view
style="display: flex;width: 100%; padding-bottom: 15rpx; border-bottom: 1rpx solid #dfdfdf;
align-items: center;justify-content: center;padding: 12rpx; background-color: #fff;"
v-for="(item, index) in ruKuMxDetail.inOrOutDelList"
:key="index"
>
<u-album
singleSize="62"
multipleMode="scaleToFill"
singleMode="scaleToFill"
multipleSize="62"
rowCount="1"
style="width: 125rpx;height: 125rpx;border: 1px solid #EFEFEF;background-color:#EFEFEF ;"
:urls="item.showUrls == null ? [] : item.showUrls"
maxCount="1"
></u-album>
<view style="display: flex;width: 80%;">
<view style=" width: 75%;display: flex;flex-direction: column;justify-content: space-between; align-items: flex-start;margin-left: 10rpx;">
<span style="font-weight: 600;font-size: 24rpx;">
{{ item.materialName }}
<span v-if="item.text3" style="font-weight: 600;font-size: 21rpx;color: #ff4c11;margin-left: 10rpx;">{{ item.text3 }}</span>
</span>
<span style="font-weight: 600;font-size: 21rpx;color: #999999;">{{ item.text1 == null ? '暂无规格' : item.text1 }}</span>
<span style="align-self: flex-start;font-size: 21rpx;color: #4c4c4c;margin-right: 20rpx;">{{ item.materialCategory }}</span>
</view>
<view style="display: flex;align-items: flex-end;justify-content: space-between;flex-direction: row;">
<span style="color: #0f0b04;font-size: 28rpx;font-weight: 900;">+ {{ item.realNum }}{{ item.materialUnit }}</span>
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
</template>
<script>
import { listWarehouse } from '@/api/indexpage/yjWz/warehouse.js';
import { getDicts } from '@/api/indexpage/user.js';
import { getInListAndInListDel } from '@/api/indexpage/yjWz/inList.js';
// 查询入库单列表
import { listInList, getInList } from '@/api/indexpage/yjWz/wzRuKu.js';
import { listInOutDetails, getInOutDetails } from '@/api/indexpage/yjWz/crk.js';
export default {
data() {
return {
keyword: '',
keyword2: '',
timer: '',
timer1: '',
changku: '',
wuzhiCheBian: false, //物资侧边栏
ckid: '',
ruKuMxList: [],
Detailshow: false,
ruKuMxDetail: {},
planTypeList: [],
titlelist: []
};
},
onLoad(options) {
//获取场库id和名字
let name = options.ckName;
let id = options.ckId;
this.ckid = id;
this.changku = name;
this.getlistInOutDetails();
this.getDict();
this.getChangKu();
},
watch: {
keyword(newdata, olddata) {
let that = this;
//防抖函数
clearTimeout(that.timer);
that.timer = setTimeout(function() {
if (newdata === '') {
//发场库请求
listWarehouse().then(res => {
that.titlelist = res.rows;
});
} else {
//发场库请求
listWarehouse({ name: newdata }).then(res => {
that.titlelist = res.rows;
});
}
}, 600);
},
keyword2(newdata, olddata) {
let that = this;
//防抖函数
clearTimeout(that.timer1);
that.timer1 = setTimeout(function() {
if (newdata === '') {
listInOutDetails({
houseId: that.ckid,
type: 1
}).then(res => {
that.ruKuMxList = res.rows;
});
} else {
//发场库请求
listInOutDetails({
houseId: that.ckid,
type: 1,
materialName: newdata
}).then(res => {
that.ruKuMxList = res.rows;
});
}
}, 600);
}
},
methods: {
//弹出侧边栏
popCheBian() {
//弹出侧边栏
this.wuzhiCheBian = true;
},
getChangKu() {
//发场库请求
listWarehouse().then(res => {
this.titlelist = res.rows;
});
},
offPop() {
//弹出侧边栏
this.wuzhiCheBian = false;
//清空搜索
this.keyword = '';
},
xuanZheChangKu(item) {
//获取仓库名称和ID
this.changku = item.name;
this.ckid = item.id;
this.getlistInOutDetails();
//弹出侧边栏
this.wuzhiCheBian = false;
//清空搜索
this.keyword = '';
},
// 字典值
getDict() {
getDicts('in_out_type').then(res => {
let dataInfo = res.data;
this.planTypeList = dataInfo.map(item => {
return {
key: item.dictLabel,
value: item.dictValue
};
});
});
},
setDict(stauts) {
for (let item of this.planTypeList) {
if (item.value === stauts) {
return item.key;
}
}
},
//获取本场库的入库明细
getlistInOutDetails() {
listInOutDetails({
houseId: this.ckid,
type: 1
}).then(res => {
this.ruKuMxList = res.rows;
});
},
openDetail(item) {
this.Detailshow = true;
this.getInOutDetailsList(item.inOutDbId);
},
//获取这个入库明细的详情
getInOutDetailsList(id) {
getInListAndInListDel(id).then(res => {
this.ruKuMxDetail = res.data;
});
},
closeDetail() {
this.Detailshow = false;
},
toPage() {
console.log('9999999');
this.$tab.navigateTo(`/pages/indexpage/YJgoods/rkMingXi/rkdan?inOutDbId=${this.ruKuMxDetail.inOutDbId}`);
}
}
};
</script>
<style scoped lang="scss">
.textInfo {
padding: 20rpx;
border-bottom: #dceaf1 1px solid;
width: 90vw;
}
.ruKuInfo {
background-color: #dceaf1;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
height: 200rpx;
width: 100vw;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
.process {
display: flex;
margin: 20rpx 0;
}
}
.paiban {
padding: 20rpx;
}
.paibanBox {
width: 100vw;
// height: 900rpx;
background-color: #fff;
box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 37, 105, 0.1);
}
</style>