浏览代码

前端调整维修工单

lipenghui 4 月之前
父节点
当前提交
6a62f9e160

+ 3 - 0
src/api/infra/file/index.ts

@@ -38,3 +38,6 @@ export const createFile = (data: any) => {
 export const updateFile = (data: any) => {
   return request.upload({ url: '/infra/file/upload', data })
 }
+export const updateFilePath = (data: any) => {
+  return request.upload({ url: '/infra/file/upload/path', data })
+}

+ 3 - 1
src/components/UploadFile/src/useUpload.ts

@@ -80,10 +80,12 @@ export const useUpload = () => {
           return { data: presignedInfo.url }
         })
     } else {
+      debugger
       // 模式二:后端上传
       // 重写 el-upload httpRequest 文件上传成功会走成功的钩子,失败走失败的钩子
       return new Promise((resolve, reject) => {
-        FileApi.updateFile({ file: options.file })
+        FileApi.updateFilePath({ file: options.file })
+        // FileApi.updateFile({ file: options.file })
           .then((res) => {
             if (res.code === 0) {
               resolve(res)

+ 1 - 1
src/views/pms/failure/IotFailureReportForm.vue

@@ -72,7 +72,7 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="图片" prop="pic">
-            <UploadImg v-model="formData.pic" height="60px" width="28em" />
+            <UploadImg v-model="formData.pic" height="60px" />
           </el-form-item>
         </el-col>
         <el-col :span="24">

+ 1 - 1
src/views/pms/maintain/IotMaintainDetail.vue

@@ -221,7 +221,7 @@ const drawerVisible = ref<boolean>(false)
 const showDrawer = ref()
 const list = ref<IotMaintainMaterialVO[]>([]) // 列表的数据
 const { params, name } = useRoute() // 查询参数
-const id = params.id
+const id = params.id||props.id
 const formData = ref({
   id: undefined,
   failureCode: undefined,