| | |
| | | //this.WSClose2(); |
| | | setTimeout(() => { |
| | | this.$router.push("/login"); |
| | | location.reload(); |
| | | // location.reload(); |
| | | }, 2000); |
| | | } |
| | | }, |
| | |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | </template> |
| | | <template v-if="canLockOther"> |
| | | <template v-if="canLockOther && (id || productId)"> |
| | | <a-divider v-if="!record.lockFlag" type="vertical"></a-divider> |
| | | <a @click="lock(record)">{{ record.lockFlag ? "解锁" : "锁定" }}</a> |
| | | </template> |
| | |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import { updateAttachLock } from "@/pages/resourceManage/materialsCenter/apis"; |
| | | import { updateProductLock } from "@/pages/resourceManage/product/details/apis"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | }, |
| | | lock(obj) { |
| | | this.currObj = obj; |
| | | this.reason = ''; |
| | | this.reason = ""; |
| | | this.reasonVisible = true; |
| | | }, |
| | | reasonCancel() { |
| | | this.reasonVisible = false; |
| | | }, |
| | | reasonOk() { |
| | | if (!this.id) { |
| | | this.$message.error("无效的物料ID"); |
| | | if (!this.id && !this.productId) { |
| | | this.$message.error("无效的ID"); |
| | | return false; |
| | | } |
| | | let obj = this.currObj; |
| | | let lockFlag = !obj.lockFlag * 1; |
| | | let isProd = !!this.productId; |
| | | let params = { |
| | | attachName: obj.fileName, |
| | | localReason: this.reason, |
| | | lockFlag, |
| | | materialId: this.id, |
| | | materialId: this.id ? this.id : undefined, |
| | | productId: this.productId ? this.productId : undefined |
| | | }; |
| | | updateAttachLock([params]).then((res) => { |
| | | let update = isProd ? updateProductLock : updateAttachLock; |
| | | update([params]).then((res) => { |
| | | const { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.$message.success('操作成功'); |
| | | this.$message.success("操作成功"); |
| | | obj.lockFlag = lockFlag; |
| | | obj.localReason = this.reason; |
| | | this.reasonVisible = false; |
| | | } else { |
| | | this.$message.error('操作失败'); |
| | | this.$message.error("操作失败"); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | id() { |
| | | return this.info ? this.info.id : 0; |
| | | }, |
| | | productId() { |
| | | return this.info ? this.info.productId : 0; |
| | | }, |
| | | attachLocks() { |
| | | return this.info ? this.info.attachLocks : []; |
| | | }, |
| | |
| | | <a-layout-footer> |
| | | <a-card> |
| | | <template v-if="dataSource.length"> |
| | | <a-popover title="" v-if="otherDoc.length"> |
| | | <!-- <a-popover title="" v-if="otherDoc.length" trigger="click"> |
| | | <div class="file-list" slot="content"> |
| | | <files-table :list="otherDoc"></files-table> |
| | | <files-table :list="otherDoc" :info="info"></files-table> |
| | | </div> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> |
| | | </a-popover> --> |
| | | <a-button v-if="otherDoc.length" type="primary" @click="showOtherDoc">其他附件</a-button> |
| | | </template> |
| | | </a-card> |
| | | </a-layout-footer> |
| | | </a-layout> |
| | | <!-- 其他附件列表弹窗 --> |
| | | <a-modal |
| | | :visible="otherDocVisible" |
| | | title="其他附件" |
| | | :destroyOnClose="true" |
| | | :width="600" |
| | | :footer="null" |
| | | @cancel="otherDocCancel" |
| | | > |
| | | <files-table :list="otherDoc" :info="info"></files-table> |
| | | </a-modal> |
| | | </a-layout> |
| | | </template> |
| | | |
| | |
| | | |
| | | data() { |
| | | return { |
| | | otherDocVisible: false, |
| | | diffShow: false, |
| | | diffData: [], |
| | | softwareDownloadShow: false, |
| | |
| | | let list = []; |
| | | let prods = []; |
| | | let otherDoc = []; |
| | | let attachLocks = []; |
| | | this.spinning = false; |
| | | if (code && data) { |
| | | list = data2; |
| | | prods = data2.products; |
| | | attachLocks = data2.attachLocks || []; |
| | | otherDoc = data3; |
| | | } |
| | | this.dataSource = prods; |
| | | this.record = list; |
| | | this.info = { attachLocks, id }; |
| | | this.otherDoc = otherDoc; |
| | | if (this.record.dwgUrl) { |
| | | this.otherDoc.unshift(this.record.dwgUrl); |
| | |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | showOtherDoc() { |
| | | this.getInfo(); |
| | | this.otherDocVisible = true; |
| | | }, |
| | | otherDocCancel() { |
| | | this.otherDocVisible = false; |
| | | }, |
| | | |
| | | }, |
| | | mounted() { |
| | | this.getVersions(); |
| | |
| | | const { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.$message.success(msg); |
| | | this.panelShow(this.currentObj); |
| | | this.fileUploadVisible = false; |
| | | } else { |
| | | this.$message.error(msg); |
| | |
| | | params: { preProductId, productId } |
| | | }) |
| | | } |
| | | /** |
| | | * 修改附件锁定状态 |
| | | * @returns |
| | | */ |
| | | export const updateProductLock = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "attachLock/updateProductLock", |
| | | data |
| | | }) |
| | | } |
| | |
| | | <template |
| | | v-if="record.softwares.length && canDownloadSoftware" |
| | | > |
| | | <a-divider v-if="record.dwgUrl" type="vertical"></a-divider> |
| | | <a-divider |
| | | v-if="record.dwgUrl" |
| | | type="vertical" |
| | | ></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | | <div class="" slot="content" style="width: 450px"> |
| | | <a-table |
| | |
| | | <a-layout-footer> |
| | | <a-card> |
| | | <template v-if="dataSource.length"> |
| | | <a-popover |
| | | <!-- <a-popover |
| | | title="" |
| | | v-if="otherDoc.length && currentVersion.enabled" |
| | | > |
| | | <files-table slot="content" :list="otherDoc"></files-table> |
| | | <div class="file-list" slot="content"> |
| | | <files-table :list="otherDoc"></files-table> |
| | | </div> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> |
| | | </a-popover> --> |
| | | <a-button |
| | | v-if="otherDoc.length && currentVersion.enabled" |
| | | type="primary" |
| | | @click="showOtherDoc" |
| | | >其他附件</a-button |
| | | > |
| | | <a-button |
| | | v-if="canDownloadBom && currentVersion.enabled" |
| | | type="primary" |
| | |
| | | /> |
| | | </a-form-model-item> |
| | | </a-modal> |
| | | <!-- 其他附件列表弹窗 --> |
| | | <a-modal |
| | | :visible="otherDocVisible" |
| | | title="其他附件" |
| | | :destroyOnClose="true" |
| | | :width="800" |
| | | :footer="null" |
| | | @cancel="otherDocCancel" |
| | | > |
| | | <files-table :list="otherDoc" :info="info"></files-table> |
| | | </a-modal> |
| | | </a-layout> |
| | | </template> |
| | | |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | otherDocVisible: false, |
| | | reasonVisible: false, |
| | | reason: '', |
| | | reason: "", |
| | | lastId: undefined, |
| | | diffShow: false, |
| | | diffData: [], |
| | |
| | | parentCode, |
| | | customCode, |
| | | }; |
| | | console.log("=====9=", data, JSON.stringify(data)); |
| | | // console.log("=====9=", data, JSON.stringify(data)); |
| | | this.SOCKET.send(JSON.stringify(data)); |
| | | }, |
| | | onWSMessage(res) { |
| | |
| | | this.currentVersion = obj; |
| | | this.getInfo(); |
| | | }, |
| | | getInfo() { |
| | | getInfo(force) { |
| | | const { |
| | | currentVersion: { id, version }, |
| | | info, |
| | | lastId, |
| | | } = this; |
| | | if (id == lastId) { |
| | | if (id == lastId && !force) { |
| | | return false; |
| | | } |
| | | this.lastId = id; |
| | |
| | | let list = []; |
| | | let softwareList = []; |
| | | let otherDoc = []; |
| | | let attachLocks = []; |
| | | this.spinning = false; |
| | | if (code && data) { |
| | | list = data2.map((v) => { |
| | |
| | | return v; |
| | | }); |
| | | softwareList = data3; |
| | | otherDoc = data4; |
| | | otherDoc = data4.files || []; |
| | | attachLocks = data4.attachLocks || []; |
| | | } |
| | | this.dataSource = list; |
| | | this.softwareList = softwareList; |
| | | this.otherDoc = otherDoc; |
| | | this.info = { attachLocks, productId: id }; |
| | | if (-1 == this.update) { |
| | | this.update = Math.random(); |
| | | } |
| | |
| | | }, |
| | | reasonOk() { |
| | | let { |
| | | currentVersion: { customCode, parentCode, enabled, version, versionTime }, |
| | | reason |
| | | currentVersion: { |
| | | customCode, |
| | | parentCode, |
| | | enabled, |
| | | version, |
| | | versionTime, |
| | | }, |
| | | reason, |
| | | } = this; |
| | | enabled = !enabled * 1; |
| | | setpHistoryEnable({ customCode, parentCode, enabled, version, reason, versionTime }).then( |
| | | (res) => { |
| | | let { code, data } = res.data; |
| | | if (code && data) { |
| | | this.$message.success("操作成功"); |
| | | this.currentVersion.enabled = enabled; |
| | | this.reasonVisible = false; |
| | | } else { |
| | | this.$message.error("操作失败"); |
| | | } |
| | | setpHistoryEnable({ |
| | | customCode, |
| | | parentCode, |
| | | enabled, |
| | | version, |
| | | reason, |
| | | versionTime, |
| | | }).then((res) => { |
| | | let { code, data } = res.data; |
| | | if (code && data) { |
| | | this.$message.success("操作成功"); |
| | | this.currentVersion.enabled = enabled; |
| | | this.reasonVisible = false; |
| | | } else { |
| | | this.$message.error("操作失败"); |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | }, |
| | | showOtherDoc() { |
| | | this.getInfo(1); |
| | | this.otherDocVisible = true; |
| | | }, |
| | | otherDocCancel() { |
| | | this.otherDocVisible = false; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.sendMessage(); |
| | |
| | | background: #ffbcc9; |
| | | } |
| | | } |
| | | .file-list { |
| | | width: 600px; |
| | | } |
| | | </style> |