From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 05 五月 2023 08:55:46 +0800 Subject: [PATCH] 修改 --- src/views/hiddenDangerRectification/index.vue | 760 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 476 insertions(+), 284 deletions(-) diff --git a/src/views/hiddenDangerRectification/index.vue b/src/views/hiddenDangerRectification/index.vue index 7f78602..6f72fa9 100644 --- a/src/views/hiddenDangerRectification/index.vue +++ b/src/views/hiddenDangerRectification/index.vue @@ -5,7 +5,7 @@ <el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input> </el-form-item> <el-form-item label="检查单位"> - <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeJCDW"> + <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeJCDW"> <el-option v-for="item in JCDWList" :key="item.value" @@ -45,7 +45,7 @@ v-for="item in YHBMList" :key="item.branch_id" :label="item.branch_name" - :value="item.branch_id"> + :value="item.branch_name"> </el-option> </el-select> </el-form-item> @@ -117,59 +117,97 @@ </el-form-item>--> <el-form-item label="检查时间"> <el-col :span="11"> - <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker> + <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart" + style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker> </el-col> <el-col style="text-align:center" :span="2">-</el-col> <el-col :span="11"> - <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker> + <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd" + style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker> </el-col> </el-form-item> <el-form-item label="限改时间"> <el-col :span="11"> - <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker> + <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart" + value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker> </el-col> <el-col style="text-align:center" :span="2">-</el-col> <el-col :span="11"> - <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker> + <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd" + value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker> </el-col> </el-form-item> <el-form-item style="text-align:center;padding:0 50px"> - <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询</el-button> + <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">导出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"> - <el-col :span="24" style="text-align:right;"> - <el-button class="btns" type="primary" size="small" @click="dialogVisible=true">申请延期</el-button> + <el-col :span="24" style="text-align:right;"> + <el-button class="btns" type="primary" size="small" @click="applyDelay()">申请延期</el-button> </el-col> </el-row> - <el-table :data="tableData" style="width: 100%"> + <el-table :data="tableData" ref="dangerRectificationTable" style="width: 100%" v-loading="loading"> <el-table-column type="selection" width="55" align="center"></el-table-column> - <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column> - <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column> - <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column> + <el-table-column prop="number" label="编号" align="center" width="120"> + <template slot-scope="scope"> + <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div> + </template> + </el-table-column> + <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column> + <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column> <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column> <el-table-column label="隐患项目" align="center"> - <el-table-column prop="check_date" label="检查时间" width="120" align="center"></el-table-column> - <el-table-column prop="address" label="地点" align="center"> </el-table-column> - <el-table-column prop="ht_content" label="内容" align="center"> </el-table-column> - <el-table-column prop="ht_typesub" label="类别" align="center"> </el-table-column> - <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column> + <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> + </template> + </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"> + <p>{{ scope.row.ht_content }}</p> + <div slot="reference" class="name-wrapper">{{ + scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content + }} + </div> + </el-popover> + </template> + </el-table-column> + <el-table-column prop="ht_typesub" label="类别" align="center"></el-table-column> + <el-table-column prop="ht_level" label="级别" align="center"></el-table-column> </el-table-column> <el-table-column label="整改计划" align="center"> - <el-table-column prop="measure" label="整改措施" align="center"> </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" align="center"></el-table-column> + <el-table-column prop="measure" label="整改措施" width="150" align="center"> + <template slot-scope="scope"> + <el-popover trigger="hover" placement="top"> + <p>{{ scope.row.measure }}</p> + <div slot="reference" class="name-wrapper">{{ + scope.row.measure != null && scope.row.measure.length > 10 ? scope.row.measure.substring(0, 8) + "...." : scope.row.measure + }} + </div> + </el-popover> + </template> + </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> <el-table-column label="整改情况" align="center"> - <el-table-column prop="ACCOMPLISHTIME" label="完成时间" 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="复查时间" 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> - <el-table-column label="隐患处理状态" align="center"> + <el-table-column label="隐患处理状态" align="center"> <template slot-scope="scope"> <span v-if="scope.row.step =='1'">初始状态</span> <span v-if="scope.row.step =='2'">整改中</span> @@ -177,11 +215,11 @@ <span v-if="scope.row.step =='end'">处理结束</span> </template> </el-table-column> - <el-table-column prop="date" label="是否关联" align="center"> </el-table-column> - <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"></el-table-column> + <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" fixed="right"> <template slot-scope="scope"> <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button> </template> @@ -189,19 +227,21 @@ </el-table> <!--申请延期弹窗--> <el-dialog - title="提示" + title="申请延期" :visible.sync="dialogVisible" :close-on-click-modal="false" width="30%" :before-close="handleClose"> - <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> + <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm"> <el-row> <el-col :span="16" :offset="3"> - <el-form-item label="申请限改时间" prop="name"> + <el-form-item label="申请限改时间" prop="application_time"> <el-date-picker - v-model="value1" + v-model="ruleForm.application_time" + :picker-options="pickerOptions" type="date" - :disabled="true" + :disabled="false" + value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%"> </el-date-picker> @@ -213,15 +253,17 @@ <el-form-item label="附件上传" prop="desc"> <el-upload class="upload-demo" - ref="upload" action="https://jsonplaceholder.typicode.com/posts/" + ref="upload" + :http-request="uploadSectionFile" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="fileList" :before-upload="beforeUpload" - :auto-upload="true"> + :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> @@ -229,12 +271,12 @@ <el-row> <el-col :span="16" :offset="3"> <el-form-item label="备注" prop="desc"> - <el-input class="textarea" type="textarea" v-model="ruleForm.desc"></el-input> + <el-input class="textarea" type="textarea" v-model="ruleForm.remark"></el-input> </el-form-item> </el-col> </el-row> <div style="text-align: center"> - <el-button class="btns" size="small" type="primary" @click="dialogVisible = false">保存</el-button> + <el-button class="btns" size="small" type="primary" @click="applyDelaySave()">保存</el-button> <el-button size="small" @click="dialogVisible = false">关闭</el-button> </div> </el-form> @@ -256,253 +298,403 @@ </div> </template> <script> - import {getPageList} from "@/api/sgyhpczl/hiddenDangerRectification"; - import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect"; - export default { - data() { - return { - reList:[{label:"未关联",value:0}], - options: [], - form:{}, - value1:"", - llrList:[], - JCDWList:[{label:"众泰",value:0},{label:"上级单位",value:1}], - JCBMList:[], - YHLXList:[], - BCList:[], - JCLBList:[], - YHBMList:[], - YHJBList:[], - tableData: [], - listQuery:{ - page:1, - limit:10, - form:{ - ht_community:"众泰煤焦化" - }, +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 { + data() { + return { + reList: [{label: "未关联", value: 0}], + options: [], + form: {}, + value1: "", + llrList: [], + JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}], + JCBMList: [], + YHLXList: [], + BCList: [], + JCLBList: [], + YHBMList: [], + YHJBList: [], + tableData: [], + fileNameList: [], + loading: false, + listQuery: { + page: 1, + limit: 10, + form: { + ht_community: "众泰煤焦化" }, + }, - dialogVisible: false, - ruleForm: { - name: '', - region: '', - date1: '', - date2: '', - delivery: false, - type: [], - resource: '', - value1: '', - desc: '' + dialogVisible: false, + ruleForm: { + application_time: "", + remark: "", + realFileName: "", + id: "", + }, + rules: { + application_time: [{required: true, message: '申请限改时间不能为空', trigger: 'blur'}], + }, + fileList: [], + currentPage: 1, + pageSize: 10, + recordTotal: 0, + pickerOptions: { //禁用当前日期之前的日期 + disabledDate(time) { + //Date.now()是javascript中的内置函数,它返回自1970年1月1日00:00:00 UTC以来经过的毫秒数。 + return time.getTime() < Date.now() - 8.64e7; }, - rules: {}, - fileList: [], - currentPage: 1, - pageSize: 10, - recordTotal: 0, - }; - }, - mounted(){ - this.getPageList() - this.initYHLX() - this.initYHJB() - this.initBC() - this.initJCLB() - this.initLlr() - }, + }, + }; + }, + mounted() { + this.getPageList() + this.initYHLX() + this.initYHJB() + this.initBC() + this.initJCLB() + this.initLlr() + this.initYHBM() + }, - methods:{ - initLlr(){ - initLlr().then(res=>{ - if (res.data.ok==1){ - this.llrList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - changeYHDW(val){ - initYHBM().then(res=>{ - if (res.data.ok==1){ - this.YHBMList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - changeJCDW(val){ - initJCBM(val).then(res=>{ - if (res.data.ok==1){ - this.JCBMList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - checkTime(){ - if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){ - if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){ - }else { - this.$message({type:'error', message:"请选择检查结束时间", duration:3000}) - return - } - + watch: { + dialogVisible(nval, oval) { + //弹框关闭,重置值 + if (!nval) { + this.fileList = []; + this.ruleForm = { + application_time: "", + remark: "", + realFileName: "", + id: "", } - if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){ - if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){ - }else { - this.$message({type:'error', message:"请选择检查开始时间", duration:3000}) - return - } - } - if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){ - if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){ - }else { - this.$message({type:'error', message:"请选择限改结束时间", duration:3000}) - return - } - - } - if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){ - if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){ - }else { - this.$message({type:'error', message:"请选择改开始时间", duration:3000}) - return - } - } - }, - getPageList(){ - this.listQuery.page=1 - this.checkTime() - getPageList(this.listQuery).then(res=>{ - if (res.data.ok==1) { - this.tableData = res.data.data.items - this.recordTotal=res.data.data.total - }else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - reset(){ - this.listQuery.form={ht_community:"众泰煤焦化"} - this.getPageList() - }, - handleSizeChange(val){ - this.listQuery.limit = val - this.getPageListForPagination(); - }, - handleCurrentChange(val){ - this.listQuery.page = val - this.getPageListForPagination(); - }, - getPageListForPagination(){ - this.checkTime() - getPageList(this.listQuery).then(res=>{ - if (res.data.ok==1) { - this.tableData = res.data.data.items - this.recordTotal=res.data.data.total - }else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - initYHLX(){ - initYHLX().then(res=>{ - if (res.data.ok==1){ - this.YHLXList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - initYHJB(){ - initYHJB().then(res=>{ - if (res.data.ok==1){ - this.YHJBList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - initBC(){ - initBC().then(res=>{ - if (res.data.ok==1){ - this.BCList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - initJCLB(){ - initJCLB().then(res=>{ - if (res.data.ok==1){ - this.JCLBList=res.data.data - } else{ - this.$message({type:'error', message:res.data.msg, duration:3000}) - } - }) - }, - - - // 发送隐患单跳转 - - - handleClick(){ - this.$router.push({ - path:"/sendHiddenDangerList" - }) - }, - handleClose(done) { - this.$confirm('确认关闭?') - .then(_ => { - done(); - }) - .catch(_ => {}); - }, - handleRemove(file, fileList) { - console.log(file, fileList) - }, - handlePreview(file) { - console.log(file) - }, - beforeUpload(file) { - var FileExt = file.name.replace(/.+\./, ""); - if (['jpg','png','bmp','gif','jpeg'].indexOf(FileExt.toLowerCase()) === -1){ - this.$message({ - type: 'warning', - message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!' - }); - return false; - } - }, + } } - }; + }, + methods: { + initLlr() { + initLlr().then(res => { + if (res.data.ok == 1) { + this.llrList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + initYHBM(val) { + initYHBM().then(res => { + if (res.data.ok == 1) { + this.YHBMList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + changeJCDW(val) { + initJCBM(val).then(res => { + if (res.data.ok == 1) { + this.JCBMList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + checkTime() { + if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') { + if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') { + } else { + this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000}) + return + } + + } + if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') { + if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') { + } else { + this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000}) + return + } + } + if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') { + if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') { + } else { + this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000}) + return + } + + } + if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') { + if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') { + } else { + this.$message({type: 'error', message: "请选择改开始时间", duration: 3000}) + return + } + } + }, + getPageList() { + this.listQuery.page = 1 + this.checkTime() + this.loading = true; + getPageList(this.listQuery).then(res => { + this.loading = false; + if (res.data.ok == 1) { + this.tableData = res.data.data.items + this.recordTotal = res.data.data.total + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + reset() { + this.listQuery.form = {ht_community: "众泰煤焦化"} + this.getPageList() + }, + handleSizeChange(val) { + this.listQuery.limit = val + this.getPageListForPagination(); + }, + handleCurrentChange(val) { + this.listQuery.page = val + this.getPageListForPagination(); + }, + getPageListForPagination() { + this.checkTime() + getPageList(this.listQuery).then(res => { + if (res.data.ok == 1) { + this.tableData = res.data.data.items + this.recordTotal = res.data.data.total + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + initYHLX() { + initYHLX().then(res => { + if (res.data.ok == 1) { + this.YHLXList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + initYHJB() { + initYHJB().then(res => { + if (res.data.ok == 1) { + this.YHJBList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + initBC() { + initBC().then(res => { + if (res.data.ok == 1) { + this.BCList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + initJCLB() { + initJCLB().then(res => { + if (res.data.ok == 1) { + this.JCLBList = res.data.data + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + }, + + + // 发送隐患单跳转 + + + handleClick(row) { + this.$router.push({ + path: "/sendHiddenDangerList", + query: {"id": row.id} + }) + }, + handleClose(done) { + this.$confirm('确认关闭?') + .then(_ => { + done(); + }) + .catch(_ => { + }); + }, + handleRemove(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(/.+\./, ""); + //.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,gif,bmp,png,doc,docx,pdf,ppt,pptx,xls,xlsx,rar,zip的图片!' + }); + return false; + } + }, + applyDelay() { + var selectDataList = this.$refs.dangerRectificationTable.selection; + if (selectDataList.length != 1) { + this.$message({ + type: 'warning', + message: '请选择一条数据!' + }); + return false; + } else { + this.ruleForm.id = selectDataList[0].id; + console.log(this.ruleForm) + this.dialogVisible = true; + } + }, + 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({ + type: 'success', + message: '保存成功!' + }); + this.getPageList(); + }) + } + }) + }, + uploadSectionFile(param) { + let form = new FormData(); + var that = this; + form.append('file', param.file); + //隐患延期申请附件 + form.append('type', "0"); + uploadFile(form).then(res => { + var data = res.data; + if (data.ok) { + var fileName = data.data.fileName[0]; + if (!fileName.endsWith("a62b")) { + fileName = fileName + "a62b"; + } + 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: '附件上传失败,请重试!' + // }); + // }) + }, + //方法区 + formatDate(data) { + // 获取单元格数据 + if (data == null) { + return null + } + let dt = new Date(data) + return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + }, + + //方法区 + formatColumnDate(row, column) { + // 获取单元格数据 + let data = row[column.property] + if (data == null) { + return null + } + let dt = new Date(data) + return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + }, + exportData() { + this.listLoading = true + var requestData = JSON.parse(JSON.stringify(this.listQuery)); + requestData.export_type = 2; + //删除分页参数 + this.$delete(requestData, 'page') + this.$delete(requestData, 'limit') + danger_export_do(requestData).then(res => { + this.listLoading = false + var blob = new Blob([res.data]) + var downloadElement = document.createElement('a') + var href = window.URL.createObjectURL(blob) //创建下载的链接 + downloadElement.href = href + downloadElement.download = '隐患整改治理.xlsx' //下载后文件名 + document.body.appendChild(downloadElement) + downloadElement.click() //点击下载 + document.body.removeChild(downloadElement) //下载完成移除元素 + window.URL.revokeObjectURL(href) //释放掉blob对象 + }).catch(err => { + console.log(err) + }) + }, + showDetails(row) { + this.$router.push({ + path: "/dangerDetails", + query: {"id": row.id} + }) + } + } +}; </script> <style> - .inquire{ - display: flex; - justify-content:left; - flex-wrap: wrap; - } - .inquire .el-form-item{ - padding: 0 46px; - } - .title-center{ - padding: 20px 0; - } - .btns { - background-color: #034ea2; - border: 1px solid #034ea2; - } - /deep/ .el-dialog .el-textarea__inner{ - height: 80px; - max-height: 80px; - overflow-y: auto - } - /deep/.el-dialog .button .el-form-item__content{ - margin-left: 0; - } - .textarea{ - max-height: 70px; - overflow-y: auto; - } +.inquire { + display: flex; + justify-content: left; + flex-wrap: wrap; +} + +.inquire .el-form-item { + padding: 0 46px; +} + +.title-center { + padding: 20px 0; +} + +.btns { + background-color: #034ea2; + border: 1px solid #034ea2; +} + +/deep/ .el-dialog .el-textarea__inner { + height: 80px; + max-height: 80px; + overflow-y: auto +} + +.blue-font-color:hover { + cursor: pointer; + color: blue; +} + +/deep/ .el-dialog .button .el-form-item__content { + margin-left: 0; +} + +.textarea { + max-height: 70px; + overflow-y: auto; +} </style> -- Gitblit v1.9.2