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/cancellationRecord.vue | 478 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 478 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/systemManagement/documentRecords/cancellationRecord.vue b/src/views/CNAS/systemManagement/documentRecords/cancellationRecord.vue
new file mode 100644
index 0000000..f01da6e
--- /dev/null
+++ b/src/views/CNAS/systemManagement/documentRecords/cancellationRecord.vue
@@ -0,0 +1,478 @@
+<template>
+ <!-- 浣滃簾鏂囦欢閿�姣佽褰� -->
+ <div class="ObsoleteDocumentDestructionRecords">
+ <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 - 260px)'" @pagination="pagination"></lims-table>
+ </div>
+ <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh">
+ <el-row>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label"><span style="color: red;margin-left: 4px;">* </span>鏂囦欢缂栧彿锛�</div>
+ <div class="search_input">
+ <el-select v-model="addInfo.documentCode" size="small" style="width: 100%;" @change="getCurrentFile"
+ allow-create clearable filterable>
+ <el-option v-for="item in fileList" :key="item.documentCode" :label="item.title"
+ :value="item.documentCode">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏂囦欢鍚嶇О锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.documentName"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏁伴噺锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.qty"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">閿�姣佸師鍥狅細</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.reason"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">澶囨敞锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.remark"
+ type="textarea" :rows="2"></el-input></div>
+ </div>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="handleAdd" :loading="addLoading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ selectUserCondition,
+} from "@/api/system/user.js";
+import {
+ exportOutManageRecordCancel,
+ addManageRecordCancel,
+ doManageRecordCancel,
+ ratifyManageRecordCancel,
+ delManageRecordCancel,
+ pageManageRecordCancel
+} from '@/api/cnas/systemManagement/documentRecords.js'
+import {
+ pageManageDocumentList,
+} from '@/api/cnas/systemManagement/documentControl.js'
+export default {
+ components: {
+ limsTable
+ },
+ data() {
+ return {
+ addPower: true,
+ outPower: true,
+ upPower: true,
+ outLoading: false,
+ addLoading: false,
+ addInfo: {},
+ title: '鏂板',
+ addInfo: {},
+ addDialogVisible: false,
+ fileList: [],
+ personList: [],
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "鏂囦欢缂栧彿", prop: "documentCode" },
+ { label: "鏂囦欢鍚嶇О", prop: "documentName", width: "120px" },
+ {
+ label: "鏁伴噺",
+ prop: "qty",
+ },
+ { label: "閿�姣佸師鍥�", prop: "reason" },
+ { label: "鐢宠浜�", prop: "createUserName" },
+ { label: "鐢宠鏃ユ湡", prop: "createTime" },
+ { label: "鎵瑰噯浜�", prop: "ratifyUserName" },
+ { label: "鎵瑰噯鏃ユ湡", prop: "ratifyTime" },
+ { label: "澶囨敞", prop: "remark" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.handleEdit0(row);
+ },
+ disabled: (row) => {
+ return row.ratifyState == '閫氳繃'
+ },
+ },
+ {
+ name: "鎵瑰噯",
+ type: "text",
+ clickFun: (row) => {
+ this.handleRatify(row);
+ },
+ disabled: (row) => {
+ return row.ratifyState == '閫氳繃'
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ disabled: (row) => {
+ return row.ratifyState == '閫氳繃'
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ }
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ action() {
+ return this.javaApi + '/manageRecordCancel/exportInManageRecordCancel'
+ }
+ },
+ mounted() {
+ // this.entityCopy = this.HaveJson(this.componentData.entity);
+ this.getList()
+ this.getAuthorizedPerson()
+ this.getFileList()
+ },
+ methods: {
+ getPower() {
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let add = false
+ let del = false
+ let up = false;
+ let out = false;
+ let ratify = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'addManageRecordCancel') {
+ add = true
+ }
+ if (power[i].menuMethod == 'delManageRecordCancel') {
+ del = true
+ }
+ if (power[i].menuMethod == 'exportInManageRecordCancel') {
+ up = true
+ }
+ if (power[i].menuMethod == 'ratifyManageRecordCancel') {
+ ratify = true
+ }
+ if (power[i].menuMethod == 'exportOutManageRecordCancel') {
+ out = true
+ }
+ }
+ if (!ratify) {
+ 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
+ },
+ openAdd() {
+ this.addInfo = {}
+ this.title = '鏂板'
+ this.addDialogVisible = true;
+ },
+ handleEdit0(row) {
+ this.addInfo = row
+ this.title = '淇敼'
+ this.addDialogVisible = true;
+ },
+ // 瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ exportOutManageRecordCancel(this.queryParams).then(res => {
+ this.outLoading = false
+ if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触')
+ let url = this.javaApi + '/word/' + res.data
+ this.$download.saveAs(url, "浣滃簾鏂囦欢閿�姣佽褰�");
+ })
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ pageManageRecordCancel({ ...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();
+ },
+ 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('涓婁紶澶辫触');
+ }
+ },
+ // 鑾峰彇鏂囦欢鍒楄〃--鏂囦欢娓呭崟
+ getFileList() {
+ pageManageDocumentList({
+ current: -1,
+ size: -1
+ }).then(res => {
+ this.fileList = res.data.records.map(m => {
+ m.title = m.documentCode
+ return m
+ })
+ }).catch(err => { })
+ },
+ handleAdd() {
+ if (!this.addInfo.documentCode) return this.$message.error('璇疯緭鍏ユ枃浠剁紪鍙�')
+ this.addLoading = true
+ let obj = {}
+ if (this.title == '鏂板') {
+ obj = this.HaveJson(this.addInfo)
+ } else {
+ let { id, documentCode, documentName, qty, reason, remark } = this.addInfo
+ obj = { id, documentCode, documentName, qty, reason, remark }
+ }
+ if (this.title == '鏂板') {
+ addManageRecordCancel(obj).then(res => {
+ this.addLoading = false
+ if (res.code == 201) {
+ return
+ }
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ }).catch(err => { })
+ } else {
+ doManageRecordCancel(obj).then(res => {
+ this.addLoading = false
+ if (res.code == 201) {
+ return
+ }
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ }).catch(err => { })
+ }
+ },
+ getCurrentFile(e) {
+ let obj = this.fileList.find(m => m.documentCode == e)
+ if (obj) {
+ this.$set(this.addInfo, 'documentName', obj.name)
+ }
+ },
+ getAuthorizedPerson() {
+ selectUserCondition().then(res => {
+ let data = []
+ res.data.forEach(a => {
+ data.push({
+ label: a.name,
+ value: a.id
+ })
+ })
+ this.personList = data
+ })
+ },
+ handleRatify(row) {
+ this.$confirm('鏄惁鎵瑰噯閫氳繃?', '鎻愮ず', {
+ confirmButtonText: '閫氳繃',
+ cancelButtonText: '涓嶉�氳繃',
+ type: 'warning',
+ closeOnClickModal: false, // 绂佹鐐瑰嚮閬僵灞傚叧闂�
+ distinguishCancelAndClose: true,
+ beforeClose: (action, instance, done) => {
+ if (action === 'confirm') {
+ // 鐐瑰嚮鈥滅‘瀹氣�濇寜閽紝鍏佽鍏抽棴
+ ratifyManageRecordCancel({ 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') {
+ // 鐐瑰嚮鈥滃彇娑堚�濇寜閽紝涓嶅厑璁稿叧闂�
+ ratifyManageRecordCancel({ id: row.id, ratifyState: '涓嶉�氳繃' }).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("脳鎸夐挳鐐瑰嚮浜嬩欢锛屼笉鍏抽棴寮规");
+ }
+ }
+ })
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delManageRecordCancel({ id: row.id }).then((res) => {
+ if (res.code == 201) return;
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => { });
+ },
+ }
+}
+</script>
+
+<style scoped>
+.title {
+ height: 60px;
+ line-height: 60px;
+}
+
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+}
+
+.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);
+}
+
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ height: calc(100% - 60px - 80px - 10px - 40px);
+ padding: 20px;
+ padding-top: 0;
+}
+
+.btn {
+ position: absolute;
+ right: 20px;
+ top: 16px;
+}
+</style>
--
Gitblit v1.9.3