SmartStorage/pages/exitExam/exitExam.vue

539 lines
11 KiB
Vue
Raw Normal View History

2023-12-20 15:15:23 +08:00
<template>
<view>
2023-12-21 11:01:48 +08:00
<view
class="single-fetch"
v-for="(fetch, index) in fetchMaterialList"
:key="index"
>
<view class="fetch-upper">
<view class="upper-lef">
2024-01-08 17:41:15 +08:00
{{ fetch.backPerson.slice(0, 1) }}
2023-12-21 11:01:48 +08:00
</view>
<view class="upper-rig">
2024-01-08 17:41:15 +08:00
<h4 style="font-size: 16px;">{{ fetch.backPerson }}</h4>
2023-12-21 11:01:48 +08:00
<h4 style="color: #989898;">{{ fetch.phone }}</h4>
</view>
</view>
<view class="fetch-lower">
<view>
<span>退料申请单位</span>
<h4>{{ fetch.unitName }}</h4>
</view>
<view>
<span>退料申请工程</span>
<h4>{{ fetch.lotName }}</h4>
</view>
<view>
<span>工机具类型</span>
<h4>{{ fetch.typeName }}</h4>
</view>
<view>
<span>申请数量</span>
<h4>{{ fetch.num }}</h4>
</view>
<view>
<span>申请时间</span>
2024-03-13 17:55:34 +08:00
<h4>{{ fetch.backTime }}</h4>
2023-12-21 11:01:48 +08:00
</view>
</view>
<view class="fetch-btns">
<view
style="background-color: #3788FF;"
@click="seeDetail(fetch.id)"
>
2024-03-13 17:55:34 +08:00
<uni-icons style="color: #fff;" type="eye"></uni-icons>
2023-12-21 11:01:48 +08:00
查看
</view>
<view
style="background-color: #FCA30D;"
2024-03-13 17:55:34 +08:00
v-show="fetch.taskStatus == 37 && roles.includes('jjfgs') && fetch.status == 0"
@click="toggleOpenModal(fetch)"
>
<uni-icons style="color: #fff;" type="auth"></uni-icons>
机具审核
</view>
<view
style="background-color: #FCA30D;"
v-show="fetch.taskStatus == 37 && roles.includes('tsfgs') && fetch.status == 0"
@click="toggleOpenModal(fetch)"
2023-12-21 11:01:48 +08:00
>
2024-03-13 17:55:34 +08:00
<uni-icons style="color: #fff;" type="auth"></uni-icons>
调试审核
2023-12-21 11:01:48 +08:00
</view>
</view>
<view class="sticky-area">
2024-03-13 17:55:34 +08:00
<!-- <image src="/static/passed.png" v-show="Number(fetch.taskStatus) >= '38'" mode=""></image>
<image src="/static/noPass.png" v-show="fetch.status == '1'" mode=""></image>
<image src="/static/noExam.png" v-show="Number(fetch.taskStatus) < '38'" mode=""></image> -->
<h4
v-show="fetch.taskStatus == '37'"
>
退料待审核
</h4>
<h4
v-show="fetch.taskStatus == '38'"
>
退料已审核
</h4>
<h4
v-show="fetch.taskStatus == '39'"
>
退料核查中
</h4>
<h4
v-show="fetch.taskStatus == '40'"
style="border: 1px solid #27D870; color: #27D870;"
>
退料完成
</h4>
2023-12-21 11:01:48 +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> -->
<uni-popup
ref="popup"
type="center"
:mask-click="false"
>
<view class="popup">
<view class="pop-top">
<h4>审批</h4>
<uni-icons
style="color: #AAAAAA; font-weight: bold;"
type="closeempty"
@click="closePopup"
>
</uni-icons>
</view>
2024-03-13 17:55:34 +08:00
<h4 style="width: 85%; margin: 2vh auto; font-weight: normal; text-align: center;">是否通过审批</h4>
<view class="select-area">
<view @click="modalConfirm">通过</view>
<view @click="modalReject">驳回</view>
</view>
</view>
</uni-popup>
<uni-popup
ref="popup1"
type="center"
:mask-click="false"
>
<view class="popup1">
<view class="pop-top">
<h4>驳回原因</h4>
<uni-icons
style="color: #AAAAAA; font-weight: bold;"
type="closeempty"
@click="closePopup1"
>
</uni-icons>
</view>
2023-12-21 11:01:48 +08:00
<view class="select-area">
2024-03-13 17:55:34 +08:00
<uni-easyinput v-model="rejectReason" placeholder="请填写驳回原因"></uni-easyinput>
<view class="btn" @click="confirmReject">驳回</view>
2023-12-21 11:01:48 +08:00
</view>
</view>
</uni-popup>
2023-12-20 15:15:23 +08:00
</view>
</template>
<script>
2023-12-21 11:01:48 +08:00
import { basePath } from '../../public'
2023-12-20 15:15:23 +08:00
export default {
data() {
return {
2023-12-21 11:01:48 +08:00
allChecked: false,
examFormData: {
ifPass: '',
noPassReason: ''
},
ifPassRange: [
{ text: '是', value: '0' },
{ text: '否', value: '1' }
],
rules: {
ifPass: {
rules: [
{
required: true,
errorMessage: '请选择是否通过!'
}
]
}
},
fetchMaterialList: [
2023-12-23 11:54:30 +08:00
2023-12-21 11:01:48 +08:00
],
examList: [],
2024-03-13 17:55:34 +08:00
deviceList: [],
roles: uni.getStorageSync('roles'),
modalList: {},
rejectReason: ''
2023-12-20 15:15:23 +08:00
}
},
methods: {
2023-12-21 11:01:48 +08:00
seeDetail (id) {
uni.navigateTo({
url: `/pages/exitExamDetail/exitExamDetail?id=${id}`
})
},
checkAll() {
this.allChecked = !this.allChecked
if (this.allChecked) {
this.fetchMaterialList.map(item => {
if (item.checked == false) {
item.checked = true
}
})
} else {
this.fetchMaterialList.map(item => {
if (item.checked == true) {
item.checked = false
}
})
}
},
checkClick(item) {
item.checked = !item.checked
if (!item.checked) {
this.allChecked = false
} else {
const goods = this.fetchMaterialList.every(item => {
return item.checked === true
})
if (goods) {
this.allChecked = true
} else {
this.allChecked = false
}
}
},
2024-03-13 17:55:34 +08:00
toggleOpenModal (info) {
console.log(info);
this.modalList = info
this.$refs.popup.open()
},
modalConfirm () {
let that = this
console.log(that.modalList);
// that.seeExam(that.modalList.id)
},
modalReject () {
let that = this
console.log(that.modalList);
that.$refs.popup1.open()
},
confirmReject () {
let that = this
if (that.rejectReason == '') {
uni.showToast({
icon: 'none',
title: '请填写驳回原因!'
})
} else {
that.modalList.directAuditRemark = that.rejectReason
console.log(that.modalList);
// that.rejectExam(that.modalList.id)
}
},
2023-12-21 11:01:48 +08:00
closePopup () {
this.$refs.popup.close()
},
2024-03-13 17:55:34 +08:00
closePopup1 () {
this.$refs.popup1.close()
},
2023-12-21 11:01:48 +08:00
seeExam (id) {
let that = this
2024-03-13 17:55:34 +08:00
// 提交单个审核
that.$api.exitExam.subExitExam({
id
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.closePopup()
that.closePopup1()
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.redirectTo({
url: '/pages/exitExam/exitExam'
})
}
})
} else {
that.closePopup()
that.closePopup1()
uni.showToast({
icon: 'none',
title: res.data.msg
})
2023-12-21 11:01:48 +08:00
}
2024-03-13 17:55:34 +08:00
}).catch(err => {
console.log(err);
2023-12-21 11:01:48 +08:00
})
},
2024-03-13 17:55:34 +08:00
rejectExam () {
2023-12-21 11:01:48 +08:00
let that = this
2024-03-13 17:55:34 +08:00
// 拒绝单个审核
that.$api.exitExam.rejectExitExam({
id
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.closePopup()
that.closePopup1()
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.redirectTo({
url: '/pages/exitExam/exitExam'
})
}
})
} else {
that.closePopup()
that.closePopup1()
uni.showToast({
icon: 'none',
title: res.data.msg
})
2023-12-21 11:01:48 +08:00
}
2024-03-13 17:55:34 +08:00
}).catch(err => {
console.log(err);
})
2023-12-21 11:01:48 +08:00
}
},
onShow() {
let that = this
2024-03-13 17:55:34 +08:00
// that.roles = uni.getStorageSync('roles')
console.log(that.roles, uni.getStorageSync('userInfo').sysUser.companyId);
if (that.roles.includes('admin')) that.roles = ['admin', 'jjfgs', 'tsfgs']
2023-12-23 11:54:30 +08:00
// 获取退料审批清单
2023-12-21 11:01:48 +08:00
that.$api.exitExam.exitExamList({
2023-12-23 11:54:30 +08:00
companyId: uni.getStorageSync('userInfo').sysUser.companyId
// companyId: 1
2024-01-04 15:13:09 +08:00
}).then(res => {
2023-12-23 23:21:42 +08:00
console.log(res);
2023-12-21 11:01:48 +08:00
if (res.data.code == 200) {
for (let i = 0; i < res.data.data.length; i++) {
res.data.data[i].num = res.data.data[i].num.split('.')[0]
}
that.fetchMaterialList = res.data.data
console.log(that.fetchMaterialList);
}
}).catch(err => {
2024-01-04 15:13:09 +08:00
console.log(err);
2023-12-21 11:01:48 +08:00
})
2023-12-20 15:15:23 +08:00
}
}
</script>
2023-12-21 11:01:48 +08:00
<style lang="scss">
body{
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
.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%;
box-sizing: border-box;
padding: 15rpx;
border-bottom: 1px solid #D7D7D7;
display: flex;
align-items: center;
.upper-lef{
width: 12%;
height: 5vh;
border-radius: 15rpx;
background-color: #378AFF;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
}
.upper-rig{
flex: 1;
box-sizing: border-box;
padding: 10rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
h4{
font-weight: normal;
font-size: 14px;
}
}
}
.fetch-lower{
width: 100%;
box-sizing: border-box;
padding: 15rpx;
border-bottom: 1px solid #D7D7D7;
view{
width: 100%;
display: flex;
align-items: center;
margin-bottom: 15rpx;
font-size: 14px;
span{
color: #9D9D9D;
padding-right: 20rpx;
}
h4{
color: #000;
font-size: 14px;
font-weight: normal;
}
}
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;
2024-03-13 17:55:34 +08:00
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-21 11:01:48 +08:00
}
}
}
.btm-sticky{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 15rpx 30rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.checked{
display: flex;
align-items: center;
}
.exam{
box-sizing: border-box;
padding: 10rpx 50rpx;
border-radius: 30rpx;
background-color: #3788FF;
font-size: 14px;
color: #fff;
}
}
.popup{
width: 80vw;
2024-03-13 17:55:34 +08:00
height: 20vh;
2023-12-21 11:01:48 +08:00
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top{
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.select-area{
width: 85%;
margin: 40rpx auto;
2024-03-13 17:55:34 +08:00
display: flex;
justify-content: space-around;
align-items: center;
view{
box-sizing: border-box;
font-size: 30rpx;
padding: 12rpx 24rpx;
background-color: #3788FF;
2023-12-21 11:01:48 +08:00
color: #fff;
2024-03-13 17:55:34 +08:00
border-radius: 20rpx;
}
}
}
.popup1{
width: 80vw;
height: 20vh;
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#D9E7FE, #fff, #fff, #fff);
.pop-top{
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.select-area{
width: 85%;
margin: 40rpx auto;
.btn{
width: 30%;
box-sizing: border-box;
padding: 10rpx 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #3788FF;
color: #fff;
font-size: 14px;
border-radius: 15rpx;
margin: 20rpx auto;
2023-12-21 11:01:48 +08:00
}
}
}
2023-12-20 15:15:23 +08:00
</style>