Merge remote-tracking branch 'origin/dev' into dev_7004
| | |
| | | }, |
| | | "dependencies": { |
| | | "@element-plus/icons-vue": "2.3.1", |
| | | "@vue-office/docx": "^1.6.3", |
| | | "@vue-office/excel": "^1.7.14", |
| | | "@vueup/vue-quill": "1.2.0", |
| | | "@vueuse/core": "10.11.0", |
| | | "axios": "0.28.1", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢å表 |
| | | export const listPage = (params) => { |
| | | return request({ |
| | | url: "/account/accountExpense/listPage", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | export function add(data) { |
| | | return request({ |
| | | url: "/account/accountExpense/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾ |
| | | export function update(data) { |
| | | return request({ |
| | | url: "/account/accountExpense/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å¯¼åº |
| | | export const exportAccountExpense = (query) => { |
| | | return request({ |
| | | url: "/account/accountExpense/export", |
| | | method: "post", |
| | | data: query, |
| | | responseType: "blob", |
| | | }); |
| | | }; |
| | | |
| | | export const delAccountExpense = (query) => { |
| | | return request({ |
| | | url: `account/accountExpense/del`, |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | }; |
| | | |
| | | export const getAccountExpense = (id) => { |
| | | return request({ |
| | | url: `/account/accountExpense/${id}`, |
| | | method: "get", |
| | | }); |
| | | }; |
| | | |
| | | // æ¥è¯¢éä»¶å表 |
| | | export function fileListPage(query) { |
| | | return request({ |
| | | url: "/account/accountFile/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // ä¿åéä»¶å表 |
| | | export function fileAdd(query) { |
| | | return request({ |
| | | url: "/account/accountFile/add", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤éä»¶å表 |
| | | export function fileDel(query) { |
| | | return request({ |
| | | url: "/account/accountFile/del", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢å表 |
| | | export const listPage = (params) => { |
| | | return request({ |
| | | url: "/account/accountIncome/listPage", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | export function add(data) { |
| | | return request({ |
| | | url: "/account/accountIncome/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾ |
| | | export function update(data) { |
| | | return request({ |
| | | url: "/account/accountIncome/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //å¯¼åº |
| | | export const exportAccountIncome = (query) => { |
| | | return request({ |
| | | url: "/account/accountIncome/export", |
| | | method: "post", |
| | | data: query, |
| | | responseType: "blob", |
| | | }); |
| | | }; |
| | | |
| | | export const delAccountIncome = (query) => { |
| | | return request({ |
| | | url: `account/accountIncome/del`, |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | }; |
| | | |
| | | export const getAccountIncome = (id) => { |
| | | return request({ |
| | | url: `/account/accountIncome/${id}`, |
| | | method: "get", |
| | | }); |
| | | }; |
| | | |
| | | // æ¥è¯¢éä»¶å表 |
| | | export function fileListPage(query) { |
| | | return request({ |
| | | url: "/account/accountFile/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // ä¿åéä»¶å表 |
| | | export function fileAdd(query) { |
| | | return request({ |
| | | url: "/account/accountFile/add", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤éä»¶å表 |
| | | export function fileDel(query) { |
| | | return request({ |
| | | url: "/account/accountFile/del", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | |
| | | padding: 0 !important;
|
| | | }
|
| | | .el-dialog__header {
|
| | | background: #F5F6F7;
|
| | | background: #f5f6f7;
|
| | | padding: 12px 16px;
|
| | | border-radius: 8px 8px 0 0;
|
| | | }
|
| | | .el-dialog__title {
|
| | | font-weight: 400;
|
| | | font-size: 16px;
|
| | | color: #2E3033;
|
| | | color: #2e3033;
|
| | | }
|
| | | .el-dialog__body {
|
| | | padding: 16px 40px 0 40px;
|
| | | max-height: 680px;
|
| | | max-height: 90vh;
|
| | | overflow-y: auto;
|
| | | }
|
| | | .el-dialog__footer {
|
| | |
| | | border-radius: 8px;
|
| | | }
|
| | | .el-message-box__header {
|
| | | background: #F5F6F7;
|
| | | background: #f5f6f7;
|
| | | padding: 12px 16px;
|
| | | border-radius: 8px 8px 0 0;
|
| | | }
|
| | | .el-message-box__title {
|
| | | font-weight: 400;
|
| | | font-size: 16px;
|
| | | color: #2E3033;
|
| | | color: #2e3033;
|
| | | }
|
| | | .el-message-box__content {
|
| | | padding: 16px 40px 0 40px;
|
| | |
| | | .el-table__expanded-cell {
|
| | | padding: 0 !important;
|
| | | .el-table__header-wrapper {
|
| | | background-color: #F5F8FF !important;
|
| | | background-color: #f5f8ff !important;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | // dropdown
|
| | | .el-dropdown-menu {
|
| | | a {
|
| | | display: block
|
| | | display: block;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | display: none;
|
| | | }
|
| | |
|
| | | .el-dropdown .el-dropdown-link{
|
| | | .el-dropdown .el-dropdown-link {
|
| | | color: var(--el-color-primary) !important;
|
| | | } |
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="é¢è§" width="100%" fullscreen align-center :before-close="handleClose" append-to-body> |
| | | <div> |
| | | <!-- å¾çé¢è§ --> |
| | | <div v-if="isImage"> |
| | | <img :src="imgUrl" alt="Image Preview" /> |
| | | </div> |
| | | |
| | | <!-- PDFé¢è§æç¤º --> |
| | | <div v-if="isPdf" style="height: 100vh; display: flex; align-items: center; justify-content: center;"> |
| | | <p>æ£å¨åå¤PDFé¢è§...</p> |
| | | </div> |
| | | |
| | | <!-- Wordææ¡£é¢è§ --> |
| | | <div v-if="isDoc"> |
| | | <p v-if="!isDocShow">ææ¡£æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">ä¸è½½æä»¶</a> |
| | | <vue-office-docx |
| | | v-else |
| | | :src="fileUrl" |
| | | style="height: 100vh;" |
| | | @rendered="renderedHandler" |
| | | @error="errorHandler" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- Excelææ¡£é¢è§ --> |
| | | <div v-if="isXls"> |
| | | <p v-if="!isDocShow">ææ¡£æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">ä¸è½½æä»¶</a> |
| | | <vue-office-excel |
| | | v-else |
| | | :src="fileUrl" |
| | | :options="options" |
| | | style="height: 100vh;" |
| | | @rendered="renderedHandler" |
| | | @error="errorHandler" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- å缩æä»¶å¤ç --> |
| | | <div v-if="isZipOrRar"> |
| | | <p>å缩æä»¶æ æ³ç´æ¥é¢è§ï¼è¯·ä¸è½½æ¥çã</p> |
| | | <a :href="fileUrl">ä¸è½½æä»¶</a> |
| | | </div> |
| | | |
| | | <!-- 䏿¯æçæ ¼å¼ --> |
| | | <div v-if="!isSupported"> |
| | | <p>䏿¯æçæä»¶æ ¼å¼</p> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, getCurrentInstance, watch } from 'vue'; |
| | | import VueOfficeDocx from '@vue-office/docx'; |
| | | import '@vue-office/docx/lib/index.css'; |
| | | import VueOfficeExcel from '@vue-office/excel'; |
| | | import '@vue-office/excel/lib/index.css'; |
| | | |
| | | // ååºå¼åé |
| | | const fileUrl = ref('') |
| | | const dialogVisible = ref(false) |
| | | const { proxy } = getCurrentInstance(); |
| | | const javaApi = proxy.javaApi; |
| | | |
| | | // ææ¡£é¢è§ç¶æ |
| | | const isDocShow = ref(true); |
| | | const imgUrl = ref(''); |
| | | const options = ref({ |
| | | xls: false, |
| | | minColLength: 0, |
| | | minRowLength: 0, |
| | | widthOffset: 10, |
| | | heightOffset: 10, |
| | | beforeTransformData: (workbookData) => workbookData, |
| | | transformData: (workbookData) => workbookData, |
| | | }); |
| | | |
| | | // 计ç®å±æ§ - 夿æä»¶ç±»å |
| | | const isImage = computed(() => { |
| | | const state = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl.value); |
| | | if (state) { |
| | | imgUrl.value = fileUrl.value.replaceAll('word', 'img'); |
| | | } |
| | | return state; |
| | | }); |
| | | |
| | | const isPdf = computed(() => { |
| | | console.log(fileUrl.value) |
| | | return /\.pdf$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isDoc = computed(() => { |
| | | return /\.(doc|docx)$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isXls = computed(() => { |
| | | const state = /\.(xls|xlsx)$/i.test(fileUrl.value); |
| | | if (state) { |
| | | options.value.xls = /\.(xls)$/i.test(fileUrl.value); |
| | | } |
| | | return state; |
| | | }); |
| | | |
| | | const isZipOrRar = computed(() => { |
| | | return /\.(zip|rar)$/i.test(fileUrl.value); |
| | | }); |
| | | |
| | | const isSupported = computed(() => { |
| | | return isImage.value || isPdf.value || isDoc.value || isXls.value || isZipOrRar.value; |
| | | }); |
| | | |
| | | // 卿å建aæ ç¾å¹¶è·³è½¬é¢è§PDF |
| | | const previewPdf = (url) => { |
| | | // å建aæ ç¾ |
| | | const link = document.createElement('a'); |
| | | // 设置PDFæä»¶URL |
| | | link.href = url; |
| | | // 卿°æ ç¾é¡µæå¼ |
| | | link.target = '_blank'; |
| | | // å®å
¨å±æ§ï¼é²æ¢æ°é¡µé¢è®¿é®åé¡µé¢ |
| | | link.rel = 'noopener noreferrer'; |
| | | // å¯éï¼è®¾ç½®é¾æ¥ææ¬ |
| | | link.textContent = 'é¢è§PDF'; |
| | | // å°aæ ç¾æ·»å å°é¡µé¢ï¼é¨åæµè§å¨è¦æ±å¿
é¡»å¨DOMä¸ï¼ |
| | | document.body.appendChild(link); |
| | | // 触åç¹å»äºä»¶ |
| | | link.click(); |
| | | // ç§»é¤aæ ç¾ï¼æ¸
çDOM |
| | | document.body.removeChild(link); |
| | | }; |
| | | |
| | | |
| | | // çå¬PDFç¶æååï¼èªå¨è§¦å跳转 |
| | | watch( |
| | | () => isPdf.value, |
| | | (newVal) => { |
| | | |
| | | // å½ç¡®è®¤æ¯PDF䏿件URLæææ¶ |
| | | if (newVal && fileUrl.value) { |
| | | // å
³éå¯¹è¯æ¡ |
| | | dialogVisible.value = false; |
| | | // å 个å°å»¶è¿ç¡®ä¿ç¶ææ´æ°å®æ |
| | | setTimeout(() => { |
| | | previewPdf(fileUrl.value); |
| | | fileUrl.value = ''; |
| | | }, 100); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | // æ¹æ³å®ä¹ |
| | | const renderedHandler = () => { |
| | | console.log("渲æå®æ"); |
| | | isDocShow.value = true; |
| | | resetStyle(); |
| | | }; |
| | | |
| | | const errorHandler = () => { |
| | | console.log("渲æå¤±è´¥"); |
| | | isDocShow.value = false; |
| | | }; |
| | | |
| | | const open = (url) => { |
| | | fileUrl.value = window.location.protocol+'//'+window.location.host+ url; |
| | | dialogVisible.value = true; |
| | | }; |
| | | const handleClose = () => { |
| | | dialogVisible.value = false; |
| | | }; |
| | | |
| | | const resetStyle = () => { |
| | | const elements = document.querySelectorAll('[style*="pt"]'); |
| | | for (const element of elements) { |
| | | const style = element.getAttribute('style'); |
| | | if (style) { |
| | | element.setAttribute('style', style.replace(/pt/g, 'px')); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // æ´é²openæ¹æ³ä¾å¤é¨è°ç¨ |
| | | defineExpose({ |
| | | open |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped> |
| | | img { |
| | | max-width: 100%; |
| | | display: block; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .oneLine { |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | </style> |
| | |
| | | import { createApp } from 'vue'
|
| | | import { createApp } from "vue";
|
| | |
|
| | | import Cookies from 'js-cookie'
|
| | | import Cookies from "js-cookie";
|
| | |
|
| | | import ElementPlus from 'element-plus'
|
| | | import 'element-plus/dist/index.css'
|
| | | import 'element-plus/theme-chalk/dark/css-vars.css'
|
| | | import locale from 'element-plus/es/locale/lang/zh-cn'
|
| | | import ElementPlus from "element-plus";
|
| | | import "element-plus/dist/index.css";
|
| | | import "element-plus/theme-chalk/dark/css-vars.css";
|
| | | import locale from "element-plus/es/locale/lang/zh-cn";
|
| | |
|
| | | import '@/assets/styles/index.scss' // global css
|
| | | import "@/assets/styles/index.scss"; // global css
|
| | |
|
| | | import App from './App'
|
| | | import store from './store'
|
| | | import router from './router'
|
| | | import directive from './directive' // directive
|
| | | import App from "./App";
|
| | | import store from "./store";
|
| | | import router from "./router";
|
| | | import directive from "./directive"; // directive
|
| | |
|
| | | // 注åæä»¤
|
| | | import plugins from './plugins' // plugins
|
| | | import { download } from '@/utils/request'
|
| | | import plugins from "./plugins"; // plugins
|
| | | import { download } from "@/utils/request";
|
| | |
|
| | | // svg徿
|
| | | import 'virtual:svg-icons-register'
|
| | | import SvgIcon from '@/components/SvgIcon'
|
| | | import elementIcons from '@/components/SvgIcon/svgicon'
|
| | | import "virtual:svg-icons-register";
|
| | | import SvgIcon from "@/components/SvgIcon";
|
| | | import elementIcons from "@/components/SvgIcon/svgicon";
|
| | |
|
| | | import './permission' // permission control
|
| | | import "./permission"; // permission control
|
| | |
|
| | | import { useDict } from '@/utils/dict'
|
| | | import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
|
| | | import { useDict } from "@/utils/dict";
|
| | | import {
|
| | | parseTime,
|
| | | resetForm,
|
| | | addDateRange,
|
| | | handleTree,
|
| | | selectDictLabel,
|
| | | selectDictLabels,
|
| | | } from "@/utils/ruoyi";
|
| | |
|
| | | // å页ç»ä»¶
|
| | | import Pagination from '@/components/Pagination'
|
| | | import Pagination from "@/components/Pagination";
|
| | | // èªå®ä¹è¡¨æ ¼å·¥å
·ç»ä»¶
|
| | | import RightToolbar from '@/components/RightToolbar'
|
| | | import RightToolbar from "@/components/RightToolbar";
|
| | | // 坿æ¬ç»ä»¶
|
| | | import Editor from "@/components/Editor"
|
| | | import Editor from "@/components/Editor";
|
| | | // æä»¶ä¸ä¼ ç»ä»¶
|
| | | import FileUpload from "@/components/FileUpload"
|
| | | import FileUpload from "@/components/FileUpload";
|
| | | // å¾çä¸ä¼ ç»ä»¶
|
| | | import ImageUpload from "@/components/ImageUpload"
|
| | | import ImageUpload from "@/components/ImageUpload";
|
| | | // å¾çé¢è§ç»ä»¶
|
| | | import ImagePreview from "@/components/ImagePreview"
|
| | | import ImagePreview from "@/components/ImagePreview";
|
| | | // åå
¸æ ç¾ç»ä»¶
|
| | | import DictTag from '@/components/DictTag'
|
| | | import DictTag from "@/components/DictTag";
|
| | | // è¡¨æ ¼ç»ä»¶
|
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue";
|
| | |
|
| | | import { getToken } from "@/utils/auth";
|
| | | import {calculateTaxExclusiveTotalPrice, summarizeTable,calculateTaxIncludeTotalPrice} from "@/utils/summarizeTable.js";
|
| | | import {
|
| | | calculateTaxExclusiveTotalPrice,
|
| | | summarizeTable,
|
| | | calculateTaxIncludeTotalPrice,
|
| | | } from "@/utils/summarizeTable.js";
|
| | |
|
| | | const app = createApp(App)
|
| | | const app = createApp(App);
|
| | |
|
| | | // å
¨å±æ¹æ³æè½½
|
| | | app.config.globalProperties.useDict = useDict
|
| | | app.config.globalProperties.download = download
|
| | | app.config.globalProperties.parseTime = parseTime
|
| | | app.config.globalProperties.resetForm = resetForm
|
| | | app.config.globalProperties.summarizeTable = summarizeTable
|
| | | app.config.globalProperties.calculateTaxExclusiveTotalPrice = calculateTaxExclusiveTotalPrice
|
| | | app.config.globalProperties.calculateTaxIncludeTotalPrice = calculateTaxIncludeTotalPrice
|
| | | app.config.globalProperties.handleTree = handleTree
|
| | | app.config.globalProperties.addDateRange = addDateRange
|
| | | app.config.globalProperties.selectDictLabel = selectDictLabel
|
| | | app.config.globalProperties.selectDictLabels = selectDictLabels
|
| | | app.config.globalProperties.javaApi = 'http://114.132.189.42:8078'
|
| | | app.config.globalProperties.useDict = useDict;
|
| | | app.config.globalProperties.download = download;
|
| | | app.config.globalProperties.parseTime = parseTime;
|
| | | app.config.globalProperties.resetForm = resetForm;
|
| | | app.config.globalProperties.summarizeTable = summarizeTable;
|
| | | app.config.globalProperties.calculateTaxExclusiveTotalPrice =
|
| | | calculateTaxExclusiveTotalPrice;
|
| | | app.config.globalProperties.calculateTaxIncludeTotalPrice =
|
| | | calculateTaxIncludeTotalPrice;
|
| | | app.config.globalProperties.handleTree = handleTree;
|
| | | app.config.globalProperties.addDateRange = addDateRange;
|
| | | app.config.globalProperties.selectDictLabel = selectDictLabel;
|
| | | app.config.globalProperties.selectDictLabels = selectDictLabels;
|
| | | app.config.globalProperties.javaApi = "http://114.132.189.42:8099";
|
| | | app.config.globalProperties.HaveJson = (val) => {
|
| | | return JSON.parse(JSON.stringify(val));
|
| | | };
|
| | |
| | | };
|
| | |
|
| | | // å
¨å±ç»ä»¶æè½½
|
| | | app.component('DictTag', DictTag)
|
| | | app.component('Pagination', Pagination)
|
| | | app.component('FileUpload', FileUpload)
|
| | | app.component('ImageUpload', ImageUpload)
|
| | | app.component('ImagePreview', ImagePreview)
|
| | | app.component('RightToolbar', RightToolbar)
|
| | | app.component('Editor', Editor)
|
| | | app.component('PIMTable', PIMTable)
|
| | | app.component("DictTag", DictTag);
|
| | | app.component("Pagination", Pagination);
|
| | | app.component("FileUpload", FileUpload);
|
| | | app.component("ImageUpload", ImageUpload);
|
| | | app.component("ImagePreview", ImagePreview);
|
| | | app.component("RightToolbar", RightToolbar);
|
| | | app.component("Editor", Editor);
|
| | | app.component("PIMTable", PIMTable);
|
| | |
|
| | | app.use(router)
|
| | | app.use(store)
|
| | | app.use(plugins)
|
| | | app.use(elementIcons)
|
| | | app.component('svg-icon', SvgIcon)
|
| | | app.use(router);
|
| | | app.use(store);
|
| | | app.use(plugins);
|
| | | app.use(elementIcons);
|
| | | app.component("svg-icon", SvgIcon);
|
| | |
|
| | | directive(app)
|
| | | directive(app);
|
| | |
|
| | | // 使ç¨element-plus å¹¶ä¸è®¾ç½®å
¨å±ç大å°
|
| | | app.use(ElementPlus, {
|
| | | locale: locale,
|
| | | // æ¯æ largeãdefaultãsmall
|
| | | size: Cookies.get('size') || 'default'
|
| | | })
|
| | | app._context.components.ElDialog.props.closeOnClickModal.default = false
|
| | | size: Cookies.get("size") || "default",
|
| | | });
|
| | | app._context.components.ElDialog.props.closeOnClickModal.default = false;
|
| | |
|
| | | app.mount('#app')
|
| | | app.mount("#app");
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form :model="form" label-width="100px" :rules="formRules" ref="formRef"> |
| | | <el-form-item label="æ¯åºæ¥æ" prop="expenseDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.expenseDate" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯åºç±»å" prop="expenseType"> |
| | | <el-select |
| | | v-model="form.expenseType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in expense_types" :key="index" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ä¾åºååç§°" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯åºéé¢" prop="expenseMoney"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | v-model="form.expenseMoney" |
| | | placeholder="请è¾å
¥" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯åºæè¿°" prop="expenseDescribed"> |
| | | <el-input v-model="form.expenseDescribed" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="仿¬¾æ¹å¼" prop="expenseMethod"> |
| | | <el-select |
| | | v-model="form.expenseMethod" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in checkout_payment" :key="index" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å票å·ç " prop="invoiceNumber"> |
| | | <el-input v-model="form.invoiceNumber" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="note"> |
| | | <el-input |
| | | v-model="form.note" |
| | | placeholder="夿³¨" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { getAccountExpense } from "@/api/financialManagement/expenseManagement"; |
| | | import {ref} from "vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | |
| | | defineOptions({ |
| | | name: "æ°å¢æ¯åº", |
| | | }); |
| | | const { expense_types } = proxy.useDict("expense_types"); |
| | | const { checkout_payment } = proxy.useDict("checkout_payment"); |
| | | const formRef = ref(null); |
| | | const formRules = { |
| | | supplierName: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | expenseMoney: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | expenseDescribed: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | expenseDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | expenseType: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | expenseMethod: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | } |
| | | |
| | | const { form, resetForm } = useFormData({ |
| | | expenseDate: undefined, // æ¯åºæ¥æ |
| | | expenseType: undefined, // æ¯åºç±»å |
| | | supplierName: undefined, // 客æ·åç§° |
| | | expenseMoney: undefined, // æ¯åºéé¢ |
| | | expenseDescribed: undefined, // æ¯åºæè¿° |
| | | expenseMethod: undefined, // æ¶æ¬¾æ¹å¼ |
| | | invoiceNumber: undefined, // å票å·ç |
| | | note: undefined, // 夿³¨ |
| | | }); |
| | | |
| | | const loadForm = async (id) => { |
| | | const { code, data } = await getAccountExpense(id); |
| | | if (code == 200) { |
| | | form.expenseDate = data.expenseDate; |
| | | form.expenseType = data.expenseType; |
| | | form.supplierName = data.supplierName; |
| | | form.expenseMoney = data.expenseMoney; |
| | | form.expenseDescribed = data.expenseDescribed; |
| | | form.expenseMethod = data.expenseMethod; |
| | | form.invoiceNumber = data.invoiceNumber; |
| | | form.note = data.note; |
| | | } |
| | | }; |
| | | |
| | | // æ¸
é¤è¡¨åæ ¡éªç¶æ |
| | | const clearValidate = () => { |
| | | formRef.value?.clearValidate(); |
| | | }; |
| | | |
| | | // éç½®è¡¨åæ°æ®åæ ¡éªç¶æ |
| | | const resetFormAndValidate = () => { |
| | | resetForm(); |
| | | clearValidate(); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | form, |
| | | loadForm, |
| | | resetForm, |
| | | clearValidate, |
| | | resetFormAndValidate, |
| | | formRef, |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :title="modalOptions.title" v-model="visible" @close="close" width="30%"> |
| | | <Form ref="formRef"></Form> |
| | | <template #footer> |
| | | <el-button type="primary" @click="sendForm" :loading="loading"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { useModal } from "@/hooks/useModal"; |
| | | import { add, update } from "@/api/financialManagement/expenseManagement"; |
| | | import Form from "./Form.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | defineOptions({ |
| | | name: "æ¯åºæ°å¢ç¼è¾", |
| | | }); |
| | | |
| | | const emits = defineEmits(["success"]); |
| | | |
| | | const formRef = ref(); |
| | | const { |
| | | id, |
| | | visible, |
| | | loading, |
| | | openModal, |
| | | modalOptions, |
| | | handleConfirm, |
| | | closeModal, |
| | | } = useModal({ title: "æ¯åº" }); |
| | | |
| | | const sendForm = () => { |
| | | proxy.$refs.formRef.$refs.formRef.validate(async valid => { |
| | | if (valid) { |
| | | const {code} = id.value |
| | | ? await update({id: id.value, ...formRef.value.form}) |
| | | : await add(formRef.value.form); |
| | | if (code == 200) { |
| | | emits("success"); |
| | | ElMessage({message: "æä½æå", type: "success"}); |
| | | close(); |
| | | } else { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | }) |
| | | }; |
| | | |
| | | const close = () => { |
| | | formRef.value.resetFormAndValidate(); |
| | | closeModal(); |
| | | }; |
| | | |
| | | const loadForm = async (id) => { |
| | | openModal(id); |
| | | await nextTick(); |
| | | formRef.value.loadForm(id); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openModal, |
| | | loadForm, |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="å½å
¥æ¥æ:"> |
| | | <el-date-picker v-model="filters.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | </el-form-item> |
| | | <el-form-item label="仿¬¾æ¹å¼:"> |
| | | <el-select |
| | | v-model="filters.expenseMethod" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 200px;" |
| | | > |
| | | <el-option |
| | | v-for="item in checkout_payment" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">æç´¢</el-button> |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <el-button type="primary" @click="add" icon="Plus"> æ°å¢ </el-button> |
| | | <el-button @click="handleOut" icon="download">导åº</el-button> |
| | | <el-button |
| | | type="danger" |
| | | icon="Delete" |
| | | :disabled="multipleList.length <= 0" |
| | | @click="deleteRow(multipleList.map((item) => item.id))" |
| | | > |
| | | æ¹éå é¤ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | | isSelection |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" text @click="edit(row.id)" icon="editPen"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | @click="openFilesFormDia(row)" |
| | | > |
| | | éä»¶ |
| | | </el-button> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <Modal ref="modalRef" @success="getTableData"></Modal> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { usePaginationApi } from "@/hooks/usePaginationApi"; |
| | | import { listPage, delAccountExpense } from "@/api/financialManagement/expenseManagement"; |
| | | import { onMounted, getCurrentInstance } from "vue"; |
| | | import Modal from "./Modal.vue"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import FilesDia from "../revenueManagement/filesDia.vue"; |
| | | |
| | | defineOptions({ |
| | | name: "æ¯åºç®¡ç", |
| | | }); |
| | | |
| | | // è¡¨æ ¼å¤éæ¡éä¸é¡¹ |
| | | const multipleList = ref([]); |
| | | const { proxy } = getCurrentInstance(); |
| | | const modalRef = ref(); |
| | | const { checkout_payment } = proxy.useDict("checkout_payment"); |
| | | const { expense_types } = proxy.useDict("expense_types"); |
| | | const filesDia = ref() |
| | | |
| | | const { |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | listPage, |
| | | { |
| | | expenseMethod: undefined, |
| | | }, |
| | | [ |
| | | { |
| | | label: "æ¯åºæ¥æ", |
| | | align: "center", |
| | | prop: "expenseDate", |
| | | }, |
| | | { |
| | | label: "æ¯åºç±»å", |
| | | align: "center", |
| | | prop: "expenseType", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (expense_types.value.find((m) => m.value == params)) { |
| | | return expense_types.value.find((m) => m.value == params).label; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "ä¾åºååç§°", |
| | | align: "center", |
| | | prop: "supplierName", |
| | | |
| | | }, |
| | | { |
| | | label: "æ¯åºéé¢", |
| | | align: "center", |
| | | prop: "expenseMoney", |
| | | |
| | | }, |
| | | { |
| | | label: "æ¯åºæè¿°", |
| | | align: "center", |
| | | prop: "expenseDescribed", |
| | | |
| | | }, |
| | | { |
| | | label: "仿¬¾æ¹å¼", |
| | | align: "center", |
| | | prop: "expenseMethod", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (checkout_payment.value.find((m) => m.value == params)) { |
| | | return checkout_payment.value.find((m) => m.value == params).label; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "å票å·ç ", |
| | | align: "center", |
| | | prop: "invoiceNumber", |
| | | |
| | | }, |
| | | { |
| | | label: "夿³¨", |
| | | align: "center", |
| | | prop: "note", |
| | | |
| | | }, |
| | | { |
| | | label: "å½å
¥äºº", |
| | | align: "center", |
| | | prop: "inputUser", |
| | | }, |
| | | { |
| | | label: "å½å
¥æ¥æ", |
| | | align: "center", |
| | | prop: "inputTime", |
| | | |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "æä½", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | |
| | | // å¤éååä»ä¹ |
| | | const handleSelectionChange = (selectionList) => { |
| | | multipleList.value = selectionList; |
| | | }; |
| | | |
| | | const add = () => { |
| | | modalRef.value.openModal(); |
| | | }; |
| | | const edit = (id) => { |
| | | modalRef.value.loadForm(id); |
| | | }; |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | const deleteRow = (id) => { |
| | | ElMessageBox.confirm("æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(async () => { |
| | | const { code } = await delAccountExpense(id); |
| | | if (code == 200) { |
| | | ElMessage({ |
| | | type: "success", |
| | | message: "å 餿å", |
| | | }); |
| | | getTableData(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const changeDaterange = (value) => { |
| | | if (value) { |
| | | filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | | } else { |
| | | filters.entryDateStart = undefined; |
| | | filters.entryDateEnd = undefined; |
| | | } |
| | | getTableData(); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download(`/account/accountExpense/export`, {}, "æ¯åºå°è´¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // æå¼éä»¶å¼¹æ¡ |
| | | const openFilesFormDia = (row) => { |
| | | nextTick(() => { |
| | | filesDia.value?.openDialog( row,'æ¯åº') |
| | | }) |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | filters.entryDate = [ |
| | | dayjs().format("YYYY-MM-DD"), |
| | | dayjs().add(1, "day").format("YYYY-MM-DD"), |
| | | ] |
| | | filters.entryDateStart = dayjs().format("YYYY-MM-DD") |
| | | filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD") |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form :model="form" label-width="100px" :rules="formRules" ref="formRef"> |
| | | <el-form-item label="æ¶å
¥æ¥æ" prop="incomeDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.incomeDate" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶å
¥ç±»å" prop="incomeType"> |
| | | <el-select |
| | | v-model="form.incomeType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in income_types" :key="index" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·åç§°" prop="customerName"> |
| | | <el-input v-model="form.customerName" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶å
¥éé¢" prop="incomeMoney"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | v-model="form.incomeMoney" |
| | | placeholder="请è¾å
¥" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶å
¥æè¿°" prop="incomeDescribed"> |
| | | <el-input v-model="form.incomeDescribed" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶æ¬¾æ¹å¼" prop="incomeMethod"> |
| | | <el-select |
| | | v-model="form.incomeMethod" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option :label="item.label" :value="item.value" v-for="(item,index) in payment_methods" :key="index" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å票å·ç " prop="invoiceNumber"> |
| | | <el-input v-model="form.invoiceNumber" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="note"> |
| | | <el-input |
| | | v-model="form.note" |
| | | placeholder="夿³¨" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { getAccountIncome } from "@/api/financialManagement/revenueManagement"; |
| | | import {ref} from "vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | |
| | | defineOptions({ |
| | | name: "æ°å¢æ¶å
¥", |
| | | }); |
| | | const { income_types } = proxy.useDict("income_types"); |
| | | const { payment_methods } = proxy.useDict("payment_methods"); |
| | | const formRef = ref(null); |
| | | const formRules = { |
| | | customerName: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | incomeMoney: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | incomeDescribed: [{ required: true, trigger: "blur", message: "请è¾å
¥" }], |
| | | incomeDate: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | incomeType: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | incomeMethod: [{ required: true, trigger: "change", message: "è¯·éæ©" }], |
| | | } |
| | | |
| | | const { form, resetForm } = useFormData({ |
| | | incomeDate: undefined, // æ¶å
¥æ¥æ |
| | | incomeType: undefined, // æ¶å
¥ç±»å |
| | | customerName: undefined, // 客æ·åç§° |
| | | incomeMoney: undefined, // æ¶å
¥éé¢ |
| | | incomeDescribed: undefined, // æ¶å
¥æè¿° |
| | | incomeMethod: undefined, // æ¶æ¬¾æ¹å¼ |
| | | invoiceNumber: undefined, // å票å·ç |
| | | note: undefined, // 夿³¨ |
| | | }); |
| | | |
| | | const loadForm = async (id) => { |
| | | const { code, data } = await getAccountIncome(id); |
| | | if (code == 200) { |
| | | form.incomeDate = data.incomeDate; |
| | | form.incomeType = data.incomeType; |
| | | form.customerName = data.customerName; |
| | | form.incomeMoney = data.incomeMoney; |
| | | form.incomeDescribed = data.incomeDescribed; |
| | | form.incomeMethod = data.incomeMethod; |
| | | form.invoiceNumber = data.invoiceNumber; |
| | | form.note = data.note; |
| | | } |
| | | }; |
| | | |
| | | // æ¸
é¤è¡¨åæ ¡éªç¶æ |
| | | const clearValidate = () => { |
| | | formRef.value?.clearValidate(); |
| | | }; |
| | | |
| | | // éç½®è¡¨åæ°æ®åæ ¡éªç¶æ |
| | | const resetFormAndValidate = () => { |
| | | resetForm(); |
| | | clearValidate(); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | form, |
| | | loadForm, |
| | | resetForm, |
| | | clearValidate, |
| | | resetFormAndValidate, |
| | | formRef, |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :title="modalOptions.title" v-model="visible" @close="close" width="30%"> |
| | | <Form ref="formRef"></Form> |
| | | <template #footer> |
| | | <el-button type="primary" @click="sendForm" :loading="loading"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { useModal } from "@/hooks/useModal"; |
| | | import { add, update } from "@/api/financialManagement/revenueManagement"; |
| | | import Form from "./Form.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | defineOptions({ |
| | | name: "æ¶å
¥æ°å¢ç¼è¾", |
| | | }); |
| | | |
| | | const emits = defineEmits(["success"]); |
| | | |
| | | const formRef = ref(); |
| | | const { |
| | | id, |
| | | visible, |
| | | loading, |
| | | openModal, |
| | | modalOptions, |
| | | handleConfirm, |
| | | closeModal, |
| | | } = useModal({ title: "æ¶å
¥" }); |
| | | |
| | | const sendForm = () => { |
| | | proxy.$refs.formRef.$refs.formRef.validate(async valid => { |
| | | if (valid) { |
| | | const {code} = id.value |
| | | ? await update({id: id.value, ...formRef.value.form}) |
| | | : await add(formRef.value.form); |
| | | if (code == 200) { |
| | | emits("success"); |
| | | ElMessage({message: "æä½æå", type: "success"}); |
| | | close(); |
| | | } else { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | }) |
| | | }; |
| | | |
| | | const close = () => { |
| | | formRef.value.resetFormAndValidate(); |
| | | closeModal(); |
| | | }; |
| | | |
| | | const loadForm = async (id) => { |
| | | openModal(id); |
| | | await nextTick(); |
| | | formRef.value.loadForm(id); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openModal, |
| | | loadForm, |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | title="ä¸ä¼ éä»¶" |
| | | width="50%" |
| | | @close="closeDia" |
| | | > |
| | | <div style="margin-bottom: 10px;text-align: right"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | :action="uploadUrl" |
| | | :on-success="handleUploadSuccess" |
| | | :on-error="handleUploadError" |
| | | name="file" |
| | | :show-file-list="false" |
| | | :headers="headers" |
| | | style="display: inline;margin-right: 10px" |
| | | > |
| | | <el-button type="primary">ä¸ä¼ éä»¶</el-button> |
| | | </el-upload> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | height="500" |
| | | > |
| | | </PIMTable> |
| | | <pagination |
| | | style="margin: 10px 0" |
| | | v-show="total > 0" |
| | | @pagination="paginationSearch" |
| | | :total="total" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | /> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <filePreview ref="filePreviewRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {getToken} from "@/utils/auth.js"; |
| | | import filePreview from '@/components/filePreview/index.vue' |
| | | import { |
| | | fileAdd, |
| | | fileDel, |
| | | fileListPage |
| | | } from "@/api/financialManagement/revenueManagement.js"; |
| | | import Pagination from "@/components/PIMTable/Pagination.vue"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const currentId = ref('') |
| | | const selectedRows = ref([]); |
| | | const filePreviewRef = ref() |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "æä»¶åç§°", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | operation: [ |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "é¢è§", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | lookFile(row); |
| | | }, |
| | | } |
| | | ], |
| | | }, |
| | | ]); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }); |
| | | const total = ref(0); |
| | | const tableData = ref([]); |
| | | const fileList = ref([]); |
| | | const tableLoading = ref(false); |
| | | const accountType = ref('') |
| | | const headers = ref({ |
| | | Authorization: "Bearer " + getToken(), |
| | | }); |
| | | const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // ä¸ä¼ çå¾çæå¡å¨å°å |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = (row,type) => { |
| | | accountType.value = type; |
| | | dialogFormVisible.value = true; |
| | | currentId.value = row.id; |
| | | getList() |
| | | } |
| | | const paginationSearch = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | fileListPage({accountId: currentId.value,accountType:accountType.value, ...page}).then(res => { |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | | }) |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | dialogFormVisible.value = false; |
| | | emit('close') |
| | | }; |
| | | // ä¸ä¼ æåå¤ç |
| | | function handleUploadSuccess(res, file) { |
| | | // 妿ä¸ä¼ æå |
| | | if (res.code == 200) { |
| | | const fileRow = {} |
| | | fileRow.name = res.data.originalName |
| | | fileRow.url = res.data.tempPath |
| | | uploadFile(fileRow) |
| | | } else { |
| | | proxy.$modal.msgError("æä»¶ä¸ä¼ 失败"); |
| | | } |
| | | } |
| | | function uploadFile(file) { |
| | | file.accountId = currentId.value; |
| | | file.accountType = accountType.value; |
| | | fileAdd(file).then(res => { |
| | | proxy.$modal.msgSuccess("æä»¶ä¸ä¼ æå"); |
| | | getList() |
| | | }) |
| | | } |
| | | // ä¸ä¼ 失败å¤ç |
| | | function handleUploadError() { |
| | | proxy.$modal.msgError("æä»¶ä¸ä¼ 失败"); |
| | | } |
| | | // ä¸è½½éä»¶ |
| | | const downLoadFile = (row) => { |
| | | proxy.$download.name(row.url); |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | fileDel(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // é¢è§éä»¶ |
| | | const lookFile = (row) => { |
| | | filePreviewRef.value.open(row.url) |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="å½å
¥æ¥æ:"> |
| | | <el-date-picker v-model="filters.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶æ¬¾æ¹å¼:"> |
| | | <el-select |
| | | v-model="filters.incomeMethod" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 200px;" |
| | | > |
| | | <el-option |
| | | v-for="item in payment_methods" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData">æç´¢</el-button> |
| | | <el-button @click="resetFilters">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <el-button type="primary" @click="add" icon="Plus"> æ°å¢ </el-button> |
| | | <el-button @click="handleOut" icon="download">导åº</el-button> |
| | | <el-button |
| | | type="danger" |
| | | icon="Delete" |
| | | :disabled="multipleList.length <= 0" |
| | | @click="deleteRow(multipleList.map((item) => item.id))" |
| | | > |
| | | æ¹éå é¤ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | | isSelection |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" text @click="edit(row.id)" icon="editPen"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | @click="openFilesFormDia(row)" |
| | | > |
| | | éä»¶ |
| | | </el-button> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <Modal ref="modalRef" @success="getTableData"></Modal> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { usePaginationApi } from "@/hooks/usePaginationApi"; |
| | | import { listPage, delAccountIncome } from "@/api/financialManagement/revenueManagement"; |
| | | import { onMounted, getCurrentInstance } from "vue"; |
| | | import Modal from "./Modal.vue"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import FilesDia from "./filesDia.vue"; |
| | | |
| | | defineOptions({ |
| | | name: "æ¶å
¥ç®¡ç", |
| | | }); |
| | | |
| | | // è¡¨æ ¼å¤éæ¡éä¸é¡¹ |
| | | const multipleList = ref([]); |
| | | const { proxy } = getCurrentInstance(); |
| | | const modalRef = ref(); |
| | | const { payment_methods } = proxy.useDict("payment_methods"); |
| | | const { income_types } = proxy.useDict("income_types"); |
| | | const filesDia = ref() |
| | | |
| | | const { |
| | | filters, |
| | | columns, |
| | | dataList, |
| | | pagination, |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi( |
| | | listPage, |
| | | { |
| | | incomeMethod: undefined, |
| | | }, |
| | | [ |
| | | { |
| | | label: "æ¶å
¥æ¥æ", |
| | | align: "center", |
| | | prop: "incomeDate", |
| | | }, |
| | | { |
| | | label: "æ¶å
¥ç±»å", |
| | | align: "center", |
| | | prop: "incomeType", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (income_types.value.find((m) => m.value == params)) { |
| | | return income_types.value.find((m) => m.value == params).label; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "客æ·åç§°", |
| | | align: "center", |
| | | prop: "customerName", |
| | | |
| | | }, |
| | | { |
| | | label: "æ¶å
¥éé¢", |
| | | align: "center", |
| | | prop: "incomeMoney", |
| | | |
| | | }, |
| | | { |
| | | label: "æ¶å
¥æè¿°", |
| | | align: "center", |
| | | prop: "incomeDescribed", |
| | | |
| | | }, |
| | | { |
| | | label: "æ¶æ¬¾æ¹å¼", |
| | | align: "center", |
| | | prop: "incomeMethod", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (payment_methods.value.find((m) => m.value == params)) { |
| | | return payment_methods.value.find((m) => m.value == params).label; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "å票å·ç ", |
| | | align: "center", |
| | | prop: "invoiceNumber", |
| | | |
| | | }, |
| | | { |
| | | label: "夿³¨", |
| | | align: "center", |
| | | prop: "note", |
| | | |
| | | }, |
| | | { |
| | | label: "å½å
¥äºº", |
| | | align: "center", |
| | | prop: "inputUser", |
| | | }, |
| | | { |
| | | label: "å½å
¥æ¥æ", |
| | | align: "center", |
| | | prop: "inputTime", |
| | | |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "æä½", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | }, |
| | | ] |
| | | ); |
| | | |
| | | // å¤éååä»ä¹ |
| | | const handleSelectionChange = (selectionList) => { |
| | | multipleList.value = selectionList; |
| | | }; |
| | | |
| | | const add = () => { |
| | | modalRef.value.openModal(); |
| | | }; |
| | | const edit = (id) => { |
| | | modalRef.value.loadForm(id); |
| | | }; |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | const deleteRow = (id) => { |
| | | ElMessageBox.confirm("æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(async () => { |
| | | const { code } = await delAccountIncome(id); |
| | | if (code == 200) { |
| | | ElMessage({ |
| | | type: "success", |
| | | message: "å 餿å", |
| | | }); |
| | | getTableData(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const changeDaterange = (value) => { |
| | | if (value) { |
| | | filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | | } else { |
| | | filters.entryDateStart = undefined; |
| | | filters.entryDateEnd = undefined; |
| | | } |
| | | getTableData(); |
| | | }; |
| | | |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download(`/account/accountIncome/export`, {}, "æ¶å
¥å°è´¦.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // æå¼éä»¶å¼¹æ¡ |
| | | const openFilesFormDia = (row) => { |
| | | nextTick(() => { |
| | | filesDia.value?.openDialog( row,'æ¶å
¥') |
| | | }) |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | filters.entryDate = [ |
| | | dayjs().format("YYYY-MM-DD"), |
| | | dayjs().add(1, "day").format("YYYY-MM-DD"), |
| | | ] |
| | | filters.entryDateStart = dayjs().format("YYYY-MM-DD") |
| | | filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD") |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| | | |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="éä»¶" width="30%" :before-close="handleClose"> |
| | | <el-dialog v-model="dialogVisible" title="éä»¶" width="40%" :before-close="handleClose"> |
| | | <el-table :data="tableData" border height="40vh"> |
| | | <el-table-column label="éä»¶åç§°" prop="name" min-width="400" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">ä¸è½½</el-button> |
| | | <el-button link type="primary" size="small" @click="lookFile(scope.row)">é¢è§</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <filePreview ref="filePreviewRef" /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref } from 'vue' |
| | | import filePreview from '@/components/filePreview/index.vue' |
| | | |
| | | const dialogVisible = ref(false) |
| | | const tableData = ref([]) |
| | | const { proxy } = getCurrentInstance(); |
| | | const filePreviewRef = ref() |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | |
| | | proxy.$download.name(row.url); |
| | | |
| | | } |
| | | const lookFile = (row) => { |
| | | filePreviewRef.value.open(row.url) |
| | | } |
| | | defineExpose({ |
| | | open |
| | | }) |