新购配件
This commit is contained in:
parent
02afa160c8
commit
440b8e2d6b
|
|
@ -268,6 +268,30 @@
|
|||
"navigationBarTitleText": "配件领用详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/part/parts-accept/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "配件新购验收"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/part/parts-accept/acceptDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "配件新购验收"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/part/entry/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "配件新购入库"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/part/entry/inEntry",
|
||||
"style": {
|
||||
"navigationBarTitleText": "配件新购入库"
|
||||
}
|
||||
},
|
||||
|
||||
/* 维修及其页面 */
|
||||
// 1. 维修列表
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
<uni-col :span="24">
|
||||
<view>
|
||||
<uni-datetime-picker
|
||||
v-model="dateArray"
|
||||
type="daterange"
|
||||
@maskClick="maskClick"
|
||||
@change="onChangeDate"
|
||||
|
|
@ -183,7 +182,7 @@ const handleItem = (item) => {
|
|||
const isFinished = item.taskStatusName == '已完成'
|
||||
const singLevel = {
|
||||
2: '技术科',
|
||||
3: '库管班',
|
||||
3: '库管',
|
||||
}
|
||||
const deptName = uni.getStorageSync('deptName')
|
||||
if (!deptName.includes(singLevel[item.signLevel]) && !isFinished) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,337 @@
|
|||
<template>
|
||||
<!-- 领料入库详情 -->
|
||||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form" v-if="isDetail">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="keyWord" maxlength="10" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="search" @click="getTableList">查询</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<view
|
||||
v-for="(item, index) in detailsList"
|
||||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onCodingItem(item)"
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">新购入库</span>
|
||||
</div>
|
||||
<view class="line"></view>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">物资名称:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.maTypeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">规格型号:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.partName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">采购数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.purchaseNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">已入库数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.inputNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">待入库数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.purchaseNum - item.inputNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">状态:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
v-if="item.status == 4"
|
||||
text="未完成"
|
||||
type="warning"
|
||||
size="small"
|
||||
/>
|
||||
<uni-tag v-else text="已完成" type="success" size="small" />
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { getPartArrivedInfoApi, partTypeWarehouseApi } from '@/services/partLease.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const id = ref('')
|
||||
const taskId = ref('')
|
||||
const keyWord = ref('')
|
||||
const isDetail = ref(false)
|
||||
|
||||
// 获取列表详情
|
||||
const getTableList = async () => {
|
||||
let obj = {
|
||||
id: id.value,
|
||||
taskId: taskId.value,
|
||||
keyWWord: keyWord.value,
|
||||
}
|
||||
const { data: res } = await getPartArrivedInfoApi(obj)
|
||||
detailsList.value = res.partTypeCheckDetailsList
|
||||
}
|
||||
|
||||
// 点击入库
|
||||
const onCodingItem = (item) => {
|
||||
console.log('item----------', item)
|
||||
|
||||
if (item.status != 4) {
|
||||
uni.showToast({ title: '该设备已完成入库!', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认入库?',
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const res = await partTypeWarehouseApi({
|
||||
taskId: taskId.value,
|
||||
id: item.id,
|
||||
partId: item.partId,
|
||||
purchaseNum: item.purchaseNum,
|
||||
})
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '入库成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
getTableList()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad((options) => {
|
||||
console.log('🚀 ~ onLoad ~ options:', options)
|
||||
id.value = options.id
|
||||
taskId.value = options.taskId
|
||||
isDetail.value = options.isDetail == 'true' ? true : false
|
||||
})
|
||||
onShow(() => {
|
||||
setTimeout(() => {
|
||||
getTableList()
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
flex-direction: column;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
padding-bottom: 120rpx; // 为底部按钮留出空间
|
||||
|
||||
.table-list-item {
|
||||
margin: 24rpx 0;
|
||||
padding: 32rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.985);
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
span {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #007aff;
|
||||
letter-spacing: 1rpx;
|
||||
background: linear-gradient(90deg, #007aff, #4b8eff);
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 24rpx 0;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(232, 232, 232, 0) 0%,
|
||||
rgba(232, 232, 232, 1) 50%,
|
||||
rgba(232, 232, 232, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
:deep(.uni-row) {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.uni-col-7 {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.uni-col-16 {
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.8;
|
||||
color: #262626;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.uni-tag) {
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&[type='warning'] {
|
||||
background-color: rgba(250, 140, 22, 0.1);
|
||||
color: #fa8c16;
|
||||
}
|
||||
|
||||
&[type='success'] {
|
||||
background-color: rgba(82, 196, 26, 0.1);
|
||||
color: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 输入框样式
|
||||
.input-area {
|
||||
margin-top: 24rpx;
|
||||
|
||||
:deep(.uni-easyinput__content) {
|
||||
background-color: #f7f8fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 底部按钮
|
||||
.submit-btn {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 90%;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: translateX(-50%) scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background: #e8e8e8;
|
||||
color: #999;
|
||||
box-shadow: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #8c8c8c;
|
||||
padding: 32rpx 0;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
:deep(.uni-easyinput__content) {
|
||||
width: 100%; // 确保输入框占满容器宽度
|
||||
background-color: #f7f8fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 100%; // 确保按钮占满容器宽度
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: translateY(2rpx);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,617 @@
|
|||
<template>
|
||||
<!-- 新购入库 -->
|
||||
<view class="page-container">
|
||||
<view class="complete-btn">
|
||||
<view class="btn" @click="changeTab(1)">
|
||||
<span>未完成</span>
|
||||
<div v-if="active == 1" class="bt-line"></div>
|
||||
</view>
|
||||
<view class="btn" style="margin-left: 120rpx" @click="changeTab(2)">
|
||||
<span>已完成</span>
|
||||
<div v-if="active == 2" class="bt-line"></div>
|
||||
</view>
|
||||
</view>
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="24">
|
||||
<view>
|
||||
<uni-datetime-picker
|
||||
v-model="dateArray"
|
||||
type="daterange"
|
||||
@maskClick="maskClick"
|
||||
@change="onChangeDate"
|
||||
placeholder="选择日期范围"
|
||||
/>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="search" @click="getTableList(true)">搜索</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<div class="table-list-item" v-for="(item, index) in tableList" :key="index">
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
:right-options="
|
||||
item.taskStatusName == '已完成' ? swipeOptions : swipeOptionsFail
|
||||
"
|
||||
@click="onClick($event, item)"
|
||||
@change="onSwipeChange"
|
||||
>
|
||||
<div class="content-wrapper">
|
||||
<div class="title">
|
||||
<span class="code">{{ item.code }}</span>
|
||||
<span
|
||||
:class="[
|
||||
'status',
|
||||
item.taskStatusName == '已完成' ? 'completed' : 'pending',
|
||||
]"
|
||||
>
|
||||
{{ item.taskStatusName }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">到货时间:</uni-col>
|
||||
<uni-col :span="17"
|
||||
><div class="cont">{{ item.arrivalTime }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">采购物资:</uni-col>
|
||||
<uni-col :span="17"
|
||||
><div class="cont">{{ item.purchaseMaTypeName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7">验收数量:</uni-col>
|
||||
<uni-col :span="17"
|
||||
><div class="cont">{{ item.checkMaNumber }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<div class="storage-info">
|
||||
<div class="storage-item">
|
||||
<span class="label">已入库:</span>
|
||||
<span class="value">{{ item.inputMaNumber || 0 }}</span>
|
||||
</div>
|
||||
<div class="storage-item">
|
||||
<span class="label">待入库:</span>
|
||||
<span class="value">{{ item.purchaseMaNumber || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</div>
|
||||
<view class="loading-text">
|
||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { getPurchaseList } from '@/services/purchase.js'
|
||||
import { getPartArrivedListApi } from '@/services/partLease.js'
|
||||
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
const dateArray = ref([]) // 日期范围
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
keyWord: '', // 关键字
|
||||
taskStage: 3, // 入库
|
||||
isFinish: '0', // 未完成
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskStatus: 0,
|
||||
})
|
||||
|
||||
// 日期 change 事件
|
||||
const onChangeDate = (val) => {
|
||||
const [val_1, val_2] = val
|
||||
queryParams.value.startTime = val_1
|
||||
queryParams.value.endTime = val_2
|
||||
}
|
||||
|
||||
//点击事件
|
||||
const onClick = (e, item) => {
|
||||
console.log('🚀 ~ onClick ~ item:', item)
|
||||
if (item.taskStatus == 22) {
|
||||
if (e.index == 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/part/entry/inEntry?id=${item.id}&taskId=${item.taskId}&isDetail=true`,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (e.index == 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/part/entry/inEntry?id=${item.id}&taskId=${item.taskId}&isDetail=true`,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/part/entry/inEntry?id=${item.id}&taskId=${item.taskId}&isDetail=false`,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//左滑选择项1
|
||||
const swipeOptions = ref([
|
||||
{
|
||||
text: '查看',
|
||||
style: { backgroundColor: '#34C759' },
|
||||
onClick: () => {
|
||||
handleAction('查看')
|
||||
},
|
||||
},
|
||||
// {
|
||||
// text: '驳回',
|
||||
// style: { backgroundColor: '#dd524d' },
|
||||
// onClick: () => { handleAction('驳回'); }
|
||||
// }
|
||||
])
|
||||
|
||||
//左滑选择项2
|
||||
const swipeOptionsFail = ref([
|
||||
{
|
||||
text: '查看',
|
||||
style: { backgroundColor: '#34C759' },
|
||||
},
|
||||
{
|
||||
text: '入库',
|
||||
style: { backgroundColor: '#007AFF' },
|
||||
},
|
||||
// {
|
||||
// text: '驳回',
|
||||
// style: { backgroundColor: '#dd524d' },
|
||||
// }
|
||||
])
|
||||
|
||||
//左滑改变
|
||||
const onSwipeChange = (e) => {
|
||||
console.log('Swipe Changed', e)
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
const getTableList = async (isTap = false) => {
|
||||
try {
|
||||
console.log('queryParams.value查询参数', queryParams.value)
|
||||
const { data: res } = await getPartArrivedListApi(queryParams.value)
|
||||
console.log('res列表数据', res)
|
||||
|
||||
// 更新总数
|
||||
total.value = res.total
|
||||
|
||||
// 处理数据
|
||||
if (isTap) {
|
||||
// 点击搜索时,直接替换数据
|
||||
tableList.value = res.rows || []
|
||||
// 重置页码
|
||||
queryParams.value.pageNum = 1
|
||||
} else {
|
||||
// 下拉加载时,追加数据
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
// 使用展开运算符安全地合并数组
|
||||
tableList.value = [...tableList.value, ...res.rows]
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表数据失败:', error)
|
||||
// 发生错误时重置数据
|
||||
if (isTap) {
|
||||
tableList.value = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('下一页')
|
||||
// 判断是否还有更多数据
|
||||
if (tableList.value.length < total.value) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList(false)
|
||||
}
|
||||
}, 500)
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
// 重置查询参数
|
||||
queryParams.value.pageNum = 1
|
||||
queryParams.value.keyWord = ''
|
||||
queryParams.value.startTime = ''
|
||||
queryParams.value.endTime = ''
|
||||
dateArray.value = [] // 清空日期选择
|
||||
|
||||
if (index == 1) {
|
||||
queryParams.value.isFinish = '0' // 查未完成的
|
||||
queryParams.value.taskStatus = 0
|
||||
} else if (index == 2) {
|
||||
queryParams.value.isFinish = '1' // 查已完成的
|
||||
queryParams.value.taskStatus = 1
|
||||
}
|
||||
|
||||
// 重置列表数据
|
||||
tableList.value = []
|
||||
// 重新获取数据
|
||||
getTableList(true)
|
||||
}
|
||||
const maskClick = () => {}
|
||||
|
||||
// // 页面加载完毕
|
||||
// onLoad(() => {
|
||||
// getTableList()
|
||||
// })
|
||||
|
||||
onShow(() => {
|
||||
tableList.value = []
|
||||
getTableList(true)
|
||||
})
|
||||
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
console.log('total.value', total.value)
|
||||
console.log('tableList.value.length', tableList.value.length)
|
||||
if (total.value === tableList.value.length) return true
|
||||
else return false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
flex-direction: column;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
|
||||
.complete-btn {
|
||||
display: flex;
|
||||
padding: 20rpx 24rpx;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 60rpx;
|
||||
position: relative;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
span {
|
||||
font-size: 32rpx;
|
||||
color: #8c8c8c;
|
||||
font-weight: 500;
|
||||
|
||||
&.active {
|
||||
color: #3784fb;
|
||||
font-weight: 600;
|
||||
|
||||
.second-active & {
|
||||
color: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bt-line {
|
||||
width: 32rpx;
|
||||
height: 6rpx;
|
||||
background: #3784fb;
|
||||
margin-top: 12rpx;
|
||||
border-radius: 6rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
.second-active & {
|
||||
background: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
:deep(.uni-easyinput__content),
|
||||
:deep(.uni-date-editor) {
|
||||
background-color: #f7f8fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
:deep(.uni-date) {
|
||||
width: 100%;
|
||||
|
||||
.uni-date-x {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-editor--x {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-range--x {
|
||||
width: 100%;
|
||||
|
||||
.uni-date-range--x-input {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.uni-date-range--x-text {
|
||||
font-size: 28rpx;
|
||||
color: #262626;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uni-date-x--border {
|
||||
width: 100%;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
background-color: #f7f8fa;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.uni-date-editor) {
|
||||
width: 100%;
|
||||
|
||||
.uni-date {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-x {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.uni-date-range--text {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.uni-date-range--delimeter {
|
||||
padding: 0 20rpx;
|
||||
color: #8c8c8c;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-date-x--border {
|
||||
width: 100%;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
background-color: #f7f8fa;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: translateY(2rpx);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
padding: 0 2rpx;
|
||||
|
||||
.table-list-item {
|
||||
margin: 24rpx 0;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
overflow: hidden;
|
||||
|
||||
.content-wrapper {
|
||||
padding: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.code {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #007aff;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
span.status {
|
||||
padding: 8rpx 28rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.completed {
|
||||
background-color: rgba(82, 196, 26, 0.1);
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
&.pending {
|
||||
background-color: rgba(250, 140, 22, 0.1);
|
||||
color: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 24rpx 0;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(232, 232, 232, 0) 0%,
|
||||
rgba(232, 232, 232, 1) 50%,
|
||||
rgba(232, 232, 232, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
:deep(.uni-row) {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.uni-col-6 {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.8;
|
||||
color: #262626;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.storage-info {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 32rpx;
|
||||
margin-top: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 2rpx solid #f5f5f5;
|
||||
|
||||
.storage-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.label {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #262626;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 优化左滑区域样式
|
||||
:deep(.uni-swipe_action) {
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.uni-swipe_content {
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.uni-swipe_button-group {
|
||||
height: 100%;
|
||||
|
||||
.uni-swipe_button {
|
||||
height: 100%;
|
||||
padding: 0 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
border: none;
|
||||
|
||||
// 查看按钮
|
||||
&:nth-child(1) {
|
||||
background: linear-gradient(to bottom, #3ad980, #34c759);
|
||||
}
|
||||
|
||||
// 入库按钮
|
||||
&:nth-child(2) {
|
||||
background: linear-gradient(to bottom, #3b95ff, #007aff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #8c8c8c;
|
||||
padding: 32rpx 0;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,421 @@
|
|||
<template>
|
||||
<!-- 新购验收详情 -->
|
||||
<view class="accept page-common">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<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>
|
||||
<uni-row :gutter="24" class="sect-form">
|
||||
<uni-section title="审核记录" type="line" padding>
|
||||
<uni-steps :options="auditingList" :active="activeSect" />
|
||||
</uni-section>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" class="check-form" v-if="!isFinished">
|
||||
<!-- <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(true)">合格</button>
|
||||
</div>
|
||||
<div>
|
||||
<button type="warn" size="mini" @click="handleAllSubmit(false)">不合格</button>
|
||||
</div>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<div
|
||||
class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
>
|
||||
<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.partName }}</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.inputNum }}</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.checkResult }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
</div>
|
||||
<div class="loading-text">
|
||||
{{ '没有更多数据了~' }}
|
||||
</div>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { getSignListApi } from '@/services/purchase.js'
|
||||
import { getPartArrivedInfoApi, innerVerify } from '@/services/partLease.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const searchValue = ref('')
|
||||
const id = ref('')
|
||||
const taskId = ref('')
|
||||
const isFinished = ref(false)
|
||||
const statusList = ref(['2', '12'])
|
||||
const tableList = ref([])
|
||||
const allChecked = ref(false)
|
||||
const auditingList = ref([
|
||||
{ title: '供应科审核', desc: '' },
|
||||
{ title: '技术科审核' },
|
||||
{ title: '库管班审核' },
|
||||
])
|
||||
const activeSect = ref(0)
|
||||
const checkedCount = computed(
|
||||
() => tableList.value.filter((item) => item.status == 2 && item.isChecked).length,
|
||||
)
|
||||
|
||||
const getSignList = async () => {
|
||||
try {
|
||||
const res = await getSignListApi({ taskId: taskId.value })
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
auditingList.value = res.data.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
title: item.deptName + '审核',
|
||||
desc: item.auditStatusName + '\n' + (index == 0 ? '姚士超' : item.userName || '') + '\n' + item.createTime + '\n' + (item.auditRemark || '')
|
||||
}
|
||||
})
|
||||
activeSect.value = auditingList.value.length - 1
|
||||
const auditSteps = [
|
||||
{ title: '技术科审核', desc: '待审核' },
|
||||
{ title: '库管班审核', desc: '待审核' }
|
||||
]
|
||||
if (auditingList.value.length === 1) {
|
||||
auditingList.value.push(...auditSteps)
|
||||
} else if (auditingList.value.length === 2) {
|
||||
auditingList.value.push(auditSteps[1])
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getSignList ~ error:', error)
|
||||
}
|
||||
}
|
||||
const getTableList = () => {
|
||||
let obj = {
|
||||
id: id.value,
|
||||
taskId: taskId.value,
|
||||
// statusList: statusList.value,
|
||||
// taskStage: 2,
|
||||
keyWord: searchValue.value,
|
||||
}
|
||||
console.log(obj)
|
||||
getPartArrivedInfoApi(obj)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
tableList.value = res.data.partTypeCheckDetailsList
|
||||
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()
|
||||
}
|
||||
const handleItem = (item) => {
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
if (item.status == 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/new-purchase/accept/conclusion?item=${JSON.stringify(item)}`,
|
||||
})
|
||||
} else {
|
||||
// 提示已验收
|
||||
uni.showToast({
|
||||
title: '已完成验收',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
}
|
||||
// 多选框选中
|
||||
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 = (bool) => {
|
||||
console.log('🚀 ~ handleAllSubmit ~ bool:', bool)
|
||||
const connect = bool ? '确定合格吗?' : '确定不合格吗?'
|
||||
// 弹框确定
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: connect,
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
// 获取选中的行数据
|
||||
// const checkedRows = tableList.value.filter(item => item.isChecked)
|
||||
// console.log('🚀 ~ success: ~ checkedRows:', checkedRows)
|
||||
const purchaseCheckDetailsList = tableList.value.map(item => {
|
||||
return {
|
||||
taskId: item.taskId,
|
||||
typeId: item.typeId,
|
||||
status: bool ? '3' : '1',
|
||||
checkResult: bool ? '合格' : '不合格',
|
||||
manageType: item.manageType
|
||||
}
|
||||
})
|
||||
const param = {
|
||||
purchaseCheckDetailsList,
|
||||
verifyPass: bool
|
||||
}
|
||||
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()
|
||||
// 返回
|
||||
uni.navigateBack()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ success: ~ error:', error)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
onLoad((options) => {
|
||||
console.log(options)
|
||||
id.value = options.id
|
||||
taskId.value = options.taskId
|
||||
isFinished.value = options.isFinished ? JSON.parse(options.isFinished) : false
|
||||
getTableList()
|
||||
getSignList()
|
||||
})
|
||||
onShow(() => {
|
||||
getTableList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.accept {
|
||||
height: 100vh;
|
||||
word-break: break-all;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
overflow-y: auto;
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
:deep(.uni-easyinput__content) {
|
||||
background-color: #f7f8fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: translateY(2rpx);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.985);
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
span:first-child {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #3784fb;
|
||||
letter-spacing: 1rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
span:last-child {
|
||||
padding: 8rpx 28rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.completed {
|
||||
background-color: rgba(55, 132, 251, 0.1);
|
||||
color: #3784fb;
|
||||
}
|
||||
|
||||
&.pending {
|
||||
background-color: rgba(250, 140, 22, 0.1);
|
||||
color: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 24rpx 0;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(232, 232, 232, 0) 0%,
|
||||
rgba(232, 232, 232, 1) 50%,
|
||||
rgba(232, 232, 232, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
:deep(.uni-row) {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.uni-col-6 {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.8;
|
||||
color: #262626;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #8c8c8c;
|
||||
padding: 32rpx 0;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,440 @@
|
|||
<template>
|
||||
<!-- 新购验收 -->
|
||||
<view class="accept page-common">
|
||||
<view class="complete-btn">
|
||||
<view class="btn first-active" @click="changeTab(1)">
|
||||
<span :class="{ active: active == 1 }">未完成</span>
|
||||
<div v-if="active == 1" class="bt-line"></div>
|
||||
</view>
|
||||
<view class="btn second-active" style="margin-left: 120rpx" @click="changeTab(2)">
|
||||
<span :class="{ active: active == 2 }">已完成</span>
|
||||
<div v-if="active == 2" class="bt-line"></div>
|
||||
</view>
|
||||
</view>
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="24">
|
||||
<view>
|
||||
<uni-datetime-picker
|
||||
type="daterange"
|
||||
@maskClick="maskClick"
|
||||
@change="onChangeDate"
|
||||
placeholder="选择日期范围"
|
||||
/>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="search" @click="getTableList(true)">搜索</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<div
|
||||
class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="handleItem(item)"
|
||||
>
|
||||
<div class="title">
|
||||
<div class="title-left">
|
||||
<span class="code">{{ item.code }}</span>
|
||||
</div>
|
||||
<span :class="['status', active == 1 ? 'pending' : 'completed']">
|
||||
{{ active == 1 ? '未完成' : '已完成' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货时间:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.arrivalTime }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">采购物资:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.purchaseMaTypeName }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.purchaseMaNumber }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">验收数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.checkMaNumber }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</div>
|
||||
<div class="loading-text">
|
||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||
</div>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { getPartArrivedListApi } from '@/services/partLease.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
const active = ref(1)
|
||||
const tableList = ref([])
|
||||
const total = ref(0) //数据总量
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
keyWord: '', // 关键字
|
||||
taskStage: 2, // 验收
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskStatus: 0,
|
||||
})
|
||||
// 获列表数据
|
||||
const getTableList = async (isTap = false) => {
|
||||
console.log(queryParams.value)
|
||||
try {
|
||||
const { data: res } = await getPartArrivedListApi(queryParams.value)
|
||||
console.log('res列表数据', res)
|
||||
// 更新总数
|
||||
total.value = res.total
|
||||
// 处理数据
|
||||
if (isTap) {
|
||||
// 点击搜索时,直接替换数据
|
||||
tableList.value = res.rows || []
|
||||
// 重置页码
|
||||
queryParams.value.pageNum = 1
|
||||
} else {
|
||||
// 下拉加载时,追加数据
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
tableList.value = [...tableList.value, ...res.rows]
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表数据失败:', error)
|
||||
// 发生错误时重置数据
|
||||
if (isTap) {
|
||||
tableList.value = []
|
||||
}
|
||||
}
|
||||
}
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('触底事件')
|
||||
// 判断是否还有更多数据
|
||||
if (tableList.value.length < total.value) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList(false)
|
||||
}
|
||||
}, 500)
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
if (total.value === tableList.value.length) return true
|
||||
})
|
||||
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
// 重置查询参数
|
||||
queryParams.value.pageNum = 1
|
||||
queryParams.value.keyWord = ''
|
||||
queryParams.value.startTime = ''
|
||||
queryParams.value.endTime = ''
|
||||
|
||||
if (index == 1) {
|
||||
queryParams.value.taskStatus = '0'
|
||||
}
|
||||
if (index == 2) {
|
||||
queryParams.value.taskStatus = '1'
|
||||
}
|
||||
// 重置列表数据
|
||||
tableList.value = []
|
||||
// 重新获取数据
|
||||
getTableList(true)
|
||||
}
|
||||
// 日期 change 事件
|
||||
const onChangeDate = (val) => {
|
||||
const [val_1, val_2] = val
|
||||
queryParams.value.startTime = val_1
|
||||
queryParams.value.endTime = val_2
|
||||
}
|
||||
//日期选择
|
||||
const maskClick = () => {}
|
||||
const handleItem = (item) => {
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
// 是否完成
|
||||
const isFinished = item.taskStatusName == '已完成'
|
||||
const singLevel = {
|
||||
2: '技术科',
|
||||
3: '库管',
|
||||
}
|
||||
const deptName = uni.getStorageSync('deptName')
|
||||
if (!deptName.includes(singLevel[item.signLevel]) && !isFinished) {
|
||||
uni.showToast({
|
||||
title: `请联系${singLevel[item.signLevel]}进行审核`,
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/part/parts-accept/acceptDetails?id=${item.id}&taskId=${item.taskId}&isFinished=${isFinished}`,
|
||||
})
|
||||
}
|
||||
onShow((options) => {
|
||||
setTimeout(() => {
|
||||
getTableList(true)
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.accept {
|
||||
height: 100vh;
|
||||
word-break: break-all;
|
||||
background-color: #f7f8fa;
|
||||
padding: 24rpx;
|
||||
|
||||
.complete-btn {
|
||||
display: flex;
|
||||
padding: 20rpx 24rpx;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 60rpx;
|
||||
position: relative;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
span {
|
||||
font-size: 32rpx;
|
||||
color: #8c8c8c;
|
||||
font-weight: 500;
|
||||
|
||||
&.active {
|
||||
color: #3784fb;
|
||||
font-weight: 600;
|
||||
|
||||
.second-active & {
|
||||
color: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bt-line {
|
||||
width: 32rpx;
|
||||
height: 6rpx;
|
||||
background: #3784fb;
|
||||
margin-top: 12rpx;
|
||||
border-radius: 6rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
.second-active & {
|
||||
background: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
:deep(.uni-easyinput__content),
|
||||
:deep(.uni-date-editor) {
|
||||
background-color: #f7f8fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
:deep(.uni-date) {
|
||||
width: 100%;
|
||||
|
||||
.uni-date-x {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-editor--x {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uni-date-range--x {
|
||||
width: 100%;
|
||||
|
||||
.uni-date-range--x-input {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.uni-date-range--x-text {
|
||||
font-size: 28rpx;
|
||||
color: #262626;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uni-date-x--border {
|
||||
width: 100%;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
background-color: #f7f8fa;
|
||||
height: 80rpx;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #3784fb;
|
||||
box-shadow: 0 0 0 2rpx rgba(55, 132, 251, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.uni-date-editor) {
|
||||
.uni-date-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.uni-date-range--text {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 80rpx;
|
||||
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: translateY(2rpx);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
padding: 0 2rpx;
|
||||
|
||||
.table-list-item {
|
||||
margin: 24rpx 0;
|
||||
padding: 32rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.985);
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.title-left {
|
||||
.code {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #3784fb;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
}
|
||||
|
||||
span.status {
|
||||
padding: 8rpx 28rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.completed {
|
||||
background-color: rgba(82, 196, 26, 0.1);
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
&.pending {
|
||||
background-color: rgba(250, 140, 22, 0.1);
|
||||
color: #fa8c16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 24rpx 0;
|
||||
height: 2rpx;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(232, 232, 232, 0) 0%,
|
||||
rgba(232, 232, 232, 1) 50%,
|
||||
rgba(232, 232, 232, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
:deep(.uni-row) {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.uni-col-6 {
|
||||
color: #8c8c8c;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.8;
|
||||
color: #262626;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #8c8c8c;
|
||||
padding: 32rpx 0;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -179,11 +179,11 @@ const getOutboundDetailsData = async () => {
|
|||
if(taskStatus.value==3){
|
||||
options.value = [
|
||||
{ text: '出库',style: {backgroundColor: '#84c649',color: '#fff',fontSize: '28rpx'} },
|
||||
{ text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'} },
|
||||
// { text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'} },
|
||||
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'} }
|
||||
];
|
||||
options2.value = [
|
||||
{ text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'}},
|
||||
// { text: '退回',style: {backgroundColor: '#ed6042',color: '#fff',fontSize: '28rpx'}},
|
||||
{ text: '查看',style: {backgroundColor: '#3784fb',color: '#fff',fontSize: '28rpx'}}
|
||||
]
|
||||
}else if(taskStatus.value==4){
|
||||
|
|
|
|||
|
|
@ -216,9 +216,14 @@ const partList = ref([
|
|||
url: '/pages/part/part-lease/index',
|
||||
iconSrc: '../../static/workbench/partIn.png',
|
||||
},
|
||||
{
|
||||
title: '配件新购验收',
|
||||
url: '/pages/part/parts-accept/index',
|
||||
iconSrc: '../../static/workbench/partIn.png',
|
||||
},
|
||||
{
|
||||
title: '配件新购入库',
|
||||
url: '',
|
||||
url: '/pages/part/entry/index',
|
||||
iconSrc: '../../static/workbench/partIn.png',
|
||||
},
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -45,15 +45,41 @@ export const getPartLeaseByTaskIdApi = (data) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 新购配件验收-列表
|
||||
export const getPartArrivedListApi = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/part_arrived/list',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 新购配件验收-详情
|
||||
export const getPartArrivedInfoApi = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/part_arrived/getInfo',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 新购配件验收-验收
|
||||
export const innerVerify = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/part_check/innerVerify',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 新购配件入库-入库
|
||||
export const partTypeWarehouseApi = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/part_accept/partTypeWarehouse',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue