zy 2 år sedan
förälder
incheckning
f2143f0ea6

+ 9 - 0
neim-ui/src/api/biz/manualEntry/projectEvolveEntry.js

@@ -16,3 +16,12 @@ export function projectProgressParse(data) {
   })
 }
 
+/*上传项目附件*/
+export function uploadProjectAnnex(data) {
+  return request({
+    url: '/manualEntry/uploadProjectAnnex',
+    method: 'post',
+    data: data
+  })
+}
+

+ 93 - 24
neim-ui/src/views/manualEntry/projectEvolveEntry/index.vue

@@ -15,24 +15,10 @@
         </el-table-column>
         <el-table-column label="操作" align="center">
           <template slot-scope="scope">
-            <el-upload
-              :http-request="dataUpload"
-              :before-upload="beforeUpload"
-              class="el-upload-button"
-              action=""
-              ref="upload"
-            >
-              <el-button
-                @click="row=scope.row"
-                slot="trigger"
-                size="mini"
-                type="text"
-                icon="el-icon-upload2"
-              >上传进展
-              </el-button>
-            </el-upload>
-            <el-button icon="el-icon-download" @click="handleClick(scope.row)" type="text" size="small">下载最新进展</el-button>
-<!--            <el-button icon="el-icon-upload2" @click="handleClick(scope.row)" type="text" size="small"></el-button>-->
+            <el-button @click="uploadEvolve(scope.row)" slot="trigger" size="mini" type="text" icon="el-icon-upload2">上传进展</el-button>
+            <el-button icon="el-icon-download" :loading="exportLoading" @click="handleAllExport(scope.row)" type="text" size="small">下载最新进展
+            </el-button>
+            <!--            <el-button icon="el-icon-upload2" @click="handleClick(scope.row)" type="text" size="small"></el-button>-->
             <el-button icon="el-icon-upload2" @click="handleClick(scope.row)" type="text" size="small">上传附件</el-button>
           </template>
         </el-table-column>
@@ -48,20 +34,69 @@
           :total=page.total>
         </el-pagination>
       </div>
+      <el-dialog
+        title="上传项目进展"
+        :visible.sync="dialogVisible"
+        width="30%">
+        <div style="text-align: center">
+          <el-upload
+            :http-request="dataUpload"
+            :before-upload="beforeUpload"
+            ref="upload"
+            drag
+            action=""
+            multiple>
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+            <div class="el-upload__tip" slot="tip">只能上传xls文件,且不超过500kb</div>
+          </el-upload>
+        </div>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        </span>
+      </el-dialog>
+      <el-dialog
+        title="上传项目进展附件"
+        :visible.sync="fjDialogVisible"
+        width="30%">
+        <div style="text-align: center">
+          <el-upload
+            :http-request="fjDataUpload"
+            :before-upload="beforeUpload"
+            ref="upload"
+            drag
+            action=""
+            multiple>
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+            <div class="el-upload__tip" slot="tip">文件不超过500kb</div>
+          </el-upload>
+        </div>
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="fjDialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="fjDialogVisible = false">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </el-card>
 </template>
 
 <script>
-import {getProjectInfo,projectProgressParse} from "@/api/biz/manualEntry/projectEvolveEntry";
+import {getProjectInfo,projectProgressParse,uploadProjectAnnex} from "@/api/biz/manualEntry/projectEvolveEntry";
 
 export default {
   // 项目进展录入
   name: "index",
-  data(){
-    return{
-      row:'',
-      tableData:[],
+  data() {
+    return {
+      row: '',
+      tableData: [],
+      dialogVisible: false,
+      fjDialogVisible:false,
+      exportLoading:false,
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -92,6 +127,7 @@ export default {
       }
       return isLt2M
     },
+    /*文件上传*/
     dataUpload(item) {
       this.fullscreenLoading = true
       const formData = new FormData()
@@ -109,8 +145,41 @@ export default {
         }
       })
     },
+    /*附件的上传*/
+    fjDataUpload(item) {
+      this.fullscreenLoading = true
+      const formData = new FormData()
+      formData.append("id", this.row.id)
+      uploadProjectAnnex(formData).then((response) => {
+        this.$refs.upload.clearFiles()
+        this.fullscreenLoading = false
+        if (response && response.code === 200) {
+          // this.getAllWindTowerInfo()
+          this.$message.success(response.msg)
+        } else {
+          this.$message.error(response.msg)
+        }
+      })
+    },
+    uploadEvolve(row){
+      this.row = row
+      this.dialogVisible = true
+    },
     handleClick(row) {
-      console.log(row);
+      this.row = row
+      this.dialogVisible = true
+    },
+    /*下载最新项目进展*/
+    handleAllExport(row) {
+      this.exportLoading = true
+      download.exportAllData("/manualEntry/exportProjectEvolve", row.id);
+      this.downPdfTimer = setInterval(() => {
+        if (Cookies.get('exportLoading')) {
+          this.exportLoading = false
+          clearInterval(this.downPdfTimer)
+          Cookies.remove("exportLoading");
+        }
+      }, 500)
     },
     /*pageSize改变*/
     handleSizeChange(val) {