This commit is contained in:
jjLv 2024-11-21 10:15:21 +08:00
commit 436465640e
6 changed files with 588 additions and 105 deletions

View File

@ -65,6 +65,31 @@
"navigationBarTitleText": "新购入库"
}
},
//
{
"path": "pages/new-purchase/entry/details",
"style": {
"navigationBarTitleText": "新购入库详情"
}
},
//
{
"path": "pages/new-purchase/entry/inEntry",
"style": {
"navigationBarTitleText": "入库"
}
},
//
{
"path": "pages/new-purchase/entry/code-inbound",
"style": {
"navigationBarTitleText": "编码入库"
}
},
{
"path": "pages/new-purchase/accept/acceptDetails",
"style": {

View File

@ -0,0 +1,213 @@
<template>
<!-- 编码出库-->
<view class="page-container">
<!-- <view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="6">出库方式</uni-col>
<uni-col :span="6">
<view class="coding-btn">编码识别</view>
</uni-col>
<uni-col :span="6">
<view class="coding-btn">编码识别</view>
</uni-col>
<uni-col :span="6">
<view class="coding-btn">二维码识别</view>
</uni-col>
</uni-row>
</view> -->
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 85rpx">
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.id">
<uni-row :gutter="24">
<uni-col :span="7" >类型名称</uni-col>
<uni-col :span="13">
<view class="cont">{{ queryParams.maTypeName }}</view>
</uni-col>
<uni-col :span="4">
<checkbox-group @change="onChangeChecked(item)">
<label>
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="item.checked"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="7">规格型号</uni-col>
<uni-col :span="17">
<view class="cont">{{ queryParams.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="7">设备编码</uni-col>
<uni-col :span="17">
<view class="cont">{{ item.maCode }}</view>
</uni-col>
</uni-row>
</view>
</scroll-view>
<view class="outbound-btn" @tap="onHandleOutbound"> 入库 </view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { getMachineById,setInboundCodeAPI } from '@/services/purchase.js'
import { onBackPress,onLoad } from '@dcloudio/uni-app'
const codeDeviceList = ref([])
const total = ref(0)
const query = defineProps() //
const queryParams = JSON.parse(query.queryParams)
// const typeId = ref('')
// const taskId = ref('')
// const maTypeName = ref('')
// const typeName = ref('')
//
onLoad(() => {
// typeId.value = options.typeId
// taskId.value = options.taskId
// maTypeName.value = options.maTypeName
// typeName.value = options.typeName
getCodeDeviceListData()
// //
// uni.$on('onUpdate', () => {
// // console.log('')
// //
// getCodeDeviceListData()
// })
})
//
const getCodeDeviceListData = async () => {
console.log('queryParams',queryParams)
let obj = {
"typeId":queryParams.typeId,
"taskId":queryParams.taskId,
}
const res = await getMachineById(obj)
codeDeviceList.value.push(...res.data)
if (codeDeviceList.value.length > 0) {
codeDeviceList.value = codeDeviceList.value.map((e) => {
return { ...e, checked: false }
})
}
}
//
const onScrollTolower = () => {
console.log('滚动触底--')
}
//
const onChangeChecked = (item) => {
item.checked = !item.checked
}
//
const onHandleOutbound = async () => {
const isSelect = codeDeviceList.value.some((e) => e.checked === true)
if (!isSelect) {
uni.showToast({
title: '请勾选需要入库的设备',
icon: 'none',
})
return
}
//
const paramsList = []
codeDeviceList.value.map((e) => {
if (e.checked) {
paramsList.push({
maCode: e.maCode,
})
}
})
const res = await setInboundCodeAPI({taskId:queryParams.taskId, typeId:queryParams.typeId, purchaseId:queryParams.id, inPutList: paramsList })
if (res.code === 200) {
uni.showToast({
title: '入库成功!',
icon: 'none',
})
setTimeout(() => {
//
uni.navigateBack({
delta: 1,
success() {
uni.$emit('onUpdate')
},
})
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
background-color: #e8f5fb;
.table-list-item {
margin: 5rpx 0;
padding: 20rpx;
background-color: #fff;
border-radius: 10rpx;
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.coding-btn {
padding: 5rpx 0;
background-color: #409eff;
border-radius: 6rpx;
text-align: center;
color: #fff;
font-size: 14px;
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
.outbound-btn {
position: fixed;
bottom: 15rpx;
left: 15%;
width: 70%;
height: 65rpx;
line-height: 65rpx;
text-align: center;
background-color: #19be6b;
border-radius: 12rpx;
color: #fff;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<!-- 领料入库详情 -->
<!-- 领料入库未完成入库 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="12">
@ -17,7 +17,7 @@
v-for="(item, index) in detailsList"
:key="index"
class="table-list-item"
@tap="onCodingItem(item)"
>
<view class="line"></view>
<uni-row :gutter="24">
@ -36,30 +36,23 @@
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">预领数量</uni-col>
<uni-col :span="6">到货数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.preNum }}</view>
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">数量</uni-col>
<uni-col :span="6">入库数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.alNum }}</view>
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">数量</uni-col>
<uni-col :span="6">入库数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.preNum - item.alNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">单位</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.unitName }}</view>
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
@ -88,13 +81,13 @@
text="未完成"
type="warning"
size="small"
v-if="item.status == 0 || item.status == 1"
v-if="item.status == 4"
/>
<uni-tag
text="已完成"
type="success"
size="small"
v-if="item.status == 2"
v-if="item.status == 19"
/>
</uni-col>
</uni-row>
@ -106,86 +99,38 @@
<script setup>
import { ref, onUnmounted } from 'vue'
import { getOutboundDetailsAPI } from '@/services/picking/outbound.js'
import { getPurchaseDetailsList } from '@/services/purchase.js'
import { onLoad } from '@dcloudio/uni-app'
const detailsList = ref([])
const query = defineProps() //
const id = ref('')
const taskId = ref('')
//
const leaseApplyInfo = ref({
leaseUnit: '', //
leaseProject: '', //
maTypeName: '', //
typeName: '', //
unitName: '', //
storageNum: '', //
preNum: '', //
parentId: query.id, // id
id: '', // id
typeId: '', // typeId
manageType: '', // manageType
})
//
const getOutboundDetailsData = async () => {
console.log('query.id',query.id)
const { data: res } = await getOutboundDetailsAPI(query.id)
detailsList.value = res.leaseApplyDetailsList
leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject
const getTableList = async () => {
let obj = {
"id":id.value,
"taskId":taskId.value,
"statusList":[3,13,4,14,19],
}
const { data: res } = await getPurchaseDetailsList(obj)
detailsList.value = res.purchaseCheckDetailsList
// leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
// leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject
// console.log('', res)
}
//
const onCodingItem = (item) => {
//
const {
status,
manageType,
maTypeName,
typeName,
storageNum,
preNum,
alNum,
unitName,
id,
typeId,
} = item
leaseApplyInfo.value.maTypeName = maTypeName
leaseApplyInfo.value.typeName = typeName
leaseApplyInfo.value.unitName = unitName
leaseApplyInfo.value.storageNum = storageNum
leaseApplyInfo.value.preNum = preNum
leaseApplyInfo.value.alNum = alNum
leaseApplyInfo.value.id = id
leaseApplyInfo.value.typeId = typeId
leaseApplyInfo.value.manageType = manageType
if (status == 2) {
uni.showToast({ title: '该物资已完成出库!', icon: 'none' })
return
}
let codingUrl = ''
if (manageType === 0) {
codingUrl = '/pages/picking/outbound/code-outbound' //
}
if (manageType == 1) {
codingUrl = '/pages/picking/outbound/num-outbound' //
}
// leaseApplyInfo json
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
}
//
onLoad(() => {
getOutboundDetailsData()
onLoad((options) => {
id.value = options.id
taskId.value = options.taskId
getTableList()
//
uni.$on('onUpdate', () => {
// console.log('')
//
getOutboundDetailsData()
getTableList()
})
})

View File

@ -0,0 +1,261 @@
<template>
<!-- 领料入库详情 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="12">
<view>
<uni-easyinput placeholder="请输入内容" />
</view>
</uni-col>
<uni-col :span="4">
<view class="search">查询</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)"
>
<view class="line"></view>
<uni-row :gutter="24">
<uni-col :span="2">{{ index + 1 }}</uni-col>
<uni-col :span="6">物资名称</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.maTypeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">规格型号</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">到货数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">已入库数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">待入库数量</uni-col>
<uni-col :span="16">
<view class="cont">{{ }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">管理模式</uni-col>
<uni-col :span="16">
<uni-tag
text="编码"
type="warning"
v-if="item.manageType === 0"
size="small"
/>
<uni-tag
text="数量"
type="success"
v-if="item.manageType === 1"
size="small"
/>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">状态</uni-col>
<uni-col :span="16">
<uni-tag
text="未完成"
type="warning"
size="small"
v-if="item.status == 4"
/>
<uni-tag
text="已完成"
type="success"
size="small"
v-if="item.status == 19"
/>
</uni-col>
</uni-row>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, onUnmounted } from 'vue'
import { getPurchaseDetailsList,setInboundCodeAPI } from '@/services/purchase.js'
import { onLoad } from '@dcloudio/uni-app'
const detailsList = ref([])
const id = ref('')
const taskId = ref('')
//
const inBoundInfo = ref({
manageType: '', // manageType
taskId: '', // taskId
typeId: '', // typeId
})
//
const getTableList = async () => {
let obj = {
"id":id.value,
"taskId":taskId.value,
"statusList":[3,13,4,14,19],
}
const { data: res } = await getPurchaseDetailsList(obj)
detailsList.value = res.purchaseCheckDetailsList
}
//
const onCodingItem = (item) => {
console.log('item----------',item)
//
const {
status,
manageType,
taskId,
typeId,
maTypeName,
typeName,
id,
} = item
inBoundInfo.value.taskId = taskId
inBoundInfo.value.typeId = typeId
inBoundInfo.value.manageType = manageType
inBoundInfo.value.maTypeName = maTypeName
inBoundInfo.value.typeName = typeName
inBoundInfo.value.id = id
if (status == 19) {
uni.showToast({ title: '该设备已完成出库!', icon: 'none' })
return
}
if (manageType === 1 && status!=19) {
uni.showModal({
title: '提示',
content: '是否确认入库?',
confirmText: '确定',
cancelText: '取消',
success: async (res) => {
if (res.confirm) {
//
//
const res = await setInboundCodeAPI({taskId:taskId, typeId:typeId, purchaseId:id})
if (res.code === 200) {
uni.showToast({
title: '入库成功!',
icon: 'none',
})
setTimeout(() => {
getTableList()
}, 500)
}
// uni.showToast({
// title: '',
// icon: 'success'
// });
}
}
})
}
let codingUrl = ''
if (manageType === 0) {
codingUrl = '/pages/new-purchase/entry/code-inbound' //
// inBoundInfo json
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(inBoundInfo.value)}` })
}
}
//
onLoad((options) => {
console.log(options)
id.value = options.id
taskId.value = options.taskId
getTableList()
//
uni.$on('onUpdate', () => {
// console.log('')
//
getTableList()
})
})
//
onUnmounted(() => {
uni.$off('onUpdate') //
})
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
background-color: #e8f5fb;
.search-form {
margin: 10rpx 0;
display: flex;
align-items: center;
box-sizing: content-box;
}
.search {
height: 60rpx;
background-color: #3784fb;
text-align: center;
line-height: 60rpx;
color: #fff;
border-radius: 10rpx;
}
.scroll-container {
.table-list-item {
margin-bottom: 20rpx;
padding: 20rpx;
background-color: #fff;
min-height: 300rpx;
border-radius: 10rpx;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.line {
margin: 20rpx 0;
height: 1px;
background-color: #e8e8e8;
}
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
</style>

View File

@ -59,9 +59,13 @@
<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.supplier }}</div></uni-col>
<uni-row :gutter="24">
<uni-col :span="6">已入库数量</uni-col>
<uni-col :span="18"><div class="cont">{{ }}</div></uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待入库数量</uni-col>
<uni-col :span="18"><div class="cont">{{ }}</div></uni-col>
</uni-row>
</uni-swipe-action-item>
</uni-swipe-action>
@ -105,15 +109,21 @@ const onChangeDate = (val) => {
//
const onClick=(e,item)=> {
if(item.taskStatus==22){
console.log(e.index)
if(e.index==0){
uni.navigateTo({ url: `/pages/new-purchase/entry/details?id=${item.id}` })
uni.navigateTo({ url: `/pages/new-purchase/entry/details?id=${item.id}&taskId=${item.taskId}` })
}
// console.log(e,'item',item);
// console.log(e.index);
}else{
if(e.index==0){
uni.navigateTo({ url: `/pages/new-purchase/entry/details?id=${item.id}&taskId=${item.taskId}` })
}else{
uni.navigateTo({ url: `/pages/new-purchase/entry/inEntry?id=${item.id}&taskId=${item.taskId}` })
}
}
}
//1
const swipeOptions = ref([
{
@ -121,11 +131,11 @@ const swipeOptions = ref([
style: { backgroundColor: '#34C759' },
onClick: () => { handleAction('查看'); }
},
{
text: '驳回',
style: { backgroundColor: '#dd524d' },
onClick: () => { handleAction('驳回'); }
}
// {
// text: '',
// style: { backgroundColor: '#dd524d' },
// onClick: () => { handleAction(''); }
// }
])
//2
@ -138,10 +148,10 @@ const swipeOptions = ref([
text: '入库',
style: { backgroundColor: '#007AFF' },
},
{
text: '驳回',
style: { backgroundColor: '#dd524d' },
}
// {
// text: '',
// style: { backgroundColor: '#dd524d' },
// }
])
//
@ -153,10 +163,9 @@ const swipeOptions = ref([
//
const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value)
const res = await getPurchaseList(queryParams.value)
console.log('res列表数据', res)
total.value = res.total
total.value = res.data.total
if (isTap) {
tableList.value = res.data.rows
} else {
@ -182,10 +191,10 @@ const changeTab = (index) => {
}
const maskClick = () => {}
//
onLoad(() => {
getTableList()
})
// //
// onLoad(() => {
// getTableList()
// })
onShow(() => {
tableList.value = []
@ -198,10 +207,12 @@ const onScrollTolower = debounce(() => {
queryParams.value.pageNum++
getTableList()
}
})
},500)
//
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
})

View File

@ -18,6 +18,34 @@ export const getPurchaseInfo = (data) => {
})
}
// 查询新购验收任务详细列表
export const getPurchaseDetailsList = (data)=> {
return http({
url: '/material/purchase_check_info/getInfo',
method: 'GET',
data: data,
})
}
// 查询入库编码列表
export const getMachineById = (data)=> {
return http({
url: '/material/purchase/storage/getMachineById',
method: 'POST',
data: data,
})
}
// 查询入库编码列表 || 数量入库
export const setInboundCodeAPI = (data)=> {
return http({
url: '/material/purchase/storage/warehouse',
method: 'POST',
data: data
})
}
// 验收接口
export const innerVerify = (data) => {
return http({