From d3e7923f5cc188da720ba9c3d6a536ae82e46f3c Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期四, 09 六月 2022 10:00:24 +0800 Subject: [PATCH] 删除 --- src/views/troubleshooting/index.vue | 825 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 486 insertions(+), 339 deletions(-) diff --git a/src/views/troubleshooting/index.vue b/src/views/troubleshooting/index.vue index 8879d09..e2ca9bc 100644 --- a/src/views/troubleshooting/index.vue +++ b/src/views/troubleshooting/index.vue @@ -4,197 +4,124 @@ ref="form" :inline="true" class="inquire" - :model="form" + :model="listQuery.form" label-width="100px" > <el-form-item label="地点"> - <el-input - v-model="listQuery.form.address" - style="width: 202px" - placeholder="请输入内容" - ></el-input> + <el-input v-model="listQuery.form.ADDRESS" style="width: 202px" placeholder="请输入内容"></el-input> </el-form-item> <el-form-item label="主持人"> - <el-input - v-model="listQuery.form.ht_content" - style="width: 202px" - placeholder="请输入内容" - ></el-input> + <el-input v-model="listQuery.form.HOST" style="width: 202px" placeholder="请输入内容"></el-input> </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.Conference_TimeStart" 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.Conference_TimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></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-refresh-right" - @click="reset()" - >重置</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" icon="el-icon-refresh-right" @click="reset()">重置</el-button> </el-form-item> </el-form> <el-row class="title-center"> - <el-col :span="10"> - <el-radio-group v-model="listQuery.type" @change="typeChange"> - <el-radio-button label="0">未上报</el-radio-button> - <el-radio-button label="1">已上报</el-radio-button> - <el-radio-button label="2">上级公司会议</el-radio-button> - </el-radio-group> + <el-col :span="5"> + <el-radio-group v-model="listQuery.type" @change="typeChange"> + <el-radio-button label="0">未上报</el-radio-button> + <el-radio-button label="1">已上报</el-radio-button> + <el-radio-button label="2">上级公司会议</el-radio-button> + </el-radio-group> </el-col> <div v-if="listQuery.type==0"> - <el-col :span="10"> - <el-row> - <el-col :span="7" :offset="7" style="text-align: right;" - ><span style="line-height: 36px; font-size: 14px; color: #606266;margin-right:10px;font-weight: bold;" - >请选择上报方式</span - ></el-col - > - <el-col :span="10"> - <el-select - v-model="listQuery.form.check_main_branch" - placeholder="请选择" - @change="changeJCDW" - > - <el-option - v-for="item in JCDWList" - :key="item.value" - :label="item.label" - :value="item.value" - > - </el-option> - </el-select> - <el-button type="primary" class="btns" size="small" - >上报</el-button - > + <el-col :span="15"> + <el-col :span="4" :offset="offset" style="text-align: right;"> + <span style="line-height: 36px; font-size: 14px; color: #606266;margin-right:10px;font-weight: bold;">请选择上报方式</span> </el-col> - </el-row> + <el-col :span="4"> + <el-select v-model="upType" placeholder="请选择" @change="changeUpType"> + <el-option v-for="item in upTypeList" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </el-col> + <div v-if="upType == 2"> + <el-col :span="5" :offset="1"> + <el-date-picker type="date" placeholder="选择日期" v-model="upTimeStart" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker> + </el-col> + <el-col style="text-align: center" :span="1"> + <span style="line-height: 36px; font-size: 14px; color: #606266;font-weight: bold;">至</span> + </el-col> + <el-col :span="5"> + <el-date-picker type="date" placeholder="选择日期" v-model="upTimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker> + </el-col> + </div> + <el-col :span="2" style="text-align: right"> + <el-button type="primary" class="btns" size="small" @click="putBatch">上报</el-button> + </el-col> </el-col> <el-col :span="4" style="text-align: right"> - <el-button - class="btns" - type="primary" - size="small" - icon="el-icon-plus" - >添加</el-button - > - <el-button - class="btns" - type="primary" - size="small" - icon="el-icon-close" - @click="sendBath()" - >批量删除</el-button - > + <el-button class="btns" type="primary" size="small" icon="el-icon-plus" @click="addMeeting">添加</el-button> + <el-button class="btns" type="primary" size="small" icon="el-icon-close" @click="deleteBatch()">批量删除</el-button> </el-col> </div> <div v-if="listQuery.type==1"> - <el-col :span="14" style="text-align: right"> - <el-button - class="btns" - type="primary" - size="small" - >撤销</el-button - > + <el-col :span="18" style="text-align: right"> + <el-button class="btns" type="primary" size="small" @click="revokeBatch">撤销</el-button> </el-col> </div> </el-row> <el-row class="title-center"> <el-col :span="10"> - <el-radio-group v-model="radio1"> + <el-radio-group v-model="listQuery.form.CONFERENCE_PROFESSIONAL" @change="changeType2"> <el-radio-button label="0">全部</el-radio-button> - <el-radio-button label="1">综合</el-radio-button> - <el-radio-button label="2">生产</el-radio-button> - <el-radio-button label="3">设备</el-radio-button> - <el-radio-button label="4">电器</el-radio-button> - <el-radio-button label="5">仪表</el-radio-button> - <el-radio-button label="6">消防</el-radio-button> - <el-radio-button label="7">安全管理</el-radio-button> - <el-radio-button label="8">其他</el-radio-button> + <el-radio-button label="综合">综合</el-radio-button> + <el-radio-button label="生产">生产</el-radio-button> + <el-radio-button label="设备">设备</el-radio-button> + <el-radio-button label="电器">电器</el-radio-button> + <el-radio-button label="仪表">仪表</el-radio-button> + <el-radio-button label="消防">消防</el-radio-button> + <el-radio-button label="安全管理">安全管理</el-radio-button> + <el-radio-button label="其他">其他</el-radio-button> </el-radio-group> </el-col> </el-row> - <el-table - :data="tableData" - style="width: 100%" - @selection-change="changeBox" - > - <el-table-column - type="selection" - width="55" - align="center" - ></el-table-column> - <el-table-column - v-if="listQuery.type==2" - prop="number" - label="会议单位" - align="center" - width="120" - ></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="checktype" - label="会议专业" - align="center" - ></el-table-column> - <el-table-column - prop="checktype" - label="会议摘要" - align="center" - ></el-table-column> - <el-table-column prop="DTRisk_level" label="会议纪要" align="center"> - </el-table-column> - <el-table-column prop="date" v-if="listQuery.type==0" label="基本操作" align="center"> - <template slot-scope="scope"> - <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button> - <el-button @click="updateClick(scope.row)" type="text" size="small">保存</el-button> - <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button> - </template> - </el-table-column> + <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" v-loading="listLoading"> + <el-table-column type="selection" width="55" align="center"></el-table-column> + <el-table-column v-if="listQuery.type==2" prop="communityname" label="会议单位" align="center" width="120"></el-table-column> + <el-table-column prop="CONFERENCE_TIME" label="召开时间" :formatter="formatColumnDate" align="center" width="120"></el-table-column> + <el-table-column prop="ADDRESS" label="地点" align="center" width="120"></el-table-column> + <el-table-column prop="HOST" label="主持人" align="center" width="120"></el-table-column> + <el-table-column prop="CONFERENCE_PROFESSIONAL" label="会议专业" align="center" width="120"></el-table-column> + <el-table-column prop="meeting_content" label="会议摘要" align="center"> + <template slot-scope="scope"> + <el-popover trigger="hover" placement="top"> + <p>{{ scope.row.meeting_content }}</p> + <div slot="reference" class="name-wrapper">{{ + scope.row.meeting_content != null && scope.row.meeting_content.length > 20 ? scope.row.meeting_content.substring(0, 18) + "...." : scope.row.meeting_content + }} + </div> + </el-popover> + </template> + </el-table-column> + <el-table-column prop="realFileName" label="会议纪要" align="center"> + <template slot-scope="scope" > + + <div v-for="item in scope.row.realFileName"> + <el-link type="primary" @click="downloadFile(subFile(item))"> + {{subFile(item)}} + </el-link> + </div> + </template> + </el-table-column> + <el-table-column prop="date" v-if="listQuery.type==0" label="基本操作" align="center"> + <template slot-scope="scope"> + <el-button @click="editMeeting(scope.row)" type="text" size="small">编辑</el-button> +<!-- <el-button @click="updateClick(scope.row)" type="text" size="small">保存</el-button>--> + <el-button @click="deleteMeeting(scope.row)" type="text" size="small">删除</el-button> + </template> + </el-table-column> </el-table> <div style="text-align: right"> <el-pagination @@ -209,183 +136,178 @@ > </el-pagination> </div> + + <el-dialog + :title="title" + :visible.sync="dialogVisible" + :close-on-click-modal="false" + width="40%"> + <el-form ref="form" :rules="meetingRules" :model="meetingForm" label-width="100px"> + <el-row> + <el-col :span="9"> + <el-form-item label="召开时间" prop="CONFERENCE_TIME"> + <el-date-picker type="date" placeholder="选择日期" + v-model="meetingForm.CONFERENCE_TIME" + style="width: 100%" value-format="yyyy-MM-dd" + ></el-date-picker> + </el-form-item> + </el-col> + <el-col :span="9" :offset="4"> + <el-form-item label="会议专业" prop="CONFERENCE_PROFESSIONAL"> + <el-select v-model="meetingForm.CONFERENCE_PROFESSIONAL" placeholder="请选择"> + <el-option + v-for="item in YHLXList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="9"> + <el-form-item label="地点" prop="ADDRESS"> + <el-input v-model="meetingForm.ADDRESS" rows="3" type="textarea" class="multiline"></el-input> + </el-form-item> + </el-col> + <el-col :span="9" :offset="4"> + <el-form-item label="主持人" prop="HOST"> + <el-input v-model="meetingForm.HOST" rows="3" type="textarea" class="multiline"></el-input> + </el-form-item> + </el-col> + </el-row> + + <el-row> + <el-col :span="22"> + <el-form-item label="会议摘要" prop="meeting_content"> + <el-input v-model="meetingForm.meeting_content" rows="3" type="textarea" class="multiline"></el-input> + </el-form-item> + </el-col> + </el-row> + + <el-row> + <el-col :span="22" > + <el-form-item label="会议纪要" prop="realFileName"> + <el-upload + class="upload-demo" + ref="upload" + action="https://jsonplaceholder.typicode.com/posts/" + :http-request="uploadSectionFile" + :on-preview="handlePreview" + :on-remove="handleRemove" + :file-list="fileList" + :before-upload="beforeUpload" + :auto-upload="true"> + <el-button slot="trigger" size="small" type="primary" class="btns">上传附件</el-button> + </el-upload> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="22"> + <el-form-item style="text-align: center"> + <el-button type="primary" class="btns" @click="submitFrom('form')"> + 保存 + </el-button> + <el-button @click="dialogVisible=false">关闭</el-button> + </el-form-item> + </el-col> + </el-row> + </el-form> + </el-dialog> + + </div> </template> <script> -import { getPageList, analogy_export_do } from "@/api/sgyhpczl/oneFromanotherN"; +import {getPageList,addOrEdit, del, revoke, upload_do} from "@/api/sgyhpczl/troubleshooting"; +import {uploadFile} from "@/api/sgyhpczl/hiddenDangerRectification"; +import {deepClone} from '@/utils' +import {downloadFile} from "@/api/sgyhpczl/fileUtils"; + import { - initJCBM, initYHLX, - initJCLB, - initYHJB, } from "@/api/sgyhpczl/initSelect"; export default { - data() { - return { - listQuery: { - page: 1, - limit: 10, - type: 0, - form: {}, - }, - radio1: 0, - table1: true, - table2: false, + data() { + return { + listQuery: { + page: 1, + limit: 10, + type: 0,//type=0 待上报 type=1 已上报 type=2 上级公司会议 + form: { + CONFERENCE_PROFESSIONAL: '0' + }, + }, + form: {}, + currentPage: 1, + pageSize: 10, + recordTotal: 0, + YHLXList:[], + tableData: [], + selectedList: [], + listLoading: false, + // fileList:[{name:'aa.doc',url:'sssss.doc'}], + fileList:[], + upTypeList:[{label:"按勾选上报",value:0},{label:"按时间上报",value:2}], + upType:0, + upTimeStart:'', + upTimeEnd:'', + offset: 14, - currentPage: 1, - pageSize: 10, - recordTotal: 0, - XFDWList: [], - YHLBList: [], - YHJBList: [], - JCLBList: [], - tableData: [], - selectedList: [], - listLoading: false, - selfInspectVisible: false, - selfInspectForm: { - id: "", - markUserName: "", - markDate: "", - remark: "", - }, - selfInspectFormRules: { - markUserName: [ - { required: true, message: "自查人不能为空", trigger: "blur" }, - ], - markDate: [ - { required: true, message: "自查时间不能为空", trigger: "blur" }, - ], - }, - }; + title:'', + dialogVisible:false, + meetingForm:{}, + meetingRules:{ + CONFERENCE_TIME: [{ required: true, message: '不能为空', trigger: 'blur' },], + ADDRESS: [{ required: true, message: '不能为空', trigger: 'blur' },], + HOST: [{ required: true, message: '不能为空', trigger: 'blur' },], + meeting_content: [{ required: true, message: '不能为空', trigger: 'blur' },], + CONFERENCE_PROFESSIONAL: [{ required: true, message: '不能为空', trigger: 'blur' },], + }, + }; }, - mounted() { - this.getPageList(); - this.initJCLB(); - this.initXFDW(); - this.initYHJB(); - this.initYHLB(); - }, - methods: { - sendBath() { - this.$router.push({ - path: "/existN", - }); - }, - handleClick(data, val) { - if (val == "存在") { - this.$router.push({ - path: "/exist", - }); - } - }, - handoff(index) { - if (index == 1) { - this.table1 = false; - this.table2 = true; - this.listQuery.type = 2; - console.log(this.listQuery.type); + mounted() { this.getPageList(); - } else { - this.table1 = true; - this.table2 = false; - } + this.initYHLX(); }, - initXFDW() { - initJCBM(1).then((res) => { - if (res.data.ok == 1) { - this.XFDWList = res.data.data; - } else { - this.$message({ - type: "error", - message: res.data.msg, - duration: 3000, - }); - } - }); - }, - initYHLB() { - initYHLX().then((res) => { - if (res.data.ok == 1) { - this.YHLBList = 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, - }); - } - }); - }, - 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, - }); - } - }); - }, - 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; - } - } - }, + methods: { + 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}) + } + }) + }, + changeUpType(val){ + this.upType = val; + if (val == 2){ + this.offset = 2; + }else { + this.offset = 14; + } + }, + checkTime(){ + if(this.listQuery.form.Conference_TimeStart!=null && this.listQuery.form.Conference_TimeStart!=''){ + if(this.listQuery.form.Conference_TimeEnd!=null && this.listQuery.form.Conference_TimeEnd!=''){ + }else { + this.$message({type:'error', message:"请选择检查结束时间", duration:3000}) + return + } + } + }, //搜索 getPageList() { this.listQuery.page = 1; this.checkTime(); + this.listLoading = true getPageList(this.listQuery).then((res) => { - if (res.data.ok == 1) { + this.listLoading = false + if (res.data.ok == 1) { this.tableData = res.data.data.items; this.recordTotal = res.data.data.total; } else { @@ -399,7 +321,9 @@ }, //重置 reset() { - this.listQuery.form = {}; + this.listQuery.form = { + CONFERENCE_PROFESSIONAL: '0' + }; this.getPageList(); }, handleSizeChange(val) { @@ -429,33 +353,256 @@ this.listQuery.type = val; this.getPageList(); }, + changeType2(val){ + this.listQuery.form.CONFERENCE_PROFESSIONAL = val; + this.getPageList(); + }, handleSelectionChange(val) { this.selectedList = []; val.forEach((item) => { this.selectedList.push(item); }); }, - exportData() { - var requestData = this.listQuery; - //删除分页参数 - this.$delete(requestData, "page"); - this.$delete(requestData, "limit"); - analogy_export_do(requestData) - .then((res) => { - 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); - }); - }, + uploadSectionFile(param) { + let form = new FormData(); + form.append('file', param.file); + form.append('type', "1"); + uploadFile(form).then(res => { + var data = res.data; + if (data.ok) { + var fileName = data.data.fileName[0]; + if (!fileName.endsWith("a62b")) { + fileName = fileName + "a62b"; + } + this.fileList.push({name:fileName,url:fileName}) + } + }).error(res => { + this.$message({ + type: 'error', + message: '附件上传失败,请重试!' + }); + }) + }, + downloadFile(path){ + let params = { + type: 1, + fileName: path, + }; + downloadFile(params).then((res) => { + if(res.data.type=='text/json'){ + const reader = new FileReader(); //创建一个FileReader实例 + reader.readAsText(res.data, 'utf-8'); //读取文件,结果用字符串形式表示 + //读取完成后,**获取reader.result** + reader.onload = e => { + this.$message({ + type: "error", + message: JSON.parse(reader.result).msg, + duration: 3000, + }); + } + } else { + let blob = new Blob([res.data], {type: 'application/octet-stream'}) + console.log(blob) + // 创建下载的链接 + let blobUrl = window.URL.createObjectURL(blob) + let downloadElement = document.createElement('a') + downloadElement.href = blobUrl + //下载后文件名 + downloadElement.download = path + document.body.appendChild(downloadElement) + //点击下载 + downloadElement.click() + //下载完成移除元素 + document.body.removeChild(downloadElement) + // 释放掉blob对象 + window.URL.revokeObjectURL(blobUrl) + } + }); + }, + subFile(fileName){ + return fileName.substring(fileName.indexOf("fileName=")+9) + }, + //删除上传组件文件 + handleRemove(file, fileList) { + this.fileList = fileList; + }, + //点击上传组件-文件列表 + handlePreview(file) { + this.downloadFile(file.url) + }, + beforeUpload(file) { + var FileExt = file.name.replace(/.+\./, ""); + if (['doc', 'docx', 'pdf', 'ppt', 'pptx','xls','xlsx','rar','zip'].indexOf(FileExt.toLowerCase()) === -1) { + this.$message({ + type: 'warning', + message: '请上传正确格式的文件!(.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip)' + }); + return false; + } + }, + editMeeting(row, index) { + this.meetingForm = deepClone(row); + this.rowIndex = index; + this.dialogVisible = true; + this.title = '编辑'; + this.fileList = []; + const arr = this.meetingForm.realFileName; + for (let i = 0; i < arr.length; i++) { + this.fileList.push({name:this.subFile(arr[i]),url:this.subFile(arr[i])}) + } + }, + addMeeting(){ + this.fileList = []; + this.meetingForm={} + this.title="新增" + this.dialogVisible=true + }, + //提交表单 + submitFrom(formName){ + let fileStr = ''; + if (this.fileList.length != 0){ + this.fileList.forEach((item,index,arr)=>{ + if (item.url.endsWith("a62b")) { + fileStr = fileStr + item.url; + }else { + fileStr = fileStr + item.url + "a62b"; + } + }) + } + this.meetingForm.realFileName = fileStr; + console.log(this.meetingForm) + this.$refs[formName].validate((valid) => { + if (valid) { + + addOrEdit(this.meetingForm).then(res=>{ + if (res.data.ok==1) { + this.dialogVisible=false + this.$message({type:'success', message:res.data.msg, duration:3000}) + this.getPageList() + }else{ + this.$message({type:'error', message:res.data.msg, duration:3000}) + } + }) + } else { + console.log("error submit!!"); + return false; + } + }); + }, + deleteBatch() { + if (this.selectedList == null || this.selectedList.length == 0) { + this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000}) + return + } + var ids = this.selectedList.map((obj) => { + return obj.id + }).join(",") + this.$confirm('确认删除吗', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + del(ids).then(() => { + this.getPageList() + this.$notify({ + title: "成功", + message: "删除成功", + type: "success", + duration: 2000, + }); + }); + }) + .catch(error => { + }); + }, + deleteMeeting(row) { + this.$confirm('确认删除吗', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + console.log(row.id) + del(row.id).then(() => { + this.getPageList() + this.$notify({ + title: "成功", + message: "删除成功", + type: "success", + duration: 2000, + }); + }); + }).catch(error => { + }); + }, + //撤销 + revokeBatch() { + if (this.selectedList == null || this.selectedList.length == 0) { + this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000}) + return + } + var ids = this.selectedList.map((obj) => { + return obj.id + }).join(",") + this.$confirm('确认撤销吗', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let data = { + id:ids + } + revoke(data).then(() => { + this.getPageList() + this.$notify({ + title: "成功", + message: "撤销成功", + type: "success", + duration: 2000, + }); + }); + }).catch(error => { + }); + }, + //上报 + putBatch() { + let data = {} + if (this.upType == 0){ + if (this.selectedList == null || this.selectedList.length == 0) { + this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000}) + return + } + var ids = this.selectedList.map((obj) => { + return obj.id + }).join(",") + data = { + type: this.upType, + id: ids, + } + }else { + data = { + type: this.upType, + time: this.upTimeStart+'至'+this.upTimeEnd, + } + } + this.$confirm('确认上报吗', '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + upload_do(data).then(() => { + this.getPageList() + this.$notify({ + title: "成功", + message: "上报成功", + type: "success", + duration: 2000, + }); + }); + }).catch(error => { + }); + }, + + //日期格式转换 formatColumnDate(row, column) { // 获取单元格数据 -- Gitblit v1.9.2