From e888346ebcd8e3e099a15c7edd7bf367c057193a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 04 三月 2025 15:33:33 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'
---
src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue | 513 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 513 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue b/src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue
new file mode 100644
index 0000000..b695edd
--- /dev/null
+++ b/src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue
@@ -0,0 +1,513 @@
+<template>
+ <!-- 鏂囦欢瀹℃壒璁板綍 -->
+ <div class="DocumentApprovalRecords">
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">鏂囦欢鍚嶇О锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.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="queryParams.documentCode"
+ @keyup.enter.native="refreshTable()"></el-input>
+ </div>
+ </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>
+ <div class="btn">
+ <el-button size="small" type="primary" @click="openAdd('鏂板')">鏂板</el-button>
+ <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx'
+ :headers="uploadHeader" :on-change="beforeUpload" :on-error="onError" ref='upload'
+ :on-success="handleSuccessUp" style="display:inline-block;margin-left: 20px;">
+ <el-button type="primary" size="small">瀵煎叆</el-button></el-upload>
+ <el-button size="small" type="primary" @click="handleDown" :loading="outLoading"
+ style="display:inline-block;margin-left: 20px;">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+ :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table>
+ </div>
+ <!-- 鏂板/缂栬緫 -->
+ <el-dialog :title="title" :visible.sync="addDia" width="500px">
+ <el-form :model="addForm" ref="addForm" :rules="addRules" label-position="right" label-width="120px">
+ <el-form-item label="鏂囦欢鍚嶇О" prop="documentName">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentName"></el-input>
+ </el-form-item>
+ <el-form-item label="鏂囦欢缂栧彿" prop="documentCode">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentCode">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鐗�/娆�" prop="documentVersion">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentVersion">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="缂栧埗" prop="writeUser">
+ <el-select v-model="addForm.writeUser" size="small" clearable placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="瀹℃牳" prop="checkUser">
+ <el-select v-model="addForm.checkUser" size="small" clearable placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鎵瑰噯" prop="ratifyUser">
+ <el-select v-model="addForm.ratifyUser" size="small" clearable placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鎵瑰噯鏃ユ湡" prop="ratifyDate">
+ <el-date-picker v-model="addForm.ratifyDate" style="width: 100%" value-format="yyyy-MM-dd" ormat="yyyy-MM-dd"
+ type="date" size="small"></el-date-picker>
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input size="small" placeholder="璇疯緭鍏�" type="textarea" :rows="2" clearable v-model="addForm.remarks">
+ </el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDia = false">鍙� 娑�</el-button>
+ <el-button :loading="uploading" type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ selectUserCondition,
+} from "@/api/system/user.js";
+import {
+ addManageRecordCheck,
+ doManageRecordCheck,
+ exportOutManageRecordCheck,
+ checkManageRecordCheck,
+ ratifyManageRecordCheck,
+ delManageRecordCheck,
+ pageManageRecordCheck
+} from '@/api/cnas/systemManagement/documentRecords.js'
+export default {
+ components: {
+ limsTable
+ },
+ data() {
+ return {
+ addPower: true,
+ outPower: true,
+ upPower: true,
+ outLoading: false,
+ personList: [],
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "鏂囦欢鍚嶇О", prop: "documentName" },
+ { label: "鏂囦欢缂栧彿", prop: "documentCode", width: "120px" },
+ {
+ label: "鐗�/娆�",
+ prop: "documentVersion",
+ },
+ { label: "缂栧埗", prop: "writeUser" },
+ { label: "瀹℃牳", prop: "checkUser" },
+ { label: "鎵瑰噯", prop: "ratifyUser" },
+ { label: "鎵瑰噯鏃ユ湡", prop: "ratifyDate" },
+ { label: "澶囨敞", prop: "remark" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.openAdd("缂栬緫", row);
+ },
+ disabled: (row) => {
+ return row.checkState == '閫氳繃' || row.ratifyState == '閫氳繃'
+ },
+ },
+ {
+ name: "瀹℃牳",
+ type: "text",
+ clickFun: (row) => {
+ this.handleCheck(row);
+ },
+ disabled: (row) => {
+ return row.checkState == '閫氳繃' || row.ratifyState == '閫氳繃'
+ },
+ },
+ {
+ name: "鎵瑰噯",
+ type: "text",
+ clickFun: (row) => {
+ this.handleApproval(row);
+ },
+ disabled: (row) => {
+ return row.ratifyState == '閫氳繃'
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ disabled: (row) => {
+ return row.checkState == '閫氳繃' || row.ratifyState == '閫氳繃'
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ title: "鏂板",
+ addDia: false,
+ addForm: {},
+ addRules: {
+ documentName: [{ required: true, message: "璇疯緭鍏ユ枃浠跺悕绉�", trigger: "blur" }],
+ },
+ uploading: false,
+ }
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ action() {
+ return this.javaApi + '/manageRecordCheck/exportInManageRecordCheck'
+ }
+ },
+ mounted() {
+ this.getAuthorizedPerson()
+ },
+ methods: {
+ getPower() {
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let add = false
+ let del = false
+ let up = false;
+ let out = false;
+ let check = false
+ let ratify = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'addManageRecordCheck') {
+ add = true
+ }
+ if (power[i].menuMethod == 'delManageRecordCheck') {
+ del = true
+ }
+ if (power[i].menuMethod == 'exportInManageRecordCheck') {
+ up = true
+ }
+ if (power[i].menuMethod == 'checkManageRecordCheck') {
+ check = true
+ }
+ if (power[i].menuMethod == 'ratifyManageRecordCheck') {
+ ratify = true
+ }
+ if (power[i].menuMethod == 'exportOutManageRecordCheck') {
+ out = true
+ }
+ }
+ if (!ratify) {
+ this.componentData.do.splice(3, 1)
+ }
+ if (!check) {
+ this.componentData.do.splice(2, 1)
+ }
+ if (!add) {
+ this.componentData.do.splice(1, 1)
+ }
+ if (!del) {
+ this.componentData.do.splice(0, 1)
+ }
+ this.addPower = add
+ this.outPower = out
+ this.upPower = up
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ pageManageRecordCheck({ ...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.queryParams = {};
+ this.page.current = 1;
+ this.getList();
+ },
+ refreshTable() {
+ this.page.current = 1;
+ this.getList();
+ },
+ // 鏂板/缂栬緫
+ openAdd(title, row) {
+ this.title = title
+ if (row) {
+ this.addForm = row
+ } else {
+ this.addForm = {}
+ }
+ this.addDia = true;
+ },
+ // 瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ // queryParams
+ exportOutManageRecordCheck(this.queryParams).then(res => {
+ this.outLoading = false
+ if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触')
+ let url = this.javaApi + '/word/' + res.message
+ this.$download.saveAs(url, '鏂囦欢瀹℃壒璁板綍')
+ })
+ },
+ getAuthorizedPerson() {
+ selectUserCondition().then(res => {
+ let data = []
+ res.data.forEach(a => {
+ data.push({
+ label: a.name,
+ value: a.id
+ })
+ })
+ this.personList = data
+ this.refreshTable()()
+ })
+ },
+ // 瀹℃牳
+ handleCheck(row) {
+ this.$confirm('鏄惁瀹℃牳閫氳繃?', '鎻愮ず', {
+ confirmButtonText: '閫氳繃',
+ cancelButtonText: '涓嶉�氳繃',
+ type: 'warning',
+ closeOnClickModal: false, // 绂佹鐐瑰嚮閬僵灞傚叧闂�
+ distinguishCancelAndClose: true,
+ beforeClose: (action, instance, done) => {
+ if (action === 'confirm') {
+ // 鐐瑰嚮鈥滅‘瀹氣�濇寜閽紝鍏佽鍏抽棴
+ checkManageRecordCheck({ id: row.id, checkState: '閫氳繃' }).then(res => {
+ if (res.code === 201) return
+ this.refreshTable()
+ done();
+ this.$message({
+ type: 'success',
+ message: '鎻愪氦鎴愬姛'
+ })
+ })
+ .catch(err => {
+
+ })
+ } else if (action === 'cancel') {
+ // 鐐瑰嚮鈥滃彇娑堚�濇寜閽紝涓嶅厑璁稿叧闂�
+ checkManageRecordCheck({ id: row.id, checkState: '涓嶉�氳繃' }).then(res => {
+ if (res.code === 201) return
+ this.refreshTable()
+ done();
+ this.$message({
+ type: 'success',
+ message: '鎻愪氦鎴愬姛'
+ })
+ })
+ .catch(err => {
+
+ })
+ console.log("鍙栨秷鎸夐挳鐐瑰嚮浜嬩欢锛屼笉鍏抽棴寮规");
+ } else if (action === 'close') {
+ // 鐐瑰嚮鈥溍椻�濇寜閽紝涓嶅厑璁稿叧闂�
+ done();
+ console.log("脳鎸夐挳鐐瑰嚮浜嬩欢锛屼笉鍏抽棴寮规");
+ }
+ }
+ })
+ },
+ // 鎵瑰噯
+ handleApproval(row) {
+ this.$confirm('鏄惁鎵瑰噯閫氳繃?', '鎻愮ず', {
+ confirmButtonText: '閫氳繃',
+ cancelButtonText: '涓嶉�氳繃',
+ type: 'warning',
+ closeOnClickModal: false, // 绂佹鐐瑰嚮閬僵灞傚叧闂�
+ distinguishCancelAndClose: true,
+ beforeClose: (action, instance, done) => {
+ if (action === 'confirm') {
+ // 鐐瑰嚮鈥滅‘瀹氣�濇寜閽紝鍏佽鍏抽棴
+ ratifyManageRecordCheck({ id: row.id, ratifyState: '閫氳繃' }).then(res => {
+ if (res.code === 201) return
+ this.refreshTable()
+ done();
+ this.$message({
+ type: 'success',
+ message: '鎻愪氦鎴愬姛'
+ })
+ })
+ .catch(err => {
+
+ })
+ } else if (action === 'cancel') {
+ // 鐐瑰嚮鈥滃彇娑堚�濇寜閽紝涓嶅厑璁稿叧闂�
+ ratifyManageRecordCheck({ id: row.id, ratifyState: '涓嶉�氳繃' }).then(res => {
+ if (res.code === 201) return
+ this.refreshTable()
+ done();
+ this.$message({
+ type: 'success',
+ message: '鎻愪氦鎴愬姛'
+ })
+ })
+ .catch(err => {
+
+ })
+ } else if (action === 'close') {
+ // 鐐瑰嚮鈥溍椻�濇寜閽紝涓嶅厑璁稿叧闂�
+ done();
+ console.log("脳鎸夐挳鐐瑰嚮浜嬩欢锛屼笉鍏抽棴寮规");
+ }
+ }
+ })
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ // this.upLoading = true;
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ handleSuccessUp(response) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.refreshTable()()
+ } else {
+ this.$message.error('涓婁紶澶辫触');
+ }
+ },
+ // 鏂板/淇敼
+ submitProduct(formName) {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ this.uploading = true;
+ if (this.title == "鏂板") {
+ addManageRecordCheck(this.addForm)
+ .then((res) => {
+ this.uploading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.refresh();
+ this.addDia = false;
+ })
+ .catch((err) => {
+ this.uploading = false;
+ });
+ } else {
+ doManageRecordCheck(this.addForm)
+ .then((res) => {
+ this.uploading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.refresh();
+ this.addDia = false;
+ })
+ .catch((err) => {
+ this.uploading = false;
+ });
+ }
+ } else {
+ return false;
+ }
+ });
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delManageRecordCheck({ id: row.id }).then((res) => {
+ if (res.code == 201) return;
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => { });
+ },
+ }
+}
+</script>
+
+<style scoped>
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.btn {
+ position: absolute;
+ right: 16px;
+ top: 20px;
+}
+
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ height: calc(100% - 60px - 80px - 10px - 40px);
+ padding: 20px;
+}
+</style>
--
Gitblit v1.9.3