工单信息修正、小程序登录修正

This commit is contained in:
2025-12-28 14:58:09 +08:00
parent 7eddf00705
commit 8448a801ce
11 changed files with 62 additions and 27 deletions

View File

@@ -816,7 +816,7 @@ function chooseAssignFile() {
const uploadRes = await fileAPI.uploadFile(file.path, {
module: 'workcase',
optsn: workcase.workcaseId || 'temp'
})
}, file.name)
if (uploadRes.success && uploadRes.data?.fileId) {
assignForm.files.push({
name: file.name,
@@ -842,12 +842,12 @@ function chooseAssignFile() {
uni.showLoading({ title: '上传中...' })
try {
for (const filePath of imgRes.tempFilePaths) {
const fileName = filePath.split('/').pop() || '图片.jpg'
const uploadRes = await fileAPI.uploadFile(filePath, {
module: 'workcase',
optsn: workcase.workcaseId || 'temp'
})
}, fileName)
if (uploadRes.success && uploadRes.data?.fileId) {
const fileName = filePath.split('/').pop() || '图片'
assignForm.files.push({
name: fileName,
fileId: uploadRes.data.fileId
@@ -974,12 +974,13 @@ async function chooseFaultImages() {
// 上传图片到服务器
uni.showLoading({ title: '上传中...' })
try {
const uploadPromises = res.tempFilePaths.map(filePath =>
fileAPI.uploadFile(filePath, {
const uploadPromises = res.tempFilePaths.map((filePath, index) => {
const fileName = `故障图片_${Date.now()}_${index}.jpg`
return fileAPI.uploadFile(filePath, {
module: 'workcase',
optsn: workcase.workcaseId || 'temp'
})
)
}, fileName)
})
const results = await Promise.all(uploadPromises)
@@ -1022,10 +1023,11 @@ async function chooseNameplateImage() {
// 上传铭牌照片到服务器
uni.showLoading({ title: '上传中...' })
try {
const fileName = `设备铭牌_${Date.now()}.jpg`
const result = await fileAPI.uploadFile(res.tempFilePaths[0], {
module: 'workcase',
optsn: workcase.workcaseId || 'temp'
})
}, fileName)
if (result.success && result.data?.fileId) {
workcase.deviceNamePlateImg = result.data.fileId
@@ -1187,7 +1189,7 @@ async function chooseProcessFile() {
const result = await fileAPI.uploadFile(file.path, {
module: 'workcase',
optsn: workcase.workcaseId || 'temp'
})
}, file.name)
if (result.success && result.data?.fileId) {
return {
name: file.name,