| | |
| | | <a v-if="!record.lockFlag && ((record.fileType == 'dwg' && canViewDoc) || (record.fileType != 'dwg' && canViewOther))" @click="view(record)">预览</a> |
| | | <template v-if="((record.fileType == 'dwg' && canDownloadDoc) || (record.fileType != 'dwg' && canDownloadOther)) && !record.lockFlag"> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | <a @click="downloadReason(record)">下载</a> |
| | | </template> |
| | | <template v-if="canLockOther && (id || productId)"> |
| | | <a-divider v-if="!record.lockFlag" type="vertical"></a-divider> |
| | |
| | | /> |
| | | </a-form-model-item> |
| | | </a-modal> |
| | | <download-reason :reason-visible.sync="downloadReasonVisible" v-if="downloadReasonVisible" @ok="downloadReasonOk"></download-reason> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { updateAttachLock } from "@/pages/resourceManage/materialsCenter/apis"; |
| | | import { updateProductLock } from "@/pages/resourceManage/product/details/apis"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import DownloadReason from '@/pages/components/downloadReason'; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: "", |
| | | components: { |
| | | DownloadReason, |
| | | }, |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | |
| | | return null; |
| | | }, |
| | | }, |
| | | // 类型 产品12 物料13 |
| | | type: { |
| | | type: Number, |
| | | required: true, |
| | | }, |
| | | oprateVersion: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | const columns = [ |
| | |
| | | }, |
| | | ]; |
| | | return { |
| | | downloadUrl: '', |
| | | downloadReasonVisible: false, |
| | | reason: "", |
| | | reasonVisible: false, |
| | | currObj: null, |
| | |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | downloadLog(record) { |
| | | const { parentModel, subModel, url } = record; |
| | | downloadReason(record) { |
| | | this.downloadUrl = record.url; |
| | | this.downloadReasonVisible = true; |
| | | }, |
| | | downloadReasonOk(data) { |
| | | this.downloadLog(this.downloadUrl, data); |
| | | }, |
| | | downloadLog(url, reason) { |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | let fileName = url.match(reg)[2]; |
| | | downLoadFileByFilePath(url).then((res) => { |
| | | downLoadFileByFilePath(url, reason, this.info.oprateInfo, this.oprateVersion, this.type).then((res) => { |
| | | let { data, status } = res; |
| | | if (200 == status && data) { |
| | | let url = window.URL.createObjectURL(data); |