This commit is contained in:
parent
b5ba331df0
commit
b32e34bf05
|
|
@ -4,86 +4,150 @@
|
|||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="searchValue" maxlength="10"/>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="searchValue" maxlength="10" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="search" @click="search">查询</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<div class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="handleItem(item)">
|
||||
<div class="title">
|
||||
<span>新购验收</span>
|
||||
<span :class="item.status == 2 ? 'pending' : 'completed'">
|
||||
{{ item.status == 2 ? '未验收' : '已验收' }}
|
||||
</span>
|
||||
<uni-row :gutter="24" class="sect-form">
|
||||
<uni-section title="审核记录" type="line" padding>
|
||||
<uni-steps :options="sectList" :active="activeSect" />
|
||||
</uni-section>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" class="check-form">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<checkbox-group @change="onAllChecked">
|
||||
<checkbox
|
||||
color="#409eff"
|
||||
borderColor="#409eff"
|
||||
activeBorderColor="#409eff"
|
||||
:checked="allChecked"
|
||||
/>
|
||||
</checkbox-group>
|
||||
<div>全选 {{ checkedCount }}/{{ tableList.length }}</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.maTypeName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.typeName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">验收数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.status != 2">
|
||||
<uni-col :span="6">原因:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.reason }}</div></uni-col>
|
||||
</uni-row>
|
||||
</div>
|
||||
<div>
|
||||
<button type="primary" size="mini" @click="handleAllSubmit" :disabled="checkedCount == 0">批量合格</button>
|
||||
</div>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<div
|
||||
class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="handleItem(item)"
|
||||
>
|
||||
<div class="title">
|
||||
<span>
|
||||
<checkbox-group @change="onChangeChecked(item)">
|
||||
<checkbox
|
||||
color="#409eff"
|
||||
borderColor="#409eff"
|
||||
activeBorderColor="#409eff"
|
||||
:checked="item.isChecked"
|
||||
:disabled="item.status != '2'"
|
||||
/>
|
||||
</checkbox-group>
|
||||
新购验收
|
||||
</span>
|
||||
<span :class="item.status == 2 ? 'pending' : 'completed'">
|
||||
{{ item.status == 2 ? '未验收' : '已验收' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.maTypeName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.typeName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">验收数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.status != 2">
|
||||
<uni-col :span="6">原因:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.reason }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
</div>
|
||||
<div class="loading-text">
|
||||
{{ '没有更多数据了~' }}
|
||||
</div>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { getPurchaseInfo } from '../../../services/purchase.js';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { getPurchaseInfo, innerVerify } from '../../../services/purchase.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const searchValue = ref('')
|
||||
const id = ref('')
|
||||
const id = ref('')
|
||||
const taskId = ref('')
|
||||
const statusList = ref(["2","12"])
|
||||
const statusList = ref(['2', '12'])
|
||||
const tableList = ref([])
|
||||
const getTableList = () => {
|
||||
let obj = {
|
||||
"id":id.value,
|
||||
"taskId":taskId.value,
|
||||
"statusList":statusList.value,
|
||||
"taskStage":2,
|
||||
"keyWord":searchValue.value
|
||||
}
|
||||
console.log(obj)
|
||||
getPurchaseInfo(obj).then(res => {
|
||||
console.log(res)
|
||||
tableList.value = res.data.purchaseCheckDetailsList;
|
||||
console.log(tableList.value)
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
const allChecked = ref(false)
|
||||
const sectList = ref([
|
||||
{ title: '供应科审核', desc: '已审核\n张三\n' },
|
||||
{ title: '技术科审核' },
|
||||
{ title: '库管班审核' },
|
||||
])
|
||||
const activeSect = ref(0)
|
||||
const checkedCount = computed(
|
||||
() => tableList.value.filter((item) => item.status == 2 && item.isChecked).length,
|
||||
)
|
||||
const getTableList = () => {
|
||||
let obj = {
|
||||
id: id.value,
|
||||
taskId: taskId.value,
|
||||
statusList: statusList.value,
|
||||
taskStage: 2,
|
||||
keyWord: searchValue.value,
|
||||
}
|
||||
console.log(obj)
|
||||
getPurchaseInfo(obj)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
tableList.value = res.data.purchaseCheckDetailsList
|
||||
if (tableList.value.length > 0) {
|
||||
tableList.value.forEach((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
}
|
||||
console.log(tableList.value)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
const search = () => {
|
||||
console.log('🚀 ~ search ~ searchValue:', searchValue.value)
|
||||
getTableList()
|
||||
getTableList()
|
||||
}
|
||||
const handleItem = (item) => {
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
if (item.status == 2) {
|
||||
uni.navigateTo({ url: `/pages/new-purchase/accept/conclusion?item=${JSON.stringify(item)}` })
|
||||
uni.navigateTo({
|
||||
url: `/pages/new-purchase/accept/conclusion?item=${JSON.stringify(item)}`,
|
||||
})
|
||||
} else {
|
||||
// 提示已验收
|
||||
uni.showToast({
|
||||
|
|
@ -92,20 +156,78 @@ const handleItem = (item) => {
|
|||
})
|
||||
}
|
||||
}
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
id.value = options.id
|
||||
taskId.value = options.taskId
|
||||
getTableList()
|
||||
// 多选框选中
|
||||
const onChangeChecked = (item) => {
|
||||
item.isChecked = !item.isChecked
|
||||
allChecked.value = tableList.value.every((item) => item.isChecked)
|
||||
console.log('🚀 ~ onChangeChecked ~ item:', item)
|
||||
}
|
||||
// 全选
|
||||
const onAllChecked = () => {
|
||||
allChecked.value = !allChecked.value
|
||||
tableList.value.forEach((item) => {
|
||||
if (item.status == 2) {
|
||||
console.log('全选的', allChecked.value)
|
||||
item.isChecked = allChecked.value ? true : false
|
||||
}
|
||||
})
|
||||
console.log('🚀 ~ tableList.value.forEach ~ tableList.value:', tableList.value)
|
||||
}
|
||||
// 批量合格
|
||||
const handleAllSubmit = () => {
|
||||
// 弹框确定
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定批量合格吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
// 获取选中的行数据
|
||||
const checkedRows = tableList.value.filter(item => item.isChecked)
|
||||
console.log('🚀 ~ success: ~ checkedRows:', checkedRows)
|
||||
const purchaseCheckDetailsList = checkedRows.map(item => {
|
||||
return {
|
||||
taskId: item.taskId,
|
||||
typeId: item.typeId,
|
||||
status: '3',
|
||||
checkResult: '合格',
|
||||
manageType: item.manageType
|
||||
}
|
||||
})
|
||||
const param = {
|
||||
purchaseCheckDetailsList,
|
||||
verifyPass: true
|
||||
}
|
||||
console.log('🚀 ~ success: ~ param:', param)
|
||||
try {
|
||||
const res = await innerVerify(param)
|
||||
console.log('🚀 ~ success: ~ res:', res)
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success'
|
||||
})
|
||||
allChecked.value = false
|
||||
getTableList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ success: ~ error:', error)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
onLoad((options) => {
|
||||
console.log(options)
|
||||
id.value = options.id
|
||||
taskId.value = options.taskId
|
||||
getTableList()
|
||||
})
|
||||
onShow(()=>{
|
||||
getTableList()
|
||||
onShow(() => {
|
||||
getTableList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.accept {
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
word-break: break-all;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
|
|
@ -152,6 +274,29 @@ onShow(()=>{
|
|||
}
|
||||
}
|
||||
}
|
||||
.check-form {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx 0;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.sect-form {
|
||||
/* display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center; */
|
||||
background: #fff;
|
||||
padding: 24rpx 0;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.scroll-container {
|
||||
padding: 0 2rpx;
|
||||
}
|
||||
.table-list-item {
|
||||
margin: 24rpx 0;
|
||||
padding: 32rpx;
|
||||
|
|
@ -177,6 +322,8 @@ onShow(()=>{
|
|||
font-weight: 600;
|
||||
color: #3784fb;
|
||||
letter-spacing: 1rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
span:last-child {
|
||||
|
|
@ -189,7 +336,7 @@ onShow(()=>{
|
|||
background-color: rgba(55, 132, 251, 0.1);
|
||||
color: #3784fb;
|
||||
}
|
||||
|
||||
|
||||
&.pending {
|
||||
background-color: rgba(250, 140, 22, 0.1);
|
||||
color: #fa8c16;
|
||||
|
|
@ -200,7 +347,8 @@ onShow(()=>{
|
|||
.line {
|
||||
margin: 24rpx 0;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(90deg,
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(232, 232, 232, 0) 0%,
|
||||
rgba(232, 232, 232, 1) 50%,
|
||||
rgba(232, 232, 232, 0) 100%
|
||||
|
|
@ -209,7 +357,7 @@ onShow(()=>{
|
|||
|
||||
:deep(.uni-row) {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
|
||||
.uni-col-6 {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
|
|
@ -226,4 +374,11 @@ onShow(()=>{
|
|||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #8c8c8c;
|
||||
padding: 32rpx 0;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -98,6 +98,10 @@ const pass = () => {
|
|||
}
|
||||
//不合格
|
||||
const reject = () => {
|
||||
if (bmFileInfos.value.length == 0) {
|
||||
uni.showToast({ title: '请上传图片', icon: 'none' })
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
"taskId":formData.value.taskId,
|
||||
"typeId":formData.value.typeId,
|
||||
|
|
@ -114,20 +118,20 @@ const reject = () => {
|
|||
verifyPass:false
|
||||
}
|
||||
console.log(param)
|
||||
innerVerify(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '操作成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
// innerVerify(param).then(res => {
|
||||
// console.log(res)
|
||||
// if(res.code==200){
|
||||
// uni.showToast({ title: '操作成功', icon: 'none' })
|
||||
// uni.navigateBack({
|
||||
// delta: 1 // 返回到已存在的页面
|
||||
// });
|
||||
// }else{
|
||||
// uni.showToast({ title: res.msg, icon: 'none' })
|
||||
// }
|
||||
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
// }).catch(error => {
|
||||
// console.log(error)
|
||||
// })
|
||||
}
|
||||
|
||||
//上传
|
||||
|
|
@ -228,7 +232,7 @@ onLoad((options)=>{
|
|||
border-radius: 20px;
|
||||
// 取消按钮淡蓝色
|
||||
&:first-child {
|
||||
background-color: #aacefb;
|
||||
background-color: #F56C6C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue