| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢ç¥è¯åºå表 |
| | | export function listKnowledgeBase(query) { |
| | | return request({ |
| | | url: "/knowledgeBase/getList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¥è¯¢ç¥è¯åºè¯¦ç» |
| | | // export function getKnowledgeBase(knowledgeBaseId) { |
| | | // return request({ |
| | | // url: "/collaborativeApproval/knowledgeBase/" + knowledgeBaseId, |
| | | // method: "get", |
| | | // }); |
| | | // } |
| | | |
| | | // æ°å¢ç¥è¯åº |
| | | export function addKnowledgeBase(data) { |
| | | return request({ |
| | | url: "/knowledgeBase/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ç¥è¯åº |
| | | export function updateKnowledgeBase(data) { |
| | | return request({ |
| | | url: "/knowledgeBase/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤ç¥è¯åº |
| | | export function delKnowledgeBase(query) { |
| | | return request({ |
| | | url: "/knowledgeBase/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤ç¥è¯åº |
| | | export function delKnowledgeBaseBatch(knowledgeBaseIds) { |
| | | return request({ |
| | | url: "/knowledgeBase/batch", |
| | | method: "delete", |
| | | data: knowledgeBaseIds, |
| | | }); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢å°ç« ç³è¯·å表 |
| | | export function listSealApplication(page,query) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ¥è¯¢è§ç« å¶åº¦å表 |
| | | export function listRuleManagement(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusList(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ ¹æ®è§åidæ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusByRuleId(id) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusByRuleId/"+id, |
| | | method: "get" |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢å°ç« ç³è¯· |
| | | export function addSealApplication(data) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // æ°å¢è§ç« å¶åº¦ |
| | | export function addRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // æ°å¢é
è¯»ç¶æ |
| | | export function addReadingStatus(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/addReadingStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹å°ç« ç³è¯· |
| | | export function updateSealApplication(data) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹è§ç« å¶åº¦ |
| | | export function updateRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹é
è¯»ç¶æ |
| | | export function updateReadingStatus(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/updateReadingStatus", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤å°ç« ç³è¯· |
| | | export function delSealApplication(query) { |
| | | return request({ |
| | | url: "/sealApplicationManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤è§ç« å¶åº¦ |
| | | export function delRuleManagement(query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // æ¹éå é¤ç¥è¯åº |
| | | export function delKnowledgeBaseBatch(knowledgeBaseIds) { |
| | | return request({ |
| | | url: "/knowledgeBase/batch", |
| | | method: "delete", |
| | | data: knowledgeBaseIds, |
| | | }); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // å页æ¥è¯¢è´¢å¡å¯¹è´¦å°è´¦ |
| | | export const getReconciliationPage = (params) => { |
| | | return request({ |
| | | url: "/finance/reconciliation/page", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | // æ°å¢å¯¹è´¦è®°å½ |
| | | export const addReconciliation = (data) => { |
| | | return request({ |
| | | url: "/finance/reconciliation", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | // æ´æ°å¯¹è´¦è®°å½ |
| | | export const updateReconciliation = (data) => { |
| | | return request({ |
| | | url: "/finance/reconciliation", |
| | | method: "put", |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | // å é¤å¯¹è´¦è®°å½ï¼æ¯ææ¹éï¼ |
| | | export const deleteReconciliation = (ids) => { |
| | | return request({ |
| | | url: "/finance/reconciliation", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // å页æ¥è¯¢èµé管çå°è´¦ |
| | | export const getFundsPage = (params) => { |
| | | return request({ |
| | | url: "/finance/funds/page", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | // æ°å¢èµéè®°å½ |
| | | export const addFunds = (data) => { |
| | | return request({ |
| | | url: "/finance/funds", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | // æ´æ°èµéè®°å½ |
| | | export const updateFunds = (data) => { |
| | | return request({ |
| | | url: "/finance/funds", |
| | | method: "put", |
| | | data, |
| | | }); |
| | | }; |
| | | |
| | | // å é¤èµéè®°å½ï¼æ¯ææ¹éï¼ |
| | | export const deleteFunds = (ids) => { |
| | | return request({ |
| | | url: "/finance/funds", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | }; |
| | |
| | | <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> |
| | |
| | | </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" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | 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 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 { 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() |
| | | } |
| | | |
| | | // è·åè§ç« å¶åº¦åè¡¨æ°æ® |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!-- æç´¢åº --> |
| | | <div class="search_form"> |
| | | <el-form :inline="true" :model="searchForm"> |
| | | <el-form-item label="徿¥åä½ï¼"> |
| | | <el-input v-model="searchForm.counterparty" placeholder="请è¾å
¥å¾æ¥åä½" clearable style="width: 180px" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¯¹è´¦ç¶æï¼"> |
| | | <el-select v-model="searchForm.status" placeholder="è¯·éæ©" clearable style="width: 150px"> |
| | | <el-option label="æªå¯¹è´¦" value="pending" /> |
| | | <el-option label="对账ä¸" value="processing" /> |
| | | <el-option label="已宿" value="done" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æ¥æï¼"> |
| | | <el-date-picker |
| | | v-model="searchForm.dateRange" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | /> |
| | | </el-form-item> --> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | <el-button @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- æä½åº --> |
| | | <div class="actions"> |
| | | <el-button type="primary" @click="openDialog('add')">æ°å¢</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | |
| | | <!-- è¡¨æ ¼ --> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | style="width: 100%" |
| | | height="calc(100vh - 280px)" |
| | | :row-key="row => row.id" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center" /> |
| | | <el-table-column prop="accountDate" label="å¯¹è´¦æ¥æ" width="130" show-overflow-tooltip /> |
| | | <el-table-column prop="counterparty" label="徿¥åä½" width="180" show-overflow-tooltip /> |
| | | <el-table-column prop="amount" label="对账éé¢(å
)" width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="statusText" label="ç¶æ" width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="remark" label="夿³¨" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="150" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openDialog('edit', scope.row)">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | |
| | | <!-- å¼¹çª --> |
| | | <el-dialog v-model="dialogVisible" :title="dialogTitle" width="520px" @close="resetForm"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="120px"> |
| | | <el-form-item label="å¯¹è´¦æ¥æï¼" prop="accountDate"> |
| | | <el-date-picker v-model="form.accountDate" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="徿¥åä½ï¼" prop="counterparty"> |
| | | <el-input v-model="form.counterparty" placeholder="请è¾å
¥å¾æ¥åä½" /> |
| | | </el-form-item> |
| | | <el-form-item label="对账éé¢(å
)ï¼" prop="amount"> |
| | | <el-input-number v-model="form.amount" :min="0" :precision="2" :step="100" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æï¼" prop="status"> |
| | | <el-select v-model="form.status" placeholder="è¯·éæ©" style="width: 100%"> |
| | | <el-option label="æªå¯¹è´¦" value="pending" /> |
| | | <el-option label="对账ä¸" value="processing" /> |
| | | <el-option label="已宿" value="done" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { |
| | | getReconciliationPage, |
| | | addReconciliation, |
| | | updateReconciliation, |
| | | deleteReconciliation |
| | | } from '@/api/financialManagement/financialReconciliation.js' |
| | | |
| | | const tableData = ref([]) |
| | | const tableLoading = ref(false) |
| | | const selectedRows = ref([]) |
| | | const dialogVisible = ref(false) |
| | | const dialogTitle = ref('æ°å¢') |
| | | const formRef = ref(null) |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100 |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | const searchForm = reactive({ |
| | | counterparty: '', |
| | | status: '', |
| | | dateRange: [] |
| | | }) |
| | | |
| | | const form = reactive({ |
| | | id: null, |
| | | accountDate: '', |
| | | counterparty: '', |
| | | amount: null, |
| | | status: '', |
| | | remark: '' |
| | | }) |
| | | |
| | | const rules = { |
| | | accountDate: [{ required: true, message: 'è¯·éæ©å¯¹è´¦æ¥æ', trigger: 'change' }], |
| | | counterparty: [{ required: true, message: '请è¾å
¥å¾æ¥åä½', trigger: 'blur' }], |
| | | amount: [{ required: true, message: '请è¾å
¥å¯¹è´¦éé¢', trigger: 'blur' }], |
| | | status: [{ required: true, message: 'è¯·éæ©ç¶æ', trigger: 'change' }] |
| | | } |
| | | |
| | | const statusTextMap = { |
| | | pending: 'æªå¯¹è´¦', |
| | | processing: '对账ä¸', |
| | | done: '已宿' |
| | | } |
| | | |
| | | // è·åå表 |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | const params = { |
| | | ...searchForm, |
| | | current: page.current, |
| | | size: page.size |
| | | } |
| | | if (params.dateRange && params.dateRange.length === 2) { |
| | | params.beginDate = params.dateRange[0] |
| | | params.endDate = params.dateRange[1] |
| | | } |
| | | delete params.dateRange |
| | | |
| | | getReconciliationPage(params) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | tableData.value = (res.data?.records || []).map(item => ({ |
| | | ...item, |
| | | statusText: statusTextMap[item.status] || item.status |
| | | })) |
| | | total.value = res.data?.total || 0 |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const resetQuery = () => { |
| | | searchForm.counterparty = '' |
| | | searchForm.status = '' |
| | | searchForm.dateRange = [] |
| | | handleQuery() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page |
| | | page.size = obj.limit |
| | | getList() |
| | | } |
| | | |
| | | const handleSelectionChange = (rows) => { |
| | | selectedRows.value = rows |
| | | } |
| | | |
| | | const openDialog = (type, row) => { |
| | | dialogTitle.value = type === 'add' ? 'æ°å¢å¯¹è´¦è®°å½' : 'ç¼è¾å¯¹è´¦è®°å½' |
| | | if (type === 'edit' && row) { |
| | | Object.assign(form, row) |
| | | } else { |
| | | resetForm() |
| | | } |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | const resetForm = () => { |
| | | Object.assign(form, { |
| | | id: null, |
| | | date: '', |
| | | counterparty: '', |
| | | amount: null, |
| | | status: '', |
| | | remark: '' |
| | | }) |
| | | } |
| | | |
| | | const submitForm = () => { |
| | | formRef.value?.validate(valid => { |
| | | if (!valid) return |
| | | const payload = { ...form } |
| | | const request = payload.id ? updateReconciliation(payload) : addReconciliation(payload) |
| | | request |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('æäº¤æå') |
| | | dialogVisible.value = false |
| | | getList() |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error(err.msg || 'æäº¤å¤±è´¥') |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | const handleDelete = () => { |
| | | if (!selectedRows.value.length) { |
| | | ElMessage.warning('è¯·éæ©è¦å é¤çè®°å½') |
| | | return |
| | | } |
| | | ElMessageBox.confirm('确认å é¤éä¸è®°å½åï¼', 'æç¤º', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const ids = selectedRows.value.map(r => r.id) |
| | | deleteReconciliation(ids).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('å 餿å') |
| | | getList() |
| | | selectedRows.value = [] |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg || 'å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .app-container { |
| | | padding: 20px; |
| | | |
| | | .search_form { |
| | | background: #fff; |
| | | padding: 16px; |
| | | border-radius: 6px; |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .actions { |
| | | margin-bottom: 12px; |
| | | } |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!-- æç´¢åº --> |
| | | <div class="search_form"> |
| | | <el-form :inline="true" :model="searchForm"> |
| | | <el-form-item label="èµéç±»åï¼"> |
| | | <el-select v-model="searchForm.typeText" placeholder="è¯·éæ©" clearable style="width: 150px"> |
| | | <el-option label="æ¶å
¥" value="æ¶å
¥" /> |
| | | <el-option label="æ¯åº" value="æ¯åº" /> |
| | | <el-option label="å
é¨è½¬è´¦" value="å
é¨è½¬è´¦" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è´¦æ·ï¼"> |
| | | <el-input v-model="searchForm.account" placeholder="请è¾å
¥è´¦æ·" clearable style="width: 160px" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æ¥æï¼"> |
| | | <el-date-picker |
| | | v-model="searchForm.dateRange" |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | /> |
| | | </el-form-item> --> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | <el-button @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- æä½åº --> |
| | | <div class="actions"> |
| | | <el-button type="primary" @click="openDialog('add')">æ°å¢</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | |
| | | <!-- è¡¨æ ¼ --> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | style="width: 100%" |
| | | height="calc(100vh - 280px)" |
| | | :row-key="row => row.id" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center" /> |
| | | <el-table-column prop="accountDate" label="æ¥æ" width="130" show-overflow-tooltip /> |
| | | <el-table-column prop="typeText" label="èµéç±»å" width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="amount" label="éé¢(å
)" width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="account" label="è´¦æ·" width="160" show-overflow-tooltip /> |
| | | <el-table-column prop="counterparty" label="徿¥åä½" width="180" show-overflow-tooltip /> |
| | | <el-table-column prop="remark" label="夿³¨" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="150" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openDialog('edit', scope.row)">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | |
| | | <!-- å¼¹çª --> |
| | | <el-dialog v-model="dialogVisible" :title="dialogTitle" width="520px" @close="resetForm"> |
| | | <el-form :model="form" :rules="rules" ref="formRef" label-width="120px"> |
| | | <el-form-item label="æ¥æï¼" prop="accountDate"> |
| | | <el-date-picker v-model="form.accountDate" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="èµéç±»åï¼" prop="typeText"> |
| | | <el-select v-model="form.typeText" placeholder="è¯·éæ©" style="width: 100%"> |
| | | <el-option label="æ¶å
¥" value="æ¶å
¥" /> |
| | | <el-option label="æ¯åº" value="æ¯åº" /> |
| | | <el-option label="å
é¨è½¬è´¦" value="å
é¨è½¬è´¦" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="éé¢(å
)ï¼" prop="amount"> |
| | | <el-input-number v-model="form.amount" :min="0" :precision="2" :step="100" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="è´¦æ·ï¼" prop="account"> |
| | | <el-input v-model="form.account" placeholder="请è¾å
¥è´¦æ·" /> |
| | | </el-form-item> |
| | | <el-form-item label="徿¥åä½ï¼" prop="counterparty"> |
| | | <el-input v-model="form.counterparty" placeholder="请è¾å
¥å¾æ¥åä½" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { |
| | | getFundsPage, |
| | | addFunds, |
| | | updateFunds, |
| | | deleteFunds |
| | | } from '@/api/financialManagement/fundsManagement.js' |
| | | |
| | | const tableData = ref([]) |
| | | const tableLoading = ref(false) |
| | | const selectedRows = ref([]) |
| | | const dialogVisible = ref(false) |
| | | const dialogTitle = ref('æ°å¢') |
| | | const formRef = ref(null) |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100 |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | const searchForm = reactive({ |
| | | typeText: '', |
| | | account: '', |
| | | dateRange: [] |
| | | }) |
| | | |
| | | const form = reactive({ |
| | | id: null, |
| | | accountDate: '', |
| | | typeText: '', |
| | | amount: null, |
| | | account: '', |
| | | counterparty: '', |
| | | remark: '' |
| | | }) |
| | | |
| | | const rules = { |
| | | accountDate: [{ required: true, message: 'è¯·éæ©æ¥æ', trigger: 'change' }], |
| | | typeText: [{ required: true, message: 'è¯·éæ©èµéç±»å', trigger: 'change' }], |
| | | amount: [{ required: true, message: '请è¾å
¥éé¢', trigger: 'blur' }], |
| | | account: [{ required: true, message: '请è¾å
¥è´¦æ·', trigger: 'blur' }] |
| | | } |
| | | |
| | | const typeTextMap = { |
| | | income: 'æ¶å
¥', |
| | | expense: 'æ¯åº', |
| | | transfer: 'å
é¨è½¬è´¦' |
| | | } |
| | | |
| | | // è·åå表 |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | const params = { |
| | | ...searchForm, |
| | | current: page.current, |
| | | size: page.size |
| | | } |
| | | // å
¼å®¹åç«¯åæ®µï¼è¥åç«¯ä½¿ç¨ typeTextï¼è¯·ç´æ¥ä¼ éï¼è¥ä½¿ç¨ typeï¼è¯·ä¸åç«¯å¯¹é½ |
| | | if (params.dateRange && params.dateRange.length === 2) { |
| | | params.beginDate = params.dateRange[0] |
| | | params.endDate = params.dateRange[1] |
| | | } |
| | | delete params.dateRange |
| | | |
| | | getFundsPage(params) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | tableData.value = (res.data?.records || []).map(item => ({ |
| | | ...item, |
| | | typeText: item.typeText || typeTextMap[item.typeText] || item.typeText |
| | | })) |
| | | total.value = res.data?.total || 0 |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const resetQuery = () => { |
| | | searchForm.typeText = '' |
| | | searchForm.account = '' |
| | | searchForm.dateRange = [] |
| | | handleQuery() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page |
| | | page.size = obj.limit |
| | | getList() |
| | | } |
| | | |
| | | const handleSelectionChange = (rows) => { |
| | | selectedRows.value = rows |
| | | } |
| | | |
| | | const openDialog = (type, row) => { |
| | | dialogTitle.value = type === 'add' ? 'æ°å¢èµéè®°å½' : 'ç¼è¾èµéè®°å½' |
| | | if (type === 'edit' && row) { |
| | | Object.assign(form, row) |
| | | } else { |
| | | resetForm() |
| | | } |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | const resetForm = () => { |
| | | Object.assign(form, { |
| | | id: null, |
| | | accountDate: '', |
| | | typeText: '', |
| | | amount: null, |
| | | account: '', |
| | | counterparty: '', |
| | | remark: '' |
| | | }) |
| | | } |
| | | |
| | | const submitForm = () => { |
| | | formRef.value?.validate(valid => { |
| | | if (!valid) return |
| | | const payload = { ...form } |
| | | const request = payload.id ? updateFunds(payload) : addFunds(payload) |
| | | request |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('æäº¤æå') |
| | | dialogVisible.value = false |
| | | getList() |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error(err.msg || 'æäº¤å¤±è´¥') |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | const handleDelete = () => { |
| | | if (!selectedRows.value.length) { |
| | | ElMessage.warning('è¯·éæ©è¦å é¤çè®°å½') |
| | | return |
| | | } |
| | | ElMessageBox.confirm('确认å é¤éä¸è®°å½åï¼', 'æç¤º', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const ids = selectedRows.value.map(r => r.id) |
| | | deleteFunds(ids).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('å 餿å') |
| | | getList() |
| | | selectedRows.value = [] |
| | | } |
| | | }).catch(err => { |
| | | ElMessage.error(err.msg || 'å é¤å¤±è´¥') |
| | | }) |
| | | }).catch(() => {}) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .app-container { |
| | | padding: 20px; |
| | | |
| | | .search_form { |
| | | background: #fff; |
| | | padding: 16px; |
| | | border-radius: 6px; |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .actions { |
| | | margin-bottom: 12px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¢è¦å¼ï¼" prop="warnNum"> |
| | | <el-input v-model="form.warnNum" placeholder="请è¾å
¥é¢è¦å¼" clearable /> |
| | | <el-input-number v-model="form.warnNum" placeholder="请è¾å
¥é¢è¦å¼" clearable min="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |