6.21宁夏预报废审核新增多选-领料申请限制-领料出库完成出库

This commit is contained in:
FrancisHu 2024-06-21 17:41:49 +08:00
parent 9a1b28cce5
commit 300e785e15
9 changed files with 402 additions and 99 deletions

View File

@ -328,7 +328,14 @@ const fetchMaterialOutStore = {
HttpConfig.serviceUrl.fetchMaterialOutStore.searchRfid, HttpConfig.serviceUrl.fetchMaterialOutStore.searchRfid,
data data
) )
} },
async directOutStore(data = {}){
return await Http.post(
HttpConfig.basePath,
HttpConfig.serviceUrl.fetchMaterialOutStore.directOutStore,
data
)
},
} }
const exitMaterial = { const exitMaterial = {
@ -827,6 +834,14 @@ const preCrashList = {
header header
) )
}, },
async fetchDeptTree(data = {}, header = {}) {
return await Http.get(
HttpConfig.systemPath,
HttpConfig.serviceUrl.preCrashList.fetchDeptTree,
data,
header
)
},
} }
const url = HttpConfig.systemPath const url = HttpConfig.systemPath

View File

@ -10,7 +10,7 @@ class HttpConfig {
// baseUrl = "http://10.40.92.8:8080" // baseUrl = "http://10.40.92.8:8080"
// baseUrl = "http://10.40.92.52:28080" // baseUrl = "http://10.40.92.52:28080"
// baseUrl = "http://10.40.92.78:28080" // baseUrl = "http://10.40.92.78:28080"
baseUrl = "http://10.40.92.60:38080" baseUrl = "http://10.40.92.48:38080"
// baseUrl = "https://z.csgmall.com.cn/gl" // baseUrl = "https://z.csgmall.com.cn/gl"
// baseUrl = "http://10.40.92.141:28080" // baseUrl = "http://10.40.92.141:28080"
// #endif // #endif
@ -72,6 +72,7 @@ class HttpConfig {
subOutStoreArr: '/leaseOutDetails/submitOutRfid', // 领料出库提交-数组 subOutStoreArr: '/leaseOutDetails/submitOutRfid', // 领料出库提交-数组
fetchSingleDetail: '/tm_task/getLeaseAuditListDetail', // 根据领料id查询领料申请详情 fetchSingleDetail: '/tm_task/getLeaseAuditListDetail', // 根据领料id查询领料申请详情
searchRfid: '/backReceive/rfidCodeQuery', // 查询rfid searchRfid: '/backReceive/rfidCodeQuery', // 查询rfid
directOutStore: '/tm_task/outboundCompleted', // 直接完成出库
}, },
exitMaterial: { exitMaterial: {
exitDeptList: '/back_apply/getbackUnit', // 获取退料单位,工程列表 exitDeptList: '/back_apply/getbackUnit', // 获取退料单位,工程列表
@ -167,6 +168,7 @@ class HttpConfig {
}, },
preCrashList: { preCrashList: {
fetchPreSubList: '/scrap/getScrapTaskListApp', // 获取预报废提交列表 fetchPreSubList: '/scrap/getScrapTaskListApp', // 获取预报废提交列表
fetchDeptTree: '/user/deptTree', // 获取部门树状结构
} }
} }
} }

View File

@ -73,12 +73,12 @@
查看 查看
</view> </view>
<view <view
v-show="fetch.taskStatus == '33' || fetch.taskStatus == '34'"
style="background-color: #FCA30D;" style="background-color: #FCA30D;"
v-show="fetch.taskStatus != '33'" @click="directlyOut(fetch)"
@click="seeExam(fetch)"
> >
<uni-icons style="color: #fff;" type="auth" size="36"></uni-icons> <uni-icons style="color: #fff;" type="auth"></uni-icons>
审核 完成出库
</view> </view>
</view> --> </view> -->
<view class="sticky-area"> <view class="sticky-area">
@ -266,6 +266,9 @@ import { basePath } from '../../public'
}, },
searchKeyword () { searchKeyword () {
this.initFetch(this.keywordVal) this.initFetch(this.keywordVal)
},
directlyOut (list) {
console.log(list);
} }
}, },
onShow() { onShow() {

View File

@ -18,6 +18,22 @@
<span>待出库数量</span> <span>待出库数量</span>
<h4>{{ fetch.outNum }}</h4> <h4>{{ fetch.outNum }}</h4>
</view> </view>
<!-- <view style="
width: 25%;
border-radius: 15rpx;
background-color: #3788FF;
color: #fff;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 15rpx 25rpx;
"
@click.stop="finishOut(fetch)"
>
完成出库
</view> -->
</view> </view>
<uni-popup <uni-popup
ref="popup1" ref="popup1"
@ -53,7 +69,7 @@
> >
<view class="popup2"> <view class="popup2">
<view class="pop-top"> <view class="pop-top">
<h4>量出库</h4> <h4>量出库</h4>
<uni-icons <uni-icons
style="color: #AAAAAA; font-weight: bold;" style="color: #AAAAAA; font-weight: bold;"
type="closeempty" type="closeempty"
@ -97,9 +113,16 @@
</view> </view>
<view <view
class="sub-btn" class="sub-btn"
style="margin-bottom: 15rpx;"
@click="multiOut" @click="multiOut"
> >
批量出库 数量出库
</view>
<view
class="sub-btn"
@click="finishOut"
>
完成出库
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -208,7 +231,7 @@
}, },
multiOut () { multiOut () {
let that = this let that = this
let posiIntReg = /^\+?[1-9]\d*$/ let posiIntReg = /^\+?[0-9]\d*$/
if (!posiIntReg.test(that.multiNum)) { if (!posiIntReg.test(that.multiNum)) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -292,6 +315,33 @@
multiNumChange(val){ multiNumChange(val){
console.log('multiNumChange ===============',val); console.log('multiNumChange ===============',val);
},
finishOut () {
let that = this
uni.showModal({
title: '完成出库',
content: '确定将此种机具完成出库吗?',
confirmText: '出库',
success: (res) => {
if (res.confirm) {
console.log(that.infoList);
that.$api.fetchMaterialOutStore.directOutStore({
id: that.infoList.parentId,
typeId: that.infoList.typeId
}).then(res => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
}
}
})
} }
}, },
onLoad(params) { onLoad(params) {

View File

@ -305,12 +305,13 @@ import { basePath } from '../../public';
status: '0', status: '0',
// createTime: that.formatDate(new Date().getTime()), // createTime: that.formatDate(new Date().getTime()),
typeId: item['typeId'], typeId: item['typeId'],
preNum: item['bookNum'] preNum: item['bookNum'],
manageType: item['manageType']
} }
}) })
let setArr = [] let setArr = []
that.totalGoods.forEach(list => { that.totalGoods.forEach(list => {
setArr.push(list.typeId) setArr.push(list.manageType)
}) })
console.log(setArr); console.log(setArr);
let set = new Set(setArr) let set = new Set(setArr)

View File

@ -163,15 +163,15 @@
}) })
}, },
seePreDetail (taskId) { seePreDetail (taskId) {
uni.setStorageSync('preTaskId', taskId) // uni.setStorageSync('preTaskId', taskId)
uni.navigateTo({ uni.navigateTo({
url: `/pages/preCrashExamDetail/preCrashExamDetail` url: `/pages/preCrashExamDetail/preCrashExamDetail?taskId=${taskId}`
}) })
}, },
examPreDetail (taskId) { examPreDetail (taskId) {
uni.setStorageSync('preTaskId', taskId) // uni.setStorageSync('preTaskId', taskId)
uni.navigateTo({ uni.navigateTo({
url: `/pages/preCrashExamDetail/preCrashExamDetail?showBtn=0` url: `/pages/preCrashExamDetail/preCrashExamDetail?showBtn=0&taskId=${taskId}`
}) })
} }
}, },

View File

@ -5,70 +5,105 @@
v-for="(list, index) in preDetailList" v-for="(list, index) in preDetailList"
:key="list.id" :key="list.id"
> >
<view> <view>
<h4>设备类型</h4> <checkbox-group
<h5>{{ list.machineTypeName }}</h5> v-show="list.status == '0' && showBtn == '0'"
style="margin-right: 15rpx;"
@change="checkClick(list)"
>
<checkbox :checked="list.checked" />
</checkbox-group>
</view>
<view class="info-cont">
<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> </view>
<view> </view>
<h4>规格型号</h4> <view class="btm-sticky" v-show="showBtn == '0'">
<h5>{{ list.specificationType }}</h5> <view class="checked">
<checkbox-group @tap="checkAll" style="margin-right: 15rpx;">
<checkbox :checked="allChecked" />
</checkbox-group>
<text>全选</text>
</view> </view>
<view> <view style="display: flex;">
<h4>设备编码</h4> <view
<h5>{{ list.maCode == null ? '-' : list.maCode }}</h5> class="exam"
</view> @click="clickPass"
<view> style="margin-right: 15rpx;"
<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> </view>
<text <view
class="exam"
style="background-color: #fff; color: #000; border: 1px solid #EBEBEB;" style="background-color: #fff; color: #000; border: 1px solid #EBEBEB;"
@click="toggleRefuse(list)" @click="clickReject"
> >
驳回 驳回
</text> </view>
</h3> </view>
<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> </view>
<uni-popup <uni-popup
ref="popup1" ref="popup1"
@ -98,12 +133,14 @@
export default { export default {
data() { data() {
return { return {
allChecked: false,
taskId: '', taskId: '',
preDetailList: [], preDetailList: [],
imgPrefix: '', imgPrefix: '',
rejectReason: '', rejectReason: '',
refuseList: '', refuseList: '',
showBtn: '' showBtn: '',
rejectList: []
} }
}, },
methods: { methods: {
@ -118,6 +155,7 @@
if (item.fileUrl != null) { if (item.fileUrl != null) {
item.fileUrl = item.fileUrl.split(',') item.fileUrl = item.fileUrl.split(',')
} }
item.checked = false
}) })
that.preDetailList = res.data.data that.preDetailList = res.data.data
console.log(that.preDetailList); console.log(that.preDetailList);
@ -136,9 +174,7 @@
icon: 'none', icon: 'none',
title: res.data.msg, title: res.data.msg,
success: () => { success: () => {
uni.redirectTo({ uni.navigateBack()
url: '/pages/preCrashExamDetail/preCrashExamDetail'
})
} }
}) })
} else { } else {
@ -185,7 +221,7 @@
}, },
confirmReject () { confirmReject () {
let that = this let that = this
let arr = [] /* let arr = []
arr.push({ arr.push({
auditBy: uni.getStorageSync('userInfo').userid, auditBy: uni.getStorageSync('userInfo').userid,
id: this.refuseList.id, id: this.refuseList.id,
@ -198,15 +234,120 @@
} }
console.log(subObj); console.log(subObj);
that.submitExam(subObj) that.submitExam(subObj)
that.closePopup1() that.closePopup1() */
if (that.rejectReason == '') {
uni.showToast({
icon: 'none',
title: '请填写驳回原因!'
})
} else {
that.rejectList.forEach(item => {
item.auditRemark = that.rejectReason
})
let subObj = {
scrapDetailList: that.rejectList,
taskId: that.taskId
}
console.log(subObj);
that.submitExam(subObj)
that.closePopup1()
}
},
checkClick(item) {
item.checked = !item.checked
if (!item.checked) {
this.allChecked = false
} else {
const goods = this.preDetailList.every(item => {
return item.checked === true
})
if (goods) {
this.allChecked = true
} else {
this.allChecked = false
}
}
},
checkAll() {
this.allChecked = !this.allChecked
if (this.allChecked) {
this.preDetailList.map(item => {
if (item.checked == false) {
item.checked = true
}
})
} else {
this.preDetailList.map(item => {
if (item.checked == true) {
item.checked = false
}
})
}
},
clickPass () {
let that = this
let subList = that.preDetailList.filter(item => {
return item.checked == true
}).map(subItem => {
return {
auditBy: uni.getStorageSync('userInfo').userid,
id: subItem['id'],
status: '1'
}
})
if (subList.length == 0) {
uni.showToast({
icon: 'none',
title: '未选中审核项!'
})
} else {
let subObj = {
scrapDetailList: subList,
taskId: this.taskId
}
uni.showModal({
title: '通过审核',
content: '是否通过审核?',
confirmText: '通过',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
console.log(subObj);
that.submitExam(subObj)
}
}
})
}
},
clickReject () {
let that = this
let subList = that.preDetailList.filter(item => {
return item.checked == true
}).map(subItem => {
return {
auditBy: uni.getStorageSync('userInfo').userid,
id: subItem['id'],
status: '2'
}
})
if (subList.length == 0) {
uni.showToast({
icon: 'none',
title: '未选中审核项!'
})
} else {
that.rejectList = subList
that.$refs.popup1.open()
}
} }
}, },
onLoad(params) { onLoad(params) {
this.showBtn = params.showBtn this.showBtn = params.showBtn
this.taskId = params.taskId
}, },
onShow() { onShow() {
this.imgPrefix = this.$api.url this.imgPrefix = this.$api.url
this.fetchPreDetail(uni.getStorageSync('preTaskId')) this.fetchPreDetail(this.taskId)
} }
} }
</script> </script>
@ -214,6 +355,8 @@
<style lang="scss"> <style lang="scss">
body{ body{
background-color: #FAFDFF; background-color: #FAFDFF;
box-sizing: border-box;
padding-bottom: 10vh;
} }
.single-pre{ .single-pre{
width: 100%; width: 100%;
@ -221,28 +364,34 @@
padding: 30rpx; padding: 30rpx;
background-color: #fff; background-color: #fff;
position: relative; position: relative;
view{ display: flex;
align-items: center;
.info-cont{
width: 100%; width: 100%;
margin-bottom: 25rpx;
display: flex; display: flex;
align-items: center; flex-direction: column;
h4{ view{
font-weight: normal; display: flex;
font-size: 30rpx; align-items: center;
color: #ADADAD; margin-bottom: 25rpx;
padding-right: 20rpx; h4{
} font-weight: normal;
h5{ font-size: 30rpx;
font-weight: normal; color: #ADADAD;
font-size: 30rpx; padding-right: 20rpx;
image{ }
width: 20%; h5{
height: 100rpx; font-weight: normal;
font-size: 30rpx;
image{
width: 20%;
height: 100rpx;
}
} }
} }
} view:last-child{
view:last-child{ margin-bottom: 0;
margin-bottom: 0; }
} }
h3{ h3{
width: 100%; width: 100%;
@ -282,6 +431,30 @@
} }
} }
} }
.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;
}
}
.popup1{ .popup1{
width: 80vw; width: 80vw;
height: 20vh; height: 20vh;

View File

@ -56,6 +56,12 @@
<uni-icons style="color: #fff;" type="auth"></uni-icons> <uni-icons style="color: #fff;" type="auth"></uni-icons>
审核 审核
</view> </view>
<view
style="background-color: #1BD30B;"
>
<uni-icons style="color: #fff;" type="paperplane"></uni-icons>
提交
</view>
</view> </view>
<view class="sticky-area"> <view class="sticky-area">
<!-- <image src="/static/passed.png" v-show="pre.taskStatus == 59" mode=""></image> <!-- <image src="/static/passed.png" v-show="pre.taskStatus == 59" mode=""></image>

View File

@ -8,14 +8,67 @@
export default { export default {
data() { data() {
return { return {
taskId: '',
preDetailList: [],
deptList: []
} }
}, },
methods: { 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(',')
}
item.checked = false
})
that.preDetailList = res.data.data
console.log(that.preDetailList);
}
}).catch(err => {
console.log(err);
})
},
getDeptTree () {
let that = this
that.$api.preCrashList.fetchDeptTree().then(res => {
that.deptList = that.veri(res.data.data)
console.log(that.deptList);
}).catch(err => {
console.log(err);
})
},
veri (data) {
let that = this
if (!data || data.length <= 0) {
return null;
}
return data.map(x => {
const model = {
name: x.label,
id: x.id
}
const children = that.veri(x.children);
if (children) {
model.children = children;
}
return model;
});
}
}, },
onLoad(params) { onLoad(params) {
console.log(params); console.log(params);
this.taskId = params.taskId
this.fetchPreDetail(this.taskId)
this.getDeptTree()
} }
} }
</script> </script>