This commit is contained in:
bb_pan 2025-06-19 18:11:11 +08:00
parent 175bf076f3
commit 03a9794dfa
2 changed files with 78 additions and 78 deletions

View File

@ -303,7 +303,7 @@ const submitCode = () => {
console.log(taskInfo.value)
if (maId.value == '') {
uni.showToast({ title: '请先添加退料设备编码!', icon: 'none' })
} else if(apDetection.value == '不合格') {
} else if(apDetection.value == '不合格' && !bmFileInfos.value) {
uni.showToast({ title: '请上传附件!', icon: 'none' })
} else {
// console.log(typeList.value)

View File

@ -128,32 +128,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,61 +177,61 @@ const onCameraError = (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)
// 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)
// try {
// const signUrl = params
// if (opts.isLease) {
// const params = {
// id: opts.id,
// leaseSignUrl: signUrl,
// leaseSignType: signType.value,
// }
// console.log('🚀 ~ success: ~ params:', params)
// updateLeaseApplyInfoSign(params).then((res) => {
// console.log('🚀 ~ uploadImg- ~ res:', res)
// uni.navigateBack()
// })
// } else if (opts.isBack) {
// const params = {
// id: opts.id,
// backSignUrl: signUrl,
// backSignType: signType.value,
// }
// console.log('🚀 ~ success: ~ params:', params)
// updateSignById(params).then((res) => {
// console.log('🚀 ~ uploadImg-退 ~ res:', res)
// uni.navigateBack()
// })
// } else {
// const params = {
// signUrl: signUrl,
// signType: signType.value,
// }
// updateSign(params).then((res) => {
// console.log('🚀 ~ uploadImg- ~ res:', res)
// getSignData()
// })
// }
// } catch (error) {
// console.log('🚀 ~ uploadImg ~ error:', error)
// uni.showToast({
// title: '',
// icon: 'none',
// })
// }
try {
const signUrl = file
if (opts.isLease) {
const params = {
id: opts.id,
leaseSignUrl: signUrl,
leaseSignType: signType.value,
}
console.log('🚀 ~ success: ~ params:', params)
updateLeaseApplyInfoSign(params).then((res) => {
console.log('🚀 ~ uploadImg-领料 ~ res:', res)
uni.navigateBack()
})
} else if (opts.isBack) {
const params = {
id: opts.id,
backSignUrl: signUrl,
backSignType: signType.value,
}
console.log('🚀 ~ success: ~ params:', params)
updateSignById(params).then((res) => {
console.log('🚀 ~ uploadImg-退料 ~ res:', res)
uni.navigateBack()
})
} else {
const params = {
signUrl: signUrl,
signType: signType.value,
}
updateSign(params).then((res) => {
console.log('🚀 ~ uploadImg-个人中心 ~ res:', res)
getSignData()
})
}
} catch (error) {
console.log('🚀 ~ uploadImg ~ error:', error)
uni.showToast({
title: '上传失败',
icon: 'none',
})
}
}
//
const uploadImg2 = async (base64Data) => {