Merge branch 'dev_tide' into dev_tide_zlglxt_xinlan
# Conflicts:
# .env.production
# index.html
# package.json
# src/api/collaborativeApproval/attendanceManagement.js
# src/api/collaborativeApproval/enterpriseBook.js
# src/api/inventoryManagement/stockIn.js
# src/api/inventoryManagement/stockManage.js
# src/api/productionManagement/productionOrder.js
# src/router/index.js
# src/store/modules/user.js
# src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
# src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
# src/views/collaborativeApproval/approvalProcess/index.vue
# src/views/collaborativeApproval/enterpriseBook/index.vue
# src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
# src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue
# src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue
# src/views/collaborativeApproval/notificationManagement/summary/index.vue
# src/views/collaborativeApproval/rulesRegulationsManagement/index.vue
# src/views/collaborativeApproval/sealManagement/index.vue
# src/views/equipmentManagement/upkeep/index.vue
# src/views/financialManagement/accounting/index.vue
# src/views/financialManagement/financialStatements/index.vue
# src/views/financialManagement/inventoryAccounting/index.vue
# src/views/index.vue
# src/views/inventoryManagement/dispatchLog/index.vue
# src/views/inventoryManagement/issueManagement/index.vue
# src/views/inventoryManagement/receiptManagement/components/formDia.vue
# src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
# src/views/inventoryManagement/receiptManagement/index.vue
# src/views/inventoryManagement/stockManagement/index.vue
# src/views/inventoryManagement/stockReport/index.vue
# src/views/personnelManagement/employeeRecord/components/NewOrEditFormDia.vue
# src/views/personnelManagement/onboarding/index.vue
# src/views/procurementManagement/invoiceEntry/indexOld.vue
# src/views/procurementManagement/paymentEntry/index.vue
# src/views/procurementManagement/procurementLedger/index.vue
# src/views/productionManagement/operationScheduling/components/formDia.vue
# src/views/productionManagement/operationScheduling/index.vue
# src/views/productionManagement/productionCosting/index.vue
# src/views/productionManagement/productionDispatching/components/formDia.vue
# src/views/productionManagement/productionDispatching/index.vue
# src/views/productionManagement/productionOrder/index.vue
# src/views/productionManagement/productionReporting/index.vue
# src/views/reportAnalysis/projectProfit/index.vue
# src/views/salesManagement/invoiceRegistration/index.vue
# src/views/salesManagement/receiptPayment/index.vue
# src/views/system/dept/index.vue
# src/views/system/user/index.vue
# src/views/tideLogin.vue
# vite.config.js
| | |
| | | # 页颿 é¢
|
| | | VITE_APP_TITLE = ä¸å°ä¼ä¸æ°åå转åäºçº§å¥é¤å
|
| | | VITE_APP_TITLE = æ°ç¼-è´¨éæ£æµç®¡çç³»ç»
|
| | |
|
| | | # ç产ç¯å¢é
ç½®
|
| | | VITE_APP_ENV = 'production'
|
| | |
| | | method: 'get', |
| | | params: { |
| | | ...page, |
| | | ...query |
| | | ...query |
| | | } |
| | | }) |
| | | } |
| | |
| | | url: '/staff/staffOnJob/' + employeeId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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, |
| | | }); |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢åºåé¢è¦å°è´¦å表 |
| | | export const getStockWarningLedgerPage = (params) => { |
| | | return request({ |
| | | url: "/customStorageWarning/pageList", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | }; |
| | |
| | | |
| | | // å页æ¥è¯¢ |
| | | export function purchaseList(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢ååå· |
| | | export function getSalesNo(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/getSalesNo", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/getSalesNo", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // åè¡¨æ ¼æ¥è¯¢ |
| | | export function productList(query) { |
| | | return request({ |
| | | url: "/sales/product/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/sales/product/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ°å¢ãç¼è¾ |
| | | export function addOrEditPurchase(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/addOrEditPurchase", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/addOrEditPurchase", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤ |
| | | export function delPurchase(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/delPurchase", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/delPurchase", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢è¯¦æ
|
| | | export function getPurchaseById(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/getPurchaseById", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/getPurchaseById", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢è¯¦æ
|
| | | export function getOptions(query) { |
| | | return request({ |
| | | url: "/system/supplier/getOptions", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/system/supplier/getOptions", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢éè´å°è´¦å表 |
| | | export function purchaseListPage(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | export function createPurchaseNo() { |
| | | return request({ |
| | | url: "/purchase/ledger/createPurchaseNo", |
| | | method: "get", |
| | | }); |
| | | return request({ |
| | | url: "/purchase/ledger/createPurchaseNo", |
| | | method: "get", |
| | | }); |
| | | } |
| | | export function updateApprovalStatus(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/updateApprovalStatus", |
| | | method: "post", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // ä¿åéè´æ¨¡æ¿ |
| | | // /purchase/ledger/addPurchaseTemplate |
| | | export function addPurchaseTemplate(data) { |
| | | return request({ |
| | | url: "/purchase/ledger/addPurchaseTemplate", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ¥è¯¢éè´æ¨¡æ¿ |
| | | // /purchase/ledger/getPurchaseTemplateList |
| | | export function getPurchaseTemplateList(query) { |
| | | return request({ |
| | | url: "/purchase/ledger/getPurchaseTemplateList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | export function updateApprovalStatus(query) { |
| | | return request({ |
| | |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | } |
| | |
| | | :expand-row-keys="expandRowKeys" |
| | | :show-summary="isShowSummary" |
| | | :summary-method="summaryMethod" |
| | | stripe |
| | | @row-click="rowClick" |
| | | @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" |
| | |
| | | component: () => import("@/views/login"), |
| | | hidden: true, |
| | | }, |
| | | { |
| | | path: "/callbacklccpn", |
| | | component: () => import("@/views/tideLogin.vue"), |
| | | hidden: true, |
| | | }, |
| | | { |
| | | path: "/register", |
| | | component: () => import("@/views/register"), |
| | |
| | | .then((res) => {
|
| | | setToken(res.token);
|
| | | this.token = res.token
|
| | | Vue.prototype.uploadHeader = {
|
| | | Authorization: "Bearer " + res.token,
|
| | | };
|
| | | resolve();
|
| | | })
|
| | | .catch((error) => {
|
| | |
| | | const TokenKey = 'Admin-Token'
|
| | |
|
| | | export function getToken() {
|
| | | return Cookies.get(TokenKey)
|
| | | // return Cookies.get(TokenKey)
|
| | | return sessionStorage.getItem(TokenKey)
|
| | | }
|
| | |
|
| | | export function setToken(token) {
|
| | | return Cookies.set(TokenKey, token)
|
| | | // return Cookies.set(TokenKey, token)
|
| | | return sessionStorage.setItem(TokenKey, token)
|
| | | }
|
| | |
|
| | | export function removeToken() {
|
| | | return Cookies.remove(TokenKey)
|
| | | // return Cookies.remove(TokenKey)
|
| | | return sessionStorage.removeItem(TokenKey)
|
| | | }
|
| | |
| | | width="700px" |
| | | @close="closeDia" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" ref="formRef"> |
| | | <el-form :model="form" :rules="rules" label-width="140px" label-position="top" ref="formRef"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æµç¨ç¼å·ï¼" prop="approveId"> |
| | |
| | | approveReason: "", |
| | | checkResult: "", |
| | | }, |
| | | rules: { |
| | | // 使ç¨é¨é¨IDåå¿
å¡«æ ¡éªï¼é¿å
åç§°æªåæ¥å¯¼è´è¯¯æ¥ |
| | | approveDeptId: [{ required: true, message: "è¯·éæ©ç³è¯·é¨é¨", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form } = toRefs(data); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | // èç¹æ é¢ |
| | | const getNodeTitle = (index, len) => { |
| | |
| | | width: 200px; |
| | | height: 60px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <el-button type="success" plain style="float: right" @click="openCreate">æ°å¢</el-button> |
| | | </div> |
| | | |
| | | <el-table :data="pagedList" border style="width: 100%" height="480"> |
| | | <el-table :data="pagedList" border style="width: 100%" height="480" stripe> |
| | | <el-table-column prop="id" label="ç¼å·" width="90" sortable /> |
| | | <el-table-column prop="name" label="åç§°" min-width="140" /> |
| | | <el-table-column prop="category" label="ç±»å«" width="120" /> |
| | |
| | | <span>è¾¹ç¼è®¡ç®æ¨¡åé
ç½®</span> |
| | | </template> |
| | | |
| | | <el-table :data="modelConfigs" style="width: 100%"> |
| | | <el-table :data="modelConfigs" style="width: 100%" stripe> |
| | | <el-table-column prop="modelName" label="模ååç§°" /> |
| | | <el-table-column prop="version" label="çæ¬" /> |
| | | <el-table-column prop="status" label="ç¶æ"> |
| | |
| | | |
| | | <!-- ä¼ååå²å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="historyDialogVisible" title="ä¼ååå²è®°å½" width="80%"> |
| | | <el-table :data="optimizationHistory" style="width: 100%"> |
| | | <el-table :data="optimizationHistory" style="width: 100%" stripe> |
| | | <el-table-column prop="timestamp" label="æ¶é´" /> |
| | | <el-table-column prop="formationPressure" label="å°å±åå (MPa)" /> |
| | | <el-table-column prop="oldFrequency" label="åé¢ç (Hz)" /> |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <el-table :data="deviceList" border style="width: 100%" v-loading="tableLoading"> |
| | | <el-table :data="deviceList" border style="width: 100%" v-loading="tableLoading" stripe> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="设å¤ç¼å·" prop="deviceCode" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="设å¤åç§°" prop="deviceName" width="150" show-overflow-tooltip /> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="é¨ç¦åç§°"> |
| | | <el-input |
| | | v-model="filters.name" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥é¨ç¦åç§°" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="é¨ç¦ç¶æ"> |
| | | <el-select |
| | | v-model="filters.status" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©é¨ç¦ç¶æ" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="æ£å¸¸" value="1"></el-option> |
| | | <el-option label="å¼å¸¸" value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åºå"> |
| | | <el-input |
| | | v-model="filters.area" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥åºå" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </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 type="danger" icon="Delete" :disabled="multipleList.length <= 0" @click="batchDelete">æ¹éå é¤</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" |
| | | > |
| | | </PIMTable> |
| | | </div> |
| | | <!-- æ°å¢ç¼è¾å¼¹çª --> |
| | | <el-dialog v-model="dialogVisible" :title="dialogTitle" width="600px"> |
| | | <el-form :model="formData" label-width="100px"> |
| | | <el-form-item label="é¨ç¦åç§°" required> |
| | | <el-input v-model="formData.name" placeholder="请è¾å
¥é¨ç¦åç§°"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åºå" required> |
| | | <el-input v-model="formData.area" placeholder="请è¾å
¥åºå"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ä½ç½®" required> |
| | | <el-input v-model="formData.location" placeholder="请è¾å
¥å
·ä½ä½ç½®"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" required> |
| | | <el-select v-model="formData.status" placeholder="è¯·éæ©ç¶æ"> |
| | | <el-option label="æ£å¸¸" value="1"></el-option> |
| | | <el-option label="å¼å¸¸" value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°"> |
| | | <el-input v-model="formData.description" type="textarea" rows="3" placeholder="请è¾å
¥æè¿°ä¿¡æ¯"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="saveData">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from 'vue'; |
| | | import { Search, Plus, Delete } from '@element-plus/icons-vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | // å®ä¹åæ°æ® |
| | | const mockData = [ |
| | | { id: 1, name: 'ä¸é¨é¨ç¦', area: 'ç产åº', location: 'ä¸é¨å
¥å£', status: '1', lastUpdate: '2025-12-30 08:30:00', description: '主è¦ç¨äºåå·¥ä¸ä¸çéè¡' }, |
| | | { id: 2, name: '西é¨é¨ç¦', area: 'ä»å¨åº', location: '西é¨å
¥å£', status: '1', lastUpdate: '2025-12-30 09:15:00', description: '主è¦ç¨äºç©æµè½¦è¾éè¡' }, |
| | | { id: 3, name: 'åé¨é¨ç¦', area: 'åå
¬åº', location: 'åé¨å
¥å£', status: '0', lastUpdate: '2025-12-30 10:20:00', description: '主è¦ç¨äºè®¿å®¢éè¡ï¼å½åæ
é' }, |
| | | { id: 4, name: 'åé¨é¨ç¦', area: 'ç产åº', location: 'åé¨å
¥å£', status: '1', lastUpdate: '2025-12-30 11:45:00', description: '主è¦ç¨äºåææè¿è¾è½¦è¾éè¡' }, |
| | | { id: 5, name: '䏿§å®¤é¨ç¦', area: '䏿§åº', location: '䏿§å®¤é¨å£', status: '1', lastUpdate: '2025-12-30 13:20:00', description: 'ä»
éææäººåè¿å
¥' }, |
| | | ]; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const filters = reactive({ |
| | | name: '', |
| | | status: '', |
| | | area: '' |
| | | }); |
| | | |
| | | const dataList = ref([]); |
| | | const pagination = reactive({ |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | }); |
| | | |
| | | const multipleList = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref('æ°å¢é¨ç¦'); |
| | | const formData = reactive({ |
| | | id: '', |
| | | name: '', |
| | | area: '', |
| | | location: '', |
| | | status: '1', |
| | | description: '' |
| | | }); |
| | | |
| | | // è¡¨æ ¼åé
ç½® |
| | | const columns = [ |
| | | { |
| | | label: 'é¨ç¦åç§°', |
| | | align: 'center', |
| | | prop: 'name', |
| | | }, |
| | | { |
| | | label: 'åºå', |
| | | align: 'center', |
| | | prop: 'area', |
| | | }, |
| | | { |
| | | label: 'ä½ç½®', |
| | | align: 'center', |
| | | prop: 'location', |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | align: 'center', |
| | | prop: 'status', |
| | | formatter: (row) => { |
| | | return row.status === '1' ? '<el-tag type="success">æ£å¸¸</el-tag>' : '<el-tag type="danger">å¼å¸¸</el-tag>'; |
| | | } |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°', |
| | | align: 'center', |
| | | prop: 'lastUpdate', |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | align: 'center', |
| | | prop: 'description', |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | label: 'æä½', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 140, |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | edit(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: 'å é¤', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | deleteRow(row.id); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // è¿æ»¤åçæ°æ® |
| | | const filteredData = computed(() => { |
| | | return mockData.filter(item => { |
| | | const nameMatch = !filters.name || item.name.includes(filters.name); |
| | | const statusMatch = !filters.status || item.status === filters.status; |
| | | const areaMatch = !filters.area || item.area.includes(filters.area); |
| | | return nameMatch && statusMatch && areaMatch; |
| | | }); |
| | | }); |
| | | |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | const getTableData = () => { |
| | | pagination.total = filteredData.value.length; |
| | | const start = (pagination.currentPage - 1) * pagination.pageSize; |
| | | const end = start + pagination.pageSize; |
| | | dataList.value = filteredData.value.slice(start, end); |
| | | }; |
| | | |
| | | // éç½®è¿æ»¤å¨ |
| | | const resetFilters = () => { |
| | | filters.name = ''; |
| | | filters.status = ''; |
| | | filters.area = ''; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å页åå |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å¤éå¤ç |
| | | const handleSelectionChange = (selectionList) => { |
| | | multipleList.value = selectionList; |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | const add = () => { |
| | | dialogTitle.value = 'æ°å¢é¨ç¦'; |
| | | formData.id = ''; |
| | | formData.name = ''; |
| | | formData.area = ''; |
| | | formData.location = ''; |
| | | formData.status = '1'; |
| | | formData.description = ''; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾ |
| | | const edit = (row) => { |
| | | dialogTitle.value = 'ç¼è¾é¨ç¦'; |
| | | formData.id = row.id; |
| | | formData.name = row.name; |
| | | formData.area = row.area; |
| | | formData.location = row.location; |
| | | formData.status = row.status; |
| | | formData.description = row.description; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ä¿åæ°æ® |
| | | const saveData = () => { |
| | | if (!formData.name || !formData.area || !formData.location) { |
| | | ElMessage.warning('请填åå¿
å¡«åæ®µ'); |
| | | return; |
| | | } |
| | | |
| | | const currentTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); |
| | | if (formData.id) { |
| | | // ç¼è¾ |
| | | const index = mockData.findIndex(item => item.id === formData.id); |
| | | if (index !== -1) { |
| | | mockData[index] = { |
| | | ...formData, |
| | | lastUpdate: currentTime |
| | | }; |
| | | ElMessage.success('ç¼è¾æå'); |
| | | } |
| | | } else { |
| | | // æ°å¢ |
| | | const newId = Math.max(...mockData.map(item => item.id), 0) + 1; |
| | | mockData.unshift({ |
| | | ...formData, |
| | | id: newId, |
| | | lastUpdate: currentTime |
| | | }); |
| | | ElMessage.success('æ°å¢æå'); |
| | | } |
| | | dialogVisible.value = false; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å é¤ |
| | | const deleteRow = (id) => { |
| | | ElMessageBox.confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥é¨ç¦è®°å½, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | const index = mockData.findIndex(item => item.id === id); |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1); |
| | | ElMessage.success('å 餿å'); |
| | | getTableData(); |
| | | } |
| | | }).catch(() => {}); |
| | | }; |
| | | |
| | | // æ¹éå é¤ |
| | | const batchDelete = () => { |
| | | if (multipleList.value.length === 0) { |
| | | ElMessage.warning('è¯·éæ©è¦å é¤çæ°æ®'); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm('æ¤æä½å°æ°¸ä¹
å 餿éé¨ç¦è®°å½, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | const ids = multipleList.value.map(item => item.id); |
| | | mockData.forEach((item, index) => { |
| | | if (ids.includes(item.id)) { |
| | | mockData.splice(index, 1); |
| | | } |
| | | }); |
| | | ElMessage.success('å 餿å'); |
| | | getTableData(); |
| | | multipleList.value = []; |
| | | }).catch(() => {}); |
| | | }; |
| | | |
| | | // åå§åæ°æ® |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="å·¡æ£åç§°"> |
| | | <el-input |
| | | v-model="filters.name" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥å·¡æ£åç§°" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£ç¶æ"> |
| | | <el-select |
| | | v-model="filters.status" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©å·¡æ£ç¶æ" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="å¾
æ§è¡" value="0"></el-option> |
| | | <el-option label="æ§è¡ä¸" value="1"></el-option> |
| | | <el-option label="已宿" value="2"></el-option> |
| | | <el-option label="已忶" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£ç±»å"> |
| | | <el-select |
| | | v-model="filters.type" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©å·¡æ£ç±»å" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="宿巡æ£" value="0"></el-option> |
| | | <el-option label="临æ¶å·¡æ£" value="1"></el-option> |
| | | <el-option label="æ
éå·¡æ£" value="2"></el-option> |
| | | </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 |
| | | type="danger" |
| | | icon="Delete" |
| | | :disabled="multipleList.length <= 0" |
| | | @click="batchDelete" |
| | | >æ¹éå é¤</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" |
| | | > |
| | | </PIMTable> |
| | | </div> |
| | | <!-- æ°å¢ç¼è¾å¼¹çª --> |
| | | <el-dialog v-model="dialogVisible" :title="dialogTitle" width="600px"> |
| | | <el-form :model="formData" label-width="100px"> |
| | | <el-form-item label="å·¡æ£åç§°" required> |
| | | <el-input |
| | | v-model="formData.name" |
| | | placeholder="请è¾å
¥å·¡æ£åç§°" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£ç±»å" required> |
| | | <el-select v-model="formData.type" placeholder="è¯·éæ©å·¡æ£ç±»å"> |
| | | <el-option label="宿巡æ£" value="0"></el-option> |
| | | <el-option label="临æ¶å·¡æ£" value="1"></el-option> |
| | | <el-option label="æ
éå·¡æ£" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£åºå" required> |
| | | <el-input |
| | | v-model="formData.area" |
| | | placeholder="请è¾å
¥å·¡æ£åºå" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£äººå" required> |
| | | <el-input |
| | | v-model="formData.inspector" |
| | | placeholder="请è¾å
¥å·¡æ£äººå" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="计åå¼å§æ¶é´" required> |
| | | <el-date-picker |
| | | v-model="formData.planStartTime" |
| | | type="datetime" |
| | | placeholder="è¯·éæ©è®¡åå¼å§æ¶é´" |
| | | style="width: 100%" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="计åç»ææ¶é´" required> |
| | | <el-date-picker |
| | | v-model="formData.planEndTime" |
| | | type="datetime" |
| | | placeholder="è¯·éæ©è®¡åç»ææ¶é´" |
| | | style="width: 100%" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å·¡æ£å
容"> |
| | | <el-input |
| | | v-model="formData.content" |
| | | type="textarea" |
| | | rows="3" |
| | | placeholder="请è¾å
¥å·¡æ£å
容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="saveData">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from "vue"; |
| | | import { Search, Plus, Delete } from "@element-plus/icons-vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | // å®ä¹åæ°æ® |
| | | const mockData = [ |
| | | { |
| | | id: 1, |
| | | name: "ä¸é¨åºåæ¥å¸¸å·¡æ£", |
| | | type: "0", |
| | | status: "2", |
| | | planStartTime: "2025-12-30 08:00:00", |
| | | planEndTime: "2025-12-30 09:00:00", |
| | | actualStartTime: "2025-12-30 08:05:00", |
| | | actualEndTime: "2025-12-30 08:55:00", |
| | | inspector: "å¼ ä¸", |
| | | area: "ä¸é¨åºå", |
| | | content: "æ£æ¥é¨ç¦è®¾å¤è¿è¡ç¶æãç¯å¢çæµè®¾å¤æ°æ®", |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: "西é¨åºå临æ¶å·¡æ£", |
| | | type: "1", |
| | | status: "2", |
| | | planStartTime: "2025-12-30 10:00:00", |
| | | planEndTime: "2025-12-30 11:00:00", |
| | | actualStartTime: "2025-12-30 10:00:00", |
| | | actualEndTime: "2025-12-30 10:45:00", |
| | | inspector: "æå", |
| | | area: "西é¨åºå", |
| | | content: "æ£æ¥å¼å¸¸æ¥è¦è®¾å¤", |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: "åé¨é¨ç¦æ
éå·¡æ£", |
| | | type: "2", |
| | | status: "1", |
| | | planStartTime: "2025-12-30 13:00:00", |
| | | planEndTime: "2025-12-30 14:00:00", |
| | | actualStartTime: "2025-12-30 13:10:00", |
| | | actualEndTime: "", |
| | | inspector: "çäº", |
| | | area: "åé¨åºå", |
| | | content: "ä¿®å¤é¨ç¦æ
é", |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: "䏿§å®¤å®æå·¡æ£", |
| | | type: "0", |
| | | status: "0", |
| | | planStartTime: "2025-12-31 09:00:00", |
| | | planEndTime: "2025-12-31 10:00:00", |
| | | actualStartTime: "", |
| | | actualEndTime: "", |
| | | inspector: "èµµå
", |
| | | area: "䏿§åºå", |
| | | content: "æ£æ¥çæ§è®¾å¤ãæå¡å¨è¿è¡ç¶æ", |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: "åé¨åºåæ¥å¸¸å·¡æ£", |
| | | type: "0", |
| | | status: "2", |
| | | planStartTime: "2025-12-30 15:00:00", |
| | | planEndTime: "2025-12-30 16:00:00", |
| | | actualStartTime: "2025-12-30 15:00:00", |
| | | actualEndTime: "2025-12-30 15:50:00", |
| | | inspector: "å¼ ä¸", |
| | | area: "åé¨åºå", |
| | | content: "æ£æ¥è½¦è¾è¯å«è®¾å¤ãéé¸è¿è¡ç¶æ", |
| | | }, |
| | | ]; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const filters = reactive({ |
| | | name: "", |
| | | status: "", |
| | | type: "", |
| | | }); |
| | | |
| | | const dataList = ref([]); |
| | | const pagination = reactive({ |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | const multipleList = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref("æ°å¢å·¡æ£"); |
| | | const formData = reactive({ |
| | | id: "", |
| | | name: "", |
| | | type: "0", |
| | | status: "0", |
| | | planStartTime: "", |
| | | planEndTime: "", |
| | | actualStartTime: "", |
| | | actualEndTime: "", |
| | | inspector: "", |
| | | area: "", |
| | | content: "", |
| | | }); |
| | | |
| | | // ç¶ææ å° |
| | | const statusMap = { |
| | | '0': '<el-tag type="warning">å¾
æ§è¡</el-tag>', |
| | | '1': '<el-tag type="primary">æ§è¡ä¸</el-tag>', |
| | | '2': '<el-tag type="success">已宿</el-tag>', |
| | | '3': '<el-tag type="danger">已忶</el-tag>', |
| | | }; |
| | | |
| | | // ç±»åæ å° |
| | | const typeMap = { |
| | | 0: "宿巡æ£", |
| | | 1: "临æ¶å·¡æ£", |
| | | 2: "æ
éå·¡æ£", |
| | | }; |
| | | |
| | | // è¡¨æ ¼åé
ç½® |
| | | const columns = [ |
| | | { |
| | | label: "å·¡æ£åç§°", |
| | | align: "center", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "å·¡æ£ç±»å", |
| | | align: "center", |
| | | prop: "type", |
| | | formatter: (row) => { |
| | | return typeMap[row.type]; |
| | | }, |
| | | }, |
| | | { |
| | | label: "å·¡æ£ç¶æ", |
| | | align: "center", |
| | | prop: "status", |
| | | formatter: (row) => { |
| | | return statusMap[row.status]; |
| | | }, |
| | | }, |
| | | { |
| | | label: "计åå¼å§æ¶é´", |
| | | align: "center", |
| | | prop: "planStartTime", |
| | | }, |
| | | { |
| | | label: "计åç»ææ¶é´", |
| | | align: "center", |
| | | prop: "planEndTime", |
| | | }, |
| | | { |
| | | label: "å®é
å¼å§æ¶é´", |
| | | align: "center", |
| | | prop: "actualStartTime", |
| | | formatter: (row) => { |
| | | return row.actualStartTime || "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "å®é
ç»ææ¶é´", |
| | | align: "center", |
| | | prop: "actualEndTime", |
| | | formatter: (row) => { |
| | | return row.actualEndTime || "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "å·¡æ£äººå", |
| | | align: "center", |
| | | prop: "inspector", |
| | | }, |
| | | { |
| | | label: "å·¡æ£åºå", |
| | | align: "center", |
| | | prop: "area", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 180, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | edit(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å¼å§æ§è¡", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | startInspection(row); |
| | | }, |
| | | visible: (row) => { |
| | | return row.status === "0"; |
| | | }, |
| | | }, |
| | | { |
| | | name: "宿巡æ£", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | completeInspection(row); |
| | | }, |
| | | visible: (row) => { |
| | | return row.status === "1"; |
| | | }, |
| | | }, |
| | | { |
| | | name: "åæ¶å·¡æ£", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | cancelInspection(row); |
| | | }, |
| | | visible: (row) => { |
| | | return ["0", "1"].includes(row.status); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | deleteRow(row.id); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // è¿æ»¤åçæ°æ® |
| | | const filteredData = computed(() => { |
| | | return mockData.filter((item) => { |
| | | const nameMatch = !filters.name || item.name.includes(filters.name); |
| | | const statusMatch = !filters.status || item.status === filters.status; |
| | | const typeMatch = !filters.type || item.type === filters.type; |
| | | return nameMatch && statusMatch && typeMatch; |
| | | }); |
| | | }); |
| | | |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | const getTableData = () => { |
| | | pagination.total = filteredData.value.length; |
| | | const start = (pagination.currentPage - 1) * pagination.pageSize; |
| | | const end = start + pagination.pageSize; |
| | | dataList.value = filteredData.value.slice(start, end); |
| | | }; |
| | | |
| | | // éç½®è¿æ»¤å¨ |
| | | const resetFilters = () => { |
| | | filters.name = ""; |
| | | filters.status = ""; |
| | | filters.type = ""; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å页åå |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å¤éå¤ç |
| | | const handleSelectionChange = (selectionList) => { |
| | | multipleList.value = selectionList; |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | const add = () => { |
| | | dialogTitle.value = "æ°å¢å·¡æ£"; |
| | | formData.id = ""; |
| | | formData.name = ""; |
| | | formData.type = "0"; |
| | | formData.status = "0"; |
| | | formData.planStartTime = ""; |
| | | formData.planEndTime = ""; |
| | | formData.actualStartTime = ""; |
| | | formData.actualEndTime = ""; |
| | | formData.inspector = ""; |
| | | formData.area = ""; |
| | | formData.content = ""; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾ |
| | | const edit = (row) => { |
| | | dialogTitle.value = "ç¼è¾å·¡æ£"; |
| | | formData.id = row.id; |
| | | formData.name = row.name; |
| | | formData.type = row.type; |
| | | formData.status = row.status; |
| | | formData.planStartTime = row.planStartTime; |
| | | formData.planEndTime = row.planEndTime; |
| | | formData.actualStartTime = row.actualStartTime; |
| | | formData.actualEndTime = row.actualEndTime; |
| | | formData.inspector = row.inspector; |
| | | formData.area = row.area; |
| | | formData.content = row.content; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ä¿åæ°æ® |
| | | const saveData = () => { |
| | | if ( |
| | | !formData.name || |
| | | !formData.planStartTime || |
| | | !formData.planEndTime || |
| | | !formData.inspector || |
| | | !formData.area |
| | | ) { |
| | | ElMessage.warning("请填åå¿
å¡«åæ®µ"); |
| | | return; |
| | | } |
| | | |
| | | if (formData.id) { |
| | | // ç¼è¾ |
| | | const index = mockData.findIndex((item) => item.id === formData.id); |
| | | if (index !== -1) { |
| | | mockData[index] = { |
| | | ...mockData[index], |
| | | ...formData, |
| | | }; |
| | | ElMessage.success("ç¼è¾æå"); |
| | | } |
| | | } else { |
| | | // æ°å¢ |
| | | const newId = Math.max(...mockData.map((item) => item.id), 0) + 1; |
| | | mockData.unshift({ |
| | | ...formData, |
| | | id: newId, |
| | | }); |
| | | ElMessage.success("æ°å¢æå"); |
| | | } |
| | | dialogVisible.value = false; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å¼å§å·¡æ£ |
| | | const startInspection = (row) => { |
| | | const index = mockData.findIndex((item) => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData[index].status = "1"; |
| | | mockData[index].actualStartTime = dayjs().format("YYYY-MM-DD HH:mm:ss"); |
| | | ElMessage.success("å·¡æ£å·²å¼å§"); |
| | | getTableData(); |
| | | } |
| | | }; |
| | | |
| | | // å®æå·¡æ£ |
| | | const completeInspection = (row) => { |
| | | const index = mockData.findIndex((item) => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData[index].status = "2"; |
| | | mockData[index].actualEndTime = dayjs().format("YYYY-MM-DD HH:mm:ss"); |
| | | ElMessage.success("å·¡æ£å·²å®æ"); |
| | | getTableData(); |
| | | } |
| | | }; |
| | | |
| | | // åæ¶å·¡æ£ |
| | | const cancelInspection = (row) => { |
| | | ElMessageBox.confirm("ç¡®å®è¦åæ¶è¯¥å·¡æ£å?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const index = mockData.findIndex((item) => item.id === row.id); |
| | | if (index !== -1) { |
| | | mockData[index].status = "3"; |
| | | ElMessage.success("å·¡æ£å·²åæ¶"); |
| | | getTableData(); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // å é¤ |
| | | const deleteRow = (id) => { |
| | | ElMessageBox.confirm("æ¤æä½å°æ°¸ä¹
å é¤è¯¥å·¡æ£è®°å½, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const index = mockData.findIndex((item) => item.id === id); |
| | | if (index !== -1) { |
| | | mockData.splice(index, 1); |
| | | ElMessage.success("å 餿å"); |
| | | getTableData(); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // æ¹éå é¤ |
| | | const batchDelete = () => { |
| | | if (multipleList.value.length === 0) { |
| | | ElMessage.warning("è¯·éæ©è¦å é¤çæ°æ®"); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm("æ¤æä½å°æ°¸ä¹
å 餿éå·¡æ£è®°å½, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const ids = multipleList.value.map((item) => item.id); |
| | | mockData.forEach((item, index) => { |
| | | if (ids.includes(item.id)) { |
| | | mockData.splice(index, 1); |
| | | } |
| | | }); |
| | | ElMessage.success("å 餿å"); |
| | | getTableData(); |
| | | multipleList.value = []; |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // åå§åæ°æ® |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="设å¤åç§°"> |
| | | <el-input |
| | | v-model="filters.name" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥è®¾å¤åç§°" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç¶æ"> |
| | | <el-select |
| | | v-model="filters.status" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©è®¾å¤ç¶æ" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="å¨çº¿" value="1"></el-option> |
| | | <el-option label="离线" value="0"></el-option> |
| | | <el-option label="æ
é" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»å"> |
| | | <el-select |
| | | v-model="filters.type" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©è®¾å¤ç±»å" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="é¨ç¦è®¾å¤" value="0"></el-option> |
| | | <el-option label="ç¯å¢çæµè®¾å¤" value="1"></el-option> |
| | | <el-option label="è§é¢çæ§è®¾å¤" value="2"></el-option> |
| | | <el-option label="æºè½éé¸" value="3"></el-option> |
| | | </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="monitor-container"> |
| | | <div class="monitor-stats"> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">å¨çº¿è®¾å¤</div> |
| | | <div class="stat-value online">{{ onlineCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">离线设å¤</div> |
| | | <div class="stat-value offline">{{ offlineCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">æ
é设å¤</div> |
| | | <div class="stat-value error">{{ errorCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">è®¾å¤æ»æ°</div> |
| | | <div class="stat-value total">{{ totalCount }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="table_list"> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @pagination="changePage" |
| | | > |
| | | </PIMTable> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 设å¤è¯¦æ
å¼¹çª --> |
| | | <el-dialog |
| | | v-model="detailVisible" |
| | | :title="`设å¤è¯¦æ
- ${selectedDevice.name}`" |
| | | width="800px" |
| | | > |
| | | <div v-if="selectedDevice" class="device-detail"> |
| | | <div class="detail-section"> |
| | | <h3>åºæ¬ä¿¡æ¯</h3> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="设å¤åç§°">{{ |
| | | selectedDevice.name |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="设å¤ç±»å">{{ |
| | | typeMap[selectedDevice.type] |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="设å¤ç¶æ">{{ |
| | | statusMap[selectedDevice.status] |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="设å¤ç¼å·">{{ |
| | | selectedDevice.code |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®è£
ä½ç½®">{{ |
| | | selectedDevice.location |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®è£
æ¶é´">{{ |
| | | selectedDevice.installTime |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="æåç»´æ¤æ¶é´">{{ |
| | | selectedDevice.maintainTime |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="责任人">{{ |
| | | selectedDevice.responsiblePerson |
| | | }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | |
| | | <div class="detail-section"> |
| | | <h3>宿¶æ°æ®</h3> |
| | | <div class="realtime-data"> |
| | | <div |
| | | v-for="data in selectedDevice.realtimeData" |
| | | :key="data.name" |
| | | class="data-item" |
| | | > |
| | | <div class="data-name">{{ data.name }}</div> |
| | | <div class="data-value">{{ data.value }}{{ data.unit }}</div> |
| | | <div class="data-status" :class="data.status"> |
| | | {{ data.status === "normal" ? "æ£å¸¸" : "å¼å¸¸" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="detail-section"> |
| | | <h3>æ§å¶æä½</h3> |
| | | <div class="control-buttons"> |
| | | <el-button |
| | | type="primary" |
| | | @click="controlDevice('restart')" |
| | | :disabled="selectedDevice.status !== '1'" |
| | | >éå¯è®¾å¤</el-button |
| | | > |
| | | <el-button |
| | | type="warning" |
| | | @click="controlDevice('reset')" |
| | | :disabled="selectedDevice.status !== '1'" |
| | | >é置设å¤</el-button |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | @click="controlDevice('shutdown')" |
| | | :disabled="selectedDevice.status !== '1'" |
| | | >å
³é设å¤</el-button |
| | | > |
| | | <el-button |
| | | type="success" |
| | | @click="controlDevice('update')" |
| | | :disabled="selectedDevice.status !== '1'" |
| | | >åºä»¶æ´æ°</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="detailVisible = false">å
³é</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from "vue"; |
| | | import { |
| | | Search |
| | | } from "@element-plus/icons-vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | |
| | | // å®ä¹åæ°æ® |
| | | const mockDevices = [ |
| | | { |
| | | id: 1, |
| | | name: "ä¸é¨é¨ç¦æ§å¶å¨", |
| | | code: "DEV-20250001", |
| | | type: "0", |
| | | status: "1", |
| | | location: "ä¸é¨å
¥å£", |
| | | installTime: "2025-01-15", |
| | | maintainTime: "2025-12-20", |
| | | responsiblePerson: "å¼ ä¸", |
| | | realtimeData: [ |
| | | { name: "温度", value: 23.5, unit: "â", status: "normal" }, |
| | | { name: "湿度", value: 45, unit: "%", status: "normal" }, |
| | | { name: "è¿è¡æ¶é¿", value: 12560, unit: "h", status: "normal" }, |
| | | { name: "é¨ç¦å¼å
³æ¬¡æ°", value: 234, unit: "次/天", status: "normal" }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: "西é¨è§é¢çæ§", |
| | | code: "DEV-20250002", |
| | | type: "2", |
| | | status: "1", |
| | | location: "西é¨åºå£", |
| | | installTime: "2025-02-20", |
| | | maintainTime: "2025-11-15", |
| | | responsiblePerson: "æå", |
| | | realtimeData: [ |
| | | { name: "è§é¢æ¸
æ°åº¦", value: 1080, unit: "P", status: "normal" }, |
| | | { name: "帧ç", value: 25, unit: "fps", status: "normal" }, |
| | | { name: "åå¨ç©ºé´", value: 78, unit: "%", status: "warning" }, |
| | | { name: "ç½ç»å»¶è¿", value: 12, unit: "ms", status: "normal" }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: "åé¨ç¯å¢çæµä»ª", |
| | | code: "DEV-20250003", |
| | | type: "1", |
| | | status: "2", |
| | | location: "åé¨å¹¿åº", |
| | | installTime: "2025-03-10", |
| | | maintainTime: "2025-10-05", |
| | | responsiblePerson: "çäº", |
| | | realtimeData: [ |
| | | { name: "PM2.5", value: 85, unit: "μg/m³", status: "error" }, |
| | | { name: "PM10", value: 120, unit: "μg/m³", status: "error" }, |
| | | { name: "åªå£°", value: 65, unit: "dB", status: "normal" }, |
| | | { name: "é£é", value: 1.2, unit: "m/s", status: "normal" }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: "å鍿ºè½éé¸", |
| | | code: "DEV-20250004", |
| | | type: "3", |
| | | status: "0", |
| | | location: "åé¨å
¥å£", |
| | | installTime: "2025-04-05", |
| | | maintainTime: "2025-09-20", |
| | | responsiblePerson: "èµµå
", |
| | | realtimeData: [ |
| | | { name: "å¼å
³æ¬¡æ°", value: 156, unit: "次/天", status: "normal" }, |
| | | { name: "è¿è¡çµå", value: 220, unit: "V", status: "normal" }, |
| | | { name: "è¿è¡çµæµ", value: 5.2, unit: "A", status: "normal" }, |
| | | { name: "æ
é代ç ", value: "E001", unit: "", status: "error" }, |
| | | ], |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: "䏿§å®¤æå¡å¨", |
| | | code: "DEV-20250005", |
| | | type: "1", |
| | | status: "1", |
| | | location: "䏿§å®¤", |
| | | installTime: "2025-05-15", |
| | | maintainTime: "2025-12-01", |
| | | responsiblePerson: "åä¸", |
| | | realtimeData: [ |
| | | { name: "CPU使ç¨ç", value: 45, unit: "%", status: "normal" }, |
| | | { name: "å
å使ç¨ç", value: 68, unit: "%", status: "warning" }, |
| | | { name: "ç£ç使ç¨ç", value: 82, unit: "%", status: "warning" }, |
| | | { name: "ç½ç»æµé", value: 125, unit: "Mbps", status: "normal" }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const filters = reactive({ |
| | | name: "", |
| | | status: "", |
| | | type: "", |
| | | }); |
| | | |
| | | const dataList = ref([]); |
| | | const pagination = reactive({ |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | const detailVisible = ref(false); |
| | | const selectedDevice = ref({}); |
| | | |
| | | // ç¶ææ å° |
| | | const statusMap = { |
| | | 0: '<el-tag type="warning">离线</el-tag>', |
| | | 1: '<el-tag type="success">å¨çº¿</el-tag>', |
| | | 2: '<el-tag type="danger">æ
é</el-tag>', |
| | | }; |
| | | |
| | | // ç±»åæ å° |
| | | const typeMap = { |
| | | 0: "é¨ç¦è®¾å¤", |
| | | 1: "ç¯å¢çæµè®¾å¤", |
| | | 2: "è§é¢çæ§è®¾å¤", |
| | | 3: "æºè½éé¸", |
| | | }; |
| | | |
| | | // è®¾å¤æ°éç»è®¡ |
| | | const onlineCount = computed(() => { |
| | | return mockDevices.filter((device) => device.status === "1").length; |
| | | }); |
| | | |
| | | const offlineCount = computed(() => { |
| | | return mockDevices.filter((device) => device.status === "0").length; |
| | | }); |
| | | |
| | | const errorCount = computed(() => { |
| | | return mockDevices.filter((device) => device.status === "2").length; |
| | | }); |
| | | |
| | | const totalCount = computed(() => { |
| | | return mockDevices.length; |
| | | }); |
| | | |
| | | // è¡¨æ ¼åé
ç½® |
| | | const columns = [ |
| | | { |
| | | label: "设å¤åç§°", |
| | | align: "center", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "设å¤ç¼å·", |
| | | align: "center", |
| | | prop: "code", |
| | | }, |
| | | { |
| | | label: "设å¤ç±»å", |
| | | align: "center", |
| | | prop: "type", |
| | | formatter: (row) => { |
| | | return typeMap[row.type]; |
| | | }, |
| | | }, |
| | | { |
| | | label: "设å¤ç¶æ", |
| | | align: "center", |
| | | prop: "status", |
| | | formatter: (row) => { |
| | | return statusMap[row.status]; |
| | | }, |
| | | }, |
| | | { |
| | | label: "å®è£
ä½ç½®", |
| | | align: "center", |
| | | prop: "location", |
| | | }, |
| | | { |
| | | label: "责任人", |
| | | align: "center", |
| | | prop: "responsiblePerson", |
| | | }, |
| | | { |
| | | label: "æåç»´æ¤æ¶é´", |
| | | align: "center", |
| | | prop: "maintainTime", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 140, |
| | | operation: [ |
| | | { |
| | | name: "æ¥ç详æ
", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | viewDetail(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "宿¶çæ§", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | realtimeMonitor(row); |
| | | }, |
| | | visible: (row) => { |
| | | return row.status === "1"; |
| | | }, |
| | | }, |
| | | { |
| | | name: "éå¯è®¾å¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | controlDevice("restart", row); |
| | | }, |
| | | visible: (row) => { |
| | | return row.status === "1"; |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // è¿æ»¤åçæ°æ® |
| | | const filteredData = computed(() => { |
| | | return mockDevices.filter((item) => { |
| | | const nameMatch = !filters.name || item.name.includes(filters.name); |
| | | const statusMatch = !filters.status || item.status === filters.status; |
| | | const typeMatch = !filters.type || item.type === filters.type; |
| | | return nameMatch && statusMatch && typeMatch; |
| | | }); |
| | | }); |
| | | |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | const getTableData = () => { |
| | | pagination.total = filteredData.value.length; |
| | | const start = (pagination.currentPage - 1) * pagination.pageSize; |
| | | const end = start + pagination.pageSize; |
| | | dataList.value = filteredData.value.slice(start, end); |
| | | }; |
| | | |
| | | // éç½®è¿æ»¤å¨ |
| | | const resetFilters = () => { |
| | | filters.name = ""; |
| | | filters.status = ""; |
| | | filters.type = ""; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å页åå |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // æ¥ç设å¤è¯¦æ
|
| | | const viewDetail = (row) => { |
| | | selectedDevice.value = row; |
| | | detailVisible.value = true; |
| | | }; |
| | | |
| | | // 宿¶çæ§ |
| | | const realtimeMonitor = (row) => { |
| | | ElMessage.info(`æ£å¨è·³è½¬å°${row.name}ç宿¶çæ§é¡µé¢...`); |
| | | // è¿éå¯ä»¥è·³è½¬å°å®æ¶çæ§é¡µé¢ææå¼çæ§çªå£ |
| | | }; |
| | | |
| | | // è®¾å¤æ§å¶ |
| | | const controlDevice = (action, row = selectedDevice.value) => { |
| | | const actionMap = { |
| | | restart: "éå¯", |
| | | reset: "éç½®", |
| | | shutdown: "å
³é", |
| | | update: "åºä»¶æ´æ°", |
| | | }; |
| | | |
| | | ElMessageBox.confirm( |
| | | `ç¡®å®è¦å¯¹è®¾å¤ ${row.name} æ§è¡${actionMap[action]}æä½å?`, |
| | | "æç¤º", |
| | | { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | ElMessage.success(`设å¤${actionMap[action]}æä½å·²åé`); |
| | | // 模æè®¾å¤ååº |
| | | setTimeout(() => { |
| | | ElMessage.success(`设å¤${actionMap[action]}æä½æ§è¡æå`); |
| | | }, 1000); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // 宿¶æ´æ°è®¾å¤ç¶æï¼æ¨¡æå®æ¶ååï¼ |
| | | const updateDeviceStatus = () => { |
| | | // éæºæ´æ°ä¸äºè®¾å¤çç¶æå宿¶æ°æ® |
| | | mockDevices.forEach((device) => { |
| | | if (Math.random() > 0.8) { |
| | | // 80%æ¦ç䏿´æ° |
| | | return; |
| | | } |
| | | |
| | | // éæºæ´æ°ç¶æ |
| | | const statuses = ["0", "1", "2"]; |
| | | device.status = statuses[Math.floor(Math.random() * statuses.length)]; |
| | | |
| | | // æ´æ°å®æ¶æ°æ® |
| | | device.realtimeData.forEach((data) => { |
| | | if (data.name === "温度") { |
| | | data.value = (20 + Math.random() * 10).toFixed(1); |
| | | data.status = data.value > 30 ? "error" : "normal"; |
| | | } else if (data.name === "湿度") { |
| | | data.value = Math.floor(30 + Math.random() * 50); |
| | | data.status = data.value > 80 ? "error" : "normal"; |
| | | } else if (data.name === "CPU使ç¨ç") { |
| | | data.value = Math.floor(20 + Math.random() * 60); |
| | | data.status = |
| | | data.value > 80 ? "error" : data.value > 60 ? "warning" : "normal"; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // å·æ°è¡¨æ ¼æ°æ® |
| | | getTableData(); |
| | | }; |
| | | |
| | | // åå§åæ°æ® |
| | | onMounted(() => { |
| | | getTableData(); |
| | | // æ¯5ç§æ´æ°ä¸æ¬¡è®¾å¤ç¶æ |
| | | const interval = setInterval(updateDeviceStatus, 5000); |
| | | |
| | | // æ¸
ç宿¶å¨ |
| | | return () => clearInterval(interval); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | .monitor-container { |
| | | .monitor-stats { |
| | | display: flex; |
| | | gap: 20px; |
| | | margin-bottom: 20px; |
| | | |
| | | .stat-card { |
| | | flex: 1; |
| | | background: #fff; |
| | | padding: 20px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | text-align: center; |
| | | |
| | | .stat-title { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .stat-value { |
| | | font-size: 32px; |
| | | font-weight: bold; |
| | | |
| | | &.online { |
| | | color: #67c23a; |
| | | } |
| | | |
| | | &.offline { |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | &.error { |
| | | color: #f56c6c; |
| | | } |
| | | |
| | | &.total { |
| | | color: #409eff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .device-detail { |
| | | .detail-section { |
| | | margin-bottom: 20px; |
| | | |
| | | h3 { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-bottom: 10px; |
| | | color: #303133; |
| | | } |
| | | } |
| | | |
| | | .realtime-data { |
| | | display: grid; |
| | | grid-template-columns: repeat(2, 1fr); |
| | | gap: 15px; |
| | | |
| | | .data-item { |
| | | background: #f5f7fa; |
| | | padding: 15px; |
| | | border-radius: 8px; |
| | | |
| | | .data-name { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | .data-value { |
| | | font-size: 24px; |
| | | font-weight: bold; |
| | | color: #303133; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | .data-status { |
| | | font-size: 12px; |
| | | padding: 2px 8px; |
| | | border-radius: 10px; |
| | | |
| | | &.normal { |
| | | background: #f0f9eb; |
| | | color: #67c23a; |
| | | } |
| | | |
| | | &.warning { |
| | | background: #fdf6ec; |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | &.error { |
| | | background: #fef0f0; |
| | | color: #f56c6c; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .control-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 10px; |
| | | } |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="filters" :inline="true"> |
| | | <el-form-item label="车çå·ç "> |
| | | <el-input |
| | | v-model="filters.plateNumber" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥è½¦çå·ç " |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="车è¾ç±»å"> |
| | | <el-select |
| | | v-model="filters.vehicleType" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©è½¦è¾ç±»å" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="å°å车" value="0"></el-option> |
| | | <el-option label="ä¸å车" value="1"></el-option> |
| | | <el-option label="大å车" value="2"></el-option> |
| | | <el-option label="ç¹ç§è½¦" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¿åºæ¹å"> |
| | | <el-select |
| | | v-model="filters.direction" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©è¿åºæ¹å" |
| | | clearable |
| | | @change="getTableData" |
| | | > |
| | | <el-option label="è¿" value="0"></el-option> |
| | | <el-option label="åº" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="è¿åºæ¶é´"> |
| | | <el-date-picker |
| | | v-model="filters.timeRange" |
| | | type="daterange" |
| | | start-placeholder="å¼å§æ¶é´" |
| | | end-placeholder="ç»ææ¶é´" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm" |
| | | clearable |
| | | @change="changeTimeRange" |
| | | /> |
| | | </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="vehicle-stats"> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">仿¥è¿è½¦æ°</div> |
| | | <div class="stat-value in">{{ todayInCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">仿¥åºè½¦æ°</div> |
| | | <div class="stat-value out">{{ todayOutCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">å½åå¨åºè½¦è¾</div> |
| | | <div class="stat-value present">{{ presentCount }}</div> |
| | | </div> |
| | | <div class="stat-card"> |
| | | <div class="stat-title">仿¥æ»æµé</div> |
| | | <div class="stat-value total">{{ todayTotalCount }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="table_list"> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="columns" |
| | | :tableData="dataList" |
| | | :page="{ |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | @pagination="changePage" |
| | | > |
| | | </PIMTable> |
| | | </div> |
| | | |
| | | <!-- 车è¾è¯¦æ
å¼¹çª --> |
| | | <el-dialog |
| | | v-model="detailVisible" |
| | | :title="`车è¾è¯¦æ
- ${selectedVehicle.plateNumber}`" |
| | | width="700px" |
| | | > |
| | | <div v-if="selectedVehicle" class="vehicle-detail"> |
| | | <div class="detail-section"> |
| | | <h3>åºæ¬ä¿¡æ¯</h3> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="车çå·ç ">{{ |
| | | selectedVehicle.plateNumber |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="车è¾ç±»å">{{ |
| | | typeMap[selectedVehicle.vehicleType] |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="车è¾é¢è²">{{ |
| | | selectedVehicle.color |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¿åºæ¹å">{{ |
| | | selectedVehicle.direction === "0" ? "è¿" : "åº" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¿åºæ¶é´">{{ |
| | | selectedVehicle.timestamp |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ééåç§°">{{ |
| | | selectedVehicle.channelName |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¯å«æ¹å¼">{{ |
| | | selectedVehicle.identifyMethod |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="车è¾ç¶æ">{{ |
| | | statusMap[selectedVehicle.status] |
| | | }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | |
| | | <div class="detail-section"> |
| | | <h3>车è¾å¾ç</h3> |
| | | <div class="vehicle-images"> |
| | | <div class="image-item"> |
| | | <div class="image-title">æ£é¢å¾ç</div> |
| | | <el-image |
| | | :src="selectedVehicle.frontImage" |
| | | fit="cover" |
| | | style="width: 100%; height: 200px" |
| | | :preview-src-list="[ |
| | | selectedVehicle.frontImage, |
| | | selectedVehicle.sideImage, |
| | | ]" |
| | | ></el-image> |
| | | </div> |
| | | <div class="image-item"> |
| | | <div class="image-title">ä¾§é¢å¾ç</div> |
| | | <el-image |
| | | :src="selectedVehicle.sideImage" |
| | | fit="cover" |
| | | style="width: 100%; height: 200px" |
| | | :preview-src-list="[ |
| | | selectedVehicle.sideImage, |
| | | selectedVehicle.frontImage, |
| | | ]" |
| | | ></el-image> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="detailVisible = false">å
³é</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted } from "vue"; |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | // å®ä¹åæ°æ® |
| | | const mockVehicles = [ |
| | | { |
| | | id: 1, |
| | | plateNumber: "京A12345", |
| | | vehicleType: "0", |
| | | color: "ç½è²", |
| | | direction: "0", |
| | | timestamp: "2025-12-31 08:15:30", |
| | | channelName: "ä¸é¨éé", |
| | | identifyMethod: "车çè¯å«", |
| | | status: "0", |
| | | frontImage: "https://picsum.photos/id/1024/800/600", |
| | | sideImage: "https://picsum.photos/id/1025/800/600", |
| | | duration: "00:00:00", |
| | | present: true, |
| | | }, |
| | | { |
| | | id: 2, |
| | | plateNumber: "沪B67890", |
| | | vehicleType: "1", |
| | | color: "é»è²", |
| | | direction: "1", |
| | | timestamp: "2025-12-31 08:10:20", |
| | | channelName: "西é¨éé", |
| | | identifyMethod: "车çè¯å«", |
| | | status: "1", |
| | | frontImage: "https://picsum.photos/id/1026/800/600", |
| | | sideImage: "https://picsum.photos/id/1027/800/600", |
| | | duration: "01:25:30", |
| | | present: false, |
| | | }, |
| | | { |
| | | id: 3, |
| | | plateNumber: "粤C54321", |
| | | vehicleType: "0", |
| | | color: "红è²", |
| | | direction: "0", |
| | | timestamp: "2025-12-31 08:05:15", |
| | | channelName: "åé¨éé", |
| | | identifyMethod: "ICå¡è¯å«", |
| | | status: "0", |
| | | frontImage: "https://picsum.photos/id/1028/800/600", |
| | | sideImage: "https://picsum.photos/id/1029/800/600", |
| | | duration: "00:05:45", |
| | | present: true, |
| | | }, |
| | | { |
| | | id: 4, |
| | | plateNumber: "å·D98765", |
| | | vehicleType: "2", |
| | | color: "èè²", |
| | | direction: "0", |
| | | timestamp: "2025-12-31 08:00:00", |
| | | channelName: "åé¨éé", |
| | | identifyMethod: "车çè¯å«", |
| | | status: "0", |
| | | frontImage: "https://picsum.photos/id/1030/800/600", |
| | | sideImage: "https://picsum.photos/id/1031/800/600", |
| | | duration: "00:10:30", |
| | | present: true, |
| | | }, |
| | | { |
| | | id: 5, |
| | | plateNumber: "èE13579", |
| | | vehicleType: "0", |
| | | color: "é¶è²", |
| | | direction: "1", |
| | | timestamp: "2025-12-31 07:55:45", |
| | | channelName: "ä¸é¨éé", |
| | | identifyMethod: "车çè¯å«", |
| | | status: "1", |
| | | frontImage: "https://picsum.photos/id/1032/800/600", |
| | | sideImage: "https://picsum.photos/id/1033/800/600", |
| | | duration: "02:30:15", |
| | | present: false, |
| | | }, |
| | | { |
| | | id: 6, |
| | | plateNumber: "æµF24680", |
| | | vehicleType: "3", |
| | | color: "é»è²", |
| | | direction: "0", |
| | | timestamp: "2025-12-31 07:50:30", |
| | | channelName: "åé¨éé", |
| | | identifyMethod: "人工ç»è®°", |
| | | status: "0", |
| | | frontImage: "https://picsum.photos/id/1034/800/600", |
| | | sideImage: "https://picsum.photos/id/1035/800/600", |
| | | duration: "00:15:30", |
| | | present: true, |
| | | }, |
| | | { |
| | | id: 7, |
| | | plateNumber: "é²G97531", |
| | | vehicleType: "1", |
| | | color: "绿è²", |
| | | direction: "1", |
| | | timestamp: "2025-12-31 07:45:15", |
| | | channelName: "西é¨éé", |
| | | identifyMethod: "车çè¯å«", |
| | | status: "1", |
| | | frontImage: "https://picsum.photos/id/1036/800/600", |
| | | sideImage: "https://picsum.photos/id/1037/800/600", |
| | | duration: "01:45:30", |
| | | present: false, |
| | | }, |
| | | { |
| | | id: 8, |
| | | plateNumber: "豫H86420", |
| | | vehicleType: "0", |
| | | color: "ç°è²", |
| | | direction: "0", |
| | | timestamp: "2025-12-31 07:40:00", |
| | | channelName: "åé¨éé", |
| | | identifyMethod: "ICå¡è¯å«", |
| | | status: "0", |
| | | frontImage: "https://picsum.photos/id/1038/800/600", |
| | | sideImage: "https://picsum.photos/id/1039/800/600", |
| | | duration: "00:20:15", |
| | | present: true, |
| | | }, |
| | | ]; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const filters = reactive({ |
| | | plateNumber: "", |
| | | vehicleType: "", |
| | | direction: "", |
| | | timeRange: [], |
| | | }); |
| | | |
| | | const dataList = ref([]); |
| | | const pagination = reactive({ |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | const detailVisible = ref(false); |
| | | const selectedVehicle = ref({}); |
| | | |
| | | // æ¶é´èå´ |
| | | const timeRange = reactive({ |
| | | startTime: "", |
| | | endTime: "", |
| | | }); |
| | | |
| | | // ç¶ææ å° |
| | | const statusMap = { |
| | | '0': '<el-tag type="success">æ£å¸¸</el-tag>', |
| | | '1': '<el-tag type="info">已离å¼</el-tag>', |
| | | '2': '<el-tag type="warning">å¼å¸¸</el-tag>', |
| | | }; |
| | | |
| | | // ç±»åæ å° |
| | | const typeMap = { |
| | | 0: "å°å车", |
| | | 1: "ä¸å车", |
| | | 2: "大å车", |
| | | 3: "ç¹ç§è½¦", |
| | | }; |
| | | |
| | | // ç»è®¡æ°æ® |
| | | const todayInCount = computed(() => { |
| | | const today = dayjs().format("YYYY-MM-DD"); |
| | | return mockVehicles.filter((vehicle) => { |
| | | return vehicle.direction === "0" && vehicle.timestamp.startsWith(today); |
| | | }).length; |
| | | }); |
| | | |
| | | const todayOutCount = computed(() => { |
| | | const today = dayjs().format("YYYY-MM-DD"); |
| | | return mockVehicles.filter((vehicle) => { |
| | | return vehicle.direction === "1" && vehicle.timestamp.startsWith(today); |
| | | }).length; |
| | | }); |
| | | |
| | | const presentCount = computed(() => { |
| | | return mockVehicles.filter((vehicle) => vehicle.present).length; |
| | | }); |
| | | |
| | | const todayTotalCount = computed(() => { |
| | | const today = dayjs().format("YYYY-MM-DD"); |
| | | return mockVehicles.filter((vehicle) => { |
| | | return vehicle.timestamp.startsWith(today); |
| | | }).length; |
| | | }); |
| | | |
| | | // è¡¨æ ¼åé
ç½® |
| | | const columns = [ |
| | | { |
| | | label: "车çå·ç ", |
| | | align: "center", |
| | | prop: "plateNumber", |
| | | }, |
| | | { |
| | | label: "车è¾ç±»å", |
| | | align: "center", |
| | | prop: "vehicleType", |
| | | formatter: (row) => { |
| | | return typeMap[row.vehicleType]; |
| | | }, |
| | | }, |
| | | { |
| | | label: "车è¾é¢è²", |
| | | align: "center", |
| | | prop: "color", |
| | | }, |
| | | { |
| | | label: "è¿åºæ¹å", |
| | | align: "center", |
| | | prop: "direction", |
| | | formatter: (row) => { |
| | | return row.direction === "0" ? '<el-tag type="success">è¿</el-tag>' : '<el-tag type="info">åº</el-tag>'; |
| | | }, |
| | | }, |
| | | { |
| | | label: "è¿åºæ¶é´", |
| | | align: "center", |
| | | prop: "timestamp", |
| | | }, |
| | | { |
| | | label: "ééåç§°", |
| | | align: "center", |
| | | prop: "channelName", |
| | | }, |
| | | { |
| | | label: "è¯å«æ¹å¼", |
| | | align: "center", |
| | | prop: "identifyMethod", |
| | | }, |
| | | { |
| | | label: "车è¾ç¶æ", |
| | | align: "center", |
| | | prop: "status", |
| | | formatter: (row) => { |
| | | return statusMap[row.status]; |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 140, |
| | | operation: [ |
| | | { |
| | | name: "æ¥ç详æ
", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | viewDetail(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | // è¿æ»¤åçæ°æ® |
| | | const filteredData = computed(() => { |
| | | return mockVehicles.filter((item) => { |
| | | const plateMatch = |
| | | !filters.plateNumber || item.plateNumber.includes(filters.plateNumber); |
| | | const typeMatch = |
| | | !filters.vehicleType || item.vehicleType === filters.vehicleType; |
| | | const directionMatch = |
| | | !filters.direction || item.direction === filters.direction; |
| | | const timeMatch = |
| | | !timeRange.startTime || |
| | | (item.timestamp >= timeRange.startTime && |
| | | item.timestamp <= timeRange.endTime); |
| | | return plateMatch && typeMatch && directionMatch && timeMatch; |
| | | }); |
| | | }); |
| | | |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | const getTableData = () => { |
| | | pagination.total = filteredData.value.length; |
| | | const start = (pagination.currentPage - 1) * pagination.pageSize; |
| | | const end = start + pagination.pageSize; |
| | | dataList.value = filteredData.value.slice(start, end); |
| | | }; |
| | | |
| | | // éç½®è¿æ»¤å¨ |
| | | const resetFilters = () => { |
| | | filters.plateNumber = ""; |
| | | filters.vehicleType = ""; |
| | | filters.direction = ""; |
| | | filters.timeRange = []; |
| | | timeRange.startTime = ""; |
| | | timeRange.endTime = ""; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // å页åå |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | getTableData(); |
| | | }; |
| | | |
| | | // æ¶é´èå´åå |
| | | const changeTimeRange = (value) => { |
| | | if (value && value.length === 2) { |
| | | timeRange.startTime = value[0]; |
| | | timeRange.endTime = value[1]; |
| | | } else { |
| | | timeRange.startTime = ""; |
| | | timeRange.endTime = ""; |
| | | } |
| | | getTableData(); |
| | | }; |
| | | |
| | | // æ¥ç车è¾è¯¦æ
|
| | | const viewDetail = (row) => { |
| | | selectedVehicle.value = row; |
| | | detailVisible.value = true; |
| | | }; |
| | | |
| | | // åå§åæ°æ® |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | .vehicle-stats { |
| | | display: flex; |
| | | gap: 20px; |
| | | margin-bottom: 20px; |
| | | |
| | | .stat-card { |
| | | flex: 1; |
| | | background: #fff; |
| | | padding: 20px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | text-align: center; |
| | | |
| | | .stat-title { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .stat-value { |
| | | font-size: 32px; |
| | | font-weight: bold; |
| | | |
| | | &.in { |
| | | color: #67c23a; |
| | | } |
| | | |
| | | &.out { |
| | | color: #409eff; |
| | | } |
| | | |
| | | &.present { |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | &.total { |
| | | color: #909399; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .vehicle-detail { |
| | | .detail-section { |
| | | margin-bottom: 20px; |
| | | |
| | | h3 { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-bottom: 10px; |
| | | color: #303133; |
| | | } |
| | | } |
| | | |
| | | .vehicle-images { |
| | | display: grid; |
| | | grid-template-columns: repeat(2, 1fr); |
| | | gap: 15px; |
| | | |
| | | .image-item { |
| | | background: #f5f7fa; |
| | | padding: 15px; |
| | | border-radius: 8px; |
| | | |
| | | .image-title { |
| | | font-size: 14px; |
| | | color: #606266; |
| | | margin-bottom: 10px; |
| | | text-align: center; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | size: pagination.pageSize, |
| | | total: pagination.total, |
| | | }" |
| | | :isShowSummary="true" |
| | | :summaryMethod="summaryMethod" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | |
| | | import dayjs from "dayjs"; |
| | | import QRCode from "qrcode"; |
| | | import { ref } from "vue"; |
| | | import { summarizeTable } from "@/utils/summarizeTable"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | |
| | | defineOptions({ |
| | | name: "设å¤å°è´¦", |
| | |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | |
| | | // åè®¡æ¹æ³ |
| | | const summaryMethod = (param) => { |
| | | return summarizeTable( |
| | | param, |
| | | ['number', 'taxIncludingPriceTotal', 'unTaxIncludingPriceTotal', 'taxIncludingPriceUnit'], |
| | | { |
| | | number: { noDecimal: true }, |
| | | taxIncludingPriceTotal: { decimalPlaces: 2 }, |
| | | unTaxIncludingPriceTotal: { decimalPlaces: 2 } |
| | | } |
| | | ); |
| | | }; |
| | | |
| | | const deleteRow = (id) => { |
| | | ElMessageBox.confirm("æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import MaintainModal from "./Modal/MaintainModal.vue"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | |
| | | defineOptions({ |
| | | name: "è®¾å¤æ¥ä¿®", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="data-cards"> |
| | | <div class="data-card sales"> |
| | | <div class="data-title">é宿°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">æ¬æéå®é¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthSaleMoney}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">æªå¼ç¥¨éé¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthSaleHaveMoney}}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="data-card purchase"> |
| | | <div class="data-title">éè´æ°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">æ¬æéè´é¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthPurchaseMoney}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">å¾
仿¬¾éé¢/å
</div> |
| | | <div class="data-value">{{businessInfo.monthPurchaseHaveMoney}}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="data-card inventory"> |
| | | <div class="data-title">åºåæ°æ®</div> |
| | | <div class="data-num"> |
| | | <div> |
| | | <div class="data-desc">å½ååºåæ»é/ä»¶</div> |
| | | <div class="data-value">{{businessInfo.inventoryNum}}</div> |
| | | </div> |
| | | <div> |
| | | <div class="data-desc">仿¥å
¥åº/ä»¶</div> |
| | | <div class="data-value">{{businessInfo.todayInventoryNum}}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="data-cards">--> |
| | | <!-- <div class="data-card sales">--> |
| | | <!-- <div class="data-title">é宿°æ®</div>--> |
| | | <!-- <div class="data-num">--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">æ¬æéå®é¢/å
</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.monthSaleMoney}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">æªå¼ç¥¨éé¢/å
</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.monthSaleHaveMoney}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- --> |
| | | <!-- </div>--> |
| | | <!-- <div class="data-card purchase">--> |
| | | <!-- <div class="data-title">éè´æ°æ®</div>--> |
| | | <!-- <div class="data-num">--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">æ¬æéè´é¢/å
</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.monthPurchaseMoney}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">å¾
仿¬¾éé¢/å
</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.monthPurchaseHaveMoney}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="data-card inventory">--> |
| | | <!-- <div class="data-title">åºåæ°æ®</div>--> |
| | | <!-- <div class="data-num">--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">å½ååºåæ»é/ä»¶</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.inventoryNum}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- <div>--> |
| | | <!-- <div class="data-desc">仿¥å
¥åº/ä»¶</div>--> |
| | | <!-- <div class="data-value">{{businessInfo.todayInventoryNum}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <!-- å³ï¼å¾
åäºé¡¹ --> |
| | | <div class="todo-panel"> |
| | | <div class="section-title">å¾
åäºé¡¹</div> |
| | | <ul class="todo-list" v-if="todoList.length > 0"> |
| | | <li v-for="item in todoList" :key="item.id"> |
| | | <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 20px"> |
| | | <div style="display: flex;justify-content: space-between;align-items: center;"> |
| | | <div class="todo-title">å¾
åç¼å·ï¼{{item.approveId}}</div> |
| | | <div class="todo-division">é¨é¨ï¼{{item.approveDeptName}}</div> |
| | | <div class="todo-time">{{item.approveTime}}</div> |
| | | </div> |
| | | <div class="todo-division">å¾
åäºç±ï¼{{item.approveReason}}</div> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | <div v-else style="text-align: center"> |
| | | ææ æ°æ® |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ä¸é¨æ¨ªå两æ --> |
| | | <div class="dashboard-row"> |
| | | <div class="main-panel"> |
| | | <div class="section-title">客æ·ååéé¢åæ</div> |
| | | <div class="contract-summary"> |
| | | <div class="contract-info"> |
| | | <img src="../assets/images/khtitle.png" alt="" style="width: 42px"/> |
| | | <div class="contract-card"> |
| | | <div class="contract-name">æ»ååéé¢(å
)</div> |
| | | <div class="contract-meta"> |
| | | <div class="main-amount">{{sum}}</div> |
| | | <div>å¨åæ¯: <span class="up">{{yny}}% </span> æ¥ç¯æ¯: <span class="up">{{chain}}% </span></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;align-items: center;gap: 20px;justify-content: space-evenly;height: 180px;margin-top: 20px"> |
| | | <div> |
| | | <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStylePie" |
| | | :series="materialPieSeries" |
| | | :tooltip="pieTooltip"></Echarts> |
| | | </div> |
| | | <ul class="contract-list"> |
| | | <li v-for="item in materialPieSeries[0].data" :key="item.name"> |
| | | <div style="display: flex;align-items: center;justify-content: space-between;width: 100%"> |
| | | <div class="line" :style="{color: item.itemStyle.color}">â{{item.name}}</div> |
| | | <div style="width: 70px">{{item.rate}}%</div> |
| | | <div>ï¿¥{{item.value}}</div> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <div class="main-panel"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <div class="section-title">åºæ¶åºä»ç»è®¡</div> |
| | | <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable"> |
| | | <el-radio-button label="æå¨" :value="1" /> |
| | | <el-radio-button label="ææ" :value="2" /> |
| | | <el-radio-button label="æå£åº¦" :value="3" /> |
| | | </el-radio-group> |
| | | </div> |
| | | <Echarts ref="chart" |
| | | :color="barColors2" |
| | | :chartStyle="chartStyle" |
| | | :grid="grid" |
| | | :series="barSeries" |
| | | :tooltip="tooltip" |
| | | :xAxis="xAxis" |
| | | :yAxis="yAxis" |
| | | style="height: 260px"></Echarts> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="todo-panel">--> |
| | | <!-- <div class="section-title">å¾
åäºé¡¹</div>--> |
| | | <!-- <ul class="todo-list" v-if="todoList.length > 0">--> |
| | | <!-- <li v-for="item in todoList" :key="item.id">--> |
| | | <!-- <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 20px">--> |
| | | <!-- <div style="display: flex;justify-content: space-between;align-items: center;">--> |
| | | <!-- <div class="todo-title">æµç¨ç¼å·ï¼{{item.approveId}}</div>--> |
| | | <!-- <div class="todo-division">ç³è¯·é¨é¨ï¼{{item.approveDeptName}}</div>--> |
| | | <!-- <div class="todo-time">{{item.approveTime}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="todo-division">审æ¹äºç±ï¼{{item.approveReason}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- </li>--> |
| | | <!-- </ul>--> |
| | | <!-- <div v-else style="text-align: center">--> |
| | | <!-- ææ æ°æ®--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- --> |
| | | <!-- <!– ä¸é¨æ¨ªåä¸¤æ –>--> |
| | | <!-- <div class="dashboard-row">--> |
| | | <!-- <div class="main-panel">--> |
| | | <!-- <div class="section-title">客æ·ååéé¢åæ</div>--> |
| | | <!-- <div class="contract-summary">--> |
| | | <!-- <div class="contract-info">--> |
| | | <!-- <img src="../assets/images/khtitle.png" alt="" style="width: 42px"/>--> |
| | | <!-- <div class="contract-card">--> |
| | | <!-- <div class="contract-name">æ»ååéé¢(å
)</div>--> |
| | | <!-- <div class="contract-meta">--> |
| | | <!-- <div class="main-amount">{{sum}}</div>--> |
| | | <!-- <div>å¨åæ¯: <span class="up">{{yny}}% </span> æ¥ç¯æ¯: <span class="up">{{chain}}% </span></div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div style="display: flex;align-items: center;gap: 20px;justify-content: space-evenly;height: 180px;margin-top: 20px">--> |
| | | <!-- <div>--> |
| | | <!-- <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStylePie"--> |
| | | <!-- :series="materialPieSeries"--> |
| | | <!-- :tooltip="pieTooltip"></Echarts>--> |
| | | <!-- </div>--> |
| | | <!-- <ul class="contract-list">--> |
| | | <!-- <li v-for="item in materialPieSeries[0].data" :key="item.name">--> |
| | | <!-- <div style="display: flex;align-items: center;justify-content: space-between;width: 100%">--> |
| | | <!-- <div class="line" :style="{color: item.itemStyle.color}">â{{item.name}}</div>--> |
| | | <!-- <div style="width: 70px">{{item.rate}}%</div>--> |
| | | <!-- <div>ï¿¥{{item.value}}</div>--> |
| | | <!-- </div>--> |
| | | <!-- </li>--> |
| | | <!-- </ul>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="main-panel">--> |
| | | <!-- <div style="display: flex;justify-content: space-between;">--> |
| | | <!-- <div class="section-title">åºæ¶åºä»ç»è®¡</div>--> |
| | | <!--<!– <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">–>--> |
| | | <!--<!– <el-radio-button label="æå¨" :value="1" />–>--> |
| | | <!--<!– <el-radio-button label="ææ" :value="2" />–>--> |
| | | <!--<!– <el-radio-button label="æå£åº¦" :value="3" />–>--> |
| | | <!--<!– </el-radio-group>–>--> |
| | | <!-- </div>--> |
| | | <!-- <Echarts ref="chart"--> |
| | | <!-- :color="barColors2"--> |
| | | <!-- :chartStyle="chartStyle"--> |
| | | <!-- :grid="grid"--> |
| | | <!-- :series="barSeries"--> |
| | | <!-- :tooltip="tooltip"--> |
| | | <!-- :xAxis="xAxis"--> |
| | | <!-- :yAxis="yAxis"--> |
| | | <!-- style="height: 260px"></Echarts>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- åºé¨æ¨ªå两æ --> |
| | | <div class="dashboard-row"> |
| | | <!-- <div class="dashboard-row">--> |
| | | <!-- <div class="main-panel">--> |
| | | <!-- <div class="section-title">è´¨éç»è®¡</div>--> |
| | | <!-- <div class="quality-cards">--> |
| | |
| | | <!-- :yAxis="yAxis1"--> |
| | | <!-- style="height: 260px"></Echarts>--> |
| | | <!-- </div>--> |
| | | <div class="main-panel"> |
| | | <div class="section-title">忬¾ä¸å¼ç¥¨åæ</div> |
| | | <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries" |
| | | :tooltip="tooltipLine" :xAxis="xAxis2" :yAxis="yAxis2" style="height: 270px;"></Echarts> |
| | | </div> |
| | | <!-- <div class="main-panel">--> |
| | | <!-- <div class="section-title">忬¾ä¸å¼ç¥¨åæ</div>--> |
| | | <!-- <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries"--> |
| | | <!-- :tooltip="tooltipLine" :xAxis="xAxis2" :yAxis="yAxis2" style="height: 270px;"></Echarts>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | min-width: 0; |
| | | background-color: #EFF2FB; /* ä½¿ç¨æå®çèæ¯é¢è² */ |
| | | background-image: url("../assets/images/denglu.png"); |
| | | background-size: cover; |
| | | background-size: 100% 260%; |
| | | background-position: center; |
| | | background-repeat: no-repeat; |
| | | border-radius: 12px; |
| | |
| | | } |
| | | .quality-card.three { |
| | | background-image: url("../assets/images/chuchang.png"); |
| | | |
| | | |
| | | } |
| | | .quality-card span { |
| | | color: #4fc3f7; |
| | |
| | | height: 220px; |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | selectProductRecordListByPuechaserId |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { purchaseListPage } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | const calculateTotalPrice = (row) => { |
| | | const quantityStock = Number(row?.quantityStock ?? 0); |
| | | const taxInclusiveUnitPrice = Number(row?.taxInclusiveUnitPrice ?? 0); |
| | | |
| | | |
| | | if (Number.isFinite(quantityStock) && Number.isFinite(taxInclusiveUnitPrice)) { |
| | | row.taxInclusiveTotalPrice = quantityStock * taxInclusiveUnitPrice; |
| | | } else { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢èªå®ä¹å
¥åº' : 'ç¼è¾èªå®ä¹å
¥åº'" width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <div style="margin-bottom: 10px;" v-if="operationType === 'add'"> |
| | | <el-button type="primary" @click="addProductRow">æ°å¢</el-button> |
| | | </div> |
| | | <el-table |
| | | :data="productList" |
| | | border |
| | | v-loading="loadingProducts" |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" |
| | | /> |
| | | <el-table-column label="产å大类" prop="productCategory" width="200"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.productCategory" placeholder="请è¾å
¥äº§å大类" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" width="200"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.specificationModel" placeholder="请è¾å
¥è§æ ¼åå·" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åä½" prop="unit" width="100"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.unit" placeholder="请è¾å
¥åä½" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¾åºå" prop="supplierName" width="200"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.supplierName" placeholder="请è¾å
¥ä¾åºå" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç©åç±»å" prop="itemType" width="150"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.itemType" placeholder="请è¾å
¥ç©åç±»å" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å
¥åºæ°é" prop="inboundNum" width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å
¥åºæ¥æ" prop="inboundDate" width="180"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | v-model="scope.row.inboundDate" |
| | | type="date" |
| | | placeholder="è¯·éæ©å
¥åºæ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | style="width: 100%" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åä»·(å
)" prop="taxInclusiveUnitPrice" width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æ»ä»·(å
)" |
| | | prop="taxInclusiveTotalPrice" |
| | | width="150" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80" v-if="operationType === 'add'"> |
| | | <template #default="scope"> |
| | | <el-button type="danger" size="small" @click="removeProductRow(scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance } from 'vue' |
| | | import useUserStore from '@/store/modules/user' |
| | | import { |
| | | addStockInCustom, |
| | | updateStockInCustom, |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close', 'success']) |
| | | |
| | | const operationType = ref('')// æä½ç±»å: 'add' æ 'edit' |
| | | const dialogFormVisible = ref(false)// å¼¹æ¡æ¾ç¤ºç¶æ |
| | | const productList = ref([]);// 产ååè¡¨æ°æ® |
| | | const loadingProducts = ref(false);// 产åå è½½ç¶æ |
| | | const loading = ref(false); |
| | | |
| | | function formatDateTime(date = new Date(), includeTime = true) { |
| | | const d = new Date(date); |
| | | const year = d.getFullYear(); |
| | | const month = String(d.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(d.getDate()).padStart(2, '0'); |
| | | |
| | | if (!includeTime) { |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | |
| | | const hours = String(d.getHours()).padStart(2, '0'); |
| | | const minutes = String(d.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(d.getSeconds()).padStart(2, '0'); |
| | | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | |
| | | const taxRateOptions = [ |
| | | { label: '1', value: 1 }, |
| | | { label: '6', value: 6 }, |
| | | { label: '13', value: 13 }, |
| | | ] |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | id: null, |
| | | supplierId: null, // ä¾åºåID |
| | | supplierName: '', // ä¾åºååç§° |
| | | recorderId: userStore.userId, // å½å
¥äººID |
| | | recorderName: userStore.name, // å½å
¥äººå§å |
| | | entryDate: getCurrentDate(), // å½å
¥æ¥æ |
| | | remark: '', // 夿³¨ |
| | | }, |
| | | rules: { |
| | | supplierName: [{ required: true, message: "请è¾å
¥ä¾åºååç§°", trigger: "blur" }] |
| | | } |
| | | }) |
| | | const { form, rules } = toRefs(data) |
| | | |
| | | // æ°å¢äº§åè¡ |
| | | const addProductRow = () => { |
| | | productList.value.push({ |
| | | id: null, |
| | | productCategory: '', |
| | | specificationModel: '', |
| | | unit: '', |
| | | supplierName: form.value.supplierName || '', |
| | | itemType: '', |
| | | inboundNum: 0, |
| | | inboundDate: getCurrentDate(), // é»è®¤å½å¤©æ¥æ |
| | | // quantityStock: 0, |
| | | taxInclusiveUnitPrice: 0, |
| | | taxInclusiveTotalPrice: 0, |
| | | taxRate: null, |
| | | taxExclusiveTotalPrice: 0, |
| | | }); |
| | | }; |
| | | |
| | | // å é¤äº§åè¡ |
| | | const removeProductRow = (index) => { |
| | | productList.value.splice(index, 1); |
| | | }; |
| | | |
| | | // è®¡ç®æ»ä»·ï¼æ ¹æ®æ°éãåä»·åå«ç¨åä»·ï¼ |
| | | const calculateTotalPrice = (row) => { |
| | | // è®¡ç®æ®éæ»ä»·ï¼inboundNum * taxInclusiveUnitPrice |
| | | const quantity = Number(row.inboundNum || 0); |
| | | const taxInclusiveUnitPrice = Number(row.taxInclusiveUnitPrice || 0); |
| | | row.taxInclusiveTotalPrice = quantity * taxInclusiveUnitPrice; |
| | | calculateExclusivePrice(row); |
| | | }; |
| | | |
| | | // 计ç®ä¸å«ç¨æ»ä»·ï¼æ ¹æ®å«ç¨æ»ä»·åç¨çï¼ |
| | | const calculateExclusivePrice = (row) => { |
| | | const taxInclusiveTotalPrice = Number(row.taxInclusiveTotalPrice || 0); |
| | | const taxRate = Number(row.taxRate || 0); |
| | | row.taxExclusiveTotalPrice = taxInclusiveTotalPrice / (1 + taxRate / 100); |
| | | }; |
| | | |
| | | const submitForm = async () => { |
| | | try { |
| | | await proxy.$refs.formRef.validate() |
| | | |
| | | if (!productList.value.length) { |
| | | proxy.$modal.msgError('请è³å°æ·»å 䏿¡äº§åæ°æ®') |
| | | return |
| | | } |
| | | |
| | | // éªè¯èªå®ä¹æ·»å çæ°æ®å¿
å¡«åæ®µ |
| | | for (let i = 0; i < productList.value.length; i++) { |
| | | const product = productList.value[i]; |
| | | if (!product.productCategory || !product.specificationModel || !product.unit) { |
| | | proxy.$modal.msgError(`第${i + 1}è¡äº§åæ°æ®æªå¡«å宿´ï¼äº§å大类ãè§æ ¼åå·ãåä½ä¸ºå¿
å¡«ï¼`) |
| | | return |
| | | } |
| | | if (!product.itemType) { |
| | | proxy.$modal.msgError(`第${i + 1}è¡è¯·éæ©ç©åç±»å`) |
| | | return |
| | | } |
| | | if (!product.inboundDate) { |
| | | proxy.$modal.msgError(`第${i + 1}è¡è¯·éæ©å
¥åºæ¥æ`) |
| | | return |
| | | } |
| | | const stock = Number(product?.inboundNum ?? 0); |
| | | if (!Number.isFinite(stock) || stock <= 0) { |
| | | proxy.$modal.msgError(`第${i + 1}è¡æ¬æ¬¡å
¥åºæ°éé大äº0`) |
| | | return |
| | | } |
| | | } |
| | | |
| | | const payloadList = productList.value.map(product => ({ |
| | | id: product.id ?? null, |
| | | inboundNum: Number(product.inboundNum), |
| | | productCategory: product.productCategory, |
| | | specificationModel: product.specificationModel, |
| | | unit: product.unit, |
| | | supplierName: product.supplierName || form.value.supplierName, |
| | | itemType: product.itemType, |
| | | inboundDate: formatDateTime(product.inboundDate, false), |
| | | taxRate: Number(product.taxRate || 0), |
| | | taxExclusiveTotalPrice: Number(product.taxExclusiveTotalPrice || 0), |
| | | taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice || 0), |
| | | taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice || 0), |
| | | })); |
| | | loading.value = true |
| | | if (operationType.value === 'edit') { |
| | | const editPayload = payloadList[0] |
| | | await updateStockInCustom(editPayload) |
| | | } else { |
| | | await addStockInCustom(payloadList) |
| | | } |
| | | |
| | | proxy.$modal.msgSuccess(operationType.value === 'edit' ? 'ç¼è¾èªå®ä¹å
¥åºæå' : 'æ°å¢èªå®ä¹å
¥åºæå') |
| | | closeDia() |
| | | emit('success') |
| | | |
| | | } catch (error) { |
| | | console.error('æäº¤å¤±è´¥:', error) |
| | | if (!error.errors) { |
| | | proxy.$modal.msgError('æä½å¤±è´¥ï¼è¯·éè¯') |
| | | } |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | const closeDia = () => { |
| | | proxy.$refs.formRef.resetFields() |
| | | dialogFormVisible.value = false |
| | | productList.value = [] |
| | | emit('close') |
| | | } |
| | | |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type |
| | | dialogFormVisible.value = true |
| | | |
| | | if (type === 'add') { |
| | | form.value = { |
| | | id: null, |
| | | supplierId: null, |
| | | supplierName: '', |
| | | recorderId: userStore.userId, |
| | | recorderName: userStore.name, |
| | | entryDate: getCurrentDate(), |
| | | remark: '' |
| | | } |
| | | productList.value = [] |
| | | } else { |
| | | // ç¼è¾æ¨¡å¼ï¼å°è¡æ°æ®å¡«å
å°è¡¨æ ¼ä¸ä»¥æ¯æä¿®æ¹ |
| | | form.value = { |
| | | id: row?.id ?? null, |
| | | supplierId: row?.supplierId ?? null, |
| | | supplierName: row?.supplierName ?? '', |
| | | recorderId: userStore.userId, |
| | | recorderName: userStore.name, |
| | | entryDate: getCurrentDate(), |
| | | remark: row?.remark ?? '' |
| | | } |
| | | productList.value = [{ |
| | | id: row?.id ?? null, |
| | | productCategory: row?.productCategory ?? '', |
| | | specificationModel: row?.specificationModel ?? '', |
| | | unit: row?.unit ?? '', |
| | | supplierName: row?.supplierName ?? '', |
| | | itemType: row?.itemType ?? '', |
| | | inboundNum: Number(row?.inboundNum ?? row?.inboundQuantity ?? 0), |
| | | inboundDate: row?.inboundDate ?? row?.createTime ?? '', |
| | | taxRate: Number(row?.taxRate ?? 0), |
| | | taxInclusiveUnitPrice: Number(row?.taxInclusiveUnitPrice ?? 0), |
| | | taxInclusiveTotalPrice: Number(row?.taxInclusiveTotalPrice ?? 0), |
| | | taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0), |
| | | }] |
| | | } |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | | |
| | |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.unitPrice" @change="() => calculateTotalPrice(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æ»ä»·(å
)" |
| | | prop="totalPrice" |
| | | width="150" |
| | | <el-table-column |
| | | label="æ»ä»·(å
)" |
| | | prop="totalPrice" |
| | | width="150" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80" v-if="operationType === 'add'"> |
| | |
| | | import { |
| | | addStockInCustom, updateProduct |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | const submitForm = async () => { |
| | | try { |
| | | await proxy.$refs.formRef.validate() |
| | | |
| | | |
| | | if (!productList.value.length) { |
| | | proxy.$modal.msgError('请è³å°æ·»å 䏿¡äº§åæ°æ®') |
| | | return |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢ææåºå' : 'ç¼è¾ææåºå'" width="70%" |
| | | @update:model-value="$emit('update:dialogFormVisible', $event)" @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <el-input disabled v-model="form.productCategory" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="specificationModel"> |
| | | <el-input disabled v-model="form.specificationModel" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="unit"> |
| | | <el-input disabled v-model="form.unit" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç©åç±»åï¼" prop="itemType"> |
| | | <el-input disabled v-model="form.itemType" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ¶é´ï¼" prop="createTime"> |
| | | <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåæ°éï¼" prop="inboundNum"> |
| | | <el-input v-model="form.inboundNum" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¢è¦å¼ï¼" prop="warnNum"> |
| | | <el-input-number v-model="form.warnNum" placeholder="请è¾å
¥é¢è¦å¼" clearable min="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·²åºåºæ°éï¼" prop="totalInboundNum"> |
| | | <el-input disabled v-model="form.totalInboundNum" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¾
åºåºæ°éï¼" prop="inboundNum0"> |
| | | <el-input disabled v-model="form.inboundNum0" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä»·(å
)ï¼" prop="taxInclusiveUnitPrice"> |
| | | <el-input v-model="form.taxInclusiveUnitPrice" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ»ä»·(å
)ï¼" prop="taxInclusiveTotalPrice"> |
| | | <el-input disabled v-model="form.taxInclusiveTotalPrice" placeholder="èªå¨è®¡ç®" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, watch } from 'vue' |
| | | |
| | | const props = defineProps({ |
| | | dialogFormVisible: Boolean, |
| | | operationType: String, |
| | | formData: Object |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close']) |
| | | |
| | | const formRef = ref() |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | productCategory: '', |
| | | specificationModel: '', |
| | | unit: '', |
| | | itemType: '', |
| | | createTime: '', |
| | | inboundNum: '', |
| | | totalInboundNum: '', |
| | | inboundNum0: '', |
| | | taxInclusiveUnitPrice: '', |
| | | taxInclusiveTotalPrice: '', |
| | | warnNum: '' |
| | | }, |
| | | rules: { |
| | | productCategory: [{ required: true, message: '请è¾å
¥äº§å大类', trigger: 'blur' }], |
| | | specificationModel: [{ required: true, message: '请è¾å
¥è§æ ¼åå·', trigger: 'blur' }], |
| | | unit: [{ required: true, message: '请è¾å
¥åä½', trigger: 'blur' }], |
| | | itemType: [{ required: true, message: '请è¾å
¥ç©åç±»å', trigger: 'blur' }], |
| | | createTime: [{ required: true, message: 'è¯·éæ©å
¥åºæ¶é´', trigger: 'change' }], |
| | | inboundNum: [{ required: true, message: '请è¾å
¥åºåæ°é', trigger: 'blur' }], |
| | | taxInclusiveUnitPrice: [{ required: true, message: '请è¾å
¥åä»·', trigger: 'blur' }], |
| | | warnNum: [{ required: true, message: '请è¾å
¥é¢è¦å¼', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | const { form, rules } = toRefs(data) |
| | | |
| | | // è®¡ç®æ»ä»·ï¼æ»ä»· = åä»· à å©ä½åºå |
| | | const calculateTotalPrice = () => { |
| | | const unitPrice = parseFloat(form.value.taxInclusiveUnitPrice) || 0 |
| | | const stockQuantity = parseFloat(form.value.inboundNum) || 0 // åºåæ°é |
| | | const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // å·²åºåºæ°é |
| | | const remainingStock = stockQuantity - outboundQuantity // å©ä½åºå |
| | | form.value.taxInclusiveTotalPrice = (unitPrice * remainingStock).toFixed(2) |
| | | } |
| | | |
| | | // çå¬formDataåå |
| | | watch(() => props.formData, (newVal) => { |
| | | if (newVal) { |
| | | form.value = { ...newVal } |
| | | // æ°æ®åååéæ°è®¡ç®æ»ä»· |
| | | calculateTotalPrice() |
| | | } |
| | | }, { immediate: true }) |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | emit('submit', form.value) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | emit('close') |
| | | emit('update:dialogFormVisible', false) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .dialog-footer { |
| | | text-align: center; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢æååºå' : 'ç¼è¾æååºå'" width="70%" |
| | | @update:model-value="$emit('update:dialogFormVisible', $event)" @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <el-input disabled v-model="form.productCategory" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="specificationModel"> |
| | | <el-input disabled v-model="form.specificationModel" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="unit"> |
| | | <el-input disabled v-model="form.unit" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ¶é´ï¼" prop="createTime"> |
| | | <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåæ°éï¼" prop="inboundNum"> |
| | | <el-input v-model="form.inboundNum" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·²åºåºæ°éï¼" prop="totalInboundNum"> |
| | | <el-input disabled v-model="form.totalInboundNum" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¾
åºåºæ°éï¼" prop="inboundNum0"> |
| | | <el-input disabled v-model="form.inboundNum0" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä»·(å
)ï¼" prop="unitPrice"> |
| | | <el-input v-model="form.unitPrice" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ»ä»·(å
)ï¼" prop="totalPrice"> |
| | | <el-input disabled v-model="form.totalPrice" placeholder="èªå¨è®¡ç®" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, watch } from 'vue' |
| | | |
| | | const props = defineProps({ |
| | | dialogFormVisible: Boolean, |
| | | operationType: String, |
| | | formData: Object |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close']) |
| | | |
| | | const formRef = ref() |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | productCategory: '', |
| | | specificationModel: '', |
| | | unit: '', |
| | | createTime: '', |
| | | inboundNum: '', |
| | | totalInboundNum: '', |
| | | inboundNum0: '', |
| | | unitPrice: '', |
| | | totalPrice: '' |
| | | }, |
| | | rules: { |
| | | productCategory: [{ required: true, message: '请è¾å
¥äº§å大类', trigger: 'blur' }], |
| | | specificationModel: [{ required: true, message: '请è¾å
¥è§æ ¼åå·', trigger: 'blur' }], |
| | | unit: [{ required: true, message: '请è¾å
¥åä½', trigger: 'blur' }], |
| | | createTime: [{ required: true, message: 'è¯·éæ©å
¥åºæ¶é´', trigger: 'change' }], |
| | | inboundNum: [{ required: true, message: '请è¾å
¥åºåæ°é', trigger: 'blur' }], |
| | | unitPrice: [{ required: true, message: '请è¾å
¥åä»·', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | const { form, rules } = toRefs(data) |
| | | |
| | | // è®¡ç®æ»ä»·ï¼æ»ä»· = åä»· à å©ä½åºå |
| | | const calculateTotalPrice = () => { |
| | | const unitPrice = parseFloat(form.value.unitPrice) || 0 |
| | | const stockQuantity = parseFloat(form.value.inboundNum) || 0 // åºåæ°é |
| | | const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // å·²åºåºæ°é |
| | | const remainingStock = stockQuantity - outboundQuantity // å©ä½åºå |
| | | form.value.totalPrice = (unitPrice * remainingStock).toFixed(2) |
| | | } |
| | | |
| | | // çå¬formDataåå |
| | | watch(() => props.formData, (newVal) => { |
| | | if (newVal) { |
| | | form.value = { ...newVal } |
| | | // æ°æ®åååéæ°è®¡ç®æ»ä»· |
| | | calculateTotalPrice() |
| | | } |
| | | }, { immediate: true }) |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | emit('submit', form.value) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | emit('close') |
| | | emit('update:dialogFormVisible', false) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .dialog-footer { |
| | | text-align: center; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :model-value="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢åæåºå' : 'ç¼è¾åæåºå'" width="70%" |
| | | @update:model-value="$emit('update:dialogFormVisible', $event)" @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <el-input disabled v-model="form.productCategory" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="specificationModel"> |
| | | <el-input disabled v-model="form.specificationModel" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="unit"> |
| | | <el-input disabled v-model="form.unit" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ¶é´ï¼" prop="createTime"> |
| | | <el-date-picker style="width: 100%" v-model="form.createTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåæ°éï¼" prop="inboundNum"> |
| | | <el-input v-model="form.inboundNum" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·²åºåºæ°éï¼" prop="totalInboundNum"> |
| | | <el-input disabled v-model="form.totalInboundNum" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¾
åºåºæ°éï¼" prop="inboundNum0"> |
| | | <el-input disabled v-model="form.inboundNum0" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·(å
)ï¼" prop="taxInclusiveUnitPrice"> |
| | | <el-input v-model="form.taxInclusiveUnitPrice" placeholder="请è¾å
¥" clearable @input="calculateTotalPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨æ»ä»·(å
)ï¼" prop="taxInclusiveTotalPrice"> |
| | | <el-input disabled v-model="form.taxInclusiveTotalPrice" placeholder="èªå¨è®¡ç®" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, watch } from 'vue' |
| | | |
| | | const props = defineProps({ |
| | | dialogFormVisible: Boolean, |
| | | operationType: String, |
| | | formData: Object |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:dialogFormVisible', 'submit', 'close']) |
| | | |
| | | const formRef = ref() |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | productCategory: '', |
| | | specificationModel: '', |
| | | unit: '', |
| | | createTime: '', |
| | | inboundNum: '', |
| | | totalInboundNum: '', |
| | | inboundNum0: '', |
| | | taxInclusiveUnitPrice: '', |
| | | taxInclusiveTotalPrice: '' |
| | | }, |
| | | rules: { |
| | | productCategory: [{ required: true, message: '请è¾å
¥äº§å大类', trigger: 'blur' }], |
| | | specificationModel: [{ required: true, message: '请è¾å
¥è§æ ¼åå·', trigger: 'blur' }], |
| | | unit: [{ required: true, message: '请è¾å
¥åä½', trigger: 'blur' }], |
| | | createTime: [{ required: true, message: 'è¯·éæ©å
¥åºæ¶é´', trigger: 'change' }], |
| | | inboundNum: [{ required: true, message: '请è¾å
¥åºåæ°é', trigger: 'blur' }], |
| | | taxInclusiveUnitPrice: [{ required: true, message: '请è¾å
¥å«ç¨åä»·', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | const { form, rules } = toRefs(data) |
| | | |
| | | // è®¡ç®æ»ä»·ï¼å«ç¨æ»ä»· = å«ç¨åä»· à å©ä½åºå |
| | | const calculateTotalPrice = () => { |
| | | const unitPrice = parseFloat(form.value.taxInclusiveUnitPrice) || 0 |
| | | const stockQuantity = parseFloat(form.value.inboundNum) || 0 // åºåæ°é |
| | | const outboundQuantity = parseFloat(form.value.totalInboundNum) || 0 // å·²åºåºæ°é |
| | | const remainingStock = stockQuantity - outboundQuantity // å©ä½åºå |
| | | form.value.taxInclusiveTotalPrice = (unitPrice * remainingStock).toFixed(2) |
| | | } |
| | | |
| | | // çå¬formDataåå |
| | | watch(() => props.formData, (newVal) => { |
| | | if (newVal) { |
| | | form.value = { ...newVal } |
| | | // æ°æ®åååéæ°è®¡ç®æ»ä»· |
| | | calculateTotalPrice() |
| | | } |
| | | }, { immediate: true }) |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | emit('submit', form.value) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | emit('close') |
| | | emit('update:dialogFormVisible', false) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .dialog-footer { |
| | | text-align: center; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form-item label="产å大类ï¼"> |
| | | <el-input |
| | | v-model="searchForm.productCategory" |
| | | placeholder="请è¾å
¥äº§å大类" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·ï¼"> |
| | | <el-input |
| | | v-model="searchForm.specificationModel" |
| | | placeholder="请è¾å
¥è§æ ¼åå·" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="é¢è¦ç¶æï¼"> |
| | | <el-select |
| | | v-model="searchForm.warningStatus" |
| | | placeholder="è¯·éæ©é¢è¦ç¶æ" |
| | | clearable |
| | | style="width: 150px" |
| | | > |
| | | <el-option label="å·²é¢è¦" value="å·²é¢è¦" /> |
| | | <el-option label="æ£å¸¸" value="æ£å¸¸" /> |
| | | </el-select> |
| | | </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="table_list"> |
| | | <div class="actions"></div> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | style="width: 100%" |
| | | height="calc(100vh - 280px)" |
| | | > |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="æ¹æ¬¡å·" prop="code" width="130" show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" prop="productCategory" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" show-overflow-tooltip /> |
| | | <el-table-column label="å½ååºå" prop="currentStock" width="120" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span :class="getStockClass(scope.row)">{{ scope.row.currentStock || 0 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½åºå" prop="warnNum" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="é¢è¦çº§å«" prop="warningLevel" width="100" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-tag :type="getWarningLevelTag(scope.row.warningLevel)"> |
| | | {{ scope.row.warningLevel || '-' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é¢è¦ç¶æ" prop="warningStatus" width="100" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.warningStatus === 'å·²é¢è¦' ? 'danger' : 'success'"> |
| | | {{ scope.row.warningStatus || 'æ£å¸¸' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é¢è¦æ¶é´" prop="warningTime" width="150" show-overflow-tooltip /> |
| | | <el-table-column label="é¢è®¡ç¼ºè´§æ¶é´" prop="expectedShortageTime" width="150" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <div v-if="scope.row.expectedShortageTime"> |
| | | <div v-if="getCountdown(scope.row.expectedShortageTime).isExpired" class="countdown-expired"> |
| | | <el-tag type="danger">已缺货</el-tag> |
| | | </div> |
| | | <div v-else class="countdown-timer"> |
| | | <span :class="getCountdownClass(scope.row.expectedShortageTime)"> |
| | | {{ getCountdown(scope.row.expectedShortageTime).text }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <span v-else>-</span> |
| | | </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" |
| | | /> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { |
| | | getStockWarningLedgerPage |
| | | } from '@/api/inventoryManagement/stockWarningLedger.js' |
| | | |
| | | // ååºå¼æ°æ® |
| | | const tableData = ref([]) |
| | | const tableLoading = ref(false) |
| | | const total = ref(0) |
| | | |
| | | // å页忰 |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100 |
| | | }) |
| | | |
| | | // æç´¢è¡¨å |
| | | const searchForm = reactive({ |
| | | productCategory: '', |
| | | specificationModel: '', |
| | | warningStatus: '' |
| | | }) |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | const params = { |
| | | ...page, |
| | | ...searchForm |
| | | } |
| | | getStockWarningLedgerPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false |
| | | if (res.code === 200) { |
| | | tableData.value = res.data.records || [] |
| | | total.value = res.data.total || 0 |
| | | |
| | | // 计ç®é¢è¦çº§å«åç¶æ |
| | | tableData.value = tableData.value.map(item => { |
| | | const currentStock = parseFloat(item.inboundNum0 || item.currentStock || 0) |
| | | const warnNum = parseFloat(item.warnNum || 0) |
| | | const safetyStock = parseFloat(item.safetyStock || warnNum * 1.2) |
| | | |
| | | // 计ç®é¢è¦çº§å« |
| | | if (currentStock <= 0) { |
| | | item.warningLevel = 'ç´§æ¥' |
| | | item.warningStatus = 'å·²é¢è¦' |
| | | } else if (currentStock < warnNum) { |
| | | item.warningLevel = 'éè¦' |
| | | item.warningStatus = 'å·²é¢è¦' |
| | | } else if (currentStock < safetyStock) { |
| | | item.warningLevel = 'ä¸è¬' |
| | | item.warningStatus = 'å·²é¢è¦' |
| | | } else { |
| | | item.warningLevel = '' |
| | | item.warningStatus = 'æ£å¸¸' |
| | | } |
| | | |
| | | // 计ç®é¢è®¡ç¼ºè´§æ¶é´ï¼åºäºæ¥åæ¶èéï¼è¿éç®åå¤çï¼ |
| | | if (item.warningStatus === 'å·²é¢è¦' && currentStock > 0 && warnNum > 0) { |
| | | const dailyConsumption = warnNum / 30 // å设30天æ¶è宿ä½åºå |
| | | const daysRemaining = Math.floor(currentStock / dailyConsumption) |
| | | if (daysRemaining > 0) { |
| | | const date = new Date() |
| | | date.setDate(date.getDate() + daysRemaining) |
| | | item.expectedShortageTime = date.toISOString().split('T')[0] |
| | | } |
| | | } |
| | | |
| | | item.currentStock = currentStock |
| | | item.safetyStock = safetyStock |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false |
| | | ElMessage.error(err.msg || 'è·åæ°æ®å¤±è´¥') |
| | | }) |
| | | } |
| | | |
| | | // æç´¢ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // éç½®æç´¢ |
| | | const resetQuery = () => { |
| | | Object.keys(searchForm).forEach(key => { |
| | | searchForm[key] = '' |
| | | }) |
| | | handleQuery() |
| | | } |
| | | |
| | | // å页åå |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page |
| | | page.size = obj.limit |
| | | getList() |
| | | } |
| | | |
| | | // è·ååºåæ ·å¼ç±» |
| | | const getStockClass = (row) => { |
| | | const currentStock = parseFloat(row.currentStock || row.inboundNum0 || 0) |
| | | const warnNum = parseFloat(row.warnNum || 0) |
| | | |
| | | if (currentStock <= 0) { |
| | | return 'text-danger' |
| | | } else if (currentStock < warnNum) { |
| | | return 'text-warning' |
| | | } |
| | | return 'text-success' |
| | | } |
| | | |
| | | // è·åé¢è¦çº§å«æ ç¾æ ·å¼ |
| | | const getWarningLevelTag = (level) => { |
| | | const levelMap = { |
| | | 'ç´§æ¥': 'danger', |
| | | 'éè¦': 'warning', |
| | | 'ä¸è¬': 'info' |
| | | } |
| | | return levelMap[level] || 'info' |
| | | } |
| | | |
| | | // è·åå计æ¶ä¿¡æ¯ |
| | | const getCountdown = (expectedTime) => { |
| | | if (!expectedTime) return { text: '-', isExpired: false } |
| | | |
| | | const now = new Date().getTime() |
| | | const expected = new Date(expectedTime).getTime() |
| | | const diff = expected - now |
| | | |
| | | if (diff <= 0) { |
| | | return { text: '已缺货', isExpired: true } |
| | | } |
| | | |
| | | const days = Math.floor(diff / (1000 * 60 * 60 * 24)) |
| | | const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) |
| | | const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)) |
| | | |
| | | if (days > 0) { |
| | | return { text: `${days}天${hours}å°æ¶`, isExpired: false } |
| | | } else if (hours > 0) { |
| | | return { text: `${hours}å°æ¶${minutes}åé`, isExpired: false } |
| | | } else { |
| | | return { text: `${minutes}åé`, isExpired: false } |
| | | } |
| | | } |
| | | |
| | | // è·ååè®¡æ¶æ ·å¼ç±» |
| | | const getCountdownClass = (expectedTime) => { |
| | | if (!expectedTime) return '' |
| | | |
| | | const now = new Date().getTime() |
| | | const expected = new Date(expectedTime).getTime() |
| | | const diff = expected - now |
| | | |
| | | if (diff <= 0) { |
| | | return 'countdown-expired' |
| | | } else if (diff <= 24 * 60 * 60 * 1000) { // 24å°æ¶å
|
| | | return 'countdown-urgent' |
| | | } else if (diff <= 7 * 24 * 60 * 60 * 1000) { // 7天å
|
| | | return 'countdown-warning' |
| | | } else { |
| | | return 'countdown-normal' |
| | | } |
| | | } |
| | | |
| | | // 页é¢å è½½ |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .app-container { |
| | | padding: 20px; |
| | | |
| | | .search_form { |
| | | background: #fff; |
| | | padding: 20px; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .table_list { |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | padding: 20px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| | | |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | } |
| | | } |
| | | |
| | | .text-danger { |
| | | color: #f56c6c; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .text-warning { |
| | | color: #e6a23c; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .text-success { |
| | | color: #67c23a; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .countdown-timer { |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .countdown-normal { |
| | | color: #67c23a; |
| | | } |
| | | |
| | | .countdown-warning { |
| | | color: #e6a23c; |
| | | } |
| | | |
| | | .countdown-urgent { |
| | | color: #f56c6c; |
| | | animation: blink 1s infinite; |
| | | } |
| | | |
| | | .countdown-expired { |
| | | color: #f56c6c; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | @keyframes blink { |
| | | 0%, 50% { opacity: 1; } |
| | | 51%, 100% { opacity: 0.5; } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="ä»»å¡ç¼å·" width="100" align="center" prop="jobId" />
|
| | | <el-table-column label="ä»»å¡åç§°" align="center" prop="jobName" :show-overflow-tooltip="true" />
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="æ¥å¿ç¼å·" width="80" align="center" prop="jobLogId" />
|
| | | <el-table-column label="ä»»å¡åç§°" align="center" prop="jobName" :show-overflow-tooltip="true" />
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table ref="logininforRef" v-loading="loading" :data="logininforList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
| | | <el-table ref="logininforRef" v-loading="loading" :data="logininforList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="访é®ç¼å·" align="center" prop="infoId" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
| | |
| | | v-loading="loading"
|
| | | :data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
| | | style="width: 100%;"
|
| | | stripe
|
| | | >
|
| | | <el-table-column label="åºå·" width="50" type="index" align="center">
|
| | | <template #default="scope">
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table ref="operlogRef" v-loading="loading" :data="operlogList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
| | | <el-table ref="operlogRef" v-loading="loading" :data="operlogList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange" stripe>
|
| | | <el-table-column type="selection" width="50" align="center" />
|
| | | <el-table-column label="æ¥å¿ç¼å·" align="center" prop="operId" />
|
| | | <el-table-column label="ç³»ç»æ¨¡å" align="center" prop="title" :show-overflow-tooltip="true" />
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">å§åï¼</span> |
| | | <el-input |
| | | v-model="searchForm.staffName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥å§åæç´¢" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <span style="margin-left: 10px;" class="search_title">ååå¼å§æ¥æï¼</span> |
| | | <el-date-picker |
| | | v-model="searchForm.entryDateStart" |
| | | type="date" |
| | | placeholder="è¯·éæ©ååå¼å§æ¥æ" |
| | | size="default" |
| | | @change="(date) => handleDateChange(date,1)" |
| | | /> |
| | | <span style="margin-left: 10px;" class="search_title">ååç»ææ¥æï¼</span> |
| | | <el-date-picker |
| | | v-model="searchForm.entryDateEnd" |
| | | type="date" |
| | | placeholder="è¯·éæ©ååç»ææ¥æ" |
| | | size="default" |
| | | @change="(date) => handleDateChange(date,2)" |
| | | /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px" |
| | | >æç´¢</el-button |
| | | > |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢å
¥è</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="page.total" |
| | | ></PIMTable> |
| | | </div> |
| | | <form-dia ref="formDia" @close="handleQuery"></form-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue"; |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | staffName: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ç¶æ", |
| | | prop: "staffState", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "离è"; |
| | | } else if (params == 1) { |
| | | return "å
¥è"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 0) { |
| | | return "danger"; |
| | | } else if (params == 1) { |
| | | return "primary"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "åå·¥ç¼å·", |
| | | prop: "staffNo", |
| | | }, |
| | | { |
| | | label: "å§å", |
| | | prop: "staffName", |
| | | }, |
| | | { |
| | | label: "æ§å«", |
| | | prop: "sex", |
| | | }, |
| | | { |
| | | label: "ç±è´¯", |
| | | prop: "nativePlace", |
| | | }, |
| | | { |
| | | label: "å²ä½", |
| | | prop: "postJob", |
| | | }, |
| | | { |
| | | label: "å®¶åºä½å", |
| | | prop: "adress", |
| | | width:200 |
| | | }, |
| | | { |
| | | label: "第ä¸å¦å", |
| | | prop: "firstStudy", |
| | | }, |
| | | { |
| | | label: "ä¸ä¸", |
| | | prop: "profession", |
| | | width:100 |
| | | }, |
| | | { |
| | | label: "身份è¯å·", |
| | | prop: "identityCard", |
| | | width:200 |
| | | }, |
| | | { |
| | | label: "å¹´é¾", |
| | | prop: "age", |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "phone", |
| | | width:150 |
| | | }, |
| | | { |
| | | label: "ç´§æ¥è系人", |
| | | prop: "emergencyContact", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "emergencyContactPhone", |
| | | width:150 |
| | | }, |
| | | { |
| | | label: "è¯ç¨æï¼æï¼", |
| | | prop: "probationPeriod", |
| | | width: 120, |
| | | }, |
| | | // { |
| | | // label: "è½¬æ£æ¥æ", |
| | | // prop: "probationEndDate", |
| | | // width: 120, |
| | | // formatData: (row) => { |
| | | // // ä¿®æ¹ä¸ºä½¿ç¨ååå¼å§æ¥æè®¡ç®è½¬æ£æ¥æ |
| | | // if (row.contractStartTime && row.probationPeriod) { |
| | | // // 计ç®è½¬æ£æ¥æï¼ååå¼å§æ¥æå ä¸è¯ç¨æææ°ï¼ |
| | | // return dayjs(row.contractStartTime).add(row.probationPeriod, 'month').format('YYYY-MM-DD'); |
| | | // } |
| | | // return ''; |
| | | // }, |
| | | // formatType: (row) => { |
| | | // // ä¿®æ¹ä¸ºä½¿ç¨ååå¼å§æ¥ææ£æ¥æ¯å¦ä¸´è¿è½¬æ£ï¼7天å
ï¼ |
| | | // if (row.contractStartTime && row.probationPeriod) { |
| | | // const probationEndDate = dayjs(row.contractStartTime).add(row.probationPeriod, 'month'); |
| | | // const daysUntilProbationEnd = probationEndDate.diff(dayjs(), 'day'); |
| | | |
| | | // if (daysUntilProbationEnd >= 0 && daysUntilProbationEnd <= 7) { |
| | | // return 'warning'; // 使ç¨è¦åæ ·å¼æ 记临è¿è½¬æ£çåå·¥ |
| | | // } |
| | | // } |
| | | // return ''; |
| | | // } |
| | | // }, |
| | | { |
| | | label: "ååå¹´éï¼å¹´ï¼", |
| | | prop: "contractTerm", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "ååå¼å§æ¥æ", |
| | | prop: "contractStartTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "ååç»ææ¥æ", |
| | | prop: "contractEndTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const formDia = ref() |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const handleDateChange = (value,type) => { |
| | | searchForm.value.entryDateEnd = null |
| | | searchForm.value.entryDateStart = null |
| | | if(type === 1){ |
| | | if (value) { |
| | | searchForm.value.entryDateStart = dayjs(value).format("YYYY-MM-DD"); |
| | | } |
| | | }else{ |
| | | if (value) { |
| | | searchForm.value.entryDateEnd = dayjs(value).format("YYYY-MM-DD"); |
| | | } |
| | | } |
| | | getList(); |
| | | }; |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const pagination = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | staffJoinListPage({...page, ...searchForm.value, staffState: 1}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records |
| | | page.total = res.data.total; |
| | | |
| | | // æ£æ¥æ¯å¦æä¸´è¿è½¬æ£çå工并æé |
| | | checkProbationEnding(tableData.value); |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | }; |
| | | // æ£æ¥ä¸´è¿è½¬æ£çå工并æé |
| | | const checkProbationEnding = (data) => { |
| | | const probationEndingSoon = []; |
| | | |
| | | data.forEach(item => { |
| | | // ä¿®æ¹ä¸ºä½¿ç¨ååå¼å§æ¥ææ£æ¥ |
| | | if (item.contractStartTime && item.probationPeriod) { |
| | | const probationEndDate = dayjs(item.contractStartTime).add(item.probationPeriod, 'month'); |
| | | const daysUntilProbationEnd = probationEndDate.diff(dayjs(), 'day'); |
| | | |
| | | if (daysUntilProbationEnd >= 0 && daysUntilProbationEnd <= 7) { |
| | | probationEndingSoon.push({ |
| | | staffName: item.staffName, |
| | | probationEndDate: probationEndDate.format('YYYY-MM-DD'), |
| | | daysLeft: daysUntilProbationEnd |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (probationEndingSoon.length > 0) { |
| | | let message = '以ä¸åå·¥å°å¨7天å
转æ£ï¼\n'; |
| | | probationEndingSoon.forEach(item => { |
| | | message += `${item.staffName}ï¼${item.probationEndDate}ï¼è¿æ${item.daysLeft}天ï¼\n`; |
| | | }); |
| | | |
| | | // æ¾ç¤ºæéæ¶æ¯ |
| | | proxy.$modal.msgInfo(message); |
| | | } |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | |
| | | // å é¤ |
| | | 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(() => { |
| | | staffJoinDel(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 1}, "人åå
¥è.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | height="calc(100vh - 18.5em)" |
| | | :highlight-current-row="true" |
| | | style="width: 100%" |
| | | stripe |
| | | tooltip-effect="dark" |
| | | @row-click="rowClick" |
| | | :show-summary="isShowSummary" |
| | |
| | | <template> |
| | | <el-form :model="form"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éè´ååå·ï¼"> |
| | | <el-tag size="large">{{ form.purchaseContractNumber }}</el-tag> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼"> |
| | | <el-text>{{ form.salesContractNo }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·(å
)ï¼"> |
| | | <el-text type="primary">{{ form.taxInclusiveUnitPrice }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å建æ¶é´ï¼"> |
| | | <el-text>{{ form.createdAt }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼"> |
| | | <el-input disabled v-model="form.invoiceNumber" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥ç¥¨æ°ï¼"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡æ¥ç¥¨éé¢(å
)ï¼"> |
| | | <el-form :model="form"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éè´ååå·ï¼"> |
| | | <el-tag size="large">{{ form.purchaseContractNumber }}</el-tag> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼"> |
| | | <el-text>{{ form.salesContractNo }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·(å
)ï¼"> |
| | | <el-text type="primary">{{ form.taxInclusiveUnitPrice }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å建æ¶é´ï¼"> |
| | | <el-text>{{ form.createdAt }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼"> |
| | | <el-input v-model="form.invoiceNumber" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥ç¥¨æ°ï¼"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡æ¥ç¥¨éé¢(å
)ï¼"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount" :precision="2"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æªæ¥ç¥¨æ°ï¼"> |
| | | <el-text type="success">{{ form.futureTickets }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æªæ¥ç¥¨æ°ï¼"> |
| | | <el-text type="success">{{ form.futureTickets }}</el-text> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | defineOptions({ |
| | | name: "æ¥ç¥¨å°è´¦è¡¨å", |
| | | name: "æ¥ç¥¨å°è´¦è¡¨å", |
| | | }); |
| | | const temFutureTickets = ref(0) |
| | | const temFutureTickets = ref(0) // åå§æªæ¥ç¥¨æ° |
| | | const initialTicketsNum = ref(0) // åå§æ¥ç¥¨æ° |
| | | const initialTicketsAmount = ref(0) // åå§æ¥ç¥¨éé¢ |
| | | const quantity = ref(0) // æ»æ°é |
| | | const { form, resetForm } = useFormData({ |
| | | id: undefined, |
| | | purchaseContractNumber: undefined, // éè´ååå· |
| | | salesContractNo: undefined, // éå®ååå· |
| | | createdAt: undefined, // å建æ¶é´ |
| | | invoiceNumber: undefined, // åç¥¨å· |
| | | ticketsNum: undefined, // æ¥ç¥¨æ° |
| | | ticketsAmount: undefined, // æ¥ç¥¨éé¢ |
| | | id: undefined, |
| | | purchaseContractNumber: undefined, // éè´ååå· |
| | | salesContractNo: undefined, // éå®ååå· |
| | | createdAt: undefined, // å建æ¶é´ |
| | | invoiceNumber: undefined, // åç¥¨å· |
| | | ticketsNum: undefined, // æ¥ç¥¨æ° |
| | | ticketsAmount: undefined, // æ¥ç¥¨éé¢ |
| | | taxInclusiveUnitPrice: undefined, // å«ç¨åä»· |
| | | ticketRegistrationId: undefined, // å«ç¨åä»· |
| | | }); |
| | | |
| | | const load = async (id) => { |
| | | const { code, data } = await getProductRecordById({ id }); |
| | | if (code === 200) { |
| | | form.id = data.id; |
| | | form.purchaseContractNumber = data.purchaseContractNumber; |
| | | form.salesContractNo = data.salesContractNo; |
| | | form.createdAt = data.createdAt; |
| | | form.invoiceNumber = data.invoiceNumber; |
| | | form.ticketsNum = data.ticketsNum; |
| | | form.ticketsAmount = data.ticketsAmount.toFixed(2); |
| | | form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice; |
| | | form.futureTickets = data.futureTickets; |
| | | temFutureTickets.value = data.futureTickets; |
| | | } |
| | | const { code, data } = await getProductRecordById({ id }); |
| | | if (code === 200) { |
| | | form.id = data.id; |
| | | form.purchaseContractNumber = data.purchaseContractNumber; |
| | | form.salesContractNo = data.salesContractNo; |
| | | form.createdAt = data.createdAt; |
| | | form.invoiceNumber = data.invoiceNumber; |
| | | form.ticketsNum = data.ticketsNum; |
| | | form.ticketsAmount = data.ticketsAmount ? Number(data.ticketsAmount).toFixed(2) : 0; |
| | | form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice; |
| | | form.futureTickets = data.futureTickets; |
| | | temFutureTickets.value = data.futureTickets; |
| | | initialTicketsNum.value = data.ticketsNum || 0; |
| | | initialTicketsAmount.value = data.ticketsAmount || 0; |
| | | form.ticketRegistrationId = data.ticketRegistrationId; |
| | | // è·åæ»æ°éï¼å¦ææ°æ®ä¸æ quantity åæ®µå使ç¨ï¼å¦åä½¿ç¨æ¥ç¥¨æ°+æªæ¥ç¥¨æ° |
| | | quantity.value = data.quantity || (Number(data.ticketsNum || 0) + Number(data.futureTickets || 0)); |
| | | } |
| | | }; |
| | | |
| | | const inputTicketsNum = (val) => { |
| | |
| | | proxy.$modal.msgWarning("å«ç¨åä»·ä¸è½ä¸ºé¶ææªå®ä¹"); |
| | | return; |
| | | } |
| | | if (Number(form.ticketsNum) > Number(temFutureTickets.value)) { |
| | | proxy.$modal.msgWarning("å¼ç¥¨æ°ä¸å¾å¤§äºæªå¼ç¥¨æ°"); |
| | | form.ticketsNum = temFutureTickets.value |
| | | |
| | | const newTicketsNum = Number(form.ticketsNum) || 0; |
| | | const currentTicketsNum = Number(initialTicketsNum.value) || 0; |
| | | |
| | | // è®¡ç®æ°å¢çæ¥ç¥¨æ° |
| | | const addedTicketsNum = newTicketsNum - currentTicketsNum; |
| | | |
| | | // è®¡ç®æ°çæªæ¥ç¥¨æ° = åå§æªæ¥ç¥¨æ° - æ°å¢çæ¥ç¥¨æ° |
| | | const newFutureTickets = Number(temFutureTickets.value) - addedTicketsNum; |
| | | |
| | | // éªè¯ï¼æ°çæ¥ç¥¨æ° + æ°çæªæ¥ç¥¨æ° ⤠quantity |
| | | if (newTicketsNum + newFutureTickets > Number(quantity.value)) { |
| | | proxy.$modal.msgWarning(`æ¥ç¥¨æ°+æªæ¥ç¥¨æ°ä¸è½å¤§äºæ»æ°é(${quantity.value})`); |
| | | // éå¶æ¥ç¥¨æ°ï¼ä½¿å
¶æ»¡è¶³ï¼æ¥ç¥¨æ° + æªæ¥ç¥¨æ° ⤠quantity |
| | | // æå¤§æ¥ç¥¨æ° = quantity - åå§æªæ¥ç¥¨æ° + åå§æ¥ç¥¨æ° |
| | | const maxTicketsNum = Number(quantity.value) - Number(temFutureTickets.value) + Number(initialTicketsNum.value); |
| | | form.ticketsNum = Math.max(0, Math.min(maxTicketsNum, newTicketsNum)); |
| | | // éæ°è®¡ç® |
| | | const recalculatedAddedTicketsNum = Number(form.ticketsNum) - Number(initialTicketsNum.value); |
| | | const recalculatedFutureTickets = Number(temFutureTickets.value) - recalculatedAddedTicketsNum; |
| | | form.futureTickets = Number(recalculatedFutureTickets.toFixed(2)); |
| | | const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsAmount = Number(ticketsAmount.toFixed(2)); |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥æ°å¢çæ¥ç¥¨æ°æ¯å¦å¤§äºåå§æªæ¥ç¥¨æ° |
| | | if (addedTicketsNum > Number(temFutureTickets.value)) { |
| | | proxy.$modal.msgWarning("æ°å¢å¼ç¥¨æ°ä¸å¾å¤§äºæªå¼ç¥¨æ°"); |
| | | form.ticketsNum = Number(initialTicketsNum.value) + Number(temFutureTickets.value); |
| | | } |
| | | |
| | | // ç¡®ä¿æææ°å¼é½è½¬æ¢ä¸ºæ°åç±»åè¿è¡è®¡ç® |
| | | const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice); |
| | | const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum); |
| | | form.futureTickets = Number(futureTickets.toFixed(2)); |
| | | const finalTicketsNum = Number(form.ticketsNum) || 0; |
| | | const finalAddedTicketsNum = finalTicketsNum - Number(initialTicketsNum.value); |
| | | const finalFutureTickets = Number(temFutureTickets.value) - finalAddedTicketsNum; |
| | | const ticketsAmount = finalTicketsNum * Number(form.taxInclusiveUnitPrice); |
| | | form.futureTickets = Number(finalFutureTickets.toFixed(2)); |
| | | form.ticketsAmount = Number(ticketsAmount.toFixed(2)); |
| | | }; |
| | | const inputTicketsAmount = (val) => { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (Number(val) > Number(form.futureTickets*form.taxInclusiveUnitPrice)) { |
| | | proxy.$modal.msgWarning("æ¬æ¬¡æ¥ç¥¨éé¢ä¸å¾å¤§äºæ»éé¢"); |
| | | form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(2) |
| | | const ticketsNum = Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(2)) |
| | | const newTicketsAmount = Number(val) || 0; |
| | | |
| | | // è®¡ç®æ°çæ¥ç¥¨æ° |
| | | const newTicketsNum = newTicketsAmount / Number(form.taxInclusiveUnitPrice); |
| | | const currentTicketsNum = Number(initialTicketsNum.value) || 0; |
| | | |
| | | // è®¡ç®æ°å¢çæ¥ç¥¨æ° |
| | | const addedTicketsNum = newTicketsNum - currentTicketsNum; |
| | | |
| | | // è®¡ç®æ°çæªæ¥ç¥¨æ° = åå§æªæ¥ç¥¨æ° - æ°å¢çæ¥ç¥¨æ° |
| | | const newFutureTickets = Number(temFutureTickets.value) - addedTicketsNum; |
| | | |
| | | // éªè¯ï¼æ°çæ¥ç¥¨æ° + æ°çæªæ¥ç¥¨æ° ⤠quantity |
| | | if (newTicketsNum + newFutureTickets > Number(quantity.value)) { |
| | | proxy.$modal.msgWarning(`æ¥ç¥¨æ°+æªæ¥ç¥¨æ°ä¸è½å¤§äºæ»æ°é(${quantity.value})`); |
| | | // éå¶æ¥ç¥¨æ°ï¼ä½¿å
¶æ»¡è¶³ï¼æ¥ç¥¨æ° + æªæ¥ç¥¨æ° ⤠quantity |
| | | const maxTicketsNum = Number(quantity.value) - Number(temFutureTickets.value) + Number(initialTicketsNum.value); |
| | | form.ticketsNum = Math.max(0, Math.min(maxTicketsNum, newTicketsNum)); |
| | | form.ticketsAmount = Number((form.ticketsNum * Number(form.taxInclusiveUnitPrice)).toFixed(2)); |
| | | const recalculatedAddedTicketsNum = Number(form.ticketsNum) - Number(initialTicketsNum.value); |
| | | const recalculatedFutureTickets = Number(temFutureTickets.value) - recalculatedAddedTicketsNum; |
| | | form.futureTickets = Number(recalculatedFutureTickets.toFixed(2)); |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥æ°å¢çæ¥ç¥¨é颿¯å¦å¤§äºåå§æªæ¥ç¥¨æ°å¯¹åºçéé¢ |
| | | const maxAddedAmount = Number(temFutureTickets.value * form.taxInclusiveUnitPrice); |
| | | if (addedTicketsNum > 0 && addedTicketsNum * Number(form.taxInclusiveUnitPrice) > maxAddedAmount) { |
| | | proxy.$modal.msgWarning("æ°å¢æ¥ç¥¨éé¢ä¸å¾å¤§äºæªå¼ç¥¨éé¢"); |
| | | form.ticketsAmount = Number((initialTicketsAmount.value + maxAddedAmount).toFixed(2)); |
| | | form.ticketsNum = Number((currentTicketsNum + Number(temFutureTickets.value)).toFixed(2)); |
| | | form.futureTickets = 0; |
| | | return; |
| | | } |
| | | |
| | | // ç¡®ä¿æææ°å¼é½è½¬æ¢ä¸ºæ°åç±»åè¿è¡è®¡ç® |
| | | const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(2)); |
| | | const finalTicketsNum = Number(newTicketsNum.toFixed(2)); |
| | | const finalAddedTicketsNum = finalTicketsNum - Number(initialTicketsNum.value); |
| | | const finalFutureTickets = Number(temFutureTickets.value) - finalAddedTicketsNum; |
| | | form.ticketsNum = finalTicketsNum; |
| | | form.futureTickets = Number(finalFutureTickets.toFixed(2)); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | load, |
| | | form, |
| | | resetForm, |
| | | load, |
| | | form, |
| | | resetForm, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | :summary-method="summarizeMainTable" |
| | | @expand-change="expandChange" |
| | | height="calc(100vh - 18.5em)" |
| | | stripe |
| | | > |
| | | <el-table-column align="center" label="åºå·" type="index" width="55" /> |
| | | <el-table-column type="expand"> |
| | |
| | | border |
| | | show-summary |
| | | :summary-method="summarizeChildrenTable" |
| | | stripe |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | |
| | | unitFromRow.value = row?.unit ?? ''; |
| | | idFromRow.value = row?.id ?? ''; |
| | | specificationModelFromRow.value = row?.specificationModel ?? ''; |
| | | |
| | | |
| | | userListNoPageByTenantId().then((res) => { |
| | | userList.value = res.data; |
| | | // æ¾å°åå©çç¨æ·ID并设置为é»è®¤å¼ |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | <el-input v-model="form.quantity" placeholder="请è¾å
¥" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¾
æäº§æ°éï¼" prop="pendingQuantity"> |
| | | <el-input v-model="form.pendingQuantity" placeholder="请è¾å
¥" clearable disabled/> |
| | |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | import {productionDispatch} from "@/api/productionManagement/productionOrder.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | |
| | | schedulingDate: "", |
| | | pendingQuantity: "", |
| | | speculativeTradingName: "", // ç»å®æºå¨åç§° |
| | | salesLedgerProductId: "", |
| | | }, |
| | | rules: { |
| | | schedulingNum: [{ required: true, message: "请è¾å
¥", trigger: "blur" },], |
| | |
| | | userList.value = res.data; |
| | | }); |
| | | form.value = {...row} |
| | | // ç»å®å¤å±ä¼ å
¥ç产åIDå°å端éè¦ç salesLedgerProductId åæ®µ |
| | | form.value.salesLedgerProductId = row.id; |
| | | // ç¡®ä¿ä¸ä¼æåå§ id å½ä½æäº§è®°å½ä¸»é®ä¼ ç»å端 |
| | | delete form.value.id; |
| | | form.value.schedulingNum = 0 |
| | | form.value.schedulingUserId = userStore.id |
| | | form.value.schedulingDate = dayjs().format("YYYY-MM-DD"); |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | prop: "unit", |
| | | width: 120, |
| | | }, |
| | | |
| | | |
| | | { |
| | | label: "å建æ¶é´", |
| | | prop: "createTime", |
| | |
| | | :visible.sync="emergencyRecordsVisible" |
| | | width="800px" |
| | | > |
| | | <el-table :data="emergencyRecords" style="width: 100%"> |
| | | <el-table :data="emergencyRecords" style="width: 100%" stripe> |
| | | <el-table-column prop="time" label="æ¶é´" width="180"></el-table-column> |
| | | <el-table-column prop="location" label="ä½ç½®" width="150"></el-table-column> |
| | | <el-table-column prop="type" label="ç±»å" width="120"></el-table-column> |
| | |
| | | |
| | | <div class="sensor-data-section"> |
| | | <h4>ä¼ æå¨æ°æ®</h4> |
| | | <el-table :data="currentEvent.sensorData" style="width: 100%"> |
| | | <el-table :data="currentEvent.sensorData" style="width: 100%" stripe> |
| | | <el-table-column prop="sensor" label="ä¼ æå¨"></el-table-column> |
| | | <el-table-column prop="methane" label="ç²ç·æµåº¦"></el-table-column> |
| | | <el-table-column prop="h2s" label="ç¡«åæ°¢æµåº¦"></el-table-column> |
| | |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :row-key="(row) => row.id" show-summary :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)"> |
| | | :row-key="(row) => row.id" show-summary :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)" stripe> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="éå®ååå·" prop="salesContractNo" show-overflow-tooltip width="180" /> |
| | |
| | | // ä¸ä¼ åæ ¡æ£ |
| | | function handleBeforeUpload(file) { |
| | | // æ ¡æ£æä»¶å¤§å° |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | proxy.$modal.msgError("ä¸ä¼ æä»¶å¤§å°ä¸è½è¶
è¿10MB!"); |
| | | if (file.size > 1024 * 1024 * 50) { |
| | | proxy.$modal.msgError("ä¸ä¼ æä»¶å¤§å°ä¸è½è¶
è¿50MB!"); |
| | | return false; |
| | | } |
| | | // 夿æä»¶æ ¼å¼æ¯å¦ç¬¦å |
| | |
| | | { |
| | | label: "忬¾æ¹å¼", |
| | | prop: "receiptPaymentType", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "çµæ±"; |
| | | } else if (params == 1) { |
| | | return "æ¿å
"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | return "info"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "ç»è®°äºº", |
| | |
| | | :summary-method="summarizeMainTable" |
| | | @row-click="rowClickMethod" |
| | | height="calc(100vh - 18.5em)" |
| | | stripe |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | |
| | | :data="receiptRecord" |
| | | border |
| | | :row-key="(row) => row.id" |
| | | stripe |
| | | show-summary |
| | | :summary-method="summarizeMainTable1" |
| | | height="calc(100vh - 18.5em)" |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="éä»¶" width="40%" :before-close="handleClose"> |
| | | <el-table :data="tableData" border height="40vh"> |
| | | <el-table :data="tableData" border height="40vh" stripe> |
| | | <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"> |
| | |
| | | </div> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="(row) => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 18.5em)"> |
| | | :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 18.5em)" stripe> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable" stripe> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | |
| | | <el-table-column label="仿¬¾æ¹å¼" prop="paymentMethod" show-overflow-tooltip /> |
| | | <el-table-column label="ååéé¢(å
)" prop="contractAmount" width="220" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å·²å¼ç¥¨éé¢(å
)" prop="invoiceTotal" width="220" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="æªå¼ç¥¨éé¢(å
)" prop="noInvoiceAmountTotal" width="220" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="忬¾éé¢(å
)" prop="receiptPaymentAmountTotal" width="220" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å¾
忬¾éé¢(å
)" prop="noReceiptAmount" width="220" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å½å
¥äºº" prop="entryPersonName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å½å
¥æ¥æ" prop="entryDate" width="120" show-overflow-tooltip /> |
| | | <el-table-column label="ç¾è®¢æ¥æ" prop="executionDate" width="120" show-overflow-tooltip /> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å¡åï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | <el-input |
| | | v-model="form.salesman" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :disabled="operationType === 'view'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-button v-if="operationType !== 'view'" plain type="danger" @click="deleteProduct" >å é¤</el-button> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary stripe |
| | | :summary-method="summarizeMainTable"> |
| | | <el-table-column align="center" type="selection" width="55" v-if="operationType !== 'view'" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | |
| | | "contractAmount", |
| | | "taxInclusiveTotalPrice", |
| | | "taxExclusiveTotalPrice", |
| | | 'invoiceTotal', |
| | | 'noInvoiceAmountTotal', |
| | | 'receiptPaymentAmountTotal', |
| | | 'noReceiptAmount', |
| | | ]); |
| | | }; |
| | | // å表åè®¡æ¹æ³ |
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="忰䏻é®" align="center" prop="configId" />
|
| | | <el-table-column label="åæ°åç§°" align="center" prop="configName" :show-overflow-tooltip="true" />
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åå
¸ç¼ç " align="center" prop="dictCode" />
|
| | | <el-table-column label="åå
¸æ ç¾" align="center" prop="dictLabel">
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åå
¸ç¼å·" align="center" prop="dictId" />
|
| | | <el-table-column label="åå
¸åç§°" align="center" prop="dictName" :show-overflow-tooltip="true"/>
|
| | |
| | | v-if="refreshTable"
|
| | | v-loading="loading"
|
| | | :data="menuList"
|
| | | stripe
|
| | | row-key="menuId"
|
| | | :default-expand-all="isExpandAll"
|
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åºå·" align="center" prop="noticeId" width="100" />
|
| | | <el-table-column
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="å²ä½ç¼å·" align="center" prop="postId" />
|
| | | <el-table-column label="å²ä½ç¼ç " align="center" prop="postCode" />
|
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="ç¨æ·åç§°" prop="userName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¨æ·æµç§°" prop="nickName" :show-overflow-tooltip="true" />
|
| | |
| | | </el-row>
|
| | |
|
| | | <!-- è¡¨æ ¼æ°æ® -->
|
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange" stripe>
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="è§è²ç¼å·" prop="roleId" width="120" />
|
| | | <el-table-column label="è§è²åç§°" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
| | |
| | | </el-form-item>
|
| | | </el-form>
|
| | | <el-row>
|
| | | <el-table @row-click="clickRow" ref="refTable" :data="userList" @selection-change="handleSelectionChange" height="260px">
|
| | | <el-table @row-click="clickRow" ref="refTable" :data="userList" @selection-change="handleSelectionChange" height="260px" stripe>
|
| | | <el-table-column type="selection" width="55"></el-table-column>
|
| | | <el-table-column label="ç¨æ·åç§°" prop="userName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¨æ·æµç§°" prop="nickName" :show-overflow-tooltip="true" />
|
| | |
| | | </el-form>
|
| | |
|
| | | <h4 class="form-header h4">è§è²ä¿¡æ¯</h4>
|
| | | <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="roleRef" @selection-change="handleSelectionChange" :data="roles.slice((pageNum - 1) * pageSize, pageNum * pageSize)">
|
| | | <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="roleRef" @selection-change="handleSelectionChange" :data="roles.slice((pageNum - 1) * pageSize, pageNum * pageSize)" stripe>
|
| | | <el-table-column label="åºå·" width="55" type="index" align="center">
|
| | | <template #default="scope">
|
| | | <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
|
| | |
| | | <template> |
| | | <div></div> |
| | | </template> |
| | | <script setup> |
| | | <script> |
| | | import useUserStore from '@/store/modules/user' |
| | | const userStore = useUserStore() |
| | | let { proxy } = getCurrentInstance() |
| | | function goLogin() { |
| | | userStore.TideLogin({code : proxy.$route.query.code}).then(() => { |
| | | proxy.$router.push({ path: redirect || "/" }).catch(() => { }); |
| | | }) |
| | | export default { |
| | | data() { |
| | | return {} |
| | | }, |
| | | created() { |
| | | this.goLogin() |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | goLogin() { |
| | | useUserStore().TideLogin({code : this.$route.query.code}).then(() => { |
| | | this.$router.push({ path: this.redirect || "/" }).catch(() => { }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | goLogin() |
| | | </script> |
| | | <style scoped></style> |
| | |
| | | <basic-info-form ref="basicInfo" :info="info" />
|
| | | </el-tab-pane>
|
| | | <el-tab-pane label="åæ®µä¿¡æ¯" name="columnInfo">
|
| | | <el-table ref="dragTable" :data="columns" row-key="columnId" :max-height="tableHeight">
|
| | | <el-table ref="dragTable" :data="columns" row-key="columnId" :max-height="tableHeight" stripe>
|
| | | <el-table-column label="åºå·" type="index" min-width="5%"/>
|
| | | <el-table-column
|
| | | label="åæ®µåå"
|
| | |
| | | </el-form-item>
|
| | | </el-form>
|
| | | <el-row>
|
| | | <el-table @row-click="clickRow" ref="table" :data="dbTableList" @selection-change="handleSelectionChange" height="260px">
|
| | | <el-table @row-click="clickRow" ref="table" :data="dbTableList" @selection-change="handleSelectionChange" height="260px" stripe>
|
| | | <el-table-column type="selection" width="55"></el-table-column>
|
| | | <el-table-column prop="tableName" label="表åç§°" :show-overflow-tooltip="true"></el-table-column>
|
| | | <el-table-column prop="tableComment" label="表æè¿°" :show-overflow-tooltip="true"></el-table-column>
|
| | |
| | | ref="genRef"
|
| | | v-loading="loading"
|
| | | :data="tableList"
|
| | | stripe
|
| | | @selection-change="handleSelectionChange"
|
| | | :default-sort="defaultSort"
|
| | | @sort-change="handleSortChange"
|
| | |
| | | const env = loadEnv(mode, process.cwd()); |
| | | const { VITE_APP_ENV } = env; |
| | | const baseUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9003" |
| | | : env.VITE_BASE_API; |
| | | const javaUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9002" |
| | | : env.VITE_JAVA_API; |
| | | VITE_APP_ENV == "development" |
| | | ? "http://114.132.189.42:8089" // å¼åç¯å¢å端æ¥å£ |
| | | : "http://114.132.189.42:7003"; // ç产ç¯å¢å端æ¥å£ |
| | | |
| | | return { |
| | | define:{ |
| | | __BASE_API__: JSON.stringify(javaUrl) |
| | | }, |
| | | // é¨ç½²ç产ç¯å¢åå¼åç¯å¢ä¸çURLã |
| | | // é»è®¤æ
åµä¸ï¼vite ä¼åè®¾ä½ çåºç¨æ¯è¢«é¨ç½²å¨ä¸ä¸ªååçæ ¹è·¯å¾ä¸ |
| | | // ä¾å¦ https://www.ruoyi.vip/ã妿åºç¨è¢«é¨ç½²å¨ä¸ä¸ªåè·¯å¾ä¸ï¼ä½ å°±éè¦ç¨è¿ä¸ªé项æå®è¿ä¸ªåè·¯å¾ãä¾å¦ï¼å¦æä½ çåºç¨è¢«é¨ç½²å¨ https://www.ruoyi.vip/admin/ï¼å设置 baseUrl 为 /admin/ã |