SmartStorage/pages/fetchMaterialOutStore/fetchMaterialOutStore.vue

359 lines
7.5 KiB
Vue
Raw Normal View History

2023-12-20 15:15:23 +08:00
<template>
<view>
2024-04-22 13:18:44 +08:00
<view class="ipt-area">
2024-04-28 14:52:35 +08:00
<uni-easyinput suffixIcon="search" v-model="keywordVal" placeholder="请输入领料单号"
@iconClick="searchKeyword"></uni-easyinput>
2024-04-22 13:18:44 +08:00
</view>
2024-04-28 14:52:35 +08:00
<view class="single-fetch" v-for="(fetch, index) in fetchMaterialList" :key="index">
2023-12-20 15:15:23 +08:00
<view class="fetch-upper">
2023-12-23 11:54:30 +08:00
<!-- {{ fetch.taskStatus }} -->
2023-12-20 15:15:23 +08:00
<!-- <checkbox-group
2023-12-23 11:54:30 +08:00
v-show="fetch.taskStatus != '35'"
2023-12-20 15:15:23 +08:00
style="margin-right: 15rpx;"
@change="checkClick(fetch)"
>
<checkbox :checked="fetch.checked" />
</checkbox-group> -->
<view class="upper-lef">
2023-12-23 11:54:30 +08:00
{{ fetch.createBy.slice(0, 1) }}
2023-12-20 15:15:23 +08:00
</view>
<view class="upper-rig">
2023-12-23 11:54:30 +08:00
<h4 style="font-size: 16px;">{{ fetch.createBy }}</h4>
<h4 style="color: #989898;">{{ fetch.phoneNumber }}</h4>
2023-12-20 15:15:23 +08:00
</view>
</view>
2024-04-28 14:52:35 +08:00
<view class="fetch-lower" @click="seeDetail(fetch.taskId, fetch.taskStatus, fetch.id)">
2023-12-20 15:15:23 +08:00
<view>
2023-12-23 11:54:30 +08:00
<span>领料申请单位</span>
2023-12-24 14:19:53 +08:00
<h4>{{ fetch.unitName }}</h4>
2023-12-20 15:15:23 +08:00
</view>
<view>
2023-12-23 11:54:30 +08:00
<span>领料申请工程</span>
<h4>{{ fetch.proName }}</h4>
2023-12-20 15:15:23 +08:00
</view>
2024-03-21 15:42:08 +08:00
<view>
<span>领料单号</span>
<h4>{{ fetch.code }}</h4>
</view>
2023-12-23 11:54:30 +08:00
<!-- <view>
2023-12-20 15:15:23 +08:00
<span>工机具类型</span>
<h4>{{ fetch.fetchType }}</h4>
2023-12-23 11:54:30 +08:00
</view> -->
2023-12-20 15:15:23 +08:00
<view>
2023-12-23 11:54:30 +08:00
<span>申请数量</span>
<h4>{{ fetch.preCountNum }}</h4>
2023-12-20 15:15:23 +08:00
</view>
<view>
2023-12-23 11:54:30 +08:00
<span>申请时间</span>
2023-12-24 14:19:53 +08:00
<h4>{{ fetch.updateTimes }}</h4>
2023-12-20 15:15:23 +08:00
</view>
2024-03-13 17:55:34 +08:00
<view>
<span>已出库数量</span>
<h4>{{ fetch.alNum }}</h4>
</view>
2023-12-20 15:15:23 +08:00
</view>
<!-- <view class="fetch-btns">
2023-12-23 11:54:30 +08:00
<view
style="background-color: #3788FF;"
@click="seeDetail(fetch.taskId)"
v-show="fetch.taskStatus != '33'"
>
2023-12-20 15:15:23 +08:00
<uni-icons style="color: #fff;" type="eye" size="36"></uni-icons>
查看
</view>
<view
2023-12-23 11:54:30 +08:00
style="background-color: #FCA30D;"
v-show="fetch.taskStatus != '33'"
@click="seeExam(fetch)"
2023-12-20 15:15:23 +08:00
>
<uni-icons style="color: #fff;" type="auth" size="36"></uni-icons>
审核
</view>
</view> -->
<view class="sticky-area">
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '33'">
2024-03-13 17:55:34 +08:00
待出库
</h4>
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '34'">
2024-03-13 17:55:34 +08:00
出库进行中
</h4>
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '35'" style="border: 1px solid #27D870; color: #27D870;">
2024-03-13 17:55:34 +08:00
出库完成
</h4>
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '98'" style="border: 1px solid #EE603D; color: #EE603D;">
2024-03-13 17:55:34 +08:00
分公司审核驳回
</h4>
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '99'" style="border: 1px solid #EE603D; color: #EE603D;">
2024-03-13 17:55:34 +08:00
分管审核驳回
</h4>
2024-04-28 14:52:35 +08:00
<h4 v-show="fetch.taskStatus == '100'" style="border: 1px solid #EE603D; color: #EE603D;">
2024-03-13 17:55:34 +08:00
内部审核驳回
</h4>
2023-12-20 15:15:23 +08:00
</view>
</view>
<!-- <view class="btm-sticky">
<view class="checked">
<checkbox-group @tap="checkAll" style="margin-right: 15rpx;">
<checkbox :checked="allChecked" />
</checkbox-group>
<text>全选</text>
</view>
<view
class="exam"
@click="toggleExam"
>
审核
</view>
</view> -->
2024-03-13 17:55:34 +08:00
<u-loading-page :loading="showLoading" color="#000" loading-text="加载中,请稍后..."></u-loading-page>
2023-12-20 15:15:23 +08:00
</view>
</template>
<script>
import { basePath } from '../../public'
2024-04-28 14:52:35 +08:00
export default {
data() {
return {
keywordVal: '',
showLoading: false,
allChecked: false,
fetchMaterialList: [
],
examList: []
}
},
methods: {
seeDetail(taskId, taskStatus, id) {
// if (taskStatus == 33) {
uni.navigateTo({
url: `/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail?taskId=${taskId}&taskStatus=${taskStatus}&id=${id}`
})
// }
2023-12-20 15:15:23 +08:00
},
2024-04-28 14:52:35 +08:00
/* checkAll() {
this.allChecked = !this.allChecked
if (this.allChecked) {
this.fetchMaterialList.map(item => {
if (item.checked == false) {
item.checked = true
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
})
} else {
this.fetchMaterialList.map(item => {
if (item.checked == true) {
item.checked = false
2023-12-20 15:15:23 +08:00
}
})
2024-04-28 14:52:35 +08:00
}
},
checkClick(item) {
item.checked = !item.checked
if (!item.checked) {
this.allChecked = false
} else {
const goods = this.fetchMaterialList.every(item => {
return item.checked === true
2023-12-20 15:15:23 +08:00
})
2024-04-28 14:52:35 +08:00
if (goods) {
this.allChecked = true
} else {
this.allChecked = false
}
}
}, */
toggleExam() {
let that = this
that.examList = that.fetchMaterialList.filter((item) => {
return item.checked == true
}).map((subItem) => {
return {
name: subItem['name'],
number: subItem['fetchNum']
}
})
console.log(that.examList);
},
closePopup() {
this.$refs.popup.close()
},
seeExam(name) {
console.log(name);
this.$refs.popup.open()
},
formSubmit() {
let that = this
that.$refs.examForm.validate().then(formData => {
console.log(formData);
that.$refs.popup.close()
})
},
initFetch(code) {
let that = this
that.showLoading = true
// 获取领料出库数据
that.$api.fetchExam.fetchExamList({
code,
role: uni.getStorageSync('roles').join(','),
flag: 0
}).then(res => {
2024-04-30 15:12:07 +08:00
console.log(res);
2024-04-28 14:52:35 +08:00
if (res.data.code == 200) {
if (res.data.data.rows.length == 0) {
2024-03-13 17:55:34 +08:00
that.showLoading = false
uni.showToast({
icon: 'none',
2024-04-28 14:52:35 +08:00
title: '未查询到相关数据!'
2024-03-13 17:55:34 +08:00
})
2024-04-28 14:52:35 +08:00
} else {
that.showLoading = false
that.fetchMaterialList = res.data.data.rows
2024-03-13 17:55:34 +08:00
}
2024-04-28 14:52:35 +08:00
} else {
that.showLoading = false
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
2023-12-20 15:15:23 +08:00
},
2024-04-28 14:52:35 +08:00
searchKeyword() {
this.initFetch(this.keywordVal)
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
},
onShow() {
let that = this
console.log(uni.getStorageSync('roles').join(','));
that.initFetch('')
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
}
2023-12-20 15:15:23 +08:00
</script>
<style lang="scss">
2024-04-28 14:52:35 +08:00
body {
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
.ipt-area {
width: 95%;
margin: 20rpx auto;
}
.single-fetch {
width: 95%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 15rpx;
box-sizing: border-box;
padding: 15rpx;
position: relative;
.fetch-upper {
width: 100%;
2023-12-20 15:15:23 +08:00
box-sizing: border-box;
padding: 15rpx;
2024-04-28 14:52:35 +08:00
border-bottom: 1px solid #D7D7D7;
display: flex;
align-items: center;
.upper-lef {
width: 12%;
height: 5vh;
border-radius: 15rpx;
2023-12-20 15:15:23 +08:00
display: flex;
2024-04-28 14:52:35 +08:00
justify-content: center;
2023-12-20 15:15:23 +08:00
align-items: center;
2024-04-28 14:52:35 +08:00
background-color: #3789FD;
color: #fff;
font-size: 24px;
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
.upper-rig {
flex: 1;
2023-12-20 15:15:23 +08:00
box-sizing: border-box;
2024-04-28 14:52:35 +08:00
padding: 10rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
h4 {
font-weight: normal;
2023-12-20 15:15:23 +08:00
font-size: 14px;
}
}
2024-04-28 14:52:35 +08:00
}
.fetch-lower {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
view {
2023-12-20 15:15:23 +08:00
width: 100%;
display: flex;
2024-04-28 14:52:35 +08:00
align-items: center;
margin-bottom: 15rpx;
font-size: 14px;
span {
color: #9D9D9D;
padding-right: 20rpx;
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
h4 {
color: #000;
2024-03-13 17:55:34 +08:00
font-size: 14px;
font-weight: normal;
2023-12-20 15:15:23 +08:00
}
}
2024-04-28 14:52:35 +08:00
view:last-child {
margin-bottom: 0;
}
}
.fetch-btns {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
display: flex;
justify-content: flex-end;
view {
box-sizing: border-box;
padding: 8rpx 25rpx;
border-radius: 15rpx;
color: #fff;
margin-right: 15rpx;
font-size: 14px;
}
view:last-child {
margin-right: 0;
}
}
.sticky-area {
position: absolute;
top: 20rpx;
right: 20rpx;
h4 {
box-sizing: border-box;
padding: 8rpx 20rpx;
border-radius: 15rpx;
font-size: 14px;
font-weight: normal;
background-color: #fff;
border: 1px solid #3788FF;
color: #3788FF;
}
2023-12-20 15:15:23 +08:00
}
2024-04-28 14:52:35 +08:00
}
2023-12-20 15:15:23 +08:00
</style>