From 1ea1ad2c56e95e71e1756cfca73e7183f9795ac9 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 16 四月 2025 15:23:39 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev_test --- src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue | 481 +++++++++++++++++++++++------------------------------ 1 files changed, 209 insertions(+), 272 deletions(-) diff --git a/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue b/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue index c7d80ce..63aba6d 100644 --- a/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue +++ b/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue @@ -1,40 +1,28 @@ <template> <!-- 鏂囦欢淇鐢宠瀹℃壒璁板綍 --> - <div class="DocumentRevisionRequestApprovalRecords"> - <el-row class="title"> - <el-col :span="12" style="padding-left: 20px;text-align: left;">鏂囦欢淇鐢宠瀹℃壒璁板綍</el-col> - <el-col :span="12" style="text-align: right;"> - <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button> - <!-- <el-upload :action="action" :show-file-list="false" - accept='.doc,.docx' :headers="headers" :on-change="beforeUpload" - :on-error="onError" ref='upload' v-if="upPower" :on-success="handleSuccessUp" style="display:inline-block;margin-left: 20px;"> - <el-button type="primary" size="medium">瀵煎叆</el-button></el-upload> --> - <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower" - style="display:inline-block;margin-left: 20px;">瀵煎嚭</el-button> - </el-col> - </el-row> + <div class="capacity-scope"> <div class="search"> - <!-- <div class="search_thing"> - <div class="search_label">鏂囦欢鍚嶇О锛�</div> - <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.documentName" - @keyup.enter.native="refreshTable()"></el-input></div> - </div> --> - <div class="search_thing"> - <div class="search_label">鏂囦欢缂栧彿锛�</div> - <div class="search_input"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.documentCode" - @keyup.enter.native="refreshTable()"></el-input> - </div> + <div> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> + <el-form-item label="鏂囦欢缂栧彿" prop="documentCode"> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.documentCode" + @keyup.enter.native="refreshTable()"></el-input> + </el-form-item> + <el-form-item> + <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button> + <el-button size="mini" @click="refresh">閲嶇疆</el-button> + </el-form-item> + </el-form> </div> - <div class="search_thing" style="padding-left: 30px;"> - <el-button size="small" @click="refresh()">閲� 缃�</el-button> - <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> + <div> + <el-button size="small" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button> + <el-button size="small" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower" + style="display:inline-block;margin-left: 20px;">瀵煎嚭</el-button> </div> </div> <div class="table"> - <ValueTable ref="ValueTable" :url="$api.manageRecordAudit.pageManageRecordAudit" - :delUrl="$api.manageRecordAudit.delManageRecordAudit" :componentData="componentData" - :upUrl="$api.manageRecordIssueRecycle.doManageRecordIssueRecycle" :key="upIndex" /> + <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" + :height="'calc(100vh - 260px)'" @pagination="pagination"></lims-table> </div> <el-dialog :title="title" :visible.sync="addDialogVisible" width="800px" top="6vh"> <el-row> @@ -335,14 +323,27 @@ </template> <script> -import ValueTable from '@/components/Table/value-table.vue' +import limsTable from "@/components/Table/lims-table.vue"; import { exportHtmlToPDF } from '@/utils/downHtmlToPDF' import filePreview from '@/components/Preview/filePreview.vue' +import { + exportOutManageRecordAudit, + addManageRecordAudit, + doManageRecordAudit, + selectCNSAPersonTree, + ratifyManageRecordAudit, + pageManageRecordAudit, + delManageRecordAudit, +} from '@/api/cnas/systemManagement/documentRecords.js' +import { + pageManageDocumentList, +} from '@/api/cnas/systemManagement/documentControl.js' +import { + selectUserCondition, +} from "@/api/business/inspectionTask.js"; export default { - components: { - ValueTable, - filePreview - }, + name: 'RevisionRecord', + components: {filePreview, limsTable}, data() { return { addPower: true, @@ -350,114 +351,6 @@ outLoading: false, lookDialogVisible: false, addLoading: false, - componentData: { - entity: { - // documentName: null, - documentCode: null, - orderBy: { - field: 'createTime', - order: 'desc' - } - }, - isIndex: true, - showSelect: false, - select: false, - // selectMethod: 'handleChangeTask', - do: [{ - id: 'handleLook', - font: '鏌ョ湅', - type: 'text', - method: 'handleLook' - }, { - id: 'handleLook0', - font: '鏂囦欢棰勮', - type: 'text', - method: 'handleLook0' - }, { - id: 'handleOut', - font: '涓嬭浇', - type: 'text', - method: 'handleOut' - }, { - id: 'delete', - font: '鍒犻櫎', - type: 'text', - method: 'doDiy', - disabFun: (row, index) => { - return !!row.ratifyUser - } - }, { - id: 'handleEdit', - font: '淇敼', - type: 'text', - method: 'handleEdit', - field: [], - disabFun: (row, index) => { - return !!row.ratifyUser - } - }, { - id: 'handleRatify', - font: '鎵瑰噯', - type: 'text', - method: 'handleRatify', - field: [], - disabFun: (row, index) => { - return !!row.ratifyUser - } - }, { - id: 'handlework0', - font: '鐢宠鎰忚', - type: 'text', - method: 'handlework0', - field: [], - disabFun: (row, index) => { - return !!row.ratifyUser - } - }, { - id: 'handlework1', - font: '鍘熷畾鍒舵剰瑙�', - type: 'text', - method: 'handlework1', - field: [], - disabFun: (row, index) => { - return !!row.ratifyUser - } - }, { - id: 'handlework2', - font: '鍘熷鏍告剰瑙�', - type: 'text', - method: 'handlework2', - field: [], - disabFun: (row, index) => { - return !!row.ratifyUser - } - }], - tagField: { - // documentType:{ - // select: [] - // }, - // receiveUserName:{ - // select: [] - // }, - }, - selectField: { - // documentType:{ - // select: [] - // }, - // receiveUserName:{ - // select: [] - // }, - }, - addUpload: ['signatoryUrl'], - requiredAdd: [], - requiredUp: [], - datePicker: ['receiveDate'], - noHead: ['signedUserName', 'signedDate', 'departLims'],//涓嶅弬涓庢柊澧炵紪杈戠殑瀛楁 - needSort: [], - inputType: '' - }, - entityCopy: {}, - upIndex: 0, title: '鏂板', addInfo: { method: '淇', @@ -470,117 +363,179 @@ file: null, title0: '鏌ョ湅', currentInfo: {}, + queryParams: {}, + tableData: [], + column: [ + { label: "鏂囦欢缂栧彿", prop: "documentCode" }, + { label: "绔犺妭鍙�", prop: "capter", width: "120px" }, + { + label: "椤电爜", + prop: "pages", + }, + { label: "淇娆℃暟", prop: "number" }, + { label: "淇敼鍓嶇増鏈彿", prop: "beforeVersion" }, + { label: "淇敼鍚庣増鏈彿", prop: "afterVersion" }, + { label: "淇敼鍐呭", prop: "alterThing" }, + { label: "淇浜�", prop: "alterUserName" }, + { label: "鎵瑰噯浜�", prop: "ratifyUserName" }, + { label: "鏃ユ湡", prop: "date" }, + { + dataType: "action", + fixed: "right", + label: "鎿嶄綔", + operation: [ + { + name: "鏌ョ湅", + type: "text", + clickFun: (row) => { + this.handleLook(row); + }, + }, + { + name: "鏂囦欢棰勮", + type: "text", + clickFun: (row) => { + this.handleLook0(row); + }, + }, + { + name: "涓嬭浇", + type: "text", + clickFun: (row) => { + this.handleOut(row); + }, + }, + { + name: "鍒犻櫎", + type: "text", + clickFun: (row) => { + this.handleDelete(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + { + name: "缂栬緫", + type: "text", + clickFun: (row) => { + this.handleEdit(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + { + name: "鎵瑰噯", + type: "text", + clickFun: (row) => { + this.handleRatify(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + { + name: "鐢宠鎰忚", + type: "text", + clickFun: (row) => { + this.handlework0(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + { + name: "鍘熷畾鍒舵剰瑙�", + type: "text", + clickFun: (row) => { + this.handlework1(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + { + name: "鍘熷鏍告剰瑙�", + type: "text", + clickFun: (row) => { + this.handlework2(row); + }, + disabled: (row) => { + return !!row.ratifyUser + }, + }, + ], + }, + ], + page: { + total: 0, + size: 10, + current: 0, + }, + tableLoading: false, } }, mounted() { - this.entityCopy = this.HaveJson(this.componentData.entity); - this.getPower() + this.getList() this.getFileList() this.getAuthorizedPerson() this.selectTreeList() }, methods: { - getPower() { - let power = JSON.parse(sessionStorage.getItem('power')) - let add = false - let del = false - let out = false; - let ratify = false - let audit1 = false - let audit2 = false - let audit3 = false - for (var i = 0; i < power.length; i++) { - if (power[i].menuMethod == 'addManageRecordAudit') { - add = true - } - if (power[i].menuMethod == 'delManageRecordAudit') { - del = true - } - if (power[i].menuMethod == 'ratifyManageRecordAudit') { - ratify = true - } - if (power[i].menuMethod == 'exportOutManageRecordAudit') { - out = true - } - if (power[i].menuMethod == 'manageRecordAudit1') { - audit1 = true - } - if (power[i].menuMethod == 'manageRecordAudit2') { - audit2 = true - } - if (power[i].menuMethod == 'manageRecordAudit3') { - audit3 = true - } - } - if (!audit3) { - this.componentData.do.splice(8, 1) - } - if (!audit2) { - this.componentData.do.splice(7, 1) - } - if (!audit1) { - this.componentData.do.splice(6, 1) - } - if (!ratify) { - this.componentData.do.splice(5, 1) - } - if (!add) { - this.componentData.do.splice(4, 1) - } - if (!del) { - this.componentData.do.splice(3, 1) - } - this.addPower = add - this.outPower = out - }, openAdd() { this.addInfo = { method: '淇', } this.title = '鏂板' + this.file = null this.addDialogVisible = true; }, // 瀵煎嚭 handleDown() { this.outLoading = true - this.$axios.post(this.$api.manageRecordAudit.exportOutManageRecordAudit, { entity: this.componentData.entity }, { headers: { 'Content-Type': 'application/json' } }).then(res => { + exportOutManageRecordAudit(this.queryParams).then(res => { this.outLoading = false - if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触') - this.$message.success('瀵煎嚭鎴愬姛') - let url = this.javaApi + 'word/' + res.message - const link = document.createElement('a'); - link.href = url; - link.download = '鏂囦欢淇琛�'; - link.click(); + this.$download.saveAs(res.data, "鏂囦欢淇琛�"); }) }, - refreshTable() { - this.refreshTable()() + getList() { + this.tableLoading = true; + let param = { ...this.queryParams, ...this.page }; + delete param.total; + pageManageRecordAudit({ ...param }) + .then((res) => { + this.tableLoading = false; + if (res.code === 200) { + this.tableData = res.data.records; + this.page.total = res.data.total; + } + }) + .catch((err) => { + this.tableLoading = false; + }); + }, + pagination({ page, limit }) { + this.page.current = page; + this.page.size = limit; + this.getList(); }, refresh() { - this.componentData.entity = this.HaveJson(this.entityCopy) - this.upIndex++ - this.refreshTable() + this.queryParams = {}; + this.page.current = 1; + this.getList(); + }, + refreshTable() { + this.page.current = 1; + this.getList(); }, // 鑾峰彇鏂囦欢鍒楄〃--鏂囦欢娓呭崟 getFileList() { - this.$axios.post(this.$api.manageDocumentList.pageManageDocumentList, { - entity: { - orderBy: { - field: 'createTime', - order: 'desc' - } - }, - page: { - current: -1, - size: -1 - } - }, { - headers: { - 'Content-Type': 'application/json' - } + pageManageDocumentList({ + current: -1, + size: -1 }).then(res => { - this.fileList = res.data.body.records.map(m => { + this.fileList = res.data.records.map(m => { m.title = m.documentCode return m }) @@ -600,12 +555,7 @@ fd.append(m, this.addInfo[m]) } this.addLoading = true - this.$axios.post(this.$api.manageRecordAudit.addManageRecordAudit, fd, { - headers: { - 'Content-Type': 'multipart/form-data' - }, - noQs: true - }).then(res => { + addManageRecordAudit(fd).then(res => { this.addLoading = false if (res.code == 200) { this.$message({ @@ -636,12 +586,7 @@ } } this.addLoading = true - this.$axios.post(this.$api.manageRecordAudit.doManageRecordAudit, fd, { - headers: { - 'Content-Type': 'multipart/form-data' - }, - noQs: true - }).then(res => { + doManageRecordAudit(fd).then(res => { this.addLoading = false if (res.code == 200) { this.refreshTable() @@ -656,7 +601,7 @@ } }, getAuthorizedPerson() { - this.$axios.get(this.$api.user.getUserMenu).then(res => { + selectUserCondition().then(res => { let data = [] res.data.forEach(a => { data.push({ @@ -664,14 +609,12 @@ value: a.id }) }) - // this.componentData.tagField.receiveUserName.select = data - // this.componentData.selectField.receiveUserName.select = data this.personList = data }) }, // 鏌ヨ鏍戝舰鍒楄〃 selectTreeList() { - this.$axios.get(this.$api.personnel.selectCNSAPersonTree).then((res) => { + selectCNSAPersonTree().then((res) => { this.list = res.data[0].children; }); }, @@ -682,6 +625,7 @@ handleEdit(row) { this.addInfo = row this.title = '淇敼' + this.file = null this.addDialogVisible = true; }, // 瀹℃壒 @@ -692,15 +636,10 @@ type: 'warning' }) .then(() => { - this.$axios - .post(this.$api.manageRecordAudit.ratifyManageRecordAudit, { id: row.id }) - .then(res => { - if (res.code === 201) { - return; - } - this.$message.success('鎿嶄綔鎴愬姛'); - this.refreshTable(); - }) + ratifyManageRecordAudit({ id: row.id }).then(res => { + this.$message.success('鎿嶄綔鎴愬姛'); + this.refreshTable(); + }) .catch(e => { this.$message.error('鎿嶄綔澶辫触'); }); @@ -744,22 +683,30 @@ handleLook0(row) { this.currentInfo = row; this.lookDialogVisible = true - } + }, + handleDelete(row) { + this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + delManageRecordAudit({ id: row.id }).then((res) => { + this.$message.success("鍒犻櫎鎴愬姛"); + this.refresh(); + }); + }) + .catch(() => { }); + }, } } </script> <style scoped> -.title { - height: 60px; - line-height: 60px; -} - .search { - background-color: #fff; - height: 80px; + height: 46px; display: flex; - align-items: center; + justify-content: space-between; } .search_thing { @@ -778,18 +725,11 @@ width: calc(100% - 110px); } -.table { - margin-top: 10px; - background-color: #fff; - width: calc(100% - 40px); - height: calc(100% - 60px - 80px - 10px - 40px); - padding: 20px; -} - .tables { table-layout: fixed; width: 100%; margin-top: 10px; + border-collapse: collapse; } .tables td { @@ -842,7 +782,4 @@ left: 0; } ->>>.el-dialog__body { - height: auto; -} </style> -- Gitblit v1.9.3