| | |
| | | params: { oprateInfo, type }, |
| | | }); |
| | | }; |
| | | /** |
| | | * //根据物料id查询dwg历史 |
| | | * @returns |
| | | */ |
| | | export const getDwgHisById = (materialId, pageCurr, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "materialHistory/getDwgHisById", |
| | | params: { materialId, pageCurr, pageSize }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 根据物料id查询pic历史 目前用不上 |
| | | * @returns |
| | | */ |
| | | export const getPicHisById = (materialId, pageCurr, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "materialHistory/getPicHisById", |
| | | params: { materialId, pageCurr, pageSize }, |
| | | }); |
| | | }; |
| | |
| | | > |
| | | <template slot="action" slot-scope="text, record"> |
| | | <div v-if="record.url"> |
| | | <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 |
| | | 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="downloadReason(record)">下载</a> |
| | | </template> |
| | | <template v-if="canLockOther && (id || productId)"> |
| | | <a-divider v-if="!record.lockFlag" type="vertical"></a-divider> |
| | | <a @click="lock(record)">{{ record.lockFlag ? "解锁" : "锁定" }}</a> |
| | | </template> |
| | | <template v-if="isOwnerDwg(record)"> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="history(record)">历史</a> |
| | | </template> |
| | | </div> |
| | | </template> |
| | |
| | | /> |
| | | </a-form-model-item> |
| | | </a-modal> |
| | | <download-reason :reason-visible.sync="downloadReasonVisible" v-if="downloadReasonVisible" @ok="downloadReasonOk"></download-reason> |
| | | <download-reason |
| | | :reason-visible.sync="downloadReasonVisible" |
| | | v-if="downloadReasonVisible" |
| | | @ok="downloadReasonOk" |
| | | ></download-reason> |
| | | <a-modal |
| | | :visible="dwgHisVisible" |
| | | title="物料图纸历史" |
| | | :width="860" |
| | | :destroyOnClose="true" |
| | | @cancel="dwgHisClose" |
| | | > |
| | | <a-table |
| | | ref="table" |
| | | :columns="dwgColumns" |
| | | :dataSource="dwgDataSource" |
| | | :scroll="{ x: 400, y1 }" |
| | | :row-key="(record, index) => index" |
| | | :pagination="{ |
| | | current: pageCurr, |
| | | pageSize: pageSize, |
| | | total: total, |
| | | showSizeChanger: true, |
| | | showLessItems: true, |
| | | showQuickJumper: true, |
| | | pageSizeOptions: ['10', '20', '50', '100'], |
| | | showTotal: (total, range) => |
| | | `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`, |
| | | onChange: onPageChange, |
| | | onShowSizeChange: onSizeChange, |
| | | }" |
| | | > |
| | | <template slot="action" slot-scope="text, record"> |
| | | <a @click="dwgReview(record.url)">预览</a> |
| | | </template> |
| | | </a-table> |
| | | <template v-slot:footer> |
| | | <a-button @click="dwgHisClose">关闭</a-button> |
| | | </template> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | // import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import { downLoadFileByFilePath } from "@/assets/js/apis"; |
| | | import { downLoadFileByFilePath, getDwgHisById } from "@/assets/js/apis"; |
| | | 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 DownloadReason from "@/pages/components/downloadReason"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | |
| | | return null; |
| | | }, |
| | | }, |
| | | subModel: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | // 类型 产品12 物料13 |
| | | type: { |
| | | type: Number, |
| | |
| | | }, |
| | | oprateVersion: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | default: 0, |
| | | }, |
| | | }, |
| | | data() { |
| | | const columns = [ |
| | |
| | | dataIndex: "operation", |
| | | key: "operation", |
| | | align: "center", |
| | | width: 200, |
| | | scopedSlots: { customRender: "action" }, |
| | | }, |
| | | ]; |
| | | const dwgColumns = [ |
| | | { |
| | | title: "文件名称", |
| | | dataIndex: "fileName", |
| | | align: "center", |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: "操作", |
| | | dataIndex: "operation", |
| | | key: "operation", |
| | | align: "center", |
| | | width: 140, |
| | | scopedSlots: { customRender: "action" }, |
| | | }, |
| | | ]; |
| | | return { |
| | | downloadUrl: '', |
| | | dwgHisVisible: false, |
| | | dwgColumns, |
| | | dwgDataSource: [], |
| | | pageCurr: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | y1: 400, |
| | | downloadUrl: "", |
| | | downloadReasonVisible: false, |
| | | reason: "", |
| | | reasonVisible: false, |
| | |
| | | handleCancel() { |
| | | this.previewVisible = false; |
| | | }, |
| | | dwgHisClose() { |
| | | this.dwgHisVisible = false; |
| | | }, |
| | | dwgReview(url) { |
| | | let loading = this.$layer.loading(); |
| | | dwgReview(url) |
| | |
| | | downloadLog(url, reason) { |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | let fileName = url.match(reg)[2]; |
| | | downLoadFileByFilePath(url, reason, this.info.oprateInfo, this.oprateVersion, this.type).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); |
| | |
| | | localReason: this.reason, |
| | | lockFlag, |
| | | materialId: this.id ? this.id : undefined, |
| | | productId: this.productId ? this.productId : undefined |
| | | productId: this.productId ? this.productId : undefined, |
| | | }; |
| | | let update = isProd ? updateProductLock : updateAttachLock; |
| | | update([params]).then((res) => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | isOwnerDwg(record) { |
| | | if (!this.subModel) { |
| | | return false; |
| | | } |
| | | let reg = new RegExp("^" + this.subModel, "i"); |
| | | return reg.test(record.fileName) && record.fileType == "dwg"; |
| | | }, |
| | | history(record) { |
| | | this.getList(); |
| | | this.dwgHisVisible = true; |
| | | }, |
| | | getList() { |
| | | getDwgHisById(this.id, this.pageCurr, this.pageSize) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | let total = 0; |
| | | if (code && data) { |
| | | // console.log(data); |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | list = data2.list.map((item) => { |
| | | let url = item.dwgUrl; |
| | | let fileName = url.match(reg)[2]; |
| | | return { |
| | | fileName, |
| | | url, |
| | | }; |
| | | }); |
| | | total = data2.total; |
| | | } |
| | | this.dwgDataSource = list; |
| | | this.total = total; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | onPageChange(page, pageSize) { |
| | | this.pageCurr = page; |
| | | this.pageSize = pageSize; |
| | | this.getList(); |
| | | }, |
| | | onSizeChange(current, size) { |
| | | this.pageCurr = 1; |
| | | this.pageSize = size; |
| | | this.getList(); |
| | | }, |
| | | }, |
| | | computed: { |
| | | dataSource() { |
New file |
| | |
| | | <template> |
| | | <a-card class="card"> |
| | | <div class="p-header"> |
| | | <a-form layout="horizontal" class="flex"> |
| | | <div class="form"> |
| | | <a-row> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item |
| | | label="起止日期" |
| | | :labelCol="{ span: 5 }" |
| | | :wrapperCol="{ span: 18, offset: 1 }" |
| | | > |
| | | <a-date-picker |
| | | v-model="startDate" |
| | | :allowClear="false" |
| | | :valueFormat="dateFormat" |
| | | :format="dateFormat" |
| | | />- |
| | | <a-date-picker |
| | | v-model="endDate" |
| | | :allowClear="false" |
| | | :valueFormat="dateFormat" |
| | | :format="dateFormat" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </div> |
| | | <span style="float: right; margin-top: 3px"> |
| | | <a-button type="primary" @click="getList">查询</a-button> |
| | | </span> |
| | | </a-form> |
| | | </div> |
| | | <div class="p-content" ref="wraper"> |
| | | <div class="p-inner"> |
| | | <a-table |
| | | ref="table" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :scroll="{ x: 400, y }" |
| | | row-key="id" |
| | | :pagination="{ |
| | | current: pageCurr, |
| | | pageSize: pageSize, |
| | | total: total, |
| | | showSizeChanger: true, |
| | | showLessItems: true, |
| | | showQuickJumper: true, |
| | | pageSizeOptions: ['10', '20', '50', '100'], |
| | | showTotal: (total, range) => |
| | | `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`, |
| | | onChange: onPageChange, |
| | | onShowSizeChange: onSizeChange, |
| | | }" |
| | | > |
| | | <template slot="dataIndex" slot-scope="{ index }"> |
| | | {{ index + 1 }} |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getUnlockByOwner } from "../product/apis"; |
| | | import moment from "moment"; |
| | | export default { |
| | | name: "", |
| | | |
| | | data() { |
| | | const columns = [ |
| | | { |
| | | title: "操作时间", |
| | | dataIndex: "createTime", |
| | | }, |
| | | { |
| | | title: "母料编码", |
| | | dataIndex: "parentCode", |
| | | }, |
| | | { |
| | | title: "定制单号", |
| | | dataIndex: "customCode", |
| | | }, |
| | | { |
| | | title: "版本时间", |
| | | dataIndex: "versionTime", |
| | | }, |
| | | { |
| | | title: "操作类型", |
| | | dataIndex: "lockType", |
| | | }, |
| | | { |
| | | title: "操作原因", |
| | | dataIndex: "reason", |
| | | }, |
| | | ]; |
| | | const dateFormat='YYYY-MM-DD'; |
| | | return { |
| | | dateFormat, |
| | | startDate: moment().subtract(30, 'days').format(dateFormat), |
| | | endDate: moment().format(dateFormat), |
| | | update: -1, |
| | | pageCurr: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | y: 400, |
| | | dataSource: [], |
| | | columns, |
| | | }; |
| | | }, |
| | | components: {}, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n && !this._inactive) { |
| | | this.$nextTick(() => { |
| | | const header = document.querySelectorAll( |
| | | ".doc-center-table .ant-table-header" |
| | | )[0].clientHeight; |
| | | const wraper = this.$refs.wraper.clientHeight; |
| | | const h = wraper - header - 64; |
| | | console.log(h, "h",wraper, header ); |
| | | this.y = h; |
| | | }); |
| | | } |
| | | }, |
| | | affixed() { |
| | | setTimeout(() => { |
| | | this.update = Math.random(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | | methods: { |
| | | moment, |
| | | getList() { |
| | | getUnlockByOwner(this.startDate + " 00:00:00", this.endDate + " 00:00:00", this.pageCurr, this.pageSize) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | let total = 0; |
| | | if (code && data) { |
| | | console.log(data); |
| | | list = data2.list.map((v) => { |
| | | v.lockType = v.lockFlag ? "锁定" : "解锁"; |
| | | return v; |
| | | }); |
| | | total = data2.total; |
| | | } |
| | | this.dataSource = list; |
| | | this.total = total; |
| | | if (-1 == this.update) { |
| | | this.update = Math.random(); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | onPageChange(page, pageSize) { |
| | | this.pageCurr = page; |
| | | this.pageSize = pageSize; |
| | | this.getList(); |
| | | }, |
| | | onSizeChange(current, size) { |
| | | this.pageCurr = 1; |
| | | this.pageSize = size; |
| | | this.getList(); |
| | | }, |
| | | resize() { |
| | | setTimeout(() => { |
| | | this.update = Math.random(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | | |
| | | mounted() { |
| | | this.getList(); |
| | | window.addEventListener("resize", this.resize); |
| | | }, |
| | | destroyed() { |
| | | window.removeEventListener("resize", this.resize); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .flex { |
| | | display: flex; |
| | | } |
| | | .form { |
| | | flex: 1; |
| | | } |
| | | .card { |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .card /deep/ .ant-card-body { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .p-content { |
| | | flex: 1; |
| | | position: relative; |
| | | } |
| | | .p-inner { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | } |
| | | /deep/ .ant-table-wrapper { |
| | | height: 100%; |
| | | } |
| | | </style> |
| | |
| | | :visible="otherDocVisible" |
| | | title="其他附件" |
| | | :destroyOnClose="true" |
| | | :width="600" |
| | | :width="850" |
| | | :footer="null" |
| | | @cancel="otherDocCancel" |
| | | > |
| | |
| | | |
| | | data() { |
| | | return { |
| | | oprateInfo: '', |
| | | oprateInfo: "", |
| | | downloadlogVisible: false, |
| | | fullScreen: false, |
| | | diffVisible: false, |
| | |
| | | list = data2; |
| | | prods = data2.products; |
| | | attachLocks = data2.attachLocks || []; |
| | | otherDoc = data3; |
| | | let subModel = data2.subModel; |
| | | let reg = new RegExp("^" + subModel, "i"); |
| | | let reg2 = /(.*\\+)*(.*)$/; |
| | | otherDoc = data3.filter((v) => { |
| | | let fileName = v.match(reg2)[2]; |
| | | let arr = fileName.split("."); |
| | | let fileType = arr.length ? arr[arr.length - 1].toLowerCase() : ""; |
| | | return !(reg.test(fileName) && fileType == "dwg"); |
| | | }); |
| | | } |
| | | this.dataSource = prods; |
| | | this.record = list; |
| | |
| | | }, |
| | | downloadLogs() { |
| | | // console.log(this.record); |
| | | let { |
| | | id, |
| | | } = this.record; |
| | | let { id } = this.record; |
| | | this.oprateInfo = id; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | |
| | | :footer="null" |
| | | @cancel="fileListCancel" |
| | | > |
| | | <files-table :list="fileList" :info="info" :type="13"></files-table> |
| | | <files-table |
| | | :list="fileList" |
| | | :info="info" |
| | | :sub-model="currentObj.subModel" |
| | | :type="13" |
| | | ></files-table> |
| | | <div class="footer"> |
| | | <a-space> |
| | | <a-button @click="fileListCancel">关闭</a-button> |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | oprateInfo: '', |
| | | oprateInfo: "", |
| | | downloadlogVisible: false, |
| | | errorVisible: false, |
| | | errorTbl2: { |
| | |
| | | title: "问题描述", |
| | | dataIndex: "irregularDesc", |
| | | align: "center", |
| | | } |
| | | }, |
| | | ], |
| | | dataSource: [], |
| | | }, |
| | |
| | | fileList: [], |
| | | resShow: false, |
| | | submitShow: false, |
| | | currentObj: null, |
| | | currentObj: {}, |
| | | title: "", |
| | | resList: [], |
| | | // 是否为新增关联 false表示为删除关联 |
| | |
| | | methods: { |
| | | downloadLogs(record) { |
| | | // console.log(record); |
| | | let { |
| | | id, |
| | | } = record; |
| | | let { id } = record; |
| | | this.oprateInfo = id; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | |
| | | subCode, |
| | | subModel, |
| | | }; |
| | | |
| | | let dwgFileName = subModel.toLowerCase() + ".dwg"; |
| | | formData.append("materialStr", JSON.stringify(obj)); |
| | | this.uploadFileList.forEach((v, i) => { |
| | | formData.append("file", v.originFileObj); |
| | | }); |
| | | if ( |
| | | this.uploadType == "normal" && |
| | | this.uploadFileList.some((v) => v.name.toLowerCase() == dwgFileName) |
| | | ) { |
| | | this.$message.error("所选附件类型不匹配"); |
| | | this.$layer.close(loading); |
| | | return false; |
| | | } |
| | | if ( |
| | | this.uploadType == "dwg" && |
| | | this.uploadFileList.some((v) => v.name.toLowerCase() != dwgFileName) |
| | | ) { |
| | | this.$message.error("所选附件类型不匹配"); |
| | | this.$layer.close(loading); |
| | | return false; |
| | | } |
| | | let upload = this.uploadType != "normal" ? picOrDwg : uploadOthers; |
| | | upload(formData) |
| | | .then((res) => { |
| | |
| | | this.resize(); |
| | | }, |
| | | panelShow(obj) { |
| | | const { id, dwgUrl, attachLocks } = obj; |
| | | const { id, dwgUrl, attachLocks, subModel } = obj; |
| | | this.currentObj = obj; |
| | | let reg = new RegExp("^" + subModel, "i"); |
| | | let reg2 = /(.*\\+)*(.*)$/; |
| | | getFileList(id).then((res) => { |
| | | const { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | list = data2; |
| | | list = data2.filter((v) => { |
| | | let fileName = v.match(reg2)[2]; |
| | | let arr = fileName.split("."); |
| | | let fileType = arr.length ? arr[arr.length - 1].toLowerCase() : ""; |
| | | return !(reg.test(fileName) && fileType == "dwg"); |
| | | }); |
| | | } |
| | | if (dwgUrl) { |
| | | list.unshift(dwgUrl); |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getAllProduct", |
| | | params: { pageCurr, pageSize, ...data } |
| | | }) |
| | | } |
| | | params: { pageCurr, pageSize, ...data }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品列表 不分页 |
| | | * @returns |
| | |
| | | export const getAllProducts = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getUpBomUseProduct" |
| | | }) |
| | | } |
| | | url: "product/getUpBomUseProduct", |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品下载(产品id和版本<当前最新版本>) |
| | | * @returns |
| | |
| | | method: "GET", |
| | | url: "product/downloadProduct", |
| | | params: { productId, version, oprateReason, oprateInfo }, |
| | | responseType: "blob" |
| | | }) |
| | | } |
| | | responseType: "blob", |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 根据母料型号查询子件信息及有关联的散装件信息 |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getBomAndMaterial", |
| | | params: { productId, version } |
| | | }) |
| | | } |
| | | params: { productId, version }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 批量修改关联关系 |
| | |
| | | return axios({ |
| | | method: "POST", |
| | | url: "worksheetMain/materialRelatedSubmit", |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * 上传产品 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "POST", |
| | | url: "product", |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品指定版本的激活 锁定 |
| | | * customCode=1&enabled=1&parentCode=1&version=1 |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/setpHistoryEnable", |
| | | params |
| | | }) |
| | | } |
| | | params, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品操作日志查询 |
| | | * customCode=1&parentCode=1 |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "productLockLog/listByParentCodeAndCustomCode", |
| | | params |
| | | }) |
| | | } |
| | | params, |
| | | }); |
| | | }; |
| | | /** |
| | | * 根据产品id查询被锁定的物料dwg和产品丝印 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getLockedByProductId", |
| | | params: { productId } |
| | | }) |
| | | } |
| | | params: { productId }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询当前使用的所有的产品 不分页 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getCompareProduct", |
| | | }) |
| | | } |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询当前使用的所有的产品 不分页 (过滤掉锁定的) |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getFkProduct", |
| | | }) |
| | | } |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询用户的解锁操作 |
| | | * @returns |
| | | */ |
| | | export const getUnlockByOwner = ( |
| | | createTime, |
| | | createTime1, |
| | | pageCurr, |
| | | pageSize |
| | | ) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "productLockLog/getUnlockByOwner", |
| | | params: { |
| | | createTime, |
| | | createTime1, |
| | | pageCurr, |
| | | pageSize, |
| | | }, |
| | | }); |
| | | }; |
| | |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * //验证母料编码是否存在产品中 |
| | | * @returns |
| | | */ |
| | | export const checkExist = (parentCode, customCode) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/judgeParentCode", |
| | | params: { parentCode, customCode }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品查看原来压缩包中文件信息(文件目录和时间) |
| | | * @returns |
| | | */ |
| | | export const getzipAndRarInfo = (fileUrl) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "zipAndRar/getzipAndRarInfo", |
| | | params: { fileUrl }, |
| | | }); |
| | | }; |
| | |
| | | >详情</a |
| | | > |
| | | </template> |
| | | <template v-if="/^08|^09/.test(record.subCode)"> |
| | | <a-divider |
| | | v-if=" |
| | | record.softwares && |
| | | record.softwares.length && |
| | | canDownloadSoftware |
| | | " |
| | | type="vertical" |
| | | ></a-divider> |
| | | <a href="javascript:;" @click="toDetails08_09(record)" |
| | | >详情</a |
| | | > |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </a-spin> |
| | |
| | | type="primary" |
| | | @click="checkLock('OriginalZipDownload')" |
| | | >下载原始包</a-button |
| | | > |
| | | <a-button |
| | | v-if="isTester && originalZipUrl" |
| | | type="primary" |
| | | @click="viewRar" |
| | | >查看原始包</a-button |
| | | > |
| | | <a-button |
| | | type="primary" |
| | |
| | | <div> |
| | | <span class="user">{{ item.owner }}</span> 在 |
| | | <span class="time">{{ item.createTime }}</span> |
| | | {{ {"-1": "上传", "0": "激活", "1": "锁定"}[item.lockFlag] }}了版本 |
| | | {{ |
| | | { "-1": "上传", "0": "激活", "1": "锁定" }[item.lockFlag] |
| | | }}了版本 |
| | | <span class="version">{{ item.versionTime }}</span> |
| | | </div> |
| | | <div>操作原因: {{ item.reason ? item.reason : "无" }}</div> |
| | |
| | | :type="12" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | <a-modal |
| | | :visible="fileTreeVisible" |
| | | :footer="null" |
| | | :width="860" |
| | | title="文件列表" |
| | | :destroyOnClose="true" |
| | | @cancel="fileTreeVisible = false" |
| | | > |
| | | <div class="log-content"> |
| | | <a-tree |
| | | v-if="fileTree.length" |
| | | :show-line="true" |
| | | defaultExpandAll |
| | | :tree-data="fileTree" |
| | | /> |
| | | <a-empty v-else /> |
| | | </div> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getBomHistoryAndMaterial, |
| | | compare, |
| | | getOriginalZip, |
| | | checkExist, |
| | | getzipAndRarInfo, |
| | | } from "./apis"; |
| | | import { |
| | | searchDefaultMailUser, |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | fileTreeVisible: false, |
| | | fileTree: [], |
| | | userListAll: [], |
| | | mailList: [], |
| | | tester: [], |
| | |
| | | if (/^0120/.test(record.subCode)) { |
| | | classList.push("is-0120"); |
| | | } |
| | | // 08 09 开头的半成品 |
| | | if (/^08|^09/.test(record.subCode)) { |
| | | classList.push("is-08_09"); |
| | | } |
| | | return classList; |
| | | }, |
| | | toDetails0120(record) { |
| | |
| | | this.$router.push({ |
| | | path: "/resource/product-details-0120", |
| | | query: { parentCode, customCode: "", parentModel, parentName }, |
| | | }); |
| | | }, |
| | | toDetails08_09(record) { |
| | | const { |
| | | subCode: parentCode, |
| | | subModel: parentModel, |
| | | subName: parentName, |
| | | } = record; |
| | | checkExist(parentCode, "") |
| | | .then((res) => { |
| | | let { code, data } = res.data; |
| | | if (code && data) { |
| | | this.$router.push({ |
| | | path: "/resource/product-details-0809", |
| | | query: { parentCode, customCode: "", parentModel, parentName }, |
| | | }); |
| | | // console.log(data); |
| | | } else { |
| | | this.$message.error("产品未上传"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | getParent(obj, arr, i) { |
| | | let len = arr.length - 1; |
| | | if (i > len) { |
| | | return false; |
| | | } |
| | | // if (i == 0) { |
| | | // return obj; |
| | | // } |
| | | // if (i == 1) { |
| | | // return obj[arr[0]]; |
| | | // } |
| | | let res = obj; |
| | | let tmp = {}; |
| | | for (let m = 1; m <= i; m++) { |
| | | // tmp[arr[m]] = {}; |
| | | // tmp = tmp[arr[m]]; |
| | | tmp = arr[m - 1]; |
| | | res = res[tmp]; |
| | | } |
| | | |
| | | return res; |
| | | }, |
| | | format(list) { |
| | | let counter = this.counter(); |
| | | let obj = { |
| | | counter, |
| | | key: "root", |
| | | children: [], |
| | | }; |
| | | // let root = { |
| | | // counter, |
| | | // key: "root", |
| | | // children: [], |
| | | // }; |
| | | list.forEach((v) => { |
| | | let url = v.fileName; |
| | | let fileTime = v.fileTime; |
| | | let arr = url.split("/"); |
| | | let fileName = arr.pop(); |
| | | let tmp = obj; |
| | | |
| | | for (let i = 0, len = arr.length; i < len; i++) { |
| | | let parent = this.getParent(obj, arr, i); |
| | | if (!tmp[arr[i]]) { |
| | | tmp[arr[i]] = { |
| | | parent, |
| | | title: arr[i], |
| | | key: parent.key + "-" + parent.counter(), |
| | | children: [], |
| | | counter: this.counter(), |
| | | }; |
| | | // tmp[arr[i]].parent.children.push(tmp[arr[i]]); |
| | | parent.children.push(tmp[arr[i]]); |
| | | } |
| | | tmp = tmp[arr[i]]; |
| | | } |
| | | // console.log(tmp.children, 'children') |
| | | tmp.children.push({ |
| | | fileName, |
| | | fileTime, |
| | | key: tmp.key + "-" + tmp.counter(), |
| | | title: fileName + " " + fileTime, |
| | | isLeaf: true, |
| | | }); |
| | | // console.log(obj, '......') |
| | | // for (let i = 0, len = arr.length; i < len; i++) { |
| | | // // 判断有没有父级 i为0没有 i为大于1就有 |
| | | // let parent = i > 0 ? tmp[arr[i - 1]] : root; |
| | | // if (!obj[item]) { |
| | | // obj[item] = { |
| | | // title: item, |
| | | // key: parent.key + "-" + parent.counter(), |
| | | // children: [], |
| | | // counter: this.counter(), |
| | | // }; |
| | | // } |
| | | // } |
| | | }); |
| | | return obj; |
| | | }, |
| | | counter() { |
| | | let count = 0; |
| | | return () => { |
| | | return count++; |
| | | }; |
| | | }, |
| | | viewRar() { |
| | | let loading = this.$layer.loading(); |
| | | // console.log(this.originalZipUrl); |
| | | getzipAndRarInfo(this.originalZipUrl) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | console.log(data2); |
| | | list = this.format(data2); |
| | | } |
| | | this.$layer.close(loading); |
| | | this.fileTree = list.children; |
| | | this.fileTreeVisible = true; |
| | | // { title: 'Tree Node', key: '2', isLeaf: true }, |
| | | console.log(list, '===list'); |
| | | }) |
| | | .catch((err) => { |
| | | this.$layer.close(loading); |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | /deep/.ant-table-row-level-1.ant-table-row-level-1:hover > td { |
| | | background: #ffbcc9; |
| | | } |
| | | /deep/.is-08_09 > td, |
| | | /deep/.is-0120 > td { |
| | | background: #ffae00; |
| | | } |
| | | /deep/.is-08_09.is-08_09.ant-table-row-hover > td, |
| | | /deep/.is-08_09.is-08_09:hover > td, |
| | | /deep/.is-0120.is-0120.ant-table-row-hover > td, |
| | | /deep/.is-0120.is-0120:hover > td { |
| | | background: #f8c34f; |
| | |
| | | >新增</a-button |
| | | > |
| | | <a-button type="primary" @click="prodDiff">产品比较</a-button> |
| | | <a-button type="primary" @click="ownerDownloadLog" |
| | | >我的锁定记录</a-button |
| | | > |
| | | </a-space> |
| | | </template> |
| | | <template slot="enabled" slot-scope="{ record }"> |
| | |
| | | <div> |
| | | <span class="user">{{ item.owner }}</span> 在 |
| | | <span class="time">{{ item.createTime }}</span> |
| | | {{ {"-1": "上传", "0": "激活", "1": "锁定"}[item.lockFlag] }}了版本 |
| | | {{ |
| | | { "-1": "上传", "0": "激活", "1": "锁定" }[item.lockFlag] |
| | | }}了版本 |
| | | <span class="version">{{ item.versionTime }}</span> |
| | | </div> |
| | | <div>操作原因: {{ item.reason ? item.reason : "无" }}</div> |
| | |
| | | :type="12" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | <a-modal |
| | | :visible="ownerLogVisible" |
| | | title="我的下载记录" |
| | | width="100%" |
| | | :destroyOnClose="true" |
| | | @cancel="ownerLogClose" |
| | | wrapClassName="full-modal" |
| | | > |
| | | <owner-download></owner-download> |
| | | <template v-slot:footer> |
| | | <a-button @click="ownerLogClose">关闭</a-button> |
| | | </template> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import createWs from "@/assets/js/websocket"; |
| | | import DiffList from "@/pages/components/diffList"; |
| | | import FeedbackForm from "../components/feedbackForm.vue"; |
| | | import OwnerDownload from "../components/ownerDownload"; |
| | | const WSMixin = createWs("product"); |
| | | |
| | | export default { |
| | |
| | | }, |
| | | ]; |
| | | return { |
| | | ownerLogVisible: false, |
| | | reason: "", |
| | | reasonVisible: false, |
| | | oprateInfo: "", |
| | |
| | | FeedbackForm, |
| | | DownloadReason, |
| | | DownloadLogs, |
| | | OwnerDownload, |
| | | }, |
| | | methods: { |
| | | rowClassFn(record) { |
| | |
| | | this.oprateInfo = parentCode + "_" + customCode; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | | ownerDownloadLog() { |
| | | this.ownerLogVisible = true; |
| | | }, |
| | | ownerLogClose() { |
| | | this.ownerLogVisible = false; |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | |
| | | background: #fcd583; |
| | | } |
| | | </style> |
| | | |
| | | <style lang="less"> |
| | | .full-modal { |
| | | height: 100%; |
| | | .ant-modal { |
| | | max-width: 100%; |
| | | height: 100%; |
| | | top: 0; |
| | | padding-bottom: 0; |
| | | margin: 0; |
| | | } |
| | | .ant-modal-content { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | // height: calc(100vh); |
| | | } |
| | | .ant-modal-body { |
| | | flex: 1; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | // 08|09二级产品详情 |
| | | { |
| | | path: 'product-details-0809', |
| | | name: '二级产品详情', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | { |
| | | path: 'software', |
| | | name: '软件中心', |