Sfoglia il codice sorgente

文档下载页面 获取信息

Reiskuchen 5 anni fa
parent
commit
05426b6d17
2 ha cambiato i file con 77 aggiunte e 48 eliminazioni
  1. 3 3
      ys_vue/src/port.js
  2. 74 45
      ys_vue/src/views/mold/moldDownload.vue

+ 3 - 3
ys_vue/src/port.js

@@ -37,12 +37,12 @@ export default {
         addMold: '/mould/addOrUpdate', //添加/修改模具设备
         molds: '/mould/list', //模具列表
         modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
-
         moldDetail: '/mould/detail', //模具详情
-        moldFileList: '/mouldfile/list', //获取模具文档*
+        moldFileList: '/mouldfile/list', //获取模具文档
         moldFileListAll: '/mouldfile/allList', //获取全部模具文档
-        moldFileUpload: '/mouldfile/uploadFile', //上传模具文档*
+        moldFileUpload: '/mouldfile/uploadFile', //上传模具文档
         moldFileDowload: '/mouldfile/dowloadFile', //模具文档的下载
+        moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
         moldFileCheck: '/mouldfile/check', //审批模具文档 
         moldFileDelete: '/mouldfile/delFile', //项目文档的删除
         moldOperationList: '/mouldoperationdynamics/list', //项目文档的删除

+ 74 - 45
ys_vue/src/views/mold/moldDownload.vue

@@ -3,19 +3,8 @@
     <!--工具条-->
     <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
       <el-form :inline="true" :model="filters">
-        <el-col :span="2">
-          <el-form-item>
-            <el-select v-model="filters.value" clearable placeholder="文档类型">
-              <el-option label="模具3D图档" value="0"></el-option>
-              <el-option label="模具2D图档" value="1"></el-option>
-              <el-option label="零件3D图档" value="2"></el-option>
-              <el-option label="零件2D图档" value="3"></el-option>
-              <el-option label="模具保养方案" value="4"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
         <el-form-item>
-          <el-input v-model="filters.name" placeholder="请输入名称进行搜索"></el-input>
+          <el-input v-model="filters.name" placeholder="请输入模具名称进行搜索"></el-input>
         </el-form-item>
         <el-form-item>
           <el-button type="primary">查询</el-button>
@@ -41,7 +30,7 @@
 
     <!--列表-->
     <el-table
-      :data="moulds"
+      :data="documents"
       :height="tableHeight"
       highlight-current-row
       v-loading="listLoading"
@@ -50,40 +39,40 @@
     >
       <el-table-column type="selection" width="40"></el-table-column>
       <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column width="200" label="模具名称" prop="name"></el-table-column>
+      <el-table-column width="200" label="模具名称" prop="modelName"></el-table-column>
       <el-table-column width="200" label="模具3D图档">
         <template slot-scope="scope">
-          <span v-if="scope.row.states[0] == 0">未上传</span>
-          <span v-else-if="scope.row.states[0] == 1">审批中</span>
-          <span v-else>通过</span>
+          <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
+          <span v-else-if="scope.row.mould3DFiles.state == 3">已通过</span>
+          <span v-else>通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="模具2D图档">
         <template slot-scope="scope">
-          <span v-if="scope.row.states[1] == 0">未上传</span>
-          <span v-else-if="scope.row.states[1] == 1">审批中</span>
-          <span v-else>通过</span>
+          <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
+          <span v-else-if="scope.row.mould2DFiles.state == 3">已通过</span>
+          <span v-else>通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="零件3D图档">
         <template slot-scope="scope">
-          <span v-if="scope.row.states[2] == 0">未上传</span>
-          <span v-else-if="scope.row.states[2] == 1">审批中</span>
-          <span v-else>通过</span>
+          <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
+          <span v-else-if="scope.row.sparepart3DFiles.state == 3">已通过</span>
+          <span v-else>通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="零件2D图档">
         <template slot-scope="scope">
-          <span v-if="scope.row.states[3] == 0">未上传</span>
-          <span v-else-if="scope.row.states[3] == 1">审批中</span>
-          <span v-else>通过</span>
+          <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
+          <span v-else-if="scope.row.sparepart2DFiles.state == 3">已通过</span>
+          <span v-else>通过</span>
         </template>
       </el-table-column>
       <el-table-column width="200" label="保养方案">
         <template slot-scope="scope">
-          <span v-if="scope.row.states[4] == 0">未上传</span>
-          <span v-else-if="scope.row.states[4] == 1">审批中</span>
-          <span v-else>通过</span>
+          <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
+          <span v-else-if="scope.row.maintainFiles.state == 3">已通过</span>
+          <span v-else>通过</span>
         </template>
       </el-table-column>
     </el-table>
@@ -108,20 +97,14 @@ import util from "../../common/js/util";
 export default {
   data() {
     return {
-      moulds: [
-        //临时数据
-        { id: 1, name: "墨盒类型1", states: [0, 1, 2, 0, 1] },
-        { id: 2, name: "墨盒类型2", states: [2, 0, 1, 2, 0] },
-        { id: 3, name: "墨盒类型3", states: [1, 2, 0, 1, 2] },
-        { id: 4, name: "墨盒类型4", states: [0, 1, 2, 0, 1] },
-        { id: 5, name: "墨盒类型5", states: [2, 0, 1, 2, 0] },
-        { id: 6, name: "墨盒类型6", states: [2, 2, 2, 2, 2] }
-      ],
+      documents: [],
       filters: {
         name: "",
         value: ""
       },
       listLoading: false,
+      page: 1,
+      size: 20,
       total: 0,
       tableHeight: 0,
       selectedArray: []
@@ -131,23 +114,69 @@ export default {
     //分页
     handleCurrentChange(val) {
       this.page = val;
-      // this.getUsers();
+      this.getFileList();
     },
     handleSizeChange(val) {
       this.size = val;
-      // this.getUsers();
+      this.getFileList();
     },
-    getFileList() {
+    //获取列表
+    getFileList(keyword) {
       this.http.post(
-        this.port.mold.moldFileListAll,
-        {},
+        this.port.mold.moldFileDowloadList,
+        {
+          keyName: keyword,
+          pageSize: this.size,
+          pageNum: this.page
+        },
         res => {
           if (res.code == "ok") {
             this.$message({
               message: "安排上了",
               type: "success"
             });
-            console.log(res);
+            this.documents = res.data.list;
+            //对于拿到的所有数据
+            this.documents.forEach(file => {
+              var mould2DFilesState = true;
+              var mould3DFilesState = true;
+              var sparepart2DFilesState = true;
+              var sparepart3DFilesState = true;
+              var maintainFilesState = true;
+              //看看每种文档中的所有文件
+              file.mould2DFiles.forEach(item => {
+                if (item.state != 3) {
+                  mould2DFilesState = false;
+                }
+              });
+              file.mould3DFiles.forEach(item => {
+                if (item.state != 3) {
+                  mould3DFilesState = false;
+                }
+              });
+              file.sparepart2DFiles.forEach(item => {
+                if (item.state != 3) {
+                  sparepart2DFilesState = false;
+                }
+              });
+              file.sparepart3DFiles.forEach(item => {
+                if (item.state != 3) {
+                  sparepart3DFilesState = false;
+                }
+              });
+              file.maintainFiles.forEach(item => {
+                if (item.state != 3) {
+                  maintainFilesState = false;
+                }
+              });
+              //把计算好的状态装进这个模具对象中
+              file.mould2DFilesState = mould2DFilesState;
+              file.mould3DFilesState = mould3DFilesState;
+              file.sparepart2DFilesState = sparepart2DFilesState;
+              file.sparepart3DFilesState = sparepart3DFilesState;
+              file.maintainFilesState = maintainFilesState;
+            });
+            // console.log(this.documents);
           } else {
             this.$message({
               message: res.msg,
@@ -203,7 +232,7 @@ export default {
     this.tableHeight = height - 210;
   },
   mounted() {
-    // this.getFileList();
+    this.getFileList();
   }
 };
 </script>