This commit is contained in:
bb_pan 2025-06-20 15:35:54 +08:00
parent 2628a1dbb7
commit db7a85fe52
8 changed files with 279 additions and 108 deletions

View File

@ -206,7 +206,8 @@
{
"path": "pages/back/detail",
"style": {
"navigationBarTitleText": "退料任务详情"
// "navigationBarTitleText": "退料任务详情"
"navigationStyle": "custom"
}
},
{
@ -225,7 +226,8 @@
{
"path": "pages/back/backCode",
"style": {
"navigationBarTitleText": "退料编码"
// "navigationBarTitleText": "退料编码"
"navigationStyle": "custom"
}
},
{
@ -243,7 +245,8 @@
{
"path": "pages/back/backNum",
"style": {
"navigationBarTitleText": "退料数量"
// "navigationBarTitleText": "退料数量"
"navigationStyle": "custom"
}
},
{

View File

@ -1,7 +1,11 @@
<template>
<uni-nav-bar leftIcon="left" right-text="确定" title="退料编码" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submitCode"/>
<view class="accept page-common">
<div class="card">
<div>任务信息</div>
<div class="card top-content" :class="{'is-expanded': isExpanded}">
<div class="card-header" @click="isExpanded = !isExpanded">
<div class="title">任务信息</div>
<uni-icons class="icon" type="down" size="19" :class="{'is-expanded': isExpanded}"></uni-icons>
</div>
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
<uni-forms-item label="退料单位:" name="unitName">
<span style="height: 100%; display: flex; align-items: center">{{
@ -109,10 +113,9 @@
</uni-row>
</div>
<div class="btn">
<!-- <button class="btn-cont" @click="reject">取消</button> -->
<!-- <div class="btn">
<button class="btn-cont" @click="submitCode">确认</button>
</div>
</div> -->
</view>
</template>
@ -136,7 +139,14 @@ const imgList = ref([]) // 图片列表,用于回显
const bmFileInfos = ref([]) //
const scanQrCodeRef = ref(null)
const codeList = ref([])
const isExpanded = ref(false)
const leftClick = () => {
//
uni.navigateBack({
delta: 1, //
})
}
const changeRadio = (e) => {
console.log(e.detail.value)
apDetection.value = e.detail.value
@ -565,7 +575,7 @@ onLoad((options) => {
}
.accept {
padding: 24rpx;
height: 95vh;
/* height: 95vh; */
word-break: break-all;
background-color: #f7f8fa;
display: flex;
@ -580,7 +590,7 @@ onLoad((options) => {
margin-bottom: 24rpx;
//
> div:first-child {
/* > div:first-child {
font-size: 32rpx;
font-weight: 600;
color: #262626;
@ -599,6 +609,41 @@ onLoad((options) => {
background: #3784fb;
border-radius: 6rpx;
}
} */
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
.title {
font-size: 32rpx;
font-weight: 600;
color: #262626;
position: relative;
padding-left: 24rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6rpx;
height: 28rpx;
background: #3784fb;
border-radius: 6rpx;
}
}
.icon {
transition: transform 0.5s ease; /* 添加动画过渡 */
transform: rotate(0deg);
&.is-expanded {
transform: rotate(180deg);
}
}
}
//
@ -751,4 +796,13 @@ onLoad((options) => {
}
}
}
.top-content {
max-height: 30px;
overflow: hidden;
transition: max-height 0.5s ease-out;
&.is-expanded {
max-height: 2000px !important;
}
}
</style>

View File

@ -1,8 +1,10 @@
<template>
<uni-nav-bar leftIcon="left" right-text="确定" title="退料数量" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submitNum"/>
<view class="accept page-common">
<div class="card">
<div class="card-header">
<div class="card top-content" :class="{'is-expanded': isExpanded}">
<div class="card-header" @click="isExpanded = !isExpanded">
<span class="title">任务信息</span>
<uni-icons class="icon" type="down" size="19" :class="{'is-expanded': isExpanded}"></uni-icons>
</div>
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
<uni-forms-item label="单位:" name="unitName">
@ -31,20 +33,35 @@
</div>
<div class="select-area">
<uni-row :gutter="24" style="display: flex; align-items: center">
<uni-col :span="10">
<uni-col :span="12">
<view>
<uni-data-select v-model="typeId"
<!-- <uni-data-select v-model="typeId"
placeholder="请选择物资类型"
:localdata="maTypeSelectList" @change="getMaCode" filterable >
</uni-data-select>
</uni-data-select> -->
<eselect
style="width: 100%; height: 90rpx"
v-model="typeId"
:options="maTypeSelectList"
@change="getMaCode"
@clear="clearTypeId"
></eselect>
</view>
</uni-col>
<uni-col :span="10">
<uni-col :span="12">
<view>
<uni-data-select v-model="typeCode"
<!-- <uni-data-select v-model="typeCode"
placeholder="请选择规格型号"
:localdata="maCodeSelectList" @change="selectMaCode">
</uni-data-select>
</uni-data-select> -->
<eselect
style="width: 100%; height: 90rpx"
v-model="typeCode"
ref="treeSelect"
:options="maCodeSelectList"
@change="selectMaCode"
@clear=""
></eselect>
</view>
</uni-col>
</uni-row>
@ -121,9 +138,9 @@
</div>
</div>
<div class="footer-btn">
<!-- <div class="footer-btn">
<button class="btn-cont" @click="submitNum">确认</button>
</div>
</div> -->
</view>
</template>
@ -131,13 +148,23 @@
import { ref, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getUseType,insertApp } from '../../services/back.js';
import eselect from '@/components/tree-select/eselect.vue'
const taskInfo = ref({})
const maTypeSelectList = ref([])
const typeId = ref("")//
const typeId = ref()//
const maCodeSelectList = ref([])
const typeCode = ref("")//
const typeList = ref([])
const isExpanded = ref(false)
const treeSelect = ref()
const leftClick = () => {
//
uni.navigateBack({
delta: 1, //
})
}
//
const getMaType = () => {
let obj = {
@ -147,8 +174,11 @@ const getMaType = () => {
console.log(res)
maTypeSelectList.value = res.data.map(option => {
return {
value:option.typeId,
text:option.typeName,
// value:option.typeId,
// text:option.typeName,
id:option.typeId,
name:option.typeName,
parentId: 0
}
});
}).catch(error => {
@ -156,19 +186,26 @@ const getMaType = () => {
})
}
//
const getMaCode = () => {
const getMaCode = (e) => {
console.log('🚀 ~ getMaCode ~ e:', e.id)
typeId.value = e.id
console.log('🚀 ~ getMaCode ~ typeId.value:', typeId.value)
let obj = {
"agreementId":taskInfo.value.agreementId,
"typeId":typeId.value
}
console.log('🚀 ~ getMaCode ~ obj:', obj)
getUseType(obj).then(res => {
console.log(res)
maCodeSelectList.value = res.data.map(option => {
let obj = {
...option,
bmFileInfos:[],
value:option.typeId,
text:option.typeName,
// value:option.typeId,
// text:option.typeName,
id:option.typeId,
name:option.typeName,
parentId: 0
}
return obj
});
@ -176,13 +213,29 @@ const getMaCode = () => {
console.log(error)
})
}
const clearTypeId = () => {
typeId.value = ''
typeCode.value = ''
maCodeSelectList.value = []
treeSelect.value.showLabel = ''
console.log('🚀 ~ clearTypeId ~ treeSelect.value:', treeSelect.value)
}
//
const selectMaCode = (e) => {
console.log(e)
console.log('🚀 ~ selectMaCode ~ e:', e)
//
if(typeList.value.some(item => item.typeId == e.id)){
//
uni.showToast({
title: '请勿重复添加',
icon: 'none'
});
return
}
maCodeSelectList.value.forEach(item=>{
console.log(item)
if(item.typeId==e){
typeList.value.push(item)
if(item.typeId==e.id){
typeList.value.unshift(item)
}
})
console.log(typeList.value)
@ -332,7 +385,10 @@ onLoad((options)=>{
})
</script>
<style lang="scss">
<style lang="scss" scoped>
::v-deep .tree-item .head {
justify-content: center !important;
}
.accept {
padding: 24rpx;
height: 95vh;
@ -382,6 +438,15 @@ onLoad((options)=>{
color: #8c8c8c;
}
}
.icon {
transition: transform 0.5s ease; /* 添加动画过渡 */
transform: rotate(0deg);
&.is-expanded {
transform: rotate(180deg);
}
}
}
//
.uni-group {
@ -474,4 +539,13 @@ onLoad((options)=>{
}
}
}
.top-content {
max-height: 30px;
overflow: hidden;
transition: max-height 0.5s ease-out;
&.is-expanded {
max-height: 800px;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<!-- 新购验收详情 -->
<uni-nav-bar leftIcon="left" right-text="提交" title="退料任务详情" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="leftClick" @clickRight="submit"/>
<view class="accept page-common">
<uni-row :gutter="24" class="search-form">
<uni-col :span="10">
@ -57,7 +57,7 @@
<script setup>
import { ref, reactive } from 'vue'
import { getBackInfo,deleteNumType } from '../../services/back.js';
import { getBackInfo,deleteNumType, submitBackApply } from '@/services/back.js';
import { onLoad,onShow } from '@dcloudio/uni-app'
const keyWord = ref('')
const id = ref('')
@ -99,6 +99,12 @@ const options2 = ref([
},
])
const leftClick = () => {
//
uni.navigateBack({
delta: 1, //
})
}
//
const getTableList = () => {
// let obj = {
@ -158,6 +164,35 @@ const onClick = (e, item, itemIndex) => {
}
swipeRef.value[itemIndex].closeAll()
}
const submit = async () => {
let param = {
id: id.value,
taskId: taskId.value
}
try {
const res = await submitBackApply(param)
if (res.code==200){
uni.showToast({ title: '提交成功', icon: 'none' })
leftClick()
}
} catch (error) {
console.log('🚀 ~ submit ~ error:', error)
uni.showToast({ title: '删除失败', icon: 'none' })
}
// console.log(param)
// submitBackApply(param).then(res => {
// console.log(res)
// if(res.code==200){
// uni.showToast({ title: '', icon: 'none' })
// }else{
// uni.showToast({ title: '', icon: 'none' })
// }
// }).catch(error => {
// console.log(error)
// })
}
onLoad((options)=>{
console.log(options)
id.value = options.id

View File

@ -179,14 +179,14 @@ const options = ref([
fontSize: '30rpx',
},
},
{
text: '提交',
style: {
backgroundColor: '#13ce66',
color: '#fff',
fontSize: '30rpx',
},
},
// {
// text: '',
// style: {
// backgroundColor: '#13ce66',
// color: '#fff',
// fontSize: '30rpx',
// },
// },
{
text: '删除',
style: {
@ -239,31 +239,31 @@ const onClick=(e,item,itemIndex)=> {
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
})
}
if (index === 1) {
if (item.taskStatus == 0) {//-
console.log(item)
let param = {
id:item.id,
taskId:item.taskId
}
console.log(param)
submitBackApply(param).then(res => {
console.log(res)
if(res.code==200){
uni.showToast({ title: '提交成功', icon: 'none' })
getTableList(true)
}else{
uni.showToast({ title: '提交失败', icon: 'none' })
}
}).catch(error => {
console.log(error)
})
} else if(item.taskStatus == 2) {//-
handleItem(item)
}
}
// if (index === 1) {
// if (item.taskStatus == 0) {//-
// console.log(item)
// let param = {
// id:item.id,
// taskId:item.taskId
// }
// console.log(param)
// submitBackApply(param).then(res => {
// console.log(res)
// if(res.code==200){
// uni.showToast({ title: '', icon: 'none' })
// getTableList(true)
// }else{
// uni.showToast({ title: '', icon: 'none' })
// }
// }).catch(error => {
// console.log(error)
// })
// } else if(item.taskStatus == 2) {//-
// handleItem(item)
// }
// }
// 2.
if (index === 2) {
if (index === 1) {
console.log(item)
let param = {
id:item.id

View File

@ -97,7 +97,7 @@ const complete = (e) => {
// console.log(e) // base
const img = new Image()
img.src = e
console.log('🚀 ~ complete ~ img.src:', img.src)
// console.log('🚀 ~ complete ~ img.src:', img.src)
img.onload = () => {
const canvas = document.createElement('canvas')
canvas.width = img.width
@ -106,9 +106,11 @@ const complete = (e) => {
ctx.drawImage(img, 0, 0)
// WebP 0.8
const webpBase64 = canvas.toDataURL('image/webp', 0.8).replace(/^data:image\/(jpeg|png|webp);base64,/, '')
const webpBase64 = canvas
.toDataURL('image/webp', 0.8)
.replace(/^data:image\/(jpeg|png|webp);base64,/, '')
console.log('🚀 ~ WebP base64:', webpBase64)
// console.log('🚀 ~ WebP base64:', webpBase64)
uploadImg2(webpBase64)
}
}
@ -129,32 +131,32 @@ const preview = () => {
// /
const handlePhoto = () => {
console.log('拍照/上传')
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res)
// imgPath.value = res.tempFilePaths[0]
// isRotate.value = false
signType.value = 1
uploadImg(res.tempFilePaths[0])
},
})
// uni.showActionSheet({
// itemList: ['', ''],
// uni.chooseImage({
// count: 1,
// sizeType: ['compressed'],
// sourceType: ['album', 'camera'],
// success: (res) => {
// if (res.tapIndex === 0) {
// getCamera()
// } else if (res.tapIndex === 1) {
// //
// getPhoto()
// }
// },
// fail: (err) => {
// console.error(':', err)
// console.log('🚀 ~ handlePhoto ~ res.tempFilePaths[0]:', res)
// // imgPath.value = res.tempFilePaths[0]
// // isRotate.value = false
// signType.value = 1
// uploadImg(res.tempFilePaths[0])
// },
// })
uni.showActionSheet({
itemList: ['拍照', '从相册选择'],
success: (res) => {
if (res.tapIndex === 0) {
getCamera()
} else if (res.tapIndex === 1) {
//
getPhoto()
}
},
fail: (err) => {
console.error('操作菜单选择失败:', err)
},
})
}
//
const getCamera = () => {
@ -177,23 +179,26 @@ const onCameraError = (message) => {
console.log('🚀 ~ onCameraError ~ message:', message)
}
const onCameraSuccess = (file) => {
// const file1 = "data:image/jpeg;base64," + file;
// const file1 = file
// uni.showToast({ title: file, icon: 'none', duration: 20000 })
// uni.showModal({
// title: '',
// content: file,
// })
// let params = {
// image: file1,
// jiju_type: '',
// auth_lic:
// 'xIWDlaDVdijcBB4mjhGCPYk5Kvk8tHZJbUn+vW+ih15+MYx98e/PXyBmKL5gFcWMPznLgDA15QuSAnZQSLddwdy9HkZgtuQDEEZZ351Eyb1eiDUccUnyoSGIrNimbx5TooBNNPYqU4qJeFrPJXAqjBHzRrxoBxuR2CEGKQPgHC4=',
// }
// console.log('🚀 ~ onCameraSuccess ~ params:', params)
img.src = file
let signUrl = ''
// console.log('🚀 ~ complete ~ img.src:', img.src)
img.onload = () => {
const canvas = document.createElement('canvas')
canvas.width = img.width
canvas.height = img.height
const ctx = canvas.getContext('2d')
ctx.drawImage(img, 0, 0)
// WebP 0.8
signUrl = canvas
.toDataURL('image/webp', 0.8)
.replace(/^data:image\/(jpeg|png|webp);base64,/, '')
// console.log('🚀 ~ WebP base64:', signUrl)
}
try {
const signUrl = file
// const signUrl = webpBase64
if (opts.isLease) {
const params = {
id: opts.id,

View File

@ -325,7 +325,7 @@ const onClick = (e, item) => {
console.log("tttttttttt",e,item)
if(taskStatus.value==3){//
console.log("333333333333333333333333333")
if (e.index === 0) {
if (e.content.text == '出库') {
if (item.status == 2) {//
leaseOutBack(item)
}else{
@ -333,7 +333,7 @@ const onClick = (e, item) => {
onCodingItem(item)//
}
}
if (e.index === 1) {
if (e.content.text == '查看') {
if (item.status == 2) {//
console.log(312)
checkViewDetail(item)//

View File

@ -131,7 +131,7 @@ export const submitBackApply = (data) => {
export const backApplyRemove = (data) => {
return http({
method: 'POST',
url: '/material/back_apply_info/deleteById',
url: '/material/back_apply_info/deleteByApp',
data:data,
})
}