This commit is contained in:
zzyuan 2024-12-24 18:30:48 +08:00
commit 453e655c89
8 changed files with 398 additions and 235 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name" : "material-app", "name" : "material-app",
"appid" : "__UNI__AD10BE7", "appid" : "__UNI__2AF69B2",
"description" : "", "description" : "",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : 101, "versionCode" : 101,

View File

@ -106,20 +106,15 @@ const maxNum = computed(() => {
const scanStart = () => { const scanStart = () => {
console.log('编码识别--') console.log('编码识别--')
// //
// uni.scanCode({ uni.scanCode({
// onlyFromCamera: true, onlyFromCamera: true,
// scanType: ['qrCode', 'pdf417'], scanType: ['qrCode', 'pdf417'],
// success: (res) => { success: (res) => {
// console.log('' + res.result) console.log('扫码结果:' + res.result)
// queryCodeParams.value.maCode = res.result queryCodeParams.value.maCode = res.result.split("qrcode=")[1]
// }, },
// fail: (err) => { fail: (err) => {},
// // uni.showToast({ })
// // title: '',
// // icon: 'none'
// // });
// },
// })
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
mpaasScanModule.mpaasScan({ mpaasScanModule.mpaasScan({

View File

@ -1,7 +1,13 @@
<template> <template>
<!-- 编码出库--> <!-- 编码出库-->
<view class="page-container"> <view class="page-container">
<view class="table-list-item"> <!-- 表单信息区域 -->
<view class="form-section">
<view class="section-header" @tap="toggleForm">
<text class="title">表单信息</text>
<text class="toggle-icon" :class="{ 'is-expanded': isExpanded }"></text>
</view>
<view class="form-content" :class="{ 'is-expanded': isExpanded }">
<uni-forms :model="formData" label-width="100" :border="true"> <uni-forms :model="formData" label-width="100" :border="true">
<uni-forms-item label="领料单位:" name="leaseUnit"> <uni-forms-item label="领料单位:" name="leaseUnit">
<span class="form-view">{{ queryParams.leaseUnit }}</span> <span class="form-view">{{ queryParams.leaseUnit }}</span>
@ -20,6 +26,7 @@
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
</view>
<view class="table-list-item"> <view class="table-list-item">
<uni-row :gutter="24"> <uni-row :gutter="24">
@ -137,6 +144,14 @@ const queryCodeParams = ref({
maCode: '', maCode: '',
}) })
//
const isExpanded = ref(true)
//
const toggleForm = () => {
isExpanded.value = !isExpanded.value
}
// //
const boxScan = async () => { const boxScan = async () => {
boxCode.value="" boxCode.value=""
@ -181,7 +196,7 @@ const boxScan = async () => {
} }
} }
// // <EFBFBD><EFBFBD>
const boxOutBound = async () => { const boxOutBound = async () => {
// //
const { typeId, parentId } = queryParams.value const { typeId, parentId } = queryParams.value
@ -193,7 +208,9 @@ const boxOutBound = async () => {
boxId: e.boxId, boxId: e.boxId,
maId: e.maId, maId: e.maId,
maCode: e.maCode, maCode: e.maCode,
manageType: 3, manageType: 0,
// 0123
outType: 3,
outNum: 1, outNum: 1,
parentId, parentId,
typeId, typeId,
@ -219,14 +236,15 @@ const boxOutBound = async () => {
} }
} }
const maxNum = ref(0)
// //
const maxNum = computed(() => { // const maxNum = computed(() => {
// 1. // // 1.
const waitNum = queryParams.value.preNum - queryParams.value.alNum - codeNum.value // const waitNum = queryParams.value.preNum - queryParams.value.alNum
// 2. // // 2.
return total.value > waitNum ? waitNum : total.value // return total.value > waitNum ? waitNum : total.value
}) // })
// //
const getCodeDeviceListData = async () => { const getCodeDeviceListData = async () => {
@ -277,7 +295,7 @@ const onScrollTolower = debounce(() => {
} }
}, 500) }, 500)
// // <EFBFBD><EFBFBD>
const finish = computed(() => { const finish = computed(() => {
if (total.value === codeDeviceList.value.length) return true if (total.value === codeDeviceList.value.length) return true
}) })
@ -355,9 +373,11 @@ onLoad((options) => {
uni.$on('onUpdate', (num) => { uni.$on('onUpdate', (num) => {
console.log('监听事件', num) console.log('监听事件', num)
codeNum.value = num codeNum.value = num
}) })
queryParams.value = JSON.parse(options.queryParams) queryParams.value = JSON.parse(options.queryParams)
queryCodeParams.typeId = queryParams.value.typeId maxNum.value = queryParams.value.preNum - queryParams.value.alNum
queryCodeParams.value.typeId = queryParams.value.typeId
getCodeDeviceListData() getCodeDeviceListData()
}) })
// //
@ -544,4 +564,77 @@ onUnmounted(() => {
padding: 32rpx 0; padding: 32rpx 0;
letter-spacing: 1rpx; letter-spacing: 1rpx;
} }
.form-section {
background: #fff;
border-radius: 20rpx;
margin-bottom: 24rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
//
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 32rpx;
background: #fff;
cursor: pointer;
transition: all 0.3s ease;
&:active {
background: #f7f8fa;
}
.title {
font-size: 32rpx;
font-weight: 600;
color: #262626;
}
.toggle-icon {
font-size: 40rpx;
color: #8c8c8c;
transform: rotate(90deg);
transition: transform 0.3s ease;
display: inline-block;
&.is-expanded {
transform: rotate(-90deg);
}
}
}
//
.form-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
&.is-expanded {
max-height: 1000rpx; //
}
:deep(.uni-forms) {
padding: 0 32rpx 32rpx;
}
:deep(.uni-forms-item) {
margin-bottom: 24rpx;
&:last-child {
margin-bottom: 0;
}
.uni-forms-item__label {
color: #8c8c8c;
}
.form-view {
color: #262626;
font-size: 28rpx;
}
}
}
}
</style> </style>

View File

@ -312,147 +312,78 @@ const onClick = (e, item) => {
// //
.table-list-item { .table-list-item {
margin: 24rpx 0;
padding: 0;
background-color: #fff;
border-radius: 20rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
overflow: hidden;
position: relative;
//
.swipe-action {
:deep(.uni-swipe) {
width: 100% !important;
background-color: #fff;
}
:deep(.uni-swipe_content) {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 32rpx; padding: 24rpx;
overflow: hidden; margin-bottom: 24rpx;
} box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
:deep(.uni-swipe_right) {
height: 100%;
display: flex;
align-items: center;
}
}
//
:deep(.uni-swipe_button-group) {
height: 100%;
display: flex;
align-items: stretch;
.uni-swipe_button {
padding: 0 50rpx;
font-size: 28rpx;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
height: auto;
margin: 0;
min-width: 120rpx;
opacity: 0;
transition: opacity 0.3s;
&:nth-child(1) {
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
box-shadow: 0 4rpx 16rpx rgba(55, 132, 251, 0.2);
border-radius: 0;
}
&:nth-child(2) {
background: linear-gradient(135deg, #ff4d4f 0%, #ed6042 100%);
box-shadow: 0 4rpx 16rpx rgba(237, 96, 66, 0.2);
border-radius: 0;
}
&:active { &:active {
transform: scale(0.99);
opacity: 0.9; opacity: 0.9;
transform: scale(0.98);
}
}
}
&:active {
transform: scale(0.985);
background-color: #fafbfc;
} }
//
.title { .title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 24rpx; margin-bottom: 24rpx;
span { .main-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #3784fb; color: #262626;
background: linear-gradient(90deg, #3784fb, #4b8eff); }
-webkit-background-clip: text;
-webkit-text-fill-color: transparent; //
.status-tag {
:deep(.uni-tag) {
padding: 8rpx 24rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 500;
border: none;
&[type="warning"] {
color: #fa8c16;
background: rgba(250, 140, 22, 0.1);
}
&[type="success"] {
color: #52c41a;
background: rgba(82, 196, 26, 0.1);
}
}
} }
} }
// 线
.line { .line {
margin: 24rpx 0;
height: 2rpx; height: 2rpx;
background: linear-gradient(90deg, background: linear-gradient(90deg,
rgba(232, 232, 232, 0) 0%, rgba(232, 232, 232, 0) 0%,
rgba(232, 232, 232, 1) 50%, rgba(232, 232, 232, 1) 50%,
rgba(232, 232, 232, 0) 100% rgba(232, 232, 232, 0) 100%
); );
margin: 24rpx 0;
} }
:deep(.uni-row) { //
.uni-row {
margin-bottom: 20rpx; margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
.uni-col-8 {
color: #8c8c8c;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500;
.uni-col-6 {
color: #8c8c8c;
} }
.cont { .cont {
color: #262626; color: #262626;
font-size: 28rpx;
font-weight: 500;
line-height: 1.8;
text-align: right; text-align: right;
} }
} }
//
:deep(.uni-tag) {
padding: 6rpx 20rpx;
border-radius: 8rpx;
font-size: 26rpx;
font-weight: 600;
margin: 0;
&[type="warning"] {
color: #fa8c16;
background-color: rgba(250, 140, 22, 0.1);
border: 2rpx solid rgba(250, 140, 22, 0.2);
}
&[type="success"] {
color: #52c41a;
background-color: rgba(82, 196, 26, 0.1);
border: 2rpx solid rgba(82, 196, 26, 0.2);
}
}
} }
} }
@ -464,4 +395,47 @@ const onClick = (e, item) => {
padding: 32rpx 0; padding: 32rpx 0;
letter-spacing: 1rpx; letter-spacing: 1rpx;
} }
//
: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;
writing-mode: vertical-rl;
//
&:nth-child(1) {
background: linear-gradient(to bottom, #3ad980, #34C759) !important;
}
//
&:nth-child(2) {
background: linear-gradient(to bottom, #3b95ff, #007AFF) !important;
}
&:active {
opacity: 0.85;
}
}
}
}
</style> </style>

View File

@ -3,11 +3,11 @@
<view class="page-container"> <view class="page-container">
<view class="complete-btn"> <view class="complete-btn">
<view class="btn" @click="changeTab(1)"> <view class="btn" @click="changeTab(1)">
<span>完成</span> <span>完成</span>
<div v-if="active == 1" class="bt-line"></div> <div v-if="active == 1" class="bt-line"></div>
</view> </view>
<view class="btn" style="margin-left: 80rpx" @click="changeTab(2)"> <view class="btn" style="margin-left: 80rpx" @click="changeTab(2)">
<span>完成</span> <span>完成</span>
<div v-if="active == 2" class="bt-line"></div> <div v-if="active == 2" class="bt-line"></div>
</view> </view>
</view> </view>
@ -126,7 +126,7 @@ const queryParams = ref({
startTime: '', // startTime: '', //
endTime: '', // endTime: '', //
keyWord: '', // keyWord: '', //
statusList: [4], // statusList: [3], //
pageNum: 1, pageNum: 1,
pageSize: 3, pageSize: 3,
}) })
@ -140,7 +140,7 @@ const onChangeDate = (val) => {
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value) console.log('queryParams.value查询参数', queryParams.value)
const res = await getPickingOutboundListAPI(queryParams.value) const res = await getPickingOutboundListAPI(queryParams.value)
console.log('res列表数据', res) console.log('res列表数据', res)
total.value = res.total total.value = res.total
@ -178,11 +178,12 @@ const onScrollTolower = debounce(() => {
// tap // tap
const changeTab = (index) => { const changeTab = (index) => {
active.value = index active.value = index
if (index == 1) { console.log('index', index)
if (index == 2) {
queryParams.value.statusList = [4] // queryParams.value.statusList = [4] //
queryParams.value.pageNum = 1 queryParams.value.pageNum = 1
getTableList(true) getTableList(true)
} else if (index == 2) { } else if (index == 1) {
queryParams.value.statusList = [3] // queryParams.value.statusList = [3] //
queryParams.value.pageNum = 1 queryParams.value.pageNum = 1
getTableList(true) getTableList(true)

View File

@ -39,7 +39,11 @@
<scroll-view scroll-y class="scroll-container"> <scroll-view scroll-y class="scroll-container">
<view v-for="(item, index) in detailsList" <view v-for="(item, index) in detailsList"
:key="index" class="table-list-item" :key="index" class="table-list-item"
@tap="onRepairItem(item)" >
<uni-swipe-action>
<uni-swipe-action-item
:right-options="options"
@click="onClick($event, item)"
> >
<div class="title"> <div class="title">
<span style="font-size: 15px; font-weight: 800">修试入库</span> <span style="font-size: 15px; font-weight: 800">修试入库</span>
@ -74,7 +78,7 @@
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> <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"> <uni-col :span="16">
<view class="cont">{{ item.repairNum }}</view> <view class="cont">{{ item.repairNum }}</view>
</uni-col> </uni-col>
@ -118,6 +122,8 @@
<view class="cont">{{ item.status }}</view> <view class="cont">{{ item.status }}</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -131,6 +137,33 @@ const detailsList = ref([])
// const query = defineProps() // // const query = defineProps() //
const taskId = ref('') const taskId = ref('')
//
const options = ref([
{
text: '查看',
style: {
backgroundColor: '#34C759'
}
},
{
text: '入库',
style: {
backgroundColor: '#007AFF'
}
}
])
//
const onClick = (e, item) => {
if (e.index === 0) {
//
handleView(item)
} else {
//
handleInbound(item)
}
}
// //
const getDetailsData = async () => { const getDetailsData = async () => {
const res = await getRepairedDetailList(taskId.value) const res = await getRepairedDetailList(taskId.value)
@ -155,18 +188,18 @@ const onChangeChecked = (val) => {
val.isChecked = !val.isChecked val.isChecked = !val.isChecked
} }
// //
const allChecked = computed(() => { const allChecked = computed(() => {
return detailsList.value.every((e) => e.isChecked == true) return detailsList.value.every((e) => e.isChecked == true)
}) })
// // <EFBFBD><EFBFBD><EFBFBD>
const onQualified = async () => { const onQualified = async () => {
const isSelect = detailsList.value.some((e) => e.isChecked == true) const isSelect = detailsList.value.some((e) => e.isChecked == true)
if (!isSelect) { if (!isSelect) {
uni.showToast({ uni.showToast({
title: '请勾选需要需要合格的<EFBFBD><EFBFBD>据!', title: '请勾选需要需要合格的据!',
icon: 'none', icon: 'none',
}) })
return return
@ -219,7 +252,7 @@ onLoad((options) => {
getDetailsData() getDetailsData()
}) })
}) })
// <EFBFBD><EFBFBD> //
onUnmounted(() => { onUnmounted(() => {
uni.$off('onUpdate') // uni.$off('onUpdate') //
}) })
@ -416,4 +449,45 @@ onUnmounted(() => {
color: #8c8c8c; color: #8c8c8c;
padding: 24rpx 0; padding: 24rpx 0;
} }
//
: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;
writing-mode: vertical-rl;
&:nth-child(1) {
background: linear-gradient(to bottom, #3ad980, #34C759) !important;
}
&:nth-child(2) {
background: linear-gradient(to bottom, #3b95ff, #007AFF) !important;
}
&:active {
opacity: 0.85;
}
}
}
}
</style> </style>

View File

@ -13,6 +13,8 @@
</text> </text>
</view> </view>
</view> </view>
<view class="new-purchase"> <view class="new-purchase">
<view <view
class="purchase-item" class="purchase-item"