Browse Source

Merge remote-tracking branch 'origin/master'

Reiskuchen 5 năm trước cách đây
mục cha
commit
ca04b6fe99

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldFileController.java

@@ -177,7 +177,7 @@ public class MouldFileController {
     public HttpRespMsg downloadfileList(UserVO userVO,HttpServletRequest request, HttpServletResponse response){
         HttpRespMsg msg = new HttpRespMsg();
         try {
-            msg = mouldFileService.dowloadFileList(userVO,request,response,downloadPath);
+            msg = mouldFileService.dowloadFileList(userVO,request,response,downloadPath,path);
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldFileService.java

@@ -28,6 +28,6 @@ public interface MouldFileService extends IService<MouldFile> {
     HttpRespMsg getFileList(int mouldId, Integer blongType, UserVO userVO);
     HttpRespMsg delFile(MouldFile mouldFile);
     HttpRespMsg getListByUserAndProjectId(UserVO userVO, PageUtil page);
-    HttpRespMsg dowloadFileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response,String downloadPath) throws IOException;
+    HttpRespMsg dowloadFileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response,String downloadPath,String path) throws IOException;
     HttpRespMsg addPartFile(UserVO userVO, String path, MultipartFile[] files);
 }

+ 4 - 4
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java

@@ -366,14 +366,14 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
     }
 
     @Override
-    public HttpRespMsg dowloadFileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response, String downloadPath) throws IOException {
+    public HttpRespMsg dowloadFileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response, String downloadPath,String path) throws IOException {
         HttpRespMsg msg = new HttpRespMsg();
         if (null != userVO.getIds()) {
             List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(userVO.getIds());
             for (Integer id : ids) {
                 Mould mould = mouldMapper.selectById(id);
                 List<MouldFile> mouldFiles = mouldFileMapper.selectList(new QueryWrapper<MouldFile>().eq("model_id", id).eq("state", 3));
-                feedBackDirectMultiDownload(request, response, downloadPath, mould, mouldFiles);
+                feedBackDirectMultiDownload(request, response, downloadPath, mould, mouldFiles,path);
             }
         }
         return msg;
@@ -453,7 +453,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
     }
 
 
-    public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles) throws IOException {
+    public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles,String oldFilePath) throws IOException {
         //压缩文件初始设置
         String path = downloadPath;
         String base_name = vo.getModelNo() + vo.getModelName();
@@ -463,7 +463,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
         //mouldFiles为根据前台传过来的信息,通过数据库查询所得出的pdf文件路径集合(具体到后缀),此处省略
         File[] files = new File[mouldFiles.size()];//
         for (int i = 0; i < mouldFiles.size(); i++) {
-            files[i] = new File(mouldFiles.get(i).getFileUrl());//获取所有需要下载的pdf
+            files[i] = new File(oldFilePath+mouldFiles.get(i).getFileUrl());//获取所有需要下载的pdf
         }
 
         // 创建临时压缩文件

+ 4 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldServiceImpl.java

@@ -420,13 +420,16 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
                 m.setId(mould.getId());
                 m.setEquipmentId(mould.getEquipmentId());
                 mouldMapper.updateById(m);
+                //通知资产方管理员
+                
+
             }else{
                 msg.setError("您没有该项权限");
             }
         }else{
             msg.setError("用户不存在或未登录");
         }
-        return null;
+        return msg;
     }
 
     //告警模板推送通用接口

+ 77 - 38
ys_vue/src/views/mold/moldDetail.vue

@@ -204,51 +204,43 @@
                         <el-table-column prop="isVulnerable" label="易损件" align="center" width="100" sortable>
                             <template slot-scope="scope">{{scope.row.isVulnerable==0?'否':'是'}}</template>
                         </el-table-column>
-                        <el-table-column prop="part3dFile.fileName" label="3D图档" width="200" sortable></el-table-column>
-                        <el-table-column prop="part2dFile.fileName" label="2D图档" width="200" sortable></el-table-column>
+                        <el-table-column prop="part3dFile.fileName" label="3D图档" width="200" sortable>
+                            <template slot-scope="scope" v-if="scope.row.part3dFile != null">
+                                <a class="download" :href="scope.row.part3dFile.fileUrl" :download="scope.row.part3dFile.fileName">{{scope.row.part3dFile.fileName}}</a>
+                            </template>
+                        </el-table-column>
+                        <el-table-column prop="part2dFile.fileName" label="2D图档" width="200" sortable>
+                            <template slot-scope="scope" v-if="scope.row.part2dFile != null">
+                                <a class="download" :href="scope.row.part2dFile.fileUrl" :download="scope.row.part2dFile.fileName">{{scope.row.part2dFile.fileName}}</a>
+                            </template>
+                        </el-table-column>
                         <el-table-column prop="indate" label="上传时间" width="200" align="center" sortable></el-table-column>
                         <el-table-column label="状态" width="120" align="center" sortable>
                             <template slot-scope="scope">
-                                <span v-if="scope.row.part3dFile != null && scope.row.part2dFile == null">
-                                    <span v-if="scope.row.part3dFile.state == -2">生产方审核不通过</span>
-                                    <span v-else-if="scope.row.part3dFile.state == -1">资产方审核不通过</span>
-                                    <span v-else-if="scope.row.part3dFile.state == 0">待双方审核</span>
-                                    <span v-else-if="scope.row.part3dFile.state == 1">待生产方审核</span>
-                                    <span v-else-if="scope.row.part3dFile.state == 2">待资产方审核</span>
-                                    <span v-else-if="scope.row.part3dFile.state == 3">审核通过</span>
-                                </span>
-                                <span v-if="scope.row.part3dFile == null && scope.row.part2dFile != null">
-                                    <span v-if="scope.row.part2dFile.state == -2">生产方审核不通过</span>
-                                    <span v-else-if="scope.row.part2dFile.state == -1">资产方审核不通过</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 0">待双方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 1">待生产方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 2">待资产方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 3">审核通过</span>
-                                </span>
-                                <span v-if="scope.row.part3dFile != null && scope.row.part2dFile != null">
-                                    <span v-if="scope.row.part2dFile.state == -2">生产方审核不通过</span>
-                                    <span v-else-if="scope.row.part2dFile.state == -1">资产方审核不通过</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 0">待双方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 1">待生产方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 2">待资产方审核</span>
-                                    <span v-else-if="scope.row.part2dFile.state == 3">审核通过</span>
-                                </span>
+                                <span v-if="scope.row.state == -2">生产方审核不通过</span>
+                                <span v-else-if="scope.row.state == -1">资产方审核不通过</span>
+                                <span v-else-if="scope.row.state == 0">待双方审核</span>
+                                <span v-else-if="scope.row.state == 1">待生产方审核</span>
+                                <span v-else-if="scope.row.state == 2">待资产方审核</span>
+                                <span v-else-if="scope.row.state == 3">审核通过</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="操作" width="200" align="center" sortable>
                             <template slot-scope="scope">
                                 <el-button size="small" 
-                                    v-if="approve == 1 && (scope.row.state == 0 || (scope.row.state == 1 && user.subordinateType == 1) || (scope.row.state == 2 && user.subordinateType == 0))" 
-                                    @click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
+                                    v-if="approve == 1 && (scope.row.state == 0 
+                                        || (scope.row.state == 1 && user.subordinateType == 1) 
+                                        || (scope.row.state == 2 && user.subordinateType == 0))" 
+                                    @click="checkOpenPort(scope.row)">审批</el-button>
                                 <el-button size="small" @click="editPort(scope.row)" v-if="scope.row.creatorId == user.id">
                                     修改
                                 </el-button>
-                                <el-button size="small" @click="dowloadfile(scope.row.id)" v-if="download == 1 && scope.row.state == 3">
+                                <!-- <el-button size="small" @click="dowloadfile(scope.row.id)" v-if="download == 1 && scope.row.state == 3 ">
                                     <a :href="scope.row.fileUrl" :download="scope.row.fileName">下载 </a>
-                                </el-button>
-                                <el-button size="small" 
+                                </el-button> -->
+                                <!-- <el-button size="small" 
                                     v-if="scope.row.uplodtorId == user.id && scope.row.state <= 0" 
-                                    @click="deleteFile(scope.row.id)" type="danger">删除</el-button>
+                                    @click="deleteFile(scope.row.id)" type="danger">删除</el-button> -->
                             </template>
                         </el-table-column>
                     </el-table>
@@ -630,7 +622,10 @@
                     flag: 1
                 },
 
-                files: []
+                files: [],
+
+                twoId: null,
+                threeId: null,
             };
         },
         methods: {
@@ -834,6 +829,22 @@
             checkOpen(id, name) {
                 this.activeArticleId = id;
                 this.activeFileName = name;
+                this.twoId = null;
+                this.threeId = null;
+                this.centerDialogVisible = true;
+            },
+
+            //打开审批窗口
+            checkOpenPort(row) {
+                if(row.part2dFile != null) {
+                    this.twoId = row.part2dFile.id
+                }
+
+                if(row.part3dFile != null) {
+                    this.threeId = row.part3dFile.id
+                }
+                this.activeArticleId = null;
+                this.activeFileName = null;
                 this.centerDialogVisible = true;
             },
 
@@ -848,9 +859,21 @@
 
             //审批文件
             check(adoption) {
+                if(this.activeArticleId != null) {
+                    this.onSubMit(this.activeArticleId , adoption , 0)
+                }
+                if(this.twoId != null) {
+                    this.onSubMit(this.twoId , adoption , 1)
+                }
+                if(this.threeId != null) {
+                    this.onSubMit(this.threeId , adoption , 1)
+                }
+            },
+
+            onSubMit(id , type , from) {
                 this.http.post( this.port.mold.moldFileCheck, {
-                    mouldFileId: this.activeArticleId,
-                    isPass: adoption ? 1 : 0 //通过为1 不通过为0
+                    mouldFileId: id,
+                    isPass: type ? 1 : 0 //通过为1 不通过为0
                 },
                 res => {
                     if (res.code == "ok") {
@@ -859,7 +882,11 @@
                             message: "审批成功",
                             type: "success"
                         });
-                        this.getDocument();
+                        if(from == 0){
+                            this.getDocument();
+                        } else {
+                            this.getPartList();
+                        }
                     } else {
                         this.$message({
                             message: res.msg,
@@ -1005,7 +1032,6 @@
                     }
                 })
             },
-
             
             //打开零件修改
             editPort(row) {
@@ -1063,7 +1089,14 @@
                 },
                 res => {
                     if (res.code == "ok") {
-                        this.documents.part = res.data;
+                        var list = res.data;
+                        for(var i in list){
+                            if(list[i].state == null){
+                                list[i].state = 100;
+                            }
+                        }
+                        console.log(list)
+                        this.documents.part = list;
                     } else {
                         this.$message({
                             message: res.msg,
@@ -1239,6 +1272,12 @@
         cursor: pointer;
     }
 
+    .download {
+        text-decoration:none;
+        color: #20a0ff;
+        cursor: pointer;
+    }
+
     .info {
         color: grey;
     }