bug修复
This commit is contained in:
parent
98c5c238f2
commit
7e2502e6cd
|
|
@ -209,7 +209,7 @@ onLoad((options) => {
|
||||||
getUnit()
|
getUnit()
|
||||||
getProject()
|
getProject()
|
||||||
// formData.value = JSON.parse(options.item)
|
// formData.value = JSON.parse(options.item)
|
||||||
backPerson.value = memberStore.userInfo.nickName
|
// backPerson.value = memberStore.userInfo.nickName
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
@clickLeft="leftClick"
|
@clickLeft="leftClick"
|
||||||
>
|
>
|
||||||
<!-- 使用右侧插槽自定义提交按钮 -->
|
<!-- 使用右侧插槽自定义提交按钮 -->
|
||||||
<template #right>
|
<!-- <template #right>
|
||||||
<button
|
<button
|
||||||
class="submit-btn"
|
class="submit-btn"
|
||||||
@click="submitCode"
|
@click="submitCode"
|
||||||
>
|
>
|
||||||
确定
|
确定
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template> -->
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
||||||
|
|
@ -61,6 +61,9 @@
|
||||||
<uni-col :span="6">
|
<uni-col :span="6">
|
||||||
<view class="coding-btn" @click="scanStart">二维码识别</view>
|
<view class="coding-btn" @click="scanStart">二维码识别</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
|
<uni-col :span="6">
|
||||||
|
<view class="coding-btn" @click="moveNum">转至数量</view>
|
||||||
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -131,10 +134,11 @@
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="btn">
|
<div class="btn">
|
||||||
<button class="btn-cont" @click="submitCode">确认</button>
|
<button class="btn-cont" @click="submitCode">确认</button>
|
||||||
</div> -->
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -317,6 +321,10 @@ const handleScanError = (error) => {
|
||||||
uni.showToast({ title: error.message, icon: 'none' })
|
uni.showToast({ title: error.message, icon: 'none' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const moveNum = () => {
|
||||||
|
uni.navigateTo({ url: `/pages/back/backNum?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
||||||
|
}
|
||||||
|
|
||||||
const getMaInfoScan = () => {
|
const getMaInfoScan = () => {
|
||||||
let param = {
|
let param = {
|
||||||
qrCode: qrCode.value,
|
qrCode: qrCode.value,
|
||||||
|
|
@ -324,8 +332,13 @@ const getMaInfoScan = () => {
|
||||||
proId: taskInfo.value.proId,
|
proId: taskInfo.value.proId,
|
||||||
id: taskInfo.value.id,
|
id: taskInfo.value.id,
|
||||||
}
|
}
|
||||||
getMachine(param)
|
uni.request({
|
||||||
.then((res) => {
|
url: '/material/back_apply_info/getMachine',
|
||||||
|
method: 'get',
|
||||||
|
data: param,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
console.log(res.data[0])
|
console.log(res.data[0])
|
||||||
maCode.value = res.data[0].maCode
|
maCode.value = res.data[0].maCode
|
||||||
|
|
@ -334,10 +347,46 @@ const getMaInfoScan = () => {
|
||||||
maStatusName.value = res.data[0].maStatusName
|
maStatusName.value = res.data[0].maStatusName
|
||||||
maId.value = res.data[0].maId
|
maId.value = res.data[0].maId
|
||||||
typeId.value = res.data[0].typeId
|
typeId.value = res.data[0].typeId
|
||||||
|
}else{
|
||||||
|
uni.showModal({
|
||||||
|
title: '错误提示',
|
||||||
|
content: res.data.msg,
|
||||||
|
showCancel: false, // 不显示取消按钮
|
||||||
|
confirmText: '关闭',
|
||||||
|
success: (res) => {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// console.log('用户点击关闭')
|
||||||
|
// }
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
}
|
||||||
console.log(error)
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// getMachine(param)
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res)
|
||||||
|
// console.log(res.data[0])
|
||||||
|
// maCode.value = res.data[0].maCode
|
||||||
|
// typeName.value = res.data[0].typeName
|
||||||
|
// materialName.value = res.data[0].typeModelName
|
||||||
|
// maStatusName.value = res.data[0].maStatusName
|
||||||
|
// maId.value = res.data[0].maId
|
||||||
|
// typeId.value = res.data[0].typeId
|
||||||
|
// })
|
||||||
|
// .catch((error) => {
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '错误提示',
|
||||||
|
// content: error.data.msg,
|
||||||
|
// showCancel: false, // 不显示取消按钮
|
||||||
|
// confirmText: '关闭',
|
||||||
|
// success: (res) => {
|
||||||
|
// // if (res.confirm) {
|
||||||
|
// // console.log('用户点击关闭')
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
// // 扫码识别按钮
|
// // 扫码识别按钮
|
||||||
// const scanStart = () => {
|
// const scanStart = () => {
|
||||||
|
|
@ -424,6 +473,7 @@ const submitCode = () => {
|
||||||
// uni.navigateBack({
|
// uni.navigateBack({
|
||||||
// delta: 1 // 返回到已存在的页面
|
// delta: 1 // 返回到已存在的页面
|
||||||
// });
|
// });
|
||||||
|
scanStart()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res.msg, icon: 'none' })
|
uni.showToast({ title: res.msg, icon: 'none' })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -242,9 +242,10 @@ const submitCode = () => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.showToast({ title: '新增成功', icon: 'none' })
|
uni.showToast({ title: '新增成功', icon: 'none' })
|
||||||
uni.navigateBack({
|
uni.navigateTo({ url: `/pages/back/index` })
|
||||||
delta: 1, // 返回到已存在的页面
|
// uni.navigateBack({
|
||||||
})
|
// delta: 1, // 返回到已存在的页面
|
||||||
|
// })
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: res.msg, icon: 'none' })
|
uni.showToast({ title: res.msg, icon: 'none' })
|
||||||
}
|
}
|
||||||
|
|
@ -263,13 +264,53 @@ const deleteImage = (index) => {
|
||||||
//上传
|
//上传
|
||||||
const uploadImg = () => {
|
const uploadImg = () => {
|
||||||
const count = 3 - imgList.value.length // Calculate remaining slots
|
const count = 3 - imgList.value.length // Calculate remaining slots
|
||||||
uni.chooseImage({
|
if (count <= 0) {
|
||||||
count: count, // Allow to select up to remaining slots
|
uni.showToast({ title: '最多上传3张图片', icon: 'none' })
|
||||||
sizeType: ['original', 'compressed'],
|
return
|
||||||
sourceType: ['album', 'camera'],
|
}else{
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['拍照', '从相册选择'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const tempFilePaths = res.tempFilePaths
|
if (res.tapIndex === 0) {
|
||||||
tempFilePaths.forEach((filePath, index) => {
|
getCameraFj()
|
||||||
|
} else if (res.tapIndex === 1) {
|
||||||
|
// 从相册选择
|
||||||
|
getPhotoFj()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('操作菜单选择失败:', err)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 附件拍照
|
||||||
|
const getCameraFj = () => {
|
||||||
|
navigator.camera.getPicture(onCameraSuccessFj, onCameraErrorFj, {
|
||||||
|
quality: 50,
|
||||||
|
destinationType: window.Camera.DestinationType.DATA_URL,
|
||||||
|
sourceType: window.Camera.PictureSourceType.CAMERA,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 附件从相册选择
|
||||||
|
const getPhotoFj = () => {
|
||||||
|
navigator.camera.getPicture(onCameraSuccessFj, onCameraErrorFj, {
|
||||||
|
quality: 50,
|
||||||
|
destinationType: window.Camera.DestinationType.DATA_URL,
|
||||||
|
sourceType: window.Camera.PictureSourceType.SAVEDPHOTOALBUM,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onCameraErrorFj = (message) => {
|
||||||
|
console.log(message)
|
||||||
|
}
|
||||||
|
|
||||||
|
const onCameraSuccessFj = (file) => {
|
||||||
|
uploadSignUrlFj(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSignUrlFj = (file) => {
|
||||||
|
const filePath = "data:image/jpeg;base64," + file;
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: '/file/upload',
|
url: '/file/upload',
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
|
|
@ -286,9 +327,7 @@ const uploadImg = () => {
|
||||||
url: uploadRes.data.url,
|
url: uploadRes.data.url,
|
||||||
taskType: '10'
|
taskType: '10'
|
||||||
})
|
})
|
||||||
if (index === tempFilePaths.length - 1) {
|
|
||||||
uni.showToast({ title: '上传成功', icon: 'none' })
|
uni.showToast({ title: '上传成功', icon: 'none' })
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
uni.showToast({ title: '上传失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
|
|
@ -298,9 +337,49 @@ const uploadImg = () => {
|
||||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
uni.showToast({ title: '上传失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// uni.chooseImage({
|
||||||
|
// count: count, // Allow to select up to remaining slots
|
||||||
|
// sizeType: ['original', 'compressed'],
|
||||||
|
// sourceType: ['album', 'camera'],
|
||||||
|
// success: (res) => {
|
||||||
|
// const tempFilePaths = res.tempFilePaths
|
||||||
|
// tempFilePaths.forEach((filePath, index) => {
|
||||||
|
// uni.uploadFile({
|
||||||
|
// url: '/file/upload',
|
||||||
|
// filePath: filePath,
|
||||||
|
// name: 'file',
|
||||||
|
// success: (uploadRes) => {
|
||||||
|
// uploadRes = JSON.parse(uploadRes.data)
|
||||||
|
// if (uploadRes.code && uploadRes.code == 200) {
|
||||||
|
// imgList.value.push({
|
||||||
|
// url: filePath, // Show local path first
|
||||||
|
// serverUrl: uploadRes.data.url // Store server URL
|
||||||
|
// })
|
||||||
|
// bmFileInfos.value.push({
|
||||||
|
// name: uploadRes.data.name,
|
||||||
|
// url: uploadRes.data.url,
|
||||||
|
// taskType: '10'
|
||||||
|
// })
|
||||||
|
// if (index === tempFilePaths.length - 1) {
|
||||||
|
// uni.showToast({ title: '上传成功', icon: 'none' })
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// uni.showToast({ title: '上传失败', icon: 'none' })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// fail: (err) => {
|
||||||
|
// console.error('上传失败', err)
|
||||||
|
// uni.showToast({ title: '上传失败', icon: 'none' })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理扫描成功事件
|
// 处理扫描成功事件
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
@clickLeft="leftClick"
|
@clickLeft="leftClick"
|
||||||
>
|
>
|
||||||
<!-- 使用右侧插槽自定义提交按钮 -->
|
<!-- 使用右侧插槽自定义提交按钮 -->
|
||||||
<template #right>
|
<!-- <template #right>
|
||||||
<button
|
<button
|
||||||
class="submit-btn"
|
class="submit-btn"
|
||||||
@click="submitNum"
|
@click="submitNum"
|
||||||
>
|
>
|
||||||
确定
|
确定
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template> -->
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
<div class="card top-content" :class="{'is-expanded': isExpanded}">
|
||||||
|
|
@ -154,9 +154,9 @@
|
||||||
</uni-td>
|
</uni-td>
|
||||||
</uni-tr>
|
</uni-tr>
|
||||||
</uni-table>
|
</uni-table>
|
||||||
<!-- <div class="footer-btn">
|
<div class="footer-btn">
|
||||||
<button class="btn-cont" @click="submitNum">确认</button>
|
<button class="btn-cont" @click="submitNum">确认</button>
|
||||||
</div> -->
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue