This commit is contained in:
parent
b5ba331df0
commit
b32e34bf05
|
|
@ -11,12 +11,47 @@
|
||||||
<view class="search" @click="search">查询</view>
|
<view class="search" @click="search">查询</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<div class="table-list-item"
|
<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>
|
||||||
|
<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"
|
v-for="(item, index) in tableList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItem(item)">
|
@click="handleItem(item)"
|
||||||
|
>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span>新购验收</span>
|
<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'">
|
<span :class="item.status == 2 ? 'pending' : 'completed'">
|
||||||
{{ item.status == 2 ? '未验收' : '已验收' }}
|
{{ item.status == 2 ? '未验收' : '已验收' }}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -25,54 +60,81 @@
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">物资名称:</uni-col>
|
<uni-col :span="6">物资名称:</uni-col>
|
||||||
<uni-col :span="18"
|
<uni-col :span="18"
|
||||||
><div class="cont">{{ item.maTypeName }}</div></uni-col>
|
><div class="cont">{{ item.maTypeName }}</div></uni-col
|
||||||
|
>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">规格型号:</uni-col>
|
<uni-col :span="6">规格型号:</uni-col>
|
||||||
<uni-col :span="18"
|
<uni-col :span="18"
|
||||||
><div class="cont">{{ item.typeName }}</div></uni-col>
|
><div class="cont">{{ item.typeName }}</div></uni-col
|
||||||
|
>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">到货数量:</uni-col>
|
<uni-col :span="6">到货数量:</uni-col>
|
||||||
<uni-col :span="18"
|
<uni-col :span="18"
|
||||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col>
|
><div class="cont">{{ item.purchaseNum }}</div></uni-col
|
||||||
|
>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">验收数量:</uni-col>
|
<uni-col :span="6">验收数量:</uni-col>
|
||||||
<uni-col :span="18"
|
<uni-col :span="18"
|
||||||
><div class="cont">{{ item.purchaseNum }}</div></uni-col>
|
><div class="cont">{{ item.purchaseNum }}</div></uni-col
|
||||||
|
>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24" v-if="item.status != 2">
|
<uni-row :gutter="24" v-if="item.status != 2">
|
||||||
<uni-col :span="6">原因:</uni-col>
|
<uni-col :span="6">原因:</uni-col>
|
||||||
<uni-col :span="18"><div class="cont">{{ item.reason }}</div></uni-col>
|
<uni-col :span="18"
|
||||||
|
><div class="cont">{{ item.reason }}</div></uni-col
|
||||||
|
>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="loading-text">
|
||||||
|
{{ '没有更多数据了~' }}
|
||||||
|
</div>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
import { getPurchaseInfo } from '../../../services/purchase.js';
|
import { getPurchaseInfo, innerVerify } from '../../../services/purchase.js'
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
const searchValue = ref('')
|
const searchValue = ref('')
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
const taskId = ref('')
|
const taskId = ref('')
|
||||||
const statusList = ref(["2","12"])
|
const statusList = ref(['2', '12'])
|
||||||
const tableList = ref([])
|
const tableList = ref([])
|
||||||
|
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 = () => {
|
const getTableList = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
"id":id.value,
|
id: id.value,
|
||||||
"taskId":taskId.value,
|
taskId: taskId.value,
|
||||||
"statusList":statusList.value,
|
statusList: statusList.value,
|
||||||
"taskStage":2,
|
taskStage: 2,
|
||||||
"keyWord":searchValue.value
|
keyWord: searchValue.value,
|
||||||
}
|
}
|
||||||
console.log(obj)
|
console.log(obj)
|
||||||
getPurchaseInfo(obj).then(res => {
|
getPurchaseInfo(obj)
|
||||||
|
.then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
tableList.value = res.data.purchaseCheckDetailsList;
|
tableList.value = res.data.purchaseCheckDetailsList
|
||||||
|
if (tableList.value.length > 0) {
|
||||||
|
tableList.value.forEach((item) => {
|
||||||
|
item.isChecked = false
|
||||||
|
})
|
||||||
|
}
|
||||||
console.log(tableList.value)
|
console.log(tableList.value)
|
||||||
}).catch(error => {
|
})
|
||||||
|
.catch((error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -83,7 +145,9 @@ const search = () => {
|
||||||
const handleItem = (item) => {
|
const handleItem = (item) => {
|
||||||
console.log('🚀 ~ handleItem ~ item:', item)
|
console.log('🚀 ~ handleItem ~ item:', item)
|
||||||
if (item.status == 2) {
|
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 {
|
} else {
|
||||||
// 提示已验收
|
// 提示已验收
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -92,6 +156,64 @@ const handleItem = (item) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 多选框选中
|
||||||
|
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) => {
|
onLoad((options) => {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
|
|
@ -105,7 +227,7 @@ onShow(()=>{
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.accept {
|
.accept {
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
background-color: #f7f8fa;
|
background-color: #f7f8fa;
|
||||||
padding: 24rpx;
|
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 {
|
.table-list-item {
|
||||||
margin: 24rpx 0;
|
margin: 24rpx 0;
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
|
|
@ -177,6 +322,8 @@ onShow(()=>{
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #3784fb;
|
color: #3784fb;
|
||||||
letter-spacing: 1rpx;
|
letter-spacing: 1rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
span:last-child {
|
span:last-child {
|
||||||
|
|
@ -200,7 +347,8 @@ onShow(()=>{
|
||||||
.line {
|
.line {
|
||||||
margin: 24rpx 0;
|
margin: 24rpx 0;
|
||||||
height: 2rpx;
|
height: 2rpx;
|
||||||
background: linear-gradient(90deg,
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
rgba(232, 232, 232, 0) 0%,
|
rgba(232, 232, 232, 0) 0%,
|
||||||
rgba(232, 232, 232, 1) 50%,
|
rgba(232, 232, 232, 1) 50%,
|
||||||
rgba(232, 232, 232, 0) 100%
|
rgba(232, 232, 232, 0) 100%
|
||||||
|
|
@ -226,4 +374,11 @@ onShow(()=>{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.loading-text {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #8c8c8c;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,10 @@ const pass = () => {
|
||||||
}
|
}
|
||||||
//不合格
|
//不合格
|
||||||
const reject = () => {
|
const reject = () => {
|
||||||
|
if (bmFileInfos.value.length == 0) {
|
||||||
|
uni.showToast({ title: '请上传图片', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
"taskId":formData.value.taskId,
|
"taskId":formData.value.taskId,
|
||||||
"typeId":formData.value.typeId,
|
"typeId":formData.value.typeId,
|
||||||
|
|
@ -114,20 +118,20 @@ const reject = () => {
|
||||||
verifyPass:false
|
verifyPass:false
|
||||||
}
|
}
|
||||||
console.log(param)
|
console.log(param)
|
||||||
innerVerify(param).then(res => {
|
// innerVerify(param).then(res => {
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
if(res.code==200){
|
// if(res.code==200){
|
||||||
uni.showToast({ title: '操作成功', icon: 'none' })
|
// uni.showToast({ title: '操作成功', icon: 'none' })
|
||||||
uni.navigateBack({
|
// uni.navigateBack({
|
||||||
delta: 1 // 返回到已存在的页面
|
// delta: 1 // 返回到已存在的页面
|
||||||
});
|
// });
|
||||||
}else{
|
// }else{
|
||||||
uni.showToast({ title: res.msg, icon: 'none' })
|
// uni.showToast({ title: res.msg, icon: 'none' })
|
||||||
}
|
// }
|
||||||
|
|
||||||
}).catch(error => {
|
// }).catch(error => {
|
||||||
console.log(error)
|
// console.log(error)
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
//上传
|
//上传
|
||||||
|
|
@ -228,7 +232,7 @@ onLoad((options)=>{
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
// 取消按钮淡蓝色
|
// 取消按钮淡蓝色
|
||||||
&:first-child {
|
&:first-child {
|
||||||
background-color: #aacefb;
|
background-color: #F56C6C;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue