From 5df6d6cd93ed5655065652a008189d1630fbfeab Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 29 十月 2026 16:34:34 +0800
Subject: [PATCH] change
---
.gitignore | 1
src/api/procurementManagement/procurementLedger.js | 32
src/views/collaborativeApproval/approvalProcess/index.vue | 1338 ++++----
src/views/salesManagement/salesLedger/index.vue | 265
src/api/customerPortal/submission.js | 17
src/views/collaborativeApproval/approvalManagement/index.vue | 1521 +++++-----
src/components/ProjectManagement/ProgressReportDialog.vue | 302 +
src/views/basicData/customerFile/index.vue | 1072 +-----
sql/数据库升级说明.md | 10
src/views/salesManagement/reportAudit/index.vue | 323 ++
src/views/projectManagement/Management/components/formDia.vue | 342 -
sql/20261029_customer_report_audit.sql | 17
vite.config.js | 4
.build-check-rollback/favicon.ico | 0
sql/20261028_customer_project_upgrade.sql | 125
src/permission.js | 2
sql/20261029_disable_unused_menus.sql | 92
src/views/customerPortal/mySubmission/index.vue | 58
src/views/customerPortal/myReport/index.vue | 166 +
src/views/customerPortal/submissionManagement/index.vue | 57
src/router/index.js | 50
sql/20261029_customer_financial_report.sql | 48
sql/20261029_customer_button_role_extra.sql | 5
src/views/procurementManagement/procurementLedger/index.vue | 2393 ++-------------
sql/20261029_project_classification.sql | 3
src/api/basicData/customerFinancialReport.js | 53
src/api/salesManagement/salesLedger.js | 17
src/views/projectManagement/Management/projectDetail.vue | 345 -
src/components/FileUpload/index.vue | 75
src/views/projectManagement/Management/index.vue | 2
sql/20261029_purchase_ledger_simple.sql | 19
31 files changed, 3,894 insertions(+), 4,860 deletions(-)
diff --git a/.build-check-rollback/favicon.ico b/.build-check-rollback/favicon.ico
new file mode 100644
index 0000000..ce783dc
--- /dev/null
+++ b/.build-check-rollback/favicon.ico
Binary files differ
diff --git a/.gitignore b/.gitignore
index f979342..4be611f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
.DS_Store
node_modules/
dist/
+.local-backups/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
diff --git a/sql/20261028_customer_project_upgrade.sql b/sql/20261028_customer_project_upgrade.sql
new file mode 100644
index 0000000..3193486
--- /dev/null
+++ b/sql/20261028_customer_project_upgrade.sql
@@ -0,0 +1,125 @@
+-- 瀹㈡埛鐢虫姤涓庨」鐩笟鍔″崌绾ц剼鏈�
+-- 閫傜敤搴擄細product-inventory-management-xmgl
+-- 鎵ц鍓嶅繀椤诲厛鍋氬叏搴撳浠斤紱鏈剼鏈笉鍒犻櫎鐜版湁琛ㄥ拰鏁版嵁銆�
+-- 寤鸿鍦ㄦ祴璇曞簱楠岃瘉鍚庡啀鎵ц鐢熶骇搴撱��
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+CREATE TABLE IF NOT EXISTS `customer_submission` (
+ `id` bigint NOT NULL AUTO_INCREMENT COMMENT '涓婚敭',
+ `customer_id` bigint NOT NULL COMMENT '瀹㈡埛ID',
+ `report_year` int NOT NULL COMMENT '鎶ュ憡骞村害',
+ `report_name` varchar(255) DEFAULT NULL COMMENT '鏉愭枡鍚嶇О',
+ `material_files` text COMMENT '瀹㈡埛鏉愭枡闄勪欢锛岄�楀彿鍒嗛殧',
+ `status` tinyint NOT NULL DEFAULT 0 COMMENT '0寰呭鏍� 1澶勭悊涓� 2宸插彂甯� 3宸查��鍥�',
+ `result_text` varchar(2000) DEFAULT NULL COMMENT '鍙戝竷缁撴灉璇存槑',
+ `result_files` text COMMENT '缁撴灉闄勪欢锛岄�楀彿鍒嗛殧',
+ `review_remark` varchar(1000) DEFAULT NULL COMMENT '瀹℃牳鎰忚',
+ `submit_user_id` bigint DEFAULT NULL COMMENT '鎻愪氦浜篒D',
+ `submit_user_name` varchar(100) DEFAULT NULL COMMENT '鎻愪氦浜哄悕绉�',
+ `publish_user_id` bigint DEFAULT NULL COMMENT '鍙戝竷浜篒D',
+ `publish_user_name` varchar(100) DEFAULT NULL COMMENT '鍙戝竷浜哄悕绉�',
+ `publish_time` datetime DEFAULT NULL COMMENT '鍙戝竷鏃堕棿',
+ `tenant_id` bigint DEFAULT NULL COMMENT '绉熸埛ID',
+ `dept_id` bigint DEFAULT NULL COMMENT '閮ㄩ棬ID',
+ `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
+ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '鍒涘缓鏃堕棿',
+ `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '鏇存柊鏃堕棿',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_customer_report_year` (`customer_id`,`report_year`,`is_deleted`),
+ KEY `idx_submission_status` (`status`),
+ KEY `idx_submission_user` (`submit_user_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='瀹㈡埛骞村害鐢虫姤鏉愭枡涓庣粨鏋�';
+
+DROP PROCEDURE IF EXISTS `add_column_if_missing`;
+DELIMITER $$
+CREATE PROCEDURE `add_column_if_missing`(
+ IN p_table varchar(64), IN p_column varchar(64), IN p_definition varchar(1000)
+)
+BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = p_table AND COLUMN_NAME = p_column
+ ) THEN
+ SET @ddl = CONCAT('ALTER TABLE `', p_table, '` ADD COLUMN `', p_column, '` ', p_definition);
+ PREPARE stmt FROM @ddl;
+ EXECUTE stmt;
+ DEALLOCATE PREPARE stmt;
+ END IF;
+END$$
+DELIMITER ;
+
+CALL add_column_if_missing('sales_ledger', 'business_approval_status', "tinyint NOT NULL DEFAULT 0 COMMENT '0鑽夌 1寰呭鎵� 2宸查�氳繃 3宸查��鍥�'");
+CALL add_column_if_missing('sales_ledger', 'business_approval_remark', "varchar(1000) DEFAULT NULL COMMENT '瀹℃壒鎰忚'");
+CALL add_column_if_missing('sales_ledger', 'business_approved_by', "bigint DEFAULT NULL COMMENT '瀹℃壒浜篒D'");
+CALL add_column_if_missing('sales_ledger', 'business_approved_name', "varchar(100) DEFAULT NULL COMMENT '瀹℃壒浜哄悕绉�'");
+CALL add_column_if_missing('sales_ledger', 'business_approved_time', "datetime DEFAULT NULL COMMENT '瀹℃壒鏃堕棿'");
+CALL add_column_if_missing('sales_ledger', 'business_submitted_time', "datetime DEFAULT NULL COMMENT '鎻愪氦瀹℃壒鏃堕棿'");
+CALL add_column_if_missing('sales_ledger', 'project_management_info_id', "bigint DEFAULT NULL COMMENT '瀹℃壒閫氳繃鍚庣敓鎴愮殑椤圭洰ID'");
+DROP PROCEDURE IF EXISTS `add_column_if_missing`;
+
+-- 鍥哄畾鍏樁娈垫ā鏉匡紱閲嶅鎵ц涓嶄細閲嶅鍒涘缓銆�
+INSERT INTO `project_management_plan` (`name`, `description`, `is_delete`, `create_time`, `update_time`, `create_user_name`)
+SELECT '椤圭洰鐢虫姤鍏樁娈�', '涓氬姟瀹℃壒閫氳繃鍚庤嚜鍔ㄧ敓鎴愶細绔嬮」銆佸洟闃熷垎宸ャ�佽祫鏂欐眹鎶ャ�佺敵鎶ャ�佺敵鎶ョ粨鏋溿�侀獙鏀�', 0, NOW(), NOW(), '鍗囩骇鑴氭湰'
+WHERE NOT EXISTS (
+ SELECT 1 FROM `project_management_plan` WHERE `name` = '椤圭洰鐢虫姤鍏樁娈�' AND `is_delete` = 0
+);
+SET @plan_id = (SELECT `id` FROM `project_management_plan` WHERE `name` = '椤圭洰鐢虫姤鍏樁娈�' AND `is_delete` = 0 ORDER BY `id` LIMIT 1);
+
+INSERT INTO `project_management_plan_node`
+(`project_management_plan_id`, `sort`, `name`, `estimated_duration`, `work_content`, `is_delete`, `create_time`, `update_time`, `create_user_name`)
+SELECT @plan_id, 1, '绔嬮」', 1, '寤虹珛椤圭洰骞剁‘璁よ礋璐d汉銆佽鍒掑懆鏈熷拰鍩虹璧勬枡', 0, NOW(), NOW(), '鍗囩骇鑴氭湰'
+WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='绔嬮」' AND `is_delete`=0);
+INSERT INTO `project_management_plan_node` (`project_management_plan_id`,`sort`,`name`,`estimated_duration`,`work_content`,`is_delete`,`create_time`,`update_time`,`create_user_name`)
+SELECT @plan_id,2,'鍥㈤槦鍒嗗伐',1,'纭畾椤圭洰鎴愬憳涓庡伐浣滃垎宸�',0,NOW(),NOW(),'鍗囩骇鑴氭湰' WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='鍥㈤槦鍒嗗伐' AND `is_delete`=0);
+INSERT INTO `project_management_plan_node` (`project_management_plan_id`,`sort`,`name`,`estimated_duration`,`work_content`,`is_delete`,`create_time`,`update_time`,`create_user_name`)
+SELECT @plan_id,3,'璧勬枡姹囨姤',1,'鏀堕泦銆佽ˉ鍏呭苟姹囨�荤敵鎶ヨ祫鏂�',0,NOW(),NOW(),'鍗囩骇鑴氭湰' WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='璧勬枡姹囨姤' AND `is_delete`=0);
+INSERT INTO `project_management_plan_node` (`project_management_plan_id`,`sort`,`name`,`estimated_duration`,`work_content`,`is_delete`,`create_time`,`update_time`,`create_user_name`)
+SELECT @plan_id,4,'鐢虫姤',1,'瀹屾垚姝e紡鐢虫姤骞剁櫥璁扮敵鎶ヤ俊鎭�',0,NOW(),NOW(),'鍗囩骇鑴氭湰' WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='鐢虫姤' AND `is_delete`=0);
+INSERT INTO `project_management_plan_node` (`project_management_plan_id`,`sort`,`name`,`estimated_duration`,`work_content`,`is_delete`,`create_time`,`update_time`,`create_user_name`)
+SELECT @plan_id,5,'鐢虫姤缁撴灉',1,'鐧昏鐢虫姤缁撴灉骞跺舰鎴愬鎴峰彂甯冩潗鏂�',0,NOW(),NOW(),'鍗囩骇鑴氭湰' WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='鐢虫姤缁撴灉' AND `is_delete`=0);
+INSERT INTO `project_management_plan_node` (`project_management_plan_id`,`sort`,`name`,`estimated_duration`,`work_content`,`is_delete`,`create_time`,`update_time`,`create_user_name`)
+SELECT @plan_id,6,'楠屾敹',1,'瀹屾垚浜や粯銆侀獙鏀跺拰椤圭洰褰掓。',0,NOW(),NOW(),'鍗囩骇鑴氭湰' WHERE NOT EXISTS (SELECT 1 FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `name`='楠屾敹' AND `is_delete`=0);
+
+-- 瀹㈡埛闂ㄦ埛鑿滃崟銆�
+INSERT INTO `sys_menu` (`menu_name`,`parent_id`,`order_num`,`path`,`component`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+SELECT '瀹㈡埛鏈嶅姟',0,7,'customerPortal',NULL,'CustomerPortal',1,0,'M','0','0','customer:portal','#','admin',NOW(),'瀹㈡埛鏉愭枡涓庣粨鏋滈棬鎴�'
+WHERE NOT EXISTS (SELECT 1 FROM `sys_menu` WHERE `path`='customerPortal' AND `parent_id`=0);
+SET @portal_menu_id = (SELECT `menu_id` FROM `sys_menu` WHERE `path`='customerPortal' AND `parent_id`=0 ORDER BY `menu_id` LIMIT 1);
+
+INSERT INTO `sys_menu` (`menu_name`,`parent_id`,`order_num`,`path`,`component`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+SELECT '鎴戠殑鐢虫姤',@portal_menu_id,1,'mySubmission','customerPortal/mySubmission/index','MySubmission',1,0,'C','0','0','customer:submission:mine','upload','admin',NOW(),'瀹㈡埛涓婁紶杩戜笁骞存潗鏂欏苟鏌ョ湅缁撴灉'
+WHERE NOT EXISTS (SELECT 1 FROM `sys_menu` WHERE `parent_id`=@portal_menu_id AND `path`='mySubmission');
+INSERT INTO `sys_menu` (`menu_name`,`parent_id`,`order_num`,`path`,`component`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+SELECT '鐢虫姤绠$悊',@portal_menu_id,2,'submissionManagement','customerPortal/submissionManagement/index','SubmissionManagement',1,0,'C','0','0','customer:submission:manage','list','admin',NOW(),'鍐呴儴浜哄憳瀹℃牳骞跺彂甯冨鎴风敵鎶ョ粨鏋�'
+WHERE NOT EXISTS (SELECT 1 FROM `sys_menu` WHERE `parent_id`=@portal_menu_id AND `path`='submissionManagement');
+SET @my_submission_menu_id = (SELECT `menu_id` FROM `sys_menu` WHERE `parent_id`=@portal_menu_id AND `path`='mySubmission' ORDER BY `menu_id` LIMIT 1);
+
+-- 閿�鍞彴璐︿腑鐨勪笟鍔″鎵规寜閽潈闄愩�傚凡鏈夐攢鍞彴璐︽潈闄愮殑瑙掕壊鑷姩鑾峰緱鈥滄彁浜も�濓紝
+-- 鈥滃鎵光�濅笉鑷姩鎺堜簣锛岀敱绠$悊鍛樺湪鐜版湁瑙掕壊绠$悊涓垎閰嶇粰绠$悊浜哄憳銆�
+SET @sales_ledger_menu_id = (SELECT `menu_id` FROM `sys_menu` WHERE `component`='salesManagement/salesLedger/index' ORDER BY `menu_id` LIMIT 1);
+INSERT INTO `sys_menu` (`menu_name`,`parent_id`,`order_num`,`path`,`component`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+SELECT '鎻愪氦涓氬姟瀹℃壒',@sales_ledger_menu_id,20,'#',NULL,'',1,0,'F','0','0','business:approval:submit','#','admin',NOW(),'鎻愪氦涓氬姟杩涘叆绠$悊瀹℃壒'
+WHERE @sales_ledger_menu_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `sys_menu` WHERE `perms`='business:approval:submit');
+INSERT INTO `sys_menu` (`menu_name`,`parent_id`,`order_num`,`path`,`component`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+SELECT '瀹℃牳涓氬姟',@sales_ledger_menu_id,21,'#',NULL,'',1,0,'F','0','0','business:approval:review','#','admin',NOW(),'瀹℃壒閫氳繃鍚庤嚜鍔ㄧ敓鎴愰」鐩�'
+WHERE @sales_ledger_menu_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `sys_menu` WHERE `perms`='business:approval:review');
+SET @business_submit_menu_id = (SELECT `menu_id` FROM `sys_menu` WHERE `perms`='business:approval:submit' ORDER BY `menu_id` LIMIT 1);
+INSERT IGNORE INTO `sys_role_menu` (`role_id`,`menu_id`)
+SELECT `role_id`, @business_submit_menu_id FROM `sys_role_menu`
+WHERE `menu_id`=@sales_ledger_menu_id AND @business_submit_menu_id IS NOT NULL;
+
+-- 瀹㈡埛瑙掕壊鍙巿浜堝鎴烽棬鎴峰拰鈥滄垜鐨勭敵鎶モ�濓紝璐﹀彿浠嶇敱绠$悊鍛樺湪鐜版湁鐢ㄦ埛绠$悊涓垱寤恒��
+INSERT INTO `sys_role` (`role_name`,`role_key`,`role_sort`,`data_scope`,`menu_check_strictly`,`dept_check_strictly`,`status`,`del_flag`,`create_by`,`create_time`,`remark`)
+SELECT '瀹㈡埛','customer',90,'5',1,1,'0','0','admin',NOW(),'澶栭儴瀹㈡埛璐﹀彿锛涗笉寮�鏀捐嚜琛屾敞鍐�'
+WHERE NOT EXISTS (SELECT 1 FROM `sys_role` WHERE `role_key`='customer' AND `del_flag`='0');
+SET @customer_role_id = (SELECT `role_id` FROM `sys_role` WHERE `role_key`='customer' AND `del_flag`='0' ORDER BY `role_id` LIMIT 1);
+INSERT IGNORE INTO `sys_role_menu` (`role_id`,`menu_id`) VALUES (@customer_role_id,@portal_menu_id),(@customer_role_id,@my_submission_menu_id);
+
+SET FOREIGN_KEY_CHECKS = 1;
+
+-- 鎵ц鍚庢鏌�
+SELECT 'customer_submission' AS item, COUNT(*) AS count_value FROM `customer_submission`
+UNION ALL SELECT 'six_stage_nodes', COUNT(*) FROM `project_management_plan_node` WHERE `project_management_plan_id`=@plan_id AND `is_delete`=0
+UNION ALL SELECT 'customer_portal_menus', COUNT(*) FROM `sys_menu` WHERE `menu_id`=@portal_menu_id OR `parent_id`=@portal_menu_id;
diff --git a/sql/20261029_customer_button_role_extra.sql b/sql/20261029_customer_button_role_extra.sql
new file mode 100644
index 0000000..4185245
--- /dev/null
+++ b/sql/20261029_customer_button_role_extra.sql
@@ -0,0 +1,5 @@
+-- 瀹㈡埛妗f鎸夐挳鏉冮檺琛ュ厖锛氬叕娴峰鎴烽〉闈㈠悓鏍蜂娇鐢ㄥ鎴锋柊澧�/淇敼/鍒犻櫎鎺ュ彛
+INSERT IGNORE INTO `sys_role_menu` (`role_id`,`menu_id`)
+SELECT rm.role_id, m.menu_id FROM `sys_role_menu` rm
+JOIN `sys_menu` m ON m.menu_id BETWEEN 2362 AND 2368
+WHERE rm.menu_id = 2290;
diff --git a/sql/20261029_customer_financial_report.sql b/sql/20261029_customer_financial_report.sql
new file mode 100644
index 0000000..d05754d
--- /dev/null
+++ b/sql/20261029_customer_financial_report.sql
@@ -0,0 +1,48 @@
+-- 瀹㈡埛杩�3骞磋储鍔℃姤琛� + 瀹㈡埛妗f鎸夐挳鏉冮檺
+-- 鎵ц搴擄細product-inventory-management-xmgl
+
+CREATE TABLE IF NOT EXISTS `customer_financial_report` (
+ `id` bigint NOT NULL AUTO_INCREMENT COMMENT '涓婚敭',
+ `customer_id` bigint NOT NULL COMMENT '瀹㈡埛id',
+ `report_year` int NOT NULL COMMENT '鎶ヨ〃骞村害',
+ `report_name` varchar(255) DEFAULT NULL COMMENT '鎶ヨ〃鍚嶇О',
+ `report_files` text COMMENT '鎶ヨ〃闄勪欢(JSON鏁扮粍)',
+ `upload_user_id` bigint DEFAULT NULL COMMENT '涓婁紶浜篿d',
+ `upload_user_name` varchar(100) DEFAULT NULL COMMENT '涓婁紶浜�',
+ `tenant_id` bigint DEFAULT NULL COMMENT '绉熸埛id',
+ `dept_id` bigint DEFAULT NULL COMMENT '閮ㄩ棬id',
+ `create_time` datetime DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+ `update_time` datetime DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_customer_year` (`customer_id`, `report_year`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='瀹㈡埛杩�3骞磋储鍔℃姤琛�';
+
+-- 瀹㈡埛妗f鑿滃崟鎸備笂鏌ヨ鏉冮檺
+UPDATE `sys_menu` SET `perms` = 'basic:customer:list' WHERE `menu_id` = 2001;
+
+-- 鎸夐挳鏉冮檺锛團 绫诲瀷锛�
+INSERT IGNORE INTO `sys_menu` (`menu_id`,`menu_name`,`parent_id`,`order_num`,`path`,`component`,`query`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+VALUES
+ (2362,'瀹㈡埛鏂板',2001,2,'',NULL,'','',1,0,'F','0','0','basic:customer:add','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2363,'瀹㈡埛淇敼',2001,3,'',NULL,'','',1,0,'F','0','0','basic:customer:edit','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2364,'瀹㈡埛鍒犻櫎',2001,4,'',NULL,'','',1,0,'F','0','0','basic:customer:remove','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2365,'瀹㈡埛瀵煎叆',2001,5,'',NULL,'','',1,0,'F','0','0','basic:customer:import','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2366,'瀹㈡埛瀵煎嚭',2001,6,'',NULL,'','',1,0,'F','0','0','basic:customer:export','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2367,'瀹㈡埛璇︽儏',2001,7,'',NULL,'','',1,0,'F','0','0','basic:customer:query','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺'),
+ (2368,'杩�3骞磋储鍔℃姤琛ㄤ笂浼�',2001,8,'',NULL,'','',1,0,'F','0','0','basic:customer:report','#','admin',NOW(),'瀹㈡埛妗f鎸夐挳鏉冮檺');
+
+-- 宸叉湁瀹㈡埛妗f鑿滃崟鐨勮鑹茶嚜鍔ㄨ幏寰楁寜閽潈闄�
+INSERT IGNORE INTO `sys_role_menu` (`role_id`,`menu_id`)
+SELECT rm.role_id, m.menu_id FROM `sys_role_menu` rm
+JOIN `sys_menu` m ON m.menu_id BETWEEN 2362 AND 2368
+WHERE rm.menu_id = 2001;
+
+-- 瀹㈡埛闂ㄦ埛锛氭垜鐨勭敵鎶� -> 璐㈠姟鎶ヨ〃涓婁紶锛堜粎瀹㈡埛瑙掕壊鍙锛�
+UPDATE `sys_menu` SET `menu_name` = '璐㈠姟鎶ヨ〃涓婁紶', `path` = 'myReport', `route_name` = 'MyReport',
+ `component` = 'customerPortal/myReport/index', `perms` = 'customer:report:mine', `order_num` = 2
+WHERE `menu_id` = 2358;
+
+-- 宸茬粦瀹氱殑瀹㈡埛璐﹀彿琛ユ巿鈥滃鎴封�濊鑹诧紙role_key=customer锛�
+INSERT IGNORE INTO `sys_user_role` (`user_id`,`role_id`)
+SELECT DISTINCT cu.user_id, r.role_id FROM `customer_user` cu
+JOIN `sys_role` r ON r.role_key = 'customer' AND r.del_flag = '0';
diff --git a/sql/20261029_customer_report_audit.sql b/sql/20261029_customer_report_audit.sql
new file mode 100644
index 0000000..26c2c5d
--- /dev/null
+++ b/sql/20261029_customer_report_audit.sql
@@ -0,0 +1,17 @@
+-- 瀹㈡埛杩�3骞磋储鍔℃姤琛細瀹℃壒鐘舵�� + 钀ラ攢绠$悊涓嬬殑鈥滅敵鎶ュ鎵光�濊彍鍗�
+-- 鎵ц搴擄細product-inventory-management-xmgl
+
+ALTER TABLE `customer_financial_report`
+ ADD COLUMN `audit_status` tinyint NOT NULL DEFAULT 0 COMMENT '瀹℃壒鐘舵�侊細0寰呭鎵� 1宸查�氳繃 2宸查��鍥�' AFTER `report_files`,
+ ADD COLUMN `audit_user_id` bigint DEFAULT NULL COMMENT '瀹℃壒浜篿d' AFTER `audit_status`,
+ ADD COLUMN `audit_user_name` varchar(100) DEFAULT NULL COMMENT '瀹℃壒浜�' AFTER `audit_user_id`,
+ ADD COLUMN `audit_time` datetime DEFAULT NULL COMMENT '瀹℃壒鏃堕棿' AFTER `audit_user_name`,
+ ADD COLUMN `audit_remark` varchar(500) DEFAULT NULL COMMENT '瀹℃壒鎰忚/閫�鍥炲師鍥�' AFTER `audit_time`;
+
+-- 钀ラ攢绠$悊锛坢enu_id=2010锛変笅鏂板鈥滅敵鎶ュ鎵光�濊彍鍗�
+INSERT IGNORE INTO `sys_menu` (`menu_id`,`menu_name`,`parent_id`,`order_num`,`path`,`component`,`query`,`route_name`,`is_frame`,`is_cache`,`menu_type`,`visible`,`status`,`perms`,`icon`,`create_by`,`create_time`,`remark`)
+VALUES (2369,'鐢虫姤瀹℃壒',2010,7,'reportAudit','salesManagement/reportAudit/index','','ReportAudit',1,0,'C','0','0','sales:report:audit','form','admin',NOW(),'瀹㈡埛璐㈠姟鎶ヨ〃鐢虫姤瀹℃壒');
+
+-- 鎷ユ湁钀ラ攢绠$悊鑿滃崟鐨勮鑹茶嚜鍔ㄨ幏寰楃敵鎶ュ鎵硅彍鍗�
+INSERT IGNORE INTO `sys_role_menu` (`role_id`,`menu_id`)
+SELECT rm.role_id, 2369 FROM `sys_role_menu` rm WHERE rm.menu_id = 2010;
diff --git a/sql/20261029_disable_unused_menus.sql b/sql/20261029_disable_unused_menus.sql
new file mode 100644
index 0000000..0eb7a7b
--- /dev/null
+++ b/sql/20261029_disable_unused_menus.sql
@@ -0,0 +1,92 @@
+-- 绮剧畝椤圭洰鑿滃崟锛氫粎鍋滅敤/闅愯棌锛屼笉鍒犻櫎鑿滃崟鍜屾潈闄愭暟鎹��
+-- 淇濈暀锛氱郴缁熺鐞嗐�佸鎴锋湇鍔°�佽惀閿�涓氬姟銆侀噰璐彴璐︺�侀」鐩鐞嗐�佽鍋�/瀹℃壒銆�
+SET NAMES utf8mb4;
+
+START TRANSACTION;
+
+-- 鍋滅敤褰撳墠椤圭洰涓嶄娇鐢ㄧ殑涓�绾т笟鍔$洰褰曘��
+UPDATE sys_menu
+SET visible = '1', status = '1', update_time = NOW(), update_by = 'admin'
+WHERE menu_id IN (
+ 2000, -- 鍩虹鏁版嵁
+ 2291, -- 宸ヨ壓璁捐
+ 2029, -- 浠撳偍
+ 2033, -- 浜哄姏璧勬簮锛堜汉鍛樸�侀儴闂ㄦ敼鐢ㄧ郴缁熺鐞嗭級
+ 2058, -- 鐢熶骇绠℃帶
+ 2071, -- 璐㈠姟绠$悊
+ 2101, -- 妗f绠$悊
+ 2040, -- 璐ㄩ噺绠$悊
+ 2042, -- 璁惧绠$悊
+ 2064, -- 鑳借�楃鐞�
+ 2036, -- 绠$悊椹鹃┒鑸�
+ 2190, -- 鍔充繚绠$悊
+ 2067, -- 鍞悗鏈嶅姟
+ 2250 -- 瀹夊叏鐢熶骇
+);
+
+-- 钀ラ攢绠$悊鍙繚鐣欏鎴锋。妗�(绉佹捣)銆侀攢鍞彴璐﹀強鍏舵寜閽潈闄愩��
+UPDATE sys_menu
+SET visible = '1', status = '1', update_time = NOW(), update_by = 'admin'
+WHERE parent_id = 2010
+ AND menu_id NOT IN (2001, 2011)
+ AND menu_type <> 'F';
+
+-- 閲囪喘绠$悊淇濈暀渚涘簲鍟嗘。妗堛�侀噰璐彴璐︺��
+UPDATE sys_menu
+SET visible = '1', status = '1', update_time = NOW(), update_by = 'admin'
+WHERE parent_id = 2015
+ AND menu_id NOT IN (2012, 2016)
+ AND menu_type <> 'F';
+
+-- 鍗忓悓鍔炲叕淇濈暀瀹℃壒绠$悊銆佸崗鍚屽鎵广�佽�冨嫟绠$悊銆�
+UPDATE sys_menu
+SET visible = '1', status = '1', update_time = NOW(), update_by = 'admin'
+WHERE parent_id = 2053
+ AND menu_id NOT IN (2327, 2326, 2306)
+ AND menu_type <> 'F';
+
+-- 鑰冨嫟绠$悊鍙繚鐣欒鍋囩敵璇凤紱鍑哄樊绛夊鎵圭粺涓�浠庡崗鍚屽鎵硅繘鍏ャ��
+UPDATE sys_menu
+SET visible = '1', status = '1', update_time = NOW(), update_by = 'admin'
+WHERE parent_id = 2306
+ AND menu_id <> 2320
+ AND menu_type <> 'F';
+
+-- 鏄庣‘鍚敤闇�瑕佷繚鐣欑殑涓�绾ц彍鍗曞拰鏍稿績涓氬姟鑿滃崟銆�
+UPDATE sys_menu
+SET visible = '0', status = '0', update_time = NOW(), update_by = 'admin'
+WHERE menu_id IN (
+ 1, -- 绯荤粺绠$悊
+ 2053, -- 鍗忓悓鍔炲叕
+ 2010, -- 钀ラ攢绠$悊
+ 2015, -- 閲囪喘绠$悊
+ 2276, -- 椤圭洰绠$悊
+ 2357, -- 瀹㈡埛鏈嶅姟
+ 100,101,102,103,104,105,108,2287,
+ 2327,2326,2306,2320,
+ 2001,2011,
+ 2012,2016,
+ 2277,2283,2285,
+ 2358,2359
+);
+
+-- 灏嗘墍鏈夊凡鍋滅敤/闅愯棌鑿滃崟鐨勪笅绾ц矾鐢卞拰鎸夐挳鏉冮檺鍚屾鍋滅敤銆�
+-- 鑿滃崟鏍戝綋鍓嶅眰绾ф湁闄愶紝閫愬眰鍚屾 8 娆¤冻浠ヨ鐩栧叏閮ㄥ悗浠h妭鐐广��
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+UPDATE sys_menu child JOIN sys_menu parent ON child.parent_id = parent.menu_id SET child.visible = '1', child.status = '1', child.update_time = NOW(), child.update_by = 'admin' WHERE parent.status = '1' OR parent.visible = '1';
+
+COMMIT;
+
+-- 妫�鏌ユ渶缁堟樉绀虹殑鑿滃崟璺敱銆�
+SELECT menu_id, menu_name, parent_id, path, component, menu_type
+FROM sys_menu
+WHERE visible = '0' AND status = '0' AND menu_type IN ('M','C')
+ORDER BY parent_id, order_num, menu_id;
+
+-- 濡傞渶鎭㈠锛屽彲浠庤彍鍗曟竻鐞嗗墠鐨勫叏搴撳浠芥仮澶嶏紱鏈剼鏈病鏈夊垹闄や换浣曡褰曘��
diff --git a/sql/20261029_project_classification.sql b/sql/20261029_project_classification.sql
new file mode 100644
index 0000000..6f80faf
--- /dev/null
+++ b/sql/20261029_project_classification.sql
@@ -0,0 +1,3 @@
+-- 椤圭洰绠$悊锛氭柊澧炩�滈」鐩垎绫烩�濆瓧娈碉紙鍏堝啓姝诲嚑涓�夐」锛屽悗缁彲鍒囨崲涓哄瓧鍏革級
+ALTER TABLE project_management_info
+ ADD COLUMN project_classification varchar(50) DEFAULT NULL COMMENT '椤圭洰鍒嗙被' AFTER source;
diff --git a/sql/20261029_purchase_ledger_simple.sql b/sql/20261029_purchase_ledger_simple.sql
new file mode 100644
index 0000000..835039a
--- /dev/null
+++ b/sql/20261029_purchase_ledger_simple.sql
@@ -0,0 +1,19 @@
+-- 閲囪喘鍙拌处锛堢畝锛夎〃锛氫粎淇濈暀鍩虹瀛楁锛屼笉涓庡悎鍚�/渚涘簲鍟�/浜у搧/鍏ュ簱绛夋ā鍧楀叧鑱�
+CREATE TABLE IF NOT EXISTS purchase_ledger_simple (
+ id BIGINT NOT NULL AUTO_INCREMENT COMMENT '涓婚敭ID',
+ payment_date DATE DEFAULT NULL COMMENT '鏀嚭鏃ユ湡',
+ purchase_date DATE DEFAULT NULL COMMENT '閲囪喘鏃ユ湡',
+ amount DECIMAL(18, 2) DEFAULT NULL COMMENT '閲戦',
+ purchase_goods VARCHAR(255) DEFAULT NULL COMMENT '閲囪喘鐗╁搧',
+ invoice_number VARCHAR(100) DEFAULT NULL COMMENT '鍙戠エ鍙风爜',
+ payment_method VARCHAR(50) DEFAULT NULL COMMENT '浠樻鏂瑰紡',
+ remark VARCHAR(500) DEFAULT NULL COMMENT '澶囨敞',
+ recorder_id BIGINT DEFAULT NULL COMMENT '褰曞叆浜篿d',
+ recorder_name VARCHAR(64) DEFAULT NULL COMMENT '褰曞叆浜�',
+ entry_date DATE DEFAULT NULL COMMENT '褰曞叆鏃ユ湡',
+ create_user BIGINT DEFAULT NULL COMMENT '鍒涘缓鐢ㄦ埛',
+ dept_id BIGINT DEFAULT NULL COMMENT '閮ㄩ棬id',
+ create_time DATETIME DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
+ update_time DATETIME DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
+ PRIMARY KEY (id)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '閲囪喘鍙拌处锛堢畝锛�';
diff --git "a/sql/\346\225\260\346\215\256\345\272\223\345\215\207\347\272\247\350\257\264\346\230\216.md" "b/sql/\346\225\260\346\215\256\345\272\223\345\215\207\347\272\247\350\257\264\346\230\216.md"
new file mode 100644
index 0000000..7698f6e
--- /dev/null
+++ "b/sql/\346\225\260\346\215\256\345\272\223\345\215\207\347\272\247\350\257\264\346\230\216.md"
@@ -0,0 +1,10 @@
+# 鏁版嵁搴撳崌绾ц鏄�
+
+1. 宸插湪寮�鍙戝墠瀹屾垚鏁版嵁搴撳叏閲忓浠斤細`D:\newcode\product-inventory-management\.local-backups\product-inventory-management-xmgl-20261028-131516.sql`锛堢害 83.5 MB锛夈��
+2. 姝e紡鎵ц鍓嶏紝寤鸿鍐嶇敓鎴愪竴浠藉綋鏃剁偣澶囦唤锛屽苟纭澶囦唤鏂囦欢澶у皬涓嶆槸 0銆�
+3. 浣跨敤鏁版嵁搴撶鐞嗗伐鍏烽�夋嫨 `product-inventory-management-xmgl`锛屾墽琛� `20261028_customer_project_upgrade.sql`銆�
+4. 鑴氭湰鍙柊澧炰笟鍔¤〃銆侀攢鍞彴璐﹀瓧娈点�佸叚闃舵妯℃澘銆佸鎴疯鑹插強鑿滃崟锛屼笉鍒犻櫎鍘熸暟鎹紱鍚屼竴鏁版嵁搴撳彲閲嶅鎵ц銆�
+5. 鎵ц瀹屾垚鍚庯紝鏈熬妫�鏌ョ粨鏋滃簲涓猴細鍏樁娈佃妭鐐规暟閲� `6`锛屽鎴锋湇鍔¤彍鍗曟暟閲� `3`銆�
+6. 绠$悊鍛樺湪鐜版湁鈥滅敤鎴风鐞嗏�濆垱寤哄鎴疯处鍙凤紝璧嬩簣鈥滃鎴封�濊鑹诧紱鍐嶅湪鐜版湁鈥滃鎴锋。妗堚�濅腑鎶婅鐢ㄦ埛缁戝畾鍒板搴斿鎴枫�傚唴閮ㄥ憳宸ヨ彍鍗曟潈闄愪粛鍦ㄧ幇鏈夎鑹茬鐞嗕腑閰嶇疆銆�
+
+鍥炴粴鏂瑰紡锛氬仠姝㈠簲鐢紝鍒涘缓涓�涓┖搴撳悗瀵煎叆涓婅堪鍏ㄩ噺澶囦唤锛岀‘璁ゆ棤璇啀鍒囨崲杩炴帴銆備笉瑕佸湪鏈夋柊涓氬姟鏁版嵁浜х敓鍚庣洿鎺ヨ鐩栫敓浜у簱銆�
diff --git a/src/api/basicData/customerFinancialReport.js b/src/api/basicData/customerFinancialReport.js
new file mode 100644
index 0000000..c21fe90
--- /dev/null
+++ b/src/api/basicData/customerFinancialReport.js
@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 鍚庡彴锛氭寜瀹㈡埛鏌ヨ杩�3骞磋储鍔℃姤琛�
+export function listCustomerFinancialReport(params) {
+ return request({
+ url: '/basic/customerFinancialReport/list',
+ method: 'get',
+ params
+ })
+}
+
+// 瀹㈡埛璐﹀彿锛氭煡璇㈣嚜宸辩殑杩�3骞磋储鍔℃姤琛�
+export function listMyFinancialReport() {
+ return request({
+ url: '/basic/customerFinancialReport/mine',
+ method: 'get'
+ })
+}
+
+// 涓婁紶/淇敼璐㈠姟鎶ヨ〃
+export function saveCustomerFinancialReport(data) {
+ return request({
+ url: '/basic/customerFinancialReport/save',
+ method: 'post',
+ data
+ })
+}
+
+// 鍒犻櫎璐㈠姟鎶ヨ〃锛堜粎鍚庡彴浜哄憳锛�
+export function delCustomerFinancialReport(id) {
+ return request({
+ url: '/basic/customerFinancialReport/' + id,
+ method: 'delete'
+ })
+}
+
+// 鐢虫姤瀹℃壒锛氭煡璇㈡墍鏈夊鎴锋彁浜ゆ儏鍐�
+export function auditListCustomerFinancialReport(params) {
+ return request({
+ url: '/basic/customerFinancialReport/auditList',
+ method: 'get',
+ params
+ })
+}
+
+// 鐢虫姤瀹℃壒锛氶�氳繃/閫�鍥�
+export function auditCustomerFinancialReport(data) {
+ return request({
+ url: '/basic/customerFinancialReport/audit',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/customerPortal/submission.js b/src/api/customerPortal/submission.js
new file mode 100644
index 0000000..553735a
--- /dev/null
+++ b/src/api/customerPortal/submission.js
@@ -0,0 +1,17 @@
+import request from "@/utils/request";
+
+export function listMySubmissions(params) {
+ return request({ url: "/customer/submission/mine", method: "get", params });
+}
+
+export function submitCustomerMaterial(data) {
+ return request({ url: "/customer/submission", method: "post", data });
+}
+
+export function listSubmissionManage(params) {
+ return request({ url: "/customer/submission/manage/list", method: "get", params });
+}
+
+export function reviewSubmission(data) {
+ return request({ url: "/customer/submission/review", method: "put", data });
+}
diff --git a/src/api/procurementManagement/procurementLedger.js b/src/api/procurementManagement/procurementLedger.js
index c389582..b55a942 100644
--- a/src/api/procurementManagement/procurementLedger.js
+++ b/src/api/procurementManagement/procurementLedger.js
@@ -140,3 +140,35 @@
data: query,
});
}
+
+// ===== 閲囪喘鍙拌处锛堢畝锛夛細鐙珛绠�鍗曞彴璐︼紝涓嶄笌鍚堝悓/渚涘簲鍟�/浜у搧/鍏ュ簱鍏宠仈 =====
+export function simpleLedgerList(params) {
+ return request({
+ url: "/purchase/simpleLedger/list",
+ method: "get",
+ params,
+ });
+}
+
+export function simpleLedgerGet(id) {
+ return request({
+ url: `/purchase/simpleLedger/${id}`,
+ method: "get",
+ });
+}
+
+export function simpleLedgerSave(data) {
+ return request({
+ url: "/purchase/simpleLedger/save",
+ method: "post",
+ data,
+ });
+}
+
+export function simpleLedgerDelete(ids) {
+ return request({
+ url: "/purchase/simpleLedger/delete",
+ method: "delete",
+ data: ids,
+ });
+}
diff --git a/src/api/salesManagement/salesLedger.js b/src/api/salesManagement/salesLedger.js
index b9ef283..45da3f3 100644
--- a/src/api/salesManagement/salesLedger.js
+++ b/src/api/salesManagement/salesLedger.js
@@ -101,6 +101,23 @@
});
}
+// 涓氬姟鎻愪氦绠$悊瀹℃壒
+export function submitBusinessApproval(id) {
+ return request({
+ url: `/business/approval/submit/${id}`,
+ method: "post",
+ });
+}
+
+// 绠$悊浜哄憳瀹℃牳涓氬姟锛涢�氳繃鍚庡悗绔嚜鍔ㄧ敓鎴愬叚闃舵椤圭洰
+export function reviewBusinessApproval(data) {
+ return request({
+ url: "/business/approval/review",
+ method: "put",
+ data,
+ });
+}
+
// 鏍规嵁閿�鍞悎鍚屽彿鏌ヤ骇鍝佷俊鎭�
export function getProductInfoByContractNo(query) {
return request({
diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index 57e62b7..242b485 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="upload-file">
- <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :data="data"
+ <el-upload multiple :action="uploadFileUrl" name="files" :before-upload="handleBeforeUpload" :file-list="fileList" :data="data"
:limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess"
:show-file-list="false" :headers="headers" class="upload-file-uploader" ref="fileUpload" v-if="!disabled">
<!-- 涓婁紶鎸夐挳 -->
@@ -18,9 +18,9 @@
鐨勬枃浠�
</div>
<!-- 鏂囦欢鍒楄〃 -->
- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
+ <transition-group ref="uploadListRef" class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
- <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+ <el-link :href="getFileUrl(file.url)" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
@@ -81,7 +81,8 @@
const { proxy } = getCurrentInstance();
const emit = defineEmits();
const number = ref(0);
-const uploadList = ref([]);
+const uploadList = ref([]);
+const uploadListRef = ref();
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + props.action); // 涓婁紶鏂囦欢鏈嶅姟鍣ㄥ湴鍧�
const headers = ref({ Authorization: "Bearer " + getToken() });
@@ -95,8 +96,20 @@
(val) => {
if (val) {
let temp = 1;
- // 棣栧厛灏嗗�艰浆涓烘暟缁�
- const list = Array.isArray(val) ? val : props.modelValue.split(",");
+ let list = [];
+ if (Array.isArray(val)) {
+ list = val;
+ } else if (typeof val === "string" && val.trim().startsWith("[")) {
+ // 鍚庣杩斿洖/鍓嶇淇濆瓨鐨� JSON 鏁扮粍鏍煎紡锛歔{ id, name, url }]
+ try {
+ const parsed = JSON.parse(val);
+ list = Array.isArray(parsed) ? parsed : [];
+ } catch (e) {
+ list = val.split(",");
+ }
+ } else {
+ list = String(val).split(",");
+ }
// 鐒跺悗灏嗘暟缁勮浆涓哄璞℃暟缁�
fileList.value = list.map((item) => {
if (typeof item === "string") {
@@ -158,13 +171,21 @@
// 涓婁紶鎴愬姛鍥炶皟
function handleUploadSuccess(res, file) {
- if (res.code === 200) {
- uploadList.value.push({ name: res.fileName, url: res.fileName });
+ // 鍚庣 /common/upload 杩斿洖 { code, msg, data: [ { id, name, url, downloadURL ... } ] }
+ const list = Array.isArray(res?.data) ? res.data : [];
+ if (res?.code === 200 && list.length > 0) {
+ list.forEach((item) => {
+ uploadList.value.push({
+ id: item.id ?? item.storageAttachmentId,
+ name: item.name || item.originalFilename || item.fileName || file.name,
+ url: item.url || item.downloadURL || item.previewURL || item.previewUrl || "",
+ });
+ });
uploadedSuccessfully();
} else {
number.value--;
proxy.$modal.closeLoading();
- proxy.$modal.msgError(res.msg);
+ proxy.$modal.msgError(res?.msg || "涓婁紶鏂囦欢澶辫触");
proxy.$refs.fileUpload.handleRemove(file);
uploadedSuccessfully();
}
@@ -190,33 +211,35 @@
}
// 鑾峰彇鏂囦欢鍚嶇О
-function getFileName(name) {
+function getFileName(name) {
// 濡傛灉鏄痷rl閭d箞鍙栨渶鍚庣殑鍚嶅瓧 濡傛灉涓嶆槸鐩存帴杩斿洖
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1);
} else {
return name;
}
-}
+}
+
+function getFileUrl(url) {
+ if (!url) return "";
+ return /^https?:\/\//i.test(url) ? url : `${baseUrl}${url}`;
+}
-// 瀵硅薄杞垚鎸囧畾瀛楃涓插垎闅�
-function listToString(list, separator) {
- let strs = "";
- separator = separator || ",";
- for (let i in list) {
- if (list[i].url) {
- strs += list[i].url + separator;
- }
- }
- return strs != "" ? strs.substr(0, strs.length - 1) : "";
+// 瀵硅薄杞垚 JSON 鏁扮粍瀛楃涓诧紝淇濆瓨鏂囦欢 id銆佸悕绉颁笌鍦板潃
+function listToString(list) {
+ const files = (list || [])
+ .filter((item) => item && item.url)
+ .map((item) => ({ id: item.id, name: item.name, url: item.url }));
+ return files.length > 0 ? JSON.stringify(files) : "";
}
// 鍒濆鍖栨嫋鎷芥帓搴�
-onMounted(() => {
- if (props.drag) {
- nextTick(() => {
- const element = document.querySelector(".upload-file-list");
- Sortable.create(element, {
+onMounted(() => {
+ if (props.drag && !props.disabled) {
+ nextTick(() => {
+ const element = uploadListRef.value?.$el || uploadListRef.value;
+ if (!element) return;
+ Sortable.create(element, {
ghostClass: "file-upload-darg",
onEnd: (evt) => {
const movedItem = fileList.value.splice(evt.oldIndex, 1)[0];
diff --git a/src/components/ProjectManagement/ProgressReportDialog.vue b/src/components/ProjectManagement/ProgressReportDialog.vue
index dc6afe7..a112c85 100644
--- a/src/components/ProjectManagement/ProgressReportDialog.vue
+++ b/src/components/ProjectManagement/ProgressReportDialog.vue
@@ -1,10 +1,11 @@
<template>
- <el-dialog v-model="visible" title="杩涘害姹囨姤" width="900px" top="8vh" append-to-body destroy-on-close @close="handleClose">
+ <el-dialog v-model="visible" title="杩涘害姹囨姤" width="960px" top="6vh" append-to-body destroy-on-close @close="handleClose">
<el-form ref="formRef" :model="form" :rules="rules" label-position="top" label-width="120px">
<el-form-item label="椤圭洰闃舵" prop="planNodeId">
- <el-select v-model="form.planNodeId" placeholder="璇烽�夋嫨" clearable style="width: 100%">
+ <el-select v-model="form.planNodeId" placeholder="璇烽�夋嫨" style="width: 100%" @change="handleStageChange">
<el-option v-for="opt in stageOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
+ <div v-if="stageTip" class="stage-tip">{{ stageTip }}</div>
</el-form-item>
<el-row :gutter="20">
<el-col :span="8">
@@ -63,8 +64,8 @@
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="涓婃杩涘害(%)" prop="lastProgress">
- <el-input-number v-model="form.lastProgress" :min="0" :max="100" controls-position="right" style="width: 100%" />
+ <el-form-item label="涓婃杩涘害(%)">
+ <el-input-number v-model="form.lastProgress" :min="0" :max="100" controls-position="right" style="width: 100%" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
@@ -115,6 +116,70 @@
</el-col>
</el-row>
+ <div v-if="isTeamStage" class="team-block">
+ <div class="team-header">
+ <span class="team-title">椤圭洰鍥㈤槦</span>
+ <el-button type="primary" size="small" @click="addTeamRow">鏂板鎴愬憳</el-button>
+ </div>
+ <el-table :data="teamRows" border size="small">
+ <el-table-column label="濮撳悕" width="150">
+ <template #default="{ row }">
+ <el-select v-model="row.userId" placeholder="璇烽�夋嫨" filterable clearable style="width: 100%">
+ <el-option v-for="u in userOptions" :key="u.value" :label="u.label" :value="u.value" />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="椤圭洰缁勮鑹�" width="150">
+ <template #default="{ row }">
+ <el-select v-model="row.userRoleId" placeholder="璇烽�夋嫨" filterable clearable style="width: 100%">
+ <el-option v-for="r in roleOptions" :key="r.value" :label="r.label" :value="r.value" />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="杩涘叆鏃ユ湡" width="150">
+ <template #default="{ row }">
+ <el-date-picker
+ v-model="row.joinTime"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ clearable
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="绂诲紑鏃ユ湡" width="150">
+ <template #default="{ row }">
+ <el-date-picker
+ v-model="row.departTime"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ clearable
+ />
+ </template>
+ </el-table-column>
+ <el-table-column label="鑱旂郴鏂瑰紡" min-width="150">
+ <template #default="{ row }">
+ <el-input v-model="row.contact" placeholder="璇疯緭鍏�" clearable />
+ </template>
+ </el-table-column>
+ <el-table-column label="澶囨敞" min-width="140">
+ <template #default="{ row }">
+ <el-input v-model="row.remark" placeholder="璇疯緭鍏�" clearable />
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="70" align="center">
+ <template #default="{ $index }">
+ <el-button link type="danger" size="small" @click="removeTeamRow($index)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
<el-form-item label="闄勪欢" prop="attachmentIds">
<FileUpload v-model:file-list="form.storageBlobDTOs" />
</el-form-item>
@@ -130,16 +195,18 @@
</template>
<script setup name="ProgressReportDialog">
-import { computed, reactive, ref, watch } from 'vue'
-import { ElMessage } from 'element-plus'
-import { getToken } from '@/utils/auth'
-import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+import { computed, ref, watch } from 'vue'
+import { ElMessageBox } from 'element-plus'
+import FileUpload from '@/components/AttachmentUpload/file/index.vue'
+import { findRoleListPage } from '@/api/projectManagement/role'
+import { userListAll } from '@/api/publicApi'
const props = defineProps({
modelValue: { type: Boolean, default: false },
projectId: { type: [Number, String], default: undefined },
projectInfo: { type: Object, default: () => ({}) },
planNodes: { type: Array, default: () => [] },
+ stageRecords: { type: Array, default: () => [] },
defaultPlanNodeId: { type: [Number, String], default: undefined }
})
@@ -151,6 +218,9 @@
})
const formRef = ref()
+const userOptions = ref([])
+const roleOptions = ref([])
+const teamRows = ref([])
const form = ref({
planNodeId: undefined,
@@ -176,40 +246,176 @@
completionProgress: [{ required: true, message: '璇疯緭鍏�', trigger: 'change' }]
}
-const stageOptions = computed(() => {
+const sortedNodes = computed(() => {
const list = Array.isArray(props.planNodes) ? props.planNodes : []
- const sorted = [...list].sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
- return sorted
+ return [...list].sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
+})
+
+const stageOptions = computed(() =>
+ sortedNodes.value
.map(n => ({
label: n.name || n.workContent || n.title || String(n.id ?? ''),
value: n.id
}))
.filter(i => i.value !== undefined && i.value !== null && i.value !== '')
+)
+
+const stageNameOf = nodeId => {
+ const node = sortedNodes.value.find(n => String(n.id) === String(nodeId))
+ return node?.name || node?.workContent || ''
+}
+
+// 鍚勯樁娈垫渶杩戜竴鏉℃眹鎶ヨ褰曪紙璁板綍鎸夐樁娈点�佹椂闂村崌搴忚繑鍥烇級
+const latestProgressMap = computed(() => {
+ const map = {}
+ const records = Array.isArray(props.stageRecords) ? props.stageRecords : []
+ records.forEach(r => {
+ const key = String(r.projectManagementPlanNodeId ?? '')
+ map[key] = Number(r.progress) || 0
+ })
+ return map
})
+
+// 褰撳墠搴旀眹鎶ョ殑涓嬩竴闃舵锛氱涓�涓湭瀹屾垚锛堣繘搴� < 100锛夌殑闃舵
+const expectedNodeId = computed(() => {
+ const nodes = sortedNodes.value
+ if (nodes.length === 0) return undefined
+ const next = nodes.find(n => (latestProgressMap.value[String(n.id)] ?? 0) < 100)
+ return (next || nodes[nodes.length - 1])?.id
+})
+
+const isTeamStage = computed(() => stageNameOf(form.value.planNodeId).includes('鍥㈤槦'))
+
+const stageTip = computed(() => {
+ if (!form.value.planNodeId) return ''
+ const progress = latestProgressMap.value[String(form.value.planNodeId)] ?? 0
+ if (progress >= 100) return '璇ラ樁娈靛凡瀹屾垚锛屼粛鍙户缁ˉ鍏呮眹鎶�'
+ if (expectedNodeId.value && String(form.value.planNodeId) !== String(expectedNodeId.value)) {
+ return '褰撳墠閫夋嫨鐨勪笉鏄簲姹囨姤鐨勪笅涓�闃舵'
+ }
+ return ''
+})
+
+function todayStr() {
+ const d = new Date()
+ const pad = n => String(n).padStart(2, '0')
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
+}
+
+function latestRecordOf(nodeId) {
+ const records = Array.isArray(props.stageRecords) ? props.stageRecords : []
+ const matched = records.filter(r => String(r.projectManagementPlanNodeId) === String(nodeId))
+ return matched.length ? matched[matched.length - 1] : null
+}
+
+function applyStageBase(nodeId) {
+ const record = latestRecordOf(nodeId)
+ form.value.lastProgress = Number(record?.progress ?? 0) || 0
+ form.value.completionProgress = 0
+ form.value.totalProgress = Number(record?.progress ?? 0) || 0
+ form.value.planStartTime = record?.planStartTime || props.projectInfo?.planStartTime || ''
+ form.value.planEndTime = record?.planEndTime || props.projectInfo?.planEndTime || ''
+ form.value.actualStartTime = record?.actualStartTime || props.projectInfo?.actualStartTime || ''
+ form.value.actualEndTime = record?.actualEndTime || ''
+}
+
+async function handleStageChange(val) {
+ applyStageBase(val)
+ if (!val) return
+ const expected = expectedNodeId.value
+ if (expected && String(val) !== String(expected)) {
+ try {
+ await ElMessageBox.confirm(
+ `褰撳墠搴旀眹鎶ョ殑鈥�${stageNameOf(expected)}鈥濋樁娈佃繕鏈畬鎴愶紝閫夋嫨鍏朵粬闃舵灏嗚烦杩囦腑闂撮樁娈碉紝鏄惁缁х画锛焋,
+ '鎻愮ず',
+ { confirmButtonText: '缁х画', cancelButtonText: '杩斿洖', type: 'warning' }
+ )
+ } catch {
+ form.value.planNodeId = expected
+ applyStageBase(expected)
+ }
+ }
+}
function resetFromProject() {
const info = props.projectInfo || {}
form.value = {
- planNodeId: props.defaultPlanNodeId ?? stageOptions.value[0]?.value,
- planStartTime: info.planStartTime || '',
- planEndTime: info.planEndTime || '',
- actualStartTime: info.actualStartTime || '',
- actualEndTime: info.actualEndTime || '',
- reportDate: '',
- lastProgress: Number(info.lastProgress ?? 0) || 0,
+ planNodeId: props.defaultPlanNodeId ?? expectedNodeId.value ?? stageOptions.value[0]?.value,
+ planStartTime: '',
+ planEndTime: '',
+ actualStartTime: '',
+ actualEndTime: '',
+ reportDate: todayStr(),
+ lastProgress: 0,
completionProgress: 0,
- totalProgress: Number(info.totalProgress ?? info.progress ?? 0) || 0,
+ totalProgress: 0,
managerName: info.managerName || '',
departmentName: info.departmentName || '',
remark: '',
storageBlobDTOs: []
+ }
+ applyStageBase(form.value.planNodeId)
+ form.value.reportDate = todayStr()
+ loadTeamRows()
+}
+
+function loadTeamRows() {
+ const list = Array.isArray(props.projectInfo?.teamList) ? props.projectInfo.teamList : []
+ teamRows.value = list.map(t => ({
+ userId: t.userId,
+ userRoleId: t.userRoleId,
+ joinTime: t.joinTime || '',
+ departTime: t.departTime || '',
+ contact: t.contact || '',
+ remark: t.remark || ''
+ }))
+ if (teamRows.value.length === 0) addTeamRow()
+}
+
+function addTeamRow() {
+ teamRows.value.push({ userId: undefined, userRoleId: undefined, joinTime: '', departTime: '', contact: '', remark: '' })
+}
+
+function removeTeamRow(index) {
+ teamRows.value.splice(index, 1)
+ if (teamRows.value.length === 0) addTeamRow()
+}
+
+async function loadOptions() {
+ try {
+ const res = await userListAll()
+ const list = res?.data || res?.rows || res || []
+ userOptions.value = (Array.isArray(list) ? list : []).map(u => ({
+ label: u.nickName || u.userName || u.username || u.name,
+ value: u.userId || u.id
+ }))
+ } catch {
+ userOptions.value = []
+ }
+ try {
+ const res = await findRoleListPage({ pageNum: 1, pageSize: 999 })
+ const records = res?.data?.records || res?.rows || res?.records || []
+ roleOptions.value = records.map(item => ({ label: item.roleName || item.name, value: item.id }))
+ } catch {
+ roleOptions.value = []
}
}
watch(
() => props.modelValue,
v => {
- if (v) resetFromProject()
+ if (v) {
+ loadOptions()
+ resetFromProject()
+ }
+ }
+)
+
+// 绱杩涘害璺熼殢鏈瀹屾垚杩涘害
+watch(
+ () => form.value.completionProgress,
+ v => {
+ form.value.totalProgress = Number(v) || 0
}
)
@@ -220,15 +426,39 @@
function markDone() {
form.value.completionProgress = 100
form.value.totalProgress = 100
- if (!form.value.actualEndTime) form.value.actualEndTime = form.value.reportDate || ''
+ if (!form.value.actualEndTime) form.value.actualEndTime = form.value.reportDate || todayStr()
+}
+
+function buildTeamList() {
+ const findLabel = (list, value) => (list || []).find(i => String(i.value) === String(value))?.label || ''
+ return teamRows.value
+ .filter(r => r.userId !== undefined && r.userId !== null && r.userId !== '')
+ .map(r => ({
+ userId: Number(r.userId),
+ userName: findLabel(userOptions.value, r.userId),
+ userRoleId: r.userRoleId ?? '',
+ userRoleName: findLabel(roleOptions.value, r.userRoleId),
+ joinTime: r.joinTime || null,
+ departTime: r.departTime || null,
+ contact: r.contact || '',
+ remark: r.remark || ''
+ }))
}
async function submit() {
- await formRef.value?.validate?.()
- emit('submitted', {
+ try {
+ await formRef.value?.validate?.()
+ } catch {
+ return
+ }
+ const payload = {
projectId: props.projectId,
...form.value
- })
+ }
+ if (isTeamStage.value) {
+ payload.teamList = buildTeamList()
+ }
+ emit('submitted', payload)
visible.value = false
}
</script>
@@ -239,4 +469,28 @@
justify-content: flex-end;
gap: 10px;
}
+
+.stage-tip {
+ margin-top: 6px;
+ font-size: 12px;
+ color: #e6a23c;
+ line-height: 1.4;
+}
+
+.team-block {
+ margin-bottom: 18px;
+}
+
+.team-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 8px;
+}
+
+.team-title {
+ font-weight: 600;
+ color: #303133;
+ font-size: 14px;
+}
</style>
diff --git a/src/permission.js b/src/permission.js
index 9bf4a91..45d345f 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -11,7 +11,7 @@
NProgress.configure({ showSpinner: false })
-const whiteList = ['/login', '/register', '/callbacklccpn','/device-info']
+const whiteList = ['/login', '/register', '/callbacklccpn','/device-info']
const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
diff --git a/src/router/index.js b/src/router/index.js
index 000a0c5..8bf9a70 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -72,31 +72,31 @@
],
},
// 绯荤粺鏋舵瀯鍥�
- {
- path: "/system-architecture",
- component: Layout,
- redirect: "/system-architecture/index",
- children: [
- {
- path: "index",
- component: () => import("@/views/systemArchitecture/index.vue"),
- name: "SystemArchitecture",
- meta: { title: "绯荤粺鏋舵瀯鍥�", icon: "tree" },
- },
- ],
- },
- {
- path: "/ai-industrial-brain",
- component: Layout,
- children: [
- {
- path: "index",
- component: () => import("@/views/aiIndustrialBrain/index.vue"),
- name: "AiIndustrialBrain",
- meta: { title: "AI宸ヤ笟澶ц剳", icon: "skill" },
- },
- ],
- },
+ // {
+ // path: "/system-architecture",
+ // component: Layout,
+ // redirect: "/system-architecture/index",
+ // children: [
+ // {
+ // path: "index",
+ // component: () => import("@/views/systemArchitecture/index.vue"),
+ // name: "SystemArchitecture",
+ // meta: { title: "绯荤粺鏋舵瀯鍥�", icon: "tree" },
+ // },
+ // ],
+ // },
+ // {
+ // path: "/ai-industrial-brain",
+ // component: Layout,
+ // children: [
+ // {
+ // path: "index",
+ // component: () => import("@/views/aiIndustrialBrain/index.vue"),
+ // name: "AiIndustrialBrain",
+ // meta: { title: "AI宸ヤ笟澶ц剳", icon: "skill" },
+ // },
+ // ],
+ // },
// 鏁欏婕旂ず妯″潡
{
path: "/productionManagement/teachingDemo",
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 84153b1..1c4e6e8 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -26,17 +26,18 @@
</div>
<div>
<el-button type="primary"
+ v-hasPermi="['basic:customer:add']"
@click="openForm('add')">鏂板瀹㈡埛</el-button>
- <el-button type="primary"
- plain
- @click="back">娴佸叆鍏捣</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
+ <el-button v-hasPermi="['basic:customer:export']"
+ @click="handleOut">瀵煎嚭</el-button>
<el-button type="info"
plain
icon="Upload"
+ v-hasPermi="['basic:customer:import']"
@click="handleImport">瀵煎叆</el-button>
<el-button type="danger"
plain
+ v-hasPermi="['basic:customer:remove']"
@click="handleDelete">鍒犻櫎</el-button>
</div>
</div>
@@ -132,6 +133,23 @@
value="涓夊ぇ娌�" />
<el-option label="澶栭攢"
value="澶栭攢" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
+ <el-form-item label="缁戝畾鐧诲綍璐﹀彿锛�"
+ prop="bindUserId">
+ <el-select v-model="form.bindUserId"
+ placeholder="璇烽�夋嫨璇ュ鎴风殑鐧诲綍璐﹀彿"
+ clearable
+ filterable
+ style="width: 100%">
+ <el-option v-for="item in userList"
+ :key="item.userId"
+ :label="item.nickName + '锛�' + item.userName + '锛�'"
+ :value="item.userId" />
</el-select>
</el-form-item>
</el-col>
@@ -244,127 +262,96 @@
</div>
</template>
</el-dialog>
- <!-- 鍥炶鎻愰啋瀵硅瘽妗� -->
- <el-dialog title="鍥炶鎻愰啋"
- v-model="reminderDialogVisible"
- width="500px"
- @close="closeReminderDialog">
- <el-form :model="reminderForm"
- label-width="100px"
- :rules="reminderRules"
- ref="reminderFormRef">
- <el-form-item label="瀹㈡埛鍚嶇О锛�">
- <el-input v-model="reminderForm.customerName"
- disabled />
+ <!-- 杩�3骞磋储鍔℃姤琛ㄤ笂浼� -->
+ <el-dialog title="杩�3骞磋储鍔℃姤琛ㄤ笂浼�"
+ v-model="reportDialogVisible"
+ width="900px"
+ @close="closeReportDialog">
+ <div class="report-customer">瀹㈡埛锛歿{ reportCustomer.customerName }}</div>
+ <el-form :model="reportForm"
+ label-width="90px"
+ inline
+ class="report-form">
+ <el-form-item label="鎶ヨ〃骞村害">
+ <el-select v-model="reportForm.reportYear"
+ placeholder="璇烽�夋嫨骞村害"
+ style="width: 150px">
+ <el-option v-for="year in reportYears"
+ :key="year"
+ :label="year + '骞�'"
+ :value="year" />
+ </el-select>
</el-form-item>
- <el-form-item label="鎻愰啋寮�鍏筹細">
- <el-switch v-model="reminderForm.reminderSwitch" />
- </el-form-item>
- <el-form-item label="鎻愰啋鍐呭锛�"
- prop="reminderContent">
- <el-input v-model="reminderForm.reminderContent"
- type="textarea"
- :maxlength="100"
- show-word-limit
- placeholder="璇疯緭鍏ユ彁閱掑唴瀹�" />
- </el-form-item>
- <el-form-item label="鎻愰啋鏃堕棿锛�"
- prop="reminderTime">
- <el-date-picker v-model="reminderForm.reminderTime"
- type="datetime"
- value-format="YYYY-MM-DD HH:mm:ss"
- format="YYYY-MM-DD HH:mm:ss"
- placeholder="璇烽�夋嫨鎻愰啋鏃堕棿"
- style="width: 100%" />
+ <el-form-item label="鎶ヨ〃鍚嶇О">
+ <el-input v-model="reportForm.reportName"
+ placeholder="渚嬪锛�2025骞村害璐㈠姟鎶ヨ〃"
+ style="width: 260px"
+ clearable />
</el-form-item>
</el-form>
+ <FileUpload v-model="reportForm.reportFiles"
+ :limit="5"
+ :file-size="20"
+ :file-type="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'zip', 'rar']" />
+ <div class="report-actions">
+ <el-button type="primary"
+ :loading="reportSaving"
+ @click="saveReport">淇濆瓨涓婁紶</el-button>
+ <el-button @click="resetReportForm">閲嶇疆</el-button>
+ </div>
+ <el-table :data="reportRows"
+ border
+ size="small"
+ style="margin-top: 16px">
+ <el-table-column prop="reportYear"
+ label="骞村害"
+ width="90"
+ align="center" />
+ <el-table-column prop="reportName"
+ label="鎶ヨ〃鍚嶇О"
+ min-width="180"
+ show-overflow-tooltip />
+ <el-table-column label="鎶ヨ〃闄勪欢"
+ min-width="260">
+ <template #default="scope">
+ <FileUpload v-model="scope.row.reportFiles"
+ disabled
+ :is-show-tip="false" />
+ </template>
+ </el-table-column>
+ <el-table-column prop="uploadUserName"
+ label="涓婁紶浜�"
+ width="110" />
+ <el-table-column prop="updateTime"
+ label="涓婁紶鏃堕棿"
+ width="170" />
+ <el-table-column label="瀹℃壒鐘舵��"
+ width="100"
+ align="center">
+ <template #default="scope">
+ <el-tag :type="reportStatusTag(scope.row.auditStatus)">
+ {{ reportStatusText(scope.row.auditStatus) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔"
+ width="140"
+ align="center">
+ <template #default="scope">
+ <el-button type="primary"
+ link
+ @click="editReport(scope.row)">淇敼</el-button>
+ <el-button type="danger"
+ link
+ @click="deleteReport(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div v-if="reportRows.length === 0"
+ class="no-record">鏆傛棤璐㈠姟鎶ヨ〃锛岃鎸夊勾搴︿笂浼犺繎3骞磋储鍔℃姤琛�</div>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitReminderForm">纭</el-button>
- <el-button @click="closeReminderDialog">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
- <!-- 娣诲姞/淇敼娲借皥杩涘害瀵硅瘽妗� -->
- <el-dialog :title="negotiationForm.editIndex !== undefined ? '淇敼杩涘害' : '娣诲姞杩涘害'"
- v-model="negotiationDialogVisible"
- width="600px"
- @close="closeNegotiationDialog">
- <el-form :model="negotiationForm"
- label-width="100px"
- :rules="negotiationRules"
- ref="negotiationFormRef">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="璺熻繘鏂瑰紡锛�"
- prop="followUpMethod">
- <el-select v-model="negotiationForm.followUpMethod"
- placeholder="璇烽�夋嫨"
- style="width: 100%">
- <el-option label="鐢佃瘽"
- value="鐢佃瘽" />
- <el-option label="閭欢"
- value="閭欢" />
- <el-option label="涓婇棬"
- value="涓婇棬" />
- <el-option label="寰俊"
- value="寰俊" />
- <el-option label="鍏朵粬"
- value="鍏朵粬" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="璺熻繘绋嬪害锛�"
- prop="followUpLevel">
- <el-select v-model="negotiationForm.followUpLevel"
- placeholder="璇烽�夋嫨"
- style="width: 100%">
- <el-option label="娼滃湪瀹㈡埛"
- value="娼滃湪瀹㈡埛" />
- <el-option label="鍒濇鎷滆"
- value="鍒濇鎷滆" />
- <el-option label="澶氭鎷滆"
- value="澶氭鎷滆" />
- <el-option label="鎰忓悜瀹㈡埛"
- value="鎰忓悜瀹㈡埛" />
- <el-option label="宸茬绾﹀鎴�"
- value="宸茬绾﹀鎴�" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="璺熻繘鏃堕棿锛�"
- prop="followUpTime">
- <el-date-picker v-model="negotiationForm.followUpTime"
- type="datetime"
- value-format="YYYY-MM-DD HH:mm:ss"
- format="YYYY-MM-DD HH:mm:ss"
- placeholder="璇烽�夋嫨"
- style="width: 100%" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="璺熻繘浜猴細">
- <el-input v-model="negotiationForm.followerUserName"
- disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="鍐呭锛�"
- prop="content">
- <el-input v-model="negotiationForm.content"
- type="textarea"
- :rows="4"
- placeholder="璇疯緭鍏�" />
- </el-form-item>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitNegotiationForm">纭</el-button>
- <el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
+ <el-button @click="closeReportDialog">鍏抽棴</el-button>
</div>
</template>
</el-dialog>
@@ -373,7 +360,6 @@
v-model="detailDialogVisible"
width="1000px"
@close="closeDetailDialog">
- <!-- 瀹㈡埛鍩烘湰淇℃伅 -->
<div class="detail-section">
<h3 class="section-title">瀹㈡埛鍩烘湰淇℃伅</h3>
<div class="info-display">
@@ -450,10 +436,18 @@
<el-row :gutter="20">
<el-col :span="12">
<div class="info-item">
+ <span class="info-label">缁戝畾鐧诲綍璐﹀彿锛�</span>
+ <span class="info-value">{{ detailForm.bindUserName || '-' }}</span>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div class="info-item">
<span class="info-label">缁存姢浜猴細</span>
<span class="info-value">{{ detailForm.maintainer }}</span>
</div>
</el-col>
+ </el-row>
+ <el-row :gutter="20">
<el-col :span="12">
<div class="info-item">
<span class="info-label">缁存姢鏃堕棿锛�</span>
@@ -463,149 +457,41 @@
</el-row>
</div>
</div>
- <!-- 娲借皥杩涘害璁板綍 -->
<div class="detail-section">
- <div class="section-header">
- <h3 class="section-title">娲借皥杩涘害璁板綍</h3>
- <el-button type="primary"
- size="small"
- @click="openNegotiationDialog(detailForm)">
- 娣诲姞杩涘害
- </el-button>
- </div>
- <el-table :data="negotiationRecords"
+ <h3 class="section-title">杩�3骞磋储鍔℃姤琛�</h3>
+ <el-table :data="detailReports"
border
+ size="small"
style="width: 100%">
- <el-table-column prop="followUpTime"
- label="璺熻繘鏃堕棿"
- width="160" />
- <el-table-column prop="followUpMethod"
- label="璺熻繘鏂瑰紡"
- width="100" />
- <el-table-column prop="followUpLevel"
- label="璺熻繘绋嬪害" />
- <el-table-column prop="followerUserName"
- label="璺熻繘浜�"
- width="100" />
- <el-table-column prop="content"
- label="鍐呭"
+ <el-table-column prop="reportYear"
+ label="骞村害"
+ width="90"
+ align="center" />
+ <el-table-column prop="reportName"
+ label="鎶ヨ〃鍚嶇О"
+ min-width="180"
show-overflow-tooltip />
- <el-table-column label="闄勪欢"
- width="100"
- align="center">
- <template #default="{ row }">
- <el-button type="info"
- link
- @click="openAttachmentDialog(row)">
- <el-icon>
- <Paperclip />
- </el-icon>
- 闄勪欢
- <!-- {{ row.fileList && row.fileList.length > 0 ? row.fileList.length : '涓婁紶' }} -->
- </el-button>
+ <el-table-column label="鎶ヨ〃闄勪欢"
+ min-width="260">
+ <template #default="scope">
+ <FileUpload v-model="scope.row.reportFiles"
+ disabled
+ :is-show-tip="false" />
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔"
- width="150"
- align="center">
- <template #default="{ row, $index }">
- <el-button type="primary"
- link
- @click="editNegotiationRecord(row, $index)">
- 淇敼
- </el-button>
- <el-button type="danger"
- link
- @click="deleteNegotiationRecord(row, $index)">
- 鍒犻櫎
- </el-button>
- </template>
- </el-table-column>
+ <el-table-column prop="uploadUserName"
+ label="涓婁紶浜�"
+ width="110" />
+ <el-table-column prop="updateTime"
+ label="涓婁紶鏃堕棿"
+ width="170" />
</el-table>
- <div v-if="negotiationRecords.length === 0"
- class="no-records">
- 鏆傛棤娲借皥杩涘害璁板綍
- </div>
+ <div v-if="detailReports.length === 0"
+ class="no-record">鏆傛棤璐㈠姟鎶ヨ〃</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDetailDialog">鍏抽棴</el-button>
- </div>
- </template>
- </el-dialog>
- <!-- 闄勪欢涓婁紶寮圭獥 -->
- <el-dialog title="闄勪欢绠$悊"
- v-model="attachmentDialogVisible"
- width="600px"
- @close="closeAttachmentDialog">
- <div class="attachment-section">
- <div class="upload-area">
- <el-upload ref="attachmentUploadRef"
- :action="getAttachmentUploadUrl()"
- :headers="attachmentUploadHeaders"
- :file-list="currentAttachmentList"
- :on-success="handleAttachmentSuccess"
- :on-error="handleAttachmentError"
- :on-remove="handleAttachmentRemove"
- :before-upload="beforeAttachmentUpload"
- multiple
- :limit="10"
- name="files">
- <el-button type="primary">
- <el-icon>
- <Upload />
- </el-icon>
- 涓婁紶闄勪欢
- </el-button>
- <template #tip>
- <div class="el-upload__tip">
- 鏀寔涓婁紶鍥剧墖銆佹枃妗g瓑鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃50MB
- </div>
- </template>
- </el-upload>
- </div>
- <div v-if="currentAttachmentList.length > 0"
- class="attachment-list">
- <h4>宸蹭笂浼犻檮浠讹細</h4>
- <el-table :data="currentAttachmentList"
- border
- size="small">
- <el-table-column prop="name"
- label="鏂囦欢鍚�"
- show-overflow-tooltip />
- <el-table-column prop="size"
- label="澶у皬"
- width="100">
- <template #default="{ row }">
- {{ formatFileSize(row.size) }}
- </template>
- </el-table-column>
- <el-table-column label="鎿嶄綔"
- width="120"
- align="center">
- <template #default="{ row, $index }">
- <el-button type="primary"
- link
- @click="downloadAttachment(row)">
- 涓嬭浇
- </el-button>
- <el-button type="danger"
- link
- @click="deleteAttachment(row, $index)">
- 鍒犻櫎
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-else
- class="no-attachment">
- 鏆傛棤闄勪欢
- </div>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="closeAttachmentDialog">鍏抽棴</el-button>
</div>
</template>
</el-dialog>
@@ -614,68 +500,24 @@
<script setup>
import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
- import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
+ import { Search, Close } from "@element-plus/icons-vue";
+ import { listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer } from "@/api/basicData/customer.js";
import {
- addCustomerFollow,
- updateCustomerFollow,
- delCustomerFollow,
- addReturnVisit,
- getReturnVisit,
- } from "@/api/basicData/customerFile.js";
- import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, backCustomer} from "@/api/basicData/customer.js";
+ listCustomerFinancialReport,
+ saveCustomerFinancialReport,
+ delCustomerFinancialReport,
+ } from "@/api/basicData/customerFinancialReport.js";
import { ElMessageBox } from "element-plus";
import { userListNoPage } from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
+ import FileUpload from "@/components/FileUpload/index.vue";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
- // 鍥炶鎻愰啋鐩稿叧
- const reminderDialogVisible = ref(false);
- const reminderFormRef = ref();
- const currentCustomerId = ref();
- const reminderForm = reactive({
- customerName: "",
- reminderSwitch: false,
- reminderContent: "",
- reminderTime: "",
- });
- const reminderRules = {
- reminderContent: [
- { required: true, message: "璇疯緭鍏ユ彁閱掑唴瀹�", trigger: "blur" },
- ],
- reminderTime: [
- { required: true, message: "璇烽�夋嫨鎻愰啋鏃堕棿", trigger: "change" },
- ],
- };
-
- // 娲借皥杩涘害鐩稿叧
- const negotiationDialogVisible = ref(false);
- const negotiationFormRef = ref();
- const negotiationForm = reactive({
- customerName: "",
- customerId: "",
- followUpMethod: "",
- followUpLevel: "",
- followUpTime: "",
- followerUserName: "",
- content: "",
- });
- const negotiationRules = {
- followUpMethod: [
- { required: true, message: "璇烽�夋嫨璺熻繘鏂瑰紡", trigger: "change" },
- ],
- followUpLevel: [
- { required: true, message: "璇烽�夋嫨璺熻繘绋嬪害", trigger: "change" },
- ],
- followUpTime: [
- { required: true, message: "璇烽�夋嫨璺熻繘鏃堕棿", trigger: "change" },
- ],
- content: [{ required: true, message: "璇疯緭鍏ュ唴瀹�", trigger: "blur" }],
- };
-
// 璇︽儏鐩稿叧
const detailDialogVisible = ref(false);
+ const detailReports = ref([]);
const detailForm = reactive({
customerName: "",
customerType: "",
@@ -687,26 +529,20 @@
bankCode: "",
contactPerson: "",
contactPhone: "",
+ bindUserId: "",
+ bindUserName: "",
maintainer: "",
maintenanceTime: "",
});
- const negotiationRecords = ref([]);
- // 闄勪欢鐩稿叧
- const attachmentDialogVisible = ref(false);
- const attachmentUploadRef = ref();
- const currentAttachmentList = ref([]);
- const currentFollowRecord = ref({});
- const attachmentUploadHeaders = { Authorization: "Bearer " + getToken() };
-
- // 鍔ㄦ�佹瀯寤轰笂浼燯RL
- const getAttachmentUploadUrl = () => {
- const baseUrl =
- import.meta.env.VITE_APP_BASE_API + "/basic/customer-follow/upload";
- return currentFollowRecord.value.id
- ? `${baseUrl}/${currentFollowRecord.value.id}`
- : baseUrl;
- };
+ // 杩�3骞磋储鍔℃姤琛ㄧ浉鍏�
+ const reportDialogVisible = ref(false);
+ const reportSaving = ref(false);
+ const reportCustomer = reactive({ id: "", customerName: "" });
+ const reportRows = ref([]);
+ const nowYear = new Date().getFullYear();
+ const reportYears = [nowYear, nowYear - 1, nowYear - 2];
+ const reportForm = reactive({ reportYear: nowYear, reportName: "", reportFiles: "" });
const tableColumn = ref([
{
@@ -726,7 +562,7 @@
},
{
label: "鍦板潃鍙婅仈绯绘柟寮�",
- prop: "companyAddress",
+ prop: "addressPhone",
width: 250,
},
{
@@ -739,97 +575,36 @@
width: 150,
},
{
- label: "璺熻繘杩涘害",
- prop: "followUpLevel",
- width: 120,
- },
- {
- label: "璺熻繘鏃堕棿",
- prop: "followUpTime",
- width: 120,
- },
- {
- label: "閾惰鍩烘湰鎴�",
- prop: "basicBankAccount",
- width: 220,
- },
- {
- label: "閾惰璐﹀彿",
- prop: "bankAccount",
- width: 220,
- },
- {
- label: "寮�鎴疯鍙�",
- prop: "bankCode",
- width: 220,
- },
- {
- label: "缁存姢浜�",
- prop: "maintainer",
- },
- {
- label: "瀹㈡埛鏉ユ簮",
- prop: "type",
- dataType: "tag",
- width: 100,
- formatData: value => {
- if (value === 1 || value === "1") {
- return "鍏捣";
- }
- return "绉佹捣";
- },
- formatType: value => {
- if (value === 1 || value === "1") {
- return "warning";
- }
- return "success";
- },
- },
- {
- label: "缁存姢鏃堕棿",
- prop: "maintenanceTime",
- width: 100,
- },
- {
dataType: "action",
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 290,
+ width: 240,
operation: [
{
name: "缂栬緫",
type: "text",
- showHide: row => !isCustomerEditLocked(row),
+ showHide: () => proxy.$auth.hasPermi("basic:customer:edit"),
clickFun: row => {
- if (isCustomerEditLocked(row)) {
- proxy.$modal.msgWarning("宸茶閿�鍞ā鍧楀紩鐢ㄧ殑绉佹捣瀹㈡埛涓嶈兘缂栬緫");
- return;
- }
openForm("edit", row);
},
},
- {
- name: "娣诲姞娲借皥杩涘害",
- type: "text",
- clickFun: row => {
- openNegotiationDialog(row);
- },
- },
{
- name: "鍥炶鎻愰啋",
+ name: "杩�3骞磋储鍔℃姤琛�",
type: "text",
+ showHide: () => proxy.$auth.hasPermi("basic:customer:report"),
clickFun: row => {
- openReminderDialog(row);
+ openReportDialog(row);
},
},
- {
- name: "璇︽儏",
- type: "text",
- clickFun: row => {
- openDetailDialog(row);
- },
- },
+ {
+ name: "璇︽儏",
+ type: "text",
+ showHide: () => proxy.$auth.hasPermi("basic:customer:query"),
+ clickFun: row => {
+ openDetailDialog(row);
+ },
+ },
],
},
]);
@@ -842,13 +617,11 @@
size: 100,
total: 0,
});
- const total = ref(0);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
const dialogFormVisible = ref(false);
const formYYs = ref({
- // 鍏朵粬瀛楁...
contactList: [
{
contactPerson: "",
@@ -869,6 +642,7 @@
companyPhone: "",
contactPerson: "",
contactPhone: "",
+ bindUserId: "",
maintainer: "",
maintenanceTime: "",
basicBankAccount: "",
@@ -884,8 +658,6 @@
],
companyAddress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
companyPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- // contactPerson: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- // contactPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
maintainer: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
maintenanceTime: [
{ required: false, message: "璇烽�夋嫨", trigger: "change" },
@@ -912,7 +684,6 @@
},
// 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
beforeUpload: file => {
- console.log("鏂囦欢鍗冲皢涓婁紶", file);
// 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
const isValid =
file.type ===
@@ -930,7 +701,6 @@
},
// 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
onSuccess: (response, file, fileList) => {
- console.log("涓婁紶鎴愬姛", response, file, fileList);
upload.isUploading = false;
if (response.code === 200) {
proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
@@ -945,12 +715,11 @@
},
// 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
onError: (error, file, fileList) => {
- console.error("涓婁紶澶辫触", error, file, fileList);
upload.isUploading = false;
proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
},
// 鏂囦欢涓婁紶杩涘害鍥炶皟
- onProgress: (event, file, fileList) => {
+ onProgress: event => {
console.log("涓婁紶涓�...", event.percent);
},
});
@@ -984,6 +753,8 @@
tableLoading.value = false;
tableData.value = res.data.records;
page.total = res.data.total;
+ }).catch(() => {
+ tableLoading.value = false;
});
};
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -1006,10 +777,6 @@
}
// 鎵撳紑寮规
const openForm = (type, row) => {
- if (type === "edit" && isCustomerEditLocked(row)) {
- proxy.$modal.msgWarning("宸茶閿�鍞ā鍧楀紩鐢ㄧ殑绉佹捣瀹㈡埛涓嶈兘缂栬緫");
- return;
- }
operationType.value = type;
form.value = {};
form.value.maintainer = userStore.nickName;
@@ -1027,23 +794,21 @@
if (type === "edit") {
getCustomer(row.id).then(res => {
form.value = { ...res.data };
- formYYs.value.contactList = res.data.contactPerson
+ formYYs.value.contactList = (res.data.contactPerson || "")
.split(",")
+ .filter(item => item)
.map((item, index) => {
return {
contactPerson: item,
- contactPhone: res.data.contactPhone.split(",")[index],
+ contactPhone: (res.data.contactPhone || "").split(",")[index],
};
});
+ if (formYYs.value.contactList.length === 0) {
+ formYYs.value.contactList = [{ contactPerson: "", contactPhone: "" }];
+ }
});
}
dialogFormVisible.value = true;
- };
- const isCustomerEditLocked = row => {
- const salesReferenced = Number(row?.salesReferenceFlag || 0) === 1;
- const customerType = Number(row?.type);
- const usageStatus = Number(row?.usageStatus || 0);
- return salesReferenced && (customerType === 0 || (customerType === 1 && usageStatus === 1));
};
// 鎻愪氦琛ㄥ崟
const submitForm = () => {
@@ -1068,7 +833,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- addCustomer(form.value).then(res => {
+ addCustomer(form.value).then(() => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1082,7 +847,7 @@
form.value.contactPhone = formYYs.value.contactList
.map(item => item.contactPhone)
.join(",");
- updateCustomer(form.value).then(res => {
+ updateCustomer(form.value).then(() => {
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
closeDia();
getList();
@@ -1101,7 +866,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {type: 0}, "瀹㈡埛妗f.xlsx");
+ proxy.download("/basic/customer/export", { type: 0 }, "瀹㈡埛妗f.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -1144,182 +909,98 @@
});
};
- const back = () => {
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ // 鎵撳紑杩�3骞磋储鍔℃姤琛ㄥ脊绐�
+ const openReportDialog = row => {
+ reportCustomer.id = row.id;
+ reportCustomer.customerName = row.customerName;
+ resetReportForm();
+ loadReports(row.id);
+ reportDialogVisible.value = true;
+ };
+
+ const loadReports = customerId => {
+ listCustomerFinancialReport({ customerId }).then(res => {
+ reportRows.value = res.data || [];
+ });
+ };
+
+ const reportStatusText = status => {
+ if (status === 1) return "宸查�氳繃";
+ if (status === 2) return "宸查��鍥�";
+ return "寰呭鎵�";
+ };
+ const reportStatusTag = status => {
+ if (status === 1) return "success";
+ if (status === 2) return "danger";
+ return "warning";
+ };
+
+ const resetReportForm = () => {
+ reportForm.reportYear = nowYear;
+ reportForm.reportName = "";
+ reportForm.reportFiles = "";
+ };
+
+ const editReport = row => {
+ reportForm.reportYear = row.reportYear;
+ reportForm.reportName = row.reportName;
+ reportForm.reportFiles = row.reportFiles;
+ };
+
+ const saveReport = () => {
+ if (!reportForm.reportFiles) {
+ proxy.$modal.msgWarning("璇蜂笂浼犺储鍔℃姤琛ㄩ檮浠�");
return;
}
- const ids = selectedRows.value.map(item => item.id);
- ElMessageBox.confirm("閫変腑鐨勫鎴峰皢娴佸叆鍏捣锛屾槸鍚︾‘璁わ紵", "娴佸叆鍏捣鎻愮ず", {
+ reportSaving.value = true;
+ saveCustomerFinancialReport({
+ customerId: reportCustomer.id,
+ reportYear: reportForm.reportYear,
+ reportName: reportForm.reportName,
+ reportFiles: reportForm.reportFiles,
+ }).then(() => {
+ proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
+ resetReportForm();
+ loadReports(reportCustomer.id);
+ }).finally(() => {
+ reportSaving.value = false;
+ });
+ };
+
+ const deleteReport = row => {
+ ElMessageBox.confirm("纭畾瑕佸垹闄よ骞村害璐㈠姟鎶ヨ〃鍚楋紵", "鍒犻櫎鎻愮ず", {
confirmButtonText: "纭",
cancelButtonText: "鍙栨秷",
type: "warning",
})
.then(() => {
- tableLoading.value = true;
- return Promise.all(ids.map(id => backCustomer(id)))
- .then(() => {
- proxy.$modal.msgSuccess("娴佸叆鍏捣鎴愬姛");
- selectedRows.value = [];
- getList();
- })
- .finally(() => {
- tableLoading.value = false;
- });
+ delCustomerFinancialReport(row.id).then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ loadReports(reportCustomer.id);
+ });
})
- .catch(error => {
- if (error === "cancel" || error === "close") {
- proxy.$modal.msg("宸插彇娑�");
- }
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
});
};
- // 鎵撳紑鍥炶鎻愰啋寮圭獥
- const openReminderDialog = row => {
- currentCustomerId.value = row.id;
- reminderForm.customerName = row.customerName;
- reminderForm.reminderSwitch = false;
- reminderForm.reminderContent = "";
- reminderForm.reminderTime = "";
-
- // 灏濊瘯鑾峰彇宸叉湁鐨勫洖璁挎彁閱�
- getReturnVisit(row.id)
- .then(res => {
- if (res.code === 200 && res.data) {
- reminderForm.reminderSwitch = res.data.isEnabled === 1;
- reminderForm.reminderContent = res.data.content;
- reminderForm.reminderTime = res.data.reminderTime;
- reminderForm.id = res.data.id;
- }
- })
- .catch(error => {
- console.error("鑾峰彇鍥炶鎻愰啋澶辫触:", error);
- });
-
- reminderDialogVisible.value = true;
- };
-
- // 鍏抽棴鍥炶鎻愰啋寮圭獥
- const closeReminderDialog = () => {
- proxy.resetForm("reminderFormRef");
- reminderDialogVisible.value = false;
- };
- const submitvalue = ref({});
-
- // 鎻愪氦鍥炶鎻愰啋
- const submitReminderForm = () => {
- console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", userStore.id, userStore);
- proxy.$refs.reminderFormRef.validate(valid => {
- if (valid) {
- if (reminderForm.id) {
- submitvalue.value = {
- id: reminderForm.id,
- customerId: currentCustomerId.value,
- isEnabled: reminderForm.reminderSwitch ? 1 : 0,
- content: reminderForm.reminderContent,
- reminderTime: reminderForm.reminderTime,
- remindUserId: userStore.id,
- };
- } else {
- submitvalue.value = {
- customerId: currentCustomerId.value,
- isEnabled: reminderForm.reminderSwitch ? 1 : 0,
- content: reminderForm.reminderContent,
- reminderTime: reminderForm.reminderTime,
- remindUserId: userStore.id,
- };
- }
-
- // 璋冪敤鎺ュ彛
- addReturnVisit(submitvalue.value)
- .then(res => {
- if (res.code === 200) {
- proxy.$modal.msgSuccess("鍥炶鎻愰啋璁剧疆鎴愬姛");
- closeReminderDialog();
- } else {
- proxy.$modal.msgError(res.msg || "璁剧疆澶辫触");
- }
- })
- .catch(error => {
- console.error("璁剧疆鍥炶鎻愰啋澶辫触:", error);
- proxy.$modal.msgError("璁剧疆澶辫触");
- });
- }
- });
- };
-
- // 鎵撳紑娲借皥杩涘害寮圭獥
- const openNegotiationDialog = row => {
- negotiationForm.customerName = row.customerName;
- negotiationForm.customerId = row.id;
- negotiationForm.followUpMethod = "";
- negotiationForm.followUpLevel = "";
- negotiationForm.followUpTime = "";
- negotiationForm.followerUserName = userStore.nickName; // 榛樿褰撳墠鐧诲綍浜�
- negotiationForm.content = "";
- negotiationDialogVisible.value = true;
- };
-
- // 鍏抽棴娲借皥杩涘害寮圭獥
- const closeNegotiationDialog = () => {
- proxy.resetForm("negotiationFormRef");
- // 娓呴櫎缂栬緫鐘舵��
- delete negotiationForm.editIndex;
- delete negotiationForm.id;
- negotiationDialogVisible.value = false;
- };
-
- // 鎻愪氦娲借皥杩涘害
- const submitNegotiationForm = () => {
- proxy.$refs.negotiationFormRef.validate(valid => {
- if (valid) {
- // 鍒ゆ柇鏄柊澧炶繕鏄慨鏀�
- const isEdit = negotiationForm.editIndex !== undefined;
-
- if (isEdit) {
- // 淇敼鎿嶄綔
- updateCustomerFollow(negotiationForm).then(res => {
- // 鏇存柊鏈湴鏁版嵁
- getCustomer(negotiationForm.customerId).then(res => {
- // 鏇存柊鏈湴鏁版嵁
- negotiationRecords.value = res.data.followUpList || [];
- });
- });
- proxy.$modal.msgSuccess("淇敼鎴愬姛");
- closeNegotiationDialog();
- } else {
- // 鏂板鎿嶄綔
- console.log("鎻愪氦娲借皥杩涘害鏁版嵁:", negotiationForm);
- addCustomerFollow(negotiationForm).then(res => {
- // 娣诲姞鎴愬姛鍚庢洿鏂拌鎯呴〉闈㈢殑杩涘害璁板綍
- const newRecord = {
- followUpTime: negotiationForm.followUpTime,
- followUpMethod: negotiationForm.followUpMethod,
- followUpLevel: negotiationForm.followUpLevel,
- followerUserName: negotiationForm.followerUserName,
- content: negotiationForm.content,
- };
- negotiationRecords.value.unshift(newRecord);
-
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeNegotiationDialog();
- getList();
- });
- }
- }
- });
+ const closeReportDialog = () => {
+ reportDialogVisible.value = false;
+ reportRows.value = [];
+ resetReportForm();
};
// 鎵撳紑璇︽儏寮圭獥
const openDetailDialog = row => {
getCustomer(row.id).then(res => {
- // 濉厖瀹㈡埛鍩烘湰淇℃伅
Object.assign(detailForm, res.data);
-
- // 鑾峰彇娲借皥杩涘害璁板綍
- negotiationRecords.value = res.data.followUpList || [];
-
+ const bindUser = userList.value.find(item => item.userId === res.data.bindUserId);
+ detailForm.bindUserName = bindUser ? bindUser.nickName : "";
+ detailReports.value = [];
detailDialogVisible.value = true;
+ listCustomerFinancialReport({ customerId: row.id }).then(reportRes => {
+ detailReports.value = reportRes.data || [];
+ });
});
};
@@ -1328,201 +1009,19 @@
detailDialogVisible.value = false;
};
- // 淇敼娲借皥璁板綍
- const editNegotiationRecord = (row, index) => {
- // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
- Object.assign(negotiationForm, {
- customerName: row.customerName,
- customerId: row.customerId,
- followUpMethod: row.followUpMethod,
- followUpLevel: row.followUpLevel,
- followUpTime: row.followUpTime,
- followerUserName: row.followerUserName,
- content: row.content,
- id: row.id, // 璁板綍ID鐢ㄤ簬鏇存柊
- editIndex: index, // 璁板綍绱㈠紩鐢ㄤ簬鏈湴鏇存柊
- });
- negotiationDialogVisible.value = true;
- };
-
- // 鍒犻櫎娲借皥璁板綍
- const deleteNegotiationRecord = (row, index) => {
- ElMessageBox.confirm("纭畾瑕佸垹闄よ繖鏉℃唇璋堣褰曞悧锛�", "鍒犻櫎鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- // 杩欓噷鍙互璋冪敤鍒犻櫎鎺ュ彛
- // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
- // 绀轰緥锛歞eleteCustomerFollow(row.id).then(() => {
- // negotiationRecords.value.splice(index, 1);
- // proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- // });
- delCustomerFollow(row.id).then(() => {
- // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
- getCustomer(row.customerId).then(res => {
- // 鏇存柊鏈湴鏁版嵁
- negotiationRecords.value = res.data.followUpList || [];
- });
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- });
- // 鏈湴鍒犻櫎锛堟ā鎷燂級
- negotiationRecords.value.splice(index, 1);
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑堝垹闄�");
- });
- };
-
- // 鎵撳紑闄勪欢寮圭獥
- const openAttachmentDialog = row => {
- currentFollowRecord.value = row;
- // 杞崲涓虹鍚圗lement Plus fileList鏍煎紡鐨勬暟缁�
- currentAttachmentList.value = (row.fileList || []).map((file, index) => ({
- name: file.fileName,
- url: file.fileUrl,
- size: file.fileSize,
- id: file.id,
- uid: file.id || index,
- status: "success",
- }));
-
- attachmentDialogVisible.value = true;
- };
-
- // 鍏抽棴闄勪欢寮圭獥
- const closeAttachmentDialog = () => {
- attachmentDialogVisible.value = false;
- currentFollowRecord.value = {};
- currentAttachmentList.value = [];
- };
-
- // 闄勪欢涓婁紶鎴愬姛
- const handleAttachmentSuccess = (response, file, fileList) => {
- if (response.code === 200) {
- proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
- // 鏇存柊褰撳墠璁板綍鐨勯檮浠跺垪琛�
- currentAttachmentList.value = fileList.map(item => ({
- name: item.name,
- size: item.size,
- url: item.response?.data?.url || item.url,
- id: item.response?.data?.id,
- uid: item.uid,
- status: "success",
- }));
- // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
- if (currentFollowRecord.value) {
- currentFollowRecord.value.files = [...currentAttachmentList.value];
- }
- } else {
- proxy.$modal.msgError(response.msg || "涓婁紶澶辫触");
- }
- };
-
- // 闄勪欢涓婁紶澶辫触
- const handleAttachmentError = (error, file, fileList) => {
- console.error("涓婁紶澶辫触:", error);
- proxy.$modal.msgError("涓婁紶澶辫触");
- };
-
- // 闄勪欢绉婚櫎
- const handleAttachmentRemove = (file, fileList) => {
- currentAttachmentList.value = fileList;
- // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
- if (currentFollowRecord.value) {
- currentFollowRecord.value.files = [...fileList];
- }
- };
-
- // 闄勪欢涓婁紶鍓嶆牎楠�
- const beforeAttachmentUpload = file => {
- const maxSize = 50 * 1024 * 1024; // 50MB
- if (file.size > maxSize) {
- proxy.$modal.msgError("鏂囦欢澶у皬涓嶈兘瓒呰繃50MB");
- return false;
- }
- return true;
- };
-
- // 鏍煎紡鍖栨枃浠跺ぇ灏�
- const formatFileSize = size => {
- if (size < 1024) {
- return size + " B";
- } else if (size < 1024 * 1024) {
- return (size / 1024).toFixed(2) + " KB";
- } else {
- return (size / (1024 * 1024)).toFixed(2) + " MB";
- }
- };
-
- // 涓嬭浇闄勪欢
- const downloadAttachment = row => {
- if (row.url) {
- // proxy.download(row.url, {}, row.name);
- proxy.$download.byUrl(row.url, row.originalFilename);
- } else {
- proxy.$modal.msgError("涓嬭浇閾炬帴涓嶅瓨鍦�");
- }
- };
-
- // 鍒犻櫎闄勪欢
- const deleteAttachment = (row, index) => {
- ElMessageBox.confirm("纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�", "鍒犻櫎鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- // 璋冪敤鍚庣鎺ュ彛鍒犻櫎闄勪欢
- const deleteUrl =
- import.meta.env.VITE_APP_BASE_API +
- "/basic/customer-follow/file/" +
- row.id;
- fetch(deleteUrl, {
- method: "DELETE",
- headers: {
- Authorization: "Bearer " + getToken(),
- "Content-Type": "application/json",
- },
- })
- .then(response => response.json())
- .then(res => {
- if (res.code === 200) {
- // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版枃浠跺垪琛�
- currentAttachmentList.value.splice(index, 1);
- // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
- if (currentFollowRecord.value) {
- currentFollowRecord.value.files = [
- ...currentAttachmentList.value,
- ];
- }
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- } else {
- proxy.$modal.msgError(res.msg || "鍒犻櫎澶辫触");
- }
- })
- .catch(error => {
- console.error("鍒犻櫎闄勪欢澶辫触:", error);
- proxy.$modal.msgError("鍒犻櫎澶辫触");
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑堝垹闄�");
- });
- };
-
// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
function getCurrentDate() {
const today = new Date();
const year = today.getFullYear();
- const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+ const month = String(today.getMonth() + 1).padStart(2, "0");
const day = String(today.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
onMounted(() => {
+ userListNoPage().then(res => {
+ userList.value = res.data;
+ });
getList();
});
</script>
@@ -1533,13 +1032,6 @@
padding: 15px;
background-color: #f9f9f9;
border-radius: 4px;
- }
-
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 15px;
}
.section-title {
@@ -1574,40 +1066,24 @@
word-break: break-word;
}
- .no-records {
+ .no-record {
text-align: center;
- padding: 30px;
+ padding: 20px;
color: #999;
font-size: 14px;
}
- .attachment-section {
- .upload-area {
- margin-bottom: 20px;
- padding: 20px;
- background-color: #f9f9f9;
- border-radius: 4px;
- border: 1px dashed #d9d9d9;
+ .report-customer {
+ font-size: 14px;
+ color: #606266;
+ margin-bottom: 12px;
+ }
- .el-upload__tip {
- margin-top: 10px;
- color: #909399;
- }
- }
+ .report-form {
+ margin-bottom: 4px;
+ }
- .attachment-list {
- h4 {
- margin: 0 0 10px 0;
- font-size: 14px;
- color: #606266;
- }
- }
-
- .no-attachment {
- text-align: center;
- padding: 40px;
- color: #909399;
- font-size: 14px;
- }
+ .report-actions {
+ margin-top: 10px;
}
</style>
diff --git a/src/views/collaborativeApproval/approvalManagement/index.vue b/src/views/collaborativeApproval/approvalManagement/index.vue
index 4638392..1bcafa9 100644
--- a/src/views/collaborativeApproval/approvalManagement/index.vue
+++ b/src/views/collaborativeApproval/approvalManagement/index.vue
@@ -3,879 +3,940 @@
<!-- 椤甸潰鏍囬 -->
<div class="page-header">
<div class="header-title">
- <el-icon class="title-icon"><Setting /></el-icon>
+ <el-icon class="title-icon">
+ <Setting />
+ </el-icon>
<span>瀹℃壒娴佺▼閰嶇疆</span>
</div>
<div class="header-desc">涓轰笉鍚屽鎵圭被鍨嬮厤缃鎵规祦绋嬪拰瀹℃壒浜�</div>
</div>
-
<!-- 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� -->
<div class="type-tabs">
- <div
- v-for="type in approveTypes"
- :key="type.value"
- class="type-tab"
- :class="{ active: activeTab === type.value }"
- @click="activeTab = type.value; handleTabChange()"
- >
- <el-icon :size="14" :style="{ color: activeTab === type.value ? type.color : '#909399' }">
+ <div v-for="type in approveTypes"
+ :key="type.value"
+ class="type-tab"
+ :class="{ active: activeTab === type.value }"
+ @click="activeTab = type.value; handleTabChange()">
+ <el-icon :size="14"
+ :style="{ color: activeTab === type.value ? type.color : '#909399' }">
<component :is="type.icon" />
</el-icon>
<span class="tab-name">{{ type.label }}</span>
</div>
</div>
-
<!-- 涓昏鍐呭鍖哄煙 -->
- <el-card class="config-card" shadow="hover" v-loading="loading">
+ <el-card class="config-card"
+ shadow="hover"
+ v-loading="loading">
<template #header>
<div class="card-header">
<div class="header-left">
- <div class="type-icon" :style="{ backgroundColor: getTypeColor(currentApproveType) }">
- <el-icon :size="20" color="#fff"><component :is="getTypeIcon(currentApproveType)" /></el-icon>
+ <div class="type-icon"
+ :style="{ backgroundColor: getTypeColor(currentApproveType) }">
+ <el-icon :size="20"
+ color="#fff">
+ <component :is="getTypeIcon(currentApproveType)" />
+ </el-icon>
</div>
<div class="header-info">
<span class="type-name">{{ currentApproveTypeName }}</span>
- <el-tag :type="approverList.length > 0 ? 'success' : 'warning'" size="small" effect="light">
+ <el-tag :type="approverList.length > 0 ? 'success' : 'warning'"
+ size="small"
+ effect="light">
{{ approverList.length > 0 ? `宸查厤缃� ${approverList.length} 涓鎵逛汉` : '鏈厤缃鎵逛汉' }}
</el-tag>
</div>
</div>
- <div class="header-actions" v-if="approverList.length > 0">
- <el-button @click="handleReset" size="default">
- <el-icon><RefreshLeft /></el-icon>
+ <div class="header-actions"
+ v-if="approverList.length > 0">
+ <el-button @click="handleReset"
+ size="default">
+ <el-icon>
+ <RefreshLeft />
+ </el-icon>
閲嶇疆
</el-button>
- <el-button type="primary" @click="handleSave" :loading="saveLoading" size="default">
- <el-icon><Check /></el-icon>
+ <el-button type="primary"
+ @click="handleSave"
+ :loading="saveLoading"
+ size="default">
+ <el-icon>
+ <Check />
+ </el-icon>
淇濆瓨閰嶇疆
</el-button>
</div>
</div>
</template>
-
<!-- 瀹℃壒娴佺▼灞曠ず -->
- <div class="flow-wrapper" v-if="approverList.length > 0">
+ <div class="flow-wrapper"
+ v-if="approverList.length > 0">
<div class="flow-container">
- <div
- v-for="(item, index) in approverList"
- :key="index"
- class="flow-item"
- >
+ <div v-for="(item, index) in approverList"
+ :key="index"
+ class="flow-item">
<!-- 瀹℃壒鑺傜偣鍗$墖 -->
- <div class="node-card" :class="{ 'empty': !item.approverId }">
+ <div class="node-card"
+ :class="{ 'empty': !item.approverId }">
<!-- 椤堕儴搴忓彿鍜岀骇鍒� -->
<div class="node-badge">{{ index + 1 }}</div>
-
<!-- 澶村儚鍖哄煙 -->
<div class="node-avatar-section">
- <div
- class="node-avatar"
- :class="{ 'has-user': item.approverId }"
- :style="item.approverId ? { backgroundColor: getAvatarColor(item.approverName) } : {}"
- >
+ <div class="node-avatar"
+ :class="{ 'has-user': item.approverId }"
+ :style="item.approverId ? { backgroundColor: getAvatarColor(item.approverName) } : {}">
<span v-if="item.approverId">{{ item.approverName.charAt(0) }}</span>
- <el-icon v-else :size="24"><User /></el-icon>
+ <el-icon v-else
+ :size="24">
+ <User />
+ </el-icon>
</div>
<div class="node-level">{{ getLevelText(index) }}</div>
</div>
-
<!-- 閫夋嫨鍖哄煙 -->
<div class="node-select-section">
- <el-select
- v-model="item.approverId"
- placeholder="閫夋嫨瀹℃壒浜�"
- filterable
- size="default"
- @change="(val) => handleApproverChange(val, item)"
- >
- <el-option
- v-for="user in userList"
- :key="user.userId"
- :label="user.nickName"
- :value="user.userId"
- />
+ <el-select v-model="item.approverId"
+ placeholder="閫夋嫨瀹℃壒浜�"
+ filterable
+ size="default"
+ @change="(val) => handleApproverChange(val, item)">
+ <el-option v-for="user in userList"
+ :key="user.userId"
+ :label="user.nickName"
+ :value="user.userId" />
</el-select>
</div>
-
<!-- 鎿嶄綔鎸夐挳 -->
<div class="node-actions">
- <el-button
- type="primary"
- circle
- :disabled="index === 0"
- @click="moveLeft(index)"
- size="small"
- class="action-btn"
- title="鍓嶇Щ"
- >
- <el-icon><ArrowLeft /></el-icon>
+ <el-button type="primary"
+ circle
+ :disabled="index === 0"
+ @click="moveLeft(index)"
+ size="small"
+ class="action-btn"
+ title="鍓嶇Щ">
+ <el-icon>
+ <ArrowLeft />
+ </el-icon>
</el-button>
- <el-button
- type="primary"
- circle
- :disabled="index === approverList.length - 1"
- @click="moveRight(index)"
- size="small"
- class="action-btn"
- title="鍚庣Щ"
- >
- <el-icon><ArrowRight /></el-icon>
+ <el-button type="primary"
+ circle
+ :disabled="index === approverList.length - 1"
+ @click="moveRight(index)"
+ size="small"
+ class="action-btn"
+ title="鍚庣Щ">
+ <el-icon>
+ <ArrowRight />
+ </el-icon>
</el-button>
- <el-button
- type="danger"
- circle
- @click="handleDelete(index)"
- size="small"
- class="action-btn"
- >
- <el-icon><Delete /></el-icon>
+ <el-button type="danger"
+ circle
+ @click="handleDelete(index)"
+ size="small"
+ class="action-btn">
+ <el-icon>
+ <Delete />
+ </el-icon>
</el-button>
</div>
</div>
-
<!-- 杩炴帴绠ご -->
- <div class="arrow-connector" v-if="index < approverList.length - 1">
+ <div class="arrow-connector"
+ v-if="index < approverList.length - 1">
<div class="arrow-line"></div>
- <el-icon class="arrow-icon"><ArrowRight /></el-icon>
+ <el-icon class="arrow-icon">
+ <ArrowRight />
+ </el-icon>
</div>
</div>
-
<!-- 鏂板鑺傜偣鎸夐挳 - 鏀惧湪娴佺▼鏈�鍚� -->
<div class="add-node-item">
- <div class="arrow-connector" v-if="approverList.length > 0">
+ <div class="arrow-connector"
+ v-if="approverList.length > 0">
<div class="arrow-line"></div>
- <el-icon class="arrow-icon"><ArrowRight /></el-icon>
+ <el-icon class="arrow-icon">
+ <ArrowRight />
+ </el-icon>
</div>
- <div class="add-node-card" @click="handleAdd">
+ <div class="add-node-card"
+ @click="handleAdd">
<div class="add-icon-wrapper">
- <el-icon :size="28"><Plus /></el-icon>
+ <el-icon :size="28">
+ <Plus />
+ </el-icon>
</div>
<span class="add-text">鏂板瀹℃壒浜�</span>
</div>
</div>
</div>
</div>
-
<!-- 绌虹姸鎬� -->
- <div class="empty-state" v-else>
+ <div class="empty-state"
+ v-else>
<div class="empty-content">
<div class="empty-icon-wrapper">
- <el-icon :size="48" color="#c0c4cc"><User /></el-icon>
+ <el-icon :size="48"
+ color="#c0c4cc">
+ <User />
+ </el-icon>
</div>
<div class="empty-text">鏆傛棤瀹℃壒浜洪厤缃�</div>
<div class="empty-subtext">鐐瑰嚮涓嬫柟鎸夐挳娣诲姞绗竴涓鎵逛汉</div>
- <el-button type="primary" size="large" @click="handleAdd" class="empty-add-btn">
- <el-icon><Plus /></el-icon>
+ <el-button type="primary"
+ size="large"
+ @click="handleAdd"
+ class="empty-add-btn">
+ <el-icon>
+ <Plus />
+ </el-icon>
鏂板瀹℃壒浜�
</el-button>
</div>
</div>
</el-card>
-
<!-- 搴曢儴鎻愮ず -->
<div class="bottom-tips">
- <el-icon><InfoFilled /></el-icon>
+ <el-icon>
+ <InfoFilled />
+ </el-icon>
<span>鎻愮ず锛氭瘡涓祦绋嬭嚦灏戦厤缃竴涓鎵逛汉锛屽鎵规寜椤哄簭娴佽浆锛屽彲閫氳繃绠ご璋冩暣椤哄簭</span>
</div>
</div>
</template>
<script setup>
-import { ref, computed, onMounted } from 'vue';
-import { ElMessage, ElMessageBox } from 'element-plus';
-import {
- Plus, ArrowLeft, Delete, Check, RefreshLeft, Setting,
- Suitcase, Calendar, Location, Money, ShoppingCart, DocumentChecked,
- Van, ArrowRight, User, InfoFilled
-} from '@element-plus/icons-vue';
-import { getApproveProcessConfigNodeList, addApproveProcessConfigNode } from '@/api/collaborativeApproval/approvalManagement';
-import { userListNoPage } from '@/api/system/user';
+ import { ref, computed, onMounted } from "vue";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import {
+ Plus,
+ ArrowLeft,
+ Delete,
+ Check,
+ RefreshLeft,
+ Setting,
+ Suitcase,
+ Calendar,
+ Location,
+ Money,
+ ShoppingCart,
+ DocumentChecked,
+ Van,
+ ArrowRight,
+ User,
+ InfoFilled,
+ } from "@element-plus/icons-vue";
+ import {
+ getApproveProcessConfigNodeList,
+ addApproveProcessConfigNode,
+ } from "@/api/collaborativeApproval/approvalManagement";
+ import { userListNoPage } from "@/api/system/user";
-// 褰撳墠閫変腑鐨勬爣绛鹃〉
-const activeTab = ref('1');
+ // 褰撳墠閫変腑鐨勬爣绛鹃〉
+ const activeTab = ref("2");
-// 瀹℃壒绫诲瀷閰嶇疆鏁扮粍
-const approveTypes = [
- { value: '1', label: '鍏嚭绠$悊', icon: 'Suitcase', color: '#409EFF' },
- { value: '2', label: '璇峰亣绠$悊', icon: 'Calendar', color: '#67C23A' },
- { value: '3', label: '鍑哄樊绠$悊', icon: 'Location', color: '#E6A23C' },
- { value: '4', label: '鎶ラ攢绠$悊', icon: 'Money', color: '#F56C6C' },
- { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
- { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
- { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
-];
+ // 瀹℃壒绫诲瀷閰嶇疆鏁扮粍
+ const approveTypes = [
+ // { value: '1', label: '鍏嚭绠$悊', icon: 'Suitcase', color: '#409EFF' },
+ { value: "2", label: "璇峰亣绠$悊", icon: "Calendar", color: "#67C23A" },
+ { value: "3", label: "鍑哄樊绠$悊", icon: "Location", color: "#E6A23C" },
+ // { value: '4', label: '鎶ラ攢绠$悊', icon: 'Money', color: '#F56C6C' },
+ // { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
+ // { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
+ // { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
+ ];
-// 瀹℃壒绫诲瀷鍚嶇О鏄犲皠
-const approveTypeNameMap = {
- 1: '鍏嚭绠$悊',
- 2: '璇峰亣绠$悊',
- 3: '鍑哄樊绠$悊',
- 4: '鎶ラ攢绠$悊',
- 5: '閲囪喘瀹℃壒',
- 6: '鎶ヤ环瀹℃壒',
- 7: '鍙戣揣瀹℃壒',
-};
+ // 瀹℃壒绫诲瀷鍚嶇О鏄犲皠
+ const approveTypeNameMap = {
+ // 1: '鍏嚭绠$悊',
+ 2: "璇峰亣绠$悊",
+ 3: "鍑哄樊绠$悊",
+ // 4: '鎶ラ攢绠$悊',
+ // 5: '閲囪喘瀹℃壒',
+ // 6: '鎶ヤ环瀹℃壒',
+ // 7: '鍙戣揣瀹℃壒',
+ };
-// 瀹℃壒绫诲瀷鍥炬爣鏄犲皠
-const typeIconMap = {
- 1: 'Suitcase',
- 2: 'Calendar',
- 3: 'Location',
- 4: 'Money',
- 5: 'ShoppingCart',
- 6: 'DocumentChecked',
- 7: 'Van',
-};
+ // 瀹℃壒绫诲瀷鍥炬爣鏄犲皠
+ const typeIconMap = {
+ 1: "Suitcase",
+ 2: "Calendar",
+ 3: "Location",
+ 4: "Money",
+ 5: "ShoppingCart",
+ 6: "DocumentChecked",
+ 7: "Van",
+ };
-// 瀹℃壒绫诲瀷棰滆壊鏄犲皠
-const typeColorMap = {
- 1: '#409EFF',
- 2: '#67C23A',
- 3: '#E6A23C',
- 4: '#F56C6C',
- 5: '#909399',
- 6: '#9B59B6',
- 7: '#1ABC9C',
-};
+ // 瀹℃壒绫诲瀷棰滆壊鏄犲皠
+ const typeColorMap = {
+ 1: "#409EFF",
+ 2: "#67C23A",
+ 3: "#E6A23C",
+ 4: "#F56C6C",
+ 5: "#909399",
+ 6: "#9B59B6",
+ 7: "#1ABC9C",
+ };
-// 澶村儚棰滆壊姹�
-const avatarColors = ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#9B59B6', '#1ABC9C', '#FF6B6B', '#4ECDC4'];
+ // 澶村儚棰滆壊姹�
+ const avatarColors = [
+ "#409EFF",
+ "#67C23A",
+ "#E6A23C",
+ "#F56C6C",
+ "#9B59B6",
+ "#1ABC9C",
+ "#FF6B6B",
+ "#4ECDC4",
+ ];
-// 褰撳墠瀹℃壒绫诲瀷鍚嶇О
-const currentApproveTypeName = computed(() => {
- return approveTypeNameMap[activeTab.value] || '鏈煡绫诲瀷';
-});
+ // 褰撳墠瀹℃壒绫诲瀷鍚嶇О
+ const currentApproveTypeName = computed(() => {
+ return approveTypeNameMap[activeTab.value] || "鏈煡绫诲瀷";
+ });
-// 褰撳墠瀹℃壒绫诲瀷
-const currentApproveType = computed(() => {
- return Number(activeTab.value);
-});
+ // 褰撳墠瀹℃壒绫诲瀷
+ const currentApproveType = computed(() => {
+ return Number(activeTab.value);
+ });
-// 鑾峰彇绫诲瀷鍥炬爣
-const getTypeIcon = (type) => typeIconMap[type] || 'Setting';
+ // 鑾峰彇绫诲瀷鍥炬爣
+ const getTypeIcon = type => typeIconMap[type] || "Setting";
-// 鑾峰彇绫诲瀷棰滆壊
-const getTypeColor = (type) => typeColorMap[type] || '#409EFF';
+ // 鑾峰彇绫诲瀷棰滆壊
+ const getTypeColor = type => typeColorMap[type] || "#409EFF";
-// 鑾峰彇澶村儚棰滆壊
-const getAvatarColor = (name) => {
- if (!name) return '#C0C4CC';
- let hash = 0;
- for (let i = 0; i < name.length; i++) {
- hash = name.charCodeAt(i) + ((hash << 5) - hash);
- }
- return avatarColors[Math.abs(hash) % avatarColors.length];
-};
+ // 鑾峰彇澶村儚棰滆壊
+ const getAvatarColor = name => {
+ if (!name) return "#C0C4CC";
+ let hash = 0;
+ for (let i = 0; i < name.length; i++) {
+ hash = name.charCodeAt(i) + ((hash << 5) - hash);
+ }
+ return avatarColors[Math.abs(hash) % avatarColors.length];
+ };
-// 鑾峰彇绾у埆鏂囨湰
-const getLevelText = (index) => {
- const texts = ['绗竴绾�', '绗簩绾�', '绗笁绾�', '绗洓绾�', '绗簲绾�', '绗叚绾�', '绗竷绾�', '绗叓绾�'];
- return texts[index] || `绗�${index + 1}绾;
-};
+ // 鑾峰彇绾у埆鏂囨湰
+ const getLevelText = index => {
+ const texts = [
+ "绗竴绾�",
+ "绗簩绾�",
+ "绗笁绾�",
+ "绗洓绾�",
+ "绗簲绾�",
+ "绗叚绾�",
+ "绗竷绾�",
+ "绗叓绾�",
+ ];
+ return texts[index] || `绗�${index + 1}绾;
+ };
-// 瀹℃壒浜哄垪琛紙鐪熷疄鎺ュ彛锛�
-const userList = ref([]);
+ // 瀹℃壒浜哄垪琛紙鐪熷疄鎺ュ彛锛�
+ const userList = ref([]);
-// 瀹℃壒浜哄垪琛�
-const approverList = ref([]);
+ // 瀹℃壒浜哄垪琛�
+ const approverList = ref([]);
-// 鍘熷鏁版嵁锛岀敤浜庨噸缃�
-const originalList = ref([]);
+ // 鍘熷鏁版嵁锛岀敤浜庨噸缃�
+ const originalList = ref([]);
-// 鍔犺浇鐘舵��
-const loading = ref(false);
-const saveLoading = ref(false);
+ // 鍔犺浇鐘舵��
+ const loading = ref(false);
+ const saveLoading = ref(false);
-// 鏍囩椤靛垏鎹㈠鐞�
-const handleTabChange = () => {
- loadData();
-};
+ // 鏍囩椤靛垏鎹㈠鐞�
+ const handleTabChange = () => {
+ loadData();
+ };
-// 鍔犺浇瀹℃壒閰嶇疆鏁版嵁锛堟ā鎷燂級
-const loadData = async () => {
- loading.value = true;
- try {
- const res = await getApproveProcessConfigNodeList(currentApproveType.value);
- const source = Array.isArray(res?.data)
- ? res.data
- : Array.isArray(res?.rows)
+ // 鍔犺浇瀹℃壒閰嶇疆鏁版嵁锛堟ā鎷燂級
+ const loadData = async () => {
+ loading.value = true;
+ try {
+ const res = await getApproveProcessConfigNodeList(currentApproveType.value);
+ const source = Array.isArray(res?.data)
+ ? res.data
+ : Array.isArray(res?.rows)
? res.rows
: Array.isArray(res?.data?.records)
- ? res.data.records
- : [];
- const data = source.map((item, index) => ({
- ...item,
- sortOrder: item.nodeOrder ?? item.sortOrder ?? index + 1,
- }));
- approverList.value = data.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0));
- originalList.value = JSON.parse(JSON.stringify(approverList.value));
- } catch (error) {
- approverList.value = [];
- originalList.value = [];
- ElMessage.error('鍔犺浇瀹℃壒閰嶇疆澶辫触');
- } finally {
- loading.value = false;
- }
-};
+ ? res.data.records
+ : [];
+ const data = source.map((item, index) => ({
+ ...item,
+ sortOrder: item.nodeOrder ?? item.sortOrder ?? index + 1,
+ }));
+ approverList.value = data.sort(
+ (a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)
+ );
+ originalList.value = JSON.parse(JSON.stringify(approverList.value));
+ } catch (error) {
+ approverList.value = [];
+ originalList.value = [];
+ ElMessage.error("鍔犺浇瀹℃壒閰嶇疆澶辫触");
+ } finally {
+ loading.value = false;
+ }
+ };
-const loadUserList = async () => {
- try {
- const res = await userListNoPage();
- userList.value = Array.isArray(res?.data) ? res.data : [];
- } catch (error) {
- userList.value = [];
- ElMessage.error('鍔犺浇浜哄憳鍒楄〃澶辫触');
- }
-};
+ const loadUserList = async () => {
+ try {
+ const res = await userListNoPage();
+ userList.value = Array.isArray(res?.data) ? res.data : [];
+ } catch (error) {
+ userList.value = [];
+ ElMessage.error("鍔犺浇浜哄憳鍒楄〃澶辫触");
+ }
+ };
-// 瀹℃壒浜洪�夋嫨鍙樺寲
-const handleApproverChange = (userId, row) => {
- const user = userList.value.find((u) => u.userId === userId);
- if (user) {
- row.approverName = user.nickName;
- }
-};
+ // 瀹℃壒浜洪�夋嫨鍙樺寲
+ const handleApproverChange = (userId, row) => {
+ const user = userList.value.find(u => u.userId === userId);
+ if (user) {
+ row.approverName = user.nickName;
+ }
+ };
-// 鏂板瀹℃壒浜�
-const handleAdd = () => {
- const newOrder = approverList.value.length + 1;
- approverList.value.push({
- id: null,
- approveType: currentApproveType.value,
- approverId: null,
- approverName: '',
- sortOrder: newOrder,
- });
-};
-
-// 鍒犻櫎瀹℃壒浜�
-const handleDelete = (index) => {
- ElMessageBox.confirm('纭畾鍒犻櫎璇ュ鎵逛汉鍚楋紵', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- })
- .then(() => {
- approverList.value.splice(index, 1);
- approverList.value.forEach((item, idx) => {
- item.sortOrder = idx + 1;
- });
- ElMessage.success('鍒犻櫎鎴愬姛');
- })
- .catch(() => {});
-};
-
-// 鍓嶇Щ
-const moveLeft = (index) => {
- if (index === 0) return;
- const temp = approverList.value[index];
- approverList.value[index] = approverList.value[index - 1];
- approverList.value[index - 1] = temp;
- approverList.value[index].sortOrder = index + 1;
- approverList.value[index - 1].sortOrder = index;
-};
-
-// 鍚庣Щ
-const moveRight = (index) => {
- if (index === approverList.value.length - 1) return;
- const temp = approverList.value[index];
- approverList.value[index] = approverList.value[index + 1];
- approverList.value[index + 1] = temp;
- approverList.value[index].sortOrder = index + 1;
- approverList.value[index + 1].sortOrder = index + 2;
-};
-
-// 淇濆瓨閰嶇疆
-const handleSave = async () => {
- if (approverList.value.length === 0) {
- ElMessage.warning('璇疯嚦灏戦厤缃竴涓鎵逛汉');
- return;
- }
-
- const hasEmptyApprover = approverList.value.some((item) => !item.approverId);
- if (hasEmptyApprover) {
- ElMessage.warning('璇烽�夋嫨鎵�鏈夊鎵逛汉');
- return;
- }
-
- const approverIds = approverList.value.map((item) => item.approverId);
- const uniqueIds = [...new Set(approverIds)];
- if (uniqueIds.length !== approverIds.length) {
- ElMessage.warning('瀹℃壒浜轰笉鑳介噸澶�');
- return;
- }
-
- saveLoading.value = true;
- try {
- const payload = approverList.value.map((item, index) => ({
+ // 鏂板瀹℃壒浜�
+ const handleAdd = () => {
+ const newOrder = approverList.value.length + 1;
+ approverList.value.push({
+ id: null,
approveType: currentApproveType.value,
- nodeOrder: index + 1,
- approverId: item.approverId,
- approverName: item.approverName,
- }));
- await addApproveProcessConfigNode(payload);
- ElMessage.success('淇濆瓨鎴愬姛');
- await loadData();
- } catch (error) {
- ElMessage.error('淇濆瓨澶辫触');
- } finally {
- saveLoading.value = false;
- }
-};
+ approverId: null,
+ approverName: "",
+ sortOrder: newOrder,
+ });
+ };
-// 閲嶇疆
-const handleReset = () => {
- if (originalList.value.length === 0) {
- approverList.value = [];
- return;
- }
- ElMessageBox.confirm('纭畾瑕侀噸缃綋鍓嶉厤缃悧锛熸湭淇濆瓨鐨勬洿鏀瑰皢涓㈠け銆�', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- })
- .then(() => {
- approverList.value = JSON.parse(JSON.stringify(originalList.value));
- ElMessage.success('宸查噸缃�');
+ // 鍒犻櫎瀹℃壒浜�
+ const handleDelete = index => {
+ ElMessageBox.confirm("纭畾鍒犻櫎璇ュ鎵逛汉鍚楋紵", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
- .catch(() => {});
-};
+ .then(() => {
+ approverList.value.splice(index, 1);
+ approverList.value.forEach((item, idx) => {
+ item.sortOrder = idx + 1;
+ });
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => {});
+ };
-onMounted(async () => {
- await loadUserList();
- await loadData();
-});
+ // 鍓嶇Щ
+ const moveLeft = index => {
+ if (index === 0) return;
+ const temp = approverList.value[index];
+ approverList.value[index] = approverList.value[index - 1];
+ approverList.value[index - 1] = temp;
+ approverList.value[index].sortOrder = index + 1;
+ approverList.value[index - 1].sortOrder = index;
+ };
+
+ // 鍚庣Щ
+ const moveRight = index => {
+ if (index === approverList.value.length - 1) return;
+ const temp = approverList.value[index];
+ approverList.value[index] = approverList.value[index + 1];
+ approverList.value[index + 1] = temp;
+ approverList.value[index].sortOrder = index + 1;
+ approverList.value[index + 1].sortOrder = index + 2;
+ };
+
+ // 淇濆瓨閰嶇疆
+ const handleSave = async () => {
+ if (approverList.value.length === 0) {
+ ElMessage.warning("璇疯嚦灏戦厤缃竴涓鎵逛汉");
+ return;
+ }
+
+ const hasEmptyApprover = approverList.value.some(item => !item.approverId);
+ if (hasEmptyApprover) {
+ ElMessage.warning("璇烽�夋嫨鎵�鏈夊鎵逛汉");
+ return;
+ }
+
+ const approverIds = approverList.value.map(item => item.approverId);
+ const uniqueIds = [...new Set(approverIds)];
+ if (uniqueIds.length !== approverIds.length) {
+ ElMessage.warning("瀹℃壒浜轰笉鑳介噸澶�");
+ return;
+ }
+
+ saveLoading.value = true;
+ try {
+ const payload = approverList.value.map((item, index) => ({
+ approveType: currentApproveType.value,
+ nodeOrder: index + 1,
+ approverId: item.approverId,
+ approverName: item.approverName,
+ }));
+ await addApproveProcessConfigNode(payload);
+ ElMessage.success("淇濆瓨鎴愬姛");
+ await loadData();
+ } catch (error) {
+ ElMessage.error("淇濆瓨澶辫触");
+ } finally {
+ saveLoading.value = false;
+ }
+ };
+
+ // 閲嶇疆
+ const handleReset = () => {
+ if (originalList.value.length === 0) {
+ approverList.value = [];
+ return;
+ }
+ ElMessageBox.confirm("纭畾瑕侀噸缃綋鍓嶉厤缃悧锛熸湭淇濆瓨鐨勬洿鏀瑰皢涓㈠け銆�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ approverList.value = JSON.parse(JSON.stringify(originalList.value));
+ ElMessage.success("宸查噸缃�");
+ })
+ .catch(() => {});
+ };
+
+ onMounted(async () => {
+ await loadUserList();
+ await loadData();
+ });
</script>
<style scoped>
-.page-header {
- margin-bottom: 20px;
-}
+ .page-header {
+ margin-bottom: 20px;
+ }
-.header-title {
- display: flex;
- align-items: center;
- gap: 10px;
- font-size: 20px;
- font-weight: 600;
- color: var(--el-text-color-primary, #303133);
- margin-bottom: 6px;
-}
+ .header-title {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-size: 20px;
+ font-weight: 600;
+ color: var(--el-text-color-primary, #303133);
+ margin-bottom: 6px;
+ }
-.title-icon {
- font-size: 24px;
- color: var(--el-color-primary, #409EFF);
-}
+ .title-icon {
+ font-size: 24px;
+ color: var(--el-color-primary, #409eff);
+ }
-.header-desc {
- font-size: 13px;
- color: var(--el-text-color-secondary, #909399);
- margin-left: 34px;
-}
+ .header-desc {
+ font-size: 13px;
+ color: var(--el-text-color-secondary, #909399);
+ margin-left: 34px;
+ }
-/* 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� */
-.type-tabs {
- display: flex;
- gap: 4px;
- margin-bottom: 16px;
- padding: 4px;
- background: var(--el-fill-color-light, #f5f7fa);
- border-radius: 8px;
- overflow-x: auto;
-}
-
-.type-tab {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 8px 14px;
- border-radius: 6px;
- cursor: pointer;
- transition: all 0.2s ease;
- white-space: nowrap;
- font-size: 13px;
- color: var(--el-text-color-regular, #606266);
-}
-
-.type-tab:hover {
- background: var(--el-color-primary-light-9, rgba(64, 158, 255, 0.1));
- color: var(--el-color-primary, #409EFF);
-}
-
-.type-tab.active {
- background: var(--el-bg-color, #fff);
- color: var(--el-color-primary, #409EFF);
- font-weight: 600;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
-}
-
-.tab-name {
- font-size: 13px;
-}
-
-.tab-count {
- min-width: 16px;
- height: 16px;
- padding: 0 5px;
- background: var(--el-color-success, #67C23A);
- color: #fff;
- border-radius: 8px;
- font-size: 11px;
- font-weight: 600;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.config-card {
- margin-bottom: 16px;
- border-radius: 12px;
-}
-
-:deep(.el-card__header) {
- padding: 16px 20px;
- border-bottom: 1px solid var(--el-border-color-light, #ebeef5);
-}
-
-.card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.header-left {
- display: flex;
- align-items: center;
- gap: 14px;
-}
-
-.type-icon {
- width: 44px;
- height: 44px;
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.header-info {
- display: flex;
- flex-direction: column;
- gap: 6px;
-}
-
-.type-name {
- font-size: 16px;
- font-weight: 600;
- color: var(--el-text-color-primary, #303133);
-}
-
-.header-actions {
- display: flex;
- gap: 10px;
-}
-
-.flow-wrapper {
- overflow-x: auto;
- padding: 8px 4px;
-}
-
-.flow-container {
- display: flex;
- align-items: center;
- gap: 0;
- min-width: min-content;
-}
-
-.flow-item {
- display: flex;
- align-items: center;
-}
-
-.node-card {
- width: 200px;
- background: var(--el-bg-color, #fff);
- border: 2px solid var(--el-border-color, #e4e7ed);
- border-radius: 12px;
- padding: 16px;
- position: relative;
- transition: all 0.3s ease;
- flex-shrink: 0;
-}
-
-.node-card:hover {
- border-color: var(--el-color-primary, #409EFF);
- box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15);
- transform: translateY(-2px);
-}
-
-.node-card.empty {
- border-style: dashed;
- border-color: var(--el-border-color, #c0c4cc);
- background: var(--el-fill-color-light, #fafbfc);
-}
-
-.node-card.empty:hover {
- border-color: var(--el-color-primary, #409EFF);
- background: var(--el-fill-color-light, #f5f7fa);
-}
-
-.node-badge {
- position: absolute;
- top: -10px;
- left: 16px;
- width: 24px;
- height: 24px;
- background: var(--el-color-primary, #409EFF);
- color: #fff;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 13px;
- font-weight: 700;
- box-shadow: 0 2px 8px rgba(64, 158, 255, 0.4);
-}
-
-.node-avatar-section {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 12px;
- margin-top: 4px;
-}
-
-.node-avatar {
- width: 56px;
- height: 56px;
- border-radius: 50%;
- background: var(--el-fill-color, #f0f2f5);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 8px;
- color: var(--el-text-color-placeholder, #c0c4cc);
- transition: all 0.3s ease;
-}
-
-.node-avatar.has-user {
- color: #fff;
- font-size: 22px;
- font-weight: 600;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
-}
-
-.node-level {
- font-size: 12px;
- color: var(--el-text-color-secondary, #909399);
- font-weight: 500;
-}
-
-.node-select-section {
- margin-bottom: 12px;
-}
-
-.node-select-section :deep(.el-select) {
- width: 100%;
-}
-
-.node-actions {
- display: flex;
- justify-content: center;
- gap: 8px;
- padding-top: 12px;
- border-top: 1px solid var(--el-border-color-light, #ebeef5);
-}
-
-.action-btn {
- transition: all 0.2s;
-}
-
-.action-btn:hover:not(:disabled) {
- transform: scale(1.1);
-}
-
-.arrow-connector {
- display: flex;
- align-items: center;
- width: 50px;
- position: relative;
-}
-
-.arrow-line {
- flex: 1;
- height: 2px;
- background: var(--el-border-color, #c0c4cc);
-}
-
-.arrow-icon {
- color: var(--el-text-color-placeholder, #c0c4cc);
- font-size: 14px;
- margin-left: -2px;
-}
-
-/* 鏂板鑺傜偣鏍峰紡 */
-.add-node-item {
- display: flex;
- align-items: center;
-}
-
-.add-node-card {
- width: 140px;
- height: 200px;
- border: 2px dashed var(--el-border-color, #c0c4cc);
- border-radius: 12px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 12px;
- cursor: pointer;
- transition: all 0.3s ease;
- background: var(--el-fill-color-light, #fafbfc);
- flex-shrink: 0;
- margin-left: 0;
-}
-
-.add-node-card:hover {
- border-color: var(--el-color-primary, #409EFF);
- background: var(--el-color-primary-light-9, #f0f7ff);
- transform: translateY(-2px);
- box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15);
-}
-
-.add-icon-wrapper {
- width: 48px;
- height: 48px;
- border-radius: 50%;
- background: var(--el-color-primary, #409EFF);
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
- transition: all 0.3s ease;
-}
-
-.add-node-card:hover .add-icon-wrapper {
- transform: scale(1.1);
- box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4);
-}
-
-.add-text {
- font-size: 14px;
- color: var(--el-text-color-regular, #606266);
- font-weight: 500;
-}
-
-.add-node-card:hover .add-text {
- color: var(--el-color-primary, #409EFF);
-}
-
-/* 绌虹姸鎬� */
-.empty-state {
- padding: 50px 20px;
-}
-
-.empty-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 16px;
-}
-
-.empty-icon-wrapper {
- width: 80px;
- height: 80px;
- border-radius: 50%;
- background: var(--el-fill-color-light, #f5f7fa);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 8px;
-}
-
-.empty-text {
- font-size: 16px;
- font-weight: 600;
- color: var(--el-text-color-regular, #606266);
-}
-
-.empty-subtext {
- font-size: 13px;
- color: var(--el-text-color-secondary, #909399);
-}
-
-.empty-add-btn {
- margin-top: 8px;
- padding: 12px 28px;
-}
-
-/* 搴曢儴鎻愮ず */
-.bottom-tips {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- padding: 12px 20px;
- background: var(--el-fill-color-light, #f5f7fa);
- border-radius: 8px;
- color: var(--el-text-color-regular, #606266);
- font-size: 13px;
-}
-
-.bottom-tips .el-icon {
- color: var(--el-color-primary, #409EFF);
- font-size: 16px;
-}
-
-@media (max-width: 768px) {
+ /* 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� */
.type-tabs {
- padding: 3px;
+ display: flex;
+ gap: 4px;
+ margin-bottom: 16px;
+ padding: 4px;
+ background: var(--el-fill-color-light, #f5f7fa);
+ border-radius: 8px;
+ overflow-x: auto;
}
.type-tab {
- padding: 6px 10px;
- font-size: 12px;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 8px 14px;
+ border-radius: 6px;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ white-space: nowrap;
+ font-size: 13px;
+ color: var(--el-text-color-regular, #606266);
+ }
+
+ .type-tab:hover {
+ background: var(--el-color-primary-light-9, rgba(64, 158, 255, 0.1));
+ color: var(--el-color-primary, #409eff);
+ }
+
+ .type-tab.active {
+ background: var(--el-bg-color, #fff);
+ color: var(--el-color-primary, #409eff);
+ font-weight: 600;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.tab-name {
- font-size: 12px;
+ font-size: 13px;
+ }
+
+ .tab-count {
+ min-width: 16px;
+ height: 16px;
+ padding: 0 5px;
+ background: var(--el-color-success, #67c23a);
+ color: #fff;
+ border-radius: 8px;
+ font-size: 11px;
+ font-weight: 600;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .config-card {
+ margin-bottom: 16px;
+ border-radius: 12px;
+ }
+
+ :deep(.el-card__header) {
+ padding: 16px 20px;
+ border-bottom: 1px solid var(--el-border-color-light, #ebeef5);
+ }
+
+ .card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .header-left {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ }
+
+ .type-icon {
+ width: 44px;
+ height: 44px;
+ border-radius: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ }
+
+ .header-info {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ }
+
+ .type-name {
+ font-size: 16px;
+ font-weight: 600;
+ color: var(--el-text-color-primary, #303133);
+ }
+
+ .header-actions {
+ display: flex;
+ gap: 10px;
+ }
+
+ .flow-wrapper {
+ overflow-x: auto;
+ padding: 8px 4px;
}
.flow-container {
- flex-wrap: wrap;
+ display: flex;
+ align-items: center;
+ gap: 0;
+ min-width: min-content;
+ }
+
+ .flow-item {
+ display: flex;
+ align-items: center;
+ }
+
+ .node-card {
+ width: 200px;
+ background: var(--el-bg-color, #fff);
+ border: 2px solid var(--el-border-color, #e4e7ed);
+ border-radius: 12px;
+ padding: 16px;
+ position: relative;
+ transition: all 0.3s ease;
+ flex-shrink: 0;
+ }
+
+ .node-card:hover {
+ border-color: var(--el-color-primary, #409eff);
+ box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15);
+ transform: translateY(-2px);
+ }
+
+ .node-card.empty {
+ border-style: dashed;
+ border-color: var(--el-border-color, #c0c4cc);
+ background: var(--el-fill-color-light, #fafbfc);
+ }
+
+ .node-card.empty:hover {
+ border-color: var(--el-color-primary, #409eff);
+ background: var(--el-fill-color-light, #f5f7fa);
+ }
+
+ .node-badge {
+ position: absolute;
+ top: -10px;
+ left: 16px;
+ width: 24px;
+ height: 24px;
+ background: var(--el-color-primary, #409eff);
+ color: #fff;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
justify-content: center;
+ font-size: 13px;
+ font-weight: 700;
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.4);
+ }
+
+ .node-avatar-section {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin-bottom: 12px;
+ margin-top: 4px;
+ }
+
+ .node-avatar {
+ width: 56px;
+ height: 56px;
+ border-radius: 50%;
+ background: var(--el-fill-color, #f0f2f5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 8px;
+ color: var(--el-text-color-placeholder, #c0c4cc);
+ transition: all 0.3s ease;
+ }
+
+ .node-avatar.has-user {
+ color: #fff;
+ font-size: 22px;
+ font-weight: 600;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ }
+
+ .node-level {
+ font-size: 12px;
+ color: var(--el-text-color-secondary, #909399);
+ font-weight: 500;
+ }
+
+ .node-select-section {
+ margin-bottom: 12px;
+ }
+
+ .node-select-section :deep(.el-select) {
+ width: 100%;
+ }
+
+ .node-actions {
+ display: flex;
+ justify-content: center;
+ gap: 8px;
+ padding-top: 12px;
+ border-top: 1px solid var(--el-border-color-light, #ebeef5);
+ }
+
+ .action-btn {
+ transition: all 0.2s;
+ }
+
+ .action-btn:hover:not(:disabled) {
+ transform: scale(1.1);
}
.arrow-connector {
- width: 100%;
- height: 30px;
- flex-direction: row;
- justify-content: center;
+ display: flex;
+ align-items: center;
+ width: 50px;
+ position: relative;
}
.arrow-line {
- width: 2px;
- height: 30px;
+ flex: 1;
+ height: 2px;
+ background: var(--el-border-color, #c0c4cc);
}
.arrow-icon {
- right: auto;
- top: auto;
- bottom: -5px;
- transform: rotate(90deg);
+ color: var(--el-text-color-placeholder, #c0c4cc);
+ font-size: 14px;
+ margin-left: -2px;
}
+ /* 鏂板鑺傜偣鏍峰紡 */
.add-node-item {
- width: 100%;
- justify-content: center;
- margin-top: 10px;
+ display: flex;
+ align-items: center;
}
- .add-node-item .arrow-connector {
- display: none;
+ .add-node-card {
+ width: 140px;
+ height: 200px;
+ border: 2px dashed var(--el-border-color, #c0c4cc);
+ border-radius: 12px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 12px;
+ cursor: pointer;
+ transition: all 0.3s ease;
+ background: var(--el-fill-color-light, #fafbfc);
+ flex-shrink: 0;
+ margin-left: 0;
}
-}
+
+ .add-node-card:hover {
+ border-color: var(--el-color-primary, #409eff);
+ background: var(--el-color-primary-light-9, #f0f7ff);
+ transform: translateY(-2px);
+ box-shadow: 0 4px 16px rgba(64, 158, 255, 0.15);
+ }
+
+ .add-icon-wrapper {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ background: var(--el-color-primary, #409eff);
+ color: #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
+ transition: all 0.3s ease;
+ }
+
+ .add-node-card:hover .add-icon-wrapper {
+ transform: scale(1.1);
+ box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4);
+ }
+
+ .add-text {
+ font-size: 14px;
+ color: var(--el-text-color-regular, #606266);
+ font-weight: 500;
+ }
+
+ .add-node-card:hover .add-text {
+ color: var(--el-color-primary, #409eff);
+ }
+
+ /* 绌虹姸鎬� */
+ .empty-state {
+ padding: 50px 20px;
+ }
+
+ .empty-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 16px;
+ }
+
+ .empty-icon-wrapper {
+ width: 80px;
+ height: 80px;
+ border-radius: 50%;
+ background: var(--el-fill-color-light, #f5f7fa);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 8px;
+ }
+
+ .empty-text {
+ font-size: 16px;
+ font-weight: 600;
+ color: var(--el-text-color-regular, #606266);
+ }
+
+ .empty-subtext {
+ font-size: 13px;
+ color: var(--el-text-color-secondary, #909399);
+ }
+
+ .empty-add-btn {
+ margin-top: 8px;
+ padding: 12px 28px;
+ }
+
+ /* 搴曢儴鎻愮ず */
+ .bottom-tips {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ padding: 12px 20px;
+ background: var(--el-fill-color-light, #f5f7fa);
+ border-radius: 8px;
+ color: var(--el-text-color-regular, #606266);
+ font-size: 13px;
+ }
+
+ .bottom-tips .el-icon {
+ color: var(--el-color-primary, #409eff);
+ font-size: 16px;
+ }
+
+ @media (max-width: 768px) {
+ .type-tabs {
+ padding: 3px;
+ }
+
+ .type-tab {
+ padding: 6px 10px;
+ font-size: 12px;
+ }
+
+ .tab-name {
+ font-size: 12px;
+ }
+
+ .flow-container {
+ flex-wrap: wrap;
+ justify-content: center;
+ }
+
+ .arrow-connector {
+ width: 100%;
+ height: 30px;
+ flex-direction: row;
+ justify-content: center;
+ }
+
+ .arrow-line {
+ width: 2px;
+ height: 30px;
+ }
+
+ .arrow-icon {
+ right: auto;
+ top: auto;
+ bottom: -5px;
+ transform: rotate(90deg);
+ }
+
+ .add-node-item {
+ width: 100%;
+ justify-content: center;
+ margin-top: 10px;
+ }
+
+ .add-node-item .arrow-connector {
+ display: none;
+ }
+ }
</style>
diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index 158916c..066624a 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -2,130 +2,154 @@
<div class="app-container">
<!-- 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� -->
<div class="type-tabs">
- <div
- v-for="type in approveTypes"
- :key="type.value"
- class="type-tab"
- :class="{ active: activeTab === type.value }"
- @click="activeTab = type.value; handleTabChange()"
- >
- <el-icon :size="14" :style="{ color: activeTab === type.value ? type.color : '#909399' }">
+ <div v-for="type in approveTypes"
+ :key="type.value"
+ class="type-tab"
+ :class="{ active: activeTab === type.value }"
+ @click="activeTab = type.value; handleTabChange()">
+ <el-icon :size="14"
+ :style="{ color: activeTab === type.value ? type.color : '#909399' }">
<component :is="type.icon" />
</el-icon>
<span class="tab-name">{{ type.label }}</span>
</div>
</div>
-
<!-- 鎼滅储鍜屾搷浣滃尯鍩� -->
- <el-card class="search-card" shadow="never">
+ <el-card class="search-card"
+ shadow="never">
<div class="search-content">
<div class="search-filters">
<div class="filter-item">
<span class="filter-label">娴佺▼缂栧彿</span>
- <el-input
- v-model="searchForm.approveId"
- placeholder="璇疯緭鍏ユ祦绋嬬紪鍙�"
- clearable
- :prefix-icon="Search"
- @keyup.enter="handleQuery"
- class="search-input"
- />
+ <el-input v-model="searchForm.approveId"
+ placeholder="璇疯緭鍏ユ祦绋嬬紪鍙�"
+ clearable
+ :prefix-icon="Search"
+ @keyup.enter="handleQuery"
+ class="search-input" />
</div>
<div class="filter-item">
<span class="filter-label">瀹℃壒鐘舵��</span>
- <el-select
- v-model="searchForm.approveStatus"
- clearable
- @change="handleQuery"
- placeholder="璇烽�夋嫨鐘舵��"
- class="search-select"
- >
- <el-option label="寰呭鏍�" :value="0">
- <el-tag size="small" type="warning">寰呭鏍�</el-tag>
+ <el-select v-model="searchForm.approveStatus"
+ clearable
+ @change="handleQuery"
+ placeholder="璇烽�夋嫨鐘舵��"
+ class="search-select">
+ <el-option label="寰呭鏍�"
+ :value="0">
+ <el-tag size="small"
+ type="warning">寰呭鏍�</el-tag>
</el-option>
- <el-option label="瀹℃牳涓�" :value="1">
- <el-tag size="small" type="primary">瀹℃牳涓�</el-tag>
+ <el-option label="瀹℃牳涓�"
+ :value="1">
+ <el-tag size="small"
+ type="primary">瀹℃牳涓�</el-tag>
</el-option>
- <el-option label="瀹℃牳瀹屾垚" :value="2">
- <el-tag size="small" type="success">瀹℃牳瀹屾垚</el-tag>
+ <el-option label="瀹℃牳瀹屾垚"
+ :value="2">
+ <el-tag size="small"
+ type="success">瀹℃牳瀹屾垚</el-tag>
</el-option>
- <el-option label="瀹℃牳鏈�氳繃" :value="3">
- <el-tag size="small" type="danger">瀹℃牳鏈�氳繃</el-tag>
+ <el-option label="瀹℃牳鏈�氳繃"
+ :value="3">
+ <el-tag size="small"
+ type="danger">瀹℃牳鏈�氳繃</el-tag>
</el-option>
- <el-option label="宸查噸鏂版彁浜�" :value="4">
- <el-tag size="small" type="info">宸查噸鏂版彁浜�</el-tag>
+ <el-option label="宸查噸鏂版彁浜�"
+ :value="4">
+ <el-tag size="small"
+ type="info">宸查噸鏂版彁浜�</el-tag>
</el-option>
</el-select>
</div>
- <el-button type="primary" @click="handleQuery" class="search-btn">
- <el-icon><Search /></el-icon>
+ <el-button type="primary"
+ @click="handleQuery"
+ class="search-btn">
+ <el-icon>
+ <Search />
+ </el-icon>
鎼滅储
</el-button>
- <el-button @click="resetQuery" class="reset-btn">
- <el-icon><RefreshRight /></el-icon>
+ <el-button @click="resetQuery"
+ class="reset-btn">
+ <el-icon>
+ <RefreshRight />
+ </el-icon>
閲嶇疆
</el-button>
</div>
<div class="search-actions">
- <el-button
- type="primary"
- @click="openForm('add')"
- v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
- class="action-btn primary"
- >
- <el-icon><Plus /></el-icon>
+ <el-button type="primary"
+ @click="openForm('add')"
+ v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+ class="action-btn primary">
+ <el-icon>
+ <Plus />
+ </el-icon>
鏂板
</el-button>
- <el-button @click="handleOut" class="action-btn">
- <el-icon><Download /></el-icon>
+ <el-button @click="handleOut"
+ class="action-btn">
+ <el-icon>
+ <Download />
+ </el-icon>
瀵煎嚭
</el-button>
- <el-button
- type="danger"
- plain
- @click="handleDelete"
- v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
- class="action-btn danger"
- >
- <el-icon><Delete /></el-icon>
+ <el-button type="danger"
+ plain
+ @click="handleDelete"
+ v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+ class="action-btn danger">
+ <el-icon>
+ <Delete />
+ </el-icon>
鍒犻櫎
</el-button>
</div>
</div>
</el-card>
-
<!-- 鏁版嵁琛ㄦ牸 -->
- <el-card class="table-card" shadow="never" v-loading="tableLoading">
+ <el-card class="table-card"
+ shadow="never"
+ v-loading="tableLoading">
<template #header>
<div class="table-header">
<div class="table-title">
- <div class="type-tag" :style="{ backgroundColor: currentTypeInfo.color }">
- <el-icon color="#fff" :size="16"><component :is="currentTypeInfo.icon" /></el-icon>
+ <div class="type-tag"
+ :style="{ backgroundColor: currentTypeInfo.color }">
+ <el-icon color="#fff"
+ :size="16">
+ <component :is="currentTypeInfo.icon" />
+ </el-icon>
</div>
<span>{{ currentTypeInfo.label }}鍒楄〃</span>
- <el-tag type="info" size="small" effect="plain" class="count-tag">
+ <el-tag type="info"
+ size="small"
+ effect="plain"
+ class="count-tag">
鍏� {{ page.total }} 鏉�
</el-tag>
</div>
</div>
</template>
- <PIMTable
- rowKey="id"
- :column="tableColumnCopy"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- class="custom-table"
- ></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumnCopy"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"
+ class="custom-table"></PIMTable>
</el-card>
-
<!-- 寮圭獥缁勪欢 -->
- <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="currentApproveType"></info-form-dia>
- <approval-dia ref="approvalDia" @close="handleQuery" :approveType="currentApproveType"></approval-dia>
+ <info-form-dia ref="infoFormDia"
+ @close="handleQuery"
+ :approveType="currentApproveType"></info-form-dia>
+ <approval-dia ref="approvalDia"
+ @close="handleQuery"
+ :approveType="currentApproveType"></approval-dia>
<FileList v-if="fileDialogVisible"
v-model:visible="fileDialogVisible"
record-type="approve_process"
@@ -134,362 +158,392 @@
</template>
<script setup>
-import { Search, Plus, Delete, Download, RefreshRight, DocumentChecked } from "@element-plus/icons-vue";
-import {onMounted, ref, computed, reactive, toRefs, nextTick, getCurrentInstance, defineAsyncComponent} from "vue";
-import {ElMessageBox} from "element-plus";
-import { useRoute } from 'vue-router';
-import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
-import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
-import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js";
-import useUserStore from "@/store/modules/user";
-const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
+ import {
+ Search,
+ Plus,
+ Delete,
+ Download,
+ RefreshRight,
+ DocumentChecked,
+ } from "@element-plus/icons-vue";
+ import {
+ onMounted,
+ ref,
+ computed,
+ reactive,
+ toRefs,
+ nextTick,
+ getCurrentInstance,
+ defineAsyncComponent,
+ } from "vue";
+ import { ElMessageBox } from "element-plus";
+ import { useRoute } from "vue-router";
+ import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
+ import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
+ import {
+ approveProcessDelete,
+ approveProcessListPage,
+ } from "@/api/collaborativeApproval/approvalProcess.js";
+ import useUserStore from "@/store/modules/user";
+ const FileList = defineAsyncComponent(() =>
+ import("@/components/Dialog/FileList.vue")
+ );
-const userStore = useUserStore();
-const route = useRoute();
+ const userStore = useUserStore();
+ const route = useRoute();
-// 褰撳墠閫変腑鐨勬爣绛鹃〉锛岄粯璁や负鍏嚭绠$悊
-const activeTab = ref('1');
+ // 褰撳墠閫変腑鐨勬爣绛鹃〉锛岄粯璁や负璇峰亣绠$悊
+ const activeTab = ref("2");
-// 鍚勭被鍨嬫暟閲忕粺璁�
-const typeCounts = ref({});
+ // 鍚勭被鍨嬫暟閲忕粺璁�
+ const typeCounts = ref({});
-// 瀹℃壒绫诲瀷閰嶇疆
-const approveTypes = [
- { value: '1', label: '鍏嚭绠$悊', icon: 'Suitcase', color: '#409EFF' },
- { value: '2', label: '璇峰亣绠$悊', icon: 'Calendar', color: '#67C23A' },
- { value: '3', label: '鍑哄樊绠$悊', icon: 'Location', color: '#E6A23C' },
- { value: '4', label: '鎶ラ攢绠$悊', icon: 'Money', color: '#F56C6C' },
- { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
- { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
- { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
-];
+ // 瀹℃壒绫诲瀷閰嶇疆
+ const approveTypes = [
+ // { value: '1', label: '鍏嚭绠$悊', icon: 'Suitcase', color: '#409EFF' },
+ { value: "2", label: "璇峰亣绠$悊", icon: "Calendar", color: "#67C23A" },
+ { value: "3", label: "鍑哄樊绠$悊", icon: "Location", color: "#E6A23C" },
+ // { value: '4', label: '鎶ラ攢绠$悊', icon: 'Money', color: '#F56C6C' },
+ // { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
+ // { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
+ // { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
+ ];
-// 褰撳墠瀹℃壒绫诲瀷淇℃伅
-const currentTypeInfo = computed(() => {
- return approveTypes.find(t => t.value === activeTab.value) || approveTypes[0];
-});
+ // 褰撳墠瀹℃壒绫诲瀷淇℃伅
+ const currentTypeInfo = computed(() => {
+ return approveTypes.find(t => t.value === activeTab.value) || approveTypes[0];
+ });
-// 鑾峰彇绫诲瀷鏁伴噺
-const getTypeCount = (value) => {
- return typeCounts.value[value] || 0;
-};
+ // 鑾峰彇绫诲瀷鏁伴噺
+ const getTypeCount = value => {
+ return typeCounts.value[value] || 0;
+ };
-// 褰撳墠瀹℃壒绫诲瀷锛屾牴鎹�変腑鐨勬爣绛鹃〉璁$畻
-const currentApproveType = computed(() => {
- return Number(activeTab.value);
-});
+ // 褰撳墠瀹℃壒绫诲瀷锛屾牴鎹�変腑鐨勬爣绛鹃〉璁$畻
+ const currentApproveType = computed(() => {
+ return Number(activeTab.value);
+ });
-// 鏍囩椤靛垏鎹㈠鐞�
-const handleTabChange = () => {
- // 鍒囨崲鏍囩椤垫椂閲嶇疆鎼滅储鏉′欢鍜屽垎椤碉紝骞堕噸鏂板姞杞芥暟鎹�
- searchForm.value.approveId = '';
- searchForm.value.approveStatus = '';
- page.current = 1;
- getList();
-};
+ // 鏍囩椤靛垏鎹㈠鐞�
+ const handleTabChange = () => {
+ // 鍒囨崲鏍囩椤垫椂閲嶇疆鎼滅储鏉′欢鍜屽垎椤碉紝骞堕噸鏂板姞杞芥暟鎹�
+ searchForm.value.approveId = "";
+ searchForm.value.approveStatus = "";
+ page.current = 1;
+ getList();
+ };
+ const data = reactive({
+ searchForm: {
+ approveId: "",
+ approveStatus: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
-const data = reactive({
- searchForm: {
- approveId: "",
- approveStatus: "",
- },
-});
-const { searchForm } = toRefs(data);
+ // 閲嶇疆鎼滅储
+ const resetQuery = () => {
+ searchForm.value.approveId = "";
+ searchForm.value.approveStatus = "";
+ handleQuery();
+ };
-// 閲嶇疆鎼滅储
-const resetQuery = () => {
- searchForm.value.approveId = '';
- searchForm.value.approveStatus = '';
- handleQuery();
-};
+ // 鍔ㄦ�佽〃鏍煎垪閰嶇疆锛屾牴鎹鎵圭被鍨嬬敓鎴愬垪
+ const tableColumnCopy = computed(() => {
+ const isLeaveType = currentApproveType.value === 2; // 璇峰亣绠$悊
+ const isBusinessTripType = currentApproveType.value === 3; // 鍑哄樊绠$悊
+ const isReimburseType = currentApproveType.value === 4; // 鎶ラ攢绠$悊
+ const isQuotationType = currentApproveType.value === 6; // 鎶ヤ环瀹℃壒
+ const isPurchaseType = currentApproveType.value === 5; // 閲囪喘瀹℃壒
-// 鍔ㄦ�佽〃鏍煎垪閰嶇疆锛屾牴鎹鎵圭被鍨嬬敓鎴愬垪
-const tableColumnCopy = computed(() => {
- const isLeaveType = currentApproveType.value === 2; // 璇峰亣绠$悊
- const isBusinessTripType = currentApproveType.value === 3; // 鍑哄樊绠$悊
- const isReimburseType = currentApproveType.value === 4; // 鎶ラ攢绠$悊
- const isQuotationType = currentApproveType.value === 6; // 鎶ヤ环瀹℃壒
- const isPurchaseType = currentApproveType.value === 5; // 閲囪喘瀹℃壒
-
- // 鍩虹鍒楅厤缃�
- const baseColumns = [
- {
- label: "瀹℃壒鐘舵��",
- prop: "approveStatus",
- dataType: "tag",
- width: 100,
- formatData: (params) => {
- if (params == 0) {
- return "寰呭鏍�";
- } else if (params == 1) {
- return "瀹℃牳涓�";
- } else if (params == 2) {
- return "瀹℃牳瀹屾垚";
- } else if (params == 4) {
- return "宸查噸鏂版彁浜�";
- } else {
- return '涓嶉�氳繃';
- }
+ // 鍩虹鍒楅厤缃�
+ const baseColumns = [
+ {
+ label: "瀹℃壒鐘舵��",
+ prop: "approveStatus",
+ dataType: "tag",
+ width: 100,
+ formatData: params => {
+ if (params == 0) {
+ return "寰呭鏍�";
+ } else if (params == 1) {
+ return "瀹℃牳涓�";
+ } else if (params == 2) {
+ return "瀹℃牳瀹屾垚";
+ } else if (params == 4) {
+ return "宸查噸鏂版彁浜�";
+ } else {
+ return "涓嶉�氳繃";
+ }
+ },
+ formatType: params => {
+ if (params == 0) {
+ return "warning";
+ } else if (params == 1) {
+ return "primary";
+ } else if (params == 2) {
+ return "success";
+ } else if (params == 4) {
+ return "info";
+ } else {
+ return "danger";
+ }
+ },
},
- formatType: (params) => {
- if (params == 0) {
- return "warning";
- } else if (params == 1) {
- return "primary";
- } else if (params == 2) {
- return "success";
- } else if (params == 4) {
- return "info";
- } else {
- return 'danger';
- }
+ {
+ label: "娴佺▼缂栧彿",
+ prop: "approveId",
+ width: 170,
},
- },
- {
- label: "娴佺▼缂栧彿",
- prop: "approveId",
- width: 170
- },
- {
- label: "鐢宠閮ㄩ棬",
- prop: "approveDeptName",
- width: 220
- },
- {
- label: isQuotationType ? "鎶ヤ环鍗曞彿" : isPurchaseType ? "閲囪喘鍚堝悓鍙�" : "瀹℃壒浜嬬敱",
- prop: "approveReason",
- },
- {
- label: "鐢宠浜�",
- prop: "approveUserName",
- width: 120
+ {
+ label: "鐢宠閮ㄩ棬",
+ prop: "approveDeptName",
+ width: 220,
+ },
+ {
+ label: isQuotationType
+ ? "鎶ヤ环鍗曞彿"
+ : isPurchaseType
+ ? "閲囪喘鍚堝悓鍙�"
+ : "瀹℃壒浜嬬敱",
+ prop: "approveReason",
+ },
+ {
+ label: "鐢宠浜�",
+ prop: "approveUserName",
+ width: 120,
+ },
+ ];
+
+ // 閲戦鍒楋紙浠呮姤閿�绠$悊鏄剧ず锛�
+ if (isReimburseType) {
+ baseColumns.push({
+ label: "閲戦锛堝厓锛�",
+ prop: "price",
+ width: 120,
+ });
}
- ];
-
- // 閲戦鍒楋紙浠呮姤閿�绠$悊鏄剧ず锛�
- if (isReimburseType) {
+
+ // 璇峰亣绠$悊锛氬紑濮嬫棩鏈� / 缁撴潫鏃ユ湡
+ if (isLeaveType) {
+ baseColumns.push(
+ { label: "寮�濮嬫棩鏈�", prop: "startDate", width: 120 },
+ { label: "缁撴潫鏃ユ湡", prop: "endDate", width: 120 }
+ );
+ }
+
+ // 鍑哄樊绠$悊锛氬紑濮嬫椂闂� / 缁撴潫鏃堕棿锛堜笉鍚锛�
+ if (isBusinessTripType) {
+ baseColumns.push(
+ {
+ label: "寮�濮嬫椂闂�",
+ prop: "startDateTime",
+ width: 180,
+ formatData: val => (val ? val.substring(0, 16) : ""),
+ },
+ {
+ label: "缁撴潫鏃堕棿",
+ prop: "endDateTime",
+ width: 180,
+ formatData: val => (val ? val.substring(0, 16) : ""),
+ }
+ );
+ }
+
+ // 褰撳墠瀹℃壒浜哄垪
baseColumns.push({
- label: "閲戦锛堝厓锛�",
- prop: "price",
- width: 120
+ label: "褰撳墠瀹℃壒浜�",
+ prop: "approveUserCurrentName",
+ width: 120,
});
- }
- // 璇峰亣绠$悊锛氬紑濮嬫棩鏈� / 缁撴潫鏃ユ湡
- if (isLeaveType) {
- baseColumns.push(
- { label: "寮�濮嬫棩鏈�", prop: "startDate", width: 120 },
- { label: "缁撴潫鏃ユ湡", prop: "endDate", width: 120 }
- );
- }
-
- // 鍑哄樊绠$悊锛氬紑濮嬫椂闂� / 缁撴潫鏃堕棿锛堜笉鍚锛�
- if (isBusinessTripType) {
- baseColumns.push(
+ // 鐢宠鏃堕棿 - 鎵�鏈夌被鍨嬮兘鏄剧ず
+ baseColumns.push({
+ label: "鐢宠鏃堕棿",
+ prop: "approveTime",
+ width: 180,
+ });
+
+ // 瀹℃壒鏃堕棿 - 鎵�鏈夌被鍨嬮兘鏄剧ず
+ baseColumns.push({
+ label: "瀹℃壒鏃堕棿",
+ prop: "approveOverTime",
+ width: 180,
+ });
+
+ // 鎿嶄綔鍒�
+ const actionOperations = [
{
- label: "寮�濮嬫椂闂�",
- prop: "startDateTime",
- width: 180,
- formatData: (val) => val ? val.substring(0, 16) : ''
+ name: "缂栬緫",
+ type: "text",
+ clickFun: row => {
+ openForm("edit", row);
+ },
+ disabled: row =>
+ currentApproveType.value === 5 ||
+ currentApproveType.value === 6 ||
+ currentApproveType.value === 7 ||
+ row.approveStatus == 2 ||
+ row.approveStatus == 1 ||
+ row.approveStatus == 4,
},
{
- label: "缁撴潫鏃堕棿",
- prop: "endDateTime",
- width: 180,
- formatData: (val) => val ? val.substring(0, 16) : ''
- }
- );
- }
-
- // 褰撳墠瀹℃壒浜哄垪
- baseColumns.push({
- label: "褰撳墠瀹℃壒浜�",
- prop: "approveUserCurrentName",
- width: 120
- });
+ name: "瀹℃牳",
+ type: "text",
+ clickFun: row => {
+ openApprovalDia("approval", row);
+ },
+ disabled: row =>
+ row.approveUserCurrentId == null ||
+ row.approveStatus == 2 ||
+ row.approveStatus == 3 ||
+ row.approveStatus == 4 ||
+ row.approveUserCurrentId !== userStore.id,
+ },
+ {
+ name: "璇︽儏",
+ type: "text",
+ clickFun: row => {
+ openApprovalDia("view", row);
+ },
+ },
+ ];
- // 鐢宠鏃堕棿 - 鎵�鏈夌被鍨嬮兘鏄剧ず
- baseColumns.push({
- label: "鐢宠鏃堕棿",
- prop: "approveTime",
- width: 180,
- });
+ // 鎶ヤ环瀹℃壒锛堢被鍨� 6锛変笉灞曠ず"闄勪欢"鎿嶄綔
+ if (!isQuotationType) {
+ actionOperations.push({
+ name: "闄勪欢",
+ type: "text",
+ clickFun: row => {
+ openFilesFormDia(row);
+ },
+ });
+ }
- // 瀹℃壒鏃堕棿 - 鎵�鏈夌被鍨嬮兘鏄剧ず
- baseColumns.push({
- label: "瀹℃壒鏃堕棿",
- prop: "approveOverTime",
- width: 180,
- });
-
- // 鎿嶄綔鍒�
- const actionOperations = [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
- disabled: (row) =>
- currentApproveType.value === 5 ||
- currentApproveType.value === 6 ||
- currentApproveType.value === 7 ||
- row.approveStatus == 2 ||
- row.approveStatus == 1 ||
- row.approveStatus == 4
- },
- {
- name: "瀹℃牳",
- type: "text",
- clickFun: (row) => {
- openApprovalDia("approval", row);
- },
- disabled: (row) =>
- row.approveUserCurrentId == null ||
- row.approveStatus == 2 ||
- row.approveStatus == 3 ||
- row.approveStatus == 4 ||
- row.approveUserCurrentId !== userStore.id
- },
- {
- name: "璇︽儏",
- type: "text",
- clickFun: (row) => {
- openApprovalDia("view", row);
- },
- },
- ];
-
- // 鎶ヤ环瀹℃壒锛堢被鍨� 6锛変笉灞曠ず"闄勪欢"鎿嶄綔
- if (!isQuotationType) {
- actionOperations.push({
- name: "闄勪欢",
- type: "text",
- clickFun: (row) => {
- openFilesFormDia(row);
- },
+ baseColumns.push({
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 230,
+ operation: actionOperations,
});
- }
- baseColumns.push({
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: "right",
- width: 230,
- operation: actionOperations,
+ return baseColumns;
});
-
- return baseColumns;
-});
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0
-});
-const infoFormDia = ref()
-const approvalDia = ref()
-const { proxy } = getCurrentInstance()
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const infoFormDia = ref();
+ const approvalDia = ref();
+ const { proxy } = getCurrentInstance();
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
-// 鎵撳紑闄勪欢寮圭獥
-const recordId =ref(0)
-const fileDialogVisible = ref(false)
+ // 鎵撳紑闄勪欢寮圭獥
+ const recordId = ref(0);
+ const fileDialogVisible = ref(false);
-// 鎵撳紑闄勪欢寮规
-const openFilesFormDia = async (row) => {
- recordId.value = row.id
- fileDialogVisible.value = true
-}
+ // 鎵撳紑闄勪欢寮规
+ const openFilesFormDia = async row => {
+ recordId.value = row.id;
+ fileDialogVisible.value = true;
+ };
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- approveProcessListPage({...page, ...searchForm.value, approveType: currentApproveType.value}).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- // 鏇存柊褰撳墠绫诲瀷鏁伴噺
- typeCounts.value[activeTab.value] = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 瀵煎嚭
-const handleOut = () => {
- const type = currentApproveType.value
- const urlMap = {
- 0: "/approveProcess/exportZero",
- 1: "/approveProcess/exportOne",
- 2: "/approveProcess/exportTwo",
- 3: "/approveProcess/exportThree",
- 4: "/approveProcess/exportFour",
- 5: "/approveProcess/exportFive",
- 6: "/approveProcess/exportSix",
- 7: "/approveProcess/exportSeven",
- }
- const url = urlMap[type] || urlMap[0]
- const nameMap = {
- 0: "鍗忓悓瀹℃壒绠$悊琛�",
- 1: "鍏嚭绠$悊瀹℃壒琛�",
- 2: "璇峰亣绠$悊瀹℃壒琛�",
- 3: "鍑哄樊绠$悊瀹℃壒琛�",
- 4: "鎶ラ攢绠$悊瀹℃壒琛�",
- 5: "閲囪喘鐢宠瀹℃壒琛�",
- 6: "鎶ヤ环瀹℃壒琛�",
- 7: "鍙戣揣瀹℃壒琛�",
- }
- const fileName = nameMap[type] || nameMap[0]
- proxy.download(url, {}, `${fileName}.xlsx`)
-}
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ approveProcessListPage({
+ ...page,
+ ...searchForm.value,
+ approveType: currentApproveType.value,
+ })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ // 鏇存柊褰撳墠绫诲瀷鏁伴噺
+ typeCounts.value[activeTab.value] = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ const type = currentApproveType.value;
+ const urlMap = {
+ 0: "/approveProcess/exportZero",
+ 1: "/approveProcess/exportOne",
+ 2: "/approveProcess/exportTwo",
+ 3: "/approveProcess/exportThree",
+ 4: "/approveProcess/exportFour",
+ 5: "/approveProcess/exportFive",
+ 6: "/approveProcess/exportSix",
+ 7: "/approveProcess/exportSeven",
+ };
+ const url = urlMap[type] || urlMap[0];
+ const nameMap = {
+ 0: "鍗忓悓瀹℃壒绠$悊琛�",
+ 1: "鍏嚭绠$悊瀹℃壒琛�",
+ 2: "璇峰亣绠$悊瀹℃壒琛�",
+ 3: "鍑哄樊绠$悊瀹℃壒琛�",
+ 4: "鎶ラ攢绠$悊瀹℃壒琛�",
+ 5: "閲囪喘鐢宠瀹℃壒琛�",
+ 6: "鎶ヤ环瀹℃壒琛�",
+ 7: "鍙戣揣瀹℃壒琛�",
+ };
+ const fileName = nameMap[type] || nameMap[0];
+ proxy.download(url, {}, `${fileName}.xlsx`);
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
-// 鎵撳紑鏂板銆佺紪杈戝脊妗�
-const openForm = (type, row) => {
- nextTick(() => {
- infoFormDia.value?.openDialog(type, row)
- })
-};
-// 鎵撳紑鏂板妫�楠屽脊妗�
-const openApprovalDia = (type, row) => {
- nextTick(() => {
- approvalDia.value?.openDialog(type, row)
- })
-};
+ // 鎵撳紑鏂板銆佺紪杈戝脊妗�
+ const openForm = (type, row) => {
+ nextTick(() => {
+ infoFormDia.value?.openDialog(type, row);
+ });
+ };
+ // 鎵撳紑鏂板妫�楠屽脊妗�
+ const openApprovalDia = (type, row) => {
+ nextTick(() => {
+ approvalDia.value?.openDialog(type, row);
+ });
+ };
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map((item) => item.approveId);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ // 鍒犻櫎
+ const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map(item => item.approveId);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
- approveProcessDelete(ids).then((res) => {
+ approveProcessDelete(ids).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
});
@@ -497,278 +551,278 @@
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-onMounted(() => {
- // 鏍规嵁URL鍙傛暟璁剧疆鏍囩椤靛拰鏌ヨ鏉′欢
- const approveType = route.query.approveType;
- const approveId = route.query.approveId;
-
- if (approveType) {
- // 璁剧疆鏍囩椤碉紙approveType 瀵瑰簲 activeTab 鐨� name锛�
- activeTab.value = String(approveType);
- }
-
- if (approveId) {
- // 璁剧疆娴佺▼缂栧彿鏌ヨ鏉′欢
- searchForm.value.approveId = String(approveId);
- }
-
- // 鏌ヨ鍒楄〃
- getList();
-});
+ };
+ onMounted(() => {
+ // 鏍规嵁URL鍙傛暟璁剧疆鏍囩椤靛拰鏌ヨ鏉′欢
+ const approveType = route.query.approveType;
+ const approveId = route.query.approveId;
+
+ if (approveType) {
+ // 璁剧疆鏍囩椤碉紙approveType 瀵瑰簲 activeTab 鐨� name锛�
+ activeTab.value = String(approveType);
+ }
+
+ if (approveId) {
+ // 璁剧疆娴佺▼缂栧彿鏌ヨ鏉′欢
+ searchForm.value.approveId = String(approveId);
+ }
+
+ // 鏌ヨ鍒楄〃
+ getList();
+ });
</script>
<style scoped>
-.page-header {
- margin-bottom: 20px;
-}
+ .page-header {
+ margin-bottom: 20px;
+ }
-.header-title {
- display: flex;
- align-items: center;
- gap: 12px;
-}
+ .header-title {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ }
-.title-icon {
- font-size: 28px;
- color: var(--el-color-primary, #409EFF);
-}
+ .title-icon {
+ font-size: 28px;
+ color: var(--el-color-primary, #409eff);
+ }
-.header-text {
- display: flex;
- flex-direction: column;
- gap: 4px;
-}
-
-.main-title {
- font-size: 20px;
- font-weight: 600;
- color: var(--el-text-color-primary, #303133);
-}
-
-.sub-title {
- font-size: 13px;
- color: var(--el-text-color-secondary, #909399);
-}
-
-/* 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� */
-.type-tabs {
- display: flex;
- gap: 4px;
- margin-bottom: 16px;
- padding: 4px;
- background: var(--el-fill-color-light, #f5f7fa);
- border-radius: 8px;
- overflow-x: auto;
-}
-
-.type-tab {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 8px 14px;
- border-radius: 6px;
- cursor: pointer;
- transition: all 0.2s ease;
- white-space: nowrap;
- font-size: 13px;
- color: var(--el-text-color-regular, #606266);
-}
-
-.type-tab:hover {
- background: var(--el-color-primary-light-9, rgba(64, 158, 255, 0.1));
- color: var(--el-color-primary, #409EFF);
-}
-
-.type-tab.active {
- background: var(--el-bg-color, #fff);
- color: var(--el-color-primary, #409EFF);
- font-weight: 600;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
-}
-
-.tab-name {
- font-size: 13px;
-}
-
-.tab-count {
- min-width: 16px;
- height: 16px;
- padding: 0 5px;
- background: var(--el-color-success, #67C23A);
- color: #fff;
- border-radius: 8px;
- font-size: 11px;
- font-weight: 600;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-/* 鎼滅储鍗$墖 */
-.search-card {
- margin-bottom: 16px;
- border-radius: 12px;
-}
-
-:deep(.el-card__body) {
- padding: 20px;
-}
-
-.search-content {
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-wrap: wrap;
- gap: 16px;
-}
-
-.search-filters {
- display: flex;
- align-items: center;
- gap: 16px;
- flex-wrap: wrap;
-}
-
-.filter-item {
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.filter-label {
- font-size: 14px;
- color: var(--el-text-color-regular, #606266);
- font-weight: 500;
- white-space: nowrap;
-}
-
-.search-input,
-.search-select {
- width: 200px;
-}
-
-.search-btn {
- display: flex;
- align-items: center;
- gap: 4px;
-}
-
-.reset-btn {
- display: flex;
- align-items: center;
- gap: 4px;
-}
-
-.search-actions {
- display: flex;
- gap: 10px;
-}
-
-.action-btn {
- display: flex;
- align-items: center;
- gap: 4px;
-}
-
-.action-btn.primary {
- background: var(--el-color-primary, #409EFF);
- border: none;
-}
-
-.action-btn.danger {
- transition: all 0.3s;
-}
-
-.action-btn.danger:hover {
- background: #f56c6c;
- color: #fff;
-}
-
-/* 琛ㄦ牸鍗$墖 */
-.table-card {
- border-radius: 12px;
-}
-
-:deep(.el-card__header) {
- padding: 16px 20px;
- border-bottom: 1px solid var(--el-border-color-light, #ebeef5);
-}
-
-.table-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.table-title {
- display: flex;
- align-items: center;
- gap: 12px;
- font-size: 16px;
- font-weight: 600;
- color: var(--el-text-color-primary, #303133);
-}
-
-.type-tag {
- width: 32px;
- height: 32px;
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.count-tag {
- margin-left: 8px;
-}
-
-.custom-table {
- margin-top: 8px;
-}
-
-/* 鍝嶅簲寮� */
-@media (max-width: 1200px) {
- .search-content {
+ .header-text {
+ display: flex;
flex-direction: column;
- align-items: stretch;
+ gap: 4px;
}
- .search-filters {
- justify-content: flex-start;
+ .main-title {
+ font-size: 20px;
+ font-weight: 600;
+ color: var(--el-text-color-primary, #303133);
}
- .search-actions {
- justify-content: flex-end;
+ .sub-title {
+ font-size: 13px;
+ color: var(--el-text-color-secondary, #909399);
}
-}
-@media (max-width: 768px) {
+ /* 瀹℃壒绫诲瀷鍒囨崲 - 绱у噾鏍囩寮� */
.type-tabs {
- padding: 3px;
+ display: flex;
+ gap: 4px;
+ margin-bottom: 16px;
+ padding: 4px;
+ background: var(--el-fill-color-light, #f5f7fa);
+ border-radius: 8px;
+ overflow-x: auto;
}
.type-tab {
- padding: 6px 10px;
- font-size: 12px;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 8px 14px;
+ border-radius: 6px;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ white-space: nowrap;
+ font-size: 13px;
+ color: var(--el-text-color-regular, #606266);
+ }
+
+ .type-tab:hover {
+ background: var(--el-color-primary-light-9, rgba(64, 158, 255, 0.1));
+ color: var(--el-color-primary, #409eff);
+ }
+
+ .type-tab.active {
+ background: var(--el-bg-color, #fff);
+ color: var(--el-color-primary, #409eff);
+ font-weight: 600;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.tab-name {
- font-size: 12px;
+ font-size: 13px;
+ }
+
+ .tab-count {
+ min-width: 16px;
+ height: 16px;
+ padding: 0 5px;
+ background: var(--el-color-success, #67c23a);
+ color: #fff;
+ border-radius: 8px;
+ font-size: 11px;
+ font-weight: 600;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ /* 鎼滅储鍗$墖 */
+ .search-card {
+ margin-bottom: 16px;
+ border-radius: 12px;
+ }
+
+ :deep(.el-card__body) {
+ padding: 20px;
+ }
+
+ .search-content {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 16px;
}
.search-filters {
- flex-direction: column;
- align-items: stretch;
+ display: flex;
+ align-items: center;
+ gap: 16px;
+ flex-wrap: wrap;
}
.filter-item {
- width: 100%;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+
+ .filter-label {
+ font-size: 14px;
+ color: var(--el-text-color-regular, #606266);
+ font-weight: 500;
+ white-space: nowrap;
}
.search-input,
.search-select {
- width: 100%;
+ width: 200px;
}
-}
+
+ .search-btn {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ }
+
+ .reset-btn {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ }
+
+ .search-actions {
+ display: flex;
+ gap: 10px;
+ }
+
+ .action-btn {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ }
+
+ .action-btn.primary {
+ background: var(--el-color-primary, #409eff);
+ border: none;
+ }
+
+ .action-btn.danger {
+ transition: all 0.3s;
+ }
+
+ .action-btn.danger:hover {
+ background: #f56c6c;
+ color: #fff;
+ }
+
+ /* 琛ㄦ牸鍗$墖 */
+ .table-card {
+ border-radius: 12px;
+ }
+
+ :deep(.el-card__header) {
+ padding: 16px 20px;
+ border-bottom: 1px solid var(--el-border-color-light, #ebeef5);
+ }
+
+ .table-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .table-title {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ font-size: 16px;
+ font-weight: 600;
+ color: var(--el-text-color-primary, #303133);
+ }
+
+ .type-tag {
+ width: 32px;
+ height: 32px;
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .count-tag {
+ margin-left: 8px;
+ }
+
+ .custom-table {
+ margin-top: 8px;
+ }
+
+ /* 鍝嶅簲寮� */
+ @media (max-width: 1200px) {
+ .search-content {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .search-filters {
+ justify-content: flex-start;
+ }
+
+ .search-actions {
+ justify-content: flex-end;
+ }
+ }
+
+ @media (max-width: 768px) {
+ .type-tabs {
+ padding: 3px;
+ }
+
+ .type-tab {
+ padding: 6px 10px;
+ font-size: 12px;
+ }
+
+ .tab-name {
+ font-size: 12px;
+ }
+
+ .search-filters {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .filter-item {
+ width: 100%;
+ }
+
+ .search-input,
+ .search-select {
+ width: 100%;
+ }
+ }
</style>
diff --git a/src/views/customerPortal/myReport/index.vue b/src/views/customerPortal/myReport/index.vue
new file mode 100644
index 0000000..ba2665a
--- /dev/null
+++ b/src/views/customerPortal/myReport/index.vue
@@ -0,0 +1,166 @@
+<template>
+ <div class="app-container">
+ <el-alert title="璇蜂笂浼犳渶杩戜笁涓勾搴︾殑璐㈠姟鎶ヨ〃锛屼笂浼犲悗鍙殢鏃堕噸鏂颁笂浼犺鐩栥�傛彁浜ゅ悗鍙湪鏈〉瀹炴椂鏌ョ湅瀹℃壒缁撴灉锛岃閫�鍥炴椂璇锋寜閫�鍥炲師鍥犱慨鏀瑰悗閲嶆柊鎻愪氦銆�"
+ type="info"
+ show-icon
+ :closable="false" />
+ <div class="year-cards">
+ <el-card v-for="item in yearRows"
+ :key="item.reportYear"
+ shadow="never"
+ class="year-card">
+ <div class="year-header">
+ <span class="year-title">{{ item.reportYear }} 骞村害</span>
+ <span v-if="item.id">
+ <el-tag type="success"
+ size="small"
+ v-if="item.auditStatus === 1">宸查�氳繃</el-tag>
+ <el-tag type="danger"
+ size="small"
+ v-else-if="item.auditStatus === 2">宸查��鍥�</el-tag>
+ <el-tag type="warning"
+ size="small"
+ v-else>寰呭鎵�</el-tag>
+ </span>
+ <el-tag v-else
+ type="info"
+ size="small">鏈笂浼�</el-tag>
+ </div>
+ <el-alert v-if="item.auditStatus === 2 && item.auditRemark"
+ :title="'閫�鍥炲師鍥狅細' + item.auditRemark"
+ type="error"
+ show-icon
+ :closable="false"
+ class="reject-tip" />
+ <div class="year-body">
+ <div class="year-row">
+ <span class="year-label">鎶ヨ〃鍚嶇О</span>
+ <el-input v-model="item.reportName"
+ :placeholder="'渚嬪锛�' + item.reportYear + '骞村害璐㈠姟鎶ヨ〃'"
+ clearable />
+ </div>
+ <div class="year-row">
+ <span class="year-label">鎶ヨ〃闄勪欢</span>
+ <FileUpload v-model="item.reportFiles"
+ :limit="5"
+ :file-size="20"
+ :file-type="['pdf', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'zip', 'rar']" />
+ </div>
+ <div class="year-footer">
+ <span v-if="item.updateTime"
+ class="year-tip">鏈�杩戜笂浼狅細{{ item.updateTime }}</span>
+ <el-button type="primary"
+ :loading="savingYear === item.reportYear"
+ @click="save(item)">淇濆瓨涓婁紶</el-button>
+ </div>
+ </div>
+ </el-card>
+ </div>
+ </div>
+</template>
+
+<script setup>
+ import { onMounted, ref, getCurrentInstance } from "vue";
+ import FileUpload from "@/components/FileUpload/index.vue";
+ import { listMyFinancialReport, saveCustomerFinancialReport } from "@/api/basicData/customerFinancialReport";
+
+ const { proxy } = getCurrentInstance();
+ const nowYear = new Date().getFullYear();
+ const yearRows = ref([]);
+ const savingYear = ref(0);
+
+ // 鏈�杩戜笁骞达紝鏈笂浼犵殑骞村害鐣欑┖寰呬笂浼�
+ const buildYears = rows => {
+ const map = new Map(rows.map(item => [item.reportYear, item]));
+ return [nowYear, nowYear - 1, nowYear - 2].map(year => {
+ const row = map.get(year);
+ return row
+ ? { ...row }
+ : { reportYear: year, reportName: "", reportFiles: "" };
+ });
+ };
+
+ const load = () => {
+ listMyFinancialReport().then(res => {
+ yearRows.value = buildYears(res.data || []);
+ });
+ };
+
+ const save = item => {
+ if (!item.reportFiles) {
+ proxy.$modal.msgWarning("璇蜂笂浼犺储鍔℃姤琛ㄩ檮浠�");
+ return;
+ }
+ savingYear.value = item.reportYear;
+ saveCustomerFinancialReport({
+ reportYear: item.reportYear,
+ reportName: item.reportName,
+ reportFiles: item.reportFiles,
+ }).then(() => {
+ proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+ load();
+ }).finally(() => {
+ savingYear.value = 0;
+ });
+ };
+
+ onMounted(load);
+</script>
+
+<style scoped>
+ .year-cards {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16px;
+ margin-top: 16px;
+ }
+
+ .year-card {
+ flex: 1 1 320px;
+ min-width: 320px;
+ }
+
+ .reject-tip {
+ margin-bottom: 12px;
+ }
+
+ .year-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 12px;
+ }
+
+ .year-title {
+ font-size: 16px;
+ font-weight: 600;
+ }
+
+ .year-row {
+ display: flex;
+ align-items: flex-start;
+ margin-bottom: 12px;
+ }
+
+ .year-label {
+ width: 80px;
+ flex: 0 0 80px;
+ color: #606266;
+ line-height: 32px;
+ }
+
+ .year-row > :not(.year-label) {
+ flex: 1;
+ }
+
+ .year-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ .year-tip {
+ color: #909399;
+ font-size: 12px;
+ }
+</style>
diff --git a/src/views/customerPortal/mySubmission/index.vue b/src/views/customerPortal/mySubmission/index.vue
new file mode 100644
index 0000000..6b5525d
--- /dev/null
+++ b/src/views/customerPortal/mySubmission/index.vue
@@ -0,0 +1,58 @@
+<template>
+ <div class="app-container">
+ <el-alert title="璇锋寜骞村害鎻愪氦鏈�杩戜笁骞寸殑璐㈠姟鎶ュ憡锛涘凡鍙戝竷鐨勭敵鎶ョ粨鏋滃彲鐩存帴鏌ョ湅鍜屼笅杞姐��" type="info" show-icon :closable="false" />
+ <el-form :inline="true" :model="query" class="query-form">
+ <el-form-item label="骞村害"><el-select v-model="query.reportYear" clearable style="width: 140px"><el-option v-for="year in years" :key="year" :label="year" :value="year" /></el-select></el-form-item>
+ <el-form-item label="鐘舵��"><el-select v-model="query.status" clearable style="width: 140px"><el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
+ <el-form-item><el-button type="primary" @click="load">鏌ヨ</el-button><el-button type="success" @click="openSubmit">鎻愪氦鏉愭枡</el-button></el-form-item>
+ </el-form>
+ <el-table v-loading="loading" :data="rows" border>
+ <el-table-column prop="reportYear" label="鎶ュ憡骞村害" width="110" align="center" />
+ <el-table-column prop="reportName" label="鏉愭枡鍚嶇О" min-width="180" />
+ <el-table-column label="鏉愭枡闄勪欢" min-width="200"><template #default="scope"><FileUpload v-model="scope.row.materialFiles" disabled /></template></el-table-column>
+ <el-table-column label="鐘舵��" width="110" align="center"><template #default="scope"><el-tag :type="statusType(scope.row.status)">{{ statusText(scope.row.status) }}</el-tag></template></el-table-column>
+ <el-table-column prop="reviewRemark" label="瀹℃牳鎰忚" min-width="180" show-overflow-tooltip />
+ <el-table-column prop="resultText" label="鍙戝竷缁撴灉" min-width="220" show-overflow-tooltip />
+ <el-table-column label="缁撴灉闄勪欢" min-width="200"><template #default="scope"><FileUpload v-if="scope.row.resultFiles" v-model="scope.row.resultFiles" disabled /><span v-else>-</span></template></el-table-column>
+ <el-table-column prop="publishTime" label="鍙戝竷鏃堕棿" width="170" />
+ <el-table-column label="鎿嶄綔" width="110" fixed="right"><template #default="scope"><el-button v-if="[0, 3].includes(scope.row.status)" link type="primary" @click="openSubmit(scope.row)">{{ scope.row.status === 3 ? "閲嶆柊鎻愪氦" : "淇敼" }}</el-button><span v-else>-</span></template></el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" v-model:page="query.current" v-model:limit="query.size" @pagination="load" />
+
+ <el-dialog v-model="visible" title="鎻愪氦骞村害璐㈠姟鏉愭枡" width="620px" append-to-body destroy-on-close :close-on-click-modal="false" :before-close="beforeClose" @closed="resetDialog">
+ <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
+ <el-form-item label="鎶ュ憡骞村害" prop="reportYear"><el-select v-model="form.reportYear" style="width:100%"><el-option v-for="year in years" :key="year" :label="year" :value="year" /></el-select></el-form-item>
+ <el-form-item label="鏉愭枡鍚嶇О" prop="reportName"><el-input v-model="form.reportName" placeholder="渚嬪锛�2025骞村害瀹¤鎶ュ憡" /></el-form-item>
+ <el-form-item label="鏉愭枡闄勪欢" prop="materialFiles"><FileUpload v-model="form.materialFiles" :limit="8" :file-size="20" /></el-form-item>
+ </el-form>
+ <template #footer><el-button :disabled="saving" @click="closeDialog">鍙栨秷</el-button><el-button type="primary" :loading="saving" @click="save">纭鎻愪氦</el-button></template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import FileUpload from "@/components/FileUpload/index.vue";
+import { listMySubmissions, submitCustomerMaterial } from "@/api/customerPortal/submission";
+
+const { proxy } = getCurrentInstance();
+const nowYear = new Date().getFullYear();
+const years = [nowYear, nowYear - 1, nowYear - 2];
+const statusOptions = [{ label: "寰呭鏍�", value: 0 }, { label: "澶勭悊涓�", value: 1 }, { label: "宸插彂甯�", value: 2 }, { label: "宸查��鍥�", value: 3 }];
+const query = reactive({ current: 1, size: 10, reportYear: undefined, status: undefined });
+const rows = ref([]); const total = ref(0); const loading = ref(false); const visible = ref(false); const saving = ref(false); const formRef = ref();
+const form = reactive({ reportYear: nowYear, reportName: "", materialFiles: "" });
+const initialForm = ref("");
+const rules = { reportYear: [{ required: true, message: "璇烽�夋嫨鎶ュ憡骞村害", trigger: "change" }], reportName: [{ required: true, message: "璇疯緭鍏ユ潗鏂欏悕绉�", trigger: "blur" }], materialFiles: [{ required: true, message: "璇蜂笂浼犳潗鏂欓檮浠�", trigger: "change" }] };
+const statusText = (value) => statusOptions.find(item => item.value === value)?.label || "鏈煡";
+const statusType = (value) => ({ 0: "warning", 1: "primary", 2: "success", 3: "danger" }[value] || "info");
+async function load() { loading.value = true; try { const res = await listMySubmissions(query); rows.value = res.data?.records || []; total.value = Number(res.data?.total || 0); } finally { loading.value = false; } }
+function formSnapshot() { return JSON.stringify({ reportYear: form.reportYear, reportName: form.reportName, materialFiles: form.materialFiles }); }
+function openSubmit(row) { Object.assign(form, { reportYear: row?.reportYear || nowYear, reportName: row?.reportName || "", materialFiles: row?.materialFiles || "" }); initialForm.value = formSnapshot(); visible.value = true; nextTick(() => formRef.value?.clearValidate()); }
+function resetDialog() { formRef.value?.clearValidate(); Object.assign(form, { reportYear: nowYear, reportName: "", materialFiles: "" }); initialForm.value = ""; }
+function beforeClose(done) { if (saving.value) return; if (formSnapshot() === initialForm.value) return done(); proxy.$modal.confirm("褰撳墠濉啓鍐呭灏氭湭鎻愪氦锛岀‘瀹氬叧闂悧锛�").then(done).catch(() => {}); }
+function closeDialog() { beforeClose(() => { visible.value = false; }); }
+async function save() { await formRef.value.validate(); if (!form.materialFiles) return proxy.$modal.msgError("璇蜂笂浼犳潗鏂欓檮浠�"); saving.value = true; try { await submitCustomerMaterial({ ...form }); proxy.$modal.msgSuccess("鏉愭枡鎻愪氦鎴愬姛"); initialForm.value = formSnapshot(); visible.value = false; await load(); } finally { saving.value = false; } }
+onMounted(load);
+</script>
+
+<style scoped>.query-form { margin-top: 18px; }</style>
diff --git a/src/views/customerPortal/submissionManagement/index.vue b/src/views/customerPortal/submissionManagement/index.vue
new file mode 100644
index 0000000..9701eeb
--- /dev/null
+++ b/src/views/customerPortal/submissionManagement/index.vue
@@ -0,0 +1,57 @@
+<template>
+ <div class="app-container">
+ <el-form :inline="true" :model="query">
+ <el-form-item label="瀹㈡埛"><el-select v-model="query.customerId" filterable clearable style="width:240px"><el-option v-for="item in customers" :key="item.id" :label="item.customerName" :value="item.id" /></el-select></el-form-item>
+ <el-form-item label="骞村害"><el-input-number v-model="query.reportYear" :controls="false" /></el-form-item>
+ <el-form-item label="鐘舵��"><el-select v-model="query.status" clearable style="width:140px"><el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.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>
+ <el-table v-loading="loading" :data="rows" border>
+ <el-table-column prop="customerName" label="瀹㈡埛鍚嶇О" min-width="200" />
+ <el-table-column prop="reportYear" label="骞村害" width="90" align="center" />
+ <el-table-column prop="reportName" label="鏉愭枡鍚嶇О" min-width="170" />
+ <el-table-column label="鏉愭枡闄勪欢" min-width="210"><template #default="scope"><FileUpload v-model="scope.row.materialFiles" disabled /></template></el-table-column>
+ <el-table-column label="鐘舵��" width="100"><template #default="scope"><el-tag :type="statusType(scope.row.status)">{{ statusText(scope.row.status) }}</el-tag></template></el-table-column>
+ <el-table-column prop="submitUserName" label="鎻愪氦浜�" width="110" />
+ <el-table-column prop="createTime" label="鎻愪氦鏃堕棿" width="170" />
+ <el-table-column prop="reviewRemark" label="瀹℃牳鎰忚" min-width="160" show-overflow-tooltip />
+ <el-table-column prop="resultText" label="鍙戝竷缁撴灉" min-width="180" show-overflow-tooltip />
+ <el-table-column label="缁撴灉闄勪欢" min-width="180"><template #default="scope"><FileUpload v-if="scope.row.resultFiles" v-model="scope.row.resultFiles" disabled /><span v-else>-</span></template></el-table-column>
+ <el-table-column label="鎿嶄綔" width="160" fixed="right"><template #default="scope"><el-button v-if="scope.row.status === 0" link type="primary" @click="openReview(scope.row, 1)">鍙楃悊</el-button><el-button v-if="scope.row.status === 1" link type="success" @click="openReview(scope.row, 2)">鍙戝竷</el-button><el-button v-if="[0, 1].includes(scope.row.status)" link type="danger" @click="openReview(scope.row, 3)">閫�鍥�</el-button><span v-if="[2, 3].includes(scope.row.status)">-</span></template></el-table-column>
+ </el-table>
+ <pagination v-show="total > 0" :total="total" v-model:page="query.current" v-model:limit="query.size" @pagination="load" />
+ <el-dialog v-model="visible" :title="dialogTitle" width="620px" append-to-body destroy-on-close :close-on-click-modal="false" @closed="resetReviewForm">
+ <el-alert :title="`${currentRow.customerName || ''} 路 ${currentRow.reportYear || ''}骞村害 路 ${currentRow.reportName || ''}`" type="info" :closable="false" class="review-summary" />
+ <el-form ref="reviewFormRef" :model="form" label-width="100px">
+ <el-form-item label="缁撴灉璇存槑" v-if="form.status === 2"><el-input v-model="form.resultText" type="textarea" :rows="4" /></el-form-item>
+ <el-form-item label="缁撴灉闄勪欢" v-if="form.status === 2"><FileUpload v-model="form.resultFiles" :limit="8" :file-size="20" /></el-form-item>
+ <el-form-item label="瀹℃牳鎰忚"><el-input v-model="form.reviewRemark" type="textarea" :rows="3" /></el-form-item>
+ </el-form>
+ <template #footer><el-button :disabled="saving" @click="visible=false">鍙栨秷</el-button><el-button type="primary" :loading="saving" @click="saveReview">纭畾</el-button></template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+import FileUpload from "@/components/FileUpload/index.vue";
+import { listSubmissionManage, reviewSubmission } from "@/api/customerPortal/submission";
+import { listCustomer } from "@/api/basicData/customer";
+const { proxy } = getCurrentInstance();
+const statusOptions = [{ label: "寰呭鏍�", value: 0 }, { label: "澶勭悊涓�", value: 1 }, { label: "宸插彂甯�", value: 2 }, { label: "宸查��鍥�", value: 3 }];
+const query = reactive({ current: 1, size: 10, customerId: undefined, reportYear: undefined, status: undefined });
+const rows = ref([]); const customers = ref([]); const total = ref(0); const loading = ref(false); const visible = ref(false); const saving = ref(false);
+const form = reactive({ id: null, status: 1, resultText: "", resultFiles: "", reviewRemark: "" });
+const currentRow = ref({}); const reviewFormRef = ref();
+const dialogTitle = computed(() => form.status === 2 ? "鍙戝竷鐢虫姤缁撴灉" : form.status === 3 ? "閫�鍥炴潗鏂�" : "鍙楃悊鏉愭枡");
+const statusText = (value) => statusOptions.find(item => item.value === value)?.label || "鏈煡";
+const statusType = (value) => ({ 0: "warning", 1: "primary", 2: "success", 3: "danger" }[value] || "info");
+async function load() { loading.value = true; try { const res = await listSubmissionManage(query); rows.value = res.data?.records || []; total.value = Number(res.data?.total || 0); } finally { loading.value = false; } }
+function handleQuery() { query.current = 1; load(); }
+function resetQuery() { Object.assign(query, { current: 1, size: query.size, customerId: undefined, reportYear: undefined, status: undefined }); load(); }
+function openReview(row, status) { currentRow.value = row; Object.assign(form, { id: row.id, status, resultText: status === 2 ? row.resultText || "" : "", resultFiles: status === 2 ? row.resultFiles || "" : "", reviewRemark: "" }); visible.value = true; }
+function resetReviewForm() { currentRow.value = {}; Object.assign(form, { id: null, status: 1, resultText: "", resultFiles: "", reviewRemark: "" }); reviewFormRef.value?.clearValidate(); }
+async function saveReview() { if (form.status === 2 && !form.resultText.trim() && !form.resultFiles) return proxy.$modal.msgError("璇峰~鍐欑粨鏋滆鏄庢垨涓婁紶缁撴灉闄勪欢"); if (form.status === 3 && !form.reviewRemark.trim()) return proxy.$modal.msgError("璇疯緭鍏ラ��鍥炲師鍥�"); saving.value = true; try { await reviewSubmission({ ...form }); proxy.$modal.msgSuccess(form.status === 1 ? "鏉愭枡宸插彈鐞�" : form.status === 2 ? "缁撴灉鍙戝竷鎴愬姛" : "鏉愭枡宸查��鍥�"); visible.value = false; await load(); } finally { saving.value = false; } }
+onMounted(async () => { const res = await listCustomer({ current: -1, size: -1 }); customers.value = res.data?.records || []; await load(); });
+</script>
+
+<style scoped>.review-summary { margin-bottom: 18px; }</style>
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 702764a..dac74be 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -1,2066 +1,427 @@
<template>
<div class="app-container">
<div class="search_form">
- <div>
- <el-form :model="searchForm"
- :inline="true">
- <el-form-item label="渚涘簲鍟嗗悕绉帮細">
- <el-input v-model="searchForm.supplierName"
- placeholder="璇疯緭鍏�"
- clearable
- prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="閲囪喘鍚堝悓鍙凤細">
- <el-input v-model="searchForm.purchaseContractNumber"
- style="width: 240px"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search" />
- </el-form-item>
- <el-form-item label="閿�鍞悎鍚屽彿锛�">
- <el-input v-model="searchForm.salesContractNo"
- placeholder="璇疯緭鍏�"
- clearable
- prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О锛�">
- <el-input v-model="searchForm.projectName"
- placeholder="璇疯緭鍏�"
- clearable
- prefix-icon="Search"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="褰曞叆鏃ユ湡锛�">
- <el-date-picker v-model="searchForm.entryDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="daterange"
- placeholder="璇烽�夋嫨"
- clearable
- @change="changeDaterange" />
- </el-form-item>
- <el-form-item label="鍏ュ簱鐘舵�侊細">
- <el-select v-model="searchForm.stockInStatus"
- placeholder="璇烽�夋嫨"
- clearable
- style="width: 240px"
- @change="handleQuery">
- <el-option label="寰呭叆搴�"
- value="寰呭叆搴�" />
- <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-form-item>
- </el-form>
- </div>
+ <el-form :model="query" :inline="true">
+ <el-form-item label="鏀嚭鏃ユ湡锛�">
+ <el-date-picker
+ v-model="dateRange"
+ type="daterange"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ clearable
+ @change="handleDateChange"
+ />
+ </el-form-item>
+ <el-form-item label="浠樻鏂瑰紡锛�">
+ <el-select
+ v-model="query.paymentMethod"
+ placeholder="璇烽�夋嫨"
+ clearable
+ style="width: 180px"
+ @change="handleQuery"
+ >
+ <el-option v-for="item in paymentMethodOptions" :key="item" :label="item" :value="item" />
+ </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 style="display: flex;justify-content: flex-end;margin-bottom: 20px;">
-<!-- <el-button type="success"-->
-<!-- plain-->
-<!-- @click="handleBatchGenerate">鎵归噺鐢熸垚鏁版嵁</el-button>-->
- <el-button type="primary"
- @click="openForm('add')">鏂板鍙拌处</el-button>
- <el-button type="primary"
- plain
- @click="handleImport">瀵煎叆</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger"
- plain
- @click="handleDelete">鍒犻櫎
- </el-button>
+ <div class="toolbar">
+ <el-button type="primary" @click="openForm('add')">鏂板</el-button>
+ <el-button @click="handleExport">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="handleDelete">鎵归噺鍒犻櫎</el-button>
</div>
- <el-table :data="tableData"
- border
- v-loading="tableLoading"
- @selection-change="handleSelectionChange"
- :expand-row-keys="expandedRowKeys"
- :row-key="(row) => row.id"
- show-summary
- :summary-method="summarizeMainTable"
- @expand-change="expandChange"
- height="calc(100vh - 21.5em)">
- <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-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="unit" />
- <el-table-column label="鍏ュ簱瀹℃牳鐘舵��"
- prop="stockInApprovalStatus"
- width="120">
- <template #default="scope">
- <el-tag :type="getStockInApprovalStatusType(scope.row.stockInApprovalStatus)"
- size="small">
- {{ scope.row.stockInApprovalStatus || '--' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="鏁伴噺"
- prop="quantity" />
- <el-table-column label="閿�鍞彂璐ф暟閲�"
- prop="shippedQuantity" />
- <el-table-column label="鍙敤鏁伴噺"
- prop="availableQuality" />
- <el-table-column label="閫�璐ф暟閲�"
- prop="returnQuantity" />
- <el-table-column label="绋庣巼(%)"
- prop="taxRate" />
- <el-table-column label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber" />
- <el-table-column label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber" />
- </el-table>
- </template>
+
+ <el-table
+ v-loading="loading"
+ :data="tableData"
+ border
+ height="calc(100vh - 21.5em)"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column label="搴忓彿" type="index" width="60" align="center" />
+ <el-table-column label="閲囪喘鏃ユ湡" prop="purchaseDate" width="120" align="center" />
+ <el-table-column label="閲戦" prop="amount" min-width="120" align="right">
+ <template #default="{ row }">{{ formatAmount(row.amount) }}</template>
</el-table-column>
- <el-table-column align="center"
- label="搴忓彿"
- type="index"
- width="60" />
- <el-table-column label="閲囪喘鍚堝悓鍙�"
- prop="purchaseContractNumber"
- width="160"
- show-overflow-tooltip />
- <el-table-column label="閿�鍞悎鍚屽彿"
- prop="salesContractNo"
- width="160"
- show-overflow-tooltip />
- <el-table-column label="渚涘簲鍟嗗悕绉�"
- prop="supplierName"
- width="160"
- show-overflow-tooltip />
- <el-table-column label="椤圭洰鍚嶇О"
- prop="projectName"
- width="320"
- show-overflow-tooltip />
- <el-table-column label="瀹℃壒鐘舵��"
- prop="approvalStatus"
- width="100"
- show-overflow-tooltip>
- <template #default="scope">
- <el-tag :type="getApprovalStatusType(scope.row.approvalStatus)"
- size="small">
- {{ approvalStatusText[scope.row.approvalStatus] || '鏈煡鐘舵��' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱鐘舵��"
- prop="stockInStatus"
- width="100"
- show-overflow-tooltip>
- <template #default="scope">
- <el-tag :type="getStockInStatusType(scope.row.stockInStatus)"
- size="small">
- {{ scope.row.stockInStatus || '--' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="绛捐鏃ユ湡"
- prop="executionDate"
- width="100"
- show-overflow-tooltip />
- <el-table-column label="浠樻鏂瑰紡"
- width="100"
- prop="paymentMethod"
- show-overflow-tooltip />
- <el-table-column label="鍚堝悓閲戦(鍏�)"
- prop="contractAmount"
- width="200"
- show-overflow-tooltip
- :formatter="formattedNumber" />
- <el-table-column label="瀹為檯鍚堝悓閲戦(鍏�)"
- prop="netContractAmount"
- width="200"
- show-overflow-tooltip
- :formatter="(_, __, cellValue) => formatMoney(cellValue)" />
- <el-table-column label="褰曞叆浜�"
- prop="recorderName"
- width="120"
- show-overflow-tooltip />
- <el-table-column label="褰曞叆鏃ユ湡"
- prop="entryDate"
- width="100"
- show-overflow-tooltip />
- <el-table-column label="澶囨敞"
- prop="remarks"
- width="200"
- show-overflow-tooltip />
- <el-table-column fixed="right"
- label="鎿嶄綔"
- width="120"
- align="center">
- <template #default="scope">
- <el-button link
- type="primary"
- @click="openForm('edit', scope.row)"
- :disabled="scope.row.approvalStatus === 3">缂栬緫
- </el-button>
- <el-button link
- type="primary"
- @click="openFileDialog(scope.row)">闄勪欢</el-button>
+ <el-table-column label="閲囪喘鐗╁搧" prop="purchaseGoods" min-width="180" show-overflow-tooltip />
+ <el-table-column label="鍙戠エ鍙风爜" prop="invoiceNumber" min-width="150" show-overflow-tooltip />
+ <el-table-column label="澶囨敞" prop="remark" min-width="160" show-overflow-tooltip />
+ <el-table-column label="褰曞叆浜�" prop="recorderName" width="120" align="center" />
+ <el-table-column label="褰曞叆鏃ユ湡" prop="entryDate" width="120" align="center" />
+ <el-table-column label="鎿嶄綔" width="140" fixed="right" align="center">
+ <template #default="{ row }">
+ <el-button link type="primary" @click="openForm('edit', row)">缂栬緫</el-button>
+ <el-button link type="primary" @click="openFileDialog(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" />
+
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="query.current"
+ :limit="query.size"
+ @pagination="paginationChange"
+ />
</div>
- <FormDialog v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板閲囪喘鍙拌处椤甸潰' : '缂栬緫閲囪喘鍙拌处椤甸潰'"
- :width="'70%'"
- :operation-type="operationType"
- @close="closeDia"
- @confirm="submitForm"
- @cancel="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="purchaseContractNumber">
- <el-input v-model="form.purchaseContractNumber"
- placeholder="璇疯緭鍏�"
- clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="閿�鍞悎鍚屽彿锛�"
- prop="salesLedgerId">
- <el-select v-model="form.salesLedgerId"
- placeholder="璇烽�夋嫨"
- filterable
- clearable
- @change="salesLedgerChange">
- <el-option v-for="item in salesContractList"
- :key="item.id"
- :label="item.salesContractNo"
- :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="渚涘簲鍟嗗悕绉帮細"
- prop="supplierId">
- <el-select v-model="form.supplierId"
- placeholder="璇烽�夋嫨"
- filterable
- clearable>
- <el-option v-for="item in supplierList"
- :key="item.id"
- :label="item.supplierName"
- :value="item.id">{{ item.supplierName + '---' + item.supplierType }}
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="椤圭洰鍚嶇О"
- prop="projectName">
- <el-input v-model="form.projectName"
- placeholder="璇疯緭鍏�"
- clearable />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="浠樻鏂瑰紡">
- <el-input v-model="form.paymentMethod"
- placeholder="璇疯緭鍏�"
- clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="绛捐鏃ユ湡锛�"
- prop="executionDate">
- <el-date-picker style="width: 100%"
- v-model="form.executionDate"
- 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="recorderId">
- <el-select v-model="form.recorderId"
- placeholder="璇烽�夋嫨"
- clearable
- filterable>
- <el-option v-for="item in userList"
- :key="item.userId"
- :label="item.nickName"
- :value="item.userId" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="褰曞叆鏃ユ湡锛�"
- prop="entryDate">
- <el-date-picker style="width: 100%"
- v-model="form.entryDate"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- type="date"
- placeholder="璇烽�夋嫨"
- clearable />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-form-item label="浜у搧淇℃伅锛�"
- prop="entryDate">
- <el-button type="primary"
- @click="openProductForm('add')">娣诲姞
- </el-button>
- <el-button plain
- type="danger"
- @click="deleteProduct">鍒犻櫎
- </el-button>
- </el-form-item>
- <div class="select-button-group"
- style="width: 500px; margin: 20px 0;"
- v-if="operationType === 'add'">
- <el-select filterable
- allow-create
- :reserve-keyword="true"
- :default-first-option="false"
- clearable
- v-model="templateName"
- :input-value="filterInputValue"
- @filter-change="onTemplateFilterChange"
- @change="onTemplateChange"
- @focus="getTemplateList"
- style="width: 500px;"
- placeholder="璇烽�夋嫨妯$増鎴栬�呰緭鍏ユ柊鐨勬ā鐗堝悕绉板悗閫夋嫨"
- class="no-arrow-select">
- <el-option v-for="item in templateList"
- :key="item.id || item.value"
- :label="item.templateName"
- :value="item.templateName">
- <div style="display: flex; justify-content: space-between; align-items: center;">
- <span>{{ item.templateName }}</span>
- <el-icon v-if="item.id"
- class="delete-icon"
- @click.stop="handleDeleteTemplate(item)"
- style="cursor: pointer; color: #f56c6c; font-size: 14px; margin-left: 8px;">
- <Delete />
- </el-icon>
- </div>
- </el-option>
- </el-select>
- <!-- 鎸夐挳锛氫笌 Select 楂樺害鍖归厤锛屽幓鎺夊乏渚ц竟妗嗭紝鏃犵紳琛旀帴 -->
- <el-button size="small"
- style="height: 32px;margin-left: 8px;"
- @click="handleButtonClick"
- :disabled="!templateName || templateName.trim() === '' || (!currentTemplateId && isTemplateNameDuplicate)">
- 淇濆瓨
- </el-button>
- </div>
- </el-row>
- <el-table :data="productData"
- border
- @selection-change="productSelected"
- show-summary
- :summary-method="summarizeProTable">
- <el-table-column align="center"
- type="selection"
- width="55" />
- <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="unit"
- width="70" />
- <el-table-column label="鏁伴噺"
- prop="quantity"
- width="70" />
- <el-table-column label="搴撳瓨棰勮鏁伴噺"
- prop="warnNum"
- width="120"
- show-overflow-tooltip />
- <el-table-column label="绋庣巼(%)"
- prop="taxRate"
- width="80" />
- <el-table-column label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
- width="150" />
- <el-table-column label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
- width="150" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- width="150" />
- <el-table-column label="鏄惁璐ㄦ"
- prop="isChecked"
- width="150">
- <template #default="scope">
- <el-tag :type="scope.row.isChecked ? 'success' : 'info'">
- {{ scope.row.isChecked ? '鏄�' : '鍚�' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="鍏ュ簱瀹℃牳鐘舵��"
- prop="stockInApprovalStatus"
- width="120">
- <template #default="scope">
- <el-tag :type="getStockInApprovalStatusType(scope.row.stockInApprovalStatus)"
- size="small">
- {{ scope.row.stockInApprovalStatus || '--' }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column fixed="right"
- label="鎿嶄綔"
- min-width="60"
- align="center">
- <template #default="scope">
- <el-button link
- type="primary"
- @click="openProductForm('edit', scope.row, scope.$index)"
- :disabled="scope.row.stockInApprovalStatus === '瀹屽叏鍏ュ簱'">缂栬緫
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="澶囨敞路锛�"
- prop="remarks">
- <el-input v-model="form.remarks"
- placeholder="璇疯緭鍏�"
- clearable
- type="textarea"
- :rows="2" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="闄勪欢鏉愭枡锛�"
- prop="purchaseLedgerFiles">
- <FileUpload v-model:file-list="fileList" />
- </el-form-item>
- </el-col>
- </el-row>
+
+ <el-dialog
+ v-model="formVisible"
+ :title="operationType === 'add' ? '鏂板閲囪喘鍙拌处' : '缂栬緫閲囪喘鍙拌处'"
+ width="640px"
+ destroy-on-close
+ append-to-body
+ >
+ <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
+ <el-form-item label="閲囪喘鏃ユ湡锛�" prop="purchaseDate">
+ <el-date-picker
+ v-model="form.purchaseDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ </el-form-item>
+ <el-form-item label="鏀嚭鏃ユ湡锛�" prop="paymentDate">
+ <el-date-picker
+ v-model="form.paymentDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ </el-form-item>
+ <el-form-item label="浠樻鏂瑰紡锛�" prop="paymentMethod">
+ <el-select
+ v-model="form.paymentMethod"
+ placeholder="璇烽�夋嫨"
+ clearable
+ filterable
+ allow-create
+ default-first-option
+ style="width: 100%"
+ >
+ <el-option v-for="item in paymentMethodOptions" :key="item" :label="item" :value="item" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閲戦(鍏�)锛�" prop="amount">
+ <el-input-number
+ v-model="form.amount"
+ :min="0"
+ :precision="2"
+ controls-position="right"
+ placeholder="璇疯緭鍏�"
+ style="width: 100%"
+ />
+ </el-form-item>
+ <el-form-item label="閲囪喘鐗╁搧锛�" prop="purchaseGoods">
+ <el-input v-model="form.purchaseGoods" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ <el-form-item label="鍙戠エ鍙风爜锛�" prop="invoiceNumber">
+ <el-input v-model="form.invoiceNumber" placeholder="璇疯緭鍏�" clearable />
+ </el-form-item>
+ <el-form-item label="澶囨敞锛�" prop="remark">
+ <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="璇疯緭鍏�" maxlength="500" show-word-limit />
+ </el-form-item>
+ <el-form-item label="闄勪欢锛�" prop="attachments">
+ <AttachmentUploadFile v-model:file-list="formFiles" :limit="10" />
+ </el-form-item>
</el-form>
- </FormDialog>
- <!-- 瀵煎叆寮圭獥 -->
- <FormDialog v-model="importUpload.open"
- :title="importUpload.title"
- :width="'600px'"
- @close="importUpload.open = false"
- @confirm="submitImportFile"
- @cancel="importUpload.open = false">
- <el-upload ref="importUploadRef"
- :limit="1"
- accept=".xlsx,.xls"
- :action="importUpload.url"
- :headers="importUpload.headers"
- :before-upload="importUpload.beforeUpload"
- :on-success="importUpload.onSuccess"
- :on-error="importUpload.onError"
- :on-progress="importUpload.onProgress"
- :on-change="importUpload.onChange"
- :auto-upload="false"
- drag>
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- 灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
- </div>
- <template #tip>
- <div class="el-upload__tip">
- 浠呮敮鎸� xls/xlsx锛屽ぇ灏忎笉瓒呰繃 10MB銆�
- <el-button link
- type="primary"
- @click="downloadTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
- </div>
- </template>
- </el-upload>
- </FormDialog>
- <FormDialog v-model="productFormVisible"
- :title="productOperationType === 'add' ? '鏂板浜у搧' : '缂栬緫浜у搧'"
- :width="'40%'"
- :operation-type="productOperationType"
- @close="closeProductDia"
- @confirm="submitProduct"
- @cancel="closeProductDia">
- <el-form :model="productForm"
- label-width="140px"
- label-position="top"
- :rules="productRules"
- ref="productFormRef">
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="浜у搧澶х被锛�"
- prop="productId">
- <el-tree-select v-model="productForm.productId"
- placeholder="璇烽�夋嫨"
- clearable
- filterable
- check-strictly
- @change="getModels"
- :data="productOptions"
- :render-after-expand="false"
- style="width: 100%" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="瑙勬牸鍨嬪彿锛�"
- prop="productModelId">
- <el-select v-model="productForm.productModelId"
- placeholder="璇烽�夋嫨"
- filterable
- clearable
- @change="getProductModel">
- <el-option v-for="item in modelOptions"
- :key="item.id"
- :label="item.model"
- :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍗曚綅锛�"
- prop="unit">
- <el-input v-model="productForm.unit"
- placeholder="璇疯緭鍏�"
- clearable />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="绋庣巼(%)锛�"
- prop="taxRate">
- <el-select v-model="productForm.taxRate"
- placeholder="璇烽�夋嫨"
- clearable
- @change="mathNum">
- <el-option v-for="dict in tax_rate"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍚◣鍗曚环(鍏�)锛�"
- prop="taxInclusiveUnitPrice">
- <el-input-number v-model="productForm.taxInclusiveUnitPrice"
- :precision="2"
- :step="0.1"
- :min="0"
- clearable
- style="width: 100%"
- @change="mathNum" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鏁伴噺锛�"
- prop="quantity">
- <el-input-number :step="0.1"
- clearable
- :precision="3"
- :min="0"
- style="width: 100%"
- v-model="productForm.quantity"
- placeholder="璇疯緭鍏�"
- @change="mathNum" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍚◣鎬讳环(鍏�)锛�"
- prop="taxInclusiveTotalPrice">
- <el-input-number v-model="productForm.taxInclusiveTotalPrice"
- :precision="2"
- :step="0.1"
- :min="0"
- clearable
- style="width: 100%"
- @change="reverseMathNum('taxInclusiveTotalPrice')" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="涓嶅惈绋庢�讳环(鍏�)锛�"
- prop="taxExclusiveTotalPrice">
- <el-input-number v-model="productForm.taxExclusiveTotalPrice"
- :precision="2"
- :step="0.1"
- :min="0"
- clearable
- style="width: 100%"
- @change="reverseMathNum('taxExclusiveTotalPrice')" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鍙戠エ绫诲瀷锛�"
- prop="invoiceType">
- <el-select v-model="productForm.invoiceType"
- placeholder="璇烽�夋嫨"
- clearable>
- <el-option label="澧炴櫘绁�"
- value="澧炴櫘绁�" />
- <el-option label="澧炰笓绁�"
- value="澧炰笓绁�" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="搴撳瓨棰勮鏁伴噺锛�"
- prop="warnNum">
- <el-input-number v-model="productForm.warnNum"
- :precision="2"
- :step="0.1"
- :min="0"
- clearable
- style="width: 100%" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="30">
- <el-col :span="12">
- <el-form-item label="鏄惁璐ㄦ锛�"
- prop="isChecked">
- <el-radio-group v-model="productForm.isChecked">
- <el-radio label="鏄�"
- :value="true" />
- <el-radio label="鍚�"
- :value="false" />
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </FormDialog>
- <FileList v-if="fileListDialogVisible"
- v-model:visible="fileListDialogVisible"
- record-type="purchase_ledger"
- :record-id="recordId" />
+ <template #footer>
+ <el-button @click="formVisible = false">鍙栨秷</el-button>
+ <el-button type="primary" :loading="saving" @click="submit">纭畾</el-button>
+ </template>
+ </el-dialog>
+
+ <FileList
+ v-if="fileDialogVisible"
+ v-model:visible="fileDialogVisible"
+ record-type="purchase_ledger_simple"
+ :record-id="currentRowId"
+ />
</div>
</template>
-<script setup>
- import FormDialog from "@/components/Dialog/FormDialog.vue";
- import FileListDialog from "@/components/Dialog/FileListDialog.vue";
- import { getToken } from "@/utils/auth";
- import pagination from "@/components/PIMTable/Pagination.vue";
- import {
- ref,
- onMounted,
- reactive,
- toRefs,
- getCurrentInstance,
- nextTick,
- } from "vue";
- import { Search, Delete } from "@element-plus/icons-vue";
- import { ElMessageBox, ElMessage } from "element-plus";
- import { userListNoPage } from "@/api/system/user.js";
- import {
- addOrUpdateSalesLedgerProduct,
- delProduct,
- delLedgerFile,
- getProductInfoByContractNo,
- } from "@/api/salesManagement/salesLedger.js";
- import {
- addOrEditPurchase,
- addPurchaseTemplate,
- updatePurchaseTemplate,
- createPurchaseNo,
- delPurchase,
- getSalesNo,
- purchaseListPage,
- productList,
- getPurchaseById,
- getOptions,
- getPurchaseTemplateList,
- delPurchaseTemplate,
- batchGeneratePurchaseInboundSteps,
- } from "@/api/procurementManagement/procurementLedger.js";
- import useFormData from "@/hooks/useFormData.js";
- const FileList = defineAsyncComponent(() =>
- import("@/components/Dialog/FileList.vue")
- );
+<script setup name="ProcurementLedger">
+import { getCurrentInstance, onMounted, reactive, ref } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import pagination from '@/components/PIMTable/Pagination.vue'
+import AttachmentUploadFile from '@/components/AttachmentUpload/file/index.vue'
+import FileList from '@/components/Dialog/FileList.vue'
+import { simpleLedgerList, simpleLedgerGet, simpleLedgerSave, simpleLedgerDelete } from '@/api/procurementManagement/procurementLedger.js'
+import { attachmentList, createAttachment } from '@/api/basicData/storageAttachment.js'
+import useUserStore from '@/store/modules/user'
- const { proxy } = getCurrentInstance();
- const { tax_rate } = proxy.useDict("tax_rate");
- const tableData = ref([]);
- const productData = ref([]);
- const selectedRows = ref([]);
- const productSelectedRows = ref([]);
- const modelOptions = ref([]);
- const userList = ref([]);
- const productOptions = ref([]);
- const salesContractList = ref([]);
- const supplierList = ref([]);
- const tableLoading = ref(false);
- const recordId = ref();
- const fileListDialogVisible = ref(false);
- const page = reactive({
- current: 1,
- size: 100,
- });
- const total = ref(0);
- const fileList = ref([]);
- import useUserStore from "@/store/modules/user";
- import { modelList, productTreeList } from "@/api/basicData/product.js";
- import dayjs from "dayjs";
- import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+const { proxy } = getCurrentInstance()
+const userStore = useUserStore()
- const userStore = useUserStore();
+const RECORD_TYPE = 'purchase_ledger_simple'
+const paymentMethodOptions = ['鐜伴噾', '閾惰杞处', '鎵垮厬姹囩エ', '鍏朵粬']
- // 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
- const approvalStatusText = {
- 1: "寰呭鏍�",
- 2: "瀹℃壒涓�",
- 3: "瀹℃壒閫氳繃",
- 4: "瀹℃壒澶辫触",
- };
+const loading = ref(false)
+const saving = ref(false)
+const total = ref(0)
+const tableData = ref([])
+const selectedRows = ref([])
+const dateRange = ref([])
- // 鑾峰彇瀹℃壒鐘舵�佹爣绛剧被鍨�
- const getApprovalStatusType = status => {
- const typeMap = {
- 1: "info", // 寰呭鏍� - 鐏拌壊
- 2: "warning", // 瀹℃壒涓� - 姗欒壊
- 3: "success", // 瀹℃壒閫氳繃 - 缁胯壊
- 4: "danger", // 瀹℃壒澶辫触 - 绾㈣壊
- };
- return typeMap[status] || "";
- };
+const query = reactive({
+ current: 1,
+ size: 10,
+ paymentDateStart: undefined,
+ paymentDateEnd: undefined,
+ paymentMethod: undefined
+})
- // 鑾峰彇鍏ュ簱鐘舵�佹爣绛剧被鍨�
- const getStockInStatusType = status => {
- const typeMap = {
- 寰呭叆搴�: "info", // 寰呭叆搴� - 鐏拌壊
- 鍏ュ簱涓�: "warning", // 鍏ュ簱涓� - 姗欒壊
- 瀹屽叏鍏ュ簱: "success", // 瀹屽叏鍏ュ簱 - 缁胯壊
- };
- return typeMap[status] || "";
- };
+const formVisible = ref(false)
+const operationType = ref('add')
+const formRef = ref()
+const formFiles = ref([])
+const fileDialogVisible = ref(false)
+const currentRowId = ref(0)
- // 鑾峰彇鍏ュ簱瀹℃牳鐘舵�佹爣绛剧被鍨�
- const getStockInApprovalStatusType = status => {
- const typeMap = {
- 寰呭叆搴�: "info", // 寰呭叆搴� - 鐏拌壊
- 鍏ュ簱涓�: "warning", // 鍏ュ簱涓� - 姗欒壊
- 瀹屽叏鍏ュ簱: "success", // 瀹屽叏鍏ュ簱 - 缁胯壊
- };
- return typeMap[status] || "";
- };
+const form = ref({
+ id: undefined,
+ purchaseDate: '',
+ paymentDate: '',
+ paymentMethod: '',
+ amount: undefined,
+ purchaseGoods: '',
+ invoiceNumber: '',
+ remark: ''
+})
- const templateName = ref("");
- const filterInputValue = ref("");
- const templateList = ref([]);
- const isTemplateNameDuplicate = ref(false); // 鏍囪妯℃澘鍚嶇О鏄惁閲嶅
- // 褰撳墠閫変腑鐨勬ā鏉縄D锛堢敤浜庡尯鍒嗘柊澧炴ā鏉胯繕鏄洿鏂版ā鏉匡級
- const currentTemplateId = ref(null);
+const rules = {
+ purchaseDate: [{ required: true, message: '璇烽�夋嫨閲囪喘鏃ユ湡', trigger: 'change' }],
+ amount: [{ required: true, message: '璇疯緭鍏ラ噾棰�', trigger: 'blur' }],
+ purchaseGoods: [{ required: true, message: '璇疯緭鍏ラ噰璐墿鍝�', trigger: 'blur' }]
+}
- // 妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶�
- const checkTemplateNameDuplicate = name => {
- if (!name || name.trim() === "") {
- isTemplateNameDuplicate.value = false;
- return false;
- }
- const isDuplicate = templateList.value.some(
- item => item.templateName === name.trim()
- );
- isTemplateNameDuplicate.value = isDuplicate;
- return isDuplicate;
- };
+function todayStr() {
+ const d = new Date()
+ const pad = n => String(n).padStart(2, '0')
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
+}
- // 闃叉姈瀹氭椂鍣�
- let duplicateCheckTimer = null;
- const onTemplateFilterChange = val => {
- filterInputValue.value = val ?? "";
- // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒
- if (duplicateCheckTimer) {
- clearTimeout(duplicateCheckTimer);
- }
- // 瀹炴椂妫�鏌ユā鏉垮悕绉版槸鍚﹂噸澶嶏紙闃叉姈澶勭悊锛岄伩鍏嶉绻佹彁绀猴級
- if (val && val.trim()) {
- duplicateCheckTimer = setTimeout(() => {
- const isDuplicate = checkTemplateNameDuplicate(val);
- if (isDuplicate) {
- ElMessage({
- message: "妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�",
- type: "warning",
- duration: 2000,
- });
- }
- }, 300); // 300ms 闃叉姈
- } else {
- isTemplateNameDuplicate.value = false;
- }
- };
+function formatAmount(val) {
+ const num = Number(val)
+ return Number.isFinite(num) ? num.toFixed(2) : '-'
+}
- // allow-create 鏃讹紝杈撳叆涓嶅瓨鍦ㄧ殑鍐呭浼氫綔涓� string 鍊艰繑鍥烇紱杩欓噷鍚屾鍥炶緭鍏ユ浠ョ‘淇濇枃瀛椾笉涓�
- const onTemplateChange = async val => {
- if (typeof val === "string") {
- filterInputValue.value = val;
- // 閫夋嫨鎴栬緭鍏ユ椂妫�鏌ラ噸澶�
- checkTemplateNameDuplicate(val);
- }
+function getList() {
+ loading.value = true
+ simpleLedgerList({ ...query })
+ .then(res => {
+ const data = res?.data || {}
+ tableData.value = data.records || []
+ total.value = Number(data.total) || 0
+ })
+ .catch(() => {
+ tableData.value = []
+ total.value = 0
+ })
+ .finally(() => {
+ loading.value = false
+ })
+}
- // 杩囨护鏁版嵁锛屾煡鎵惧尮閰嶇殑妯℃澘
- const matchedTemplate = templateList.value.find(
- item => item.templateName === val
- );
+function handleQuery() {
+ query.current = 1
+ getList()
+}
- if (matchedTemplate?.id) {
- // 璁板綍褰撳墠閫変腑鐨勬ā鏉縄D锛屽悗缁繚瀛樻椂杩涜鏇存柊鎿嶄綔
- currentTemplateId.value = matchedTemplate.id;
- // 閫変腑宸叉湁妯℃澘鏃讹紝涓嶅簲瑙嗕负鈥滄ā鏉垮悕绉伴噸澶嶅鑷翠笉鍙繚瀛樷��
- isTemplateNameDuplicate.value = false;
- // 濡傛灉鎵惧埌妯℃澘锛屽彧璧嬪�间緵搴斿晢銆侀」鐩悕绉般�佷粯娆炬柟寮忓拰浜у搧淇℃伅
- if (matchedTemplate.supplierId) {
- form.value.supplierId = matchedTemplate.supplierId;
- }
- if (matchedTemplate.supplierName) {
- form.value.supplierName = matchedTemplate.supplierName;
- }
- if (matchedTemplate.projectName) {
- form.value.projectName = matchedTemplate.projectName;
- }
- if (matchedTemplate.paymentMethod) {
- form.value.paymentMethod = matchedTemplate.paymentMethod;
- }
- // 妯℃澘鏁版嵁涓殑浜у搧瀛楁鏄� productList锛岄渶瑕佽浆鎹负 productData
- productData.value =
- matchedTemplate.productList || matchedTemplate.productData || [];
- } else {
- // 鏈尮閰嶅埌宸叉湁妯℃澘锛岃涓烘柊妯℃澘
- currentTemplateId.value = null;
- // 濡傛灉娌℃湁鎵惧埌妯℃澘锛岄噸缃〃鍗曪紙淇濇寔褰撳墠琛ㄥ崟鐘舵�侊級
- const currentFormData = { ...form.value };
- const currentProductData = [...productData.value];
+function handleDateChange(val) {
+ query.paymentDateStart = val?.[0]
+ query.paymentDateEnd = val?.[1]
+ handleQuery()
+}
- // 濡傛灉瀵硅瘽妗嗘湭鎵撳紑锛屽厛鎵撳紑
- if (!dialogFormVisible.value) {
- operationType.value = "add";
- dialogFormVisible.value = true;
- }
+function resetQuery() {
+ dateRange.value = []
+ query.paymentDateStart = undefined
+ query.paymentDateEnd = undefined
+ query.paymentMethod = undefined
+ query.current = 1
+ getList()
+}
- // 绛夊緟涓嬩竴涓� tick 鍚庢仮澶嶆暟鎹�
- await nextTick();
- form.value = {
- ...form.value,
- ...currentFormData,
- };
- productData.value = currentProductData;
- }
- };
+function paginationChange(obj) {
+ query.current = obj.page
+ query.size = obj.limit
+ getList()
+}
- // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
- const operationType = ref("");
- const dialogFormVisible = ref(false);
- const data = reactive({
- searchForm: {
- supplierName: "", // 渚涘簲鍟嗗悕绉�
- purchaseContractNumber: "", // 閲囪喘鍚堝悓缂栧彿
- salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
- projectName: "", // 椤圭洰鍚嶇О
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
+function handleSelectionChange(rows) {
+ selectedRows.value = rows
+}
+
+function handleExport() {
+ proxy.download(
+ 'purchase/simpleLedger/export',
+ {
+ paymentDateStart: query.paymentDateStart,
+ paymentDateEnd: query.paymentDateEnd,
+ paymentMethod: query.paymentMethod
},
- form: {
- purchaseContractNumber: "",
- salesLedgerId: "",
- projectName: "",
- recorderId: "",
- entryDate: "",
- productData: [],
- supplierName: "",
- supplierId: "",
- paymentMethod: "",
- executionDate: "",
- isChecked: false,
- },
- rules: {
- purchaseContractNumber: [
- { required: false, message: "璇疯緭鍏�", trigger: "blur" },
- ],
- projectName: [
- { required: true, message: "璇疯緭鍏ラ」鐩悕绉�", trigger: "blur" },
- ],
- supplierId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- executionDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- },
- });
- const { form, rules } = toRefs(data);
- const { form: searchForm } = useFormData({
- ...data.searchForm,
- // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
- entryDate: [
- dayjs().startOf("day").format("YYYY-MM-DD"),
- dayjs().endOf("day").format("YYYY-MM-DD"),
- ],
- entryDateStart: dayjs().startOf("day").format("YYYY-MM-DD"),
- entryDateEnd: dayjs().endOf("day").format("YYYY-MM-DD"),
- });
+ '閲囪喘鍙拌处.xlsx'
+ )
+}
- // 浜у搧琛ㄥ崟寮规鏁版嵁
- const productFormVisible = ref(false);
- const productOperationType = ref("");
- const productOperationIndex = ref("");
- const currentId = ref("");
- const productFormData = reactive({
- productForm: {
- productId: "",
- productCategory: "",
- productModelId: "",
- specificationModel: "",
- unit: "",
- quantity: "",
- taxInclusiveUnitPrice: "",
- taxRate: "",
- taxInclusiveTotalPrice: "",
- taxExclusiveTotalPrice: "",
- invoiceType: "",
- warnNum: "",
- isChecked: false,
- },
- productRules: {
- productId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- productModelId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- taxInclusiveUnitPrice: [
- { required: true, message: "璇疯緭鍏�", trigger: "blur" },
- ],
- taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- warnNum: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- taxInclusiveTotalPrice: [
- { required: true, message: "璇疯緭鍏�", trigger: "blur" },
- ],
- taxExclusiveTotalPrice: [
- { required: true, message: "璇疯緭鍏�", trigger: "blur" },
- ],
- invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- isChecked: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
- },
- });
- const { productForm, productRules } = toRefs(productFormData);
- const upload = reactive({
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
- });
-
- // 瀵煎叆鐩稿叧
- const importUploadRef = ref(null);
- const importUpload = reactive({
- title: "瀵煎叆閲囪喘鍙拌处",
- open: false,
- url: import.meta.env.VITE_APP_BASE_API + "/purchase/ledger/import",
- headers: { Authorization: "Bearer " + getToken() },
- isUploading: false,
- beforeUpload: file => {
- const isExcel = file.name.endsWith(".xlsx") || file.name.endsWith(".xls");
- const isLt10M = file.size / 1024 / 1024 < 10;
- if (!isExcel) {
- proxy.$modal.msgError("涓婁紶鏂囦欢鍙兘鏄� xlsx/xls 鏍煎紡!");
- return false;
- }
- if (!isLt10M) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 10MB!");
- return false;
- }
- return true;
- },
- onChange: (file, fileList) => {
- // noop
- },
- onProgress: (event, file, fileList) => {
- // noop
- },
- onSuccess: (response, file, fileList) => {
- importUpload.isUploading = false;
- if (response?.code === 200) {
- proxy.$modal.msgSuccess("瀵煎叆鎴愬姛");
- importUpload.open = false;
- if (importUploadRef.value) {
- importUploadRef.value.clearFiles?.();
- }
- getList();
+function handleDelete() {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁')
+ return
+ }
+ const ids = selectedRows.value.map(r => r.id)
+ ElMessageBox.confirm(`纭鍒犻櫎閫変腑鐨� ${ids.length} 鏉℃暟鎹悧锛焋, '鍒犻櫎纭', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ })
+ .then(() => simpleLedgerDelete(ids))
+ .then(res => {
+ if (res?.code === 200) {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ getList()
} else {
- proxy.$modal.msgError(response?.msg || "瀵煎叆澶辫触");
+ ElMessage.error(res?.msg || '鍒犻櫎澶辫触')
}
- },
- onError: () => {
- importUpload.isUploading = false;
- proxy.$modal.msgError("瀵煎叆澶辫触锛岃閲嶈瘯");
- },
- });
+ })
+ .catch(() => {})
+}
- const handleImport = () => {
- importUpload.title = "瀵煎叆閲囪喘鍙拌处";
- importUpload.open = true;
- importUpload.isUploading = false;
- if (importUploadRef.value) {
- importUploadRef.value.clearFiles?.();
+async function loadAttachments(recordId) {
+ try {
+ const res = await attachmentList({ recordType: RECORD_TYPE, recordId })
+ const list = res?.data || []
+ return (Array.isArray(list) ? list : []).map(item => ({
+ id: item.id,
+ name: item.name || item.originalFilename || '闄勪欢',
+ url: item.url || item.downloadURL || item.previewURL || ''
+ }))
+ } catch {
+ return []
+ }
+}
+
+async function openForm(type, row) {
+ operationType.value = type
+ formRef.value?.resetFields?.()
+ formFiles.value = []
+ form.value = {
+ id: undefined,
+ purchaseDate: '',
+ paymentDate: '',
+ paymentMethod: '',
+ amount: undefined,
+ purchaseGoods: '',
+ invoiceNumber: '',
+ remark: ''
+ }
+ if (type === 'edit' && row?.id) {
+ const detail = (await simpleLedgerGet(row.id))?.data || row
+ form.value = {
+ id: detail.id,
+ purchaseDate: detail.purchaseDate || '',
+ paymentDate: detail.paymentDate || '',
+ paymentMethod: detail.paymentMethod || '',
+ amount: detail.amount === null || detail.amount === undefined ? undefined : Number(detail.amount),
+ purchaseGoods: detail.purchaseGoods || '',
+ invoiceNumber: detail.invoiceNumber || '',
+ remark: detail.remark || ''
}
- };
+ formFiles.value = await loadAttachments(detail.id)
+ } else {
+ form.value.purchaseDate = todayStr()
+ }
+ formVisible.value = true
+}
- // 涓嬭浇瀵煎叆妯℃澘锛堝鍚庣璺緞涓嶅悓锛屽彲鍦ㄦ澶勮皟鏁达級
- const downloadTemplate = () => {
- proxy.download(
- "/purchase/ledger/exportTemplate",
- {},
- "閲囪喘鍙拌处瀵煎叆妯℃澘.xlsx"
- );
- };
-
- const submitImportFile = () => {
- importUpload.isUploading = true;
- proxy.$refs["importUploadRef"]?.submit?.();
- };
-
- const changeDaterange = value => {
- if (value) {
- searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- } else {
- searchForm.entryDateStart = undefined;
- searchForm.entryDateEnd = undefined;
+async function submit() {
+ try {
+ await formRef.value?.validate?.()
+ } catch {
+ return
+ }
+ saving.value = true
+ try {
+ const payload = { ...form.value }
+ if (!payload.id) {
+ payload.recorderId = userStore.id
+ payload.recorderName = userStore.nickName || userStore.name
+ payload.entryDate = todayStr()
}
- handleQuery();
- };
-
- const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
- };
- // 鏌ヨ鍒楄〃
- /** 鎼滅储鎸夐挳鎿嶄綔 */
- const handleQuery = () => {
- page.current = 1;
- getList();
- };
-
- // 淇濆瓨妯℃澘
- const handleButtonClick = async () => {
- // 妫�鏌ユā鏉垮悕绉版槸鍚︿负绌�
- if (!templateName.value || templateName.value.trim() === "") {
- ElMessage({
- message: "璇疯緭鍏ユā鏉垮悕绉�",
- type: "warning",
- });
- return;
+ const res = await simpleLedgerSave(payload)
+ if (res?.code !== 200) {
+ ElMessage.error(res?.msg || '淇濆瓨澶辫触')
+ return
}
-
- // 濡傛灉鏄�滄柊澧炴ā鏉库�濓紙娌℃湁閫変腑宸叉湁妯℃澘锛夛紝鎵嶉渶瑕佸仛閲嶅悕鏍¢獙锛�
- // 鑻ユ槸閫変腑宸叉湁妯℃澘鍚庝慨鏀癸紝鍒欏厑璁镐娇鐢ㄥ師鍚嶇О锛堣涓烘洿鏂帮級
- if (!currentTemplateId.value) {
- const isDuplicate = checkTemplateNameDuplicate(templateName.value);
- if (isDuplicate) {
- ElMessage({
- message: "妯℃澘鍚嶇О宸插瓨鍦紝璇锋洿鎹㈡ā鏉垮悕绉�",
- type: "warning",
- });
- return;
- }
- }
-
- // 妫�鏌ヤ緵搴斿晢鏄惁閫夋嫨
- if (!form.value.supplierId) {
- ElMessage({
- message: "璇峰厛閫夋嫨渚涘簲鍟�",
- type: "warning",
- });
- return;
- }
-
- // 妫�鏌ユ槸鍚︽湁浜у搧鏁版嵁
- if (!productData.value || productData.value.length === 0) {
- ElMessage({
- message: "璇峰厛娣诲姞浜у搧淇℃伅",
- type: "warning",
- });
- return;
- }
-
- try {
- let params = {
- productData: proxy.HaveJson(productData.value),
- supplierId: form.value.supplierId,
- paymentMethod: form.value.paymentMethod,
- recorderId: form.value.recorderId,
- projectName: form.value.projectName,
- templateName: templateName.value.trim(),
- };
- console.log(
- "template params ===>",
- params,
- "currentTemplateId:",
- currentTemplateId.value
- );
-
- // 濡傛灉 currentTemplateId 鏈夊�硷紝璇存槑褰撳墠鏄�滅紪杈戝凡鏈夋ā鏉库�� 鈫� 璋冪敤鏇存柊鎺ュ彛
- // 鍚﹀垯涓衡�滄柊寤烘ā鏉库�� 鈫� 璋冪敤鏂板鎺ュ彛
- let res;
- if (currentTemplateId.value) {
- res = await updatePurchaseTemplate({
- id: currentTemplateId.value,
- ...params,
- });
- } else {
- res = await addPurchaseTemplate(params);
- }
-
- if (res && res.code === 200) {
- ElMessage({
- message: currentTemplateId.value ? "妯℃澘鏇存柊鎴愬姛" : "妯℃澘淇濆瓨鎴愬姛",
- type: "success",
- });
- // 淇濆瓨鎴愬姛鍚庨噸鏂拌幏鍙栨ā鏉垮垪琛�
- await getTemplateList();
- // 娓呯┖妯℃澘鍚嶇О杈撳叆
- templateName.value = "";
- filterInputValue.value = "";
- isTemplateNameDuplicate.value = false;
- // 淇濆瓨/鏇存柊瀹屾垚鍚庯紝閲嶇疆褰撳墠妯℃澘ID
- currentTemplateId.value = null;
- } else {
- ElMessage({
- message: res?.msg || "妯℃澘淇濆瓨澶辫触",
- type: "error",
- });
- }
- } catch (error) {
- console.error("淇濆瓨妯℃澘澶辫触:", error);
- ElMessage({
- message: "妯℃澘淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯",
- type: "error",
- });
- }
- };
- // 瀛愯〃鍚堣鏂规硶
- const summarizeChildrenTable = param => {
- return proxy.summarizeTable(
- param,
- [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- "ticketsNum",
- "ticketsAmount",
- "futureTickets",
- "futureTicketsAmount",
- ],
- {
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- }
- );
- };
- const paginationChange = obj => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
- };
- const getList = () => {
- tableLoading.value = true;
- const { entryDate, ...rest } = searchForm;
- purchaseListPage({ ...rest, ...page })
- .then(res => {
- tableLoading.value = false;
- // tableData.value = res.data.records;
- tableData.value = res.data.records.map(record => ({
- ...record,
- }));
- // 鍒濆鍖栧瓙鏁版嵁鏁扮粍
- tableData.value.forEach(item => {
- item.children = [];
- });
- total.value = res.data.total;
- expandedRowKeys.value = [];
- })
- .catch(() => {
- tableLoading.value = false;
- });
- };
- // 琛ㄦ牸閫夋嫨鏁版嵁
- const handleSelectionChange = selection => {
- selectedRows.value = selection;
- };
- const productSelected = selectedRows => {
- productSelectedRows.value = selectedRows;
- };
- const expandedRowKeys = ref([]);
- // 灞曞紑琛�
- const expandChange = async (row, expandedRows) => {
- if (expandedRows.length > 0) {
- expandedRowKeys.value = [];
+ const recordId = res.data || form.value.id
+ const blobs = formFiles.value
+ .map(f => ({
+ id: f.id ?? f.rawData?.id,
+ application: 'file',
+ name: f.name,
+ url: f.url,
+ downloadURL: f.url
+ }))
+ .filter(f => f.id)
+ if (blobs.length > 0) {
try {
- const res = await productList({ salesLedgerId: row.id, type: 2 });
- const index = tableData.value.findIndex(item => item.id === row.id);
- if (index > -1) {
- tableData.value[index].children = res.data || [];
- expandedRowKeys.value.push(row.id);
- }
- } catch (error) {
- console.error("鍔犺浇浜у搧鍒楄〃澶辫触:", error);
- proxy.$modal.msgError("鍔犺浇浜у搧鍒楄〃澶辫触");
- // 灞曞紑澶辫触鏃讹紝绉婚櫎灞曞紑鐘舵��
- const index = expandedRows.findIndex(item => item.id === row.id);
- if (index > -1) {
- expandedRows.splice(index, 1);
- }
- }
- } else {
- expandedRowKeys.value = [];
- }
- };
- // 涓昏〃鍚堣鏂规硶
- const summarizeMainTable = param => {
- return proxy.summarizeTable(param, ["contractAmount", "netContractAmount"]);
- };
- const formatMoney = value => {
- if (value === null || value === undefined || value === "") {
- return "--";
- }
- const num = Number(value);
- return Number.isFinite(num) ? num.toFixed(2) : "--";
- };
- // 瀛愯〃鍚堣鏂规硶
- const summarizeProTable = param => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
- };
- // 鎵撳紑寮规
- const openForm = async (type, row) => {
- // 缂栬緫鏃舵鏌ュ叆搴撶姸鎬侊紝瀹屽叏鍏ュ簱鏃朵笉鑳界紪杈�
- if (type === "edit" && row) {
- if (row.stockInStatus === "瀹屽叏鍏ュ簱") {
- proxy.$modal.msgWarning("瀹屽叏鍏ュ簱鐘舵�佺殑璁板綍涓嶈兘缂栬緫");
- return;
- }
- }
-
- await getTemplateList();
- await userListNoPage().then(res => {
- userList.value = res.data;
- });
- operationType.value = type;
- form.value = {};
- productData.value = [];
- fileList.value = [];
- templateName.value = "";
- filterInputValue.value = "";
- isTemplateNameDuplicate.value = false;
- try {
- // 骞惰鍔犺浇鍩虹鏁版嵁
- const [salesRes, supplierRes] = await Promise.all([
- getSalesNo(),
- getOptions(),
- ]);
-
- salesContractList.value = salesRes || [];
- // 渚涘簲鍟嗚繃婊ゅ嚭isWhite=0 鐨勬暟鎹�
- supplierList.value = (supplierRes.data || []).filter(
- item => item.isWhite === 0
- );
-
- form.value.entryDate = getCurrentDate();
-
- if (type === "edit" && row?.id) {
- // 缂栬緫鏃跺姞杞芥暟鎹�
- currentId.value = row.id;
- try {
- const purchaseRes = await getPurchaseById({ id: row.id, type: 2 });
- form.value = { ...purchaseRes, stockInStatus: row.stockInStatus };
- fileList.value = purchaseRes.storageBlobVOS || [];
- // 浣跨敤 productList 鎺ュ彛鑾峰彇浜у搧鍒楄〃锛屼互鑾峰彇鍏ュ簱瀹℃牳鐘舵��
- const productRes = await productList({
- salesLedgerId: row.id,
- type: 2,
- });
- productData.value = productRes.data || [];
- } catch (error) {
- console.error("鍔犺浇閲囪喘鍙拌处鏁版嵁澶辫触:", error);
- proxy.$modal.msgError("鍔犺浇鏁版嵁澶辫触");
- return;
- }
- }
-
- if (form.value.salesLedgerId == -1) {
- form.value.salesLedgerId = null;
- }
- console.log(form.value, "form.value===========");
- dialogFormVisible.value = true;
- } catch (error) {
- console.error("鎵撳紑琛ㄥ崟澶辫触:", error);
- proxy.$modal.msgError("鍔犺浇鍩虹鏁版嵁澶辫触");
- }
- };
-
- // 涓婁紶鍓嶆牎妫�
- function handleBeforeUpload(file) {
- // 鏍℃鏂囦欢澶у皬
- if (file.size > 1024 * 1024 * 10) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
- return false;
- }
- proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
- return true;
- }
-
- // 涓婁紶澶辫触
- function handleUploadError(err) {
- proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
- proxy.$modal.closeLoading();
- }
-
- // 涓婁紶鎴愬姛鍥炶皟
- function handleUploadSuccess(res, file, uploadFiles) {
- proxy.$modal.closeLoading();
- if (res.code === 200) {
- file.tempId = res.data.tempId;
- proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
- } else {
- proxy.$modal.msgError(res.msg);
- proxy.$refs.fileUpload.handleRemove(file);
- }
- }
-
- // 绉婚櫎鏂囦欢
- async function handleRemove(file) {
- if (!file?.id) {
- return;
- }
- console.log("handleRemove", file.id);
- if (file.size > 1024 * 1024 * 10) {
- // 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
- return;
- }
-
- if (operationType.value === "edit" && file.id) {
- try {
- await delLedgerFile([file.id]);
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- } catch (error) {
- console.error("鍒犻櫎鏂囦欢澶辫触:", error);
- proxy.$modal.msgError("鍒犻櫎鏂囦欢澶辫触");
- }
- }
- }
-
- // 鎻愪氦琛ㄥ崟
- const submitForm = () => {
- proxy.$refs["formRef"].validate(async valid => {
- if (valid) {
- if (productData.value.length > 0) {
- // 鏂板鏃讹紝闇�瑕佷粠姣忎釜浜у搧瀵硅薄涓垹闄� id 瀛楁
- let processedProductData = productData.value;
- if (operationType.value === "add") {
- processedProductData = productData.value.map(product => {
- const { id, ...rest } = product;
- return rest;
- });
- }
- form.value.productData = proxy.HaveJson(processedProductData);
- } else {
- proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
- return;
- }
- form.value.storageBlobDTOS = fileList.value;
- form.value.type = 2;
-
- // 濡傛灉salesLedgerId涓虹┖锛屽垯涓嶄紶閫抯alesContractNo
- if (!form.value.salesLedgerId) {
- form.value.salesContractNo = "";
- }
-
- // 鏂板鏃朵笉浼犻�抜d
- const submitData = { ...form.value };
- if (operationType.value === "add") {
- delete submitData.id;
- }
-
- // 濡傛灉閲囪喘鍚堝悓鍙蜂负绌猴紝鍒欐牴鎹綍鍏ユ棩鏈熻嚜鍔ㄧ敓鎴�
- if (!submitData.purchaseContractNumber) {
- try {
- const purchaseNoRes = await createPurchaseNo(submitData.entryDate);
- if (purchaseNoRes?.data) {
- submitData.purchaseContractNumber = purchaseNoRes.data;
- }
- } catch (error) {
- console.error("鐢熸垚閲囪喘鍚堝悓鍙峰け璐�:", error);
- proxy.$modal.msgWarning("鐢熸垚閲囪喘鍚堝悓鍙峰け璐�");
- return;
- }
- }
-
- addOrEditPurchase(submitData).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- });
- }
- });
- };
- // 鍏抽棴寮规
- const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
- };
- // 鎵撳紑浜у搧寮规
- const openProductForm = async (type, row, index) => {
- // 缂栬緫鏃舵鏌ヤ骇鍝佸叆搴撳鏍哥姸鎬侊紝瀹屽叏鍏ュ簱鏃朵笉鑳界紪杈�
- if (type === "edit" && row && row.stockInApprovalStatus === "瀹屽叏鍏ュ簱") {
- proxy.$modal.msgWarning("瀹屽叏鍏ュ簱鐘舵�佺殑浜у搧涓嶈兘缂栬緫");
- return;
- }
-
- productOperationType.value = type;
- productOperationIndex.value = index;
- productForm.value = {};
- proxy.resetForm("productFormRef");
- productFormVisible.value = true;
-
- // 鍏堣幏鍙栦骇鍝侀�夐」锛岀‘淇濇暟鎹姞杞藉畬鎴�
- await getProductOptions();
-
- // 绛夊緟 DOM 鏇存柊
- await nextTick();
-
- if (type === "add") {
- productForm.value.isChecked = false;
- }
-
- if (type === "edit") {
- // 澶嶅埗琛屾暟鎹�
- productForm.value = { ...row };
-
- // 濡傛灉鏄粠妯℃澘鍔犺浇鐨勬暟鎹紝鍙兘娌℃湁 productId 鍜� productModelId
- // 闇�瑕佹牴鎹� productCategory 鍜� specificationModel 鏉ユ煡鎵惧搴旂殑 ID
- if (!productForm.value.productId && productForm.value.productCategory) {
- // 鏍规嵁 productCategory 鏌ユ壘 productId
- const findProductIdByCategory = (nodes, categoryName) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].label === categoryName) {
- return nodes[i].value;
- }
- if (nodes[i].children && nodes[i].children.length > 0) {
- const found = findProductIdByCategory(
- nodes[i].children,
- categoryName
- );
- if (found) return found;
- }
- }
- return null;
- };
-
- const productId = findProductIdByCategory(
- productOptions.value,
- productForm.value.productCategory
- );
- if (productId) {
- productForm.value.productId = productId;
- // 鑾峰彇鍨嬪彿鍒楄〃骞剁瓑寰呭畬鎴�
- const modelRes = await modelList({ id: productId });
- modelOptions.value = modelRes;
-
- // 绛夊緟 DOM 鏇存柊
- await nextTick();
-
- // 鏍规嵁 specificationModel 鏌ユ壘 productModelId
- if (
- productForm.value.specificationModel &&
- modelOptions.value.length > 0
- ) {
- const modelItem = modelOptions.value.find(
- item => item.model === productForm.value.specificationModel
- );
- if (modelItem) {
- productForm.value.productModelId = modelItem.id;
- // 璁剧疆瑙勬牸鍨嬪彿鍜屽崟浣�
- getProductModel(modelItem.id);
- }
- }
- }
- } else if (productForm.value.productId) {
- // 濡傛灉鏈� productId锛屾甯稿姞杞藉瀷鍙峰垪琛�
- await getModels(productForm.value.productId);
-
- // 绛夊緟 DOM 鏇存柊
- await nextTick();
-
- if (productForm.value.productModelId) {
- getProductModel(productForm.value.productModelId);
- }
- }
-
- // 鏈�鍚庡啀绛夊緟涓�娆� DOM 鏇存柊锛岀‘淇濇墍鏈夋暟鎹兘宸茶缃�
- await nextTick();
- }
- };
- const getProductOptions = () => {
- return productTreeList().then(res => {
- productOptions.value = convertIdToValue(res);
- return res;
- });
- };
- const getModels = value => {
- if (value) {
- productForm.value.productCategory =
- findNodeById(productOptions.value, value) || "";
- return modelList({ id: value }).then(res => {
- modelOptions.value = res;
- return res;
- });
- } else {
- productForm.value.productCategory = "";
- modelOptions.value = [];
- return Promise.resolve([]);
- }
- };
- const getProductModel = value => {
- const index = modelOptions.value.findIndex(item => item.id === value);
- if (index !== -1) {
- productForm.value.specificationModel = modelOptions.value[index].model;
- productForm.value.unit = modelOptions.value[index].unit;
- } else {
- productForm.value.specificationModel = null;
- productForm.value.unit = null;
- }
- };
- const findNodeById = (nodes, productId) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].value === productId) {
- return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣鐨刲abel
- }
- if (nodes[i].children && nodes[i].children.length > 0) {
- const foundNode = findNodeById(nodes[i].children, productId);
- if (foundNode) {
- return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝鐩存帴杩斿洖锛堝凡缁忔槸label瀛楃涓诧級
- }
- }
- }
- return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
- };
-
- function convertIdToValue(data) {
- return data.map(item => {
- const { id, children, ...rest } = item;
- const newItem = {
- ...rest,
- value: id, // 灏� id 鏀逛负 value
- };
- if (children && children.length > 0) {
- newItem.children = convertIdToValue(children);
- }
-
- return newItem;
- });
- }
-
- // 鎻愪氦浜у搧琛ㄥ崟
- const submitProduct = () => {
- proxy.$refs["productFormRef"].validate(valid => {
- if (valid) {
- if (operationType.value === "edit") {
- submitProductEdit();
- } else {
- if (productOperationType.value === "add") {
- productData.value.push({ ...productForm.value });
- console.log("productData.value---", productData.value);
- } else {
- productData.value[productOperationIndex.value] = {
- ...productForm.value,
- };
- }
- closeProductDia();
- }
- }
- });
- };
- const submitProductEdit = () => {
- productForm.value.salesLedgerId = currentId.value;
- productForm.value.type = 2;
- addOrUpdateSalesLedgerProduct(productForm.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeProductDia();
- // 浣跨敤 productList 鎺ュ彛鍒锋柊浜у搧鍒楄〃锛屼互鑾峰彇鍏ュ簱瀹℃牳鐘舵��
- productList({ salesLedgerId: currentId.value, type: 2 }).then(res => {
- productData.value = res.data || [];
- });
- });
- };
- // 鍒犻櫎浜у搧
- const deleteProduct = () => {
- if (productData.value.length <= 1) {
- proxy.$modal.msgWarning("閲囪喘鍙拌处鑷冲皯闇�瑕佷繚鐣欎竴鏉′骇鍝佹暟鎹�");
- return;
- }
- if (productSelectedRows.value.length === 0) {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- // 妫�鏌ラ�変腑鐨勪骇鍝佷腑鏄惁鏈夊畬鍏ㄥ叆搴撶殑
- const hasFullyStocked = productSelectedRows.value.some(
- row => row.stockInApprovalStatus === "瀹屽叏鍏ュ簱"
- );
- if (hasFullyStocked) {
- proxy.$modal.msgWarning("閫変腑鐨勪骇鍝佷腑鍖呭惈瀹屽叏鍏ュ簱鐨勪骇鍝侊紝鏃犳硶鍒犻櫎");
- return;
- }
- if (operationType.value === "add") {
- productData.value = productData.value.filter(
- item => !productSelectedRows.value.includes(item)
- );
- productSelectedRows.value = [];
- } else {
- let ids = [];
- if (productSelectedRows.value.length > 0) {
- ids = productSelectedRows.value.map(item => item.id);
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- delProduct(ids).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- closeProductDia();
- // 浣跨敤 productList 鎺ュ彛鍒锋柊浜у搧鍒楄〃锛屼互鑾峰彇鍏ュ簱瀹℃牳鐘舵��
- productList({ salesLedgerId: currentId.value, type: 2 }).then(res => {
- productData.value = res.data || [];
- });
- });
+ await createAttachment({
+ application: 'file',
+ recordType: RECORD_TYPE,
+ recordId,
+ storageBlobDTOs: blobs
})
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ } catch {
+ ElMessage.error('闄勪欢淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯')
+ }
}
- };
- // 鍏抽棴浜у搧寮规
- const closeProductDia = () => {
- proxy.resetForm("productFormRef");
- productFormVisible.value = false;
- };
- // 瀵煎嚭
- const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/purchase/ledger/export", {}, "閲囪喘鍙拌处.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
- };
- // 鍒犻櫎
- const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value
- .filter(item => item.salesLedgerId === null)
- .map(item => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- delPurchase(ids).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- getList();
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
- };
-
- const handleBatchGenerate = async () => {
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- const ids = selectedRows.value.map((item) => item.id);
-
- ElMessageBox.confirm("纭鎵归噺鐢熸垚鏁版嵁锛�", "鎵归噺鐢熸垚", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "info",
- })
- .then(() => {
- proxy.$modal.loading("姝e湪鎵归噺鐢熸垚鏁版嵁锛岃绋嶅��...");
- batchGeneratePurchaseInboundSteps({ ids })
- .then((res) => {
- proxy.$modal.msgSuccess("鎵归噺鐢熸垚鎴愬姛");
- getList();
- })
- .catch(() => {
- proxy.$modal.msgError("鎵归噺鐢熸垚澶辫触");
- })
- .finally(() => {
- proxy.$modal.closeLoading();
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
- };
-
- // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
- function getCurrentDate() {
- const today = new Date();
- const year = today.getFullYear();
- const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
- const day = String(today.getDate()).padStart(2, "0");
- return `${year}-${month}-${day}`;
+ ElMessage.success('淇濆瓨鎴愬姛')
+ formVisible.value = false
+ getList()
+ } finally {
+ saving.value = false
}
+}
- const mathNum = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
- if (!productForm.value.taxInclusiveUnitPrice) {
- return;
- }
- if (!productForm.value.quantity) {
- return;
- }
- // 鍚◣鎬讳环璁$畻
- productForm.value.taxInclusiveTotalPrice =
- proxy.calculateTaxIncludeTotalPrice(
- productForm.value.taxInclusiveUnitPrice,
- productForm.value.quantity
- );
- if (productForm.value.taxRate) {
- // 涓嶅惈绋庢�讳环璁$畻
- productForm.value.taxExclusiveTotalPrice =
- proxy.calculateTaxExclusiveTotalPrice(
- productForm.value.taxInclusiveTotalPrice,
- productForm.value.taxRate
- );
- }
- };
- const reverseMathNum = field => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
- const taxRate = Number(productForm.value.taxRate);
- if (!taxRate) return;
+function openFileDialog(row) {
+ currentRowId.value = row.id
+ fileDialogVisible.value = true
+}
- // 纭繚杈撳叆鍊间笉涓鸿礋鏁�
- if (
- field === "taxInclusiveTotalPrice" ||
- field === "taxExclusiveTotalPrice"
- ) {
- const value = Number(productForm.value[field]);
- if (value < 0) {
- productForm.value[field] = "0";
- proxy.$modal.msgWarning("鍊间笉鑳藉皬浜�0");
- return;
- }
- }
-
- if (field === "taxInclusiveTotalPrice") {
- // 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
- if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
- Number(productForm.value.taxInclusiveTotalPrice) /
- Number(productForm.value.quantity)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
- productForm.value.taxInclusiveUnitPrice = "0";
- }
- }
- // 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
- else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity = (
- Number(productForm.value.taxInclusiveTotalPrice) /
- Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(3);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.quantity) < 0) {
- productForm.value.quantity = "0";
- }
- }
- // 鍙嶇畻涓嶅惈绋庢�讳环
- productForm.value.taxExclusiveTotalPrice = (
- Number(productForm.value.taxInclusiveTotalPrice) /
- (1 + taxRate / 100)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxExclusiveTotalPrice) < 0) {
- productForm.value.taxExclusiveTotalPrice = "0";
- }
- } else if (field === "taxExclusiveTotalPrice") {
- // 鍙嶇畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice = (
- Number(productForm.value.taxExclusiveTotalPrice) *
- (1 + taxRate / 100)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveTotalPrice) < 0) {
- productForm.value.taxInclusiveTotalPrice = "0";
- }
- // 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
- if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice = (
- Number(productForm.value.taxInclusiveTotalPrice) /
- Number(productForm.value.quantity)
- ).toFixed(2);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
- productForm.value.taxInclusiveUnitPrice = "0";
- }
- }
- // 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
- else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity = (
- Number(productForm.value.taxInclusiveTotalPrice) /
- Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(3);
- // 纭繚缁撴灉涓嶄负璐熸暟
- if (Number(productForm.value.quantity) < 0) {
- productForm.value.quantity = "0";
- }
- }
- }
- };
- // 閿�鍞悎鍚岄�夋嫨鏀瑰彉鏂规硶
- const salesLedgerChange = async row => {
- console.log("row", row);
- var index = salesContractList.value.findIndex(item => item.id == row);
- console.log("index", index);
- if (index > -1) {
- await querygProductInfoByContractNo();
- }
- };
-
- const querygProductInfoByContractNo = async () => {
- const { code, data } = await getProductInfoByContractNo({
- contractNo: form.value.salesLedgerId,
- });
- if (code == 200) {
- productData.value = data || [];
- }
- };
-
- // 鑾峰彇妯℃澘淇℃伅
- const getTemplateList = async () => {
- let res = await getPurchaseTemplateList();
- if (res && res.code === 200 && Array.isArray(res.data)) {
- templateList.value = res.data;
- }
- };
-
- // 鎵撳紑闄勪欢寮规
- const openFileDialog = async row => {
- recordId.value = row.id;
- fileListDialogVisible.value = true;
- };
-
- // 鍒犻櫎妯℃澘
- const handleDeleteTemplate = async item => {
- if (!item.id) {
- proxy.$modal.msgWarning("鏃犳硶鍒犻櫎璇ユā鏉�");
- return;
- }
-
- try {
- await ElMessageBox.confirm(
- `纭畾瑕佸垹闄ゆā鏉�"${item.templateName}"鍚楋紵`,
- "鍒犻櫎纭",
- {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- }
- );
-
- const res = await delPurchaseTemplate([item.id]);
- if (res && res.code === 200) {
- ElMessage({
- message: "鍒犻櫎鎴愬姛",
- type: "success",
- });
- // 濡傛灉鍒犻櫎鐨勬槸褰撳墠閫変腑鐨勬ā鏉匡紝娓呯┖閫夋嫨
- if (templateName.value === item.templateName) {
- templateName.value = "";
- filterInputValue.value = "";
- }
- // 閲嶆柊鑾峰彇妯℃澘鍒楄〃
- await getTemplateList();
- } else {
- ElMessage({
- message: res?.msg || "鍒犻櫎澶辫触",
- type: "error",
- });
- }
- } catch (error) {
- if (error !== "cancel") {
- console.error("鍒犻櫎妯℃澘澶辫触:", error);
- ElMessage({
- message: "鍒犻櫎澶辫触锛岃绋嶅悗閲嶈瘯",
- type: "error",
- });
- }
- }
- };
-
- onMounted(() => {
- getList();
- getTemplateList();
- });
+onMounted(() => {
+ getList()
+})
</script>
-<style scoped lang="scss">
- .invalid-row {
- opacity: 0.6;
- background-color: #f5f7fa;
- }
+<style scoped>
+.search_form {
+ margin-bottom: 12px;
+}
- .el-row {
- justify-content: space-between;
- align-items: center;
- }
+.toolbar {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ margin-bottom: 18px;
+}
- .no-arrow-select {
- --el-select-suffix-icon-color: transparent; /* 闅愯棌榛樿涓嬫媺绠ご */
- }
-
- .select-button-group {
- display: flex;
- align-items: center;
- }
-
- // 瀹℃壒浜鸿妭鐐瑰鍣ㄦ牱寮�
- .approver-nodes-container {
- display: flex;
- flex-wrap: wrap;
- gap: 16px;
- padding: 16px;
- background-color: #f8f9fa;
- border-radius: 4px;
- border: 1px solid #e4e7ed;
- }
-
- .approver-node-item {
- flex: 0 0 calc(33.333% - 12px);
- min-width: 200px;
- padding: 12px;
- background-color: #fff;
- border-radius: 4px;
- border: 1px solid #dcdfe6;
- transition: all 0.3s;
-
- &:hover {
- border-color: #409eff;
- box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
- }
- }
-
- .approver-node-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
- }
-
- .approver-node-label {
- font-size: 13px;
- font-weight: 500;
- color: #606266;
- }
-
- @media (max-width: 1200px) {
- .approver-node-item {
- flex: 0 0 calc(50% - 8px);
- }
- }
-
- @media (max-width: 768px) {
- .approver-node-item {
- flex: 0 0 100%;
- }
- }
-
- // 鍒犻櫎鍥炬爣鏍峰紡
- .delete-icon {
- transition: all 0.3s;
-
- &:hover {
- color: #f56c6c !important;
- transform: scale(1.2);
- }
- }
+:deep(.el-form-item) {
+ margin-bottom: 12px;
+}
</style>
diff --git a/src/views/projectManagement/Management/components/formDia.vue b/src/views/projectManagement/Management/components/formDia.vue
index 0db3efe..98722a5 100644
--- a/src/views/projectManagement/Management/components/formDia.vue
+++ b/src/views/projectManagement/Management/components/formDia.vue
@@ -40,123 +40,90 @@
</el-col>
<el-col :span="6">
<el-form-item label="瀹㈡埛鍚嶇О" prop="customerName">
- <el-input v-model="form.customerName" placeholder="璇疯緭鍏�" clearable />
+ <el-select
+ v-model="form.customerName"
+ placeholder="璇烽�夋嫨瀹㈡埛"
+ clearable
+ filterable
+ :disabled="isFromContract"
+ style="width: 100%"
+ @change="handleCustomerChange"
+ >
+ <el-option
+ v-for="item in customerOptions"
+ :key="item.id ?? item.customerName"
+ :label="item.customerName"
+ :value="item.customerName"
+ />
+ </el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
- <el-form-item label="绔嬮」鏃ユ湡" prop="setupDate">
- <el-date-picker
- v-model="form.setupDate"
- type="date"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
+ <el-form-item label="椤圭洰鍒嗙被" prop="projectClassification">
+ <el-select
+ v-model="form.projectClassification"
placeholder="璇烽�夋嫨"
- style="width: 100%"
clearable
- />
+ filterable
+ allow-create
+ default-first-option
+ style="width: 100%"
+ >
+ <el-option
+ v-for="c in projectClassificationOptions"
+ :key="c"
+ :label="c"
+ :value="c"
+ />
+ </el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="椤圭洰鏉ユ簮" prop="projectSource">
- <el-input v-model="form.projectSource" placeholder="璇疯緭鍏�" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="绔嬮」浜�" prop="creatorName">
- <el-input v-model="form.creatorName" placeholder="璇疯緭鍏�" clearable />
+ <el-select
+ v-model="form.projectSource"
+ placeholder="璇烽�夋嫨"
+ clearable
+ filterable
+ allow-create
+ default-first-option
+ style="width: 100%"
+ >
+ <el-option label="鎵嬪姩娣诲姞" value="鎵嬪姩娣诲姞" />
+ <el-option label="涓氬姟瀹℃壒" value="涓氬姟瀹℃壒" />
+ <el-option label="鍏朵粬" value="鍏朵粬" />
+ </el-select>
</el-form-item>
</el-col>
</el-row>
- <el-row :gutter="20">
- <el-col :span="6">
- <el-form-item label="棰勮宸ユ湡(澶�)" prop="estimatedDays">
- <el-input-number v-model="form.estimatedDays" :min="0" controls-position="right" style="width: 100%" />
+ <el-row v-if="isFromContract" :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍚堝悓閲戦(鍏�)">
+ <el-input :model-value="form.projectAmount" disabled />
</el-form-item>
</el-col>
- <el-col :span="6">
- <el-form-item label="璁″垝寮�濮嬫棩鏈�" prop="planStartDate">
- <el-date-picker
- v-model="form.planStartDate"
- type="date"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨"
- style="width: 100%"
- clearable
- />
+ <el-col :span="8">
+ <el-form-item label="鍚堝悓鏃ユ湡">
+ <el-input :model-value="form.orderDate" disabled />
</el-form-item>
</el-col>
- <el-col :span="6">
- <el-form-item label="璁″垝瀹屾垚鏃ユ湡" prop="planEndDate">
- <el-date-picker
- v-model="form.planEndDate"
- type="date"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨"
- style="width: 100%"
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="6">
- <el-form-item label="椤圭洰绫诲瀷" prop="projectManagementPlanId">
- <el-select v-model="form.projectManagementPlanId" placeholder="璇烽�夋嫨" clearable style="width: 100%">
- <el-option v-for="opt in projectTypeOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="椤圭洰閲戦" prop="projectAmount">
- <el-input-number v-model="form.projectAmount" :min="0" controls-position="right" style="width: 100%" />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="瀹℃牳鐘舵��" prop="auditStatus">
- <el-select v-model="form.auditStatus" placeholder="璇烽�夋嫨" clearable style="width: 100%">
- <el-option v-for="d in project_management" :key="d.value" :label="d.label" :value="d.value" />
- </el-select>
- </el-form-item>
- </el-col>
-
</el-row>
<el-row :gutter="10" >
<el-col :span="24">
- <el-upload
- v-model:file-list="fileList"
- :action="upload.url"
- :headers="upload.headers"
- multiple
- :disabled="isView"
- :before-upload="beforeUpload"
- :on-success="handleUploadSuccess"
- :on-error="handleUploadError"
- name="files"
- :on-remove="handleRemove"
- >
- <el-button type="primary" :disabled="isView">涓婁紶鏂囦欢</el-button>
- </el-upload>
- <div v-if="existingAttachments.length > 0" class="attachment-list">
- <div
- v-for="(att, idx) in existingAttachments"
- :key="att.id || att.url || idx"
- class="attachment-item"
- >
- <el-icon><Document /></el-icon>
- <span class="attachment-name">{{ att.name || att.fileName || att.url || '闄勪欢' }}</span>
- <el-button link type="primary" size="small" @click="downloadAttachment(att)">涓嬭浇</el-button>
- </div>
- </div>
+ <el-form-item label="闄勪欢" prop="attachmentIds">
+ <AttachmentUploadFile
+ v-model:file-list="fileList"
+ :disabled="isView"
+ :limit="10"
+ />
+ </el-form-item>
</el-col>
</el-row>
- <el-row :gutter="20">
+ <el-row v-if="false" :gutter="20">
<el-col :span="24">
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="璇疯緭鍏�" maxlength="100" show-word-limit />
@@ -166,49 +133,7 @@
</div>
</div>
- <div class="section">
- <div class="section-header" @click="toggleSection('product')">
- <div class="section-title">
- <span class="section-bar" />
- <span>浜у搧淇℃伅</span>
- </div>
- <div class="section-actions" @click.stop>
- <el-button v-if="!isView" type="primary" @click="openProductForm('add')">娣诲姞</el-button>
- <el-button v-if="!isView" plain type="danger" @click="deleteProduct">鍒犻櫎</el-button>
- <el-icon class="toggle-icon" @click="toggleSection('product')">
- <ArrowDown v-if="sectionCollapsed.product" />
- <ArrowUp v-else />
- </el-icon>
- </div>
- </div>
- <div v-show="!sectionCollapsed.product" class="section-body">
- <el-table
- :data="productData"
- border
- show-summary
- :summary-method="summarizeProductTable"
- @selection-change="productSelected"
- >
- <el-table-column v-if="!isView" align="center" type="selection" width="55" />
- <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="unit" />
- <el-table-column label="鏁伴噺" prop="quantity" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" />
- <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
- <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column v-if="!isView" fixed="right" label="鎿嶄綔" min-width="60" align="center">
- <template #default="scope">
- <el-button link type="primary" size="small" @click="openProductForm('edit', scope.row, scope.$index)">缂栬緫</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
-
- <div class="section">
+ <div v-if="false" class="section">
<div class="section-header" @click="toggleSection('team')">
<div class="section-title">
<span class="section-bar" />
@@ -381,7 +306,7 @@
</div>
</div> -->
- <div class="section">
+ <div v-if="false" class="section">
<div class="section-header" @click="toggleSection('address')">
<div class="section-title">
<span class="section-bar" />
@@ -421,7 +346,7 @@
</div>
</div>
- <div class="section">
+ <div v-if="false" class="section">
<div class="section-header" @click="toggleSection('contact')">
<div class="section-title">
<span class="section-bar" />
@@ -639,9 +564,10 @@
<script setup name="ProjectManagementFormDia">
import { computed, getCurrentInstance, reactive, ref, toRefs } from 'vue'
-import { ArrowDown, ArrowUp, Delete, Plus, Document } from '@element-plus/icons-vue'
+import { ArrowDown, ArrowUp, Delete, Plus } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
-import { getToken } from '@/utils/auth'
+import AttachmentUploadFile from '@/components/AttachmentUpload/file/index.vue'
+import { listCustomer } from '@/api/basicData/customer.js'
import PIMTable from '@/components/PIMTable/PIMTable.vue'
import FormDialog from '@/components/Dialog/FormDialog.vue'
import { listPlan } from '@/api/projectManagement/projectType'
@@ -659,13 +585,11 @@
const operationType = ref('add')
const formRef = ref()
const fileList = ref([])
-const existingAttachments = ref([])
-const upload = reactive({
- url: import.meta.env.VITE_APP_BASE_API + '/basic/customer-follow/upload',
- headers: { Authorization: 'Bearer ' + getToken() }
-})
+const customerOptions = ref([])
const projectTypeOptions = ref([])
+// 椤圭洰鍒嗙被锛氬厛鍐欐鍑犱釜锛屽悗缁彲鍒囨崲涓哄瓧鍏�
+const projectClassificationOptions = ['鏁板瓧鍖栬浆鍨�', '鏅鸿兘鍒堕��', '绯荤粺闆嗘垚', '鍏朵粬']
const roleOptions = ref([])
const userOptions = ref([])
const productData = ref([])
@@ -725,8 +649,9 @@
projectName: '',
customerName: '',
parentProjectName: '',
- setupDate: '',
- projectSource: '',
+ setupDate: todayStr(),
+ projectSource: '鎵嬪姩娣诲姞',
+ projectClassification: '',
creatorName: '',
billStatus: '',
projectStage: '',
@@ -771,6 +696,8 @@
})
const isView = computed(() => operationType.value === 'view')
+// 鍚堝悓鐢熸垚鐨勯」鐩細鏉ユ簮涓轰笟鍔″鎵癸紝鍚堝悓淇℃伅鍙灞曠ず
+const isFromContract = computed(() => operationType.value !== 'add' && form.value.projectSource === '涓氬姟瀹℃壒')
const dialogTitle = computed(() => {
if (operationType.value === 'add') return '鏂板椤圭洰'
if (operationType.value === 'edit') return '缂栬緫椤圭洰'
@@ -813,6 +740,12 @@
sectionCollapsed[key] = !sectionCollapsed[key]
}
+function todayStr() {
+ const d = new Date()
+ const pad = n => String(n).padStart(2, '0')
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
+}
+
function resetFormData() {
Object.assign(form.value, {
id: undefined,
@@ -831,8 +764,9 @@
projectName: '',
customerName: '',
parentProjectName: '',
- setupDate: '',
- projectSource: '',
+ setupDate: todayStr(),
+ projectSource: '鎵嬪姩娣诲姞',
+ projectClassification: '',
creatorName: '',
billStatus: '',
projectStage: '',
@@ -1116,6 +1050,11 @@
const res = await listPlan({ current: 1, size: 999 })
const records = res?.data?.records || res?.records || res?.rows || []
projectTypeOptions.value = records.map(item => ({ label: item.name, value: item.id }))
+ // 鏈寚瀹氳鍒掓椂锛岄粯璁や娇鐢ㄢ�滈」鐩敵鎶ュ叚闃舵鈥濊鍒�
+ if (!form.value.projectManagementPlanId) {
+ const defaultPlan = records.find(item => item.name === '椤圭洰鐢虫姤鍏樁娈�') || records[0]
+ if (defaultPlan) form.value.projectManagementPlanId = defaultPlan.id
+ }
} catch {
projectTypeOptions.value = []
}
@@ -1142,6 +1081,21 @@
} catch {
userOptions.value = []
}
+}
+
+async function loadCustomerOptions() {
+ try {
+ const res = await listCustomer({ current: -1, size: -1, type: 0 })
+ const records = res?.data?.records || res?.data || res?.records || []
+ customerOptions.value = Array.isArray(records) ? records : []
+ } catch {
+ customerOptions.value = []
+ }
+}
+
+function handleCustomerChange(customerName) {
+ const customer = customerOptions.value.find(item => item.customerName === customerName)
+ form.value.clientId = customer?.id ?? null
}
function addTeamRow() {
@@ -1191,41 +1145,10 @@
if (index > -1) form.value.addressList.splice(index, 1)
}
-function beforeUpload() {
- if (isView.value) return false
- proxy.$modal?.loading?.('姝e湪涓婁紶鏂囦欢锛岃绋嶅��...')
- return true
-}
-
-function handleUploadError() {
- proxy.$modal?.closeLoading?.()
- ElMessage.error('涓婁紶鏂囦欢澶辫触')
-}
-
-function handleUploadSuccess(res, file) {
- console.log(res, file)
- proxy.$modal?.closeLoading?.()
- if (res?.code !== 200) {
- ElMessage.error(res?.msg || '涓婁紶澶辫触')
- return
- }
- const attachmentId = res?.data?.[0]?.id ?? ""
- if (!attachmentId) return
- form.value.attachmentIds.push(attachmentId)
- console.log(form.value.attachmentIds)
- ElMessage.success('涓婁紶鎴愬姛')
-}
-
-function handleRemove(file) {
- const attachmentId = file?.attachmentId
- if (!attachmentId) return
- form.value.attachmentIds = (form.value.attachmentIds || []).filter(id => id !== attachmentId)
-}
-
async function openDialog(payload = {}) {
operationType.value = payload.operationType || 'add'
resetFormData()
- await Promise.all([loadProjectTypeOptions(), loadRoleOptions(), loadUserOptions(), getProductOptions()])
+ await Promise.all([loadProjectTypeOptions(), loadRoleOptions(), loadUserOptions(), loadCustomerOptions(), getProductOptions()])
if (payload.row?.id) {
try {
const res = await getProject(payload.row.id)
@@ -1261,15 +1184,18 @@
estimatedDays: Number(info.estimatedDays) || computeEstimatedDays(info.planStartTime, info.planEndTime) || 0,
projectName: info.title ?? '',
customerName: info.clientName ?? '',
+ clientId: info.clientId ?? undefined,
parentProjectName: info.projectManagementInfoParentName ?? '',
setupDate: info.establishTime ?? '',
projectSource: info.source ?? '',
+ projectClassification: info.projectClassification ?? '',
creatorName: info.managerName ?? '',
billStatus: normalizeDictValue(info.status),
projectStage: normalizeDictValue(info.stage ?? info.projectStage),
planStartDate: info.planStartTime ?? '',
planEndDate: info.planEndTime ?? '',
projectAmount: info.orderAmount ?? 0,
+ orderDate: info.orderDate ?? '',
auditStatus: normalizeDictValue(info.reviewStatus),
remark: info.remark ?? '',
attachmentIds: Array.isArray(info.attachmentIds) ? info.attachmentIds : [],
@@ -1302,7 +1228,7 @@
contactRemark: contractInfo.rappresentanteLegale ?? ''
})
- existingAttachments.value = Array.isArray(info.attachmentList)
+ fileList.value = Array.isArray(info.attachmentList)
? info.attachmentList.map(a => ({
id: a.id ?? a.fileId,
name: a.fileName ?? a.name,
@@ -1360,45 +1286,6 @@
return
}
await formRef.value?.validate?.()
- if (!productData.value || productData.value.length === 0) {
- proxy.$modal?.msgWarning?.('璇锋坊鍔犱骇鍝佷俊鎭�')
- return
- }
- const findLabel = (list, value) => (list || []).find(i => String(i.value) === String(value))?.label
- const teamList = (form.value.teamList || []).map(t => ({
- userId: t.memberId,
- userName: findLabel(userOptions.value, t.memberId),
- userRoleId: t.roleId,
- userRoleName: findLabel(roleOptions.value, t.roleId),
- joinTime: t.enterDate,
- departTime: t.leaveDate,
- contact: t.phone,
- remark: t.remark
- }))
-
- const shippingRow = (form.value.addressList || [])[0] || {}
- const shippingAddress = {
- id: undefined,
- consignee: shippingRow.receiver,
- contract: shippingRow.phone,
- address: shippingRow.address
- }
-
- const contractInfo = {
- id: undefined,
- name: form.value.contactName,
- sex: form.value.contactGender === '1' ? '鐢�' : form.value.contactGender === '2' ? '濂�' : '',
- birthday: form.value.contactBirthday,
- department: form.value.contactDept,
- job: form.value.contactJob,
- phoneNumber: form.value.contactMobile,
- email: form.value.contactEmail,
- qq: form.value.contactQq,
- lineaFissa: form.value.contactWorkWechat,
- wx: form.value.contactWechat,
- origineEtnica: form.value.contactAddress,
- rappresentanteLegale: form.value.contactRemark
- }
const info = {
id: form.value.id ?? null,
no: form.value.billNo,
@@ -1407,8 +1294,9 @@
clientName: form.value.customerName,
projectManagementInfoParentId: form.value.parentProjectId ?? null,
projectManagementPlanId: form.value.projectManagementPlanId ?? null,
- establishTime: form.value.setupDate,
+ establishTime: form.value.setupDate || todayStr(),
source: form.value.projectSource,
+ projectClassification: form.value.projectClassification,
managerId: form.value.managerId ?? null,
managerName: form.value.creatorName,
salesmanId: form.value.salesmanId ?? null,
@@ -1425,15 +1313,17 @@
reviewStatus: form.value.auditStatus === '' || form.value.auditStatus === undefined || form.value.auditStatus === null ? null : Number(form.value.auditStatus),
stage: form.value.projectStage === '' || form.value.projectStage === undefined || form.value.projectStage === null ? null : Number(form.value.projectStage),
remark: form.value.remark,
- attachmentIds: Array.isArray(form.value.attachmentIds) ? form.value.attachmentIds : [],
- teamList
+ attachmentIds: (fileList.value || [])
+ .map(f => (f?.id ?? f?.rawData?.id))
+ .filter(v => v !== undefined && v !== null && v !== '')
+ .map(String)
}
const payload = {
info,
- shippingAddress,
- contractInfo,
- salesLedgerProductList: productData.value
+ shippingAddress: null,
+ contractInfo: null,
+ salesLedgerProductList: null
}
const req = operationType.value === 'edit' ? updateProject : addProject
diff --git a/src/views/projectManagement/Management/index.vue b/src/views/projectManagement/Management/index.vue
index 0438aef..f1e1161 100644
--- a/src/views/projectManagement/Management/index.vue
+++ b/src/views/projectManagement/Management/index.vue
@@ -187,7 +187,7 @@
setupDate: r.establishTime ?? r.setupDate,
projectType: r.planName ?? r.projectType,
projectSource: r.source ?? r.projectSource,
- projectClassification: r.departmentName ?? r.projectClassification,
+ projectClassification: r.projectClassification,
raw: r
}))
pagination.value.total = response?.total || response?.data?.total || 0
diff --git a/src/views/projectManagement/Management/projectDetail.vue b/src/views/projectManagement/Management/projectDetail.vue
index be670cb..f8d9f9c 100644
--- a/src/views/projectManagement/Management/projectDetail.vue
+++ b/src/views/projectManagement/Management/projectDetail.vue
@@ -5,48 +5,41 @@
<div class="header-title">椤圭洰璇︽儏</div>
<div class="header-actions">
<el-button style="color: white;background: #002FA7;" @click="openProgressReport">杩涘害姹囨姤</el-button>
- <!-- <el-button type="danger" @click="openDiscussProgress">娲借皥杩涘害</el-button> -->
<el-button @click="goBack">杩斿洖</el-button>
</div>
</div>
- <el-steps v-if="steps.length > 0" :active="activeStep" align-center finish-status="success">
- <el-step v-for="(s, idx) in steps" :key="idx" :title="s" />
- </el-steps>
+ <div v-if="stageSteps.length > 0" class="progress-block">
+ <el-steps :active="activeStep" align-center finish-status="success">
+ <el-step v-for="(s, idx) in stageSteps" :key="idx" :title="s.name" />
+ </el-steps>
+ <div class="progress-percent">
+ <span class="progress-label">鏁翠綋杩涘害</span>
+ <el-progress :percentage="overallProgress" :stroke-width="12" style="flex: 1" />
+ </div>
+ </div>
</el-card>
<el-card class="content-card" shadow="never" v-loading="loading">
<el-tabs v-model="activeTab">
<el-tab-pane label="鍩虹璧勬枡" name="base">
<el-descriptions :column="4" border>
- <el-descriptions-item label="椤圭洰ID">{{ info.id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="鍗曟嵁缂栧彿">{{ info.no || '-' }}</el-descriptions-item>
<el-descriptions-item label="椤圭洰鍚嶇О">{{ info.title || '-' }}</el-descriptions-item>
<el-descriptions-item label="瀹㈡埛鍚嶇О">{{ info.clientName || '-' }}</el-descriptions-item>
- <el-descriptions-item label="瀹㈡埛ID">{{ info.clientId ?? '-' }}</el-descriptions-item>
+ <el-descriptions-item label="椤圭洰鍒嗙被">{{ info.projectClassification || '-' }}</el-descriptions-item>
<el-descriptions-item label="鐖堕」鐩�">{{ parentProjectLabel }}</el-descriptions-item>
- <el-descriptions-item label="椤圭洰绫诲瀷">{{ projectTypeLabel }}</el-descriptions-item>
<el-descriptions-item label="绔嬮」鏃ユ湡">{{ info.establishTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="椤圭洰鏉ユ簮">{{ info.source || '-' }}</el-descriptions-item>
- <el-descriptions-item label="绔嬮」浜�">{{ info.managerName || '-' }}</el-descriptions-item>
- <el-descriptions-item label="涓氬姟鍛�">{{ info.salesmanName || '-' }}</el-descriptions-item>
- <el-descriptions-item label="閮ㄩ棬">{{ info.departmentName || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鍗曟嵁鐘舵��">
- <dict-tag :options="bill_status" :value="String(info.status ?? '')" />
- </el-descriptions-item>
+ <el-descriptions-item label="褰撳墠闃舵">{{ currentStageName }}</el-descriptions-item>
<el-descriptions-item label="瀹℃牳鐘舵��">
<dict-tag :options="project_management" :value="String(info.reviewStatus ?? '')" />
</el-descriptions-item>
- <el-descriptions-item label="璁″垝鐘舵��">
- <dict-tag :options="plan_status" :value="String(info.stage ?? '')" />
- </el-descriptions-item>
- <el-descriptions-item label="棰勮宸ユ湡(澶�)">{{ estimatedDays }}</el-descriptions-item>
- <el-descriptions-item label="璁″垝寮�濮嬫棩鏈�">{{ info.planStartTime || '-' }}</el-descriptions-item>
- <el-descriptions-item label="璁″垝瀹屾垚鏃ユ湡">{{ info.planEndTime || '-' }}</el-descriptions-item>
- <el-descriptions-item label="瀹為檯寮�濮嬫棩鏈�">{{ info.actualStartTime || '-' }}</el-descriptions-item>
- <el-descriptions-item label="瀹為檯瀹屾垚鏃ユ湡">{{ info.actualEndTime || '-' }}</el-descriptions-item>
- <el-descriptions-item label="璁㈠崟鏃ユ湡">{{ info.orderDate || '-' }}</el-descriptions-item>
- <el-descriptions-item label="椤圭洰閲戦">{{ info.orderAmount ?? '-' }}</el-descriptions-item>
- <el-descriptions-item label="澶囨敞" :span="4">{{ info.remark || '-' }}</el-descriptions-item>
+ </el-descriptions>
+
+ <el-descriptions v-if="isFromContract" :column="3" border style="margin-top: 14px;">
+ <el-descriptions-item label="鍚堝悓瀹㈡埛">{{ info.clientName || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓閲戦(鍏�)">{{ info.orderAmount ?? '-' }}</el-descriptions-item>
+ <el-descriptions-item label="鍚堝悓鏃ユ湡">{{ info.orderDate || '-' }}</el-descriptions-item>
</el-descriptions>
<div class="attachment-block" v-if="attachments.length > 0">
@@ -59,81 +52,6 @@
</div>
</div>
</div>
-
- <el-divider content-position="left">浜у搧淇℃伅</el-divider>
- <el-table :data="productRows" border show-summary :summary-method="summarizeProductTable">
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="浜у搧澶х被" prop="productCategory" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" show-overflow-tooltip />
- <el-table-column label="鍗曚綅" prop="unit" width="90" />
- <el-table-column label="鏁伴噺" prop="quantity" width="90" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" width="90" />
- <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
- <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
- <el-table-column label="鍙戠エ绫诲瀷" prop="invoiceType" width="110" />
- </el-table>
-
- <el-divider content-position="left">椤圭洰鍥㈤槦</el-divider>
- <el-table :data="teamRows" border>
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column label="濮撳悕" prop="userName" show-overflow-tooltip />
- <el-table-column label="椤圭洰缁勮鑹�" prop="userRoleName" show-overflow-tooltip />
- <el-table-column label="杩涘叆鏃ユ湡" prop="joinTime" width="140" />
- <el-table-column label="绂诲紑鏃ユ湡" prop="departTime" width="140" />
- <el-table-column label="鑱旂郴鏂瑰紡" prop="contact" show-overflow-tooltip />
- <el-table-column label="澶囨敞" prop="remark" show-overflow-tooltip />
- </el-table>
-
- <el-divider content-position="left">鏀惰揣鍦板潃</el-divider>
- <el-descriptions :column="3" border>
- <el-descriptions-item label="鏀惰揣浜�">{{ shippingAddress.consignee || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鑱旂郴鏂瑰紡">{{ shippingAddress.contract || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鍦板潃">{{ shippingAddress.address || '-' }}</el-descriptions-item>
- </el-descriptions>
-
- <el-divider content-position="left">鑱旂郴淇℃伅</el-divider>
- <el-descriptions :column="4" border>
- <el-descriptions-item label="鑱旂郴浜�">{{ contractInfo.name || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鎬у埆">{{ contractInfo.sex || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鐢熸棩">{{ contractInfo.birthday || '-' }}</el-descriptions-item>
- <el-descriptions-item label="閮ㄩ棬">{{ contractInfo.department || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鑱屽姟">{{ contractInfo.job || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鎵嬫満鍙�">{{ contractInfo.phoneNumber || '-' }}</el-descriptions-item>
- <el-descriptions-item label="閭">{{ contractInfo.email || '-' }}</el-descriptions-item>
- <el-descriptions-item label="QQ">{{ contractInfo.qq || '-' }}</el-descriptions-item>
- <el-descriptions-item label="鍥哄畾鐢佃瘽">{{ contractInfo.lineaFissa || '-' }}</el-descriptions-item>
- <el-descriptions-item label="寰俊">{{ contractInfo.wx || '-' }}</el-descriptions-item>
- <el-descriptions-item label="绫嶈疮">{{ contractInfo.origineEtnica || '-' }}</el-descriptions-item>
- <el-descriptions-item label="娉曚汉浠h〃">{{ contractInfo.rappresentanteLegale || '-' }}</el-descriptions-item>
- </el-descriptions>
- </el-tab-pane>
-
- <el-tab-pane label="椤圭洰绫诲瀷" name="plan">
- <el-descriptions :column="4" border>
- <el-descriptions-item label="绫诲瀷鍚嶇О">{{ projectPlan.name || '-' }}</el-descriptions-item>
- <el-descriptions-item label="澶囨敞" :span="3">{{ projectPlan.description || '-' }}</el-descriptions-item>
- </el-descriptions>
-
- <div class="attachment-block" v-if="planAttachments.length > 0">
- <div class="attachment-title">绫诲瀷闄勪欢</div>
- <div class="attachment-list">
- <div v-for="(att, idx) in planAttachments" :key="att.id || att.url || idx" class="attachment-item">
- <el-icon><Document /></el-icon>
- <span class="attachment-name">{{ att.name || att.fileName || att.url || '闄勪欢' }}</span>
- <el-button link type="primary" size="small" @click="downloadAttachment(att)">涓嬭浇</el-button>
- </div>
- </div>
- </div>
-
- <el-table :data="planNodeRows" border style="margin-top: 14px;">
- <el-table-column align="center" label="姝ラ" type="index" width="80" />
- <el-table-column label="闃舵鍚嶇О" prop="name" min-width="160" show-overflow-tooltip />
- <el-table-column label="璐熻矗浜�" prop="leaderName" width="140" show-overflow-tooltip />
- <el-table-column label="棰勮宸ユ湡(澶�)" prop="estimatedDuration" width="140" />
- <el-table-column label="宸ユ椂鍗曚环" prop="hourlyRate" width="120" />
- <el-table-column label="浣滀笟鍐呭" prop="workContent" min-width="180" show-overflow-tooltip />
- </el-table>
</el-tab-pane>
<el-tab-pane label="椤圭洰闃舵" name="stage">
@@ -147,13 +65,13 @@
<el-table-column label="璁″垝缁撴潫" prop="planEndTime" width="120" />
<el-table-column label="瀹為檯寮�濮�" prop="actualStartTime" width="120" />
<el-table-column label="瀹為檯缁撴潫" prop="actualEndTime" width="120" />
- <el-table-column label="棰勮宸ユ湡(澶�)" prop="estimatedDuration" width="130" />
+ <el-table-column label="鏈杩涘害鏃ユ湡" prop="reportDate" width="130" />
<el-table-column label="闄勪欢" width="90" align="center">
<template #default="{ row }">
<span>{{ row.attachmentCount }}</span>
</template>
</el-table-column>
- <el-table-column v-if="false" label="鎿嶄綔" width="100" align="center" fixed="right" >
+ <el-table-column v-if="false" label="鎿嶄綔" width="100" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="danger" size="small" @click="handleDeleteStage(row)">鍒犻櫎</el-button>
</template>
@@ -169,15 +87,9 @@
:project-id="info.id"
:project-info="info"
:plan-nodes="planNodeRows"
+ :stage-records="stageNodeRows"
:default-plan-node-id="defaultPlanNodeId"
@submitted="handleProgressSubmitted"
- />
- <DiscussProgressDialog
- v-model="discussProgressVisible"
- :project-id="info.id"
- :plan-nodes="planNodeRows"
- :default-plan-node-id="defaultPlanNodeId"
- @submitted="handleDiscussSubmitted"
/>
</template>
@@ -186,54 +98,28 @@
import { useRoute, useRouter } from 'vue-router'
import { Document } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
-import { getProject, saveStage, listStage, deleteStage } from '@/api/projectManagement/project'
+import { getProject, saveStage, listStage, deleteStage, updateProject } from '@/api/projectManagement/project'
import { listPlan } from '@/api/projectManagement/projectType'
import ProgressReportDialog from '@/components/ProjectManagement/ProgressReportDialog.vue'
-import DiscussProgressDialog from '@/components/ProjectManagement/DiscussProgressDialog.vue'
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance()
const route = useRoute()
const router = useRouter()
-const { bill_status, project_management, plan_status } = proxy.useDict('bill_status', 'project_management', 'plan_status')
+const { project_management } = proxy.useDict('project_management')
const loading = ref(false)
const activeTab = ref('base')
const progressReportVisible = ref(false)
-const discussProgressVisible = ref(false)
const userStore = useUserStore()
const info = ref({})
-const shippingAddress = ref({})
-const contractInfo = ref({})
-const productRows = ref([])
-const teamRows = ref([])
const attachments = ref([])
const projectTypeMap = ref(new Map())
-const projectPlan = ref({})
const planNodeRows = ref([])
-const planAttachments = ref([])
const stageNodeRows = ref([])
-const estimatedDays = computed(() => {
- const raw = info.value?.estimatedDays
- const n = Number(raw)
- if (Number.isFinite(n) && n > 0) return n
- const start = info.value?.planStartTime
- const end = info.value?.planEndTime
- if (!start || !end) return 0
- const startTime = new Date(`${start}T00:00:00`).getTime()
- const endTime = new Date(`${end}T00:00:00`).getTime()
- if (!Number.isFinite(startTime) || !Number.isFinite(endTime) || endTime < startTime) return 0
- return Math.floor((endTime - startTime) / (24 * 60 * 60 * 1000)) + 1
-})
-
-const projectTypeLabel = computed(() => {
- const id = info.value?.projectManagementPlanId
- if (id === undefined || id === null || id === '') return '-'
- const p = projectTypeMap.value.get(Number(id))
- return p?.name || String(id)
-})
+const isFromContract = computed(() => info.value?.source === '涓氬姟瀹℃壒')
const parentProjectLabel = computed(() => {
return (
@@ -244,32 +130,62 @@
)
})
-const planStageEnum = computed(() => {
- const list = Array.isArray(plan_status) ? plan_status : []
- return list.map(i => ({ value: String(i.value), label: i.label }))
+// 鍚勯樁娈靛綋鍓嶈繘搴︼紙鍚屼竴闃舵澶氭姹囨姤鍙栨渶澶у�硷級
+const stageProgressMap = computed(() => {
+ const map = {}
+ stageNodeRows.value.forEach(r => {
+ const key = String(r.projectManagementPlanNodeId ?? '')
+ if (!key) return
+ map[key] = Math.max(map[key] || 0, Number(r.progress) || 0)
+ })
+ return map
})
-const steps = computed(() => {
- const nodes = Array.isArray(planNodeRows.value) ? planNodeRows.value : []
- const sorted = [...nodes].sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
- const labels = sorted.map(i => i.name || i.workContent).filter(Boolean)
- return labels.length > 0 ? labels : planStageEnum.value.map(i => i.label)
+// 闃舵杩涘害鏉℃暟鎹細浼樺厛浣跨敤椤圭洰涓婂悓姝ョ殑 planStage
+const stageSteps = computed(() => {
+ const planStages = Array.isArray(info.value?.planStage) ? info.value.planStage : []
+ if (planStages.length > 0) {
+ return [...planStages]
+ .sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
+ .map(i => ({
+ id: i.id,
+ name: i.name || String(i.id ?? ''),
+ status: Number(i.planStageEnum) || 1,
+ progress: stageProgressMap.value[String(i.id)] ?? 0
+ }))
+ }
+ const nodes = [...(planNodeRows.value || [])].sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
+ return nodes.map(n => {
+ const progress = stageProgressMap.value[String(n.id)] ?? 0
+ return {
+ id: n.id,
+ name: n.name || n.workContent || String(n.id ?? ''),
+ status: progress >= 100 ? 3 : progress > 0 ? 2 : 1,
+ progress
+ }
+ })
})
const activeStep = computed(() => {
- const statusOrStage = info.value?.stage ?? info.value?.status
- const enumList = planStageEnum.value
- // 浼樺厛浣跨敤 planStageEnum 鐨� value 鍖归厤
- const found = enumList.find(i => i.value === String(statusOrStage))
- const label = found?.label
- // 鍦ㄩ」鐩被鍨嬭妭鐐逛腑鏌ユ壘瀵瑰簲 label 鐨勪笅鏍�
- const nodeLabels = steps.value
- const idxByLabel = label ? nodeLabels.findIndex(l => String(l) === String(label)) : -1
- if (idxByLabel >= 0) return idxByLabel + 1
- // 鍥為��锛氬鏋� statusOrStage 鏄暟瀛楃储寮�
- const n = Number(statusOrStage)
- if (Number.isFinite(n) && n > 0) return Math.min(n, nodeLabels.length)
- return 0
+ const idx = stageSteps.value.findIndex(s => s.status !== 3)
+ return idx === -1 ? stageSteps.value.length : idx
+})
+
+const currentStageName = computed(() => {
+ const current = stageSteps.value.find(s => s.status === 2) || stageSteps.value[activeStep.value]
+ return current?.name || '-'
+})
+
+const overallProgress = computed(() => {
+ const list = stageSteps.value
+ if (list.length === 0) return 0
+ const sum = list.reduce((acc, s) => acc + (Number(s.progress) || 0), 0)
+ return Math.round(sum / list.length)
+})
+
+const defaultPlanNodeId = computed(() => {
+ const next = stageSteps.value.find(s => s.status !== 3)
+ return next?.id ?? stageSteps.value[stageSteps.value.length - 1]?.id
})
function goBack() {
@@ -280,27 +196,30 @@
progressReportVisible.value = true
}
-function openDiscussProgress() {
- discussProgressVisible.value = true
+async function saveTeamIfNeeded(teamList) {
+ if (!Array.isArray(teamList)) return
+ const attachmentIds = attachments.value
+ .map(a => a.id ?? a.fileId)
+ .filter(v => v !== undefined && v !== null && v !== '')
+ .map(String)
+ const res = await updateProject({
+ info: {
+ id: info.value?.id,
+ no: info.value?.no,
+ title: info.value?.title,
+ projectManagementPlanId: info.value?.projectManagementPlanId,
+ teamList,
+ attachmentIds
+ }
+ })
+ if (res?.code !== 200) throw new Error(res?.msg || '鍥㈤槦淇濆瓨澶辫触')
}
-
-const defaultPlanNodeId = computed(() => {
- const nodes = Array.isArray(planNodeRows.value) ? planNodeRows.value : []
- if (nodes.length === 0) return undefined
- const stageVal = info.value?.stage
- const direct = nodes.find(n => String(n.id) === String(stageVal))
- if (direct?.id) return direct.id
- const sorted = [...nodes].sort((a, b) => Number(a.sort ?? 0) - Number(b.sort ?? 0))
- const idx = Number(stageVal)
- if (Number.isFinite(idx)) {
- const byIndex = sorted[idx - 1] || sorted[idx] || sorted[0]
- if (byIndex?.id) return byIndex.id
- }
- return sorted[0]?.id
-})
async function handleProgressSubmitted(payload) {
try {
+ if (Array.isArray(payload.teamList)) {
+ await saveTeamIfNeeded(payload.teamList)
+ }
const nodes = Array.isArray(planNodeRows.value) ? planNodeRows.value : []
const node = nodes.find(n => String(n.id) === String(payload.planNodeId)) || {}
const description = payload.remark
@@ -312,13 +231,13 @@
projectManagementInfoId: info.value?.id,
description,
actualLeaderId: userStore.id || info.value?.managerId,
- actualLeaderName: userStore.nickName || info.value?.managerName || info.value?.managerName,
+ actualLeaderName: userStore.nickName || info.value?.managerName || '',
estimatedDuration: Number(node.estimatedDuration ?? 0) || 0,
planStartTime: payload.planStartTime || info.value?.planStartTime,
planEndTime: payload.planEndTime || info.value?.planEndTime,
actualStartTime: payload.actualStartTime || null,
actualEndTime: payload.actualEndTime || null,
- progress: Number(payload.totalProgress ?? payload.completionProgress ?? 0) || 0,
+ progress: Number(payload.completionProgress ?? payload.totalProgress ?? 0) || 0,
storageBlobDTOs: Array.isArray(payload.storageBlobDTOs) ? payload.storageBlobDTOs : []
}
const res = await saveStage(req)
@@ -329,45 +248,14 @@
}
ElMessage.error(res?.msg || '鎻愪氦澶辫触')
} catch (e) {
- ElMessage.error('鎻愪氦澶辫触')
- }
-}
-
-async function handleDiscussSubmitted(payload) {
- try {
- const nodes = Array.isArray(planNodeRows.value) ? planNodeRows.value : []
- const node = nodes.find(n => String(n.id) === String(payload.planNodeId)) || {}
- const req = {
- id: null,
- projectManagementPlanNodeId: payload.planNodeId,
- projectManagementInfoId: info.value?.id,
- description: payload.remark,
- actualLeaderId: userStore.id || info.value?.managerId,
- actualLeaderName: userStore.nickName || info.value?.managerName || info.value?.managerName,
- estimatedDuration: Number(node.estimatedDuration ?? 0) || 0,
- planStartTime: info.value?.planStartTime,
- planEndTime: info.value?.planEndTime,
- actualStartTime: info.value?.actualStartTime || null,
- actualEndTime: info.value?.actualEndTime || null,
- progress: Number(info.value?.progress ?? 0) || 0,
- attachmentIds: Array.isArray(payload.attachmentIds) ? payload.attachmentIds : []
- }
- const res = await saveStage(req)
- if (res?.code === 200) {
- ElMessage.success('鎻愪氦鎴愬姛')
- await Promise.all([loadDetail(), loadStageList()])
- return
- }
- ElMessage.error(res?.msg || '鎻愪氦澶辫触')
- } catch (e) {
- ElMessage.error('鎻愪氦澶辫触')
+ ElMessage.error(e?.message || '鎻愪氦澶辫触')
}
}
function downloadAttachment(row) {
if (row?.url) {
try {
- proxy.$download.byUrl(row.url, row.originalFilename);
+ proxy.$download.byUrl(row.url, row.originalFilename)
return
} catch (e) {}
}
@@ -403,11 +291,12 @@
const records = Array.isArray(list) ? list : []
stageNodeRows.value = records.map(r => {
const attachmentList = Array.isArray(r.attachmentList) ? r.attachmentList : []
- const attachmentIds = Array.isArray(r.attachmentIds) ? r.attachmentIds : []
+ const blobList = Array.isArray(r.storageBlobVOs) ? r.storageBlobVOs : []
return {
...r,
stageName: getPlanNodeName(r.projectManagementPlanNodeId),
- attachmentCount: attachmentList.length || attachmentIds.length || 0
+ reportDate: r.createTime ? String(r.createTime).slice(0, 10) : '',
+ attachmentCount: attachmentList.length || blobList.length || 0
}
})
} catch {
@@ -437,15 +326,11 @@
function syncProjectPlan() {
const id = info.value?.projectManagementPlanId
if (id === undefined || id === null || id === '') {
- projectPlan.value = {}
planNodeRows.value = []
- planAttachments.value = []
return
}
const plan = projectTypeMap.value.get(Number(id)) || {}
- projectPlan.value = plan || {}
planNodeRows.value = Array.isArray(plan?.planNodeList) ? plan.planNodeList : []
- planAttachments.value = Array.isArray(plan?.attachmentList) ? plan.attachmentList : []
}
async function loadDetail() {
@@ -456,10 +341,6 @@
const res = await getProject(id)
const detail = res?.data?.data ?? res?.data ?? res
info.value = detail?.info || {}
- shippingAddress.value = detail?.shippingAddress || {}
- contractInfo.value = detail?.contractInfo || {}
- productRows.value = Array.isArray(detail?.salesLedgerProductList) ? detail.salesLedgerProductList : []
- teamRows.value = Array.isArray(detail?.info?.teamList) ? detail.info.teamList : []
attachments.value = Array.isArray(detail?.info?.attachmentList) ? detail.info.attachmentList : []
syncProjectPlan()
await loadStageList()
@@ -475,12 +356,6 @@
</script>
<style scoped lang="scss">
-.section-bar {
- width: 3px;
- height: 14px;
- background: #002FA7;
- border-radius: 2px;
-}
.header-card {
margin-bottom: 14px;
}
@@ -495,6 +370,23 @@
.header-title {
font-weight: 600;
font-size: 16px;
+}
+
+.progress-block {
+ padding-top: 6px;
+}
+
+.progress-percent {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin-top: 16px;
+}
+
+.progress-label {
+ font-size: 13px;
+ color: #606266;
+ white-space: nowrap;
}
.content-card {
@@ -529,4 +421,3 @@
white-space: nowrap;
}
</style>
-
diff --git a/src/views/salesManagement/reportAudit/index.vue b/src/views/salesManagement/reportAudit/index.vue
new file mode 100644
index 0000000..aa0d6a2
--- /dev/null
+++ b/src/views/salesManagement/reportAudit/index.vue
@@ -0,0 +1,323 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <div>
+ <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
+ <el-input v-model="searchForm.customerName"
+ style="width: 220px; margin-right: 10px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter="handleQuery" />
+ <span class="search_title">鎶ヨ〃骞村害锛�</span>
+ <el-select v-model="searchForm.reportYear"
+ style="width: 150px; margin-right: 10px"
+ placeholder="鍏ㄩ儴"
+ clearable
+ @change="handleQuery">
+ <el-option v-for="year in yearOptions"
+ :key="year"
+ :label="year + '骞�'"
+ :value="year" />
+ </el-select>
+ <span class="search_title">瀹℃壒鐘舵�侊細</span>
+ <el-select v-model="searchForm.auditStatus"
+ style="width: 150px"
+ placeholder="鍏ㄩ儴"
+ clearable
+ @change="handleQuery">
+ <el-option label="寰呭鎵�"
+ :value="0" />
+ <el-option label="宸查�氳繃"
+ :value="1" />
+ <el-option label="宸查��鍥�"
+ :value="2" />
+ </el-select>
+ <el-button type="primary"
+ style="margin-left: 10px"
+ @click="handleQuery">鎼滅储</el-button>
+ <el-button @click="resetQuery">閲嶇疆</el-button>
+ </div>
+ </div>
+ <el-table v-loading="loading"
+ :data="pagedData"
+ border
+ size="small"
+ style="margin-top: 10px">
+ <el-table-column prop="customerName"
+ label="瀹㈡埛鍚嶇О"
+ min-width="180"
+ show-overflow-tooltip />
+ <el-table-column prop="reportYear"
+ label="骞村害"
+ width="80"
+ align="center" />
+ <el-table-column prop="reportName"
+ label="鎶ヨ〃鍚嶇О"
+ min-width="160"
+ show-overflow-tooltip />
+ <el-table-column label="鎶ヨ〃闄勪欢"
+ min-width="240">
+ <template #default="scope">
+ <FileUpload v-model="scope.row.reportFiles"
+ disabled
+ :is-show-tip="false" />
+ </template>
+ </el-table-column>
+ <el-table-column prop="uploadUserName"
+ label="鎻愪氦浜�"
+ width="100" />
+ <el-table-column prop="updateTime"
+ label="鎻愪氦鏃堕棿"
+ width="160" />
+ <el-table-column label="瀹℃壒鐘舵��"
+ width="100"
+ align="center">
+ <template #default="scope">
+ <el-tag :type="statusTagType(scope.row.auditStatus)">
+ {{ statusText(scope.row.auditStatus) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="auditUserName"
+ label="瀹℃壒浜�"
+ width="100" />
+ <el-table-column prop="auditRemark"
+ label="瀹℃壒鎰忚"
+ min-width="160"
+ show-overflow-tooltip />
+ <el-table-column label="鎿嶄綔"
+ width="130"
+ align="center"
+ fixed="right">
+ <template #default="scope">
+ <el-button type="primary"
+ link
+ v-hasPermi="['sales:report:audit']"
+ @click="openAuditDialog(scope.row)">瀹℃壒</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div v-if="total > 0"
+ class="pagination-wrap">
+ <el-pagination v-model:current-page="page.current"
+ v-model:page-size="page.size"
+ :page-sizes="[10, 20, 50]"
+ :total="total"
+ layout="total, sizes, prev, pager, next"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange" />
+ </div>
+ <div v-else-if="!loading"
+ class="no-record">鏆傛棤瀹㈡埛鐢虫姤鏁版嵁</div>
+ <!-- 瀹℃壒寮圭獥 -->
+ <el-dialog v-model="auditDialogVisible"
+ title="鐢虫姤瀹℃壒"
+ width="760px"
+ @close="closeAuditDialog">
+ <el-descriptions :column="2"
+ border
+ size="small">
+ <el-descriptions-item label="瀹㈡埛鍚嶇О">{{ auditForm.customerName }}</el-descriptions-item>
+ <el-descriptions-item label="鎶ヨ〃骞村害">{{ auditForm.reportYear }}骞�</el-descriptions-item>
+ <el-descriptions-item label="鎶ヨ〃鍚嶇О">{{ auditForm.reportName }}</el-descriptions-item>
+ <el-descriptions-item label="鎻愪氦浜�">{{ auditForm.uploadUserName }}</el-descriptions-item>
+ <el-descriptions-item label="鎻愪氦鏃堕棿">{{ auditForm.updateTime }}</el-descriptions-item>
+ <el-descriptions-item label="褰撳墠鐘舵��">{{ statusText(auditForm.auditStatus) }}</el-descriptions-item>
+ </el-descriptions>
+ <div class="audit-files">
+ <div class="audit-files-title">鎶ヨ〃闄勪欢</div>
+ <FileUpload v-model="auditForm.reportFiles"
+ disabled
+ :is-show-tip="false" />
+ </div>
+ <el-form :model="auditForm"
+ label-width="90px"
+ style="margin-top: 12px">
+ <el-form-item label="瀹℃壒缁撴灉">
+ <el-radio-group v-model="auditForm.auditStatus">
+ <el-radio :value="1">閫氳繃</el-radio>
+ <el-radio :value="2">閫�鍥�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="瀹℃壒鎰忚">
+ <el-input v-model="auditForm.auditRemark"
+ type="textarea"
+ :rows="3"
+ maxlength="500"
+ show-word-limit
+ placeholder="閫�鍥炴椂璇峰~鍐欓��鍥炲師鍥�" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeAuditDialog">鍙� 娑�</el-button>
+ <el-button type="primary"
+ :loading="auditSaving"
+ @click="submitAudit">纭� 瀹�</el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+
+<script setup>
+ import { computed, getCurrentInstance, onMounted, reactive, ref } from "vue";
+ import FileUpload from "@/components/FileUpload/index.vue";
+ import {
+ auditListCustomerFinancialReport,
+ auditCustomerFinancialReport,
+ } from "@/api/basicData/customerFinancialReport";
+
+ const { proxy } = getCurrentInstance();
+ const nowYear = new Date().getFullYear();
+ const yearOptions = [nowYear, nowYear - 1, nowYear - 2];
+ const searchForm = reactive({ customerName: "", reportYear: "", auditStatus: "" });
+ const listData = ref([]);
+ const loading = ref(false);
+ const total = ref(0);
+ const page = reactive({ current: 1, size: 10 });
+
+ const pagedData = computed(() => {
+ const start = (page.current - 1) * page.size;
+ return listData.value.slice(start, start + page.size);
+ });
+
+ const statusText = status => {
+ if (status === 1) return "宸查�氳繃";
+ if (status === 2) return "宸查��鍥�";
+ return "寰呭鎵�";
+ };
+ const statusTagType = status => {
+ if (status === 1) return "success";
+ if (status === 2) return "danger";
+ return "warning";
+ };
+
+ const load = () => {
+ loading.value = true;
+ auditListCustomerFinancialReport({
+ customerName: searchForm.customerName,
+ reportYear: searchForm.reportYear,
+ auditStatus: searchForm.auditStatus,
+ }).then(res => {
+ listData.value = res.data || [];
+ total.value = listData.value.length;
+ if (page.current > 1 && pagedData.value.length === 0) {
+ page.current = 1;
+ }
+ }).finally(() => {
+ loading.value = false;
+ });
+ };
+
+ const handleQuery = () => {
+ page.current = 1;
+ load();
+ };
+ const resetQuery = () => {
+ searchForm.customerName = "";
+ searchForm.reportYear = "";
+ searchForm.auditStatus = "";
+ handleQuery();
+ };
+ const handleSizeChange = size => {
+ page.size = size;
+ page.current = 1;
+ };
+ const handleCurrentChange = current => {
+ page.current = current;
+ };
+
+ const auditDialogVisible = ref(false);
+ const auditSaving = ref(false);
+ const auditForm = reactive({
+ id: "",
+ customerName: "",
+ reportYear: "",
+ reportName: "",
+ reportFiles: "",
+ uploadUserName: "",
+ updateTime: "",
+ auditStatus: 1,
+ auditRemark: "",
+ });
+
+ const openAuditDialog = row => {
+ Object.keys(auditForm).forEach(key => {
+ auditForm[key] = row[key] !== undefined && row[key] !== null ? row[key] : auditForm[key];
+ });
+ auditForm.id = row.id;
+ auditForm.customerName = row.customerName;
+ auditForm.reportYear = row.reportYear;
+ auditForm.reportName = row.reportName;
+ auditForm.reportFiles = row.reportFiles;
+ auditForm.uploadUserName = row.uploadUserName;
+ auditForm.updateTime = row.updateTime;
+ auditForm.auditStatus = 1;
+ auditForm.auditRemark = "";
+ auditDialogVisible.value = true;
+ };
+
+ const closeAuditDialog = () => {
+ auditDialogVisible.value = false;
+ };
+
+ const submitAudit = () => {
+ if (!auditForm.auditStatus) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瀹℃壒缁撴灉");
+ return;
+ }
+ if (auditForm.auditStatus === 2 && !auditForm.auditRemark) {
+ proxy.$modal.msgWarning("閫�鍥炴椂璇峰~鍐欓��鍥炲師鍥�");
+ return;
+ }
+ auditSaving.value = true;
+ auditCustomerFinancialReport({
+ id: auditForm.id,
+ auditStatus: auditForm.auditStatus,
+ auditRemark: auditForm.auditRemark,
+ }).then(() => {
+ proxy.$modal.msgSuccess("瀹℃壒瀹屾垚");
+ auditDialogVisible.value = false;
+ load();
+ }).finally(() => {
+ auditSaving.value = false;
+ });
+ };
+
+ onMounted(load);
+</script>
+
+<style scoped>
+ .search_form {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 10px;
+ }
+
+ .search_title {
+ color: #606266;
+ }
+
+ .pagination-wrap {
+ display: flex;
+ justify-content: flex-end;
+ margin-top: 12px;
+ }
+
+ .no-record {
+ color: #909399;
+ text-align: center;
+ padding: 24px 0;
+ }
+
+ .audit-files {
+ margin-top: 12px;
+ }
+
+ .audit-files-title {
+ margin-bottom: 6px;
+ color: #606266;
+ }
+</style>
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 0c25737..bc5c55a 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -80,7 +80,7 @@
width="55"
fixed="left"
/>
- <el-table-column type="expand" width="60" fixed="left">
+ <el-table-column v-if="false" type="expand" width="60" fixed="left">
<template #default="props">
<el-table
:data="props.row.children"
@@ -225,43 +225,19 @@
:formatter="formattedNumber"
/>
<el-table-column
- label="瀹為檯鍚堝悓閲戦(鍏�)"
- prop="netContractAmount"
- 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-table-column
- label="浜や粯鏃ユ湡"
- prop="deliveryDate"
- width="120"
- show-overflow-tooltip
- />
- <el-table-column
- label="澶囨敞"
- prop="remarks"
- width="200"
- show-overflow-tooltip
- />
- <el-table-column fixed="right" label="鎿嶄綔" width="320" align="center">
+ <el-table-column label="涓氬姟瀹℃壒" width="120" align="center">
+ <template #default="scope">
+ <el-tag :type="businessStatusType(scope.row.businessApprovalStatus)">
+ {{ businessStatusText(scope.row.businessApprovalStatus) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="500" align="center">
<template #default="scope">
<el-button link type="primary" @click="openForm('view', scope.row)"
>璇︽儏
@@ -294,6 +270,40 @@
<el-button link type="primary" @click="openFileDialog(scope.row)"
>闄勪欢
</el-button>
+ <el-button
+ v-if="scope.row.projectManagementInfoId"
+ link
+ type="primary"
+ @click="openProjectProgress(scope.row)"
+ >鏌ョ湅椤圭洰杩涘害
+ </el-button>
+ <el-button
+ v-if="![1, 2].includes(scope.row.businessApprovalStatus)"
+ v-hasPermi="['business:approval:submit']"
+ link
+ type="warning"
+ :loading="businessActionId === scope.row.id"
+ @click="submitBusiness(scope.row)"
+ >鎻愪氦瀹℃壒
+ </el-button>
+ <el-button
+ v-if="scope.row.businessApprovalStatus === 1"
+ v-hasPermi="['business:approval:review']"
+ link
+ type="success"
+ :loading="businessActionId === scope.row.id"
+ @click="reviewBusiness(scope.row, true)"
+ >閫氳繃
+ </el-button>
+ <el-button
+ v-if="scope.row.businessApprovalStatus === 1"
+ v-hasPermi="['business:approval:review']"
+ link
+ type="danger"
+ :loading="businessActionId === scope.row.id"
+ @click="reviewBusiness(scope.row, false)"
+ >閫�鍥�
+ </el-button>
</template>
</el-table-column>
</el-table>
@@ -310,10 +320,10 @@
v-model="dialogFormVisible"
:title="
operationType === 'add'
- ? '鏂板閿�鍞彴璐﹂〉闈�'
+ ? '鏂板涓氬姟鍙拌处'
: operationType === 'edit'
- ? '缂栬緫閿�鍞彴璐﹂〉闈�'
- : '閿�鍞彴璐﹁鎯�'
+ ? '缂栬緫涓氬姟鍙拌处'
+ : '涓氬姟鍙拌处璇︽儏'
"
:width="'70%'"
:operation-type="operationType"
@@ -328,14 +338,6 @@
:rules="rules"
ref="formRef"
>
- <!-- 鎶ヤ环鍗曞鍏ュ叆鍙o細鏀惧湪琛ㄥ崟椤堕儴锛岄�夋嫨鍚庡弽鏄惧鎴�/涓氬姟鍛樼瓑 -->
- <el-row v-if="operationType === 'add'" style="margin-bottom: 10px">
- <el-col :span="24" style="text-align: right">
- <el-button type="primary" plain @click="openQuotationDialog">
- 浠庨攢鍞姤浠峰鍏�
- </el-button>
- </el-col>
- </el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍚堝悓绫诲瀷锛�" prop="contractType">
@@ -461,6 +463,20 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
+ <el-form-item label="鍚堝悓閲戦(鍏�)锛�" prop="contractAmount">
+ <el-input-number
+ v-model="form.contractAmount"
+ :min="0"
+ :precision="2"
+ controls-position="right"
+ style="width: 100%"
+ :disabled="operationType === 'view'"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <el-col :span="12">
<el-form-item label="褰曞叆浜猴細" prop="entryPerson">
<el-select
v-model="form.entryPerson"
@@ -512,89 +528,6 @@
</el-form-item>
</el-col>
</el-row>
- <el-row>
- <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
- <el-button
- v-if="operationType !== 'view'"
- type="primary"
- @click="openProductForm('add')"
- >娣诲姞
- </el-button>
- <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
- :summary-method="summarizeMainTable"
- >
- <el-table-column
- align="center"
- type="selection"
- width="55"
- v-if="operationType !== 'view'"
- :selectable="(row) => !isProductShipped(row)"
- />
- <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="unit" />
- <el-table-column label="鏁伴噺" prop="quantity" />
- <el-table-column label="绋庣巼(%)" prop="taxRate" />
- <el-table-column
- label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="鍚◣鎬讳环(鍏�)"
- prop="taxInclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column
- label="涓嶅惈绋庢�讳环(鍏�)"
- prop="taxExclusiveTotalPrice"
- :formatter="formattedNumber"
- />
- <el-table-column label="鏄惁鐢熶骇" prop="isProduction" width="150">
- <template #default="scope">
- <el-tag :type="scope.row.isProduction ? 'success' : 'info'">
- {{ scope.row.isProduction ? "鏄�" : "鍚�" }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- label="鎿嶄綔"
- min-width="60"
- align="center"
- v-if="operationType !== 'view'"
- >
- <template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- :disabled="isProductShipped(scope.row)"
- @click="openProductForm('edit', scope.row, scope.$index)"
- >缂栬緫
- </el-button>
- </template>
- </el-table-column>
- </el-table>
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="澶囨敞锛�" prop="remarks">
@@ -1501,6 +1434,8 @@
createFrameworkOrder,
listFrameworkOrders,
frameworkContractShippedQuantity,
+ submitBusinessApproval,
+ reviewBusinessApproval,
} from "@/api/salesManagement/salesLedger.js";
import { getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
@@ -1539,6 +1474,7 @@
size: 100,
});
const total = ref(0);
+const businessActionId = ref(null);
const fileList = ref([]);
const deliveryFileList = ref([]);
@@ -1857,6 +1793,55 @@
.catch(() => {
tableLoading.value = false;
});
+};
+const businessStatusText = (status) =>
+ ({ 0: "鑽夌", 1: "寰呭鎵�", 2: "宸查�氳繃", 3: "宸查��鍥�" }[status ?? 0] || "鑽夌");
+const businessStatusType = (status) =>
+ ({ 0: "info", 1: "warning", 2: "success", 3: "danger" }[status ?? 0] || "info");
+const submitBusiness = async (row) => {
+ try {
+ await ElMessageBox.confirm(
+ `纭畾鎻愪氦鈥�${row.projectName || row.salesContractNo}鈥濊繘琛岀鐞嗗鎵瑰悧锛焋,
+ "鎻愪氦涓氬姟瀹℃壒",
+ { type: "warning", confirmButtonText: "纭鎻愪氦", cancelButtonText: "鍙栨秷" }
+ );
+ businessActionId.value = row.id;
+ await submitBusinessApproval(row.id);
+ proxy.$modal.msgSuccess("宸叉彁浜ゅ鎵�");
+ await getList();
+ } catch (error) {
+ if (error !== "cancel" && error !== "close") throw error;
+ } finally {
+ businessActionId.value = null;
+ }
+};
+const reviewBusiness = async (row, approved) => {
+ try {
+ let remark = "";
+ if (!approved) {
+ const result = await ElMessageBox.prompt("璇疯緭鍏ラ��鍥炲師鍥�", "閫�鍥炰笟鍔�", {
+ inputValidator: (value) => Boolean(value?.trim()) || "璇疯緭鍏ラ��鍥炲師鍥�",
+ confirmButtonText: "纭閫�鍥�",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ });
+ remark = result.value.trim();
+ } else {
+ await ElMessageBox.confirm(
+ "瀹℃壒閫氳繃灏嗚嚜鍔ㄥ垱寤洪」鐩紝鏄惁缁х画锛�",
+ "閫氳繃涓氬姟瀹℃壒",
+ { type: "success", confirmButtonText: "閫氳繃骞跺缓椤�", cancelButtonText: "鍙栨秷" }
+ );
+ }
+ businessActionId.value = row.id;
+ await reviewBusinessApproval({ salesLedgerId: row.id, approved, remark });
+ proxy.$modal.msgSuccess(approved ? "瀹℃壒閫氳繃锛岄」鐩凡鑷姩寤虹珛" : "宸查��鍥�");
+ await getList();
+ } catch (error) {
+ if (error !== "cancel" && error !== "close") throw error;
+ } finally {
+ businessActionId.value = null;
+ }
};
// 鑾峰彇浜у搧澶х被tree鏁版嵁
const getProductOptions = () => {
@@ -2228,23 +2213,9 @@
const submitForm = () => {
proxy.$refs["formRef"].validate((valid) => {
if (valid) {
- console.log("productData.value--", productData.value);
- if (productData.value !== null && productData.value.length > 0) {
- form.value.productData = proxy.HaveJson(productData.value);
- } else {
- proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
- return;
- }
+ form.value.productData = proxy.HaveJson(productData.value || []);
form.value.storageBlobDTOs = fileList;
form.value.type = 1;
- if (isFrameworkContract.value) {
- form.value.productData = form.value.productData.map((item) => ({
- ...item,
- quantity: null,
- deliveryDate: null,
- isProduction: false,
- }));
- }
if (form.value.autoGenerateContractNo) {
form.value.salesContractNo = "";
}
@@ -3171,6 +3142,16 @@
fileDialogVisible.value = true;
};
+// 鏌ョ湅椤圭洰杩涘害锛堣烦杞」鐩鎯咃紝鍙煡鐪嬮樁娈佃繘灞曚笌璧勬枡鏂囦欢锛�
+const openProjectProgress = (row) => {
+ const projectId = row.projectManagementInfoId || row.projectId;
+ if (!projectId) {
+ proxy.$modal.msgWarning("璇ヤ笟鍔℃殏鏈叧鑱旈」鐩�");
+ return;
+ }
+ router.push(`/projectManagement/Management/detail/${projectId}`);
+};
+
// 鎵撳紑鍙戣揣寮规
const openDeliveryForm = async (row) => {
// 瀹℃壒涓椂鎻愮ず鐢ㄦ埛宸叉湁寰呭鎵圭殑鍙戣揣璁板綍
diff --git a/vite.config.js b/vite.config.js
index f393a95..6de2a3a 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -8,7 +8,7 @@
const { VITE_APP_ENV } = env;
const baseUrl =
env.VITE_APP_ENV === "development"
- ? "http://36.213.90.123:9015"
+ ? "http://127.0.0.1:7005"
: env.VITE_BASE_API;
const javaUrl =
env.VITE_APP_ENV === "development"
@@ -53,7 +53,7 @@
server: {
port: 80,
host: true,
- open: true,
+ open: false,
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
--
Gitblit v1.9.3