From a3800bf1aa5a19997bf78434b891798a3ed84632 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 22 一月 2026 13:49:04 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
---
src/views/collaborativeApproval/rulesRegulationsManagement/index.vue | 1076 +++++++++++++++++++++++++++++++++--------------------------
src/views/procurementManagement/paymentLedger/index.vue | 2
2 files changed, 597 insertions(+), 481 deletions(-)
diff --git a/src/views/collaborativeApproval/rulesRegulationsManagement/index.vue b/src/views/collaborativeApproval/rulesRegulationsManagement/index.vue
index 91a6468..1c71cdc 100644
--- a/src/views/collaborativeApproval/rulesRegulationsManagement/index.vue
+++ b/src/views/collaborativeApproval/rulesRegulationsManagement/index.vue
@@ -1,101 +1,166 @@
<template>
<div class="app-container">
-
- <!-- 瑙勭珷鍒跺害绠$悊-->
- <el-card class="box-card">
- <template #header>
- <div class="card-header">
- <span>瑙勭珷鍒跺害鍙戝竷</span>
- </div>
+ <!-- 瑙勭珷鍒跺害绠$悊-->
+ <el-card class="box-card">
+ <template #header>
+ <div class="card-header">
+ <span>瑙勭珷鍒跺害鍙戝竷</span>
+ </div>
+ </template>
+ <div class="tab-content">
+ <el-row :gutter="20"
+ class="mb-20">
+ <span class="ml-10">鍒跺害鏍囬锛�</span>
+ <el-col :span="6">
+ <el-input v-model="regulationSearchForm.title"
+ placeholder="璇疯緭鍏ュ埗搴︽爣棰�"
+ clearable />
+ </el-col>
+ <span class="search_title">鍒跺害鍒嗙被锛�</span>
+ <el-col :span="4">
+ <el-select v-model="regulationSearchForm.category"
+ placeholder="鍒跺害鍒嗙被"
+ clearable>
+ <el-option label="浜轰簨鍒跺害"
+ value="hr" />
+ <el-option label="璐㈠姟鍒跺害"
+ value="finance" />
+ <el-option label="瀹夊叏鍒跺害"
+ value="safety" />
+ <el-option label="鎶�鏈埗搴�"
+ value="tech" />
+ </el-select>
+ </el-col>
+ <el-col :span="8">
+ <el-button type="primary"
+ @click="searchRegulations">鎼滅储</el-button>
+ <el-button @click="resetRegulationSearch">閲嶇疆</el-button>
+ <el-button @click="handleExport">瀵煎嚭</el-button>
+ <el-button type="success"
+ @click="handleAdd">
+ 鍙戝竷鍒跺害
+ </el-button>
+ </el-col>
+ </el-row>
+ <el-table :data="regulations"
+ border
+ v-loading="tableLoading"
+ style="width: 100%">
+ <el-table-column prop="regulationNum"
+ label="鍒跺害缂栧彿"
+ width="120" />
+ <el-table-column prop="title"
+ label="鍒跺害鏍囬"
+ min-width="150" />
+ <el-table-column prop="category"
+ label="鍒嗙被"
+ width="120">
+ <template #default="scope">
+ <el-tag>{{ getCategoryText(scope.row.category) }}</el-tag>
</template>
- <div class="tab-content">
- <el-row :gutter="20" class="mb-20">
- <span class="ml-10">鍒跺害鏍囬锛�</span>
- <el-col :span="6">
- <el-input v-model="regulationSearchForm.title" placeholder="璇疯緭鍏ュ埗搴︽爣棰�" clearable />
- </el-col>
- <span class="search_title">鍒跺害鍒嗙被锛�</span>
- <el-col :span="4">
- <el-select v-model="regulationSearchForm.category" placeholder="鍒跺害鍒嗙被" clearable>
- <el-option label="浜轰簨鍒跺害" value="hr" />
- <el-option label="璐㈠姟鍒跺害" value="finance" />
- <el-option label="瀹夊叏鍒跺害" value="safety" />
- <el-option label="鎶�鏈埗搴�" value="tech" />
- </el-select>
- </el-col>
- <el-col :span="8">
- <el-button type="primary" @click="searchRegulations">鎼滅储</el-button>
- <el-button @click="resetRegulationSearch">閲嶇疆</el-button>
- <el-button @click="handleExport">瀵煎嚭</el-button>
- <el-button type="success" @click="handleAdd">
- 鍙戝竷鍒跺害
- </el-button>
- </el-col>
- </el-row>
-
- <el-table :data="regulations" border v-loading="tableLoading" style="width: 100%">
- <el-table-column prop="regulationNum" label="鍒跺害缂栧彿" width="120" />
- <el-table-column prop="title" label="鍒跺害鏍囬" min-width="150" />
- <el-table-column prop="category" label="鍒嗙被" width="120">
- <template #default="scope">
- <el-tag>{{ getCategoryText(scope.row.category) }}</el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="version" label="鐗堟湰" width="120" />
- <el-table-column prop="createUserName" label="鍙戝竷浜�" width="120" />
- <el-table-column prop="createTime" label="鍙戝竷鏃堕棿" width="180" />
- <el-table-column prop="status" label="鐘舵��" width="100">
- <template #default="scope">
- <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'">
- {{ scope.row.status === 'active' ? '鐢熸晥涓�' : '宸插簾姝�' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="readCount" label="宸茶浜烘暟" width="100" />
- <el-table-column label="鎿嶄綔" width="320" fixed="right">
- <template #default="scope">
- <el-button link @click="viewRegulation(scope.row)">鏌ョ湅</el-button>
- <el-button link type="primary" @click="handleEdit(scope.row)">缂栬緫</el-button>
- <el-button link type="danger" @click="repealEdit(scope.row)">搴熷純</el-button>
- <el-button link type="success" @click="viewVersionHistory(scope.row)">鐗堟湰鍘嗗彶</el-button>
- <el-button link type="warning" @click="viewReadStatus(scope.row)">闃呰鐘舵��</el-button>
- <el-button link type="primary" @click="openFileDialog(scope.row)">闄勪欢</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-card>
-
+ </el-table-column>
+ <el-table-column prop="version"
+ label="鐗堟湰"
+ width="120" />
+ <el-table-column prop="createUserName"
+ label="鍙戝竷浜�"
+ width="120" />
+ <el-table-column prop="createTime"
+ label="鍙戝竷鏃堕棿"
+ width="180" />
+ <el-table-column prop="status"
+ label="鐘舵��"
+ width="100">
+ <template #default="scope">
+ <el-tag :type="scope.row.status === 'active' ? 'success' : 'info'">
+ {{ scope.row.status === 'active' ? '鐢熸晥涓�' : '宸插簾姝�' }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="readCount"
+ label="宸茶浜烘暟"
+ width="100" />
+ <el-table-column label="鎿嶄綔"
+ width="320"
+ fixed="right">
+ <template #default="scope">
+ <el-button link
+ @click="viewRegulation(scope.row)">鏌ョ湅</el-button>
+ <el-button link
+ type="primary"
+ @click="handleEdit(scope.row)">缂栬緫</el-button>
+ <el-button link
+ type="danger"
+ @click="repealEdit(scope.row)">搴熷純</el-button>
+ <el-button link
+ type="success"
+ @click="viewVersionHistory(scope.row)">鐗堟湰鍘嗗彶</el-button>
+ <!-- <el-button link type="warning" @click="viewReadStatus(scope.row)">闃呰鐘舵��</el-button> -->
+ <el-button link
+ type="primary"
+ @click="openFileDialog(scope.row)">闄勪欢</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </el-card>
<!-- 鐢ㄥ嵃鐢宠瀵硅瘽妗嗭紙宸茬Щ闄わ級 -->
-
<!-- 瑙勭珷鍒跺害鍙戝竷瀵硅瘽妗� -->
- <el-dialog v-model="showRegulationDialog" :title="operationType === 'add' ? '鍙戝竷鍒跺害' : '缂栬緫鍒跺害'" width="800px">
- <el-form :model="regulationForm" :rules="regulationRules" ref="regulationFormRef" label-width="100px">
- <el-form-item label="鍒跺害缂栧彿" prop="regulationNum">
- <el-input v-model="regulationForm.regulationNum" placeholder="璇疯緭鍏ュ埗搴︾紪鍙�" />
+ <el-dialog v-model="showRegulationDialog"
+ :title="operationType === 'add' ? '鍙戝竷鍒跺害' : '缂栬緫鍒跺害'"
+ width="800px">
+ <el-form :model="regulationForm"
+ :rules="regulationRules"
+ ref="regulationFormRef"
+ label-width="100px">
+ <el-form-item label="鍒跺害缂栧彿"
+ prop="regulationNum">
+ <el-input v-model="regulationForm.regulationNum"
+ placeholder="璇疯緭鍏ュ埗搴︾紪鍙�" />
</el-form-item>
- <el-form-item label="鍒跺害鏍囬" prop="title">
- <el-input v-model="regulationForm.title" placeholder="璇疯緭鍏ュ埗搴︽爣棰�" />
+ <el-form-item label="鍒跺害鏍囬"
+ prop="title">
+ <el-input v-model="regulationForm.title"
+ placeholder="璇疯緭鍏ュ埗搴︽爣棰�" />
</el-form-item>
- <el-form-item label="鍒跺害鍒嗙被" prop="category">
- <el-select v-model="regulationForm.category" placeholder="璇烽�夋嫨鍒跺害鍒嗙被" style="width: 100%">
- <el-option label="浜轰簨鍒跺害" value="hr" />
- <el-option label="璐㈠姟鍒跺害" value="finance" />
- <el-option label="瀹夊叏鍒跺害" value="safety" />
- <el-option label="鎶�鏈埗搴�" value="tech" />
+ <el-form-item label="鍒跺害鍒嗙被"
+ prop="category">
+ <el-select v-model="regulationForm.category"
+ placeholder="璇烽�夋嫨鍒跺害鍒嗙被"
+ style="width: 100%">
+ <el-option label="浜轰簨鍒跺害"
+ value="hr" />
+ <el-option label="璐㈠姟鍒跺害"
+ value="finance" />
+ <el-option label="瀹夊叏鍒跺害"
+ value="safety" />
+ <el-option label="鎶�鏈埗搴�"
+ value="tech" />
</el-select>
</el-form-item>
- <el-form-item label="鍒跺害鍐呭" prop="content">
- <el-input v-model="regulationForm.content" type="textarea" :rows="10" placeholder="璇疯緭鍏ュ埗搴﹁缁嗗唴瀹�" />
+ <el-form-item label="鍒跺害鍐呭"
+ prop="content">
+ <el-input v-model="regulationForm.content"
+ type="textarea"
+ :rows="10"
+ placeholder="璇疯緭鍏ュ埗搴﹁缁嗗唴瀹�" />
</el-form-item>
- <el-form-item label="鍒跺害鐗堟湰" prop="version">
- <el-input v-model="regulationForm.version" placeholder="璇疯緭鍏ュ埗搴︾増鏈�" />
+ <el-form-item label="鍒跺害鐗堟湰"
+ prop="version">
+ <el-input v-model="regulationForm.version"
+ placeholder="璇疯緭鍏ュ埗搴︾増鏈�" />
</el-form-item>
- <el-form-item label="鐢熸晥鏃堕棿" prop="effectiveTime">
- <el-date-picker v-model="regulationForm.effectiveTime" type="datetime" format="YYYY-MM-DD HH:mm:ss"
- value-format="YYYY-MM-DD HH:mm:ss" placeholder="閫夋嫨鐢熸晥鏃堕棿" style="width: 100%" />
+ <el-form-item label="鐢熸晥鏃堕棿"
+ prop="effectiveTime">
+ <el-date-picker v-model="regulationForm.effectiveTime"
+ type="datetime"
+ format="YYYY-MM-DD HH:mm:ss"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ placeholder="閫夋嫨鐢熸晥鏃堕棿"
+ style="width: 100%" />
</el-form-item>
- <el-form-item label="閫傜敤鑼冨洿" prop="scope">
+ <el-form-item label="閫傜敤鑼冨洿"
+ prop="scope">
<el-checkbox-group v-model="regulationForm.scope">
<el-checkbox label="all">鍏ㄤ綋鍛樺伐</el-checkbox>
<el-checkbox label="manager">绠$悊灞�</el-checkbox>
@@ -104,7 +169,8 @@
<el-checkbox label="tech">鎶�鏈儴闂�</el-checkbox>
</el-checkbox-group>
</el-form-item>
- <el-form-item label="鏄惁闇�瑕佺‘璁�" prop="requireConfirm">
+ <el-form-item label="鏄惁闇�瑕佺‘璁�"
+ prop="requireConfirm">
<el-switch v-model="regulationForm.requireConfirm" />
<span class="ml-10">寮�鍚悗鍛樺伐闇�瑕侀槄璇荤‘璁�</span>
</el-form-item>
@@ -112,17 +178,19 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="showRegulationDialog = false">鍙栨秷</el-button>
- <el-button type="primary" @click="submitRegulation">鍙戝竷鍒跺害</el-button>
+ <el-button type="primary"
+ @click="submitRegulation">鍙戝竷鍒跺害</el-button>
</span>
</template>
</el-dialog>
-
<!-- 鐢ㄥ嵃璇︽儏瀵硅瘽妗嗭紙宸茬Щ闄わ級 -->
-
<!-- 瑙勭珷鍒跺害璇︽儏瀵硅瘽妗� -->
- <el-dialog v-model="showRegulationDetailDialog" title="瑙勭珷鍒跺害璇︽儏" width="800px">
+ <el-dialog v-model="showRegulationDetailDialog"
+ title="瑙勭珷鍒跺害璇︽儏"
+ width="800px">
<div v-if="currentRegulationDetail">
- <el-descriptions :column="2" border>
+ <el-descriptions :column="2"
+ border>
<el-descriptions-item label="鍒跺害缂栧彿">{{ currentRegulationDetail.id }}</el-descriptions-item>
<el-descriptions-item label="鍒跺害鏍囬">{{ currentRegulationDetail.title }}</el-descriptions-item>
<el-descriptions-item label="鍒嗙被">{{ getCategoryText(currentRegulationDetail.category) }}</el-descriptions-item>
@@ -135,19 +203,30 @@
<div class="regulation-content">{{ currentRegulationDetail.content }}</div>
</div>
<!-- 濡傛灉tableData>0 鏄剧ず -->
- <div style="margin: 10px 0;" v-if="tableData && tableData.length > 0" >
- <el-button type="success" @click="resetForm(currentRegulationDetail)">纭鏌ョ湅</el-button>
+ <div style="margin: 10px 0;"
+ v-if="tableData && tableData.length > 0">
+ <el-button type="success"
+ @click="resetForm(currentRegulationDetail)">纭鏌ョ湅</el-button>
</div>
</div>
</el-dialog>
-
<!-- 鐗堟湰鍘嗗彶瀵硅瘽妗� -->
- <el-dialog v-model="showVersionHistoryDialog" title="鐗堟湰鍘嗗彶" width="800px">
- <el-table :data="versionHistory" style="width: 100%;margin-bottom: 10px">
- <el-table-column prop="version" label="鐗堟湰鍙�" width="100" />
- <el-table-column prop="updateTime" label="鏇存柊鏃堕棿" width="180" />
- <el-table-column prop="createUserName" label="鏇存柊浜�" width="120" />
- <el-table-column prop="changeLog" label="鍙樻洿璇存槑">
+ <el-dialog v-model="showVersionHistoryDialog"
+ title="鐗堟湰鍘嗗彶"
+ width="800px">
+ <el-table :data="versionHistory"
+ style="width: 100%;margin-bottom: 10px">
+ <el-table-column prop="version"
+ label="鐗堟湰鍙�"
+ width="100" />
+ <el-table-column prop="updateTime"
+ label="鏇存柊鏃堕棿"
+ width="180" />
+ <el-table-column prop="createUserName"
+ label="鏇存柊浜�"
+ width="120" />
+ <el-table-column prop="changeLog"
+ label="鍙樻洿璇存槑">
<template #default="scope">
<el-tag :type="scope.row.status === 'active' ? 'success' : 'info'">
{{ scope.row.status === 'active' ? '鐢熸晥涓�' : '宸插簾姝�' }}
@@ -156,15 +235,27 @@
</el-table-column>
</el-table>
</el-dialog>
-
<!-- 闃呰鐘舵�佸璇濇 -->
- <el-dialog v-model="showReadStatusDialog" title="闃呰鐘舵��" width="800px">
- <el-table :data="readStatusList" style="width: 100%;margin-bottom: 10px">
- <el-table-column prop="employee" label="鍛樺伐濮撳悕" width="120" />
- <el-table-column prop="department" label="鎵�灞為儴闂�" width="150" />
- <el-table-column prop="createTime" label="闃呰鏃堕棿" width="180" />
- <el-table-column prop="confirmTime" label="纭鏃堕棿" width="180" />
- <el-table-column prop="status" label="鐘舵��" width="100">
+ <el-dialog v-model="showReadStatusDialog"
+ title="闃呰鐘舵��"
+ width="800px">
+ <el-table :data="readStatusList"
+ style="width: 100%;margin-bottom: 10px">
+ <el-table-column prop="employee"
+ label="鍛樺伐濮撳悕"
+ width="120" />
+ <el-table-column prop="department"
+ label="鎵�灞為儴闂�"
+ width="150" />
+ <el-table-column prop="createTime"
+ label="闃呰鏃堕棿"
+ width="180" />
+ <el-table-column prop="confirmTime"
+ label="纭鏃堕棿"
+ width="180" />
+ <el-table-column prop="status"
+ label="鐘舵��"
+ width="100">
<template #default="scope">
<el-tag :type="scope.row.status === 'confirmed' ? 'success' : 'warning'">
{{ scope.row.status === 'confirmed' ? '宸茬‘璁�' : '鏈‘璁�' }}
@@ -173,412 +264,437 @@
</el-table-column>
</el-table>
</el-dialog>
-
- <FileListDialog
- ref="fileListDialogRef"
- v-model="fileDialogVisible"
- :show-upload-button="true"
- :show-delete-button="true"
- :delete-method="handleAttachmentDelete"
- :rules-regulations-management-id="currentFileRuleId"
- :name-column-label="'闄勪欢鍚嶇О'"
- @upload="handleAttachmentUpload"
- />
+ <FileListDialog ref="fileListDialogRef"
+ v-model="fileDialogVisible"
+ :show-upload-button="true"
+ :show-delete-button="true"
+ :delete-method="handleAttachmentDelete"
+ :rules-regulations-management-id="currentFileRuleId"
+ :name-column-label="'闄勪欢鍚嶇О'"
+ @upload="handleAttachmentUpload" />
</div>
</template>
<script setup>
-import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { listRuleManagement,addRuleManagement,updateRuleManagement,delRuleManagement,getReadingStatusByRuleId,addReadingStatus,updateReadingStatus } from '@/api/collaborativeApproval/sealManagement.js'
-import FileListDialog from '@/components/Dialog/FileListDialog.vue'
-import { listRuleFiles, delRuleFile, addRuleFile } from '@/api/collaborativeApproval/rulesRegulationsManagementFile.js'
+ import { ref, reactive, onMounted, getCurrentInstance } from "vue";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import {
+ listRuleManagement,
+ addRuleManagement,
+ updateRuleManagement,
+ delRuleManagement,
+ getReadingStatusByRuleId,
+ addReadingStatus,
+ updateReadingStatus,
+ } from "@/api/collaborativeApproval/sealManagement.js";
+ import FileListDialog from "@/components/Dialog/FileListDialog.vue";
+ import {
+ listRuleFiles,
+ delRuleFile,
+ addRuleFile,
+ } from "@/api/collaborativeApproval/rulesRegulationsManagementFile.js";
-// 鍝嶅簲寮忔暟鎹�
-const operationType = ref('add')
-const tableData = ref([])
-const tableLoading = ref(false)
-// 鍒嗛〉鍙傛暟
-const page = reactive({
- current: 1,
- size: 10,
- total: 0
-})
-// 闄勪欢寮圭獥
-const fileDialogVisible = ref(false)
-const fileListDialogRef = ref(null)
-const currentFileRuleId = ref(null)
-const filePage = reactive({
- current: 1,
- size: 10,
- total: 0
-})
-// 瑙勭珷鍒跺害鐩稿叧
-const showRegulationDialog = ref(false)
-const showRegulationDetailDialog = ref(false)
-const showVersionHistoryDialog = ref(false)
-const showReadStatusDialog = ref(false)
-const currentRegulationDetail = ref(null)
-const regulationFormRef = ref()
-const regulationForm = reactive({
- id: '',
- regulationNum: '',
- title: '',
- category: '',
- content: '',
- version: '',
- status: 'active',
- readCount: 0,
- effectiveTime: '',
- scope: [],
- requireConfirm: false
-})
+ // 鍝嶅簲寮忔暟鎹�
+ const operationType = ref("add");
+ const tableData = ref([]);
+ const tableLoading = ref(false);
+ // 鍒嗛〉鍙傛暟
+ const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+ // 闄勪欢寮圭獥
+ const fileDialogVisible = ref(false);
+ const fileListDialogRef = ref(null);
+ const currentFileRuleId = ref(null);
+ const filePage = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+ // 瑙勭珷鍒跺害鐩稿叧
+ const showRegulationDialog = ref(false);
+ const showRegulationDetailDialog = ref(false);
+ const showVersionHistoryDialog = ref(false);
+ const showReadStatusDialog = ref(false);
+ const currentRegulationDetail = ref(null);
+ const regulationFormRef = ref();
+ const regulationForm = reactive({
+ id: "",
+ regulationNum: "",
+ title: "",
+ category: "",
+ content: "",
+ version: "",
+ status: "active",
+ readCount: 0,
+ effectiveTime: "",
+ scope: [],
+ requireConfirm: false,
+ });
-const readStatus = ref({
- id: '',
- ruleId: '',
- employee: '',
- department: '',
- createTime: '',
- confirmTime: '',
- status: 'unconfirmed'
-})
+ const readStatus = ref({
+ id: "",
+ ruleId: "",
+ employee: "",
+ department: "",
+ createTime: "",
+ confirmTime: "",
+ status: "unconfirmed",
+ });
-const regulationRules = {
- title: [{ required: true, message: '璇疯緭鍏ュ埗搴︽爣棰�', trigger: 'blur' }],
- category: [{ required: true, message: '璇烽�夋嫨鍒跺害鍒嗙被', trigger: 'change' }],
- content: [{ required: true, message: '璇疯緭鍏ュ埗搴﹀唴瀹�', trigger: 'blur' }],
- effectiveTime: [{ required: true, message: '璇烽�夋嫨鐢熸晥鏃堕棿', trigger: 'change' }],
- scope: [{ required: true, message: '璇烽�夋嫨閫傜敤鑼冨洿', trigger: 'change' }]
-}
+ const regulationRules = {
+ title: [{ required: true, message: "璇疯緭鍏ュ埗搴︽爣棰�", trigger: "blur" }],
+ category: [{ required: true, message: "璇烽�夋嫨鍒跺害鍒嗙被", trigger: "change" }],
+ content: [{ required: true, message: "璇疯緭鍏ュ埗搴﹀唴瀹�", trigger: "blur" }],
+ effectiveTime: [
+ { required: true, message: "璇烽�夋嫨鐢熸晥鏃堕棿", trigger: "change" },
+ ],
+ scope: [{ required: true, message: "璇烽�夋嫨閫傜敤鑼冨洿", trigger: "change" }],
+ };
-const regulationSearchForm = reactive({
- title: '',
- category: ''
-})
+ const regulationSearchForm = reactive({
+ title: "",
+ category: "",
+ });
-const regulations = ref([])
+ const regulations = ref([]);
-const versionHistory = ref([])
+ const versionHistory = ref([]);
-const readStatusList = ref([])
+ const readStatusList = ref([]);
// { employee: '闄堝織寮�', department: '閿�鍞儴', readTime: '2025-01-11 10:30:00', confirmTime: '2025-01-11 10:35:00', status: 'confirmed' },
// { employee: '鍒橀泤濠�', department: '鎶�鏈儴', readTime: '2025-01-11 14:20:00', confirmTime: '', status: 'unconfirmed' },
// { employee: '鐜嬪缓鍥�', department: '璐㈠姟閮�', readTime: '2025-01-12 09:15:00', confirmTime: '2025-01-12 09:20:00', status: 'confirmed' }
-// 鍒跺害鍒嗙被
-const getCategoryText = (category) => {
- const categoryMap = {
- hr: '浜轰簨鍒跺害',
- finance: '璐㈠姟鍒跺害',
- safety: '瀹夊叏鍒跺害',
- tech: '鎶�鏈埗搴�'
- }
- return categoryMap[category] || '鏈煡'
-}
-// 鎼滅储鍒跺害
-const searchRegulations = () => {
- page.current=1
- getRegulationList()
-}
-// 閲嶇疆鍒跺害鎼滅储
-const resetRegulationSearch = () => {
- regulationSearchForm.title = ''
- regulationSearchForm.category = ''
- searchRegulations()
-}
-// 鏂板
-const handleAdd = () => {
- operationType.value = 'add'
- resetRegulationForm()
- showRegulationDialog.value = true
-}
+ // 鍒跺害鍒嗙被
+ const getCategoryText = category => {
+ const categoryMap = {
+ hr: "浜轰簨鍒跺害",
+ finance: "璐㈠姟鍒跺害",
+ safety: "瀹夊叏鍒跺害",
+ tech: "鎶�鏈埗搴�",
+ };
+ return categoryMap[category] || "鏈煡";
+ };
+ // 鎼滅储鍒跺害
+ const searchRegulations = () => {
+ page.current = 1;
+ getRegulationList();
+ };
+ // 閲嶇疆鍒跺害鎼滅储
+ const resetRegulationSearch = () => {
+ regulationSearchForm.title = "";
+ regulationSearchForm.category = "";
+ searchRegulations();
+ };
+ // 鏂板
+ const handleAdd = () => {
+ operationType.value = "add";
+ resetRegulationForm();
+ showRegulationDialog.value = true;
+ };
-// 缂栬緫
-const handleEdit = (row) => {
- operationType.value = 'edit'
- Object.assign(regulationForm, row)
- showRegulationDialog.value = true
-}
-// 搴熷純
-const repealEdit = (row) => {
- operationType.value = 'edit'
- Object.assign(regulationForm, row)
- regulationForm.status = 'repealed'
- ElMessageBox.confirm('纭搴熷純璇ュ埗搴︼紵', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- updateRuleManagement(regulationForm).then(res => {
- if(res.code == 200){
- ElMessage.success('鍒跺害搴熷純鎴愬姛')
- // showRegulationDialog.value = false
- getRegulationList()
- resetRegulationForm()
- }
+ // 缂栬緫
+ const handleEdit = row => {
+ operationType.value = "edit";
+ Object.assign(regulationForm, row);
+ showRegulationDialog.value = true;
+ };
+ // 搴熷純
+ const repealEdit = row => {
+ operationType.value = "edit";
+ Object.assign(regulationForm, row);
+ regulationForm.status = "repealed";
+ ElMessageBox.confirm("纭搴熷純璇ュ埗搴︼紵", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
- }).catch(() => {
- ElMessage({
- type: 'info',
- message: '宸插彇娑堝簾寮�'
- })
- })
-}
-// 鍙戝竷鍒跺害
-const submitRegulation = async () => {
- try {
- await regulationFormRef.value.validate()
- if(operationType.value == 'add'){
- addRuleManagement(regulationForm).then(res => {
- if(res.code == 200){
- ElMessage.success('鍒跺害鍙戝竷鎴愬姛')
- showRegulationDialog.value = false
- getRegulationList()
- resetRegulationForm()
- }
+ .then(() => {
+ updateRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害搴熷純鎴愬姛");
+ // showRegulationDialog.value = false
+ getRegulationList();
+ resetRegulationForm();
+ }
+ });
})
- }else{
- updateRuleManagement(regulationForm).then(res => {
- if(res.code == 200){
- ElMessage.success('鍒跺害缂栬緫鎴愬姛')
- showRegulationDialog.value = false
- resetRegulationForm()
- getRegulationList()
- }})}
- }catch(err){
- ElMessage.error(err.msg)
- }
-}
-//閲嶇疆鍒跺害琛ㄥ崟
-const resetRegulationForm = () => {
- Object.assign(regulationForm, {
- id: '',
- regulationNum: '',
- title: '',
- category: '',
- content: '',
- version: '',
- status: 'active',
- readCount: 0,
- effectiveTime: '',
- scope: [],
- requireConfirm: false
-})
-}
-
-
-// 鏌ョ湅鍒跺害鐗堟湰鍘嗗彶
-const viewVersionHistory = (row) => {
- showVersionHistoryDialog.value = true
- const params = {
-
- category: row.category
- }
- listRuleManagement(page,params).then(res => {
- if(res.code == 200){
- versionHistory.value = res.data.records
+ .catch(() => {
+ ElMessage({
+ type: "info",
+ message: "宸插彇娑堝簾寮�",
+ });
+ });
+ };
+ // 鍙戝竷鍒跺害
+ const submitRegulation = async () => {
+ try {
+ await regulationFormRef.value.validate();
+ if (operationType.value == "add") {
+ addRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害鍙戝竷鎴愬姛");
+ showRegulationDialog.value = false;
+ getRegulationList();
+ resetRegulationForm();
+ }
+ });
+ } else {
+ updateRuleManagement(regulationForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害缂栬緫鎴愬姛");
+ showRegulationDialog.value = false;
+ resetRegulationForm();
+ getRegulationList();
+ }
+ });
+ }
+ } catch (err) {
+ ElMessage.error(err.msg);
}
- })
-}
-// 鏌ョ湅鍒跺害璇︽儏
-const viewRegulation = (row) => {
- currentRegulationDetail.value = row
- showRegulationDetailDialog.value = true
- getReadingStatusByRuleId(row.id).then(res => {
- if(res.code == 200){
- readStatusList.value = res.data
- if(readStatusList.value.length==0 && tableData.value.length>0){
+ };
+ //閲嶇疆鍒跺害琛ㄥ崟
+ const resetRegulationForm = () => {
+ Object.assign(regulationForm, {
+ id: "",
+ regulationNum: "",
+ title: "",
+ category: "",
+ content: "",
+ version: "",
+ status: "active",
+ readCount: 0,
+ effectiveTime: "",
+ scope: [],
+ requireConfirm: false,
+ });
+ };
+
+ // 鏌ョ湅鍒跺害鐗堟湰鍘嗗彶
+ const viewVersionHistory = row => {
+ showVersionHistoryDialog.value = true;
+ const params = {
+ category: row.category,
+ };
+ listRuleManagement(page, params).then(res => {
+ if (res.code == 200) {
+ versionHistory.value = res.data.records;
+ }
+ });
+ };
+ // 鏌ョ湅鍒跺害璇︽儏
+ const viewRegulation = row => {
+ currentRegulationDetail.value = row;
+ showRegulationDetailDialog.value = true;
+ getReadingStatusByRuleId(row.id).then(res => {
+ if (res.code == 200) {
+ readStatusList.value = res.data;
+ if (readStatusList.value.length == 0 && tableData.value.length > 0) {
const params = {
- ruleId: row.id,
- employee: tableData.value[0].staffName,
- department: tableData.value[0].postJob,
- status: 'unconfirmed'
+ ruleId: row.id,
+ employee: tableData.value[0].staffName,
+ department: tableData.value[0].postJob,
+ status: "unconfirmed",
+ };
+ addReadingStatus(params).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害闃呰鎴愬姛");
+ }
+ });
}
- addReadingStatus(params).then(res => {
- if(res.code == 200){
- ElMessage.success('鍒跺害闃呰鎴愬姛')
- }
- })
}
- }
- })
-
-}
-// 鏌ョ湅鍒跺害闃呰鐘舵��
-const viewReadStatus = (row) => {
- showReadStatusDialog.value = true
- //鏌ョ湅闃呰鐘舵�佸垪琛�
- getReadingStatusByRuleId(row.id).then(res => {
- if(res.code == 200){
- readStatusList.value = res.data
- }
- })
-}
-
-//纭鏌ョ湅
-const resetForm = (row) => {
- console.log("row",row)
- row.readCount = row.readCount + 1
-
- updateRuleManagement(row).then(res => {
- if(res.code == 200){
- ElMessage.success('鏌ョ湅鏁伴噺淇敼鎴愬姛')
- //淇敼闃呰鐘舵��
- //鏍规嵁鍒跺害id鍜屽綋鍓嶇櫥褰曠殑鍛樺伐寰楀埌闃呰鐘舵��
- // let item = readStatusList.value.filter(item => item.employee == tableData.value[0].staffName )
- // if(item.length>0){
- // item[0].status = 'confirmed',
- // item[0].confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
- // }
- // 绛涢�夊綋鍓嶅憳宸ュ搴旇鍒跺害鐨勯槄璇荤姸鎬佽褰�
- let statusItem = readStatusList.value.find(item => item.employee === tableData.value[0].staffName && item.ruleId === row.id);
-
- if (statusItem) {
- // 濡傛灉鎵惧埌璁板綍锛屾洿鏂扮姸鎬佸拰纭鏃堕棿
- statusItem.status = 'confirmed';
- // 鏍煎紡鍖栨椂闂翠负"YYYY-MM-DD HH:mm:ss"鏍煎紡
- const now = new Date();
- statusItem.confirmTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
- // statusItem.confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
-
- updateReadingStatus(statusItem).then(res => {
- if(res.code == 200){
- ElMessage.success('鍒跺害闃呰鐘舵�佷慨鏀规垚鍔�')
- }
- })
+ });
+ };
+ // 鏌ョ湅鍒跺害闃呰鐘舵��
+ const viewReadStatus = row => {
+ showReadStatusDialog.value = true;
+ //鏌ョ湅闃呰鐘舵�佸垪琛�
+ getReadingStatusByRuleId(row.id).then(res => {
+ if (res.code == 200) {
+ readStatusList.value = res.data;
}
+ });
+ };
+ //纭鏌ョ湅
+ const resetForm = row => {
+ console.log("row", row);
+ row.readCount = row.readCount + 1;
+
+ updateRuleManagement(row).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鏌ョ湅鏁伴噺淇敼鎴愬姛");
+ //淇敼闃呰鐘舵��
+ //鏍规嵁鍒跺害id鍜屽綋鍓嶇櫥褰曠殑鍛樺伐寰楀埌闃呰鐘舵��
+ // let item = readStatusList.value.filter(item => item.employee == tableData.value[0].staffName )
+ // if(item.length>0){
+ // item[0].status = 'confirmed',
+ // item[0].confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
+ // }
+ // 绛涢�夊綋鍓嶅憳宸ュ搴旇鍒跺害鐨勯槄璇荤姸鎬佽褰�
+ let statusItem = readStatusList.value.find(
+ item =>
+ item.employee === tableData.value[0].staffName &&
+ item.ruleId === row.id
+ );
+
+ if (statusItem) {
+ // 濡傛灉鎵惧埌璁板綍锛屾洿鏂扮姸鎬佸拰纭鏃堕棿
+ statusItem.status = "confirmed";
+ // 鏍煎紡鍖栨椂闂翠负"YYYY-MM-DD HH:mm:ss"鏍煎紡
+ const now = new Date();
+ statusItem.confirmTime = `${now.getFullYear()}-${String(
+ now.getMonth() + 1
+ ).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")} ${String(
+ now.getHours()
+ ).padStart(2, "0")}:${String(now.getMinutes()).padStart(
+ 2,
+ "0"
+ )}:${String(now.getSeconds()).padStart(2, "0")}`;
+ // statusItem.confirmTime = new Date().toISOString().replace('T', ' ').split('.')[0];
+
+ updateReadingStatus(statusItem).then(res => {
+ if (res.code == 200) {
+ ElMessage.success("鍒跺害闃呰鐘舵�佷慨鏀规垚鍔�");
+ }
+ });
+ }
+ }
+ });
+ };
+
+ // 瀵煎嚭瑙勭珷鍒跺害
+ const { proxy } = getCurrentInstance();
+ const handleExport = () => {
+ proxy.download(
+ "/rulesRegulationsManagement/export",
+ { ...regulationSearchForm },
+ "瑙勭珷鍒跺害.xlsx"
+ );
+ };
+
+ // 闄勪欢锛氭煡璇�
+ const fetchRuleFiles = async rulesRegulationsManagementId => {
+ const params = {
+ current: filePage.current,
+ size: filePage.size,
+ rulesRegulationsManagementId,
+ };
+ const res = await listRuleFiles(params);
+ const records = res?.data?.records || [];
+ filePage.total = res?.data?.total || records.length;
+ const mapped = records.map(item => ({
+ id: item.id,
+ name: item.fileName || item.name,
+ url: item.fileUrl || item.url,
+ raw: item,
+ }));
+ fileListDialogRef.value?.setList(mapped);
+ };
+
+ // 鎵撳紑闄勪欢寮圭獥
+ const openFileDialog = async row => {
+ currentFileRuleId.value = row.id;
+ fileDialogVisible.value = true;
+ await fetchRuleFiles(row.id);
+ };
+
+ // 鍒锋柊闄勪欢鍒楄〃
+ const refreshFileList = async () => {
+ if (!currentFileRuleId.value) return;
+ await fetchRuleFiles(currentFileRuleId.value);
+ };
+
+ // 涓婁紶闄勪欢锛堢敱瀛愮粍浠惰Е鍙戯級
+ const handleAttachmentUpload = async filePayload => {
+ if (!currentFileRuleId.value) return;
+ const payload = {
+ name: filePayload?.fileName || filePayload?.name,
+ url: filePayload?.fileUrl || filePayload?.url,
+ rulesRegulationsManagementId: currentFileRuleId.value,
+ };
+ await addRuleFile(payload);
+ ElMessage.success("鏂囦欢涓婁紶鎴愬姛");
+ await refreshFileList();
+ };
+
+ // 鍒犻櫎闄勪欢
+ const handleAttachmentDelete = async row => {
+ if (!row?.id) return false;
+ try {
+ await ElMessageBox.confirm("纭鍒犻櫎璇ラ檮浠讹紵", "鎻愮ず", { type: "warning" });
+ } catch {
+ return false;
}
- })
-}
+ await delRuleFile([row.id]);
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ await refreshFileList();
+ };
-// 瀵煎嚭瑙勭珷鍒跺害
-const { proxy } = getCurrentInstance()
-const handleExport = () => {
- proxy.download('/rulesRegulationsManagement/export', { ...regulationSearchForm }, '瑙勭珷鍒跺害.xlsx')
-}
+ // 鑾峰彇瑙勭珷鍒跺害鍒楄〃鏁版嵁
+ const getRegulationList = async () => {
+ tableLoading.value = true;
+ listRuleManagement(page, regulationSearchForm)
+ .then(res => {
+ regulations.value = res.data.records;
+ // 杩囨护鎺夊凡搴熷純鐨勫埗搴�
+ // regulations.value = res.data.records.filter(item => item.status !== 'repealed')
+ page.value.total = res.data.total;
+ tableLoading.value = false;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
-// 闄勪欢锛氭煡璇�
-const fetchRuleFiles = async (rulesRegulationsManagementId) => {
- const params = {
- current: filePage.current,
- size: filePage.size,
- rulesRegulationsManagementId
- }
- const res = await listRuleFiles(params)
- const records = res?.data?.records || []
- filePage.total = res?.data?.total || records.length
- const mapped = records.map(item => ({
- id: item.id,
- name: item.fileName || item.name,
- url: item.fileUrl || item.url,
- raw: item
- }))
- fileListDialogRef.value?.setList(mapped)
-}
-
-// 鎵撳紑闄勪欢寮圭獥
-const openFileDialog = async (row) => {
- currentFileRuleId.value = row.id
- fileDialogVisible.value = true
- await fetchRuleFiles(row.id)
-}
-
-// 鍒锋柊闄勪欢鍒楄〃
-const refreshFileList = async () => {
- if (!currentFileRuleId.value) return
- await fetchRuleFiles(currentFileRuleId.value)
-}
-
-// 涓婁紶闄勪欢锛堢敱瀛愮粍浠惰Е鍙戯級
-const handleAttachmentUpload = async (filePayload) => {
- if (!currentFileRuleId.value) return
- const payload = {
- name: filePayload?.fileName || filePayload?.name,
- url: filePayload?.fileUrl || filePayload?.url,
- rulesRegulationsManagementId: currentFileRuleId.value
- }
- await addRuleFile(payload)
- ElMessage.success('鏂囦欢涓婁紶鎴愬姛')
- await refreshFileList()
-}
-
-// 鍒犻櫎闄勪欢
-const handleAttachmentDelete = async (row) => {
- if (!row?.id) return false
- try {
- await ElMessageBox.confirm('纭鍒犻櫎璇ラ檮浠讹紵', '鎻愮ず', { type: 'warning' })
- } catch {
- return false
- }
- await delRuleFile([row.id])
- ElMessage.success('鍒犻櫎鎴愬姛')
- await refreshFileList()
-}
-
-// 鑾峰彇瑙勭珷鍒跺害鍒楄〃鏁版嵁
-const getRegulationList = async () => {
- tableLoading.value = true
- listRuleManagement(page,regulationSearchForm)
- .then(res => {
-
- regulations.value = res.data.records
- // 杩囨护鎺夊凡搴熷純鐨勫埗搴�
- // regulations.value = res.data.records.filter(item => item.status !== 'repealed')
- page.value.total = res.data.total;
- tableLoading.value = false;
-
- }).catch(err => {
- tableLoading.value = false;
- })
-}
-
-onMounted(() => {
- // 鍒濆鍖�
- getRegulationList()
-})
+ onMounted(() => {
+ // 鍒濆鍖�
+ getRegulationList();
+ });
</script>
<style scoped>
-.app-container {
- padding: 20px;
-}
+ .app-container {
+ padding: 20px;
+ }
-.card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
+ .card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
-.tab-content {
- padding: 20px 0;
-}
+ .tab-content {
+ padding: 20px 0;
+ }
-.mb-20 {
- margin-bottom: 20px;
-}
+ .mb-20 {
+ margin-bottom: 20px;
+ }
-.mt-20 {
- margin-top: 20px;
-}
+ .mt-20 {
+ margin-top: 20px;
+ }
-.ml-10 {
- margin-left: 10px;
-}
+ .ml-10 {
+ margin-left: 10px;
+ }
-.regulation-content {
- background-color: #f5f5f5;
- padding: 15px;
- border-radius: 4px;
- line-height: 1.6;
- white-space: pre-wrap;
- height: 200px;
-}
+ .regulation-content {
+ background-color: #f5f5f5;
+ padding: 15px;
+ border-radius: 4px;
+ line-height: 1.6;
+ white-space: pre-wrap;
+ height: 200px;
+ }
-.dialog-footer {
- display: flex;
- justify-content: flex-end;
- gap: 10px;
-}
+ .dialog-footer {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ }
</style>
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index 294561d..db34a7f 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -238,7 +238,7 @@
const getPaymenRecordtList = (supplierId) => {
tableLoadingSon.value = true;
- paymentRecordList({supplierId: supplierId})
+ paymentRecordList(supplierId)
.then((res) => {
tableLoadingSon.value = false;
tableDataSon.value = res.data;
--
Gitblit v1.9.3