¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="uncertainty-evaluation"> |
| | | <el-row class="title"> |
| | | <el-col :span="20" style="padding-left: 20px;text-align: left;">æµéä¸ç¡®å®åº¦çè¯å®</el-col> |
| | | <el-col :span="4" style="display: flex;align-items: center;justify-content: end;"> |
| | | <el-button size="medium" type="primary" @click="handleDown0" :loading="outLoading" style="margin-right: 16px;margin-top: 3px;" v-if="outPower">导åº</el-button> |
| | | <el-upload :action="action" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload" |
| | | :on-error="onError" ref='upload' v-if="addPower" :on-success="handleSuccessUp"> |
| | | <el-button size="medium" type="primary" :loading="upLoading">导å
¥</el-button></el-upload> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æ¥ååç§°ï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="componentData.entity.reportName" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">æ¥ è¯¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.processEvaluate.pageProcessEvaluate" |
| | | :delUrl="$api.processEvaluate.delProcessEvaluate" |
| | | :componentData="componentData" :key="upIndex"/> |
| | | </div> |
| | | <el-dialog |
| | | title="è¯ä»·" |
| | | :visible.sync="addDialogVisible" |
| | | width="400px"> |
| | | <el-row> |
| | | <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">è¯ä»·ï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.note"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æ¥æï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker |
| | | v-model="addInfo.evaluateTime" |
| | | type="date" |
| | | size="small" |
| | | placeholder="éæ©æ¥æ" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" style="width: 100%;"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleAdd" :loading="addLoading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="æ¥çéä»¶" |
| | | :visible.sync="lookDialogVisible" |
| | | width="800px" top="5vh" fullscreen> |
| | | <filePreview v-if="lookDialogVisible" :fileUrl="javaApi+'/word/'+currentInfo.reportUrl" |
| | | :currentFile="{}" style="max-height: 90vh;overflow-y: auto;"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ValueTable from '../tool/value-table.vue' |
| | | import filePreview from '../tool/file-preview.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable, |
| | | filePreview |
| | | }, |
| | | data() { |
| | | return { |
| | | addPower:false, |
| | | outPower:false, |
| | | outLoading:false, |
| | | componentData: { |
| | | entity: { |
| | | reportName: null, |
| | | orderBy: { |
| | | field: 'createTime', |
| | | order: 'desc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: false, |
| | | do: [{ |
| | | id: 'handleTell', |
| | | font: 'è¯ä»·', |
| | | type: 'text', |
| | | method: 'handleTell', |
| | | }, { |
| | | id: 'delete', |
| | | font: 'å é¤', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }, { |
| | | id: 'handleDown', |
| | | font: 'ä¸è½½', |
| | | type: 'text', |
| | | method: 'handleDown' |
| | | }, { |
| | | id: 'handleLook', |
| | | font: 'æ¥çéä»¶', |
| | | type: 'text', |
| | | method: 'handleLook' |
| | | }], |
| | | tagField: {}, |
| | | selectField: {}, |
| | | requiredAdd: [], |
| | | requiredUp: [], |
| | | needSort: [], |
| | | inputType:Â '' |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | upLoading:false, |
| | | addDialogVisible:false, |
| | | addInfo:{}, |
| | | addLoading:false, |
| | | currentInfo:{}, |
| | | lookDialogVisible:false, |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'token': sessionStorage.getItem('token') |
| | | } |
| | | }, |
| | | action() { |
| | | return this.javaApi + this.$api.processEvaluate.addProcessEvaluate |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity); |
| | | this.getPower() |
| | | }, |
| | | methods: { |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let out = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'doProcessEvaluate') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'addProcessEvaluate') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delProcessEvaluate') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'exportProcessEvaluate') { |
| | | out = true |
| | | } |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.outPower = out |
| | | this.addPower = add |
| | | }, |
| | | handleDown0(){ |
| | | this.outLoading = true |
| | | this.$axios.post(this.$api.processEvaluate.exportProcessEvaluate,{entity:{reportName:this.componentData.entity.reportName}},{responseType: "blob",headers: { 'Content-Type': 'application/json' }}).then(res => { |
| | | this.outLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('å¯¼åºæå') |
| | | const blob = new Blob([res],{ type: 'application/octet-stream' }); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'æµéä¸ç¡®å®åº¦çè¯å®.xlsx'; |
| | | link.click(); |
| | | }) |
| | | }, |
| | | handleDown(row) { |
| | | let url = this.javaApi+'/word/'+row.reportUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.reportName; |
| | | link.click(); |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | // this.upLoading = true; |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.refreshTable() |
| | | } |
| | | }, |
| | | handleTell(row){ |
| | | this.addInfo = row; |
| | | this.addDialogVisible = true; |
| | | }, |
| | | handleAdd(){ |
| | | this.addLoading = true; |
| | | this.$axios.post(this.$api.processEvaluate.doProcessEvaluate, { |
| | | id:this.addInfo.id, |
| | | note:this.addInfo.note, |
| | | evaluateTime:this.addInfo.evaluateTime, |
| | | evaluateUser:JSON.parse(localStorage.getItem("user")).userId |
| | | },{headers: { 'Content-Type': 'application/json' }}).then((res) => { |
| | | this.addLoading = false; |
| | | if(res.code==201){ |
| | | this.$message.error('è¯ä»·å¤±è´¥'); |
| | | return; |
| | | } |
| | | this.$message.success('è¯ä»·æå'); |
| | | this.addDialogVisible = false; |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | }, |
| | | refresh() { |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | | this.upIndex++ |
| | | this.refreshTable() |
| | | }, |
| | | handleLook(row){ |
| | | this.currentInfo = row; |
| | | this.lookDialogVisible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 80px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 80px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | </style> |