¶Ô±ÈÐÂÎļþ |
| | |
| | | // æ¥åç»æç¸å
³æ¥å£ |
| | | import request from "@/utils/request"; |
| | | |
| | | //8æ¥åç»æ-å¯¼åº |
| | | export function exportProcessReport(query) { |
| | | return request({ |
| | | url: "/processReport/exportProcessReport", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 8æ¥åç»æ-æ°å¢ |
| | | export function addProcessReport(data) { |
| | | return request({ |
| | | url: "/processReport/addProcessReport", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 8æ¥åç»æ-ä¿®æ¹ |
| | | export function doProcessReport(data) { |
| | | return request({ |
| | | url: "/processReport/doProcessReport", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="queryParams.insReportCode" |
| | | @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"> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'" |
| | | :page="page" @pagination="pagination"></lims-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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | exportProcessReport, |
| | | doProcessReport, |
| | | addProcessReport |
| | | } from '@/api/cnas/process/reportResults.js' |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | export default { |
| | | components: { |
| | | limsTable |
| | | }, |
| | | 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: 'handleWork', |
| | | font: 'ä¿®æ¹', |
| | | type: 'text', |
| | | method: 'handleWork' |
| | | }, |
| | | { |
| | | id: 'delete', |
| | | font: 'å é¤', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | } |
| | | ], |
| | | tagField: {}, |
| | | selectField: { |
| | | sendUser: { |
| | | select: [] |
| | | }, |
| | | signatory: { |
| | | select: [] |
| | | }, |
| | | }, |
| | | // addUpload:['signatoryUrl'], |
| | | requiredAdd: [], |
| | | requiredUp: [], |
| | | needSort: [], |
| | | inputType: '' |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | personList: [], |
| | | title: 'æ°å¢', |
| | | addDialogVisible: false, |
| | | addInfo: { |
| | | signatory: [] |
| | | }, |
| | | addLoading: false, |
| | | mutilSelect: [], |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "ç¼å·", prop: "number" }, |
| | | { label: "è¾
å©é¡¹ç®åç§°", prop: "auxiliaryProject", width: "120px" }, |
| | | { |
| | | label: "å®éªå®¤", |
| | | prop: "laboratory", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.laboratoryList.find((m) => m.value == params).label; |
| | | }, |
| | | }, |
| | | { label: "åä½", prop: "unit" }, |
| | | { label: "æ ¸åå·¥æ¶", prop: "approvedWorkingHour" }, |
| | | { label: "é¨é¨", prop: "department" }, |
| | | { label: "夿³¨", prop: "remarks" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.openAdd("ç¼è¾", row); |
| | | }, |
| | | showHide: (row) => { |
| | | return this.checkPermi([ |
| | | "performance:manHour:workTimeConfig:edit", |
| | | ]); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | showHide: (row) => { |
| | | return this.checkPermi([ |
| | | "performance:manHour:workTimeConfig:del", |
| | | ]); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | 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 |
| | | exportProcessReport({ ids: this.mutilSelect.map(m => m.id) }).then(res => { |
| | | this.outLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('å¯¼åºæå') |
| | | const url = this.javaApi + '/word/' + res.message; |
| | | this.$download.saveAs(url, "æ¥åç»æ"); |
| | | }) |
| | | }, |
| | | 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() { |
| | | selectUserCondition().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(',') |
| | | if (this.title == 'æ°å¢') { |
| | | addProcessReport(addInfo).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 201) { |
| | | return |
| | | } |
| | | this.addDialogVisible = false |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æä½æå!' |
| | | }); |
| | | this.refreshTable() |
| | | }).catch(err => { }) |
| | | } else { |
| | | doProcessReport(addInfo).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> |
| | |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="columns" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <AddRecord ref="addRecordRef" @submit="submit"></AddRecord> |
| | | </div> |
| | | |
| | | <!-- <div class="tables">--> |
| | | <!-- <ZTTable--> |
| | | <!-- :column="columns"--> |
| | | <!-- :table-data="tableData"--> |
| | | <!-- >--> |
| | | <!-- <template slot="action" slot-scope="{ row }">--> |
| | | <!-- <el-button type="text" @click="edit(row)">ç¼è¾</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </ZTTable>--> |
| | | <!-- <div class="pagination">--> |
| | | <!-- <div></div>--> |
| | | <!-- <el-pagination--> |
| | | <!-- :page-size="pagination.pageSize"--> |
| | | <!-- :page-sizes="[10, 20, 30, 40]"--> |
| | | <!-- :total="pagination.total"--> |
| | | <!-- layout="total, sizes, prev, pager, next, jumper"--> |
| | | <!-- @current-change="handleCurrent"--> |
| | | <!-- @size-change="handleSize"--> |
| | | <!-- >--> |
| | | <!-- </el-pagination>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> |
| | | <!-- <div class="tables">--> |
| | | <!-- <ZTTable--> |
| | | <!-- :column="columns"--> |
| | | <!-- :table-data="tableData"--> |
| | | <!-- >--> |
| | | <!-- <template slot="action" slot-scope="{ row }">--> |
| | | <!-- <el-button type="text" @click="edit(row)">ç¼è¾</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </ZTTable>--> |
| | | <!-- <div class="pagination">--> |
| | | <!-- <div></div>--> |
| | | <!-- <el-pagination--> |
| | | <!-- :page-size="pagination.pageSize"--> |
| | | <!-- :page-sizes="[10, 20, 30, 40]"--> |
| | | <!-- :total="pagination.total"--> |
| | | <!-- layout="total, sizes, prev, pager, next, jumper"--> |
| | | <!-- @current-change="handleCurrent"--> |
| | | <!-- @size-change="handleSize"--> |
| | | <!-- >--> |
| | | <!-- </el-pagination>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | }, |
| | | methods: { |
| | | async getTableData() { |
| | | const res = await getPageAcceptance(this.form); |
| | | if(res.code === 200){ |
| | | const res = await getPageAcceptance(this.form); |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | |
| | | }, |
| | | async submit(form) { |
| | | |
| | | const {code} = await form.acceptance.id ? updateAcceptanc(this.form):addAcceptance((this.form)); |
| | | if(code == 200) { |
| | | this.$message.success(`${form.acceptance.id ? 'ç¼è¾':'æ·»å '}æå`) |
| | | const { code } = await form.acceptance.id ? updateAcceptanc(this.form) : addAcceptance((this.form)); |
| | | if (code == 200) { |
| | | this.$message.success(`${form.acceptance.id ? 'ç¼è¾' : 'æ·»å '}æå`) |
| | | this.getTableData() |
| | | } |
| | | }, |
| | |
| | | url: getAcceptanceDetails, |
| | | params: { id } |
| | | }) |
| | | if(code == 200) { |
| | | if (code == 200) { |
| | | return data; |
| | | } |
| | | }, |
| | |
| | | url: `${exportAcceptance}`, |
| | | responseType: "blob" |
| | | }) |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'æ åç©è´¨éªæ¶.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'æ åç©è´¨éªæ¶.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'æ åç©è´¨éªæ¶.xlsx'); |
| | | }, |
| | | |
| | | // å页忢 |
| | |
| | | let url = ''; |
| | | if (row.type == 1) { |
| | | url = this.javaApi + '/img/' + row.fileUrl |
| | | file.downloadIamge(url, row.fileName) |
| | | this.$download.saveAs(url, row.fileName); |
| | | } else { |
| | | url = this.javaApi + '/word/' + row.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | this.$download.saveAs(url, row.fileName); |
| | | } |
| | | }, |
| | | // å é¤å®¢æ·åæéä»¶ |
| | |
| | | exportManageDocumentIssueRecycle(this.queryParams).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | // this.$download.saveAs(blob, 'åæ¾åæ¶è®°å½.xlsx') |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'åæ¾åæ¶è®°å½.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'åæ¾åæ¶è®°å½.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, 'åæ¾åæ¶è®°å½.xlsx'); |
| | | }) |
| | | }, |
| | | changeFileList(e) { |
| | |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'è¯å®¡è®¡å.docx'; |
| | | link.click(); |
| | | this.$download.saveAs(blob, name) |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'è¯å®¡è®¡å.docx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, 'è¯å®¡è®¡å.docx'); |
| | | }) |
| | | }, |
| | | lookFile(url, name) { |
| | |
| | | handleDown0(url, name) { |
| | | if (!url) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | let url0 = this.javaApi + '/word/' + url |
| | | const link = document.createElement('a'); |
| | | link.href = url0; |
| | | link.target = '_blank'; |
| | | link.click(); |
| | | this.$download.saveAs(url0, name); |
| | | } |
| | | } |
| | | }; |
| | |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'ä¼è®®è®°å½.docx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'ä¼è®®è®°å½.docx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, 'ä¼è®®è®°å½.docx'); |
| | | }) |
| | | }, |
| | | } |
| | |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'è¯å®¡æ¥å.docx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'è¯å®¡æ¥å.docx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | this.$download.saveAs(blob, 'è¯å®¡æ¥å.docx'); |
| | | }) |
| | | }, |
| | | submit(type, row) { |
| | |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="èµè´¨åç§°" prop="name"> |
| | | <el-select |
| | | v-model="queryParams.name" |
| | | placeholder="éæ©èµè´¨åç§°" |
| | | size="small" |
| | | @change="refreshTable()" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.cnas_method_qualification" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | <el-select v-model="queryParams.name" placeholder="éæ©èµè´¨åç§°" size="small" @change="refreshTable()"> |
| | | <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"> |
| | | {{ dict.label }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="refreshTable" |
| | | >æ¥ è¯¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh" |
| | | >é ç½®</el-button |
| | | > |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">æ¥ è¯¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh">é ç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="text-align: left"> |
| | | <el-radio-group |
| | | v-model="radio" |
| | | @input="selectorSwitch" |
| | | size="medium" |
| | | fill="#409EFF" |
| | | > |
| | | <el-radio-group v-model="radio" @input="selectorSwitch" size="medium" fill="#409EFF"> |
| | | <el-radio-button :label="0">èµè´¨æç»</el-radio-button> |
| | | <el-radio-button :label="1">èµè´¨æ»è§</el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right" v-if="radio === 0"> |
| | | <el-button size="small" type="primary" @click="openAdd" |
| | | >èµè´¨æ´æ°</el-button |
| | | > |
| | | <el-button size="small" icon="el-icon-delete" @click="handleDel" |
| | | >å é¤</el-button |
| | | > |
| | | <el-button size="small" type="primary" @click="openAdd">èµè´¨æ´æ°</el-button> |
| | | <el-button size="small" icon="el-icon-delete" @click="handleDel">å é¤</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-if="radio === 0"> |
| | | <lims-table |
| | | :tableData="tableData" |
| | | :column="column" |
| | | :isSelection="true" |
| | | :handleSelectionChange="handleSelectionChange" |
| | | @pagination="pagination" |
| | | :height="'calc(100vh - 300px)'" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | ></lims-table> |
| | | <lims-table :tableData="tableData" :column="column" :isSelection="true" |
| | | :handleSelectionChange="handleSelectionChange" @pagination="pagination" :height="'calc(100vh - 300px)'" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <div |
| | | class="table" |
| | | v-if="radio === 1" |
| | | v-loading="pageLoading" |
| | | @scroll="scrollFn" |
| | | > |
| | | <div class="table" v-if="radio === 1" v-loading="pageLoading" @scroll="scrollFn"> |
| | | <el-row :gutter="16"> |
| | | <el-col |
| | | :span="8" |
| | | v-for="(m, i) in list" |
| | | :key="i" |
| | | :xs="24" |
| | | :sm="12" |
| | | :md="8" |
| | | :lg="8" |
| | | :xl="6" |
| | | style="margin-bottom: 16px" |
| | | > |
| | | <el-col :span="8" v-for="(m, i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="8" :xl="6" |
| | | style="margin-bottom: 16px"> |
| | | <div class="table-item"> |
| | | <el-image |
| | | style=" |
| | | <el-image style=" |
| | | width: 102px; |
| | | height: 102px; |
| | | margin-right: 20px; |
| | | border-radius: 16px; |
| | | " |
| | | :src="javaApi + '/img/' + m.imageUrl" |
| | | > |
| | | <div |
| | | slot="error" |
| | | class="image-error" |
| | | style=" |
| | | " :src="javaApi + '/img/' + m.imageUrl"> |
| | | <div slot="error" class="image-error" style=" |
| | | width: 100px; |
| | | height: 100px; |
| | | border-radius: 16px; |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px solid #eeeeee; |
| | | " |
| | | > |
| | | <i |
| | | class="el-icon-picture-outline" |
| | | style="font-size: 30px; color: #666666" |
| | | ></i> |
| | | "> |
| | | <i class="el-icon-picture-outline" style="font-size: 30px; color: #666666"></i> |
| | | </div> |
| | | </el-image> |
| | | <div |
| | | class="table-item-right" |
| | | style="flex: 1; font-size: 12px; color: #666666" |
| | | > |
| | | <div class="table-item-right" style="flex: 1; font-size: 12px; color: #666666"> |
| | | <p style="line-height: 26px"> |
| | | èµè´¨åç§°ï¼<span style="color: #3a7bfa">{{ m.name }}</span> |
| | | </p> |
| | |
| | | <p style="line-height: 26px">å°ææ¶é´ï¼{{ m.expireTime }}</p> |
| | | <p> |
| | | <span>ç¶æï¼</span> |
| | | <el-tag |
| | | :type="m.state === 0 ? 'danger' : 'success'" |
| | | size="small" |
| | | >{{ m.state === 0 ? "失æ" : "ææ" }}</el-tag |
| | | > |
| | | <el-tag :type="m.state === 0 ? 'danger' : 'success'" size="small">{{ m.state === 0 ? "失æ" : "ææ" |
| | | }}</el-tag> |
| | | </p> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div |
| | | v-if="list.length < 1 && !pageLoading && !isLoding" |
| | | style=" |
| | | <div v-if="list.length < 1 && !pageLoading && !isLoding" style=" |
| | | color: #909399; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | margin-top: 200px; |
| | | " |
| | | > |
| | | "> |
| | | ææ æ°æ® |
| | | </div> |
| | | <div v-if="list.length > 0"> |
| | | <el-button |
| | | v-if="isLoding" |
| | | type="text" |
| | | style="display: flex; margin: 0 auto; color: #909399" |
| | | > |
| | | <el-button v-if="isLoding" type="text" style="display: flex; margin: 0 auto; color: #909399"> |
| | | <i class="el-icon-loading" style="font-size: 20px"></i> |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | v-if="finishLoding" |
| | | style="display: flex; margin: 0 auto; color: #909399" |
| | | >å·²ç»æ²¡ææ´å¤å¦~</el-button |
| | | > |
| | | <el-button type="text" v-if="finishLoding" |
| | | style="display: flex; margin: 0 auto; color: #909399">å·²ç»æ²¡ææ´å¤å¦~</el-button> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="èµè´¨æ´æ°" |
| | | :visible.sync="qualificationsConnectVisible" |
| | | width="400px" |
| | | > |
| | | <el-form |
| | | ref="formDataRef" |
| | | :model="formData" |
| | | label-position="right" |
| | | :rules="formDataRules" |
| | | label-width="78px" |
| | | > |
| | | <el-dialog title="èµè´¨æ´æ°" :visible.sync="qualificationsConnectVisible" width="400px"> |
| | | <el-form ref="formDataRef" :model="formData" label-position="right" :rules="formDataRules" label-width="78px"> |
| | | <el-form-item label="èµè´¨åç§°" prop="name"> |
| | | <el-select |
| | | v-model="formData.name" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | size="small" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.cnas_method_qualification" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | <el-select v-model="formData.name" placeholder="è¯·éæ©" style="width: 100%" size="small" clearable> |
| | | <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"> |
| | | {{ dict.label }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨ç¼ç " prop="code"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="formData.code" |
| | | ></el-input> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.code"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¢åæºæ" prop="organization"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="formData.organization" |
| | | ></el-input> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.organization"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨è¯´æ" prop="explanation"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="formData.explanation" |
| | | ></el-input> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="formData.explanation"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¢åæ¶é´" prop="dateOfIssuance"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="formData.dateOfIssuance" |
| | | type="datetime" |
| | | size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | clearable |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | <el-date-picker style="width: 100%" v-model="formData.dateOfIssuance" type="datetime" size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å°ææ¶é´" prop="expireTime"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="formData.expireTime" |
| | | type="datetime" |
| | | size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | clearable |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | <el-date-picker style="width: 100%" v-model="formData.expireTime" type="datetime" size="small" |
| | | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨å¾ç"> |
| | | <el-upload |
| | | ref="upload" |
| | | :action="uploadAction" |
| | | :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')" |
| | | accept="image/jpg,image/jpeg,image/png" |
| | | :multiple="false" |
| | | :limit="1" |
| | | :headers="headers" |
| | | :on-change="beforeUpload" |
| | | :on-error="onError" |
| | | > |
| | | <el-button slot="trigger" size="small" type="primary" |
| | | >éåå¾ç</el-button |
| | | > |
| | | <el-upload ref="upload" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')" |
| | | accept="image/jpg,image/jpeg,image/png" :multiple="false" :limit="1" :headers="headers" |
| | | :on-change="beforeUpload" :on-error="onError"> |
| | | <el-button slot="trigger" size="small" type="primary">éåå¾ç</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨éä»¶"> |
| | | <el-upload |
| | | ref="upload1" |
| | | :action="uploadAction" |
| | | :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')" |
| | | accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" |
| | | :headers="headers" |
| | | :multiple="false" |
| | | :limit="1" |
| | | :on-change="beforeUpload1" |
| | | :on-error="onError1" |
| | | > |
| | | <el-button slot="trigger" size="small" type="primary" |
| | | >éåæä»¶</el-button |
| | | > |
| | | <el-upload ref="upload1" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')" |
| | | accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" :headers="headers" :multiple="false" |
| | | :limit="1" :on-change="beforeUpload1" :on-error="onError1"> |
| | | <el-button slot="trigger" size="small" type="primary">éåæä»¶</el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="qualificationsConnectVisible = false" |
| | | >å æ¶</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | @click="confirmQualifications" |
| | | :loading="loading" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="qualificationsConnectVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="confirmQualifications" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | }, |
| | | // èµè´¨æç»éä»¶ä¸è½½ |
| | | handleDownLoad(row) { |
| | | // let url = row.fileUrl; |
| | | // const link = document.createElement('a'); |
| | | // link.href = this.javaApi + '/img/'+ url; |
| | | // document.body.appendChild(link); |
| | | // link.target = '_blank'; |
| | | // link.click(); |
| | | const url = process.env.VUE_APP_BASE_API + "/img/" + row.fileUrl; |
| | | this.$download.saveAs(url, row.fileUrl); |
| | | }, |
| | |
| | | line-height: 40px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .table-item { |
| | | border-radius: 8px 8px 8px 8px; |
| | | box-shadow: 4px 4px 8px 0px rgba(51, 51, 51, 0.04); |