| | |
| | | <template> |
| | | <div class=""> |
| | | <a-collapse v-model="activeKey" accordion> |
| | | <a-collapse :defaultActiveKey="activeKey" accordion> |
| | | <a-collapse-panel |
| | | class="add" |
| | | key="1" |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const wrap = this.$refs.tableWrap; |
| | | const header = document.querySelectorAll( |
| | |
| | | targetKeys, |
| | | linkList, |
| | | info: { nextUser, description }, |
| | | comData: { subCode, subName }, |
| | | comData: { id: subMaterialId, subCode, subName }, |
| | | } = this; |
| | | if (!selectedRowKeys.length) { |
| | | this.$message.error("请选择要处理的产品"); |
| | |
| | | parentCode: v.parentCode, |
| | | customCode: v.customCode, |
| | | materialId: val * 1, |
| | | subCode, |
| | | subMaterialId, |
| | | version: v.version, |
| | | }); |
| | | } |
| | |
| | | targetKeys, |
| | | linkList, |
| | | info: { nextUser, description }, |
| | | comData: { subCode, subName }, |
| | | comData: { id: subMaterialId, subCode, subName }, |
| | | } = this; |
| | | if (!selectedRowKeys.length) { |
| | | this.$message.error("请选择要处理的产品"); |
| | |
| | | parentCode: v.parentCode, |
| | | customCode: v.customCode, |
| | | materialId: val * 1, |
| | | subCode, |
| | | subMaterialId, |
| | | version: v.version, |
| | | }); |
| | | } |
| | |
| | | :columns="columns" |
| | | :data-source="dataSource" |
| | | :pagination="false" |
| | | rowKey="subCode" |
| | | rowKey="id" |
| | | > |
| | | </a-table> |
| | | </a-card> |
| | |
| | | <a-descriptions-item label="图片"> |
| | | <div class="img-wraper"> |
| | | <image-view |
| | | v-if="record" |
| | | v-if="record && record.pictureUrl" |
| | | :url="webUrl + record.pictureUrl" |
| | | ></image-view> |
| | | </div> |
| | |
| | | <files-table slot="content" :list="otherDoc"></files-table> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> |
| | | <a-button |
| | | type="primary" |
| | | v-if="softwareList.length" |
| | | @click="showSoftwareDownload" |
| | | >软件下载</a-button |
| | | > |
| | | </template> |
| | | </a-card> |
| | | </a-layout-footer> |
| | | </a-layout> |
| | | <!-- 下载软件 --> |
| | | <a-modal |
| | | :visible="softwareDownloadShow" |
| | | :footer="null" |
| | | :width="600" |
| | | title="软件下载" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | @cancel="softwareDownloadCancel" |
| | | > |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" |
| | | :scroll="{ y: 300 }" |
| | | bordered |
| | | :columns="softwareColumns" |
| | | :data-source="softwareList" |
| | | :pagination="false" |
| | | :expandRowByClick="true" |
| | | :row-key="(record, index) => index" |
| | | > |
| | | <template slot="action" slot-scope="text, record"> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | </template> |
| | | </a-table> |
| | | </a-modal> |
| | | </a-layout> |
| | | </template> |
| | | |
| | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { getVersions, getMaterialById } from "../apis"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: "", |
| | | |
| | |
| | | spinning: false, |
| | | loading: false, |
| | | total: 0, |
| | | y: 400, |
| | | update: -1, |
| | | columns: [ |
| | | { |
| | | title: "产品名称", |
| | |
| | | DiffList, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("setting", ["affixed"]), |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | this.$nextTick(() => { |
| | | const wraper = this.$refs.wraper; |
| | | const wraperH = wraper.clientHeight; |
| | | const header = document.querySelectorAll( |
| | | ".wraper .ant-table-header" |
| | | )[0].clientHeight; |
| | | const { paddingBottom, paddingTop } = window.getComputedStyle( |
| | | wraper, |
| | | null |
| | | ); |
| | | const h = |
| | | wraperH - header - parseInt(paddingBottom) - parseInt(paddingTop); |
| | | // console.log(h, "h", wraperH, header, paddingBottom, paddingTop); |
| | | this.y = h; |
| | | }); |
| | | } |
| | | }, |
| | | affixed() { |
| | | setTimeout(() => { |
| | | this.update = Math.random(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | | methods: { |
| | | getVersions() { |
| | |
| | | getInfo() { |
| | | const { |
| | | currentVersion: { id }, |
| | | info, |
| | | } = this; |
| | | this.spinning = true; |
| | | getMaterialById(id).then((res) => { |
| | | let { code, data, data2, data3 } = res.data; |
| | | // console.log(res, '909009') |
| | | let list = []; |
| | | let prods = []; |
| | | let softwareList = []; |
| | | let otherDoc = []; |
| | | this.spinning = false; |
| | | if (code && data) { |
| | | list = data2; |
| | | prods = data2.products; |
| | | otherDoc = data3; |
| | | // otherDoc = data4; |
| | | } |
| | | this.dataSource = prods; |
| | | this.record = list; |
| | | this.softwareList = softwareList; |
| | | this.otherDoc = otherDoc; |
| | | if (this.record.dwgUrl) { |
| | | this.otherDoc.unshift(this.record.dwgUrl); |
| | | } |
| | | if (-1 == this.update) { |
| | | this.update = Math.random(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | downloadLog(record) { |
| | | const { parentCode, subModel, dwgUrl, softwareUrl } = record; |
| | | const url = softwareUrl |
| | | ? this.webUrl + softwareUrl |
| | | : this.webUrl + dwgUrl; |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = url; |
| | | // link.download = fileName; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | // downloadLog(parentCode, subModel); |
| | | }, |
| | | zipDownload() { |
| | | // const { parentCode, currentVersion } = this; |
| | | const { |
| | | currentVersion: { id, version }, |
| | | } = this; |
| | | // zipDownload(id, version).then((res) => { |
| | | // // console.log(res, "==========="); |
| | | // let { headers, data, status } = res; |
| | | // if (200 == status && data) { |
| | | // let url = window.URL.createObjectURL(data); |
| | | // const matchRes = /filename=(.*)/.exec(headers["content-disposition"]); |
| | | // const fileName = matchRes ? matchRes[1].trim() : "未知文件名.zip"; |
| | | // let link = document.createElement("a"); |
| | | // link.style.display = "none"; |
| | | // link.href = url; |
| | | // link.download = fileName; |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); |
| | | // window.URL.revokeObjectURL(url); |
| | | // } else { |
| | | // this.$message.error("操作失败"); |
| | | // } |
| | | // }); |
| | | }, |
| | | resize() { |
| | | this.update = Math.random(); |
| | | }, |
| | | showSoftwareDownload() { |
| | | this.softwareDownloadShow = true; |
| | | }, |
| | | softwareDownloadCancel() { |
| | | this.softwareDownloadShow = false; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getVersions(); |
| | | // this.searchData(); |
| | | window.addEventListener("resize", this.resize); |
| | | }, |
| | | destroyed() { |
| | | window.removeEventListener("resize", this.resize); |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | :columns="columns" |
| | | :loading="loading" |
| | | title="" |
| | | row-key="subCode" |
| | | :row-key="(record, index) => record.subCode + '_' + index" |
| | | @search="onSearch" |
| | | @refresh="onRefresh" |
| | | @reset="onReset" |
| | |
| | | const { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.$message.success(msg); |
| | | this.fileListShow = false; |
| | | } else { |
| | | this.$message.error(msg); |
| | | } |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | |
| | | componentsBak, |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | materialId: subMaterialId, |
| | | version, |
| | | } = obj; |
| | | // 取新增的 |
| | |
| | | materialId: v.id, |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | subMaterialId, |
| | | version, |
| | | })); |
| | | // 删除的 |
| | |
| | | materialId: v.id, |
| | | parentCode, |
| | | customCode, |
| | | subCode, |
| | | subMaterialId, |
| | | version, |
| | | })); |
| | | arrAdd.push(...add); |
| | |
| | | <a @click="dwgReview(record.dwgUrl)">预览</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | <template |
| | | v-if="record.softwares.length && canUploadSoftware" |
| | | > |
| | | <a-divider type="vertical"></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | | <div class="" slot="content" style="width: 450px"> |
| | | <a-table |
| | | size="small" |
| | | :scroll="{ y: 300 }" |
| | | bordered |
| | | :columns="softwareColumns" |
| | | :data-source="record.softwares" |
| | | :pagination="false" |
| | | :expandRowByClick="true" |
| | | :row-key="(record1, index) => index" |
| | | > |
| | | <template slot="action" slot-scope="text, record1"> |
| | | <a @click="downloadLog(record1)">下载</a> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | <a>软件列表</a> |
| | | </a-popover> |
| | | </template> |
| | | </div> |
| | | <template |
| | | v-if="record.softwares.length && canDownloadSoftware" |
| | | > |
| | | <a-divider v-if="record.dwgUrl" type="vertical"></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | | <div class="" slot="content" style="width: 450px"> |
| | | <a-table |
| | | size="small" |
| | | :scroll="{ y: 300 }" |
| | | bordered |
| | | :columns="softwareColumns" |
| | | :data-source="record.softwares" |
| | | :pagination="false" |
| | | :expandRowByClick="true" |
| | | :row-key="(record1, index) => index" |
| | | > |
| | | <template slot="action" slot-scope="text, record1"> |
| | | <a @click="downloadLog(record1)">下载</a> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | <a>软件列表</a> |
| | | </a-popover> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </a-spin> |
| | |
| | | <a-layout-footer> |
| | | <a-card> |
| | | <template v-if="dataSource.length"> |
| | | <a-popover title="" v-if="otherDoc.length && currentVersion.enabled"> |
| | | <a-popover |
| | | title="" |
| | | v-if="otherDoc.length && currentVersion.enabled" |
| | | > |
| | | <files-table slot="content" :list="otherDoc"></files-table> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> |
| | | <a-button v-if="canDownloadBom && currentVersion.enabled" type="primary" @click="zipDownload" |
| | | <a-button |
| | | v-if="canDownloadBom && currentVersion.enabled" |
| | | type="primary" |
| | | @click="zipDownload" |
| | | >bom下载</a-button |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | v-if="softwareList.length && canUploadSoftware && currentVersion.enabled" |
| | | v-if=" |
| | | softwareList.length && |
| | | canDownloadSoftware && |
| | | currentVersion.enabled |
| | | " |
| | | @click="showSoftwareDownload" |
| | | >软件下载</a-button |
| | | > |
| | |
| | | computed: { |
| | | ...mapGetters("setting", ["affixed"]), |
| | | ...mapGetters("account", ["permits"]), |
| | | canUploadSoftware() { |
| | | return checkPermit(PERMITS.uploadSoftware, this.permits); |
| | | canDownloadSoftware() { |
| | | return checkPermit(PERMITS.downloadSoftware, this.permits); |
| | | }, |
| | | canDownloadBom() { |
| | | return checkPermit(PERMITS.downloadBom, this.permits); |
| | | }, |
| | | canLockBom() { |
| | | return checkPermit(PERMITS.lockBom, this.permits); |
| | | } |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const wraper = this.$refs.wraper; |
| | | const wraperH = wraper.clientHeight; |
| | |
| | | }); |
| | | }, |
| | | downloadLog(record) { |
| | | const { parentCode, subModel, dwgUrl, softwareUrl } = record; |
| | | const { parentCode, subModel, dwgUrl, fileUrl: softwareUrl } = record; |
| | | const url = softwareUrl |
| | | ? this.webUrl + softwareUrl |
| | | : this.webUrl + dwgUrl; |
| | |
| | | }, |
| | | uploadBom() { |
| | | this.file = null; |
| | | this.fromProd = undefined; |
| | | this.bomUploadShow = true; |
| | | }, |
| | | bomUploadCancel() { |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | |
| | | productSoftwareSubmit(formData) |
| | | .then((res) => { |
| | | let { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.uploadShow = true; |
| | | if (code) { |
| | | this.uploadShow = false; |
| | | this.$message.success(msg); |
| | | } else { |
| | | this.$message.error(msg); |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | if (-1 != n && !this._inactive) { |
| | | const bar = document.querySelectorAll(".header-bar")[0].clientHeight; |
| | | const workPlaceTop = document.querySelectorAll(".work-place-top")[0].clientHeight; |
| | | this.y = this.minHeight-bar-workPlaceTop-56; |