¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="report-results"> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;">æ¥åç»æ</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">导åº</el-button> |
| | | <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">æ°å¢</el-button> |
| | | </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.insReportCode" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <!-- <div class="search_thing"> |
| | | <div class="search_label">åé人ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="componentData.entity.sendUserName" |
| | | @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.processReport.pageProcessReport" |
| | | :delUrl="$api.processReport.delProcessReport" |
| | | :componentData="componentData" :key="upIndex"/> |
| | | </div> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="addDialogVisible" |
| | | width="400px" top="6vh"> |
| | | <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.insReportCode"></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-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.pages"></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-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.number"></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-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.send"></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-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.method"></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.sendTime" |
| | | 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-col :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åé人ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.sendUser" placeholder="è¯·éæ©" size="small" style="width: 100%;"> |
| | | <el-option |
| | | v-for="item in personList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </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-select v-model="addInfo.signatory" placeholder="è¯·éæ©" size="small" style="width: 100%;" multiple> |
| | | <el-option |
| | | v-for="item in personList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </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-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.remark" type="textarea" |
| | | :rows="2"></el-input></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> |
| | | <!-- html导åºä¸ºwordï¼æ ·å太ä¸äºï¼ä»£ç å
æ¾çå§ --> |
| | | <!-- <div style="position: fixed;top: 0;width: 1050px;height: 80vh;overflow-y: auto;z-index: 0;opacity: 0;"> |
| | | <div ref="content"> |
| | | <h4 style="display: flex;align-items: center;flex-direction: column;justify-content: center;"> |
| | | <span style="font-size: 20px;">æ£éªæ¥ååæ¾ç»è®°è¡¨</span> |
| | | <span>Registration form for the issuance of inspection reports</span> |
| | | </h4> |
| | | <table border="1" class="tables" cellpadding="10"> |
| | | <tr> |
| | | <td> |
| | | <p>åºå·</p> |
| | | <p class="en">No.</p> |
| | | </td> |
| | | <td> |
| | | <p>æ£éªæ¥åç¼å·</p> |
| | | <p class="en">Inspection report number</p> |
| | | </td> |
| | | <td> |
| | | <p>页æ°</p> |
| | | <p class="en">Pages</p> |
| | | </td> |
| | | <td> |
| | | <p>åé份æ°</p> |
| | | <p class="en">Number of copies sent</p> |
| | | </td> |
| | | <td> |
| | | <p>åå¾ä½å¤</p> |
| | | <p class="en">Where to send to</p> |
| | | </td> |
| | | <td> |
| | | <p>åéæ¹å¼</p> |
| | | <p class="en">Send method</p> |
| | | </td> |
| | | <td> |
| | | <p>å鿥æ</p> |
| | | <p class="en">Date sent</p> |
| | | </td> |
| | | <td> |
| | | <p>åé人</p> |
| | | <p class="en">Sender</p> |
| | | </td> |
| | | <td> |
| | | <p>ç¾æ¶äºº</p> |
| | | <p class="en">Signatory</p> |
| | | </td> |
| | | <td> |
| | | <p>夿³¨</p> |
| | | <p class="en">Remark</p> |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(item,index) in mutilSelect" :key="index"> |
| | | <td>{{ index+1 }}</td> |
| | | <td>{{ item.insReportCode }}</td> |
| | | <td>{{ item.pages }}</td> |
| | | <td>{{ item.number }}</td> |
| | | <td>{{ item.send }}</td> |
| | | <td>{{ item.method }}</td> |
| | | <td>{{ item.sendTime }}</td> |
| | | <td>{{ item.sendUserName }}</td> |
| | | <td> |
| | | <img :src="javaApi+'/img/'+item.signatoryUrl" :alt="item.signatory" style="width: 100px;"> |
| | | </td> |
| | | <td>{{ item.remark }}</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ValueTable from '../tool/value-table.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | | }, |
| | | data() { |
| | | return { |
| | | outLoading:false, |
| | | addPower:true, |
| | | outPower:true, |
| | | componentData: { |
| | | entity: { |
| | | insReportCode: null, |
| | | // sendUserName: null, |
| | | orderBy: { |
| | | field: 'createTime', |
| | | order: 'desc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | | showSelect: true, |
| | | select: true, |
| | | selectMethod: 'handleChangeTask', |
| | | do: [{ |
| | | id: 'delete', |
| | | font: 'å é¤', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }, { |
| | | id: 'handleWork', |
| | | font: 'ä¿®æ¹', |
| | | type: 'text', |
| | | method: 'handleWork' |
| | | }], |
| | | tagField: {}, |
| | | selectField: { |
| | | sendUser:{ |
| | | select: [] |
| | | }, |
| | | signatory:{ |
| | | select: [] |
| | | }, |
| | | }, |
| | | // addUpload:['signatoryUrl'], |
| | | requiredAdd: [], |
| | | requiredUp: [], |
| | | needSort: [], |
| | | inputType:Â '' |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | personList:[], |
| | | title:'æ°å¢', |
| | | addDialogVisible:false, |
| | | addInfo:{ |
| | | signatory:[] |
| | | }, |
| | | addLoading:false, |
| | | mutilSelect:[] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity); |
| | | this.getPower() |
| | | this.getAuthorizedPerson() |
| | | }, |
| | | 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 == 'doProcessReport') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'addProcessReport') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delProcessReport') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'exportProcessReport') { |
| | | out = true |
| | | } |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.outPower = out |
| | | this.addPower = add |
| | | }, |
| | | handleDown() { |
| | | if(this.mutilSelect.length==0){ |
| | | this.$message.warning('è¯·éæ©è¦å¯¼åºçæ°æ®') |
| | | return |
| | | } |
| | | // html导åºä¸ºwordï¼æ ·å太ä¸äºï¼ä»£ç å
æ¾çå§ |
| | | // exportHtmlToWord(this.$refs.content,'æ£éªæ¥ååæ¾ç»è®°è¡¨') |
| | | this.outLoading = true |
| | | this.$axios.post(this.$api.processReport.exportProcessReport,{"ids":this.mutilSelect.map(m=>m.id)},{headers: { 'Content-Type': 'application/json' },noQs:true}).then(res => { |
| | | this.outLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('å¯¼åºæå') |
| | | const url = this.javaApi+'/word/'+res.message; |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'æ¥åç»æ'; |
| | | link.click(); |
| | | }) |
| | | }, |
| | | openAdd() { |
| | | this.title = 'æ°å¢' |
| | | this.addInfo = { |
| | | signatory:[] |
| | | } |
| | | this.addDialogVisible = true; |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | }, |
| | | refresh() { |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | | this.upIndex++ |
| | | this.refreshTable() |
| | | }, |
| | | getAuthorizedPerson() { |
| | | this.$axios.get(this.$api.user.getUserMenu).then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.personList = data |
| | | }) |
| | | }, |
| | | handleAdd(){ |
| | | this.addLoading = true |
| | | delete this.addInfo.createTime |
| | | delete this.addInfo.createUser |
| | | delete this.addInfo.updateTime |
| | | delete this.addInfo.signatoryUrl |
| | | delete this.addInfo.updateUserer |
| | | delete this.addInfo.sendUserName |
| | | let addInfo = this.HaveJson(this.addInfo) |
| | | addInfo.signatory = addInfo.signatory.join(',') |
| | | this.$axios.post(this.$api.processReport[this.title=='æ°å¢'?'addProcessReport':'doProcessReport'], addInfo,{headers: { 'Content-Type': 'application/json' }}).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 201) { |
| | | return |
| | | } |
| | | this.addDialogVisible = false |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!' |
| | | }); |
| | | this.refreshTable() |
| | | }).catch(err => {}) |
| | | }, |
| | | handleWork(row){ |
| | | this.title = 'ä¿®æ¹' |
| | | this.addInfo = row |
| | | console.log(this.addInfo) |
| | | this.addInfo.signatory = this.addInfo.signatory?this.addInfo.signatory.split(',').map(m=>Number(m)):[] |
| | | this.addDialogVisible = true; |
| | | }, |
| | | handleChangeTask(list){ |
| | | this.mutilSelect = list |
| | | } |
| | | } |
| | | } |
| | | </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: 110px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | .tables { |
| | | table-layout: fixed; |
| | | width: 100%; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .tables td { |
| | | height: 40px; |
| | | width: 100px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | word-wrap: break-word; |
| | | white-space: normal; |
| | | } |
| | | .en{ |
| | | font-size: 12px; |
| | | word-break: break-word; /* èªå¨æè¡ */ |
| | | overflow-wrap: break-word; /* 鲿¢æº¢åº */ |
| | | white-space: normal; /* é»è®¤æ¢è¡ */ |
| | | } |
| | | </style> |