From cd9dae5c7db49c3dba61609e7188a6b29a635c08 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期一, 12 十二月 2022 10:01:43 +0800
Subject: [PATCH] 修改绑定参数

---
 src/views/hiddenDangerRectification/index.vue |   82 ++++++++++++++++++++++++++--------------
 1 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/src/views/hiddenDangerRectification/index.vue b/src/views/hiddenDangerRectification/index.vue
index c7e49ca..6f72fa9 100644
--- a/src/views/hiddenDangerRectification/index.vue
+++ b/src/views/hiddenDangerRectification/index.vue
@@ -141,7 +141,8 @@
                 <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询
                 </el-button>
                 <el-button type="primary" class="btns" size="small" @click="reset()">重置</el-button>
-                <el-button type="primary" class="btns" size="small" icon="el-icon-upload2" @click="exportData">导出excel</el-button>
+                <el-button type="primary" class="btns" size="small" icon="el-icon-upload2" @click="exportData">导出excel
+                </el-button>
             </el-form-item>
         </el-form>
         <el-row class="title-center">
@@ -162,11 +163,11 @@
             <el-table-column label="隐患项目" align="center">
                 <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                     <template slot-scope="scope">
-                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
-                        <label>{{ scope.row.check_class}}</label>
+                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
+                        <label>{{ scope.row.check_class }}</label>
                     </template>
                 </el-table-column>
-                <el-table-column prop="address" label="地点"   align="center"></el-table-column>
+                <el-table-column prop="address" label="地点" align="center"></el-table-column>
                 <el-table-column prop="ht_content" label="内容" width="150" align="center">
                     <template slot-scope="scope">
                         <el-popover trigger="hover" placement="top">
@@ -195,13 +196,16 @@
                 </el-table-column>
                 <el-table-column prop="ht_branch" label="隐患部门" align="center"></el-table-column>
                 <el-table-column prop="duty_officer" label="责任人" align="center"></el-table-column>
-                <el-table-column prop="alter_time" label="限改时间" width="120" :formatter="formatColumnDate" align="center"></el-table-column>
+                <el-table-column prop="alter_time" label="限改时间" width="120" :formatter="formatColumnDate"
+                                 align="center"></el-table-column>
             </el-table-column>
             <el-table-column label="整改情况" align="center">
-                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
+                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="120"
+                                 align="center"></el-table-column>
                 <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"></el-table-column>
                 <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"></el-table-column>
-                <el-table-column prop="CALLBACKTIME" label="复查时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
+                <el-table-column prop="CALLBACKTIME" label="复查时间" :formatter="formatColumnDate" width="120"
+                                 align="center"></el-table-column>
             </el-table-column>
             <el-table-column label="隐患处理状态" align="center">
                 <template slot-scope="scope">
@@ -215,7 +219,7 @@
             <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
             <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
             <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
-            <el-table-column prop="date" label="流程操作" align="center">
+            <el-table-column prop="date" label="流程操作" align="center" fixed="right">
                 <template slot-scope="scope">
                     <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                 </template>
@@ -223,7 +227,7 @@
         </el-table>
         <!--申请延期弹窗-->
         <el-dialog
-            title="提示"
+            title="申请延期"
             :visible.sync="dialogVisible"
             :close-on-click-modal="false"
             width="30%"
@@ -249,6 +253,7 @@
                         <el-form-item label="附件上传" prop="desc">
                             <el-upload
                                 class="upload-demo"
+                                action="https://jsonplaceholder.typicode.com/posts/"
                                 ref="upload"
                                 :http-request="uploadSectionFile"
                                 :on-preview="handlePreview"
@@ -258,7 +263,7 @@
                                 :auto-upload="true"
                             >
                                 <el-button slot="trigger" size="small" type="primary" class="btns">选择文件</el-button>
-                                <div slot="tip" class="el-upload__tip">只能上传.jpg,.gif,.bmp,.png,.jpeg格式的图片</div>
+                                <div slot="tip" class="el-upload__tip">只能上传.jpg,.gif,.bmp,.png,.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip格式的图片</div>
                             </el-upload>
                         </el-form-item>
                     </el-col>
@@ -293,7 +298,7 @@
     </div>
 </template>
 <script>
-import {getPageList, uploadFile, saveDelayApply,danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
+import {getPageList, uploadFile, saveDelayApply, danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
 import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
 
 export default {
@@ -312,7 +317,8 @@
             YHBMList: [],
             YHJBList: [],
             tableData: [],
-            loading:false,
+            fileNameList: [],
+            loading: false,
             listQuery: {
                 page: 1,
                 limit: 10,
@@ -508,7 +514,7 @@
         handleClick(row) {
             this.$router.push({
                 path: "/sendHiddenDangerList",
-                query:{"id":row.id}
+                query: {"id": row.id}
             })
         },
         handleClose(done) {
@@ -520,17 +526,22 @@
                 });
         },
         handleRemove(file, fileList) {
-            console.log(file, fileList)
+            var fileUidList = [];
+            fileList.forEach(file => {
+                fileUidList.push(file.uid);
+            })
+            this.fileNameList = this.fileNameList.filter(n => fileUidList.indexOf(n.uid) != -1);
         },
         handlePreview(file) {
             console.log(file)
         },
         beforeUpload(file) {
             var FileExt = file.name.replace(/.+\./, "");
-            if (['jpg', 'png', 'bmp', 'gif', 'jpeg'].indexOf(FileExt.toLowerCase()) === -1) {
+            //.jpg,.gif,.bmp,.png,.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip
+            if (['jpg', 'png', 'bmp', 'gif', 'jpeg','doc','docx','pdf','ppt','xls','pptx','xls','xlsx','rar','zip'].indexOf(FileExt.toLowerCase()) === -1) {
                 this.$message({
                     type: 'warning',
-                    message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
+                    message: '请上传后缀名为jpg,gif,bmp,png,doc,docx,pdf,ppt,pptx,xls,xlsx,rar,zip的图片!'
                 });
                 return false;
             }
@@ -552,6 +563,11 @@
         applyDelaySave() {
             this.$refs["ruleForm"].validate((valid) => {
                 if (valid) {
+                    this.ruleForm.realFileName = "";
+                    this.fileNameList.forEach(n => {
+                        this.ruleForm.realFileName += n.fileName + ",";
+                    })
+                    this.ruleForm.realFileName.substring(0, this.ruleForm.realFileName.length - 1);
                     saveDelayApply(this.ruleForm).then(res => {
                         this.dialogVisible = false;
                         this.$message({
@@ -574,21 +590,27 @@
                 if (data.ok) {
                     var fileName = data.data.fileName[0];
                     if (!fileName.endsWith("a62b")) {
-                        fileName = fileName + param.file.realFileName;
+                        fileName = fileName + "a62b";
                     }
-                    that.ruleForm.realFileName = that.ruleForm.realFileName + "," + fileName;
+                    var fileObj = {
+                        "fileName": fileName,
+                        "uid": param.file.uid
+                    }
+                    this.fileNameList.push(fileObj);
+                    // that.ruleForm.realFileName = that.ruleForm.realFileName + "," + fileName;
                 }
-            }).error(res => {
-                this.$message({
-                    type: 'error',
-                    message: '附件上传失败,请重试!'
-                });
             })
+            //     .error(res => {
+            //     this.$message({
+            //         type: 'error',
+            //         message: '附件上传失败,请重试!'
+            //     });
+            // })
         },
         //方法区
         formatDate(data) {
             // 获取单元格数据
-            if(data == null) {
+            if (data == null) {
                 return null
             }
             let dt = new Date(data)
@@ -599,13 +621,13 @@
         formatColumnDate(row, column) {
             // 获取单元格数据
             let data = row[column.property]
-            if(data == null) {
+            if (data == null) {
                 return null
             }
             let dt = new Date(data)
             return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
         },
-        exportData(){
+        exportData() {
             this.listLoading = true
             var requestData = JSON.parse(JSON.stringify(this.listQuery));
             requestData.export_type = 2;
@@ -627,10 +649,10 @@
                 console.log(err)
             })
         },
-        showDetails(row){
+        showDetails(row) {
             this.$router.push({
                 path: "/dangerDetails",
-                query:{"id":row.id}
+                query: {"id": row.id}
             })
         }
     }
@@ -661,10 +683,12 @@
     max-height: 80px;
     overflow-y: auto
 }
-.blue-font-color:hover{
+
+.blue-font-color:hover {
     cursor: pointer;
     color: blue;
 }
+
 /deep/ .el-dialog .button .el-form-item__content {
     margin-left: 0;
 }

--
Gitblit v1.9.2