From 83be7ca0c138b64b3447cc207b63c7933690f6ec Mon Sep 17 00:00:00 2001 From: 曹睿 <360930172@qq.com> Date: 星期二, 25 二月 2025 09:08:58 +0800 Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev --- src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue | 396 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 208 insertions(+), 188 deletions(-) diff --git a/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue b/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue index c7d80ce..c281b47 100644 --- a/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue +++ b/src/views/CNAS/systemManagement/documentRecords/revisionRecord.vue @@ -1,28 +1,11 @@ <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="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" + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.documentCode" @keyup.enter.native="refreshTable()"></el-input> </div> </div> @@ -30,11 +13,15 @@ <el-button size="small" @click="refresh()">閲� 缃�</el-button> <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> </div> + <div class="btn"> + <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,13 +322,28 @@ </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 + filePreview, + limsTable }, data() { return { @@ -350,114 +352,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,11 +364,121 @@ 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() @@ -543,44 +547,51 @@ // 瀵煎嚭 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(); + let url = this.javaApi + '/word/' + res.data + this.$download.saveAs(url, "鏂囦欢淇琛�"); }) }, - 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 +611,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 +642,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 +657,7 @@ } }, getAuthorizedPerson() { - this.$axios.get(this.$api.user.getUserMenu).then(res => { + selectUserCondition().then(res => { let data = [] res.data.forEach(a => { data.push({ @@ -664,14 +665,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; }); }, @@ -692,15 +691,13 @@ 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 => { + if (res.code === 201) { + return; + } + this.$message.success('鎿嶄綔鎴愬姛'); + this.refreshTable(); + }) .catch(e => { this.$message.error('鎿嶄綔澶辫触'); }); @@ -744,7 +741,22 @@ handleLook0(row) { this.currentInfo = row; this.lookDialogVisible = true - } + }, + handleDelete(row) { + this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + delManageRecordAudit({ id: row.id }).then((res) => { + if (res.code == 201) return; + this.$message.success("鍒犻櫎鎴愬姛"); + this.refresh(); + }); + }) + .catch(() => { }); + }, } } </script> @@ -760,6 +772,7 @@ height: 80px; display: flex; align-items: center; + position: relative; } .search_thing { @@ -781,15 +794,16 @@ .table { margin-top: 10px; background-color: #fff; - width: calc(100% - 40px); height: calc(100% - 60px - 80px - 10px - 40px); padding: 20px; + padding-top: 0; } .tables { table-layout: fixed; width: 100%; margin-top: 10px; + border-collapse: collapse; } .tables td { @@ -845,4 +859,10 @@ >>>.el-dialog__body { height: auto; } + +.btn { + position: absolute; + right: 20px; + top: 16px; +} </style> -- Gitblit v1.9.3