This commit is contained in:
zzyuan 2024-11-22 09:40:08 +08:00
commit f521356c3c
15 changed files with 1802 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": {
@ -156,6 +181,43 @@
"style": {
"navigationBarTitleText": "退料数量查看"
}
},
/* */
// 1.
{
"path": "pages/repair/index",
"style": {
"navigationBarTitleText": "维修任务"
}
},
// 2.
{
"path": "pages/repair/details",
"style": {
"navigationBarTitleText": "维修任务"
}
},
// 3.
{
"path": "pages/repair/code-view",
"style": {
"navigationBarTitleText": "编码设备维修"
}
},
// 4.
{
"path": "pages/repair/code-operate",
"style": {
"navigationBarTitleText": "维修"
}
},
// 5.
{
"path": "pages/repair/num-operate",
"style": {
"navigationBarTitleText": "数量设备维修"
}
}
],
"tabBar": {

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

@ -0,0 +1,120 @@
<template>
<!-- 数量出库 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="6">
<view class="search" style="background-color: #19be6b"> 维修完成 </view>
</uni-col>
</uni-row>
<view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="6">物资名称</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">物资类型</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.repairNum }}</view>
</uni-col>
</uni-row>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
const query = defineProps() //
const queryParams = JSON.parse(query.queryParams)
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
.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;
}
.search {
height: 65rpx;
background-color: #3784fb;
text-align: center;
line-height: 65rpx;
color: #fff;
}
.scroll-container {
.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;
}
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
.outbound-btn {
width: 70%;
margin: 25rpx auto;
height: 65rpx;
line-height: 65rpx;
text-align: center;
background-color: #19be6b;
border-radius: 12rpx;
color: #fff;
}
</style>

View File

@ -0,0 +1,164 @@
<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-col :span="4">
<view class="search" style="background-color: #19be6b">合格</view>
</uni-col>
</uni-row>
<view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="6">物资名称</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">物资类型</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.repairNum }}</view>
</uni-col>
</uni-row>
</view>
<view class="table-list-item" style="margin: 0">
<checkbox-group>
<label>
全选
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="allChecked"
value="all"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</view>
<view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="2">
<checkbox-group>
<label>
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</uni-col>
<uni-col :span="2">1</uni-col>
<uni-col :span="14">物资名称</uni-col>
<uni-col :span="6">
<view class="cont">66</view>
</uni-col>
</uni-row>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
const query = defineProps() //
const queryParams = JSON.parse(query.queryParams)
const allChecked = ref(false)
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
.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;
}
.search {
height: 65rpx;
background-color: #3784fb;
text-align: center;
line-height: 65rpx;
color: #fff;
}
.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;
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
.outbound-btn {
width: 70%;
margin: 25rpx auto;
height: 65rpx;
line-height: 65rpx;
text-align: center;
background-color: #19be6b;
border-radius: 12rpx;
color: #fff;
}
</style>

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-col :span="4">
<view class="search" style="background-color: #19be6b" @tap="onQualified"
>合格</view
>
</uni-col>
</uni-row>
<view class="table-list-item">
<checkbox-group @change="onChangeAllChecked">
<label>
全选
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="allChecked"
value="all"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</view>
<scroll-view scroll-y class="scroll-container">
<view
v-for="(item, index) in detailsList"
:key="index"
class="table-list-item"
@tap="onRepairItem(item)"
>
<view class="line"></view>
<uni-row :gutter="24">
<uni-col :span="2">
<checkbox-group @change="onChangeChecked(item)">
<label>
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="item.isChecked"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</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">{{ item.type }}</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.repairNum }}</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>
</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>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, onUnmounted, computed } from 'vue'
import { getRepairDetailsAPI, setQualifiedAPI } from '@/services/repair/repair.js'
import { onLoad } from '@dcloudio/uni-app'
const detailsList = ref([])
const query = defineProps() //
//
const getOutboundDetailsData = async () => {
const res = await getRepairDetailsAPI({ taskId: query.taskId })
detailsList.value = res.data
detailsList.value = detailsList.value.map((e) => {
return { ...e, isChecked: false }
})
}
//
const onChangeAllChecked = (e) => {
detailsList.value.forEach((item) => {
if (e.detail.value.length > 0) {
item.isChecked = true
} else {
item.isChecked = false
}
})
}
//
const onChangeChecked = (val) => {
val.isChecked = !val.isChecked
}
//
const allChecked = computed(() => {
return detailsList.value.every((e) => e.isChecked == true)
})
//
const onQualified = async () => {
const isSelect = detailsList.value.some((e) => e.isChecked == true)
if (!isSelect) {
uni.showToast({
title: '请勾选需要需要合格的数据!',
icon: 'none',
})
return
}
//
const ids = []
detailsList.value.forEach((e) => {
if (e.isChecked) {
ids.push(e.id)
}
})
const res = await setQualifiedAPI(ids)
if (res.code === 200) {
uni.showToast({
title: '操作成功!',
icon: 'none',
})
getOutboundDetailsData()
}
}
//
const onRepairItem = (item) => {
//
const { manageType, repairNum, typeName, type } = item
let queryParams = null
let codingUrl = ''
if (manageType === 0) {
codingUrl = '/pages/repair/code-view' //
}
if (manageType == 1) {
codingUrl = '/pages/repair/num-operate' //
}
queryParams = {
repairNum,
typeName,
type,
}
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
}
//
onLoad(() => {
getOutboundDetailsData()
//
uni.$on('onUpdate', () => {
// console.log('')
//
getOutboundDetailsData()
})
})
//
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;
}
.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>

348
src/pages/repair/index.vue Normal file
View File

@ -0,0 +1,348 @@
<template>
<!-- 维修列表 -->
<view class="page-container">
<view class="complete-btn">
<view class="btn" @click="changeTab(1)">
<span>已完成</span>
<view v-if="active == 1" class="bt-line"></view>
</view>
<view class="btn" style="margin-left: 120rpx" @click="changeTab(2)">
<span>未完成</span>
<view v-if="active == 2" class="bt-line"></view>
</view>
</view>
<uni-row :gutter="24" class="search-form">
<uni-col :span="12">
<view>
<uni-datetime-picker
v-model="dateArray"
type="daterange"
@maskClick="maskClick"
@change="onChangeDate"
placeholder="选择日期范围"
/>
</view>
</uni-col>
<uni-col :span="8">
<view>
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
</view>
</uni-col>
<uni-col :span="4">
<view class="search" @click="onSearchBtn()">搜索</view>
</uni-col>
</uni-row>
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
<view
class="table-list-item"
:key="index"
@click="handleItem(item)"
v-for="(item, index) in tableList"
>
<uni-swipe-action>
<uni-swipe-action-item @click="onClick($event, item)" :right-options="options">
<view class="line"></view>
<uni-row :gutter="24">
<uni-col :span="6">退料人</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.createBy }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">任务时间</uni-col>
<uni-col :span="18"
><view class="cont">{{ item.createTime }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">维修单号</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.repairCode }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">退料物资</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">退料单位</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.backUnit }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">工程名称</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.backPro }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">任务创建人</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.createBy }}</view>
</uni-col>
</uni-row>
<!-- <uni-row :gutter="24">
<uni-col :span="6">维修班组</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.preCountNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">已修数量</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.alNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18">
<view class="cont"></view>
</uni-col>
</uni-row> -->
<uni-row :gutter="24">
<uni-col :span="6">状态</uni-col>
<uni-col :span="18">
<view class="cont">
<uni-tag
text="未完成"
type="warning"
v-if="item.repairStatusCode == 0"
/>
<uni-tag
text="已完成"
type="success"
v-if="item.repairStatusCode == 1"
/>
</view>
</uni-col>
</uni-row>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view class="loading-text">
{{ finish ? '没有更多数据了~' : '正在加载...' }}
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { getRepairListAPI, repairSubmitAPI, repairRejectAPI } from '@/services/repair/repair.js'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const total = ref(0) //
const active = ref(1) // tap
const tableList = ref([]) //
const dateArray = ref([]) //
//
const queryParams = ref({
startTime: '', //
endTime: '', //
keyWord: '', //
// statusList: [4], //
pageNum: 1,
pageSize: 3,
})
//
const options = ref([
{
text: '提交',
style: {
backgroundColor: '#84c649',
color: '#fff',
fontSize: '30rpx',
},
},
{
text: '驳回',
style: {
backgroundColor: '#ed6042',
color: '#fff',
fontSize: '30rpx',
},
},
])
//
const onClick = async (e, item) => {
if (e.index === 0) {
//
const res = await repairSubmitAPI([{ taskId: item.taskId }])
if (res.code === 200) {
uni.showToast({
title: '提交成功!',
icon: 'none',
})
}
} else {
//
console.log('驳回')
const res = await repairRejectAPI(item.taskId)
if (res.code === 200) {
uni.showToast({
title: '驳回成功!',
icon: 'none',
})
}
}
}
// change
const onChangeDate = (val) => {
const [val_1, val_2] = val
queryParams.value.startTime = val_1
queryParams.value.endTime = val_2
}
//
const onSearchBtn = () => {
queryParams.value.pageNum = 1
tableList.value = []
getTableList()
}
//
const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value)
const res = await getRepairListAPI(queryParams.value)
total.value = res.total
if (isTap) {
tableList.value = res.rows
} else {
if (res.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.rows)
}
}
}
// //
// onLoad(() => {
// getTableList()
// })
onShow(() => {
tableList.value = []
total.value = 0
getTableList()
})
//
const onScrollTolower = debounce(() => {
console.log('触底事件')
if (total.value > tableList.value.length) {
queryParams.value.pageNum++
getTableList()
}
}, 500)
// tap
const changeTab = (index) => {
active.value = index
if (index == 1) {
queryParams.value.statusList = [4] //
queryParams.value.pageNum = 1
getTableList(true)
} else if (index == 2) {
queryParams.value.statusList = [3] //
queryParams.value.pageNum = 1
getTableList(true)
}
}
//
const handleItem = (item) => {
uni.navigateTo({ url: `/pages/repair/details?taskId=${item.taskId}` })
}
//
const finish = computed(() => {
if (total.value === tableList.value.length) return true
})
const maskClick = () => {}
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
.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;
}
.search {
height: 65rpx;
background-color: #3784fb;
text-align: center;
line-height: 65rpx;
color: #fff;
}
.scroll-container {
.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;
}
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
::v-deep .uni-swipe_button {
writing-mode: vertical-rl;
padding: 0 18rpx;
}
</style>

View File

@ -0,0 +1,210 @@
<template>
<!-- 数量出库 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="6">
<view class="search" style="background-color: #19be6b"> 维修完成 </view>
</uni-col>
</uni-row>
<view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="6">物资名称</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">物资类型</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18"
><view class="cont">{{ queryParams.repairNum }}</view>
</uni-col>
</uni-row>
</view>
<scroll-view scroll-y style="padding-bottom: 20rpx">
<!-- -->
<view class="table-list-item">
<!-- 维修人员 -->
<h2 style="padding: 4rpx 0; font-weight: bold">维修信息</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修人员">
<uni-data-select :localdata="repairPerson" placeholder="请选择维修人员" />
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput placeholder="请填写备注" />
</uni-forms-item>
<uni-forms-item label="附件">
<uni-file-picker fileMediatype="image" mode="grid" />
</uni-forms-item>
</uni-forms>
</view>
<!-- 内部维修 -->
<view class="table-list-item">
<h2 style="padding: 4rpx 0; font-weight: bold">内部维修</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修数量">
<uni-easyinput placeholder="请填写维修数量" />
</uni-forms-item>
<uni-forms-item label="配件类型">
<uni-easyinput placeholder="配件类型" />
</uni-forms-item>
<uni-forms-item label="规格型号">
<uni-easyinput placeholder="规格型号" />
</uni-forms-item>
<uni-forms-item label="是否收费">
<uni-data-select :localdata="isChargeList" placeholder="请选择是否收费" />
</uni-forms-item>
</uni-forms>
</view>
<!-- 返厂维修 -->
<view class="table-list-item">
<h2 style="padding: 4rpx 0; font-weight: bold">返厂维修</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修数量">
<uni-easyinput placeholder="请输入维修数量" />
</uni-forms-item>
<uni-forms-item label="配件信息">
<uni-easyinput placeholder="配件类型" />
</uni-forms-item>
<uni-forms-item label="配件厂家">
<uni-data-select :localdata="partsMillList" placeholder="请选择配件厂家" />
</uni-forms-item>
<uni-forms-item label="是否收费">
<uni-data-select :localdata="isChargeList" placeholder="请选择是否收费" />
</uni-forms-item>
<uni-forms-item label="配件数量">
<uni-easyinput placeholder="请输入配件数量" />
</uni-forms-item>
</uni-forms>
</view>
<!-- 维修报废 -->
<view class="table-list-item">
<h2 style="padding: 4rpx 0; font-weight: bold">维修报废</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="报废原因">
<uni-data-select :localdata="repairPerson" placeholder="请选择报废原因" />
</uni-forms-item>
<uni-forms-item label="损坏原因">
<uni-data-select :localdata="repairPerson" placeholder="请选择损坏原因" />
</uni-forms-item>
<uni-forms-item label="其他原因">
<uni-easyinput placeholder="请填写其他原因" />
</uni-forms-item>
<uni-forms-item label="附件">
<uni-file-picker fileMediatype="image" mode="grid" />
</uni-forms-item>
</uni-forms>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
const query = defineProps() //
const queryParams = JSON.parse(query.queryParams)
const repairPerson = ref([
{ value: '1', text: '张麻子' },
{ value: '2', text: '张牧之' },
{ value: '3', text: '黄四郎' },
{ value: '4', text: '马邦德' },
])
const isChargeList = ref([
{ value: 1, text: '是' },
{ value: 2, text: '否' },
])
const partsMillList = ref([
{ value: 1, text: '上海机械公司' },
{ value: 2, text: '北京机械公司' },
])
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
.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;
}
.search {
height: 65rpx;
background-color: #3784fb;
text-align: center;
line-height: 65rpx;
color: #fff;
}
.table-list-item {
margin: 20rpx 0;
padding: 20rpx;
background-color: #fff;
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;
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
.outbound-btn {
width: 70%;
margin: 25rpx auto;
height: 65rpx;
line-height: 65rpx;
text-align: center;
background-color: #19be6b;
border-radius: 12rpx;
color: #fff;
}
</style>

View File

@ -27,6 +27,19 @@
</text>
</view>
</view>
<view class="new-purchase">
<view
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in repairList"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
{{ item.title }}
</text>
</view>
</view>
</view>
</template>
@ -60,6 +73,14 @@ const pickingList = ref([
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
},
])
//
const repairList = ref([
{
title: '维修',
url: '/pages/repair/index',
iconSrc: '../../static/workbench/fix.png',
},
])
const onNavigateTo = (url) => {
uni.navigateTo({ url })

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({

View File

@ -0,0 +1,52 @@
import { http } from '@/utils/http'
/**
* 维修 ---- 列表查询
*/
export const getRepairListAPI = (data) => {
return http({
method: 'GET',
url: '/material/repair/getRepairTaskList',
data,
})
}
/**
* 维修 ---- 列表详情
*/
export const getRepairDetailsAPI = (data) => {
return http({
method: 'GET',
url: '/material/repair/getAppRepairMaTypeList',
data,
})
}
/**
* 维修 ---- 合格操作
*/
export const setQualifiedAPI = (data) => {
return http({
method: 'POST',
url: '/material/repair/completeRepair',
data,
})
}
/**
* 维修 ---- 提交
*/
export const repairSubmitAPI = (data) => {
return http({
method: 'POST',
url: '/material/repair/endRepairTask',
data,
})
}
/**
* 维修 ---- 驳回
*/
export const repairRejectAPI = (id) => {
return http({
method: 'delete',
url: '/material/repair/' + id,
data: [id],
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -49,6 +49,7 @@ export const http = (options) => {
uni.request({
...options,
success(res) {
console.log('res', res)
// 1. 判断是否请求成功
if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.data.code >= 200 && res.data.code < 300) {