Browse Source

修改检验明细附件不可删除

chensibo 3 weeks ago
parent
commit
e6bbab444c

+ 2 - 1
.env.dev

@@ -7,7 +7,8 @@ VUE_APP_TITLE = WMS开发环境
 # 芋道管理系统/开发环境
 # VUE_APP_BASE_API = 'http://192.168.1.94:48080'
 # VUE_APP_BASE_API = 'http://192.168.1.26:48080'
-VUE_APP_BASE_API = 'http://113.105.183.190:48028'
+# VUE_APP_BASE_API = 'http://113.105.183.190:48028'
+VUE_APP_BASE_API = 'http://113.105.183.190:15980'
 # VUE_APP_BASE_API = 'http://61.155.26.34:36936'
 # VUE_APP_BASE_API = 'http://127.0.0.1:48080'
 # VUE_APP_BASE_API = 'http://2227el9013.iok.la'

+ 4 - 9
src/views/wms/quality/iqcInspection/components/InspectAttachmentUpload.vue

@@ -67,15 +67,14 @@ export default {
   methods: {
     onOpen() {
       this.$nextTick(() => {
-        // 总是使用行ID调用接口获取附件列表
         if (this.rowData && this.rowData.id) {
           const id = this.rowData.id;
           getIqcInspectionDataDetailForPda({ id: id }).then((res) => {
             console.log("打印一下返回的数据", res);
             if (res.code === 0 && res.data) {
-              // 处理后端返回的数据,生成符合FileUpload组件要求的fileList
               const urlList = res.data.urlList || [];
               const fileIds = res.data.fileIds || [];
+
               this.$refs.fileUpload.fileList = urlList.map((url, index) => {
                 // 清理URL中的额外空格和括号
                 const cleanUrl = url.trim().replace(/[`]/g, "");
@@ -85,20 +84,16 @@ export default {
                   lastSlashIndex !== -1
                     ? cleanUrl.substring(lastSlashIndex + 1)
                     : cleanUrl;
-                console.log("打印一下fileName", fileName);
                 return {
-                  // name: fileName,
+                  id: fileIds[index] || "", // 关键修复:直接设置 id 字段
+                  name: { fileId: fileIds[index] || "" }, // 兼容 handleDelete 中的 name.fileId
                   sysName: fileName,
-                  url: {
-                    fileId: fileIds[index] || "",
-                    url: cleanUrl,
-                  },
+                  url: cleanUrl, // url 直接存字符串,不包对象
                 };
               });
             }
           });
         } else {
-          // 暂时使用传入的fileList作为后备
           this.$refs.fileUpload.fileList = this.fileList;
         }
         this.$refs.fileUpload.isUploadShow = this.isUploadShow;

+ 0 - 11
src/views/wms/quality/iqcInspection/components/InspectDetail.vue

@@ -78,17 +78,6 @@
           >{{ apiStatus == -1 ? "上传附件" : "查看附件" }}</el-button
         >
       </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button
-          v-hasPermi="['wms:delivery-notice-master:query']"
-          type="primary"
-          size="mini"
-          icon="el-icon-view"
-          :loading="supplierLoading"
-          @click="handleViewSupplierFile"
-          >供应商附件</el-button
-        >
-      </el-col> -->
       <el-col :span="1.5">
         <el-button
           type="primary"