2024-11-20 14:24:17 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 新购验收详情 -->
|
|
|
|
|
|
<view class="accept page-common">
|
|
|
|
|
|
<uni-row :gutter="24" class="search-form">
|
|
|
|
|
|
<uni-col :span="12">
|
|
|
|
|
|
<view><uni-easyinput placeholder="请输入内容" v-model="searchValue"/></view>
|
|
|
|
|
|
</uni-col>
|
|
|
|
|
|
<uni-col :span="4">
|
|
|
|
|
|
<view class="search" @click="getTableList()">查询</view>
|
|
|
|
|
|
</uni-col>
|
|
|
|
|
|
<uni-col :span="4">
|
2024-11-21 09:22:25 +08:00
|
|
|
|
<view class="addBtn" @click="goCode">编码退料</view>
|
2024-11-20 14:24:17 +08:00
|
|
|
|
</uni-col>
|
|
|
|
|
|
<uni-col :span="4">
|
2024-11-21 09:22:25 +08:00
|
|
|
|
<view class="addBtn" @click="goNum">数量退料</view>
|
2024-11-20 14:24:17 +08:00
|
|
|
|
</uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
<div class="table-list-item"
|
|
|
|
|
|
v-for="(item, index) in tableList"
|
|
|
|
|
|
:key="index" @click="handleItem(item)">
|
2024-11-22 09:40:01 +08:00
|
|
|
|
<uni-swipe-action>
|
|
|
|
|
|
<uni-swipe-action-item @click="onClick($event, item)" :right-options="item.manageType==1 ? options:options2">
|
|
|
|
|
|
<div class="title">
|
|
|
|
|
|
<span style="font-size: 15px; font-weight: 800">退料任务</span>
|
|
|
|
|
|
<!-- <span v-if="item.status == 2" style="color: #ff4d4f">未验收</span> -->
|
|
|
|
|
|
<!-- <span v-else-if="item.status != 2" style="color: #3784fb">已验收</span> -->
|
|
|
|
|
|
<!-- <span v-else-if="item.status == 12" style="color: #ff4d4f">不合格</span> -->
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="line"></div>
|
|
|
|
|
|
<uni-row :gutter="24">
|
|
|
|
|
|
<uni-col :span="8">物资名称:</uni-col>
|
|
|
|
|
|
<uni-col :span="16"><div class="cont">{{ item.typeName }}</div></uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
<uni-row :gutter="24">
|
|
|
|
|
|
<uni-col :span="8">规格型号:</uni-col>
|
|
|
|
|
|
<uni-col :span="16"><div class="cont">{{ item.typeModel }}</div></uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
<uni-row :gutter="24">
|
|
|
|
|
|
<uni-col :span="8">退料数量:</uni-col>
|
|
|
|
|
|
<uni-col :span="16"><div class="cont">{{ item.preNum }}</div></uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
<uni-row :gutter="24">
|
|
|
|
|
|
<uni-col :span="8">单位:</uni-col>
|
|
|
|
|
|
<uni-col :span="16"><div class="cont">{{ item.unitName }}</div></uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
<uni-row :gutter="24" v-if="item.status != 2">
|
|
|
|
|
|
<uni-col :span="8">管理模式:</uni-col>
|
|
|
|
|
|
<uni-col :span="16">
|
|
|
|
|
|
<div class="cont" v-if="item.manageType==0">编码管理</div>
|
|
|
|
|
|
<div class="cont" v-if="item.manageType==1">数量管理</div>
|
|
|
|
|
|
</uni-col>
|
|
|
|
|
|
</uni-row>
|
|
|
|
|
|
</uni-swipe-action-item>
|
|
|
|
|
|
</uni-swipe-action>
|
|
|
|
|
|
|
2024-11-20 14:24:17 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref, reactive } from 'vue'
|
2024-11-22 09:40:01 +08:00
|
|
|
|
import { getBackInfo,deleteNumType } from '../../services/back.js';
|
2024-11-20 14:24:17 +08:00
|
|
|
|
import { onLoad,onShow } from '@dcloudio/uni-app'
|
|
|
|
|
|
const searchValue = ref('')
|
|
|
|
|
|
const id = ref('')
|
|
|
|
|
|
const taskId = ref('')
|
|
|
|
|
|
const statusList = ref(["2","12"])
|
|
|
|
|
|
const tableList = ref([])
|
|
|
|
|
|
const taskInfo = ref({})
|
2024-11-22 09:40:01 +08:00
|
|
|
|
|
|
|
|
|
|
// 右滑按钮组
|
|
|
|
|
|
const options = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '查看',
|
|
|
|
|
|
style: {
|
|
|
|
|
|
backgroundColor: '#65a1ff',
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
fontSize: '30rpx',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '删除',
|
|
|
|
|
|
style: {
|
|
|
|
|
|
backgroundColor: '#ed6042',
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
fontSize: '30rpx',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
// 右滑按钮组
|
|
|
|
|
|
const options2 = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '查看',
|
|
|
|
|
|
style: {
|
|
|
|
|
|
backgroundColor: '#65a1ff',
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
fontSize: '30rpx',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
//详情数据
|
2024-11-20 14:24:17 +08:00
|
|
|
|
const getTableList = () => {
|
|
|
|
|
|
// let obj = {
|
|
|
|
|
|
// "id":id.value,
|
|
|
|
|
|
// // "taskId":taskId.value,
|
|
|
|
|
|
// // "statusList":statusList.value,
|
|
|
|
|
|
// }
|
|
|
|
|
|
// console.log(obj)
|
|
|
|
|
|
getBackInfo(id.value).then(res => {
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
taskInfo.value = res.data.backApplyInfo;
|
|
|
|
|
|
tableList.value = res.data.backApplyDetailsList;
|
|
|
|
|
|
console.log(taskInfo.value)
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
const search = () => {
|
|
|
|
|
|
console.log('🚀 ~ search ~ searchValue:', searchValue.value)
|
|
|
|
|
|
}
|
2024-11-22 09:40:01 +08:00
|
|
|
|
//查看
|
2024-11-20 14:24:17 +08:00
|
|
|
|
const handleItem = (item) => {
|
|
|
|
|
|
console.log('🚀 ~ handleItem ~ item:', item)
|
|
|
|
|
|
if (item.manageType == 0) {//编码管理
|
2024-11-21 09:22:25 +08:00
|
|
|
|
uni.navigateTo({ url: `/pages/back/backCodeDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
2024-11-20 14:24:17 +08:00
|
|
|
|
} else if(item.manageType == 1) {//数量管理
|
2024-11-21 09:22:25 +08:00
|
|
|
|
uni.navigateTo({ url: `/pages/back/backNumDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
2024-11-20 14:24:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-11-22 09:40:01 +08:00
|
|
|
|
//编码新增
|
2024-11-21 09:22:25 +08:00
|
|
|
|
const goCode = () => {
|
|
|
|
|
|
uni.navigateTo({ url: `/pages/back/backCode?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
|
|
|
|
|
}
|
2024-11-22 09:40:01 +08:00
|
|
|
|
//数量新增
|
2024-11-21 09:22:25 +08:00
|
|
|
|
const goNum = () => {
|
|
|
|
|
|
uni.navigateTo({ url: `/pages/back/backNum?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
|
|
|
|
|
}
|
2024-11-22 09:40:01 +08:00
|
|
|
|
const onClick = (e, item) => {
|
|
|
|
|
|
const { index } = e
|
|
|
|
|
|
// 1. 查看
|
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
|
if (item.manageType == 0) {//编码管理
|
|
|
|
|
|
uni.navigateTo({ url: `/pages/back/backCodeDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
|
|
|
|
|
} else if(item.manageType == 1) {//数量管理
|
|
|
|
|
|
uni.navigateTo({ url: `/pages/back/backNumDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 2. 删除
|
|
|
|
|
|
if (index === 1) {
|
|
|
|
|
|
let param = {
|
|
|
|
|
|
id:item.id,
|
|
|
|
|
|
parentId:item.parentId
|
|
|
|
|
|
}
|
|
|
|
|
|
deleteNumType(param).then(res => {
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
|
if(res.code==200){
|
|
|
|
|
|
uni.showToast({ title: '删除成功', icon: 'none' })
|
|
|
|
|
|
getTableList()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
uni.showToast({ title: '删除失败', icon: 'none' })
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-11-20 14:24:17 +08:00
|
|
|
|
onLoad((options)=>{
|
|
|
|
|
|
console.log(options)
|
|
|
|
|
|
id.value = options.id
|
|
|
|
|
|
taskId.value = options.taskId
|
|
|
|
|
|
getTableList()
|
|
|
|
|
|
})
|
|
|
|
|
|
onShow(()=>{
|
|
|
|
|
|
getTableList()
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.accept {
|
2024-11-21 09:22:25 +08:00
|
|
|
|
height: 95vh;
|
2024-11-20 14:24:17 +08:00
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
.complete-btn {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
.btn {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
}
|
|
|
|
|
|
.bt-line {
|
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
|
height: 4rpx;
|
|
|
|
|
|
background-color: #3784fb;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search-form {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
box-sizing: content-box;
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search {
|
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
|
background-color: #3784fb;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 60rpx;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.addBtn {
|
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
|
background-color: #3784fb;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 60rpx;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.table-list-item {
|
|
|
|
|
|
margin: 20rpx 0;
|
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
min-height: 300rpx;
|
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
|
.title {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.cont {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
line-height: 1.9;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line {
|
|
|
|
|
|
margin: 20rpx 0;
|
|
|
|
|
|
height: 1px;
|
|
|
|
|
|
background-color: #e8e8e8;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|