| | |
| | | * @param {*} oprateInfo 物料就传id 产品传parentCode + "_" + customCode |
| | | * @param {*} oprateVersion 物料传0 产品传versionId |
| | | * @param {*} type 物料传13 产品传12 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const downLoadFileByFilePath = ( |
| | | filePath, |
| | |
| | | responseType: "blob", |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 查询下载日志 |
| | | * @param {*} oprateInfo 物料传Id 产品传parentCode + '_' + customCode |
| | | * @param {*} type 物料13 产品12 |
| | | * @returns |
| | | */ |
| | | export const getDownloadLog = (oprateInfo, type) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docLog/getDownLoadNew", |
| | | params: { oprateInfo, type }, |
| | | }); |
| | | }; |
New file |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="600" |
| | | :visible="visible" |
| | | title="下载记录" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | @cancel="cancel" |
| | | :footer="null" |
| | | > |
| | | <div class="log-content"> |
| | | <div class="loading" v-if="!ready">查询中<div class="dot">...</div></div> |
| | | <a-timeline v-else-if="logList.length"> |
| | | <a-timeline-item |
| | | v-for="(item, idx) in logList" |
| | | :key="'log_' + idx" |
| | | color="green" |
| | | > |
| | | <div> |
| | | <span class="user">{{ item.name }}</span> 在 |
| | | <span class="time">{{ item.oprateDay }}</span> |
| | | 下载了{{ item.oprateMsg }} 版本 |
| | | <span class="version">{{ item.oprateVersion }}</span> |
| | | </div> |
| | | <div>下载原因: {{ item.oprateReason }}</div> |
| | | </a-timeline-item> |
| | | </a-timeline> |
| | | <a-empty v-else /> |
| | | </div> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDownloadLog } from "@/assets/js/apis"; |
| | | export default { |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | required: true, |
| | | }, |
| | | oprateInfo: { |
| | | type: [String, Number], |
| | | required: true, |
| | | }, |
| | | type: { |
| | | type: Number, |
| | | required: true, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | ready: false, |
| | | logList: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | | cancel() { |
| | | this.$emit("update:visible", false); |
| | | }, |
| | | getDownloadLog() { |
| | | getDownloadLog(this.oprateInfo, this.type) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | list = data2; |
| | | } |
| | | this.logList = list; |
| | | // console.log(list, "=="); |
| | | this.ready = true; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | this.ready = true; |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getDownloadLog(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .log-content { |
| | | max-height: 400px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .user { |
| | | color: #23aaf2; |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .time { |
| | | color: #f9be13; |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .version { |
| | | color: #0aedb2; |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .ant-timeline-item:first-of-type { |
| | | padding-top: 6px; |
| | | } |
| | | .dot { |
| | | font-size: 32px; |
| | | transform: translateY(-.2em); |
| | | color: green; |
| | | display: inline-block; |
| | | height: 1em; |
| | | line-height: 1; |
| | | text-align: left; |
| | | vertical-align: -0.25em; |
| | | overflow: hidden; |
| | | } |
| | | .dot::before { |
| | | display: block; |
| | | content: "...\A..\A.\A"; |
| | | white-space: pre-wrap; /* 也可以是white-space: pre */ |
| | | animation: dot 3s infinite step-start both; |
| | | } |
| | | @keyframes dot { |
| | | 20% { |
| | | transform: translateY(-3em); |
| | | } |
| | | 50% { |
| | | transform: translateY(-2em); |
| | | } |
| | | 80% { |
| | | transform: translateY(-1em); |
| | | } |
| | | } |
| | | </style> |
| | |
| | | >其他附件</a-button |
| | | > |
| | | </template> |
| | | <a-button type="primary" @click="downloadLogs">下载日志</a-button> |
| | | </a-card> |
| | | </a-layout-footer> |
| | | </a-layout> |
| | |
| | | </div> |
| | | </div> |
| | | </a-modal> |
| | | <download-logs |
| | | :visible.sync="downloadlogVisible" |
| | | v-if="downloadlogVisible" |
| | | :type="13" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import ImageView from "@/pages/components/ImageView"; |
| | | import FilesTable from "@/pages/components/filesTable"; |
| | | import DiffList from "@/pages/components/diffList"; |
| | | import DownloadLogs from "@/pages/components/downloadLogs"; |
| | | |
| | | import List from "./list"; |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | |
| | | |
| | | data() { |
| | | return { |
| | | oprateInfo: '', |
| | | downloadlogVisible: false, |
| | | fullScreen: false, |
| | | diffVisible: false, |
| | | diffImg: "", |
| | |
| | | ImageView, |
| | | FilesTable, |
| | | DiffList, |
| | | DownloadLogs, |
| | | }, |
| | | computed: {}, |
| | | watch: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | downloadLogs() { |
| | | // console.log(this.record); |
| | | let { |
| | | id, |
| | | } = this.record; |
| | | this.oprateInfo = id; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getVersions(); |
| | |
| | | </div> |
| | | </template> |
| | | <template slot="action" slot-scope="{ record }"> |
| | | <a @click="downloadLogs(record)">下载日志</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="addLink(record)">增加关联</a> |
| | | <template v-if="record.mproductHistorys.length"> |
| | | <a-divider type="vertical"></a-divider> |
| | |
| | | rowKey="num" |
| | | ></a-table> |
| | | </a-modal> |
| | | <download-logs |
| | | :visible.sync="downloadlogVisible" |
| | | v-if="downloadlogVisible" |
| | | :type="13" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import EditLink from "./editLink"; |
| | | import SubmitForm from "./SubmitForm"; |
| | | import FilesTable from "@/pages/components/filesTable"; |
| | | import DownloadLogs from "@/pages/components/downloadLogs"; |
| | | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | oprateInfo: '', |
| | | downloadlogVisible: false, |
| | | errorVisible: false, |
| | | errorTbl2: { |
| | | columns: [ |
| | |
| | | PartsUpload, |
| | | SubmitForm, |
| | | FilesTable, |
| | | DownloadLogs, |
| | | }, |
| | | methods: { |
| | | downloadLogs(record) { |
| | | console.log(record); |
| | | let { |
| | | id, |
| | | } = record; |
| | | this.oprateInfo = id; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | | onSearch(conditions, searchOptions) { |
| | | // console.log(conditions); |
| | | // console.log(searchOptions); |
| | |
| | | * 产品下载(产品id和版本<当前最新版本>) |
| | | * @returns |
| | | */ |
| | | export const downloadBom = (productId, version) => { |
| | | export const downloadBom = (productId, version, oprateReason, oprateInfo) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/downloadProduct", |
| | | params: { productId, version }, |
| | | params: { productId, version, oprateReason, oprateInfo }, |
| | | responseType: "blob" |
| | | }) |
| | | } |
| | |
| | | |
| | | /** |
| | | * 产品版本信息 列表 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getVersions = (parentCode, customCode) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getProductVersion", |
| | | params: { parentCode, customCode } |
| | | }) |
| | | } |
| | | params: { parentCode, customCode }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品指定版本详情 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getInfo = (parentCode, version) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "productBomHistory/getBoomByVersion", |
| | | params: { parentCode, version } |
| | | }) |
| | | } |
| | | params: { parentCode, version }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 下载指定版本的产品 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const zipDownload = (productId, version) => { |
| | | export const zipDownload = (productId, version, oprateReason, oprateInfo) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/downloadProductHistory", |
| | | params: { productId, version }, |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | params: { productId, version, oprateReason, oprateInfo }, |
| | | responseType: "blob", |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 下载原始压缩包文件 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getOriginalZip = (parentModel, customCode, version) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getOriginalZip", |
| | | params: { parentModel, customCode, version } |
| | | }) |
| | | } |
| | | params: { parentModel, customCode, version }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 产品指定版本详情 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getBomHistoryAndMaterial = (productId, version) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getBomHistoryAndMaterial", |
| | | params: { productId, version } |
| | | }) |
| | | } |
| | | params: { productId, version }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 产品指定版本 对比 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const compare = (preProductId, productId) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "productBomHistory/compare", |
| | | params: { preProductId, productId } |
| | | }) |
| | | } |
| | | params: { preProductId, productId }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 修改附件锁定状态 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "POST", |
| | | url: "attachLock/updateProductLock", |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | |
| | | v-if="canViewDoc && canDownloadDoc" |
| | | type="vertical" |
| | | ></a-divider> |
| | | <a v-if="canDownloadDoc" @click="showReason('downloadLog', record)" |
| | | <a |
| | | v-if="canDownloadDoc" |
| | | @click="showReason('downloadLog', record)" |
| | | >下载</a |
| | | > |
| | | </div> |
| | |
| | | </div> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> --> |
| | | <a-button type="primary" @click="viewLog">日志</a-button> |
| | | <a-button type="primary" @click="viewLog">状态日志</a-button> |
| | | <a-button type="primary" @click="downloadLogs">下载日志</a-button> |
| | | <a-button |
| | | v-if="otherDoc.length && currentVersion.enabled" |
| | | type="primary" |
| | |
| | | >其他附件</a-button |
| | | > |
| | | <a-button |
| | | v-if="canDownloadBom && currentVersion.enabled" |
| | | v-if="(canDownloadBom && currentVersion.enabled) || isTester" |
| | | type="primary" |
| | | @click="checkLock('zipDownload')" |
| | | >bom下载</a-button |
| | | > |
| | | <a-button |
| | | v-if="canDownloadBom && currentVersion.enabled && originalZipUrl" |
| | | v-if=" |
| | | ((canDownloadBom && currentVersion.enabled) || isTester) && |
| | | originalZipUrl |
| | | " |
| | | type="primary" |
| | | @click="checkLock('OriginalZipDownload')" |
| | | >下载原始包</a-button |
| | |
| | | <a-button |
| | | type="primary" |
| | | v-if=" |
| | | !currentVersion.enabled && |
| | | currentVersion.enabled == 0 && |
| | | canLockBom && |
| | | (!is0120 || maxVersionid == currentVersion.id) |
| | | " |
| | |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | v-if=" |
| | | currentVersion.enabled && |
| | | canLockBom |
| | | " |
| | | v-if="currentVersion.enabled == -1 && isTester" |
| | | @click="changeStatus" |
| | | >解锁版本</a-button |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | v-if="currentVersion.enabled == 1 && canLockBom" |
| | | @click="changeStatus" |
| | | >锁定版本</a-button |
| | | > |
| | |
| | | :footer="null" |
| | | @cancel="otherDocCancel" |
| | | > |
| | | <files-table :list="otherDoc" :info="info" :type="12" :oprate-version="currentVersion.version"></files-table> |
| | | <files-table |
| | | :list="otherDoc" |
| | | :info="info" |
| | | :type="12" |
| | | :oprate-version="currentVersion.version" |
| | | ></files-table> |
| | | </a-modal> |
| | | <!-- 锁定清单 --> |
| | | <a-modal |
| | |
| | | <a-empty v-else /> |
| | | </div> |
| | | </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> |
| | | <download-logs |
| | | :visible.sync="downloadlogVisible" |
| | | v-if="downloadlogVisible" |
| | | :type="12" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import Pop from "../../software/pop"; |
| | | import offset from "@/assets/js/tools/offset"; |
| | | |
| | | import DownloadReason from '@/pages/components/downloadReason'; |
| | | import DownloadReason from "@/pages/components/downloadReason"; |
| | | import DownloadLogs from "@/pages/components/downloadLogs"; |
| | | |
| | | import List from "./list"; |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | |
| | | compare, |
| | | getOriginalZip, |
| | | } from "./apis"; |
| | | import { |
| | | searchDefaultMailUser, |
| | | sendMail, |
| | | } from "../../../components/emailCard/apis"; |
| | | import { getUserList } from "../../../permission/apis"; |
| | | import { getRoleUser } from "@/pages/user/apis"; |
| | | import { setpHistoryEnable, getLockedList, getLogList } from "../apis"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downLoadFileByFilePath } from "@/assets/js/apis"; |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | userListAll: [], |
| | | mailList: [], |
| | | tester: [], |
| | | oprateInfo: "", |
| | | downloadlogVisible: false, |
| | | downloadReasonVisible: false, |
| | | popVisible: false, |
| | | popPosition: { |
| | |
| | | { |
| | | title: "生产商", |
| | | dataIndex: "producer", |
| | | key: "producer", |
| | | align: "center", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: "厂家规格", |
| | | dataIndex: "producerSpecification", |
| | | key: "producer", |
| | | align: "center", |
| | | width: 80, |
| | | }, |
| | |
| | | DiffList, |
| | | Pop, |
| | | DownloadReason, |
| | | DownloadLogs, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("setting", ["affixed"]), |
| | | ...mapGetters("account", ["permits"]), |
| | | ...mapGetters("account", ["permits", "user"]), |
| | | canDownloadSoftware() { |
| | | return checkPermit(PERMITS.downloadSoftware, this.permits); |
| | | }, |
| | |
| | | }, |
| | | is0120() { |
| | | return /^0120/.test(this.parentCode); |
| | | }, |
| | | isTester() { |
| | | return this.tester.some((v) => v == this.user.name); |
| | | }, |
| | | // 有状态为-1的版本在 |
| | | hasLock() { |
| | | return this.versionList.some((v) => v.enabled == -1); |
| | | }, |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | getRoleUser() { |
| | | getRoleUser(1) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | console.log(data); |
| | | list = data2.map((v) => v.name); |
| | | } |
| | | this.tester = list; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | downloadLogs() { |
| | | let { customCode, parentCode } = this; |
| | | this.oprateInfo = parentCode + "_" + customCode; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | | customCell(record) { |
| | | return { |
| | | on: { |
| | |
| | | softwareList = data3; |
| | | otherDoc = data4.files || []; |
| | | attachLocks = data4.attachLocks || []; |
| | | let { |
| | | parentCode, |
| | | customCode |
| | | } = data2[0]; |
| | | let { parentCode, customCode } = data2[0]; |
| | | oprateInfo = parentCode + "_" + customCode; |
| | | } |
| | | this.dataSource = list; |
| | |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | let fileName = url.match(reg)[2]; |
| | | |
| | | downLoadFileByFilePath(url, reason, this.info.oprateInfo, this.currentVersion.version, 12).then((res) => { |
| | | downLoadFileByFilePath( |
| | | url, |
| | | reason, |
| | | this.info.oprateInfo, |
| | | this.currentVersion.version, |
| | | 12 |
| | | ).then((res) => { |
| | | let { data, status } = res; |
| | | if (200 == status && data) { |
| | | let url = window.URL.createObjectURL(data); |
| | |
| | | } else { |
| | | // 没有锁定 |
| | | // this.zipDownload(); |
| | | this[action](); |
| | | // this[action](); |
| | | this.showReasonDialog(); |
| | | } |
| | | } else { |
| | | this.$message.error("查询锁定清单出错"); |
| | |
| | | this.lockListVisible = false; |
| | | // this.zipDownload(); |
| | | // this[this.currentAction](); |
| | | this.downloadReasonVisible = true; |
| | | }, |
| | | showReasonDialog() { |
| | | // this.currentAction = action; |
| | | this.downloadReasonVisible = true; |
| | | }, |
| | | downloadReasonOk(reason) { |
| | |
| | | let url = this.originalZipUrl; |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | let fileName = url.match(reg)[2]; |
| | | downLoadFileByFilePath(url, reason, this.info.oprateInfo, this.currentVersion.version, 12).then((res) => { |
| | | downLoadFileByFilePath( |
| | | url, |
| | | reason, |
| | | this.info.oprateInfo, |
| | | this.currentVersion.version, |
| | | 12 |
| | | ).then((res) => { |
| | | let { data, status } = res; |
| | | if (200 == status && data) { |
| | | let url = window.URL.createObjectURL(data); |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // TODO |
| | | zipDownload(reason) { |
| | | // const { parentCode, currentVersion } = this; |
| | | const { |
| | | currentVersion: { id, version }, |
| | | } = this; |
| | | let loading = this.$layer.loading(); |
| | | zipDownload(id, version).then((res) => { |
| | | zipDownload(id, version, reason, this.info.oprateInfo).then((res) => { |
| | | // console.log(res, "==========="); |
| | | let { headers, data, status } = res; |
| | | if (200 == status && data) { |
| | |
| | | this.diffShow = false; |
| | | }, |
| | | changeStatus() { |
| | | if (this.hasLock && this.currentVersion.enabled != -1) { |
| | | this.$message.error('存在新上传的版本未复核, 不能操作其他版本'); |
| | | return false; |
| | | } |
| | | this.reasonVisible = true; |
| | | }, |
| | | reasonCancel() { |
| | |
| | | currentVersion: { |
| | | customCode, |
| | | parentCode, |
| | | enabled, |
| | | enabled: lockFlagNow, |
| | | version, |
| | | versionTime, |
| | | }, |
| | | reason, |
| | | } = this; |
| | | enabled = !enabled * 1; |
| | | let enabled = lockFlagNow != 1 ? 1 : 0; |
| | | setpHistoryEnable({ |
| | | customCode, |
| | | parentCode, |
| | |
| | | if (code && data) { |
| | | this.$message.success("操作成功"); |
| | | this.currentVersion.enabled = enabled; |
| | | // 如果是测试人员解锁确认 则自动发送邮件 |
| | | if (lockFlagNow == -1 && this.isTester) { |
| | | this.sendEmail(); |
| | | } |
| | | this.reasonVisible = false; |
| | | } else { |
| | | this.$message.error("操作失败"); |
| | | } |
| | | }); |
| | | }, |
| | | sendEmail() { |
| | | let { title, content } = this.handleEmailShow(this.currentVersion, true); |
| | | let params = { mailList: this.mailList, title, content }; |
| | | sendMail(params); |
| | | }, |
| | | searchAllUserList() { |
| | | getUserList() |
| | | .then((res) => { |
| | | let rs = res.data; |
| | | if (rs.code && rs.data) { |
| | | this.userListAll = rs.data2; |
| | | this.searchDefaultMailUser(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | searchDefaultMailUser() { |
| | | // type为3 |
| | | let type = 3; |
| | | searchDefaultMailUser(type).then((res) => { |
| | | let rs = res.data; |
| | | let data = []; |
| | | if (rs.code === 1) { |
| | | data = rs.data.map((item) => { |
| | | return item.user; |
| | | }); |
| | | } |
| | | this.mailList = this.userListAll |
| | | .filter((o) => data.includes(o.name) && o.mail) |
| | | .map((item) => { |
| | | return item.mail; |
| | | }); |
| | | }); |
| | | }, |
| | | handleEmailShow(record, get) { |
| | | let title = |
| | | "[产品发布记录]" + record.parentName + " 版本:" + record.versionTime; |
| | | let content = []; |
| | | content.push("物料编码: " + record.parentCode); |
| | | content.push("物料名称: " + record.parentName); |
| | | content.push("规格型号: " + record.parentModel); |
| | | content.push("标准机型: " + (record.customCode ? "是" : "否")); |
| | | content.push("定制单号: " + (record.customCode || "无")); |
| | | content.push("版本时间: " + record.versionTime); |
| | | if (get) { |
| | | return { |
| | | title, |
| | | content: content.join("\n"), |
| | | }; |
| | | } |
| | | }, |
| | | showOtherDoc() { |
| | | this.getInfo(1); |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchAllUserList(); |
| | | this.getRoleUser(); |
| | | this.sendMessage(); |
| | | // this.searchData(); |
| | | window.addEventListener("resize", this.resize); |
| | |
| | | :key="'item_' + idx" |
| | | @click="selectHandle(item)" |
| | | > |
| | | <span :class="['status', { actived: item.enabled }]"></span> |
| | | <span :class="['status', { actived: item.enabled == 1 }]"></span> |
| | | <div class="version">{{ item.versionTime }}</div> |
| | | <a-checkbox |
| | | @click.stop |
| | |
| | | <a-button type="primary" @click="prodDiff">产品比较</a-button> |
| | | </a-space> |
| | | </template> |
| | | <template slot="enabled" slot-scope="{ record }"> |
| | | {{ record.enabled == -1 ? "是" : "否" }} |
| | | </template> |
| | | <template slot="isNormal" slot-scope="{ record }"> |
| | | {{ record.customCode == "" ? "是" : "否" }} |
| | | </template> |
| | |
| | | <a @click="upload(record)">上传软件</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | </template> --> |
| | | <a @click="viewLog(record)">日志</a> |
| | | <a @click="viewLog(record)">状态日志</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="goDetails(record)">详情</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | | <a-space class="btn-grp" direction="vertical" slot="content"> |
| | | <!-- TODO --> |
| | | <a-button |
| | | v-if="isTester && record.enabled == -1" |
| | | type="primary" |
| | | @click="unLock(record)" |
| | | >解锁</a-button |
| | | > |
| | | <a-button type="primary" @click="downloadLog(record)" |
| | | >下载日志</a-button |
| | | > |
| | | <a-button |
| | | :disabled="record.version == -1" |
| | | type="primary" |
| | |
| | | > |
| | | <a-button |
| | | v-if="canDownloadBom" |
| | | :disabled="record.version == -1" |
| | | :disabled="record.version == -1 && !isTester" |
| | | type="primary" |
| | | @click="checkLock(record)" |
| | | >下载</a-button |
| | |
| | | rowKey="num" |
| | | ></a-table> |
| | | </a-modal> |
| | | <!-- 操作原因 --> |
| | | <a-modal |
| | | :visible="reasonVisible" |
| | | :width="460" |
| | | title="操作原因" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | @cancel="reasonCancel" |
| | | @ok="reasonOk" |
| | | > |
| | | <a-form-model-item ref="name" label="操作原因"> |
| | | <a-input |
| | | type="textarea" |
| | | v-model="reason" |
| | | placeHolder="请输入操作原因" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-modal> |
| | | <download-reason |
| | | :reason-visible.sync="downloadReasonVisible" |
| | | v-if="downloadReasonVisible" |
| | | @ok="downloadReasonOk" |
| | | ></download-reason> |
| | | <download-logs |
| | | :visible.sync="downloadlogVisible" |
| | | v-if="downloadlogVisible" |
| | | :type="12" |
| | | :oprate-info="oprateInfo" |
| | | ></download-logs> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import ChangeParts from "./changeParts"; |
| | | import ProdUpload from "./prodUpload"; |
| | | import DrawUpload from "@/pages/components/drawUpload"; |
| | | import DownloadReason from "@/pages/components/downloadReason"; |
| | | import DownloadLogs from "@/pages/components/downloadLogs"; |
| | | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { |
| | |
| | | getAllProducts, |
| | | getLogList, |
| | | getLockedList, |
| | | setpHistoryEnable, |
| | | } from "./apis"; |
| | | |
| | | import { |
| | | searchDefaultMailUser, |
| | | sendMail, |
| | | } from "../../components/emailCard/apis"; |
| | | import { getUserList } from "../../permission/apis"; |
| | | |
| | | import { getRoleUser } from "@/pages/user/apis"; |
| | | import { submitFeedback } from "@/pages/workplace/apis"; |
| | | import { productSoftwareSubmit } from "../software/apis"; |
| | | import { zipParse } from "@/pages/workplace/myDraw/apis"; |
| | |
| | | }, |
| | | ]; |
| | | return { |
| | | reason: "", |
| | | reasonVisible: false, |
| | | oprateInfo: "", |
| | | downloadlogVisible: false, |
| | | tester: [], |
| | | downloadReasonVisible: false, |
| | | curObj: null, |
| | | errorVisible: false, |
| | | ecrColumns, |
| | | feedbackShow: false, |
| | |
| | | }, |
| | | prodData: {}, |
| | | userList: [], |
| | | userListAll: [], |
| | | mailList: [], |
| | | file: null, |
| | | // title: "", |
| | | fileUrl: "", |
| | |
| | | searchAble: true, |
| | | width: 100, |
| | | scopedSlots: { customRender: "isNormal" }, |
| | | }, |
| | | { |
| | | title: "待复核", |
| | | dataIndex: "enabled", |
| | | dataType: "boolean", |
| | | align: "center", |
| | | searchAble: true, |
| | | width: 100, |
| | | scopedSlots: { customRender: "enabled" }, |
| | | }, |
| | | // { |
| | | // title: "创建时间", |
| | |
| | | DrawUpload, |
| | | DiffList, |
| | | FeedbackForm, |
| | | DownloadReason, |
| | | DownloadLogs, |
| | | }, |
| | | methods: { |
| | | unLock(obj) { |
| | | this.curObj = obj; |
| | | this.reasonVisible = true; |
| | | }, |
| | | reasonCancel() { |
| | | this.reasonVisible = false; |
| | | }, |
| | | reasonOk() { |
| | | let { |
| | | curObj: { |
| | | customCode, |
| | | parentCode, |
| | | version, |
| | | versionTime, |
| | | enabled: lockFlagNow, |
| | | }, |
| | | reason, |
| | | } = this; |
| | | let enabled = 1; |
| | | setpHistoryEnable({ |
| | | customCode, |
| | | parentCode, |
| | | enabled, |
| | | version, |
| | | reason, |
| | | versionTime, |
| | | }).then((res) => { |
| | | let { code, data } = res.data; |
| | | if (code && data) { |
| | | this.$message.success("操作成功"); |
| | | this.sendMessage(); |
| | | this.reasonVisible = false; |
| | | // 如果是测试人员解锁确认 则自动发送邮件 |
| | | if (lockFlagNow == -1 && this.isTester) { |
| | | this.sendEmail(); |
| | | } |
| | | } else { |
| | | this.$message.error("操作失败"); |
| | | } |
| | | }); |
| | | }, |
| | | sendEmail() { |
| | | let { title, content } = this.handleEmailShow(this.curObj, true); |
| | | let params = { mailList: this.mailList, title, content }; |
| | | sendMail(params); |
| | | }, |
| | | searchAllUserList() { |
| | | getUserList() |
| | | .then((res) => { |
| | | let rs = res.data; |
| | | if (rs.code && rs.data) { |
| | | this.userListAll = rs.data2; |
| | | this.searchDefaultMailUser(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | searchDefaultMailUser() { |
| | | // type为3 |
| | | let type = 3; |
| | | searchDefaultMailUser(type).then((res) => { |
| | | let rs = res.data; |
| | | let data = []; |
| | | if (rs.code === 1) { |
| | | data = rs.data.map((item) => { |
| | | return item.user; |
| | | }); |
| | | } |
| | | this.mailList = this.userListAll |
| | | .filter((o) => data.includes(o.name) && o.mail) |
| | | .map((item) => { |
| | | return item.mail; |
| | | }); |
| | | }); |
| | | }, |
| | | handleEmailShow(record, get) { |
| | | let title = |
| | | "[产品发布记录]" + record.parentName + " 版本:" + record.versionTime; |
| | | let content = []; |
| | | content.push("物料编码: " + record.parentCode); |
| | | content.push("物料名称: " + record.parentName); |
| | | content.push("规格型号: " + record.parentModel); |
| | | content.push("标准机型: " + (record.customCode ? "是" : "否")); |
| | | content.push("定制单号: " + (record.customCode || "无")); |
| | | content.push("版本时间: " + record.versionTime); |
| | | if (get) { |
| | | return { |
| | | title, |
| | | content: content.join("\n"), |
| | | }; |
| | | } |
| | | }, |
| | | onSearch(conditions, searchOptions) { |
| | | // console.log(conditions); |
| | | // console.log(searchOptions); |
| | |
| | | this.lockListVisible = true; |
| | | } else { |
| | | // 没有锁定 |
| | | this.download(obj); |
| | | this.showReason(obj); |
| | | } |
| | | } else { |
| | | this.$message.error("查询锁定清单出错"); |
| | |
| | | }, |
| | | lockListOk() { |
| | | this.lockListVisible = false; |
| | | this.download(this.currentObj); |
| | | this.showReason(this.currentObj); |
| | | }, |
| | | download(obj) { |
| | | const { id, version } = obj; |
| | | showReason(obj) { |
| | | this.curObj = obj; |
| | | this.downloadReasonVisible = true; |
| | | }, |
| | | downloadReasonOk(reason) { |
| | | this.download(reason); |
| | | }, |
| | | download(reason) { |
| | | const { id, version, parentCode, customCode } = this.curObj; |
| | | let oprateInfo = parentCode + "_" + customCode; |
| | | let loading = this.$layer.loading({ shade: true }); |
| | | downloadBom(id, version).then((res) => { |
| | | downloadBom(id, version, reason, oprateInfo).then((res) => { |
| | | // console.log(res, "==========="); |
| | | this.$layer.close(loading); |
| | | let { headers, data, status } = res; |
| | |
| | | case "customCode": |
| | | if (params["customCode"] == undefined) { |
| | | params[v] = conditions[v]; |
| | | } |
| | | break; |
| | | case "enabled": |
| | | if (conditions[v]) { |
| | | params[v] = -1; |
| | | } |
| | | break; |
| | | default: |
| | |
| | | ecrListCancel() { |
| | | this.ecrListVisible = false; |
| | | }, |
| | | getRoleUser() { |
| | | getRoleUser(1) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | console.log(data); |
| | | list = data2.map((v) => v.name); |
| | | } |
| | | this.tester = list; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | downloadLog(record) { |
| | | // console.log(record); |
| | | let { customCode, parentCode } = record; |
| | | this.oprateInfo = parentCode + "_" + customCode; |
| | | this.downloadlogVisible = true; |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | |
| | | "projectManagerList", |
| | | "generalManagerList", |
| | | "permits", |
| | | "user", |
| | | ]), |
| | | ...mapGetters("setting", ["affixed"]), |
| | | canUploadBom() { |
| | |
| | | |
| | | return result; |
| | | }, |
| | | isTester() { |
| | | return this.tester.some((v) => v == this.user.name); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchAllUserList(); |
| | | this.getRoleUser(); |
| | | this.getUserByRoleId(); |
| | | this.sendMessage(); |
| | | this.getAllProducts(); |
| | |
| | | } |
| | | |
| | | .btn-grp .ant-btn { |
| | | min-width: 6em; |
| | | min-width: 6.4em; |
| | | } |
| | | </style> |
| | |
| | | sendMail, |
| | | } from "../../components/emailCard/apis"; |
| | | |
| | | import { getRoleUser } from "@/pages/user/apis"; |
| | | // TODO |
| | | const tester = ["李桂华"]; |
| | | // const tester = ["李桂华"]; |
| | | |
| | | export default { |
| | | name: "", |
| | | data() { |
| | | return { |
| | | mailList: [], |
| | | tester, |
| | | tester: [], |
| | | versionTime: moment().format("YYYY-MM-DD HH:mm:ss"), |
| | | reasonVisible: false, |
| | | reason: "", |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | getRoleUser() { |
| | | getRoleUser(0) |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | console.log(data); |
| | | list = data2.map((v) => v.name); |
| | | } |
| | | this.tester = list; |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getRoleUser(); |
| | | this.searchData(); |
| | | this.searchAllUserList(); |
| | | window.addEventListener("resize", this.resize); |
| | |
| | | import axios from "@/assets/axios"; |
| | | import formatPassword from '@/assets/js/tools/formatPassword' |
| | | import formatPassword from "@/assets/js/tools/formatPassword"; |
| | | |
| | | /** |
| | | * 查询所有用户信息 |
| | |
| | | method: "POST", |
| | | url: "docUser/getAllUser", |
| | | params, |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * 新增用户 |
| | | * @returns |
| | |
| | | method: "POST", |
| | | url: "docUser/addUser", |
| | | headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * 删除用户 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docUser/deleteUser", |
| | | params: { id } |
| | | }) |
| | | } |
| | | params: { id }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 编辑用户信息 |
| | | * @returns |
| | |
| | | method: "POST", |
| | | url: "docUser/updateUser", |
| | | headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | data |
| | | }) |
| | | } |
| | | data, |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询所有部门信息 |
| | | * @returns |
| | |
| | | export const getAllDepart = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docDepart/getAllDepart" |
| | | }) |
| | | } |
| | | url: "docDepart/getAllDepart", |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询所有角色信息 |
| | | * @returns |
| | |
| | | export const getAllRole = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docDepart/getAllRole" |
| | | }) |
| | | } |
| | | url: "docDepart/getAllRole", |
| | | }); |
| | | }; |
| | | /** |
| | | * 清除人脸信息 |
| | | * @returns |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docFace/deleteFace", |
| | | params: { faceId } |
| | | }) |
| | | } |
| | | params: { faceId }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 修改用户密码 |
| | | * @returns |
| | |
| | | params: { |
| | | newSnId: encodeURIComponent(formatPassword(newSnId)), |
| | | oldSnId: encodeURIComponent(formatPassword(oldSnId)), |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 根据用户角色的id查询所有的用户 |
| | |
| | | method: "GET", |
| | | url: "docUser/getUserByRoleId", |
| | | params: { |
| | | roleId |
| | | } |
| | | }) |
| | | } |
| | | roleId, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 根据用户角色的id (多个)查询所有的用户 |
| | |
| | | method: "GET", |
| | | url: "docUser/getUserByRoleIds", |
| | | params: { |
| | | roleIds |
| | | } |
| | | }) |
| | | } |
| | | roleIds, |
| | | }, |
| | | }); |
| | | }; |
| | | /** |
| | | * 查询角色用户列表 权限类型0:测试,1下载 |
| | | * @param {*} roleType |
| | | * @returns |
| | | */ |
| | | export const getRoleUser = (roleType) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "roleUser/getRoleUser", |
| | | params: { |
| | | roleType, |
| | | }, |
| | | }); |
| | | }; |