6.20宁夏新增预报废审核和列表模块

This commit is contained in:
FrancisHu 2024-06-20 16:40:29 +08:00
parent 20834903a3
commit 9a1b28cce5
10 changed files with 902 additions and 33 deletions

View File

@ -791,6 +791,44 @@ const indexScan = {
},
}
const preCrashExam = {
async fetchPreCrashList(data = {}, header = {}) {
return await Http.post(
HttpConfig.materialPath,
HttpConfig.serviceUrl.preCrashExam.fetchPreCrashList,
data,
header
)
},
async fetchPreCrashDetail(data = {}, header = {}) {
return await Http.get(
HttpConfig.materialPath,
HttpConfig.serviceUrl.preCrashExam.fetchPreCrashDetail,
data,
header
)
},
async submitPreExam(data = {}, header = {}) {
return await Http.post(
HttpConfig.materialPath,
HttpConfig.serviceUrl.preCrashExam.submitPreExam,
data,
header
)
},
}
const preCrashList = {
async fetchPreSubList(data = {}, header = {}) {
return await Http.get(
HttpConfig.materialPath,
HttpConfig.serviceUrl.preCrashList.fetchPreSubList,
data,
header
)
},
}
const url = HttpConfig.systemPath
export default{
@ -815,5 +853,7 @@ export default{
rfidBinding,
qrcodeBinding,
indexScan,
preCrashExam,
preCrashList,
url
}

View File

@ -3,26 +3,26 @@ class HttpConfig {
baseUrl = "/api"
// #endif
// #ifdef APP-PLUS
baseUrl = "http://112.29.103.165:21624"
// baseUrl = "http://112.29.103.165:21624"
// baseUrl = "http://192.168.0.14:21624"
// baseUrl = "http://112.29.103.165:21626"
// baseUrl = "http://172.20.10.3:8080"
// baseUrl = "http://10.40.92.8:8080"
// baseUrl = "http://10.40.92.52:28080"
// baseUrl = "http://10.40.92.78:28080"
// baseUrl = "http://10.40.92.60:38080"
baseUrl = "http://10.40.92.60:38080"
// baseUrl = "https://z.csgmall.com.cn/gl"
// baseUrl = "http://10.40.92.141:28080"
// #endif
// 基地址
authPath = `${this.baseUrl}/dev-api/auth`
/* authPath = `${this.baseUrl}/dev-api/auth`
systemPath = `${this.baseUrl}/dev-api/system`
basePath = `${this.baseUrl}/dev-api/base`
materialPath = `${this.baseUrl}/dev-api/material`
/* authPath = `${this.baseUrl}/auth`
materialPath = `${this.baseUrl}/dev-api/material` */
authPath = `${this.baseUrl}/auth`
systemPath = `${this.baseUrl}/system`
basePath = `${this.baseUrl}/base`
materialPath = `${this.baseUrl}/material` */
materialPath = `${this.baseUrl}/material`
// 短链
serviceUrl = {
login: {
@ -159,6 +159,14 @@ class HttpConfig {
},
indexScan: {
infoByCode: '/machine/getMachineByQrCode', // 首页根据二维码查询设备信息
},
preCrashExam: {
fetchPreCrashList: '/scrap/getScrapApplyListApp', //获取预报废审核列表
fetchPreCrashDetail: '/scrap/getScrapAuditListApp', //获取预报废审核列表详情
submitPreExam: '/scrap/forecastWasteAudit', //提交审核
},
preCrashList: {
fetchPreSubList: '/scrap/getScrapTaskListApp', // 获取预报废提交列表
}
}
}

View File

@ -467,6 +467,30 @@
}
}
,{
"path" : "pages/preCrashExamDetail/preCrashExamDetail",
"style" :
{
"navigationBarTitleText": "审核详情"
}
}
,{
"path" : "pages/preCrashList/preCrashList",
"style" :
{
"navigationBarTitleText": "预报废列表"
}
}
,{
"path" : "pages/preCrashListDetail/preCrashListDetail",
"style" :
{
"navigationBarTitleText": "列表详情"
}
}
],
"tabBar": {
"color": "#2c2c2c",

View File

@ -1,68 +1,101 @@
<template>
<view>
<view class="search-bar">
<uni-easyinput suffixIcon="search" v-model="preIpt" placeholder="请输入关键字" @iconClick="searchKeyword"></uni-easyinput>
</view>
<view
class="single-fetch"
v-for="(fetch, index) in fetchMaterialList"
v-for="(pre, index) in preCrashList"
:key="index"
>
<view class="fetch-upper">
<checkbox-group
v-show="fetch.taskStatus == 58"
<!-- <checkbox-group
v-show="pre.taskStatus == 58"
style="margin-right: 15rpx;"
@change="checkClick(fetch)"
@change="checkClick(pre)"
>
<checkbox :checked="fetch.checked" />
</checkbox-group>
<checkbox :checked="pre.checked" />
</checkbox-group> -->
<view class="upper-lef">
{{ fetch.createBy == null ? '' : fetch.createBy.slice(0, 1) }}
{{ pre.createBy == null ? '' : pre.createBy.slice(0, 1) }}
</view>
<view class="upper-rig">
<h4 style="font-size: 16px;">{{ fetch.createBy }}</h4>
<h4 style="color: #989898;">{{ fetch.unitName }}</h4>
<h4 style="font-size: 16px;">{{ pre.createBy }}</h4>
<h4 style="color: #989898;">{{ pre.unitName }}</h4>
</view>
</view>
<view class="fetch-lower">
<view>
<span>预报废单号</span>
<h4>{{ fetch.scrapNum }}</h4>
<h4>{{ pre.scrapNum }}</h4>
</view>
<view>
<span>报废来源</span>
<h4>{{ fetch.projectName }}</h4>
<h4>{{ pre.projectName }}</h4>
</view>
<view>
<span>设备类型</span>
<h4>{{ fetch.itemType }}</h4>
<h4>{{ pre.itemType }}</h4>
</view>
<view>
<span>申请时间</span>
<h4>{{ fetch.createTime }}</h4>
<h4>{{ pre.createTime }}</h4>
</view>
</view>
<view class="fetch-btns">
<view
style="background-color: #3788FF;"
@click="seeDetail(fetch.taskId, fetch.taskStatus, 0)"
@click="seePreDetail(pre.taskId)"
>
<uni-icons style="color: #fff;" type="eye"></uni-icons>
查看
</view>
<view
style="background-color: #FCA30D;"
v-show="fetch.taskStatus == 58"
@click="seeDetail(fetch.taskId, fetch.taskStatus, 1)"
v-show="pre.taskStatus == '120' && ifRole"
@click="examPreDetail(pre.taskId)"
>
<uni-icons style="color: #fff;" type="auth"></uni-icons>
审核
</view>
<view
style="background-color: #FCA30D;"
v-show="pre.taskStatus == '121' && ifRole"
@click="examPreDetail(pre.taskId)"
>
<uni-icons style="color: #fff;" type="auth"></uni-icons>
审核
</view>
</view>
<view class="sticky-area">
<image src="/static/passed.png" v-show="fetch.taskStatus == 59" mode=""></image>
<image src="/static/noPass.png" v-show="fetch.taskStatus == 61" mode=""></image>
<image src="/static/noExam.png" v-show="fetch.taskStatus == 58" mode=""></image>
<!-- <image src="/static/passed.png" v-show="pre.taskStatus == 59" mode=""></image>
<image src="/static/noPass.png" v-show="pre.taskStatus == 61" mode=""></image>
<image src="/static/noExam.png" v-show="pre.taskStatus == 58" mode=""></image> -->
<h4
v-show="pre.taskStatus == '120'"
>
待审核
</h4>
<h4
v-show="pre.taskStatus == '121'"
>
审核中
</h4>
<h4
v-show="pre.taskStatus == '122'"
style="border: 1px solid #27D870; color: #27D870;"
>
已通过
</h4>
<h4
v-show="pre.taskStatus == '123'"
style="border: 1px solid #EE603D; color: #EE603D;"
>
已驳回
</h4>
</view>
</view>
<view class="btm-sticky">
<!-- <view class="btm-sticky">
<view class="checked">
<checkbox-group @tap="checkAll" style="margin-right: 15rpx;">
<checkbox :checked="allChecked" />
@ -75,8 +108,8 @@
>
审核
</view>
</view>
<uni-popup
</view> -->
<!-- <uni-popup
ref="popup"
type="center"
:mask-click="false"
@ -97,7 +130,7 @@
<view @click="modalReject">驳回</view>
</view>
</view>
</uni-popup>
</uni-popup> -->
</view>
</template>
@ -105,15 +138,168 @@
export default {
data() {
return {
preCrashList: [],
preIpt: '',
roles: uni.getStorageSync('roles'),
ableRoleArr: ['admin', 'em03', 'dm02'],
ifRole: false
}
},
methods: {
searchKeyword () {
this.fetchPreCrashList(this.preIpt)
},
fetchPreCrashList (keyword) {
let that = this
that.$api.preCrashExam.fetchPreCrashList({
keyword
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.preCrashList = res.data.data
}
}).catch(err => {
console.log(err);
})
},
seePreDetail (taskId) {
uni.setStorageSync('preTaskId', taskId)
uni.navigateTo({
url: `/pages/preCrashExamDetail/preCrashExamDetail`
})
},
examPreDetail (taskId) {
uni.setStorageSync('preTaskId', taskId)
uni.navigateTo({
url: `/pages/preCrashExamDetail/preCrashExamDetail?showBtn=0`
})
}
},
onShow() {
let that = this
that.fetchPreCrashList('')
console.log(uni.getStorageSync('roles'));
for (let role of that.roles) {
if (that.ableRoleArr.includes(role)) {
that.ifRole = true;
break;
}
}
console.log(that.ifRole);
}
}
</script>
<style>
<style lang="scss">
body{
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
.search-bar{
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%;
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;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
background-color: #3788FF;
color: #fff;
}
.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;
margin-right: 15rpx;
color: #fff;
font-size: 14px;
}
}
.sticky-area{
position: absolute;
top: 20rpx;
right: 20rpx;
/* width: 11vh;
height: 10vh;
image{
width: 100%;
height: 100%;
} */
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;
}
}
}
</style>

View File

@ -0,0 +1,319 @@
<template>
<view>
<view
class="single-pre"
v-for="(list, index) in preDetailList"
:key="list.id"
>
<view>
<h4>设备类型</h4>
<h5>{{ list.machineTypeName }}</h5>
</view>
<view>
<h4>规格型号</h4>
<h5>{{ list.specificationType }}</h5>
</view>
<view>
<h4>设备编码</h4>
<h5>{{ list.maCode == null ? '-' : list.maCode }}</h5>
</view>
<view>
<h4>报废数量</h4>
<h5>{{ list.scrapNum }}</h5>
</view>
<view>
<h4>损坏原因</h4>
<h5>{{ list.scrapType == '0' ? '自然' : '人为' }}</h5>
</view>
<view>
<h4>报废图片</h4>
<h5>
<image
v-for="(img, index) in list.fileUrl"
:key="index"
:src="imgPrefix + img[index]"
mode=""
></image>
</h5>
</view>
<h3 v-show="list.status == '0' && showBtn == '0'">
<text
@click="togglePass(list)"
>
通过
</text>
<text
style="background-color: #fff; color: #000; border: 1px solid #EBEBEB;"
@click="toggleRefuse(list)"
>
驳回
</text>
</h3>
<h6 class="sticky-area">
<h4
v-show="list.status == '0'"
style="background-color: #FFF6E7; color: #FCAA23;"
>
待审核
</h4>
<h4
v-show="list.status == '1'"
style="background-color: #E9FBE7; color: #3CD92E;"
>
已通过
</h4>
<h4
v-show="list.status == '2'"
style="background-color: #FFECEC; color: #FF4C4C;"
>
驳回
</h4>
</h6>
</view>
<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>
<view class="select-area">
<uni-easyinput v-model="rejectReason" placeholder="请填写驳回原因"></uni-easyinput>
<view class="btn" @click="confirmReject">驳回</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
taskId: '',
preDetailList: [],
imgPrefix: '',
rejectReason: '',
refuseList: '',
showBtn: ''
}
},
methods: {
fetchPreDetail (taskId) {
let that = this
that.$api.preCrashExam.fetchPreCrashDetail({
taskId
}).then(res => {
console.log(res);
if (res.data.code == 200) {
res.data.data.forEach(item => {
if (item.fileUrl != null) {
item.fileUrl = item.fileUrl.split(',')
}
})
that.preDetailList = res.data.data
console.log(that.preDetailList);
}
}).catch(err => {
console.log(err);
})
},
submitExam (obj) {
let that = this
// /
that.$api.preCrashExam.submitPreExam(obj).then(res => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: 'none',
title: res.data.msg,
success: () => {
uni.redirectTo({
url: '/pages/preCrashExamDetail/preCrashExamDetail'
})
}
})
} else {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
},
togglePass (list) {
let that = this
let arr = []
arr.push({
auditBy: uni.getStorageSync('userInfo').userid,
id: list.id,
status: '1'
})
let subObj = {
scrapDetailList: arr,
taskId: list.taskId
}
uni.showModal({
title: '通过审核',
content: '是否通过审核?',
confirmText: '通过',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
console.log(subObj);
that.submitExam(subObj)
}
}
})
},
toggleRefuse (list) {
this.refuseList = list
this.$refs.popup1.open()
},
closePopup1 () {
this.$refs.popup1.close()
},
confirmReject () {
let that = this
let arr = []
arr.push({
auditBy: uni.getStorageSync('userInfo').userid,
id: this.refuseList.id,
auditRemark: this.rejectReason,
status: '2'
})
let subObj = {
scrapDetailList: arr,
taskId: this.refuseList.taskId
}
console.log(subObj);
that.submitExam(subObj)
that.closePopup1()
}
},
onLoad(params) {
this.showBtn = params.showBtn
},
onShow() {
this.imgPrefix = this.$api.url
this.fetchPreDetail(uni.getStorageSync('preTaskId'))
}
}
</script>
<style lang="scss">
body{
background-color: #FAFDFF;
}
.single-pre{
width: 100%;
box-sizing: border-box;
padding: 30rpx;
background-color: #fff;
position: relative;
view{
width: 100%;
margin-bottom: 25rpx;
display: flex;
align-items: center;
h4{
font-weight: normal;
font-size: 30rpx;
color: #ADADAD;
padding-right: 20rpx;
}
h5{
font-weight: normal;
font-size: 30rpx;
image{
width: 20%;
height: 100rpx;
}
}
}
view:last-child{
margin-bottom: 0;
}
h3{
width: 100%;
box-sizing: border-box;
padding: 20rpx;
margin-top: 50rpx;
font-size: 14px;
font-weight: normal;
display: flex;
align-items: center;
justify-content: right;
text{
width: 20%;
box-sizing: border-box;
padding: 10rpx 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: 30rpx;
background-color: #3888FF;
font-weight: normal;
margin-right: 30rpx;
color: #fff;
}
text:last-child{
margin-right: 0;
}
}
.sticky-area{
font-size: 16px;
position: absolute;
top: 20rpx;
right: 20rpx;
h4{
box-sizing: border-box;
padding: 10rpx 25rpx;
}
}
}
.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;
}
}
}
</style>

View File

@ -0,0 +1,241 @@
<template>
<view>
<view class="search-bar">
<uni-easyinput suffixIcon="search" v-model="subIpt" placeholder="请输入关键字" @iconClick="searchKeyword"></uni-easyinput>
</view>
<view
class="single-fetch"
v-for="(pre, index) in preCrashList"
:key="index"
>
<view class="fetch-upper">
<!-- <checkbox-group
v-show="pre.taskStatus == 58"
style="margin-right: 15rpx;"
@change="checkClick(pre)"
>
<checkbox :checked="pre.checked" />
</checkbox-group> -->
<view class="upper-lef">
{{ pre.createBy == null ? '' : pre.createBy.slice(0, 1) }}
</view>
<view class="upper-rig">
<h4 style="font-size: 16px;">{{ pre.createBy }}</h4>
<h4 style="color: #989898;">{{ pre.unitName }}</h4>
</view>
</view>
<view class="fetch-lower">
<view>
<span>预报废单号</span>
<h4>{{ pre.repairNum }}</h4>
</view>
<view>
<span>报废单号</span>
<h4>{{ pre.scrapNum }}</h4>
</view>
<view>
<span>报废来源</span>
<h4>{{ pre.scrapSource == '1' ? '退料' : '维修' }}</h4>
</view>
<view>
<span>设备类型</span>
<h4>{{ pre.itemType }}</h4>
</view>
</view>
<view class="fetch-btns">
<view
style="background-color: #3788FF;"
@click="seeListDetail(pre.taskId)"
>
<uni-icons style="color: #fff;" type="eye"></uni-icons>
查看
</view>
<view
style="background-color: #FCA30D;"
>
<uni-icons style="color: #fff;" type="auth"></uni-icons>
审核
</view>
</view>
<view class="sticky-area">
<!-- <image src="/static/passed.png" v-show="pre.taskStatus == 59" mode=""></image>
<image src="/static/noPass.png" v-show="pre.taskStatus == 61" mode=""></image>
<image src="/static/noExam.png" v-show="pre.taskStatus == 58" mode=""></image> -->
<h4
v-show="pre.taskStatus == '124'"
>
待提交
</h4>
<h4
v-show="pre.taskStatus == '58'"
>
审核中
</h4>
<h4
v-show="pre.taskStatus == '59'"
style="border: 1px solid #27D870; color: #27D870;"
>
已通过
</h4>
<h4
v-show="pre.taskStatus == '61'"
style="border: 1px solid #EE603D; color: #EE603D;"
>
已驳回
</h4>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
preCrashList: [],
subIpt: ''
}
},
methods: {
searchKeyword () {
this.getSubList(this.subIpt)
},
getSubList (keyword) {
let that = this
that.$api.preCrashList.fetchPreSubList({
keyword
}).then(res => {
console.log(res);
if (res.data.code == 200) {
that.preCrashList = res.data.data
}
}).catch(err => {
console.log(err);
})
},
seeListDetail (taskId) {
console.log(taskId);
uni.navigateTo({
url: `/pages/preCrashListDetail/preCrashListDetail?taskId=${taskId}`
})
}
},
onShow() {
this.getSubList('')
}
}
</script>
<style lang="scss">
body{
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
.search-bar{
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%;
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;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
background-color: #3788FF;
color: #fff;
}
.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;
margin-right: 15rpx;
color: #fff;
font-size: 14px;
}
}
.sticky-area{
position: absolute;
top: 20rpx;
right: 20rpx;
/* width: 11vh;
height: 10vh;
image{
width: 100%;
height: 100%;
} */
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;
}
}
}
</style>

View File

@ -0,0 +1,25 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
},
onLoad(params) {
console.log(params);
}
}
</script>
<style>
</style>

View File

@ -107,6 +107,11 @@
pic: '/static/preCrashExam.png',
url: 'preCrashExam'
},
{
name: '预报废列表',
pic: '/static/preCrashList.png',
url: 'preCrashList'
},
{
name: '报废审核',
pic: '/static/crashExam.png',

View File

@ -426,6 +426,27 @@ const router = createRouter({
"meta": {
"needAuth": "true"
}
},
{
"path" : "/pages/preCrashExamDetail/preCrashExamDetail",
"name": 'preCrashExamDetail',
"meta": {
"needAuth": "true"
}
},
{
"path" : "/pages/preCrashList/preCrashList",
"name": 'preCrashList',
"meta": {
"needAuth": "true"
}
},
{
"path" : "/pages/preCrashListDetail/preCrashListDetail",
"name": 'preCrashListDetail',
"meta": {
"needAuth": "true"
}
}
]
})

BIN
static/preCrashList.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB