| | |
| | | data = res.data2.list.map((v) => { |
| | | const model = v.subModel; |
| | | const reg = /(.*)(-|_)A/; |
| | | |
| | | const rootModel = reg.test(model) ? model.match(reg)[1] : ""; |
| | | const isCanUse = this.getAttachIsCanUse(v); |
| | | return { |
| | |
| | | this.resize(); |
| | | }, |
| | | panelShow(obj) { |
| | | console.log(obj); |
| | | const { id, dwgUrl, attachLocks, subModel } = obj; |
| | | this.currentObj = obj; |
| | | let reg = new RegExp("^" + subModel, "i"); |
| | |
| | | }); |
| | | }, |
| | | getAttachIsCanUse(obj) { |
| | | const {dwgUrl, attachLocks} = obj; |
| | | const {dwgUrl, attachLocks, attachFileList} = obj; |
| | | let isHasNewFile = true; // 标识是否存有文件,没有锁定和未锁定日志 |
| | | if(attachFileList) { |
| | | for(let i=0; i<attachFileList.length; i++) { |
| | | const itemI = attachFileList[i]; |
| | | for(let j=0; j<attachLocks.length; j++) { |
| | | const itemJ = attachLocks[j]; |
| | | if(itemI === itemJ.attachName) { |
| | | isHasNewFile = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | isHasNewFile = false; |
| | | } |
| | | let result = false; |
| | | if(isHasNewFile) { |
| | | result = true; |
| | | }else { |
| | | if(attachLocks.length !== 0) { // 存在未锁定/锁定条目 |
| | | let isHasUnlock = false; |
| | | for(let i=0; i<attachLocks.length; i++) { |
| | |
| | | result = false; |
| | | } |
| | | }else result = !!dwgUrl; |
| | | } |
| | | return result; |
| | | }, |
| | | fileListCancel() { |
| | |
| | | :visible="uploadShow" |
| | | :footer="null" |
| | | :width="800" |
| | | title="上传软件" |
| | | title="上传SOP" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | @cancel="uploadCancel" |
| | |
| | | <div class=""> |
| | | <template v-if="!onlyXls"> |
| | | <a-row type="flex" class="row"> |
| | | <a-col flex="6em" class="label">sop包</a-col> |
| | | <a-col flex="6em" class="label">SOP文件</a-col> |
| | | <a-col :flex="1"> |
| | | <a-upload |
| | | class="upload" |
| | | :before-upload="beforeUpload" |
| | | @change="uploadChange" |
| | | accept=".zip,.rar" |
| | | accept=".zip,.rar,.pdf" |
| | | > |
| | | <a-button type="primary">选压缩包</a-button> |
| | | <a-button type="primary">选文件</a-button> |
| | | </a-upload> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | }, |
| | | uploadSop() { |
| | | if (!this.file) { |
| | | this.$message.error("请选择要上传的压缩包"); |
| | | this.$message.error("请选择要上传的文件"); |
| | | return false; |
| | | } |
| | | if (!this.file1) { |
| | |
| | | }, |
| | | downloadFile(record) { |
| | | const fileInfo = getFileTypeAndName(record.fileUrl); |
| | | let url = this.webUrl + record.fileUrl; |
| | | if(fileInfo.type === 'pdf') { // 预览 |
| | | window.open("http://localhost:8092/cad/"+record.fileUrl); |
| | | window.open(url); |
| | | }else { // 下载 |
| | | let loading = this.$layer.loading(); |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | let url = this.webUrl + record.fileUrl; |
| | | let fileName = record.fileUrl.split("/").pop(); |
| | | link.href = url; |
| | | link.download = fileName; |
| | |
| | | :visible="uploadShow" |
| | | :footer="null" |
| | | :width="800" |
| | | title="上传软件" |
| | | title="上传SOP" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | @cancel="uploadCancel" |
| | |
| | | <div class=""> |
| | | <template v-if="!onlyXls"> |
| | | <a-row type="flex" class="row"> |
| | | <a-col flex="6em" class="label">sop包</a-col> |
| | | <a-col flex="6em" class="label">sop文件</a-col> |
| | | <a-col :flex="1"> |
| | | <a-upload |
| | | class="upload" |
| | |
| | | @change="uploadChange" |
| | | accept=".zip,.rar" |
| | | > |
| | | <a-button type="primary">选压缩包</a-button> |
| | | <a-button type="primary">选文件</a-button> |
| | | </a-upload> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | update: -1, |
| | | conditions: {}, |
| | | columns: [ |
| | | { |
| | | title: "文件名称", |
| | | dataIndex: "fileName", |
| | | align: "center", |
| | | width: 140, |
| | | searchAble: false, |
| | | customCell: this.customCell, |
| | | }, |
| | | { |
| | | title: "发布时间", |
| | | dataIndex: "releaseDate", |
| | |
| | | }, |
| | | downloadFile(record) { |
| | | const fileInfo = getFileTypeAndName(record.fileUrl); |
| | | let url = this.webUrl + record.fileUrl; |
| | | if(fileInfo.type === 'pdf') { // 预览 |
| | | window.open("http://localhost:8092/cad/"+record.fileUrl); |
| | | window.open(url); |
| | | }else { // 下载 |
| | | let loading = this.$layer.loading(); |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | let url = this.webUrl + record.fileUrl; |
| | | let fileName = record.fileUrl.split("/").pop(); |
| | | link.href = url; |
| | | link.download = fileName; |
| | |
| | | dataIndex: "parentName", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 120, |
| | | width: 180, |
| | | }, |
| | | { |
| | | title: "产品型号", |
| | |
| | | dataIndex: "versionTime", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 120, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "创建人", |
| | | dataIndex: "senderName", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 120 |
| | | }, |
| | | { |
| | | title: "创建时间", |
| | | dataIndex: "createTime", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "反馈接收人", |
| | | dataIndex: "receiverNames", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "确认人", |
| | | dataIndex: "confirmUserName", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "回复内容", |
| | | dataIndex: "replyContent", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: "回复时间", |
| | | dataIndex: "replyTime", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "变更单流水号", |
| | | dataIndex: "ecrNumber", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 180 |
| | | }, |
| | | { |
| | | title: "操作", |
| | |
| | | @refresh="onRefresh" |
| | | @reset="onReset" |
| | | :format-conditions="true" |
| | | :scroll="{ x: 400, y }" |
| | | :scroll="{ x: 100, y }" |
| | | :pagination="{ |
| | | current: pageCurr, |
| | | pageSize: pageSize, |