¶Ô±ÈÐÂÎļþ |
| | |
| | | // å®éªå®¤çæ£æµè½åæ¡£æ¡ç¸å
³æ¥å£ |
| | | import request from "@/utils/request"; |
| | | |
| | | //æ åæ¹æ³æ´æ°éªè¯å表 |
| | | export function pagesMethodVerify(query) { |
| | | return request({ |
| | | url: "/processMethodVerify/pagesMethodVerify", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //è·åç¨æ·å表 |
| | | export function selectUserCondition(query) { |
| | | return request({ |
| | | url: "/system/newUser/selectUserCondition", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //æ¥è¯¢æ åæ¹æ³éªè¯è¯¦æ
|
| | | export function getMethodVerifyOne(query) { |
| | | return request({ |
| | | url: "/processMethodVerify/getMethodVerifyOne", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // éè¿è®¾å¤åç±»è·å设å¤å表 |
| | | export function deviceScopeSearch(query) { |
| | | return request({ |
| | | url: '/deviceScope/search', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢æ åæ¹æ³éªè¯ |
| | | export function addMethodVerify(data) { |
| | | return request({ |
| | | url: "/processMethodVerify/addMethodVerify", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹æ åæ¹æ³éªè¯ |
| | | export function updateMethodVerify(data) { |
| | | return request({ |
| | | url: "/processMethodVerify/updateMethodVerify", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åºæ åæ¹æ³æ´æ°éªè¯ |
| | | export function exportMethodVerify(query) { |
| | | return request({ |
| | | url: '/processMethodVerify/exportMethodVerify', |
| | | method: "get", |
| | | responseType: "blob", |
| | | params: query, |
| | | }) |
| | | } |
| | | |
| | | // éªè¯ç¡®è®¤ |
| | | export function methodVerifyAffirm(query) { |
| | | return request({ |
| | | url: '/processMethodVerify/methodVerifyAffirm', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // å 餿 åæ¹æ³æ´æ°éªè¯ |
| | | export function delMethodVerify(query) { |
| | | return request({ |
| | | url: '/processMethodVerify/delMethodVerify', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // åå§è®°å½å表 |
| | | export function getVerifyMethodFileList(query) { |
| | | return request({ |
| | | url: '/processMethodVerify/getVerifyMethodFileList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // å é¤éªè¯åå§è®°å½å表 |
| | | export function delVerifyMethodFileList(query) { |
| | | return request({ |
| | | url: '/processMethodVerify/delVerifyMethodFileList', |
| | | method: 'delete', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="viewDeviceDialog" title="æ¥ç设å¤" width="80%" @close="closeDia"> |
| | | <div style="text-align: right;margin-bottom: 10px"> |
| | | <el-button size="small" type="primary" @click="addRow">æ·»å </el-button> |
| | | <el-button size="small" type="danger" @click="clearTable">æ¸
空</el-button> |
| | | </div> |
| | | <div> |
| | | <el-table :data="machineAttachmentList" border height="500" style="width: 100%"> |
| | | <el-table-column header-align="center" label="åç§°" prop="machineName" width="200"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <p>åç§°</p> |
| | | </template> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.machineName" |
| | | class="table_input" |
| | | clearable |
| | | filterable |
| | | placeholder="设å¤åç§°" |
| | | size="small" @change="(val)=>changeMachineName(val, scope.$index)"> |
| | | <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | {{item.label + item.value}} |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column header-align="center" label="åå·è§æ ¼" prop="machineSpecification" width="180"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <p>åå·è§æ ¼</p> |
| | | </template> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.machineSpecification" size="small"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column header-align="center" label="æµéèå´" prop="machineMeasuringRange"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <p>æµéèå´</p> |
| | | </template> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.machineMeasuringRange" size="small" type="textarea"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column header-align="center" label="â æ©å±ä¸ç¡®å®åº¦â¡æå¤§å
å·®â¢å确度ç级" prop="other"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <p>â æ©å±ä¸ç¡®å®åº¦â¡æå¤§å
å·®â¢å确度ç级</p> |
| | | </template> |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.other" size="small" type="textarea"/> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeDia">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleDeviceInfo">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { deviceScopeSearch } from '@/api/cnas/process/method/standardMethodsChange' |
| | | |
| | | export default { |
| | | name: 'ViewDeviceDialog', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | viewDeviceDialog: false, |
| | | machineAttachmentList: [], |
| | | equipOptions: [], |
| | | }; |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | openDia(info) { |
| | | this.viewDeviceDialog = true |
| | | this.machineAttachmentList = info.machineAttachmentList |
| | | this.getEquipOptions() |
| | | }, |
| | | // å¢å è¡¨æ ¼è¡æ°æ® |
| | | addRow () { |
| | | this.machineAttachmentList.push({ |
| | | machineName: '', |
| | | machineSpecification: '', |
| | | machineMeasuringRange: '', |
| | | other: '', |
| | | }) |
| | | }, |
| | | // æ¸
ç©ºè¡¨æ ¼æ°æ® |
| | | clearTable () { |
| | | this.machineAttachmentList = [] |
| | | }, |
| | | // éæ©è®¾å¤çåè° |
| | | changeMachineName (val, index) { |
| | | const index1 = this.equipOptions.findIndex(item => item.value === val); |
| | | if (index1 !== -1) { |
| | | this.machineAttachmentList[index].deviceId = this.equipOptions[index1].id; |
| | | this.machineAttachmentList[index].machineName = this.equipOptions[index1].deviceName; |
| | | } |
| | | this.machineAttachmentList[index].machineSpecification = val |
| | | }, |
| | | // æäº¤è®¾å¤ä¿¡æ¯ |
| | | handleDeviceInfo () { |
| | | if (this.machineAttachmentList.length === 0) { |
| | | this.$message.warning('请添å ä¿¡æ¯') |
| | | return |
| | | } |
| | | this.viewDeviceDialog = false |
| | | this.$emit('handleDeviceInfo', this.machineAttachmentList) |
| | | }, |
| | | closeDia () { |
| | | this.viewDeviceDialog = false |
| | | this.$emit('closDeviceDia') |
| | | }, |
| | | // è·åææè®¾å¤ |
| | | getEquipOptions() { |
| | | this.equipOptions = [] |
| | | deviceScopeSearch({status:'0'}).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | this.equipOptions = res.data.map(m => { |
| | | m.value = m.managementNumber |
| | | m.label = m.deviceName |
| | | return m |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :visible.sync="filesDialogVisible" title="éä»¶ä¸ä¼ " width="80%" @closed="closeFilesLook"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-upload ref='upload' |
| | | :action="fileAction" |
| | | :auto-upload="true" |
| | | :before-upload="fileBeforeUpload" :data="{methodVerifyId: info.methodVerifyId}" |
| | | :headers="uploadHeader" |
| | | :on-error="onError" |
| | | :on-success="handleSuccessUp" |
| | | :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;"> |
| | | <el-button size="small" style="height: 38px" type="primary">éä»¶ä¸ä¼ </el-button> |
| | | </el-upload> |
| | | </div> |
| | | <div> |
| | | <lims-table |
| | | ref="yearTable" |
| | | :column="columnData" |
| | | :height="'calc(100vh - 47em)'" |
| | | :highlightCurrentRow="true" |
| | | :table-data="tableData" |
| | | :table-loading="tableLoading" |
| | | style="margin-top: 0.5em;"> |
| | | </lims-table> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import file from "@/utils/file"; |
| | | import { delVerifyMethodFileList, getVerifyMethodFileList } from '@/api/cnas/process/method/standardMethodsChange' |
| | | |
| | | export default { |
| | | name: 'ViewTestRecord', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { limsTable }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | filesDialogVisible: false, |
| | | tableLoading: false, |
| | | filesLookInfo: {}, |
| | | columnData: [ |
| | | { |
| | | label: 'æä»¶åç§°', |
| | | prop: 'fileName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | minWidth: '100', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'ä¸è½½', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.upload(row) |
| | | } |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.delete(row) |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | info: {} |
| | | }; |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | openDia(row) { |
| | | this.filesDialogVisible = true |
| | | this.info = row |
| | | if (this.info === undefined) { |
| | | this.info = { |
| | | methodVerifyId: '' |
| | | } |
| | | } |
| | | this.searchTableList() |
| | | }, |
| | | // æ¥è¯¢éä»¶å表 |
| | | searchTableList () { |
| | | this.tableLoading = true |
| | | getVerifyMethodFileList({methodVerifyId:this.info.methodVerifyId}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | this.tableData = res.data |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | closeFilesLook () { |
| | | this.filesDialogVisible = false |
| | | }, |
| | | // ä¸è½½ |
| | | upload (row) { |
| | | let url = ''; |
| | | if(row.type==1){ |
| | | url = this.javaApi+'/img/'+row.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+row.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | } |
| | | }, |
| | | // å é¤ |
| | | delete (row) { |
| | | this.tableLoading = true |
| | | delVerifyMethodFileList({methodFileId:row.methodFileId}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | this.$message.success('å 餿å') |
| | | this.searchTableList() |
| | | } |
| | | |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | // ä¸ä¼ éªè¯ |
| | | fileBeforeUpload(file) { |
| | | let flag = true |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('ä¸ä¼ æä»¶ä¸è¶
è¿10M'); |
| | | this.$refs.upload.clearFiles() |
| | | flag = false |
| | | } |
| | | if (!flag) { |
| | | return Promise.reject(flag); //æ£ç¡®çç»æ¢ |
| | | } |
| | | }, |
| | | onError(err, file, fileList,type) { |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response, ) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('ä¸ä¼ æå'); |
| | | this.searchTableList() |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | fileAction() { |
| | | return this.javaApi + '/processMethodVerify/uploadVerifyMethodFile' |
| | | |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :visible.sync="filesDialogVisible" title="æ¥çæ ¡åè¯ä¹¦" width="80%" @closed="closeFilesLook"> |
| | | <div> |
| | | <limsTable |
| | | ref="yearTable" |
| | | :column="columnData" |
| | | :height="'calc(100vh - 47em)'" |
| | | :highlightCurrentRow="true" |
| | | :table-data="tableData" |
| | | :table-loading="tableLoading" |
| | | style="margin-top: 0.5em;"> |
| | | </limsTable> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :visible.sync="lookDialogVisible" |
| | | fullscreen |
| | | title="æ¥çéä»¶" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" |
| | | :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import filePreview from '@/views/tool/file-preview.vue'; |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import file from '@/utils/file'; |
| | | |
| | | export default { |
| | | name: 'calibrationsFileDia', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { limsTable, filePreview }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | filesDialogVisible: false, |
| | | tableLoading: false, |
| | | filesLookInfo: {}, |
| | | columnData: [ |
| | | { |
| | | label: 'æä»¶åç§°', |
| | | prop: 'fileName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | label: '设å¤åç§°', |
| | | prop: 'deviceName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | label: '设å¤ç¼å·', |
| | | prop: 'managementNumber', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | minWidth: '100', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'é¢è§', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.handleLook(row) |
| | | } |
| | | }, |
| | | { |
| | | name: 'ä¸è½½', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.upload(row) |
| | | } |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | info: {}, |
| | | currentInfo:{}, |
| | | lookDialogVisible: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | openDia(row) { |
| | | this.filesDialogVisible = true |
| | | this.info = row |
| | | this.tableData = this.info.calibrationsFileList |
| | | }, |
| | | closeFilesLook () { |
| | | this.filesDialogVisible = false |
| | | }, |
| | | // æ¥çæä»¶ |
| | | handleLook(row){ |
| | | this.currentInfo = row |
| | | this.lookDialogVisible = true |
| | | }, |
| | | // ä¸è½½ |
| | | upload (row) { |
| | | let url = ''; |
| | | if(row.type==1){ |
| | | url = this.javaApi+'/img/'+row.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+row.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" |
| | | :title="operationType === 'edit' ? 'ç¼è¾' : 'æ°å¢'" |
| | | :visible.sync="formDia" |
| | | width="90%" @close="closeDia"> |
| | | <div v-if="operationType === 'edit'" style="text-align: right"> |
| | | <el-button :disabled="form.confirmDate !== '' && form.confirmDate !== null && form.confirmDate !== undefined" size="medium" type="primary" @click="validation">éªè¯ç¡®è®¤</el-button> |
| | | </div> |
| | | <table border="1" cellspacing="10" class="tables"> |
| | | <tr> |
| | | <td> |
| | | <p>æ åæ¹æ³</p> |
| | | </td> |
| | | <td> |
| | | <p>éªè¯åå </p> |
| | | </td> |
| | | <td> |
| | | <p>ä¸»è¦ææ¯åå</p> |
| | | </td> |
| | | <td> |
| | | <p>æ¶åæ¹é¢</p> |
| | | </td> |
| | | <td> |
| | | <p>æ åè¦æ±</p> |
| | | </td> |
| | | <td> |
| | | <p>å夿
åµ</p> |
| | | </td> |
| | | <td> |
| | | <p>æ¯å¦æ»¡è¶³</p> |
| | | </td> |
| | | <td> |
| | | <p>夿³¨</p> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td rowspan="9"> |
| | | <el-input v-model="form.methodName" :rows="6" |
| | | placeholder="请è¾å
¥å
容" |
| | | size="small" |
| | | type="textarea"> |
| | | </el-input> |
| | | </td> |
| | | <td rowspan="9"> |
| | | <el-input v-model="form.verifyReason" :rows="6" |
| | | placeholder="请è¾å
¥å
容" |
| | | size="small" |
| | | type="textarea"> |
| | | </el-input> |
| | | </td> |
| | | <td rowspan="9"> |
| | | <el-input v-model="form.technologyChange" :rows="6" |
| | | placeholder="请è¾å
¥å
容" |
| | | size="small" |
| | | type="textarea"> |
| | | </el-input> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>人ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.personRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.personReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.personIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-link type="primary" @click="viewWorkPermit">æ¥çä¸å²è¯</el-link> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>æºï¼</td> |
| | | <td> |
| | | <el-input v-model="form.machineRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.machineReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.machineIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-link type="primary" @click="viewDevice">æ¥ç设å¤</el-link> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>æï¼</td> |
| | | <td> |
| | | <el-input v-model="form.materialRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.materialReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.materialIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.materialRemark" size="small"></el-input> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>æ³ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.methodRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.methodReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.methodIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-link type="primary" @click="viewTestRecord">æ¥çæ£æµè®°å½</el-link> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>ç¯ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.environmentRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.environmentReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.environmentIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.traceabilityRemark" size="small"></el-input> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>æµéæº¯æºæ§ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.traceabilityRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.traceabilityReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.traceabilityIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-link type="primary" @click="viewCalibrationsFileDia">æ¥çæ ¡åè¯ä¹¦</el-link> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>æ ·å管çéæ±ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.managementRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.managementReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.managementIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.managementRemark" size="small"></el-input> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>å
¶ä»ï¼</td> |
| | | <td> |
| | | <el-input v-model="form.otherRequirements" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.otherReadiness" size="small" type="textarea"></el-input> |
| | | </td> |
| | | <td> |
| | | <el-radio-group v-model="form.otherIsSatisfied" v-removeAriaHidden> |
| | | <el-radio :label="0">å¦</el-radio> |
| | | <el-radio :label="1">æ¯</el-radio> |
| | | </el-radio-group> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="form.otherRemark" size="small"></el-input> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | <p>æ¯å¦å¼ç¨æ¤æ åå¼å±æ£æµ:</p> |
| | | </td> |
| | | <td colspan="3">å¯ä»¥å¼ç¨æ¤æ åå¼å±æ£æµ</td> |
| | | <td> |
| | | <p>确认æ¶é´:</p> |
| | | </td> |
| | | <td>{{form.confirmDate}}</td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | <p>åå 确认人ç¾å:</p> |
| | | </td> |
| | | <td colspan="5"> |
| | | <el-select v-model="form.confirmUser" multiple placeholder="è¯·éæ©" size="small" style="width: 100%" :multiple-limit="5"> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeDia">å æ¶</el-button> |
| | | <el-button :loading="editLoad" type="primary" @click="handleEdit">æ 交</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <ViewDeviceDialog v-if="viewDeviceDialog" ref="viewDeviceDialog" @closDeviceDia="closDeviceDia" @handleDeviceInfo="handleDeviceInfo"></ViewDeviceDialog> |
| | | <ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog"></ViewTestRecord> |
| | | <ViewWorkPermitDia v-if="viewWorkPermitDia" ref="viewWorkPermitDia"></ViewWorkPermitDia> |
| | | <calibrations-file-dia v-if="calibrationsFileDia" ref="calibrationsFileDia"></calibrations-file-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { dateFormat } from '@/utils/date' |
| | | import ViewTestRecord from '../component/ViewTestRecord.vue'; |
| | | import ViewDeviceDialog from '../component/ViewDeviceDialog.vue'; |
| | | import ViewWorkPermitDia from '../component/viewWorkPermitDia.vue'; |
| | | import CalibrationsFileDia from '../component/calibrationsFileDia.vue'; |
| | | import { |
| | | addMethodVerify, deviceScopeSearch, |
| | | getMethodVerifyOne, |
| | | selectUserCondition, |
| | | updateMethodVerify |
| | | } from '@/api/cnas/process/method/standardMethodsChange' |
| | | |
| | | export default { |
| | | name: 'formDIaChange', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { CalibrationsFileDia, ViewWorkPermitDia, ViewDeviceDialog, ViewTestRecord }, |
| | | props: { |
| | | operationType: { |
| | | type: String, |
| | | default: () => '' |
| | | } |
| | | }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | formDia: false, |
| | | form: { |
| | | methodName: '', |
| | | verifyReason: '', |
| | | technologyChange: '', |
| | | personRequirements: '', |
| | | personReadiness: '', |
| | | personIsSatisfied: '', |
| | | personRemark: '', |
| | | machineRequirements: '', |
| | | machineReadiness: '', |
| | | machineIsSatisfied: '', |
| | | materialRequirements: '', |
| | | materialReadiness: '', |
| | | materialIsSatisfied: '', |
| | | materialRemark: '', |
| | | methodRequirements: '', |
| | | methodReadiness: '', |
| | | methodIsSatisfied: '', |
| | | environmentRequirements: '', |
| | | environmentReadiness: '', |
| | | environmentIsSatisfied: '', |
| | | traceabilityRequirements: '', |
| | | traceabilityReadiness: '', |
| | | traceabilityIsSatisfied: '', |
| | | traceabilityRemark: '', |
| | | managementRequirements: '', |
| | | managementReadiness: '', |
| | | managementIsSatisfied: '', |
| | | managementRemark: '', |
| | | otherRequirements: '', |
| | | otherReadiness: '', |
| | | otherIsSatisfied: '', |
| | | otherRemark: '', |
| | | machineAttachmentList: [] |
| | | }, |
| | | editLoad: false, |
| | | info: { |
| | | methodVerifyId: '' |
| | | }, |
| | | userList: [], |
| | | viewDeviceDialog: false, |
| | | viewTestRecordDialog: false, |
| | | viewWorkPermitDia: false, |
| | | calibrationsFileDia: false, |
| | | }; |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | openDia(row) { |
| | | this.formDia = true |
| | | this.info = row |
| | | this.getUserList() |
| | | if (this.operationType === 'edit') { |
| | | this.searchInfo(row) |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¯¦æ
ä¿¡æ¯ |
| | | searchInfo (row) { |
| | | getMethodVerifyOne({methodVerifyId:row.methodVerifyId}).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = {...res.data} |
| | | if (this.form.confirmUser) { |
| | | this.form.confirmUser = this.form.confirmUser.split(',').map(Number) |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | // æäº¤ |
| | | handleEdit() { |
| | | this.editLoad = true |
| | | const processMethodSearchNews = this.HaveJson(this.form) |
| | | processMethodSearchNews.confirmUser = processMethodSearchNews.confirmUser && processMethodSearchNews.confirmUser.join(',') |
| | | processMethodSearchNews.operationType = 0 |
| | | if (this.operationType === 'edit') { |
| | | this.editInfo(processMethodSearchNews) |
| | | } else { |
| | | this.addInfo(processMethodSearchNews) |
| | | } |
| | | }, |
| | | // æ¥çä¸å²è¯ |
| | | viewWorkPermit () { |
| | | this.viewWorkPermitDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.viewWorkPermitDia.openDia(this.form) |
| | | }) |
| | | }, |
| | | // æ¥çæ ¡åè¯ä¹¦ |
| | | viewCalibrationsFileDia () { |
| | | this.calibrationsFileDia = true |
| | | this.$nextTick(() => { |
| | | this.$refs.calibrationsFileDia.openDia(this.form) |
| | | }) |
| | | }, |
| | | // æ¥çè®¾å¤ |
| | | viewDevice () { |
| | | this.viewDeviceDialog = true |
| | | this.$nextTick(() => { |
| | | this.$refs.viewDeviceDialog.openDia(this.form) |
| | | }) |
| | | }, |
| | | // å
³é设å¤å¼¹æ¡ |
| | | closDeviceDia () { |
| | | this.viewDeviceDialog = false |
| | | }, |
| | | // æäº¤è®¾å¤ä¿¡æ¯ |
| | | handleDeviceInfo (machineAttachmentList) { |
| | | this.viewDeviceDialog = false |
| | | this.form.machineAttachmentList = machineAttachmentList |
| | | }, |
| | | // æ¥çæ£æµè®°å½ |
| | | viewTestRecord () { |
| | | this.viewTestRecordDialog = true |
| | | this.$nextTick(() => { |
| | | this.$refs.viewTestRecordDialog.openDia(this.info) |
| | | }) |
| | | }, |
| | | // æäº¤ç¼è¾ |
| | | editInfo (processMethodSearchNews) { |
| | | updateMethodVerify(processMethodSearchNews).then(res => { |
| | | this.editLoad = false |
| | | if (res.code === 200){ |
| | | this.$message.success('æä½æå') |
| | | this.closeDia() |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.editLoad = false |
| | | }) |
| | | }, |
| | | // æäº¤æ°å¢ |
| | | addInfo (processMethodSearchNews) { |
| | | addMethodVerify(processMethodSearchNews).then(res => { |
| | | this.editLoad = false |
| | | if (res.code === 200) { |
| | | this.$message.success('æä½æå') |
| | | this.closeDia() |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.editLoad = false |
| | | }) |
| | | }, |
| | | // éªè¯ç¡®è®¤ |
| | | validation () { |
| | | deviceScopeSearch({methodVerifyId:this.info.methodVerifyId}).then(res => { |
| | | if (res.code === 200){ |
| | | this.form.confirmDate = dateFormat(new Date()) |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | }) |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | closeDia() { |
| | | this.formDia = false |
| | | this.$emit('closeDia'); |
| | | }, |
| | | getUserList(){ |
| | | selectUserCondition().then(res => { |
| | | if (res.code === 200) { |
| | | this.userList = res.data |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | >>>.el-dialog { |
| | | margin-top: 2vh !important; |
| | | } |
| | | >>>.el-dialog__body { |
| | | max-height: 720px; |
| | | overflow-y: auto; |
| | | } |
| | | .tables { |
| | | table-layout: fixed; |
| | | width: 100%; |
| | | margin-top: 10px; |
| | | } |
| | | .tables td { |
| | | height: 34px; |
| | | width: 100px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | word-wrap: break-word; |
| | | white-space: normal; |
| | | padding: 4px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :visible.sync="filesDialogVisible" title="æ¥çä¸å²è¯" width="80%" @closed="closeFilesLook"> |
| | | <div> |
| | | <limsTable |
| | | ref="yearTable" |
| | | :column="columnData" |
| | | :height="'calc(100vh - 400px)'" |
| | | :highlightCurrentRow="true" |
| | | :table-data="tableData" |
| | | :table-loading="tableLoading" |
| | | style="margin-top: 0.5em;"> |
| | | </limsTable> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :visible.sync="lookDialogVisible" |
| | | fullscreen |
| | | title="æ¥çéä»¶" top="5vh" width="800px"> |
| | | <filePreview v-if="lookDialogVisible" :currentFile="{}" |
| | | :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import file from '@/utils/file'; |
| | | import filePreview from '@/views/tool/file-preview.vue'; |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | |
| | | export default { |
| | | name: 'viewWorkPermitDia', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { filePreview, limsTable }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | filesDialogVisible: false, |
| | | tableLoading: false, |
| | | filesLookInfo: {}, |
| | | columnData: [ |
| | | { |
| | | label: 'æä»¶åç§°', |
| | | prop: 'fileName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | label: 'ææäºº', |
| | | prop: 'userName', |
| | | minWidth: '150px' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | minWidth: '100', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'é¢è§', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.handleLook(row) |
| | | } |
| | | }, |
| | | { |
| | | name: 'ä¸è½½', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.upload(row) |
| | | } |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | info: {}, |
| | | currentInfo:{}, |
| | | lookDialogVisible: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | openDia(row) { |
| | | this.filesDialogVisible = true |
| | | this.info = row |
| | | this.tableData = this.info.workFileList |
| | | }, |
| | | closeFilesLook () { |
| | | this.filesDialogVisible = false |
| | | }, |
| | | // æ¥çæä»¶ |
| | | handleLook(row){ |
| | | this.currentInfo = row |
| | | this.lookDialogVisible = true |
| | | }, |
| | | // ä¸è½½ |
| | | upload (row) { |
| | | let url = ''; |
| | | if(row.type==1){ |
| | | url = this.javaApi+'/img/'+row.fileUrl |
| | | file.downloadIamge(url,row.fileName) |
| | | }else{ |
| | | url = this.javaApi+'/word/'+row.fileUrl |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.fileName; |
| | | link.click(); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="capacity-scope"> |
| | | <div class="search"> |
| | | <div> |
| | | <el-form :model="searchForm" ref="searchForm" size="small" :inline="true"> |
| | | <el-form-item label="æ åæ¹æ³" prop="methodName"> |
| | | <el-input size="small" placeholder="请è¾å
¥" clearable v-model="searchForm.methodName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">æ¥ è¯¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">é ç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="medium" type="primary" @click="openFormDia('add')">æ° å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <div> |
| | | <TableCard :showForm="false" :showTitle="false"> |
| | | <template v-slot:table> |
| | | <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </template> |
| | | </TableCard> |
| | | </div> |
| | | </div> |
| | | <formDIaChange v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIaChange> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableCard from '@/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue'; |
| | | import formDIaChange from './component/formDIaChange.vue'; |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import { |
| | | delMethodVerify, |
| | | exportMethodVerify, |
| | | pagesMethodVerify |
| | | } from '@/api/cnas/process/method/standardMethodsChange' |
| | | |
| | | export default { |
| | | name: 'a7-changes-standard-methods', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { limsTable, formDIaChange, TableCard }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | searchForm: { |
| | | methodName: '', |
| | | operationType: 0, |
| | | }, |
| | | options: [ |
| | | { label: 'ä¸åå¹´', value: '1' }, |
| | | { label: 'ä¸åå¹´', value: '2' }, |
| | | ], |
| | | tableColumn: [ |
| | | { |
| | | label: 'æ åæ¹æ³', |
| | | prop: 'methodName', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'éªè¯åå ', |
| | | prop: 'verifyReason', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | label: 'ä¸»è¦ææ¯åå', |
| | | prop: 'technologyChange', |
| | | minWidth: '100' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | minWidth: '60', |
| | | label: 'æä½', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openFormDia('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | | name: '导åº', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.downLoadPost(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | color: '#f56c6c', |
| | | clickFun: (row) => { |
| | | this.deleteRow(row); |
| | | }, |
| | | } |
| | | |
| | | ] |
| | | } |
| | | ], |
| | | tableData: [], |
| | | tableLoading: false, |
| | | page: { |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | formDIa: false, |
| | | operationType: '', |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.searchList() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢å表 |
| | | searchList() { |
| | | const entity = { |
| | | methodName: this.searchForm.methodName, |
| | | operationType: this.searchForm.operationType, |
| | | } |
| | | this.tableLoading = true |
| | | pagesMethodVerify({... this.page,...entity}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // å é¤ |
| | | deleteRow (row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | delMethodVerify({methodVerifyId:row.methodVerifyId}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200){ |
| | | this.$message.success('å 餿å') |
| | | this.searchList() |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }) |
| | | }, |
| | | // éç½®æ¥è¯¢æ¡ä»¶ |
| | | resetSearchForm() { |
| | | this.searchForm.methodName = ''; |
| | | this.searchList() |
| | | }, |
| | | openFormDia (type, row) { |
| | | this.formDIa = true |
| | | this.operationType = type |
| | | this.$nextTick(() => { |
| | | this.$refs.formDIa.openDia(row) |
| | | }) |
| | | }, |
| | | // å
³éå¼¹æ¡ |
| | | closeDia () { |
| | | this.formDIa = false |
| | | this.searchList() |
| | | }, |
| | | // å¯¼åº |
| | | downLoadPost(row) { |
| | | this.outLoading = true |
| | | exportMethodVerify({methodVerifyId:row.methodVerifyId}).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res],{ type: 'application/msword' }); |
| | | this.$download.saveAs(blob, 'æ åï¼æ¹æ³ï¼ç¡®è®¤è®°å½.docx') |
| | | this.$message.success('å¯¼åºæå') |
| | | }) |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.searchList(); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .search { |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |