| | |
| | | }, |
| | | "dependencies": { |
| | | "@riophae/vue-treeselect": "0.4.0", |
| | | "@vue-office/docx": "^1.6.3", |
| | | "@vue-office/excel": "^1.7.14", |
| | | "@vue/composition-api": "^1.7.2", |
| | | "axios": "0.28.1", |
| | | "clipboard": "2.0.8", |
| | | "core-js": "3.37.1", |
| | |
| | | "js-beautify": "1.13.0", |
| | | "js-cookie": "3.0.1", |
| | | "jsencrypt": "3.0.0-rc.1", |
| | | "jspdf": "^3.0.0", |
| | | "mammoth": "^1.9.0", |
| | | "nprogress": "0.2.0", |
| | | "print-js": "^1.6.0", |
| | |
| | | "vue-barcode": "^1.3.0", |
| | | "vue-count-to": "1.0.13", |
| | | "vue-cropper": "0.5.5", |
| | | "vue-demi": "^0.14.10", |
| | | "vue-meta": "2.4.0", |
| | | "vue-qr": "^4.0.9", |
| | | "vue-router": "3.4.9", |
| | |
| | | </body> |
| | | <script src="<%= BASE_URL %>luckysheet/plugins/js/plugin.js"></script> |
| | | <script src="<%= BASE_URL %>luckysheet/luckysheet.umd.js"></script> |
| | | <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js"></script> |
| | | </html> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // ä½ç³»æä»¶æ§å¶ç¸å
³æ¥å£ |
| | | import request from "@/utils/request"; |
| | | |
| | | // æä»¶æ¸
å-éä»¶ä¸ä¼ |
| | | export function uploadFileManageDocumentList(data) { |
| | | return request({ |
| | | url: "/manageDocumentList/uploadFileManageDocumentList", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶æ¸
å-å表 |
| | | export function pageManageDocumentList(query) { |
| | | return request({ |
| | | url: "/manageDocumentList/pageManageDocumentList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶æ¸
å-å é¤ |
| | | export function delManageDocumentList(query) { |
| | | return request({ |
| | | url: "/manageDocumentList/delManageDocumentList", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶æ¸
å-ç¼è¾ |
| | | export function doManageDocumentList(data) { |
| | | return request({ |
| | | url: "/manageDocumentList/doManageDocumentList", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ§-æ°å¢ |
| | | export function addManageDocumentControlled(data) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/addManageDocumentControlled", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ§-ä¿®æ¹ |
| | | export function doManageDocumentControlled(data) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/doManageDocumentControlled", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶åæ§-è·åpdfæä»¶æµ |
| | | export function checkManageDocumentControlledPdf(query) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/checkManageDocumentControlledPdf", |
| | | method: "get", |
| | | headers: { |
| | | responseType: "blob", |
| | | }, |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ§-å®¡æ ¸ |
| | | export function checkManageDocumentControlled(data) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/checkManageDocumentControlled", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶åæ§-å é¤ |
| | | export function delManageDocumentControlled(query) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/delManageDocumentControlled", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶åæ§-å表 |
| | | export function pageManageDocumentControlled(query) { |
| | | return request({ |
| | | url: "/manageDocumentControlled/pageManageDocumentControlled", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶ä½åº-å表 |
| | | export function pageManageDocumentCancel(query) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/pageManageDocumentCancel", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ¾åæ¶-å¯¼åº |
| | | export function exportManageDocumentIssueRecycle(query) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/exportManageDocumentIssueRecycle", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ¾åæ¶-æ°å¢ |
| | | export function addManageDocumentIssueRecycle(data) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/addManageDocumentIssueRecycle", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ¾åæ¶-ç¼è¾ |
| | | export function doManageDocumentIssueRecycle(data) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/doManageDocumentIssueRecycle", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ¾åæ¶-å®¡æ ¸ |
| | | export function checkManageDocumentIssueRecycle(data) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/checkManageDocumentIssueRecycle", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ¾åæ¶-å表 |
| | | export function pageManageDocumentIssueRecycle(query) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/pageManageDocumentIssueRecycle", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶åæ¾åæ¶-å表 |
| | | export function delManageDocumentIssueRecycle(query) { |
| | | return request({ |
| | | url: "/manageDocumentIssueRecycle/delManageDocumentIssueRecycle", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-å¯¼åº |
| | | export function exportManageDocumentAlter(query) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/exportManageDocumentAlter", |
| | | method: "get", |
| | | headers: { responseType: "blob" }, |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-æ°å¢ |
| | | export function addManageDocumentAlter(data) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/addManageDocumentAlter", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-ç¼è¾ |
| | | export function doManageDocumentAlter(data) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/doManageDocumentAlter", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-è½¬æ¢æµ |
| | | export function checkManageDocumentAlterPdf(query) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/checkManageDocumentAlterPdf", |
| | | method: "get", |
| | | headers: { responseType: "blob" }, |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-å®¡æ ¸ |
| | | export function checkManageDocumentAlter(data) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/checkManageDocumentAlter", |
| | | method: "post", |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶åæ´-å é¤ |
| | | export function delManageDocumentAlter(query) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/delManageDocumentAlter", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶åæ´-å表 |
| | | export function pageManageDocumentAlter(query) { |
| | | return request({ |
| | | url: "/manageDocumentAlter/pageManageDocumentAlter", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶ä½åº-æ°å¢ |
| | | export function addManageDocumentCancel(data) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/addManageDocumentCancel", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶ä½åº-ç¼è¾ |
| | | export function doManageDocumentCancel(data) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/doManageDocumentCancel", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æä»¶ä½åº-å®¡æ ¸ |
| | | export function checkManageDocumentCancel(data) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/checkManageDocumentCancel", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶ä½åº-å¯¼åº |
| | | export function exportManageDocumentCancel(query) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/exportManageDocumentCancel", |
| | | method: "get", |
| | | headers: { responseType: "blob" }, |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æä»¶ä½åº-å é¤ |
| | | export function delManageDocumentCancel(query) { |
| | | return request({ |
| | | url: "/manageDocumentCancel/delManageDocumentCancel", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div v-if="isImage"> |
| | | <img :src="imgUrl" alt="Image Preview" /> |
| | | </div> |
| | | <div v-if="isPdf"> |
| | | <object :data="fileUrl" type="application/pdf" width="100%" height="750px"> |
| | | <p>æ¨çæµè§å¨ä¸æ¯æ PDF é¢è§ã<a :href="fileUrl">ä¸è½½ PDF æä»¶</a></p> |
| | | </object> |
| | | </div> |
| | | <div v-if="isDoc"> |
| | | <p v-if="!isDocShow">ææ¡£æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">ä¸è½½æä»¶</a> |
| | | <vue-office-docx v-else :src="fileUrl" style="height: 100vh;" @rendered="renderedHandler" @error="errorHandler" /> |
| | | </div> |
| | | <div v-if="isXls"> |
| | | <p v-if="!isDocShow">ææ¡£æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">ä¸è½½æä»¶</a> |
| | | <vue-office-excel v-else :src="fileUrl" :options="options" style="height: 100vh;" @rendered="renderedHandler" |
| | | @error="errorHandler" /> |
| | | </div> |
| | | <div v-if="isZipOrRar"> |
| | | <p>å缩æä»¶æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl">ä¸è½½æä»¶</a> |
| | | </div> |
| | | <div v-if="isCsv"> |
| | | <p v-if="csvList.length == 0">CSV æä»¶æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl" v-if="csvList.length == 0">ä¸è½½æä»¶</a> |
| | | <el-tabs type="border-card" v-if="csvList.length > 0" tab-position="bottom"> |
| | | <el-tab-pane :label="item.sheetName" v-for="(item, index) in csvList" :key="index"> |
| | | <el-table :data="item.tableData" height="75vh"> |
| | | <el-table-column :label="m.label" :prop="m.prop" v-for="(m, i) in item.column" :key="i" min-width="120px" |
| | | show-overflow-tooltip> |
| | | <template slot-scope="scope" slot="header"> |
| | | <div> |
| | | <el-tooltip :content="m.label" placement="top"> |
| | | <div class="oneLine"> |
| | | <span>{{ m.label }}</span> |
| | | </div> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | <div v-if="!isSupported"> |
| | | <p>䏿¯æçæä»¶æ ¼å¼</p> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VueOfficeDocx from '@vue-office/docx' |
| | | //å¼å
¥ç¸å
³æ ·å¼ |
| | | import '@vue-office/docx/lib/index.css' |
| | | import VueOfficeExcel from '@vue-office/excel' |
| | | //å¼å
¥ç¸å
³æ ·å¼ |
| | | import '@vue-office/excel/lib/index.css' |
| | | export default { |
| | | components: { |
| | | VueOfficeDocx, |
| | | VueOfficeExcel, |
| | | }, |
| | | props: { |
| | | fileUrl: { |
| | | type: String, |
| | | required: true |
| | | }, |
| | | currentFile: { |
| | | type: Object, |
| | | required: true |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | isDocShow: true, |
| | | options: { |
| | | xls: false, //é¢è§xlsxæä»¶è®¾ä¸ºfalseï¼é¢è§xlsæä»¶è®¾ä¸ºtrue |
| | | minColLength: 0, // excelæå°æ¸²æå¤å°åï¼å¦ææ³å®ç°xlsxæä»¶å
容æå åï¼å°±æ¸²æå åï¼å¯ä»¥å°æ¤å¼è®¾ç½®ä¸º0. |
| | | minRowLength: 0, // excelæå°æ¸²æå¤å°è¡ï¼å¦ææ³å®ç°æ ¹æ®xlsxå®é
彿°æ¸²æï¼å¯ä»¥å°æ¤å¼è®¾ç½®ä¸º0. |
| | | widthOffset: 10, //å¦ææ¸²æåºæ¥çç»ææè§åå
æ ¼å®½åº¦ä¸å¤ï¼å¯ä»¥å¨é»è®¤æ¸²æçå表宽度ä¸åå Npx宽 |
| | | heightOffset: 10, //å¨é»è®¤æ¸²æçå表é«åº¦ä¸åå Npxé« |
| | | beforeTransformData: (workbookData) => { return workbookData }, //åºå±éè¿exceljsè·åexcelæä»¶å
容ï¼éè¿è¯¥é©å彿°ï¼å¯ä»¥å¯¹è·åçexcelæä»¶å
容è¿è¡ä¿®æ¹ï¼æ¯å¦æä¸ªåå
æ ¼çæ°æ®æ¾ç¤ºä¸æ£ç¡®ï¼å¯ä»¥å¨æ¤èªè¡ä¿®æ¹æ¯ä¸ªåå
æ ¼çvalueå¼ã |
| | | transformData: (workbookData) => { return workbookData }, //å°è·åå°çexcelæ°æ®è¿è¡å¤çä¹å䏿¸²æå°é¡µé¢ä¹åï¼å¯éè¿transformData对å³å°æ¸²æçæ°æ®åæ ·å¼è¿è¡ä¿®æ¹ï¼æ¤æ¶æ¯ä¸ªåå
æ ¼çtextå¼å°±æ¯å³å°æ¸²æå°é¡µé¢ä¸çå
容 |
| | | }, |
| | | csvList: [],//csvæä»¶æ°æ® |
| | | imgUrl: '' |
| | | } |
| | | }, |
| | | computed: { |
| | | isImage() { |
| | | let state = /\.(jpg|jpeg|png|gif)$/i.test(this.fileUrl) |
| | | this.imgUrl = this.fileUrl |
| | | if (state) { |
| | | this.imgUrl = this.fileUrl.replaceAll('word', 'img') |
| | | } |
| | | return state; |
| | | }, |
| | | isPdf() { |
| | | return /\.pdf$/i.test(this.fileUrl); |
| | | }, |
| | | isDoc() { |
| | | return /\.(doc|docx)$/i.test(this.fileUrl); |
| | | }, |
| | | isXls() { |
| | | let state = /\.(xls|xlsx)$/i.test(this.fileUrl) |
| | | if (state) { |
| | | if (/\.(xlsx)$/i.test(this.fileUrl)) { |
| | | this.options.xls = false |
| | | } else { |
| | | this.options.xls = true |
| | | } |
| | | } |
| | | return state; |
| | | }, |
| | | isZipOrRar() { |
| | | return /\.(zip|rar)$/i.test(this.fileUrl); |
| | | }, |
| | | isCsv() { |
| | | let state = /\.csv$/i.test(this.fileUrl) |
| | | if (state) { |
| | | this.loadCSVData(); |
| | | // this.main() |
| | | } |
| | | return state; |
| | | }, |
| | | isSupported() { |
| | | return this.isImage || this.isPdf || this.isDoc || this.isZipOrRar || this.isCsv || this.isXls; |
| | | } |
| | | }, |
| | | methods: { |
| | | renderedHandler() { |
| | | console.log("渲æå®æ") |
| | | this.isDocShow = true |
| | | this.resetStyle() |
| | | }, |
| | | errorHandler() { |
| | | console.log("渲æå¤±è´¥") |
| | | this.isDocShow = false |
| | | }, |
| | | async loadCSVData() { |
| | | this.$axios.post(this.$api.insOrderPlan.preview, { |
| | | id: this.currentFile.id, |
| | | }).then(res => { |
| | | let arr = res.data |
| | | arr = arr.map(m => { |
| | | let obj = { |
| | | sheetName: m.sheetName, |
| | | tableData: [], |
| | | column: [] |
| | | } |
| | | obj.tableData = this.formatCSVToTable(m.content.replaceAll('null', ' ')) |
| | | // .replaceAll('MIN','=MIN').replaceAll('MAX','=MAX').replaceAll('AVERAGE','=AVERAGE') |
| | | for (let item in obj.tableData[0]) { |
| | | obj.column.push({ |
| | | label: item, |
| | | prop: item, |
| | | }) |
| | | } |
| | | return obj |
| | | }) |
| | | this.csvList = arr |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | formatCSVToTable(str) { |
| | | const result = []; |
| | | const jsonObj = str.split("\n"); |
| | | let arrHeader = []; |
| | | for (const i in jsonObj) { |
| | | if (typeof jsonObj[i] === 'string' && jsonObj[i].length > 0) { |
| | | const row = `${jsonObj[i]}`; |
| | | if (row.trim().length > 0) { |
| | | const kv = jsonObj[i].split(','); |
| | | if (i == 0) { |
| | | // è·åcolumn表头 |
| | | arrHeader = kv; |
| | | } else { |
| | | const obj = {}; |
| | | for (let index = 0; index < arrHeader.length; index++) { |
| | | // ç»è£
è¡¨æ ¼æ°æ® |
| | | const name = String(arrHeader[index]); |
| | | if (!arrHeader[index]) continue |
| | | if (!obj[name]) { |
| | | try { |
| | | if (kv[index]) { |
| | | obj[name] = String(kv[index]); |
| | | } else { |
| | | obj[name] = ''; |
| | | } |
| | | } catch (err) { |
| | | obj[name] = ''; |
| | | } |
| | | } |
| | | } |
| | | result.push(obj); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result |
| | | }, |
| | | resetStyle() { |
| | | const elements = document.querySelectorAll('[style*="pt"]'); |
| | | for (const element of elements) { |
| | | const style = element.getAttribute('style'); |
| | | if (!!style) { |
| | | element.setAttribute('style', style.replace(/pt/g, 'px')); |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | img { |
| | | max-width: 100%; |
| | | } |
| | | |
| | | .oneLine { |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="up-pdf-stamp"> |
| | | <div class="work" style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;" |
| | | v-if="isUpFile"> |
| | | <input type="file" @change="handleFileUpload" accept="application/pdf" ref="fileInput" /> |
| | | </div> |
| | | <p style="color: red;font-size: 12px;margin: 16px 0;" v-if="canvasNumPages > 0">æç¤ºï¼å¨æä»¶èå´å
ï¼åå»é¼ æ çç« ï¼åå»é¼ æ å·²çå¥½ç« å¤å¯å é¤å½åç« </p> |
| | | <canvas ref="pdfCanvas" @click="e => handleCanvasClick(e, index)" style="border: 1px solid #000;" |
| | | @dblclick="e => removeStamp(e, index)" v-for="(item, index) in canvasNumPages" :key="index"></canvas> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import jsPDF from "jspdf"; |
| | | export default { |
| | | props: ['isUpFile'], |
| | | data() { |
| | | return { |
| | | pdfDoc: null, // åå¨ä¸ä¼ ç PDF æ°æ® |
| | | stamps: [], // è®°å½çç« çä½ç½® |
| | | contextList: [],//canvaså表 |
| | | canvasNumPages: 0,// åå¨ PDF æ»é¡µæ° |
| | | stampWidth: 120, // çç« å®½åº¦ |
| | | stampHeight: 80, // çç« é«åº¦ |
| | | stampsName: '', |
| | | stampsList: ['主任', 'è´¨éè´è´£äºº', 'ææ¯è´è´£äºº', '综å室', 'éä¿¡', 'çµå', 'è£
å¤', 'å¨è½', 'å°é¢'], |
| | | fileName: 'æä»¶å' |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleFileUpload(event) { |
| | | const file = event.target.files[0]; |
| | | if (file.size > 20 * 1024 * 1024) { |
| | | this.$refs.fileInput.value = ""; // æ¸
空æä»¶è¾å
¥æ¡å
容 |
| | | return this.$message.error('æä»¶å¤§å°ä¸è½è¶
è¿20M') |
| | | } |
| | | this.lookFile(file) |
| | | }, |
| | | lookFile(file, currentStamp) { |
| | | this.fileName = file.name |
| | | if (currentStamp) { |
| | | this.stampsName = currentStamp |
| | | } else { |
| | | const index = this.stampsList.indexOf(m => file.name.includes(m)) |
| | | if (index > -1) { |
| | | this.stampsName = this.stampsList[index] |
| | | } else { |
| | | this.stampsName = '综å室' |
| | | } |
| | | } |
| | | if (file && file.type === 'application/pdf') { |
| | | const reader = new FileReader(); |
| | | reader.onload = (e) => { |
| | | const typedArray = new Uint8Array(e.target.result); |
| | | this.loadPDF(typedArray); |
| | | }; |
| | | reader.readAsArrayBuffer(file); |
| | | } else { |
| | | this.$message.error('è¯·éæ© PDF æä»¶'); |
| | | } |
| | | }, |
| | | loadPDF(typedArray) { |
| | | pdfjsLib.getDocument(typedArray).promise.then(pdfDoc_ => { |
| | | this.pdfDoc = pdfDoc_; |
| | | this.canvasNumPages = this.pdfDoc._pdfInfo.numPages |
| | | this.stamps = [] |
| | | this.contextList = [] |
| | | for (let i = 1; i <= this.canvasNumPages; i++) { |
| | | this.$nextTick(() => { |
| | | this.renderPage(i); // 渲æé¡µé¢ |
| | | }); |
| | | this.stamps.push([]) |
| | | } |
| | | }); |
| | | }, |
| | | // 渲ææå®é¡µé¢ |
| | | renderPage(pageNum) { |
| | | this.pdfDoc.getPage(pageNum).then(page => { |
| | | const canvas = this.$refs.pdfCanvas[pageNum - 1]; |
| | | this.contextList.push(canvas.getContext("2d")) |
| | | const viewport = page.getViewport({ scale: 1.5 }); |
| | | |
| | | canvas.width = viewport.width; |
| | | canvas.height = viewport.height; |
| | | |
| | | page.render({ |
| | | canvasContext: this.contextList[pageNum - 1], |
| | | viewport: viewport |
| | | }).promise.then(() => { |
| | | this.stamps[pageNum - 1].forEach(m => { |
| | | this.drawStamps(m.x, m.y, pageNum - 1) |
| | | }) |
| | | }); |
| | | }); |
| | | }, |
| | | // åå»--æ·»å ç« |
| | | handleCanvasClick(event, i) { |
| | | const x = event.offsetX; |
| | | const y = event.offsetY; |
| | | const index = this.stamps[i].findIndex(stamp => { |
| | | let x0 = x - stamp.x; |
| | | let y0 = y - stamp.y; |
| | | return x0 > 0 && x0 < this.stampWidth && y0 > 0 && y0 < this.stampHeight; |
| | | }); |
| | | if (index > -1) return; |
| | | this.drawStamps(x, y, i) |
| | | this.stamps[i].push({ x, y }); |
| | | }, |
| | | // åå»--å é¤çç« |
| | | removeStamp(event, i) { |
| | | const x = event.offsetX; |
| | | const y = event.offsetY; |
| | | // æ¥æ¾è¢«åå»ççç« |
| | | const index = this.stamps[i].findIndex(stamp => { |
| | | let x0 = x - stamp.x; |
| | | let y0 = y - stamp.y; |
| | | return x0 > 0 && x0 < this.stampWidth && y0 > 0 && y0 < this.stampHeight; |
| | | }); |
| | | if (index === -1) return; |
| | | this.stamps[i].splice(index, 1); // å 餿å®ççç« |
| | | this.contextList[i].clearRect(0, 0, this.contextList[i].width, this.contextList[i].height); |
| | | this.renderPage(i + 1) |
| | | }, |
| | | // 渲æç« |
| | | drawStamps(x, y, index) { |
| | | var img = new Image(); |
| | | console.log(this.stampsName) |
| | | // 设置å¾çæº |
| | | img.src = require("@/assets/stamps/" + this.stampsName + ".png"); // æ¿æ¢ä¸ºä½ çå¾ç龿¥ |
| | | let that = this |
| | | img.onload = function () { |
| | | // å¾çå è½½å®æåï¼å°å¾çç»å¶å°canvasä¸ |
| | | that.contextList[index].drawImage(img, x, y, that.stampWidth, that.stampHeight); |
| | | }; |
| | | }, |
| | | // çæ PDF ç彿° |
| | | async generatePDF() { |
| | | if (this.contextList.length === 0) { |
| | | this.$message({ message: '请å
ä¸ä¼ PDFæä»¶', type: 'error' }); |
| | | this.$emit('uploadPDFErr') |
| | | return false |
| | | } |
| | | const pdf = new jsPDF("p", "mm", "a4"); |
| | | for (let i = 0; i < this.contextList.length; i++) { |
| | | console.log(2222, this.contextList.length, this.$refs.pdfCanvas[i]) |
| | | const imgData = this.$refs.pdfCanvas[i].toDataURL('image/jpeg', 1.0); |
| | | const pdfWidth = pdf.internal.pageSize.getWidth(); |
| | | const pdfHeight = (this.$refs.pdfCanvas[i].height * pdfWidth) / this.$refs.pdfCanvas[i].width; |
| | | pdf.addImage(imgData, "JPEG", 0, 0, pdfWidth, pdfHeight); // å°å¾çæ·»å å° PDF |
| | | if (i !== this.contextList.length - 1) { |
| | | pdf.addPage(); // æ·»å æ°çä¸é¡µ |
| | | } |
| | | } |
| | | |
| | | // å° PDF æä»¶ä¿åæä¸ä¼ |
| | | const pdfOutput = pdf.output('blob'); // è·å PDF æä»¶ç Blob 对象 |
| | | |
| | | // ä¸ä¼ å°å端 |
| | | return this.$emit('uploadPDF', pdfOutput, this.fileName) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | const vnodes = [] |
| | | |
| | | if (icon) { |
| | | vnodes.push(<svg-icon icon-class={icon}/>) |
| | | vnodes.push(<svg-icon icon-class={icon} />) |
| | | } |
| | | |
| | | if (title) { |
| | | if (title.length > 5) { |
| | | // vnodes.push(<el-tooltip class="item" effect="dark" content={(title)} placement="top-end"><span slot='title' title={(title)}>{(title)}</span></el-tooltip>) |
| | | vnodes.push(<span slot='title' title={(title)}>{(title)}</span>) |
| | | } else { |
| | | vnodes.push(<span slot='title'>{(title)}</span>) |
| | |
| | | }; |
| | | Vue.prototype.javaApi = process.env.VUE_APP_BASE_API |
| | | ? process.env.VUE_APP_BASE_API |
| | | : "http://192.168.0.170:8002"; |
| | | : "http://192.168.1.36:8002"; |
| | | Vue.prototype.checkPermi = checkPermi; |
| | | |
| | | // å
¨å±ç»ä»¶æè½½ |
| | |
| | | const state = { |
| | | visitedViews: [], |
| | | cachedViews: [], |
| | | iframeViews: [] |
| | | } |
| | | iframeViews: [], |
| | | }; |
| | | |
| | | const mutations = { |
| | | ADD_IFRAME_VIEW: (state, view) => { |
| | | if (state.iframeViews.some(v => v.path === view.path)) return |
| | | if (state.iframeViews.some((v) => v.path === view.path)) return; |
| | | state.iframeViews.push( |
| | | Object.assign({}, view, { |
| | | title: view.meta.title || 'no-name' |
| | | title: view.meta.title || "no-name", |
| | | }) |
| | | ) |
| | | ); |
| | | }, |
| | | ADD_VISITED_VIEW: (state, view) => { |
| | | if (state.visitedViews.some(v => v.path === view.path)) return |
| | | if (state.visitedViews.some((v) => v.path === view.path)) return; |
| | | state.visitedViews.push( |
| | | Object.assign({}, view, { |
| | | title: view.meta.title || 'no-name' |
| | | title: view.meta.title || "no-name", |
| | | }) |
| | | ) |
| | | ); |
| | | }, |
| | | ADD_CACHED_VIEW: (state, view) => { |
| | | if (state.cachedViews.includes(view.name)) return |
| | | if (state.cachedViews.includes(view.name)) return; |
| | | if (view.meta && !view.meta.noCache) { |
| | | state.cachedViews.push(view.name) |
| | | state.cachedViews.push(view.name); |
| | | } |
| | | }, |
| | | DEL_VISITED_VIEW: (state, view) => { |
| | | for (const [i, v] of state.visitedViews.entries()) { |
| | | if (v.path === view.path) { |
| | | state.visitedViews.splice(i, 1) |
| | | break |
| | | state.visitedViews.splice(i, 1); |
| | | break; |
| | | } |
| | | } |
| | | state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) |
| | | state.iframeViews = state.iframeViews.filter( |
| | | (item) => item.path !== view.path |
| | | ); |
| | | }, |
| | | DEL_IFRAME_VIEW: (state, view) => { |
| | | state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) |
| | | state.iframeViews = state.iframeViews.filter( |
| | | (item) => item.path !== view.path |
| | | ); |
| | | }, |
| | | DEL_CACHED_VIEW: (state, view) => { |
| | | const index = state.cachedViews.indexOf(view.name) |
| | | index > -1 && state.cachedViews.splice(index, 1) |
| | | const index = state.cachedViews.indexOf(view.name); |
| | | index > -1 && state.cachedViews.splice(index, 1); |
| | | }, |
| | | |
| | | DEL_OTHERS_VISITED_VIEWS: (state, view) => { |
| | | state.visitedViews = state.visitedViews.filter(v => { |
| | | return v.meta.affix || v.path === view.path |
| | | }) |
| | | state.iframeViews = state.iframeViews.filter(item => item.path === view.path) |
| | | state.visitedViews = state.visitedViews.filter((v) => { |
| | | return v.meta.affix || v.path === view.path; |
| | | }); |
| | | state.iframeViews = state.iframeViews.filter( |
| | | (item) => item.path === view.path |
| | | ); |
| | | }, |
| | | DEL_OTHERS_CACHED_VIEWS: (state, view) => { |
| | | const index = state.cachedViews.indexOf(view.name) |
| | | const index = state.cachedViews.indexOf(view.name); |
| | | if (index > -1) { |
| | | state.cachedViews = state.cachedViews.slice(index, index + 1) |
| | | state.cachedViews = state.cachedViews.slice(index, index + 1); |
| | | } else { |
| | | state.cachedViews = [] |
| | | state.cachedViews = []; |
| | | } |
| | | }, |
| | | DEL_ALL_VISITED_VIEWS: state => { |
| | | DEL_ALL_VISITED_VIEWS: (state) => { |
| | | // keep affix tags |
| | | const affixTags = state.visitedViews.filter(tag => tag.meta.affix) |
| | | state.visitedViews = affixTags |
| | | state.iframeViews = [] |
| | | const affixTags = state.visitedViews.filter((tag) => tag.meta.affix); |
| | | state.visitedViews = affixTags; |
| | | state.iframeViews = []; |
| | | }, |
| | | DEL_ALL_CACHED_VIEWS: state => { |
| | | state.cachedViews = [] |
| | | DEL_ALL_CACHED_VIEWS: (state) => { |
| | | state.cachedViews = []; |
| | | }, |
| | | UPDATE_VISITED_VIEW: (state, view) => { |
| | | for (let v of state.visitedViews) { |
| | | if (v.path === view.path) { |
| | | v = Object.assign(v, view) |
| | | break |
| | | v = Object.assign(v, view); |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | DEL_RIGHT_VIEWS: (state, view) => { |
| | | const index = state.visitedViews.findIndex(v => v.path === view.path) |
| | | const index = state.visitedViews.findIndex((v) => v.path === view.path); |
| | | if (index === -1) { |
| | | return |
| | | return; |
| | | } |
| | | state.visitedViews = state.visitedViews.filter((item, idx) => { |
| | | if (idx <= index || (item.meta && item.meta.affix)) { |
| | | return true |
| | | return true; |
| | | } |
| | | const i = state.cachedViews.indexOf(item.name) |
| | | const i = state.cachedViews.indexOf(item.name); |
| | | if (i > -1) { |
| | | state.cachedViews.splice(i, 1) |
| | | state.cachedViews.splice(i, 1); |
| | | } |
| | | if(item.meta.link) { |
| | | const fi = state.iframeViews.findIndex(v => v.path === item.path) |
| | | state.iframeViews.splice(fi, 1) |
| | | if (item.meta.link) { |
| | | const fi = state.iframeViews.findIndex((v) => v.path === item.path); |
| | | state.iframeViews.splice(fi, 1); |
| | | } |
| | | return false |
| | | }) |
| | | return false; |
| | | }); |
| | | }, |
| | | DEL_LEFT_VIEWS: (state, view) => { |
| | | const index = state.visitedViews.findIndex(v => v.path === view.path) |
| | | const index = state.visitedViews.findIndex((v) => v.path === view.path); |
| | | if (index === -1) { |
| | | return |
| | | return; |
| | | } |
| | | state.visitedViews = state.visitedViews.filter((item, idx) => { |
| | | if (idx >= index || (item.meta && item.meta.affix)) { |
| | | return true |
| | | return true; |
| | | } |
| | | const i = state.cachedViews.indexOf(item.name) |
| | | const i = state.cachedViews.indexOf(item.name); |
| | | if (i > -1) { |
| | | state.cachedViews.splice(i, 1) |
| | | state.cachedViews.splice(i, 1); |
| | | } |
| | | if(item.meta.link) { |
| | | const fi = state.iframeViews.findIndex(v => v.path === item.path) |
| | | state.iframeViews.splice(fi, 1) |
| | | if (item.meta.link) { |
| | | const fi = state.iframeViews.findIndex((v) => v.path === item.path); |
| | | state.iframeViews.splice(fi, 1); |
| | | } |
| | | return false |
| | | }) |
| | | } |
| | | } |
| | | return false; |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | const actions = { |
| | | addView({ dispatch }, view) { |
| | | dispatch('addVisitedView', view) |
| | | dispatch('addCachedView', view) |
| | | dispatch("addVisitedView", view); |
| | | dispatch("addCachedView", view); |
| | | }, |
| | | addIframeView({ commit }, view) { |
| | | commit('ADD_IFRAME_VIEW', view) |
| | | commit("ADD_IFRAME_VIEW", view); |
| | | }, |
| | | addVisitedView({ commit }, view) { |
| | | commit('ADD_VISITED_VIEW', view) |
| | | commit("ADD_VISITED_VIEW", view); |
| | | }, |
| | | addCachedView({ commit }, view) { |
| | | commit('ADD_CACHED_VIEW', view) |
| | | commit("ADD_CACHED_VIEW", view); |
| | | }, |
| | | delView({ dispatch, state }, view) { |
| | | return new Promise(resolve => { |
| | | dispatch('delVisitedView', view) |
| | | dispatch('delCachedView', view) |
| | | return new Promise((resolve) => { |
| | | dispatch("delVisitedView", view); |
| | | dispatch("delCachedView", view); |
| | | resolve({ |
| | | visitedViews: [...state.visitedViews], |
| | | cachedViews: [...state.cachedViews] |
| | | }) |
| | | }) |
| | | cachedViews: [...state.cachedViews], |
| | | }); |
| | | }); |
| | | }, |
| | | delVisitedView({ commit, state }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_VISITED_VIEW', view) |
| | | resolve([...state.visitedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_VISITED_VIEW", view); |
| | | resolve([...state.visitedViews]); |
| | | }); |
| | | }, |
| | | delIframeView({ commit, state }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_IFRAME_VIEW', view) |
| | | resolve([...state.iframeViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_IFRAME_VIEW", view); |
| | | resolve([...state.iframeViews]); |
| | | }); |
| | | }, |
| | | delCachedView({ commit, state }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_CACHED_VIEW', view) |
| | | resolve([...state.cachedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_CACHED_VIEW", view); |
| | | resolve([...state.cachedViews]); |
| | | }); |
| | | }, |
| | | delOthersViews({ dispatch, state }, view) { |
| | | return new Promise(resolve => { |
| | | dispatch('delOthersVisitedViews', view) |
| | | dispatch('delOthersCachedViews', view) |
| | | return new Promise((resolve) => { |
| | | dispatch("delOthersVisitedViews", view); |
| | | dispatch("delOthersCachedViews", view); |
| | | resolve({ |
| | | visitedViews: [...state.visitedViews], |
| | | cachedViews: [...state.cachedViews] |
| | | }) |
| | | }) |
| | | cachedViews: [...state.cachedViews], |
| | | }); |
| | | }); |
| | | }, |
| | | delOthersVisitedViews({ commit, state }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_OTHERS_VISITED_VIEWS', view) |
| | | resolve([...state.visitedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_OTHERS_VISITED_VIEWS", view); |
| | | resolve([...state.visitedViews]); |
| | | }); |
| | | }, |
| | | delOthersCachedViews({ commit, state }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_OTHERS_CACHED_VIEWS', view) |
| | | resolve([...state.cachedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_OTHERS_CACHED_VIEWS", view); |
| | | resolve([...state.cachedViews]); |
| | | }); |
| | | }, |
| | | delAllViews({ dispatch, state }, view) { |
| | | return new Promise(resolve => { |
| | | dispatch('delAllVisitedViews', view) |
| | | dispatch('delAllCachedViews', view) |
| | | return new Promise((resolve) => { |
| | | dispatch("delAllVisitedViews", view); |
| | | dispatch("delAllCachedViews", view); |
| | | resolve({ |
| | | visitedViews: [...state.visitedViews], |
| | | cachedViews: [...state.cachedViews] |
| | | }) |
| | | }) |
| | | cachedViews: [...state.cachedViews], |
| | | }); |
| | | }); |
| | | }, |
| | | delAllVisitedViews({ commit, state }) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_ALL_VISITED_VIEWS') |
| | | resolve([...state.visitedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_ALL_VISITED_VIEWS"); |
| | | resolve([...state.visitedViews]); |
| | | }); |
| | | }, |
| | | delAllCachedViews({ commit, state }) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_ALL_CACHED_VIEWS') |
| | | resolve([...state.cachedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_ALL_CACHED_VIEWS"); |
| | | resolve([...state.cachedViews]); |
| | | }); |
| | | }, |
| | | updateVisitedView({ commit }, view) { |
| | | commit('UPDATE_VISITED_VIEW', view) |
| | | commit("UPDATE_VISITED_VIEW", view); |
| | | }, |
| | | delRightTags({ commit }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_RIGHT_VIEWS', view) |
| | | resolve([...state.visitedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_RIGHT_VIEWS", view); |
| | | resolve([...state.visitedViews]); |
| | | }); |
| | | }, |
| | | delLeftTags({ commit }, view) { |
| | | return new Promise(resolve => { |
| | | commit('DEL_LEFT_VIEWS', view) |
| | | resolve([...state.visitedViews]) |
| | | }) |
| | | return new Promise((resolve) => { |
| | | commit("DEL_LEFT_VIEWS", view); |
| | | resolve([...state.visitedViews]); |
| | | }); |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | export default { |
| | | namespaced: true, |
| | | state, |
| | | mutations, |
| | | actions |
| | | } |
| | | actions, |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æä»¶åæ§ç³è¯· --> |
| | | <div class="controlled-file-application" style="height: 100%;"> |
| | | <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.documentCode" |
| | | @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="queryParams.createUserName" @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 class="btns" style="padding-left: 30px;"> |
| | | <el-button size="small" type="primary" |
| | | @click="addDialogVisible = true, addInfo = {}, file = null">æä»¶åæ§ç³è¯·</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog title="æä»¶åæ§ç³è¯·" :visible.sync="addDialogVisible" width="800px" top="10vh"> |
| | | <el-row> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ç³è¯·ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable |
| | | v-model="addInfo.documentCode"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">责任人ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.dutyUser" size="small" style="width: 100%;" filterable> |
| | | <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="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç±»å«ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.type" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in fileType" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" 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.name"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" 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.version"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ä¸ä¼ éä»¶ï¼</div> |
| | | <div class="search_input"><el-upload style="margin: 8px 0 0px 50px;" action="#" :auto-upload="false" |
| | | :multiple="false" accept='.pdf' :on-change="handleChangeUpload" v-if="addDialogVisible"> |
| | | <el-button size="small" type="primary">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" 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.writer"></el-input> --> |
| | | <el-select v-model="addInfo.writer" size="small" style="width: 100%;" filterable> |
| | | <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.label"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æäº¤æ¥æï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.submitDate" 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="12" 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.instructions" |
| | | 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> |
| | | <el-dialog title="æ¥çéä»¶" :visible.sync="lookDialogVisible" width="800px" top="5vh" fullscreen> |
| | | <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}" |
| | | style="height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | <el-dialog title="å®¡æ ¸" :visible.sync="checkDialogVisible" width="1000px" top="5vh"> |
| | | <UpPdfStamp ref="UpPdfStamp" v-if="checkDialogVisible" @uploadPDF="uploadPDF" :isUpFile="false"></UpPdfStamp> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleCheckSub('ä¸éè¿')" :loading="noCheckLoading">ä¸éè¿</el-button> |
| | | <el-button type="primary" @click="handleCheckSub('éè¿')" :loading="checkLoading">é è¿</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="éæ©åæ§ç« " :visible.sync="checkStampDialogVisible" width="600px" top="5vh"> |
| | | <div class="stamp-list"> |
| | | <img :src="require('@/assets/stamps/' + item + '.png')" alt="" v-for="(item, index) in stampsList" :key="index" |
| | | style="width: 120px;height: 80px;margin: 6px;" class="stamp" :class="{ active: currentStamp == item }" |
| | | @click="currentStamp = item"> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="checkStampDialogVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleCheck0(currentInfo)">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import UpPdfStamp from '@/components/UpPdfStamp/index.vue' |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import { |
| | | addManageDocumentControlled, |
| | | doManageDocumentControlled, |
| | | checkManageDocumentControlledPdf, |
| | | delManageDocumentControlled, |
| | | pageManageDocumentControlled, |
| | | checkManageDocumentControlled, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | components: { |
| | | filePreview, |
| | | UpPdfStamp, |
| | | limsTable |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | upLoading: false, |
| | | addPower: false, |
| | | addDialogVisible: false, |
| | | addLoading: false, |
| | | lookDialogVisible: false, |
| | | checkDialogVisible: false, |
| | | checkStampDialogVisible: false, |
| | | addInfo: {}, |
| | | personList: [], |
| | | fileType: [], |
| | | file: null, |
| | | currentInfo: {}, |
| | | checkLoading: false, |
| | | noCheckLoading: false, |
| | | type: '', |
| | | stampsList: ['主任', 'è´¨éè´è´£äºº', 'ææ¯è´è´£äºº', '综å室', 'éä¿¡', 'çµå', 'è£
å¤', 'å¨è½', 'å°é¢'], |
| | | currentStamp: '主任', |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "ç³è¯·æä»¶ç¼å·", prop: "documentCode" }, |
| | | { |
| | | label: "æä»¶ç±»å«", prop: "type", width: "120px", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.fileType.find((m) => m.value == params).label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.fileType.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { |
| | | label: "ç³è¯·äºº", |
| | | prop: "createUserName", |
| | | }, |
| | | { label: "ç³è¯·æ¶é´", prop: "createTime" }, |
| | | { label: "说æ", prop: "instructions" }, |
| | | { label: "æäº¤æ¥æ", prop: "submitDate" }, |
| | | { label: "责任人", prop: "dutyUserName" }, |
| | | { |
| | | label: "ç³è¯·ç¶æ", prop: "state", dataType: "tag", |
| | | formatData: (params) => { |
| | | return params; |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 'éè¿') { |
| | | return 'success' |
| | | } else { |
| | | return 'danger' |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleUpdate(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "å®¡æ ¸", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleCheck(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return !row.dutyUserName.includes(this.nickName) || row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "æ¥çéä»¶", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleLook(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDown(row); |
| | | }, |
| | | }, |
| | | |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | this.getAuthorizedPerson() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | pageManageDocumentControlled({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | // let check = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'addManageDocumentControlled') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'addManageDocumentControlled') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delManageDocumentControlled') { |
| | | del = true |
| | | } |
| | | // if (power[i].menuMethod == 'checkManageDocumentControlled') { |
| | | // check = true |
| | | // } |
| | | } |
| | | // if (!check) { |
| | | // this.componentData.do.splice(2, 1) |
| | | // } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | getAuthorizedPerson() { |
| | | selectUserCondition().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.personList = data |
| | | }) |
| | | }, |
| | | selectEnumByCategory() { |
| | | // æä»¶ç±»å« |
| | | this.getDicts("document_type").then((response) => { |
| | | this.fileType = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // æäº¤ |
| | | handleAdd() { |
| | | if (!this.addInfo.documentCode) return this.$message({ type: 'error', message: "请è¾å
¥ç¼å·" }) |
| | | if (!this.addInfo.id) { |
| | | // æ°å¢ |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | for (let m in this.addInfo) { |
| | | fd.append(m, this.addInfo[m]) |
| | | } |
| | | this.addLoading = true |
| | | addManageDocumentControlled(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æ·»å æå' |
| | | }) |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'æ·»å 失败' |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // ä¿®æ¹ |
| | | let { id, documentCode, dutyUser, type, name, version, writer, submitDate, instructions } = this.addInfo |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | fd.append("id", id); |
| | | fd.append("documentCode", documentCode); |
| | | fd.append("dutyUser", dutyUser); |
| | | fd.append("type", type); |
| | | fd.append("name", name); |
| | | fd.append("version", version); |
| | | fd.append("writer", writer); |
| | | fd.append("submitDate", submitDate); |
| | | fd.append("instructions", instructions); |
| | | this.addLoading = true |
| | | doManageDocumentControlled(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'æ·»å 失败' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | handleChangeUpload(file, fileLists) { |
| | | this.file = file |
| | | this.$set(this.addInfo, 'name', file.name) |
| | | }, |
| | | // ç¼è¾ |
| | | handleUpdate(row) { |
| | | this.title = 'æä»¶åæ´ç³è¯·' |
| | | this.addInfo = this.HaveJson(row) |
| | | this.addDialogVisible = true |
| | | }, |
| | | // æ¥çéä»¶ |
| | | handleLook(row) { |
| | | this.currentInfo = row |
| | | this.lookDialogVisible = true |
| | | }, |
| | | // å®¡æ ¸ |
| | | handleCheck(row) { |
| | | this.title = 'å®¡æ ¸' |
| | | this.currentInfo = row |
| | | if (!row.url) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | this.checkStampDialogVisible = true |
| | | }, |
| | | handleCheck0(row) { |
| | | this.checkStampDialogVisible = false |
| | | this.checkDialogVisible = true |
| | | checkManageDocumentControlledPdf({ id: row.id }).then(res => { |
| | | const blob = new Blob([res]); |
| | | const file = new File([blob], row.name, { type: 'application/pdf' }) |
| | | this.$refs.UpPdfStamp.lookFile(file, this.currentStamp) |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | handleDown(row) { |
| | | if (!row.url) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | let url = this.javaApi + '/word/' + row.url |
| | | this.$download.saveAs(url, row.url); |
| | | }, |
| | | async uploadPDF(pdfBlob) { |
| | | const formData = new FormData(); |
| | | formData.append('file', pdfBlob, this.fileName + '.pdf'); // æä»¶å段 |
| | | formData.append('id', this.currentInfo.id); // æä»¶ååæ®µ |
| | | formData.append('state', this.type); // æä»¶ååæ®µ |
| | | formData.append('writer', this.currentInfo.writer); // æä»¶ååæ®µ |
| | | |
| | | let res = await checkManageDocumentControlled(formData) |
| | | this.checkLoading = false |
| | | this.noCheckLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ message: 'æä½æå', type: 'success' }); |
| | | this.checkDialogVisible = false; |
| | | this.refreshTable() |
| | | return true |
| | | } else { |
| | | this.$message({ message: 'æä½å¤±è´¥', type: 'error' }); |
| | | return false |
| | | } |
| | | }, |
| | | handleCheckSub(type) { |
| | | this.type = type |
| | | if (type == 'éè¿') { |
| | | this.checkLoading = true |
| | | } else { |
| | | this.noCheckLoading = true |
| | | } |
| | | this.addLoading = true |
| | | this.$refs['UpPdfStamp'].generatePDF() |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentControlled({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .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 { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 5px; |
| | | } |
| | | |
| | | .stamp { |
| | | cursor: pointer; |
| | | border: #fff 1px solid; |
| | | } |
| | | |
| | | .stamp:hover { |
| | | border: #3A7BFA 1px solid; |
| | | box-shadow: inset 0px 0px 15px #3A7BFA; |
| | | } |
| | | |
| | | .stamp.active { |
| | | border: #3A7BFA 1px solid; |
| | | box-shadow: inset 0px 0px 15px #3A7BFA; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- åæ¾åæ¶è®°å½ --> |
| | | <div class="distribution-collection-record" style="height: 100%;"> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="queryParams.documentCode" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶åç§°ï¼</div> |
| | | <div class="search_input"><el-input v-model="queryParams.name" clearable placeholder="请è¾å
¥" size="small" |
| | | @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 class="btns" style="padding-left: 30px;"> |
| | | <el-button v-if="addPower" size="small" type="primary" |
| | | @click="addDialogVisible = true, addInfo = {}, radio = 'åæ¾'">æ·»å åæ¾è®°å½</el-button> |
| | | <el-button v-if="outPower" :loading="outLoading" size="small" type="primary" @click="handleOut">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog :title="'æ·»å ' + radio + 'è®°å½'" :visible.sync="addDialogVisible" top="10vh" width="800px"> |
| | | <el-row> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ç³è¯·ç¼å·ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.documentCode" :disabled="radio == 'åæ¶'" allow-create clearable filterable |
| | | size="small" style="width: 100%;" @change="changeFileList"> |
| | | <el-option v-for="item in fileList" :key="item.documentCode" :label="item.documentCode" |
| | | :value="item.documentCode"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="radio == 'åæ¾'" :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>åæ¾äººï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.issueUser" filterable 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 v-else :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>åæ¶äººï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.recycleUser" filterable 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="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>审æ¹äººï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.receiveUser" :disabled="radio != 'åæ¾'" filterable 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="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶åç§°ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.name" :disabled="radio == 'åæ¶'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶çæ¬ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.version" :disabled="radio == 'åæ¶'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç¶æï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.state" :disabled="radio == 'åæ¶'" size="small" style="width: 100%;"> |
| | | <el-option v-for="(item, index) in fileState" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="radio == 'åæ¾'" :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¾ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.issueCode" clearable placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-else :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¶ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.recycleCode" clearable placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="radio == 'åæ¾'" :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¾æ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.issueDate" format="yyyy-MM-dd" placeholder="éæ©æ¥æ" size="small" |
| | | style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-else :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¶æ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.recycleDate" format="yyyy-MM-dd" placeholder="éæ©æ¥æ" size="small" |
| | | style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="radio == 'åæ¾'" :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¾è¯´æï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.issueNote" :rows="2" clearable placeholder="请è¾å
¥" |
| | | size="small" type="textarea"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-else :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">åæ¶è¯´æï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.recycleNote" :rows="2" clearable placeholder="请è¾å
¥" |
| | | size="small" type="textarea"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="radio == 'åæ¾'" :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ä¸ä¼ éä»¶ï¼</div> |
| | | <div class="search_input"><el-upload :auto-upload="false" :multiple="false" :on-change="handleChangeUpload" |
| | | accept='.pdf,.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx' action="#" style="margin: 8px 0 0px 50px;"> |
| | | <el-button size="small" type="primary">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">å æ¶</el-button> |
| | | <el-button :loading="addLoading" type="primary" @click="handleAdd">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="lookDialogVisible" fullscreen title="æ¥çéä»¶" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/word/' + currentInfo.url" |
| | | style="height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import { |
| | | pageManageDocumentList, |
| | | pageManageDocumentCancel, |
| | | exportManageDocumentIssueRecycle, |
| | | addManageDocumentIssueRecycle, |
| | | doManageDocumentIssueRecycle, |
| | | checkManageDocumentIssueRecycle, |
| | | pageManageDocumentIssueRecycle, |
| | | delManageDocumentIssueRecycle, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | components: { |
| | | filePreview, |
| | | limsTable |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | ddPower: false, |
| | | outPower: true, |
| | | addInfo: {}, |
| | | addPower: true, |
| | | addLoading: false, |
| | | addDialogVisible: false, |
| | | outLoading: false, |
| | | personList: [], |
| | | fileList: [], |
| | | fileList0: [], |
| | | radio: 'åæ¾', |
| | | fileState: [], |
| | | file: null, |
| | | currentInfo: {}, |
| | | lookDialogVisible: false, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "æä»¶ç¼å·", prop: "documentCode" }, |
| | | { label: "æä»¶åç§°", prop: "name" }, |
| | | { |
| | | label: "æä»¶çæ¬", |
| | | prop: "version", |
| | | }, |
| | | { label: "æä»¶ç¶æ", prop: "documentState" }, |
| | | { label: "åæ¾ç¼å·", prop: "issueUserName" }, |
| | | { label: "åæ¾äºº", prop: "department" }, |
| | | { label: "åæ¾æ¥æ", prop: "issueDate" }, |
| | | { label: "åæ¶äºº", prop: "recycleUserName" }, |
| | | { label: "åæ¶æ¥æ", prop: "recycleDate" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "åæ¶è®°å½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleUpdate(row); |
| | | } |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabFun: (row, index) => { |
| | | return row.documentState == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "æ¥çéä»¶", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleLook(row); |
| | | }, |
| | | disabFun: (row, index) => { |
| | | return !row.url |
| | | } |
| | | }, |
| | | { |
| | | name: "å®¡æ ¸", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleCheck(row); |
| | | }, |
| | | disabFun: (row, index) => { |
| | | return row.receiveUser != this.userId || row.documentState == 'éè¿' |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | this.getAuthorizedPerson() |
| | | this.getFileList() |
| | | this.getFileList0() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let out = false |
| | | let del = false |
| | | let add = false |
| | | // let check = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'exportManageDocumentIssueRecycle') { |
| | | out = true |
| | | } |
| | | if (power[i].menuMethod == 'addManageDocumentIssueRecycle') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delManageDocumentIssueRecycle') { |
| | | del = true |
| | | } |
| | | // if (power[i].menuMethod == 'checkManageDocumentControlled') { |
| | | // check = true |
| | | // } |
| | | } |
| | | // if (!check) { |
| | | // this.componentData.do.splice(2, 1) |
| | | // } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!add) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | this.outPower = out |
| | | }, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | pageManageDocumentIssueRecycle({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | selectEnumByCategory() { |
| | | // æä»¶ç¶æ |
| | | this.getDicts("document_state").then((response) => { |
| | | this.fileState = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // è·å人åå表 |
| | | getAuthorizedPerson() { |
| | | selectUserCondition().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.personList = data |
| | | }) |
| | | }, |
| | | // è·åæä»¶å表--æä»¶æ¸
å |
| | | getFileList() { |
| | | pageManageDocumentList({ |
| | | current: -1, |
| | | size: -1 |
| | | }).then(res => { |
| | | this.fileList = res.data.records |
| | | }).catch(err => { }) |
| | | }, |
| | | // è·åæä»¶å表--ä½åºæä»¶ |
| | | getFileList0() { |
| | | pageManageDocumentCancel({ |
| | | current: -1, |
| | | size: -1 |
| | | }).then(res => { |
| | | this.fileList0 = res.data.records |
| | | }).catch(err => { }) |
| | | }, |
| | | // å¯¼åº |
| | | handleOut() { |
| | | this.outLoading = true |
| | | // queryParams |
| | | 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('å¯¼åºæå') |
| | | // } |
| | | // } |
| | | }) |
| | | }, |
| | | changeFileList(e) { |
| | | if (e) { |
| | | let obj = this.fileList.find(a => a.documentCode == e) |
| | | if (obj) { |
| | | this.addInfo.name = obj.name |
| | | this.addInfo.version = obj.version |
| | | this.addInfo.state = obj.state |
| | | } |
| | | } |
| | | }, |
| | | // æäº¤ |
| | | handleAdd() { |
| | | if (!this.addInfo.documentCode) { |
| | | this.$message.error('è¯·éæ©æä»¶') |
| | | return |
| | | } |
| | | if (!this.addInfo.receiveUser) { |
| | | this.$message.error('è¯·éæ©å®¡æ¹äºº') |
| | | return |
| | | } |
| | | if (this.radio == 'åæ¾') { |
| | | if (!this.addInfo.issueUser) { |
| | | this.$message.error('è¯·éæ©åæ¾äºº') |
| | | return |
| | | } |
| | | } else { |
| | | if (!this.addInfo.recycleUser) { |
| | | this.$message.error('è¯·éæ©åæ¶äºº') |
| | | return |
| | | } |
| | | } |
| | | this.addLoading = true; |
| | | if (!this.addInfo.id) { |
| | | // æ°å¢åæ¾è®°å½ |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | for (let key in this.addInfo) { |
| | | fd.append(key, this.addInfo[key]) |
| | | } |
| | | addManageDocumentIssueRecycle(fd).then(res => { |
| | | this.addLoading = false; |
| | | if (res.code == 200) { |
| | | this.$message.success('åæ¾æå') |
| | | this.addDialogVisible = false |
| | | this.refreshTable() |
| | | } |
| | | }) |
| | | } else { |
| | | let { documentCode, id, issueUser, recycleUser, receiveUser, name, version, documentState, issueCode, recycleCode, issueDate, recycleDate, issueNote, recycleNote } = this.addInfo |
| | | // æ·»å åæ¶è®°å½ |
| | | doManageDocumentIssueRecycle({ |
| | | documentCode, |
| | | id, |
| | | issueUser, |
| | | recycleUser, |
| | | receiveUser, |
| | | name, |
| | | version, |
| | | documentState, |
| | | issueCode, |
| | | recycleCode, |
| | | issueDate, |
| | | recycleDate, |
| | | issueNote, |
| | | recycleNote |
| | | }).then(res => { |
| | | this.addLoading = false; |
| | | if (res.code == 200) { |
| | | this.$message.success('æäº¤æå') |
| | | this.addDialogVisible = false |
| | | this.refreshTable() |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // æ·»å åæ¶ |
| | | handleUpdate(row) { |
| | | this.addInfo = this.HaveJson(row) |
| | | this.radio = 'åæ¶' |
| | | this.addDialogVisible = true |
| | | }, |
| | | // å®¡æ ¸ |
| | | handleCheck(row) { |
| | | this.$confirm('æ¯å¦å®¡æ ¸éè¿?', 'æç¤º', { |
| | | confirmButtonText: 'éè¿', |
| | | cancelButtonText: 'ä¸éè¿', |
| | | type: 'warning', |
| | | closeOnClickModal: false, // ç¦æ¢ç¹å»é®ç½©å±å
³é |
| | | distinguishCancelAndClose: true, |
| | | beforeClose: (action, instance, done) => { |
| | | if (action === 'confirm') { |
| | | // ç¹å»âç¡®å®âæé®ï¼å
许å
³é |
| | | checkManageDocumentIssueRecycle({ id: row.id, documentState: 'éè¿' }).then(res => { |
| | | this.refreshTable() |
| | | done(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | }) |
| | | .catch(err => { |
| | | |
| | | }) |
| | | } else if (action === 'cancel') { |
| | | // ç¹å»âåæ¶âæé®ï¼ä¸å
许å
³é |
| | | checkManageDocumentIssueRecycle({ id: row.id, documentState: 'ä¸éè¿' }).then(res => { |
| | | this.refreshTable() |
| | | done(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | }) |
| | | .catch(err => { |
| | | |
| | | }) |
| | | } else if (action === 'close') { |
| | | // ç¹å»âÃâæé®ï¼ä¸å
许å
³é |
| | | done(); |
| | | console.log("Ãæé®ç¹å»äºä»¶ï¼ä¸å
³éå¼¹æ¡"); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | handleChangeUpload(file, fileLists) { |
| | | this.file = file |
| | | this.$set(this.addInfo, 'name', file.name) |
| | | }, |
| | | // æ¥çéä»¶ |
| | | handleLook(row) { |
| | | this.currentInfo = this.HaveJson(row) |
| | | this.lookDialogVisible = true |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentIssueRecycle({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .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 { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 5px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æä»¶åæ´ç³è¯· --> |
| | | <div class="file-change-request" style="height: 100%;"> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ç³è¯·æä»¶ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="queryParams.code" clearable placeholder="请è¾å
¥" size="small" |
| | | @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 class="btns"> |
| | | <el-button size="small" type="primary" |
| | | @click="addDialogVisible = true, addInfo = {}, currentFile = {}, title = 'æä»¶åæ´ç³è¯·'">æä»¶åæ´ç³è¯·</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleOut">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <!-- <ValueTable :key="upIndex" ref="ValueTable" :componentData="componentData" |
| | | :delUrl="$api.manageDocumentList.delManageDocumentAlter" |
| | | :url="$api.manageDocumentList.pageManageDocumentAlter" /> --> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="addDialogVisible" top="0vh" width="950px"> |
| | | <el-row> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ç³è¯·ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.code" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">审æ¹äººï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.checkUser" :disabled="title == 'å®¡æ ¸'" filterable 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="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ææåæ´æ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.expectAlterDate" :disabled="title == 'å®¡æ ¸'" format="yyyy-MM-dd" |
| | | placeholder="éæ©æ¥æ" size="small" style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">å®é
åæ´æ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.actuallyAlterDate" :disabled="title == 'å®¡æ ¸'" format="yyyy-MM-dd" |
| | | placeholder="éæ©æ¥æ" size="small" style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </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.alterBeforeCode" :disabled="title == 'å®¡æ ¸'" allow-create clearable filterable |
| | | size="small" style="width: 100%;" @change="getCurrentFile"> |
| | | <el-option v-for="item in fileList" :key="item.documentCode" :label="item.title" |
| | | :value="item.documentCode"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <h4 class="title">å½åæä»¶ä¿¡æ¯</h4> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æä»¶ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="currentFile.documentCode" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æä»¶åç§°ï¼</div> |
| | | <div class="search_input"><el-input v-model="currentFile.name" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æä»¶çæ¬ï¼</div> |
| | | <div class="search_input"><el-input v-model="currentFile.version" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æäº¤äººï¼</div> |
| | | <div class="search_input"><el-select v-model="currentFile.createUser" disabled filterable 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="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">å®¡æ ¸äººï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.version" disabled></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">ä½åºäººï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.version" disabled></el-input></div> |
| | | </div> |
| | | </el-col> --> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æäº¤æ¶é´ï¼</div> |
| | | <div class="search_input"><el-input v-model="currentFile.createTime" clearable disabled placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">å®¡æ ¸æ¶é´ï¼</div> |
| | | <div class="search_input"><el-input v-model="currentFile.effectiveDate" clearable disabled placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <!-- <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">ä½åºæ¶é´ï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.version" disabled></el-input></div> |
| | | </div> |
| | | </el-col> --> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æä»¶ç¶æï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="currentFile.state" disabled size="small" style="width: 100%;"> |
| | | <el-option v-for="item in fileState" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <!-- <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">æä»¶è¯´æï¼</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请è¾å
¥" clearable v-model="addInfo.instructions" type="textarea" |
| | | :rows="2" disabled></el-input></div> |
| | | </div> |
| | | </el-col> --> |
| | | <el-col :span="24"> |
| | | <h4 class="title">æä»¶åæ´ç³è¯·</h4> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">åæ´åç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.alterAfterCode" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">åæ´ååç§°ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.alterAfterName" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">åä¸çæ¬å¤çï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.method" :disabled="title == 'å®¡æ ¸'" size="small" style="width: 100%;"> |
| | | <el-option label="ä½åº" value="ä½åº"></el-option> |
| | | <el-option label="åæ¡£ä¸å¯ç¨" value="åæ¡£ä¸å¯ç¨"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">åæ´åçæ¬ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.alterAfterVersion" :disabled="title == 'å®¡æ ¸'" clearable |
| | | placeholder="请è¾å
¥" size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="16" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">åæ´è¯´æï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.alterNote" :disabled="title == 'å®¡æ ¸'" :rows="2" |
| | | clearable placeholder="请è¾å
¥" size="small" type="textarea"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col v-if="title != 'å®¡æ ¸'" :span="24" style="margin-bottom: 16px;"> |
| | | <div class="search_thing" style="width: 100%;"> |
| | | <div class="search_label">ç¸å
³éä»¶ï¼</div> |
| | | <div class="search_input"><el-upload v-if="addDialogVisible" :auto-upload="false" :multiple="false" |
| | | :on-change="handleChangeUpload" accept='.pdf' action="#" style="margin: 8px 0 0px 50px;"> |
| | | <el-button size="small" type="primary">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload></div> |
| | | </div> |
| | | </el-col> |
| | | <UpPdfStamp v-if="title == 'å®¡æ ¸' && addDialogVisible" ref="UpPdfStamp" :isUpFile="false" @uploadPDF="uploadPDF"> |
| | | </UpPdfStamp> |
| | | </el-row> |
| | | <span v-if="title != 'å®¡æ ¸'" slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">å æ¶</el-button> |
| | | <el-button :loading="addLoading" type="primary" @click="handleAdd">ç¡® å®</el-button> |
| | | </span> |
| | | <span v-else slot="footer" class="dialog-footer"> |
| | | <el-button :loading="noCheckLoading" @click="handleCheckSub('ä¸éè¿')">ä¸éè¿</el-button> |
| | | <el-button :loading="checkLoading" type="primary" @click="handleCheckSub('éè¿')">é è¿</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="lookDialogVisible" fullscreen title="æ¥çéä»¶" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/word/' + currentInfo.alterAfterUrl" |
| | | style="height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import UpPdfStamp from '@/components/UpPdfStamp/index.vue' |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import { |
| | | exportManageDocumentAlter, |
| | | pageManageDocumentList, |
| | | addManageDocumentAlter, |
| | | doManageDocumentAlter, |
| | | checkManageDocumentAlterPdf, |
| | | checkManageDocumentAlter, |
| | | delManageDocumentAlter, |
| | | pageManageDocumentAlter, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | components: { |
| | | limsTable, |
| | | filePreview, |
| | | UpPdfStamp, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä»¶åæ´ç³è¯·', |
| | | noCheckLoading: false, |
| | | checkLoading: false, |
| | | addDialogVisible: false, |
| | | addInfo: {}, |
| | | addPower: false, |
| | | outPower: false, |
| | | outLoading: false, |
| | | personList: [], |
| | | fileList: [], |
| | | currentFile: {}, |
| | | fileState: [], |
| | | file: null, |
| | | addLoading: false, |
| | | lookDialogVisible: false, |
| | | currentInfo: { |
| | | }, |
| | | type: null, |
| | | fileName: null, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "ç³è¯·ç¼å·", prop: "code" }, |
| | | { label: "ç³è¯·äºº", prop: "createUserName", width: "120px" }, |
| | | { |
| | | label: "åæ´è¯´æ", |
| | | prop: "alterNote", |
| | | }, |
| | | { label: "ææåæ´æ¶é´", prop: "expectAlterDate" }, |
| | | { label: "å®é
åæ´æ¶é´", prop: "actuallyAlterDate" }, |
| | | { |
| | | label: "ç¶æ", prop: "state", dataType: "tag", |
| | | formatData: (params) => { |
| | | return params; |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 'éè¿') { |
| | | return 'success' |
| | | } else { |
| | | return 'danger' |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleUpdate(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "å®¡æ ¸", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleCheck(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.checkUser != this.userId || row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "æ¥çéä»¶", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleLook(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½éä»¶", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDown(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | this.getAuthorizedPerson() |
| | | this.getFileList() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | 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 == 'addManageDocumentAlter') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'addManageDocumentAlter') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delManageDocumentAlter') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'exportManageDocumentAlter') { |
| | | out = true |
| | | } |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | this.outPower = out |
| | | }, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | pageManageDocumentAlter({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | // å¯¼åº |
| | | handleOut() { |
| | | this.outLoading = true |
| | | exportManageDocumentAlter(this.queryParams).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'æä»¶åæ´è®°å½.xlsx') |
| | | }) |
| | | }, |
| | | getAuthorizedPerson() { |
| | | selectUserCondition().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.personList = data |
| | | }) |
| | | }, |
| | | // è·åæä»¶å表--æä»¶æ¸
å |
| | | getFileList() { |
| | | pageManageDocumentList({ |
| | | current: -1, |
| | | size: -1 |
| | | }).then(res => { |
| | | this.fileList = res.data.records.map(m => { |
| | | m.title = m.documentCode + ':' + m.name |
| | | return m |
| | | }) |
| | | }).catch(err => { }) |
| | | }, |
| | | // å½åæä»¶ |
| | | getCurrentFile(e) { |
| | | this.currentFile = this.fileList.find(m => m.documentCode == e) |
| | | if (!this.currentFile) { |
| | | this.currentFile = {} |
| | | } |
| | | }, |
| | | selectEnumByCategory() { |
| | | // æä»¶ç¶æ |
| | | this.getDicts("document_state").then((response) => { |
| | | this.fileState = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | handleChangeUpload(file, fileLists) { |
| | | this.file = file |
| | | this.$set(this.addInfo, 'alterAfterName', file.name) |
| | | }, |
| | | handleAdd() { |
| | | if (!this.addInfo.code) return this.$message({ type: 'error', message: "请è¾å
¥ç³è¯·ç¼å·" }) |
| | | if (!this.addInfo.id) { |
| | | // æ°å¢ |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | for (let m in this.addInfo) { |
| | | fd.append(m, this.addInfo[m]) |
| | | } |
| | | let { name, version, documentCode } = this.currentFile; |
| | | fd.append("alterBeforeName", name); |
| | | fd.append("alterBeforeVersion", version); |
| | | // fd.append("alterBeforeCode",documentCode); |
| | | this.addLoading = true |
| | | addManageDocumentAlter(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æ·»å æå' |
| | | }) |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'æ·»å 失败' |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // ä¿®æ¹ |
| | | let fd = new FormData(); |
| | | //æä»¶ä¿¡æ¯ä¸rawææ¯ççæä»¶ |
| | | if (this.file) { |
| | | fd.append("file", this.file.raw); |
| | | } |
| | | let { name, version } = this.currentFile; |
| | | fd.append("alterBeforeName", name); |
| | | fd.append("alterBeforeVersion", version); |
| | | let { code, checkUser, expectAlterDate, actuallyAlterDate, alterAfterCode, method, alterAfterVersion, alterNote, alterAfterName, id } = this.addInfo |
| | | fd.append("code", code); |
| | | fd.append("checkUser", checkUser); |
| | | fd.append("expectAlterDate", expectAlterDate); |
| | | fd.append("actuallyAlterDate", actuallyAlterDate); |
| | | fd.append("alterAfterCode", alterAfterCode); |
| | | fd.append("method", method); |
| | | fd.append("alterAfterVersion", alterAfterVersion); |
| | | fd.append("alterNote", alterNote); |
| | | fd.append("alterAfterName", alterAfterName); |
| | | fd.append("id", id); |
| | | this.addLoading = true |
| | | doManageDocumentAlter(fd).then(res => { |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'ä¿®æ¹æå' |
| | | }) |
| | | this.refreshTable() |
| | | this.addDialogVisible = false |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: 'ä¿®æ¹å¤±è´¥' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // ç¼è¾ |
| | | handleUpdate(row) { |
| | | this.title = 'æä»¶åæ´ç³è¯·' |
| | | this.addInfo = this.HaveJson(row) |
| | | let alterBeforeCode = this.addInfo.alterBeforeCode |
| | | this.getCurrentFile(alterBeforeCode) |
| | | this.addDialogVisible = true |
| | | }, |
| | | // é¢è§ |
| | | handleLook(row) { |
| | | this.currentInfo = this.HaveJson(row) |
| | | this.lookDialogVisible = true |
| | | }, |
| | | // ä¸è½½éä»¶ |
| | | handleDown(row) { |
| | | if (!row.alterAfterUrl) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | let url = this.javaApi + '/word/' + row.alterAfterUrl |
| | | this.$download.saveAs(url, row.alterAfterUrl) |
| | | }, |
| | | // æå¼å®¡æ ¸å¼¹æ¡ |
| | | handleCheck(row) { |
| | | this.title = 'å®¡æ ¸' |
| | | this.fileName = row.alterAfterName |
| | | if (!row.alterAfterUrl) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | this.addInfo = this.HaveJson(row) |
| | | let alterBeforeCode = this.addInfo.alterBeforeCode |
| | | this.getCurrentFile(alterBeforeCode) |
| | | this.addDialogVisible = true |
| | | checkManageDocumentAlterPdf({ id: row.id }).then(res => { |
| | | // |
| | | const blob = new Blob([res]); |
| | | const file = new File([blob], row.name, { type: 'application/pdf' }) |
| | | this.$refs.UpPdfStamp.lookFile(file) |
| | | this.currentInfo = row |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | // å®¡æ ¸ä¿å |
| | | async uploadPDF(pdfBlob) { |
| | | const formData = new FormData(); |
| | | formData.append('file', pdfBlob, this.fileName + '.pdf'); // æä»¶å段 |
| | | formData.append('id', this.currentInfo.id); // æä»¶ååæ®µ |
| | | formData.append('state', this.type); // æä»¶ååæ®µ |
| | | |
| | | let res = await checkManageDocumentAlter(formData) |
| | | this.checkLoading = false |
| | | this.noCheckLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ message: 'æä½æå', type: 'success' }); |
| | | this.addDialogVisible = false; |
| | | this.refreshTable() |
| | | return true |
| | | } else { |
| | | this.$message({ message: 'æä½å¤±è´¥', type: 'error' }); |
| | | return false |
| | | } |
| | | }, |
| | | // æäº¤å®¡æ ¸ |
| | | handleCheckSub(type) { |
| | | this.type = type |
| | | if (type == 'éè¿') { |
| | | this.checkLoading = true |
| | | } else { |
| | | this.noCheckLoading = true |
| | | } |
| | | this.addLoading = true |
| | | this.$refs['UpPdfStamp'].generatePDF() |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentAlter({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .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 { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 5px; |
| | | } |
| | | |
| | | h4.title { |
| | | position: relative; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | box-sizing: border-box; |
| | | padding-left: 16px; |
| | | margin-left: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | h4.title::after { |
| | | content: ''; |
| | | width: 4px; |
| | | height: 20px; |
| | | background: #3A7BFA; |
| | | position: absolute; |
| | | top: 5px; |
| | | left: 0; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æä»¶æ¸
å --> |
| | | <div class="file-list" style="height: 100%;"> |
| | | <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.name" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç¶æï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="queryParams.state" size="small" @change="refreshTable()"> |
| | | <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState" |
| | | :key="index"></el-option> |
| | | </el-select> |
| | | </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 class="btns" style="padding-left: 30px;"> |
| | | <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="headers" :on-change="beforeUpload" |
| | | :on-error="onError" ref='upload' :on-success="handleSuccessUp" :show-file-list="false"> |
| | | <el-button size="small" type="primary" :loading="upLoading">导å
¥</el-button></el-upload> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog title="ä¸ä¼ " :visible.sync="addDialogVisible" width="1000px" top="3vh"> |
| | | <UpPdfStamp ref="UpPdfStamp" v-if="addDialogVisible" @uploadPDF="uploadPDF" :isUpFile="true" |
| | | @uploadPDFErr="uploadPDFErr"></UpPdfStamp> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleAdd" v-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.url" :currentFile="{}" |
| | | style="max-height: 90vh;overflow-y: auto;" /> |
| | | </el-dialog> |
| | | <!-- æ°å¢/ç¼è¾ --> |
| | | <el-dialog :title="title" :visible.sync="addDia" width="500px"> |
| | | <el-form :model="currentInfo" ref="currentInfoForm" :rules="rules" label-position="right" label-width="120px"> |
| | | <el-form-item label="æä»¶ç¼å·" prop="documentCode"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="currentInfo.documentCode"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å«" prop="type"> |
| | | <el-select v-model="currentInfo.type" size="small" clearable placeholder="è¯·éæ©" style="width: 100%"> |
| | | <el-option v-for="item in fileType" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="currentInfo.name"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶çæ¬" prop="version"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="currentInfo.version"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ä½è
" prop="writer"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="currentInfo.writer"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="çææ¥æ" prop="effectiveDate"> |
| | | <el-date-picker v-model="currentInfo.effectiveDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" |
| | | size="small" placeholder="éæ©æ¥æ"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶ç¶æ" prop="state"> |
| | | <el-select v-model="currentInfo.state" size="small" clearable placeholder="è¯·éæ©" style="width: 100%"> |
| | | <el-option v-for="item in fileState" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDia = false">å æ¶</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitProduct('currentInfoForm')">确 认</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import UpPdfStamp from '@/components/UpPdfStamp/index.vue' |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | uploadFileManageDocumentList, |
| | | pageManageDocumentList, |
| | | delManageDocumentList, |
| | | doManageDocumentList, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | components: { |
| | | UpPdfStamp, |
| | | filePreview, |
| | | limsTable, |
| | | }, |
| | | data() { |
| | | return { |
| | | addDialogVisible: false, |
| | | lookDialogVisible: false, |
| | | addPower: false, |
| | | upLoading: false, |
| | | addLoading: false, |
| | | currentInfo: {}, |
| | | fileType: [], |
| | | fileState: [], |
| | | title: 'æ°å¢', |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "æä»¶ç¼å·", prop: "documentCode" }, |
| | | { |
| | | label: "ç±»å«", prop: "type", width: "120px", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.fileType.find((m) => m.value == params).label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.fileType.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { |
| | | label: "åç§°", |
| | | prop: "name", |
| | | }, |
| | | { label: "æä»¶çæ¬", prop: "version" }, |
| | | { label: "ä½è
", prop: "writer" }, |
| | | { label: "çææ¥æ", prop: "effectiveDate" }, |
| | | { |
| | | label: "æä»¶ç¶æ", prop: "state", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.fileState.find((m) => m.value == params).label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.fileState.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.openAdd("ç¼è¾", row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸ä¼ ", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleUp(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDown(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æ¥çéä»¶", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleLook(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | addDia: false, |
| | | rules: { |
| | | documentCode: [{ required: true, message: "请è¾å
¥æä»¶ç¼å·", trigger: "blur" }], |
| | | }, |
| | | uploading: false, |
| | | } |
| | | }, |
| | | // ç¨äºä¸ä¼ æä»¶çä¿¡æ¯ |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'Authorization': "Bearer " + getToken() |
| | | } |
| | | }, |
| | | action() { |
| | | return this.javaApi + '/manageDocumentList/exportManageDocumentList' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | pageManageDocumentList({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | openAdd(title, row) { |
| | | this.title = title; |
| | | if (row) { |
| | | this.currentInfo = row; |
| | | } else { |
| | | this.currentInfo = {}; |
| | | } |
| | | this.addDia = true; |
| | | }, |
| | | // ä¸è½½æä»¶ |
| | | handleDown(row) { |
| | | if (!row.url) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | let url = this.javaApi + '/word/' + row.url |
| | | this.$download.saveAs(url, row.url); |
| | | }, |
| | | // æ¥çæä»¶ |
| | | handleLook(row) { |
| | | if (!row.url) return this.$message.warning('æä»¶æªä¸ä¼ ') |
| | | this.currentInfo = row |
| | | this.lookDialogVisible = true |
| | | }, |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | let upFile = false |
| | | let add = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'doManageDocumentList') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'exportManageDocumentList') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'uploadFileManageDocumentList') { |
| | | upFile = true |
| | | } |
| | | } |
| | | if (!upFile) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | // ä¸ä¼ æä»¶ |
| | | handleUp(row) { |
| | | this.currentInfo = row |
| | | this.addDialogVisible = true; |
| | | }, |
| | | // æäº¤ä¸ä¼ |
| | | handleAdd() { |
| | | this.addLoading = true |
| | | this.$refs['UpPdfStamp'].generatePDF() |
| | | }, |
| | | uploadPDFErr() { |
| | | this.addLoading = false |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | selectEnumByCategory() { |
| | | // æä»¶ç±»å« |
| | | this.getDicts("document_type").then((response) => { |
| | | this.fileType = this.dictToValue(response.data); |
| | | }); |
| | | // æä»¶ç¶æ |
| | | this.getDicts("document_state").then((response) => { |
| | | this.fileState = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | async uploadPDF(pdfBlob, fileName) { |
| | | const formData = new FormData(); |
| | | formData.append('file', pdfBlob, fileName); // æä»¶å段 |
| | | formData.append('id', this.currentInfo.id); // æä»¶ååæ®µ |
| | | |
| | | let res = await uploadFileManageDocumentList(formData) |
| | | this.addLoading = false |
| | | if (res.code == 200) { |
| | | this.$message({ message: 'ä¸ä¼ æå', type: 'success' }); |
| | | this.addDialogVisible = false; |
| | | this.refreshTable() |
| | | return true |
| | | } else { |
| | | this.$message({ message: 'ä¸ä¼ 失败', type: 'error' }); |
| | | return false |
| | | } |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentList({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | submitProduct(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.uploading = true; |
| | | doManageDocumentList(this.currentInfo) |
| | | .then((res) => { |
| | | this.uploading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.$message.success("æäº¤æå"); |
| | | this.refresh(); |
| | | this.addDia = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.uploading = false; |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .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 { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 5px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æä»¶ä½åºç³è¯· --> |
| | | <div class="file-obsoletion-request" style="height: 100%;"> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç¼å·ï¼</div> |
| | | <div class="search_input"><el-input v-model="queryParams.documentCode" clearable placeholder="请è¾å
¥" size="small" |
| | | @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 class="btns" style="padding-left: 30px;"> |
| | | <el-button size="small" type="primary" @click="addDialogVisible = true, addInfo = {}">æä»¶ä½åºç³è¯·</el-button> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleOut">导åº</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <!-- <ValueTable :key="upIndex" ref="ValueTable" :componentData="componentData" |
| | | :delUrl="$api.manageDocumentList.delManageDocumentCancel" |
| | | :url="$api.manageDocumentList.pageManageDocumentCancel" /> --> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <el-dialog :visible.sync="addDialogVisible" title="æä»¶ä½åºç³è¯·" top="10vh" width="800px"> |
| | | <el-row> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>ç³è¯·ç¼å·ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.documentCode" allow-create clearable filterable size="small" |
| | | style="width: 100%;" @change="changeFileList"> |
| | | <el-option v-for="item in fileList" :key="item.documentCode" :label="item.documentCode" |
| | | :value="item.documentCode"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">审æ¹äººï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.checkUser" filterable 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="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶åç§°ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.name" clearable placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶çæ¬ï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.version" clearable placeholder="请è¾å
¥" |
| | | size="small"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æä»¶ç¶æï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.state" size="small" style="width: 100%;"> |
| | | <el-option v-for="(item, index) in fileState" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <!-- <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ä½åºæ¹å¼ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="addInfo.method" size="small" style="width: 100%;"> |
| | | <el-option label="ä½åº" value="ä½åº"></el-option> |
| | | <el-option label="æ æ" value="æ æ"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </el-col> --> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ææä½åºæ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.expectCancelDate" format="yyyy-MM-dd" placeholder="éæ©æ¥æ" size="small" |
| | | style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">å®é
ä½åºæ¶é´ï¼</div> |
| | | <div class="search_input"> |
| | | <el-date-picker v-model="addInfo.actuallyCancelDate" format="yyyy-MM-dd" placeholder="éæ©æ¥æ" size="small" |
| | | style="width: 100%;" type="date" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 16px;"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">ä½åºè¯´æï¼</div> |
| | | <div class="search_input"><el-input v-model="addInfo.cancelNote" :rows="2" clearable placeholder="请è¾å
¥" |
| | | size="small" type="textarea"></el-input></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogVisible = false">å æ¶</el-button> |
| | | <el-button :loading="addLoading" type="primary" @click="handleAdd">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | selectUserCondition, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import { |
| | | addManageDocumentCancel, |
| | | pageManageDocumentList, |
| | | doManageDocumentCancel, |
| | | checkManageDocumentCancel, |
| | | exportManageDocumentCancel, |
| | | delManageDocumentCancel, |
| | | pageManageDocumentCancel, |
| | | } from '@/api/cnas/systemManagement/documentControl.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | components: { |
| | | limsTable |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | addPower: false, |
| | | outPower: false, |
| | | addInfo: {}, |
| | | addLoading: false, |
| | | addDialogVisible: false, |
| | | personList: [], |
| | | fileList: [], |
| | | outLoading: false, |
| | | fileState: [], |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "æä»¶ç¼å·", prop: "documentCode" }, |
| | | { label: "ç³è¯·äºº", prop: "createUserName", width: "120px" }, |
| | | { |
| | | label: "ä½åºè¯´æ", |
| | | prop: "cancelNote", |
| | | }, |
| | | { label: "ææä½åºæ¶é´", prop: "expectCancelDate" }, |
| | | { label: "å®é
ä½åºæ¥æ", prop: "actuallyCancelDate" }, |
| | | { |
| | | label: "ä½åºç¶æ", prop: "state", dataType: "tag", |
| | | formatData: (params) => { |
| | | return params; |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 'éè¿') { |
| | | return 'success' |
| | | } else { |
| | | return 'danger' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleUpdate(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.state == 'éè¿' |
| | | } |
| | | }, |
| | | { |
| | | name: "å®¡æ ¸", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleCheck(row); |
| | | }, |
| | | disabled: (row, index) => { |
| | | return row.checkUser != this.userId || row.state == 'éè¿' |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | this.getAuthorizedPerson() |
| | | this.getFileList() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let out = false |
| | | let del = false |
| | | let add = false |
| | | // let check = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'exportManageDocumentCancel') { |
| | | out = true |
| | | } |
| | | if (power[i].menuMethod == 'addManageDocumentCancel') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delManageDocumentCancel') { |
| | | del = true |
| | | } |
| | | // if (power[i].menuMethod == 'checkManageDocumentControlled') { |
| | | // check = true |
| | | // } |
| | | } |
| | | // if (!check) { |
| | | // this.componentData.do.splice(2, 1) |
| | | // } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!add) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | this.outPower = out |
| | | }, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | pageManageDocumentCancel({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | }, |
| | | selectEnumByCategory() { |
| | | // æä»¶ç¶æ |
| | | this.getDicts("document_state").then((response) => { |
| | | this.fileState = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | // è·å人åå表 |
| | | getAuthorizedPerson() { |
| | | selectUserCondition().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.name, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.personList = data |
| | | }) |
| | | }, |
| | | // è·åæä»¶å表 |
| | | getFileList() { |
| | | pageManageDocumentList({ |
| | | current: -1, |
| | | size: -1 |
| | | }).then(res => { |
| | | this.fileList = res.data.records |
| | | }).catch(err => { }) |
| | | }, |
| | | // æäº¤ |
| | | handleAdd() { |
| | | if (!this.addInfo.documentCode) { |
| | | this.$message.error('请è¾å
¥ç³è¯·ç¼å·') |
| | | return false |
| | | } |
| | | this.addInfo.method = 'ä½åº' |
| | | this.addLoading = true |
| | | if (!this.addInfo.id) { |
| | | // æ°å¢ |
| | | addManageDocumentCancel(this.addInfo).then(res => { |
| | | this.addLoading = false |
| | | this.refreshTable() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | this.addDialogVisible = false |
| | | }).catch(err => { }) |
| | | } else { |
| | | // ç¼è¾ |
| | | doManageDocumentCancel({ |
| | | id: this.addInfo.id, |
| | | method: 'ä½åº', |
| | | documentCode: this.addInfo.documentCode, |
| | | checkUser: this.addInfo.checkUser, |
| | | name: this.addInfo.name, |
| | | version: this.addInfo.version, |
| | | documentState: this.addInfo.documentState, |
| | | expectCancelDate: this.addInfo.expectCancelDate, |
| | | actuallyCancelDate: this.addInfo.actuallyCancelDate, |
| | | cancelNote: this.addInfo.cancelNote, |
| | | }).then(res => { |
| | | this.addLoading = false |
| | | this.refreshTable() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | this.addDialogVisible = false |
| | | }).catch(err => { }) |
| | | } |
| | | |
| | | }, |
| | | // é䏿件 |
| | | changeFileList(e) { |
| | | if (e) { |
| | | let obj = this.fileList.find(a => a.documentCode == e) |
| | | if (obj) { |
| | | this.addInfo.name = obj.name |
| | | this.addInfo.version = obj.version |
| | | this.addInfo.documentState = obj.state |
| | | } |
| | | } |
| | | }, |
| | | handleUpdate(row) { |
| | | this.addInfo = this.HaveJson(row) |
| | | this.addDialogVisible = true |
| | | }, |
| | | // å®¡æ ¸ |
| | | handleCheck(row) { |
| | | this.$confirm('æ¯å¦å®¡æ ¸éè¿?', 'æç¤º', { |
| | | confirmButtonText: 'éè¿', |
| | | cancelButtonText: 'ä¸éè¿', |
| | | type: 'warning', |
| | | closeOnClickModal: false, // ç¦æ¢ç¹å»é®ç½©å±å
³é |
| | | distinguishCancelAndClose: true, |
| | | beforeClose: (action, instance, done) => { |
| | | if (action === 'confirm') { |
| | | // ç¹å»âç¡®å®âæé®ï¼å
许å
³é |
| | | checkManageDocumentCancel({ id: row.id, state: 'éè¿' }).then(res => { |
| | | this.refreshTable() |
| | | done(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | }) |
| | | .catch(err => { |
| | | |
| | | }) |
| | | } else if (action === 'cancel') { |
| | | // ç¹å»âåæ¶âæé®ï¼ä¸å
许å
³é |
| | | checkManageDocumentCancel({ id: row.id, state: 'ä¸éè¿' }).then(res => { |
| | | this.refreshTable() |
| | | done(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æäº¤æå' |
| | | }) |
| | | }) |
| | | .catch(err => { |
| | | |
| | | }) |
| | | } else if (action === 'close') { |
| | | // ç¹å»âÃâæé®ï¼ä¸å
许å
³é |
| | | done(); |
| | | console.log("Ãæé®ç¹å»äºä»¶ï¼ä¸å
³éå¼¹æ¡"); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // å¯¼åº |
| | | handleOut() { |
| | | this.outLoading = true |
| | | exportManageDocumentCancel(this.queryParams).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, 'æä»¶ä½åºè¡¨.xlsx') |
| | | this.$message.success('å¯¼åºæå') |
| | | }) |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delManageDocumentCancel({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | } |
| | | |
| | | .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 { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .btns { |
| | | position: absolute; |
| | | right: 20px; |
| | | top: 5px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="file-handling"> |
| | | <el-tabs type="border-card" v-model="activeName" style="height: 100%;"> |
| | | <el-tab-pane :label="item.name" :name="item.component" v-for="(item, index) in tabList" :key="index" |
| | | style="height: 100%;"> |
| | | <component :is="item.component" :key="item.component"></component> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import FileList from './components/FileList.vue' |
| | | import ControlledFileApplication from './components/ControlledFileApplication.vue' |
| | | import DistributionCollectionRecord from './components/DistributionCollectionRecord.vue' |
| | | import FileChangeRequest from './components/FileChangeRequest.vue' |
| | | import FileObsoletionRequest from './components/FileObsoletionRequest.vue' |
| | | export default { |
| | | components: { |
| | | FileList, |
| | | ControlledFileApplication, |
| | | DistributionCollectionRecord, |
| | | FileChangeRequest, |
| | | FileObsoletionRequest |
| | | }, |
| | | data() { |
| | | return { |
| | | tabList: [ |
| | | { |
| | | name: 'æä»¶æ¸
å', |
| | | component: 'FileList' |
| | | }, |
| | | { |
| | | name: 'æä»¶åæ§ç³è¯·', |
| | | component: 'ControlledFileApplication' |
| | | }, |
| | | { |
| | | name: 'åæ¾åæ¶è®°å½', |
| | | component: 'DistributionCollectionRecord' |
| | | }, |
| | | { |
| | | name: 'æä»¶åæ´ç³è¯·', |
| | | component: 'FileChangeRequest' |
| | | }, |
| | | { |
| | | name: 'æä»¶ä½åºç³è¯·', |
| | | component: 'FileObsoletionRequest' |
| | | }, |
| | | ], |
| | | activeName: 'FileList' |
| | | }; |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .file-handling { |
| | | margin-top: 10px; |
| | | height: calc(100% - 20px); |
| | | } |
| | | |
| | | >>>.el-tabs__content { |
| | | height: 100%; |
| | | padding: 0; |
| | | padding-top: 10px; |
| | | } |
| | | </style> |
| | |
| | | import DataWorker from '../../../DataWorker.worker'; |
| | | import html2canvas from "html2canvas"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | name: 'inspection', |
| | | components: { |
| | |
| | | ...mapGetters(["userId"]), |
| | | headers() { |
| | | return { |
| | | token: sessionStorage.getItem("token"), |
| | | 'Authorization': "Bearer " + getToken() |
| | | }; |
| | | }, |
| | | action() { |
| | |
| | | <el-dialog title="éä»¶æ¥ç" :visible.sync="isShow" width="80%" @closed="$emit('closeFilesLook')"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <ul class="tab"> |
| | | <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li> |
| | | <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }" |
| | | @click="handleDataVisibleTab(m, i)">{{ m.label }}</li> |
| | | </ul> |
| | | <el-upload :action="action" |
| | | :auto-upload="true" |
| | | :data="{orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId}" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" |
| | | :before-upload="beforeUpload" |
| | | style="width: 80px !important;" |
| | | :on-error="onError" ref='upload'> |
| | | <el-upload :action="action" :auto-upload="true" |
| | | :data="{ orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId }" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" |
| | | :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref='upload'> |
| | | <el-button size="small" type="primary" style="height: 38px">éä»¶ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </div> |
| | | <div v-if="filesDialogVisible"> |
| | | <lims-table :tableData="tableDataFile" :column="columnFile" |
| | | @pagination="paginationFile" height="500px" key="tableDataFile" |
| | | :page="pageFile" :tableLoading="tableLoadingFile"></lims-table> |
| | | <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px" |
| | | key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | import ValueTable from "@/components/Table/value-table.vue"; |
| | | import file from "@/utils/file"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder"; |
| | | |
| | | import { delfile, downFile, getFileList } from "@/api/business/rawMaterialOrder"; |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | name: "filesLookVisible", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {limsTable, ValueTable}, |
| | | components: { limsTable, ValueTable }, |
| | | props: { |
| | | filesDialogVisible: { |
| | | type: Boolean, |
| | |
| | | }, |
| | | filesLookInfo: { |
| | | type: Object, |
| | | default: () => {} |
| | | default: () => { } |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | } |
| | | } |
| | | }, |
| | | {label: 'éä»¶åç§°', prop: 'fileName'}, |
| | | {label: 'ä¸ä¼ 人', prop: 'name'}, |
| | | {label: 'ä¸ä¼ æ¶é´', prop: 'createTime'}, |
| | | { label: 'éä»¶åç§°', prop: 'fileName' }, |
| | | { label: 'ä¸ä¼ 人', prop: 'name' }, |
| | | { label: 'ä¸ä¼ æ¶é´', prop: 'createTime' }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | |
| | | } |
| | | ], |
| | | pageFile: { |
| | | total:0, |
| | | size:10, |
| | | current:1 |
| | | total: 0, |
| | | size: 10, |
| | | current: 1 |
| | | }, |
| | | isShow: this.filesDialogVisible, |
| | | dataVisibleTitle: [ |
| | |
| | | ], |
| | | dataVisibleIndex: 0, // tabæ éæ©å¼ |
| | | entity: { |
| | | insOrderId:'' |
| | | insOrderId: '' |
| | | }, |
| | | } |
| | | }, |
| | |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // åæ¢æ°æ®æ¥çtabæ |
| | | handleDataVisibleTab (m, i) { |
| | | handleDataVisibleTab(m, i) { |
| | | this.dataVisibleIndex = i |
| | | this.getFileList() |
| | | }, |
| | |
| | | this.entity.insOrderId = this.filesLookInfo.quarterOrderId |
| | | } |
| | | this.tableLoadingFile = true |
| | | const params = {...this.entity} |
| | | const params = { ...this.entity } |
| | | getFileList(params).then(res => { |
| | | this.tableLoadingFile = false |
| | | if (res.code === 200) { |
| | |
| | | this.tableLoadingFile = false |
| | | }) |
| | | }, |
| | | paginationFile (page) { |
| | | paginationFile(page) { |
| | | this.pageFile.size = page.limit |
| | | this.getFileList() |
| | | }, |
| | | // ä¸è½½ |
| | | handleDown(row){ |
| | | downFile({id: row.id,}).then(res => { |
| | | handleDown(row) { |
| | | downFile({ id: row.id, }).then(res => { |
| | | if (res.code === 200) { |
| | | let url = ''; |
| | | if(res.data.type==1){ |
| | | url = this.javaApi+'/img/'+res.data.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+res.data.fileUrl |
| | | if (res.data.type == 1) { |
| | | url = this.javaApi + '/img/' + res.data.fileUrl |
| | | file.downloadIamge(url, row.fileName) |
| | | } else { |
| | | url = this.javaApi + '/word/' + res.data.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | |
| | | |
| | | }) |
| | | }, |
| | | handleSuccessUp(response, ) { |
| | | handleSuccessUp(response,) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | // å é¤ |
| | | delete (row) { |
| | | delete(row) { |
| | | this.$confirm('æ¯å¦å é¤å½åæ°æ®?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | delfile({id: row.id}).then(res => { |
| | | delfile({ id: row.id }).then(res => { |
| | | if (res.code === 500) { |
| | | return |
| | | } |
| | |
| | | }).catch(e => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | }).catch(() => { }) |
| | | } |
| | | }, |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'token': sessionStorage.getItem('token') |
| | | 'Authorization': "Bearer " + getToken() |
| | | } |
| | | }, |
| | | action() { |
| | |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="å®éªå®¤åç§°" prop="laboratoryName"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.laboratoryName" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®éªå®¤ç¼ç " prop="laboratoryNumber"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="queryParams.laboratoryNumber" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">æ¥ è¯¢</el-button> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" |
| | | :height="'calc(100vh - 250px)'" |
| | | @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | <lims-table :tableData="tableData" :column="column" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <!-- æ°å¢å®éªå®¤--> |
| | | <!-- æ°å¢å®éªå®¤--> |
| | | <el-dialog :title="formTitle" :visible.sync="addDia" width="450px"> |
| | | <el-form ref="laboratoryForm" :model="laboratoryForm" :rules="userRules" |
| | | label-position="right" label-width="100px"> |
| | | <el-form ref="laboratoryForm" :model="laboratoryForm" :rules="userRules" label-position="right" |
| | | label-width="100px"> |
| | | <el-form-item label="å®éªå®¤åç§°" prop="laboratoryName"> |
| | | <el-input v-model="laboratoryForm.laboratoryName" size="small" clearable></el-input> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="reset">å æ¶</el-button> |
| | | <el-button type="primary" @click="customAdd" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | <el-button @click="reset">å æ¶</el-button> |
| | | <el-button type="primary" @click="customAdd" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="å°ç« 管ç" :visible.sync="fileVisible" width="60vw"> |
| | | <div class="btns"> |
| | | <el-button size="medium" type="primary" @click="openUpload">æ´æ°å°ç« </el-button> |
| | | </div> |
| | | <lims-table :tableData="fileComponentData" :column="fileComponentDataColumn" |
| | | @pagination="fileComponentPagination" height="500px" |
| | | :page="fileComponentPage" :tableLoading="fileComponentTableLoading"></lims-table> |
| | | <lims-table :tableData="fileComponentData" :column="fileComponentDataColumn" @pagination="fileComponentPagination" |
| | | height="500px" :page="fileComponentPage" :tableLoading="fileComponentTableLoading"></lims-table> |
| | | </el-dialog> |
| | | <el-dialog title="æ´æ°å°ç« " :visible.sync="upFileVisible" width="400px"> |
| | | <el-form ref="dataForm" :model="dataForm" :rules="dataFormRules" |
| | | label-position="right" label-width="80px"> |
| | | <el-form ref="dataForm" :model="dataForm" :rules="dataFormRules" label-position="right" label-width="80px"> |
| | | <el-form-item label="å°ç« ç±»å" prop="type"> |
| | | <el-cascader |
| | | v-model="dataForm.type" |
| | | :options="options" |
| | | :show-all-levels="false" |
| | | :props="props" |
| | | placeholder="è¯·éæ©" size="small" |
| | | style="width:100%" |
| | | collapse-tags |
| | | clearable></el-cascader> |
| | | <el-cascader v-model="dataForm.type" :options="options" :show-all-levels="false" :props="props" |
| | | placeholder="è¯·éæ©" size="small" style="width:100%" collapse-tags clearable></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="å°ç« å¾ç" prop="address"> |
| | | <el-upload |
| | | class="avatar-uploader" |
| | | :action="action" |
| | | :headers="headers" |
| | | accept='image/jpg,image/jpeg,image/png' |
| | | :show-file-list="false" |
| | | :on-success="handleSuccess" |
| | | :on-change="beforeUpload" |
| | | ref="upload" |
| | | <el-upload class="avatar-uploader" :action="action" :headers="headers" accept='image/jpg,image/jpeg,image/png' |
| | | :show-file-list="false" :on-success="handleSuccess" :on-change="beforeUpload" ref="upload" |
| | | :on-error="onError"> |
| | | <img v-if="dataForm.address" :src="javaApi+'/img/'+dataForm.address" class="avatar" > |
| | | <img v-if="dataForm.address" :src="javaApi + '/img/' + dataForm.address" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="upFileVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="confirmConnect" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | <el-button @click="upFileVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="confirmConnect" :loading="loading">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | selectSeal, |
| | | upParameter |
| | | } from "@/api/structural/laboratoryScope"; |
| | | import {getCertificationDetail} from "@/api/structural/laboratory"; |
| | | |
| | | import { getCertificationDetail } from "@/api/structural/laboratory"; |
| | | import { getToken } from "@/utils/auth"; |
| | | export default { |
| | | components: { |
| | | limsTable |
| | |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'token': sessionStorage.getItem('token') |
| | | 'Authorization': "Bearer " + getToken() |
| | | } |
| | | }, |
| | | action() { |
| | |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | | {label: 'å®éªå®¤åç§°', prop: 'laboratoryName'}, |
| | | {label: 'åºæç¼ç ', prop: 'laboratoryNumber'}, |
| | | {label: 'å®éªå®¤ä»£å·', prop: 'laboratoryCode'}, |
| | | {label: 'è´è´£äºº', prop: 'head'}, |
| | | {label: 'è´è´£äººçµè¯', prop: 'phoneNumber'}, |
| | | {label: 'å°å', prop: 'address'}, |
| | | {label: 'å建人', prop: 'createUserName'}, |
| | | {label: 'å建æ¶é´', prop: 'createTime'}, |
| | | { label: 'å®éªå®¤åç§°', prop: 'laboratoryName' }, |
| | | { label: 'åºæç¼ç ', prop: 'laboratoryNumber' }, |
| | | { label: 'å®éªå®¤ä»£å·', prop: 'laboratoryCode' }, |
| | | { label: 'è´è´£äºº', prop: 'head' }, |
| | | { label: 'è´è´£äººçµè¯', prop: 'phoneNumber' }, |
| | | { label: 'å°å', prop: 'address' }, |
| | | { label: 'å建人', prop: 'createUserName' }, |
| | | { label: 'å建æ¶é´', prop: 'createTime' }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | |
| | | } |
| | | ], |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:1 |
| | | total: 0, |
| | | size: 10, |
| | | current: 1 |
| | | }, |
| | | addDia: false, |
| | | formTitle: '', |
| | |
| | | fileComponentTableLoading: false, |
| | | fileComponentData: [], |
| | | fileComponentDataColumn: [ |
| | | {label: 'å®éªå®¤åç§°', prop: 'laboratoryName'}, |
| | | {label: 'å°ç« å¾ç', prop: 'address', dataType: 'image'}, |
| | | {label: 'å°ç« ç±»å', prop: 'type'}, |
| | | { label: 'å®éªå®¤åç§°', prop: 'laboratoryName' }, |
| | | { label: 'å°ç« å¾ç', prop: 'address', dataType: 'image' }, |
| | | { label: 'å°ç« ç±»å', prop: 'type' }, |
| | | ], |
| | | fileComponentPage: { |
| | | total:0, |
| | | size:10, |
| | | current:1, |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | layout: 'total, prev, pager, next' |
| | | }, |
| | | fileVisible:false, |
| | | upFileVisible:false, |
| | | loading:false, |
| | | dataForm:{ |
| | | type:'', |
| | | address:'', |
| | | fileVisible: false, |
| | | upFileVisible: false, |
| | | loading: false, |
| | | dataForm: { |
| | | type: '', |
| | | address: '', |
| | | }, |
| | | dataFormRules: { |
| | | type: [{ required: true, message: 'è¯·éæ©å°ç« ç±»å', trigger: 'change' }], |
| | | address: [{ required: false, message: '请ä¸ä¼ å¾ç', trigger: 'change' }], |
| | | }, |
| | | props: { multiple: false,emitPath:false,}, |
| | | options:[ |
| | | props: { multiple: false, emitPath: false, }, |
| | | options: [ |
| | | { |
| | | value:'å®éªå®¤èµè´¨', |
| | | label:'å®éªå®¤èµè´¨', |
| | | children:[] |
| | | value: 'å®éªå®¤èµè´¨', |
| | | label: 'å®éªå®¤èµè´¨', |
| | | children: [] |
| | | }, |
| | | { |
| | | value:'å§ææ¥å', |
| | | label:'å§ææ¥å', |
| | | children:null |
| | | value: 'å§ææ¥å', |
| | | label: 'å§ææ¥å', |
| | | children: null |
| | | }, |
| | | { |
| | | value:'è¿åæ¥å', |
| | | label:'è¿åæ¥å', |
| | | children:null |
| | | value: 'è¿åæ¥å', |
| | | label: 'è¿åæ¥å', |
| | | children: null |
| | | }, |
| | | ], |
| | | } |
| | |
| | | methods: { |
| | | refreshTable() { |
| | | this.tableLoading = true |
| | | selectItemParameter({...this.page, ...this.queryParams}).then(res => { |
| | | selectItemParameter({ ...this.page, ...this.queryParams }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | |
| | | this.refreshTable() |
| | | }, |
| | | // å页忢 |
| | | pagination (page) { |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.refreshTable() |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | reset () { |
| | | reset() { |
| | | this.resetForm('laboratoryForm') |
| | | this.addDia = false |
| | | }, |
| | | // å é¤å®éªå®¤ |
| | | delete (row) { |
| | | delete(row) { |
| | | this.$confirm('æ¯å¦å é¤å½åæ°æ®?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | delParameter({id: row.id}).then(res => { |
| | | delParameter({ id: row.id }).then(res => { |
| | | this.$message.success('å 餿å') |
| | | this.refreshTable() |
| | | }).catch(e => { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | }).catch(() => { }) |
| | | }, |
| | | // æå¼å°ç« 管çå¼¹æ¡ |
| | | fileManagement(row){ |
| | | fileManagement(row) { |
| | | this.fileVisible = true; |
| | | this.fileComponentTableLoading = true |
| | | this.currentRow = row |
| | | this.getFileComponentList() |
| | | }, |
| | | getFileComponentList () { |
| | | selectSeal({id: this.currentRow.id, ...this.fileComponentPage}).then(res => { |
| | | getFileComponentList() { |
| | | selectSeal({ id: this.currentRow.id, ...this.fileComponentPage }).then(res => { |
| | | this.fileComponentTableLoading = false |
| | | if (res.code === 200) { |
| | | this.fileComponentData = res.data.records |
| | |
| | | this.fileComponentTableLoading = false |
| | | }) |
| | | }, |
| | | fileComponentPagination (page) { |
| | | fileComponentPagination(page) { |
| | | this.fileComponentPage.size = page.limit |
| | | this.getFileComponentList() |
| | | }, |
| | | // æå¼æ´æ°å°ç« å¼¹æ¡ |
| | | openUpload(){ |
| | | openUpload() { |
| | | this.dataForm.type = ''; |
| | | this.dataForm.address = ''; |
| | | this.upFileVisible = true; |
| | | this.getCertificationOperation() |
| | | }, |
| | | // æ¥è¯¢å°ç« ç±»å |
| | | getCertificationOperation(){ |
| | | getCertificationOperation() { |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | |
| | | }) |
| | | }, |
| | | // æäº¤æ´æ°å°ç« |
| | | confirmConnect(){ |
| | | confirmConnect() { |
| | | this.$refs['dataForm'].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | addSeal({labId:this.currentRow.id, ...this.dataForm}).then(res => { |
| | | addSeal({ labId: this.currentRow.id, ...this.dataForm }).then(res => { |
| | | this.loading = false; |
| | | this.getFileComponentList() |
| | | this.upFileVisible = false; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | handleSuccess(response,){ |
| | | handleSuccess(response,) { |
| | | if (response.code === 200) { |
| | | this.dataForm.address = response.data.url |
| | | } |
| | | }, |
| | | beforeUpload(file,type) { |
| | | beforeUpload(file, type) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList,type) { |
| | | onError(err, file, fileList, type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .btns{ |
| | | |
| | | .btns { |
| | | text-align: right; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | padding-top: 8px !important; |
| | | } |
| | | |
| | | .avatar-uploader ::v-deep .el-upload { |
| | | border: 1px dashed #666666; |
| | | border-radius: 6px; |
| | |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader ::v-deep .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 20px; |
| | | color: #8c939d; |
| | |
| | | line-height: 90px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 90px; |
| | | height: 90px; |
| | |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="èååç§°" prop="menuName"> |
| | | <el-input |
| | | v-model="queryParams.menuName" |
| | | placeholder="请è¾å
¥èååç§°" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.menuName" placeholder="请è¾å
¥èååç§°" clearable @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="èåç¶æ" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" |
| | | :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:menu:add']" |
| | | >æ°å¢</el-button> |
| | | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| | | v-hasPermi="['system:menu:add']">æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="el-icon-sort" |
| | | size="mini" |
| | | @click="toggleExpandAll" |
| | | >å±å¼/æå </el-button> |
| | | <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">å±å¼/æå </el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="menuList" |
| | | row-key="menuId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | > |
| | | <el-table v-if="refreshTable" v-loading="loading" :data="menuList" row-key="menuId" |
| | | :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column prop="menuName" label="èååç§°" :show-overflow-tooltip="true" width="160"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 " align="center" width="100"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-table-column prop="component" label="ç»ä»¶è·¯å¾" :show-overflow-tooltip="true"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" width="80"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:menu:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['system:menu:add']" |
| | | >æ°å¢</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:menu:remove']" |
| | | >å é¤</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:menu:edit']">ä¿®æ¹</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" |
| | | v-hasPermi="['system:menu:add']">æ°å¢</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:menu:remove']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¸çº§èå" prop="parentId"> |
| | | <treeselect |
| | | v-model="form.parentId" |
| | | :options="menuOptions" |
| | | :normalizer="normalizer" |
| | | :show-count="true" |
| | | placeholder="éæ©ä¸çº§èå" |
| | | /> |
| | | <treeselect v-model="form.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" |
| | | placeholder="éæ©ä¸çº§èå" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row> |
| | | <el-col :span="24" v-if="form.menuType != 'F'"> |
| | | <el-form-item label="èå徿 " prop="icon"> |
| | | <el-popover |
| | | placement="bottom-start" |
| | | width="460" |
| | | trigger="click" |
| | | @show="$refs['iconSelect'].reset()" |
| | | > |
| | | <el-popover placement="bottom-start" width="460" trigger="click" @show="$refs['iconSelect'].reset()"> |
| | | <IconSelect ref="iconSelect" @selected="selected" :active-icon="form.icon" /> |
| | | <el-input slot="reference" v-model="form.icon" placeholder="ç¹å»éæ©å¾æ " readonly> |
| | | <svg-icon |
| | | v-if="form.icon" |
| | | slot="prefix" |
| | | :icon-class="form.icon" |
| | | style="width: 25px;" |
| | | /> |
| | | <svg-icon v-if="form.icon" slot="prefix" :icon-class="form.icon" style="width: 25px;" /> |
| | | <i v-else slot="prefix" class="el-icon-search el-input__icon" /> |
| | | </el-input> |
| | | </el-popover> |
| | |
| | | <el-form-item prop="isFrame"> |
| | | <span slot="label"> |
| | | <el-tooltip content="éæ©æ¯å¤é¾åè·¯ç±å°åéè¦ä»¥`http(s)://`å¼å¤´" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | æ¯å¦å¤é¾ |
| | | </span> |
| | |
| | | <el-form-item prop="path"> |
| | | <span slot="label"> |
| | | <el-tooltip content="访é®çè·¯ç±å°åï¼å¦ï¼`user`ï¼å¦å¤ç½å°åéå
é¾è®¿é®å以`http(s)://`å¼å¤´" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | è·¯ç±å°å |
| | | </span> |
| | |
| | | <el-form-item prop="component"> |
| | | <span slot="label"> |
| | | <el-tooltip content="访é®çç»ä»¶è·¯å¾ï¼å¦ï¼`system/user/index`ï¼é»è®¤å¨`views`ç®å½ä¸" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | ç»ä»¶è·¯å¾ |
| | | </span> |
| | |
| | | <el-input v-model="form.perms" placeholder="请è¾å
¥æéæ è¯" maxlength="100" /> |
| | | <span slot="label"> |
| | | <el-tooltip content="æ§å¶å¨ä¸å®ä¹çæéå符ï¼å¦ï¼@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | æéå符 |
| | | </span> |
| | |
| | | <el-input v-model="form.query" placeholder="请è¾å
¥è·¯ç±åæ°" maxlength="255" /> |
| | | <span slot="label"> |
| | | <el-tooltip content='访é®è·¯ç±çé»è®¤ä¼ éåæ°ï¼å¦ï¼`{"id": 1, "name": "ry"}`' placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | è·¯ç±åæ° |
| | | </span> |
| | |
| | | <el-form-item prop="isCache"> |
| | | <span slot="label"> |
| | | <el-tooltip content="éæ©æ¯åä¼è¢«`keep-alive`ç¼åï¼éè¦å¹é
ç»ä»¶ç`name`åå°åä¿æä¸è´" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | æ¯å¦ç¼å |
| | | </span> |
| | |
| | | <el-form-item prop="visible"> |
| | | <span slot="label"> |
| | | <el-tooltip content="éæ©éèåè·¯ç±å°ä¸ä¼åºç°å¨ä¾§è¾¹æ ï¼ä½ä»ç¶å¯ä»¥è®¿é®" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | æ¾ç¤ºç¶æ |
| | | </span> |
| | | <el-radio-group v-model="form.visible"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_show_hide" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | <el-radio v-for="dict in dict.type.sys_show_hide" :key="dict.value" :label="dict.value">{{ dict.label |
| | | }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-form-item prop="status"> |
| | | <span slot="label"> |
| | | <el-tooltip content="éæ©åç¨åè·¯ç±å°ä¸ä¼åºç°å¨ä¾§è¾¹æ ï¼ä¹ä¸è½è¢«è®¿é®" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | èåç¶æ |
| | | </span> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ |
| | | dict.label |
| | | }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" v-if="form.menuType != 'M'"> |
| | | <el-form-item prop="status"> |
| | | <span slot="label"> |
| | | <el-tooltip content="éæ©åªçææé®ï¼å¨è§è²ç®¡çå¤å¯é
ç½®åªçæçæ°æ®æé" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | åªçææé® |
| | | </span> |
| | | <el-switch v-model="form.isRersonalButton" inactive-text="䏿¾ç¤º" active-text="æ¾ç¤º" inactive-value="0" |
| | | active-value="1"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm: function() { |
| | | submitForm: function () { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.menuId != undefined) { |
| | |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.menuName + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.menuName + '"çæ°æ®é¡¹ï¼').then(function () { |
| | | return delMenu(row.menuId); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | }).catch(() => { }); |
| | | } |
| | | } |
| | | }; |
| | |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target: `http://192.168.0.170:8002`, |
| | | target: `http://192.168.1.36:8002`, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | ["^" + process.env.VUE_APP_BASE_API]: "", |