This commit is contained in:
zlwu committed 2026-08-17 15:25:28 +08:00
1 parent 6b2147aa46
commit 8558d9439e
31 files changed
+596719 -4174

No files matched your search

+7 -26
View File
@@ -137,7 +137,7 @@
"135": "detail.vue",
"136": "Community 136",
"137": "Community 137",
"138": "index.vue",
"138": "FollowDialog.vue",
"139": "useTableColumns.ts",
"140": "Community 140",
"141": "Community 141",
@@ -184,7 +184,7 @@
"182": "Community 182",
"183": "Ha",
"184": "highlight.ts",
"185": "highlight.ts",
"185": "initLineBrandMetaFromProduct",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
@@ -192,21 +192,16 @@
"190": "error-handle.ts",
"191": "fetchDesignerData",
"192": "handleOpen",
"193": "index.vue",
"194": "contractType.ts",
"193": "loadDefaultCustomerOptions",
"194": "fetchData",
"195": "Community 195",
"196": "Community 196",
"197": "fetchData",
"198": "detail.vue",
"197": "handleEdit",
"198": "fetchCustomerDetail",
"199": "fetchData",
"200": "index.js",
"201": "fetchData",
"202": "Community 202",
"203": "ArtException.vue",
"204": "product.ts",
"205": "detail.vue",
"206": "loadUserOptions",
"207": "detail.vue",
"208": "menuFavorite.ts",
"209": "Community 209",
"210": "Community 210",
@@ -214,36 +209,22 @@
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"215": "index.vue",
"216": "loadUserOptions",
"217": "index.js",
"218": "index.js",
"219": "form.vue",
"220": "index.vue",
"221": "zh_CN.js",
"222": "loadDefaultCustomerOptions",
"223": "Community 223",
"224": "Community 224",
"225": "getPlMaintenanceApplyStatusLabel",
"226": "handleEdit",
"226": "form.vue",
"227": "Community 227",
"228": "Community 228",
"229": "fetchCustomerDetail",
"230": "db.ts",
"231": "handleDisburse",
"232": "fetchData",
"233": "Community 233",
"234": "Community 234",
"235": "index.vue",
"236": "loading.ts",
"237": "index.vue",
"238": "expenseItemCode.ts",
"239": "Community 239",
"240": "handleSearch",
"241": "loadUserOptions",
"242": "Community 242",
"243": "Community 243",
"244": "tabs.ts",
"247": "Community 247",
"248": "Community 248",
"251": "handleDisburse",
@@ -0,0 +1,818 @@
{
"0": "Community 0",
"1": "Community 1",
"2": "Community 2",
"3": "Community 3",
"4": "Community 4",
"5": "Community 5",
"6": "Community 6",
"7": "Community 7",
"8": "Community 8",
"9": "Community 9",
"10": "Community 10",
"11": "Community 11",
"12": "Community 12",
"13": "Community 13",
"14": "Community 14",
"15": "Community 15",
"16": "Community 16",
"17": "Ha",
"18": "Community 18",
"19": "Community 19",
"20": "Community 20",
"21": "Community 21",
"22": "Community 22",
"23": "Community 23",
"24": "Community 24",
"25": "Community 25",
"26": "theme.min.js",
"27": "Community 27",
"28": "useCommon",
"29": "Community 29",
"30": "loader.ts",
"31": "RenewDialog.vue",
"32": "index.vue",
"33": "Community 33",
"34": "main.ts",
"35": "Community 35",
"36": "VoidDialog.vue",
"37": "pl-batch-print.ts",
"38": "view-fields.ts",
"39": "Community 39",
"40": "Community 40",
"41": "colors.ts",
"42": "Community 42",
"43": "Community 43",
"44": "Community 44",
"45": "Community 45",
"46": "Community 46",
"47": "fetchCustomerDetail",
"48": "Community 48",
"49": "Community 49",
"50": "Community 50",
"51": "price-letter-template.ts",
"52": "Community 52",
"53": "Community 53",
"54": "Community 54",
"55": "Community 55",
"56": "Community 56",
"57": "Community 57",
"58": "Community 58",
"59": "fetchData",
"60": "index.vue",
"61": "Community 61",
"62": "highlight.ts",
"63": "price-letter.ts",
"64": "Community 64",
"65": "detail.vue",
"66": "Community 66",
"67": "index.vue",
"68": "Community 68",
"69": "Community 69",
"70": "Community 70",
"71": "Community 71",
"72": "Community 72",
"73": "Community 73",
"74": "Community 74",
"75": "openEdit",
"76": "handleSearch",
"77": "loadUserOptions",
"78": "customerPool.ts",
"79": "Community 79",
"80": "product.ts",
"81": "Community 81",
"82": "Community 82",
"83": "useDictStore",
"84": "Community 84",
"85": "index.vue",
"86": "Community 86",
"87": "canDeleteByCreator",
"88": "index.vue",
"89": "detail.vue",
"90": "theme.min.js",
"91": "Community 91",
"92": "Community 92",
"93": "ArtUserMenu.vue",
"94": "formatYmd",
"95": "Community 95",
"96": "Community 96",
"97": "stringifyBody",
"98": "index.vue",
"99": "stringifyBody",
"100": "v2.4.2.1 - 2025-06-16",
"101": "price-letter.ts",
"102": "price-letter-template.ts",
"103": "SettingDrawer.vue",
"104": "contractType.ts",
"105": "index.vue",
"106": "Community 106",
"107": "Community 107",
"108": "Community 108",
"109": "Community 109",
"110": "Community 110",
"111": "format.ts",
"112": "inventory.ts",
"113": "Community 113",
"114": "index.vue",
"115": "useDictStore",
"116": "Community 116",
"117": "Community 117",
"118": "zh_CN.js",
"119": "Community 119",
"120": "Community 120",
"121": "chart.ts",
"122": "handleDisburse",
"123": "detail.vue",
"124": "index.vue",
"125": "Community 125",
"126": "Community 126",
"127": "selectContractRow",
"128": "Community 128",
"129": "Community 129",
"130": "system.ts",
"131": "index.vue",
"132": "Community 132",
"133": "Community 133",
"134": "index.vue",
"135": "detail.vue",
"136": "Community 136",
"137": "Community 137",
"138": "FollowDialog.vue",
"139": "useTableColumns.ts",
"140": "Community 140",
"141": "Community 141",
"142": "Community 142",
"143": "index.js",
"144": "Community 144",
"145": "api",
"146": "price-letter-template.ts",
"147": "contractType.ts",
"148": "Community 148",
"149": "fetchCustomerDetail",
"150": "Community 150",
"151": "Community 151",
"152": "SettingDrawer.vue",
"153": "index.vue",
"154": "index.vue",
"155": "error.ts",
"156": "v2.4.2.1 - 2025-06-16",
"157": "form.vue",
"158": "removeProductsNotAllowedByHazard",
"159": "detail.vue",
"160": "index.vue",
"161": "Community 161",
"162": "Community 162",
"163": "system.ts",
"164": "Community 164",
"165": "handleDisburse",
"166": "Community 166",
"167": "Community 167",
"168": "crypto.ts",
"169": "Community 169",
"170": "Community 170",
"171": "index.vue",
"172": "index.js",
"173": "index.vue",
"174": "Community 174",
"175": "handleEdit",
"176": "fetchData",
"177": "fetchCustomerDetail",
"178": "Community 178",
"179": "Community 179",
"180": "index.vue",
"181": "Community 181",
"182": "Community 182",
"183": "Ha",
"184": "highlight.ts",
"185": "initLineBrandMetaFromProduct",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
"189": "Community 189",
"190": "error-handle.ts",
"191": "fetchDesignerData",
"192": "handleOpen",
"193": "loadDefaultCustomerOptions",
"194": "fetchData",
"195": "Community 195",
"196": "Community 196",
"197": "handleEdit",
"198": "fetchCustomerDetail",
"199": "fetchData",
"200": "index.js",
"201": "fetchData",
"202": "Community 202",
"203": "prepareLineAliasAndBrandForSubmit",
"204": "types.ts",
"205": "index.vue",
"206": "price-letter.ts",
"207": "product.ts",
"208": "menuFavorite.ts",
"209": "Community 209",
"210": "Community 210",
"211": "loadUserOptions",
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"215": "index.vue",
"216": "loadUserOptions",
"217": "index.js",
"218": "index.js",
"219": "handleSearch",
"220": "index.vue",
"221": "zh_CN.js",
"222": "loadUserOptions",
"223": "Community 223",
"224": "Community 224",
"225": "getPlMaintenanceApplyStatusLabel",
"226": "form.vue",
"227": "Community 227",
"228": "Community 228",
"233": "Community 233",
"234": "Community 234",
"239": "Community 239",
"242": "Community 242",
"243": "Community 243",
"247": "Community 247",
"248": "Community 248",
"251": "handleDisburse",
"253": "Community 253",
"254": "Community 254",
"255": "Community 255",
"259": "Community 259",
"260": "Community 260",
"261": "Community 261",
"265": "Community 265",
"269": "Community 269",
"270": "Community 270",
"280": "Community 280",
"283": "Community 283",
"284": "Community 284",
"285": "Community 285",
"286": "Community 286",
"292": "Community 292",
"295": "Community 295",
"296": "Community 296",
"302": "Community 302",
"303": "Community 303",
"304": "Community 304",
"305": "isIoPlanFrozen",
"306": "handleArrange",
"307": "Community 307",
"308": "Community 308",
"309": "Community 309",
"310": "Community 310",
"315": "Community 315",
"316": "Community 316",
"317": "Community 317",
"318": "Community 318",
"319": "Community 319",
"320": "Community 320",
"321": "Community 321",
"322": "Community 322",
"323": "Community 323",
"324": "Community 324",
"325": "Community 325",
"326": "Community 326",
"327": "Community 327",
"328": "Community 328",
"329": "Community 329",
"330": "Community 330",
"331": "Community 331",
"332": "Community 332",
"333": "Community 333",
"334": "Community 334",
"335": "Community 335",
"336": "Community 336",
"337": "Community 337",
"338": "Community 338",
"339": "Community 339",
"340": "Community 340",
"341": "Community 341",
"342": "error-handle.ts",
"344": "ArtException.vue",
"346": "Community 346",
"347": "Community 347",
"349": "Community 349",
"350": "Community 350",
"354": "Community 354",
"355": "Community 355",
"362": "Community 362",
"364": "Community 364",
"367": "Community 367",
"372": "detail.vue",
"377": "Community 377",
"379": "Community 379",
"380": "Community 380",
"381": "Community 381",
"391": "Community 391",
"392": "Community 392",
"393": "Community 393",
"405": "zh_CN.js",
"406": "Community 406",
"408": "Community 408",
"409": "DbCrmCustomerSelect.vue",
"410": "Community 410",
"412": "Community 412",
"416": "Community 416",
"417": "Community 417",
"422": "Community 422",
"423": "Community 423",
"424": "Community 424",
"425": "Community 425",
"426": "Community 426",
"427": "Community 427",
"428": "Community 428",
"435": "index.vue",
"443": "index.vue",
"444": "index.vue",
"445": "Community 445",
"459": "Community 459",
"460": "Community 460",
"462": "Community 462",
"471": "Community 471",
"472": "Community 472",
"473": "Community 473",
"474": "Community 474",
"475": "Community 475",
"476": "Community 476",
"487": "Community 487",
"488": "Community 488",
"496": "Community 496",
"499": "Community 499",
"521": "Community 521",
"522": "Community 522",
"528": "Community 528",
"534": "Community 534",
"535": "Community 535",
"536": "Community 536",
"537": "Community 537",
"539": "Community 539",
"540": "Community 540",
"550": "Community 550",
"551": "Community 551",
"552": "Community 552",
"553": "Community 553",
"555": "Community 555",
"556": "Community 556",
"557": "Community 557",
"559": "Community 559",
"560": "Community 560",
"561": "Community 561",
"562": "Community 562",
"571": "Community 571",
"572": "Community 572",
"573": "Community 573",
"574": "Community 574",
"575": "Community 575",
"576": "Community 576",
"580": "Community 580",
"581": "Community 581",
"582": "Community 582",
"583": "Community 583",
"584": "Community 584",
"585": "Community 585",
"586": "Community 586",
"597": "Community 597",
"598": "Community 598",
"599": "Community 599",
"600": "Community 600",
"601": "Community 601",
"602": "Community 602",
"603": "Community 603",
"604": "Community 604",
"607": "Community 607",
"608": "Community 608",
"609": "Community 609",
"610": "Community 610",
"611": "Community 611",
"612": "Community 612",
"613": "Community 613",
"614": "Community 614",
"615": "Community 615",
"630": "Community 630",
"631": "Community 631",
"632": "Community 632",
"633": "Community 633",
"634": "Community 634",
"635": "Community 635",
"636": "Community 636",
"637": "Community 637",
"638": "Community 638",
"639": "Community 639",
"640": "Community 640",
"641": "Community 641",
"642": "Community 642",
"643": "Community 643",
"644": "Community 644",
"645": "Community 645",
"650": "Community 650",
"651": "Community 651",
"652": "Community 652",
"653": "Community 653",
"654": "Community 654",
"655": "Community 655",
"658": "Community 658",
"659": "Community 659",
"660": "Community 660",
"662": "Community 662",
"663": "Community 663",
"664": "Community 664",
"665": "Community 665",
"666": "Community 666",
"667": "Community 667",
"668": "Community 668",
"669": "Community 669",
"670": "Community 670",
"671": "Community 671",
"700": "Community 700",
"701": "Fixed",
"702": "Community 702",
"703": "Community 703",
"704": "Community 704",
"705": "Community 705",
"706": "Community 706",
"707": "Community 707",
"708": "Community 708",
"709": "Community 709",
"710": "Community 710",
"711": "Community 711",
"713": "Community 713",
"715": "Community 715",
"716": "Community 716",
"717": "Community 717",
"718": "Community 718",
"720": "Community 720",
"722": "Community 722",
"723": "Community 723",
"724": "Community 724",
"725": "Community 725",
"726": "Community 726",
"727": "Community 727",
"729": "Community 729",
"730": "Community 730",
"731": "Community 731",
"732": "Community 732",
"733": "Community 733",
"734": "修复",
"766": "新增",
"770": "移除",
"772": "重构",
"779": "重构",
"785": "⚠️ 重要提示",
"786": "⚠️ 重要提示",
"788": "⚠️ 重要提示",
"796": "OpportunityForm.vue",
"806": "index.vue",
"836": "BxInvoiceFileSelect.vue",
"838": "CustomerSelector.vue",
"840": "index.vue",
"857": "index.ts",
"886": "index.vue",
"889": "QuoteSelector.vue",
"892": "index.vue",
"896": "MarkWonDialog.vue",
"924": "OpportunitySelector.vue",
"950": "BatchUpdateStageDialog.vue",
"1010": "BxApprovalFlowTabs.vue",
"1015": "DealDialog.vue",
"1016": "TransferDialog.vue",
"1017": "BatchUpdateDateDialog.vue",
"1027": "IntoPoolDialog.vue",
"1115": "v2.4.2.7 - 2025-06-25",
"1117": "v2.5.2 - 2025-07-13",
"1118": "v2.4.2.2 - 2025-06-16",
"1123": "v2.4.1.1 - 2025-06-07",
"1126": "v2.4.2.1 - 2025-06-16",
"1127": "v2.4.2.4 - 2025-06-18",
"1197": "icons.js",
"1198": "icons.min.js",
"1199": "index.js",
"1200": "index.js",
"1201": "index.js",
"1202": "index.js",
"1203": "index.js",
"1204": "plugin.js",
"1205": "plugin.min.js",
"1206": "index.js",
"1207": "plugin.js",
"1208": "plugin.min.js",
"1209": "index.js",
"1210": "plugin.js",
"1211": "plugin.min.js",
"1212": "index.js",
"1213": "plugin.js",
"1214": "plugin.min.js",
"1215": "index.js",
"1216": "index.js",
"1217": "plugin.js",
"1218": "plugin.min.js",
"1219": "index.js",
"1220": "index.js",
"1222": "emojiimages.js",
"1223": "emojiimages.min.js",
"1224": "emojis.js",
"1225": "emojis.min.js",
"1226": "index.js",
"1228": "ar.js",
"1229": "bg_BG.js",
"1230": "ca.js",
"1231": "cs.js",
"1232": "da.js",
"1233": "de.js",
"1234": "el.js",
"1235": "es.js",
"1236": "eu.js",
"1237": "fa.js",
"1238": "fi.js",
"1239": "fr_FR.js",
"1240": "he_IL.js",
"1241": "hi.js",
"1242": "hr.js",
"1243": "hu_HU.js",
"1244": "id.js",
"1245": "it.js",
"1246": "ja.js",
"1247": "kk.js",
"1248": "ko_KR.js",
"1249": "ms.js",
"1250": "nb_NO.js",
"1251": "nl.js",
"1252": "pl.js",
"1253": "pt_BR.js",
"1254": "pt_PT.js",
"1255": "ro.js",
"1256": "ru.js",
"1257": "sk.js",
"1258": "sl_SI.js",
"1259": "sv_SE.js",
"1260": "th_TH.js",
"1261": "tr.js",
"1262": "uk.js",
"1263": "vi.js",
"1265": "zh_TW.js",
"1266": "index.js",
"1267": "index.js",
"1268": "plugin.js",
"1269": "_",
"1270": "index.js",
"1271": "plugin.js",
"1272": "plugin.min.js",
"1275": "index.js",
"1277": "plugin.js",
"1278": "plugin.min.js",
"1280": "plugin.js",
"1281": "plugin.min.js",
"1282": "index.js",
"1283": "plugin.js",
"1284": "plugin.min.js",
"1287": "plugin.js",
"1288": "plugin.min.js",
"1289": "index.js",
"1290": "index.js",
"1291": "index.js",
"1292": "index.js",
"1293": "plugin.js",
"1294": "plugin.min.js",
"1295": "index.js",
"1297": "plugin.js",
"1298": "plugin.min.js",
"1299": "content.js",
"1300": "content.js",
"1301": "content.js",
"1302": "content.js",
"1303": "content.js",
"1304": "content.js",
"1305": "content.inline.js",
"1306": "content.js",
"1307": "skin.js",
"1308": "skin.shadowdom.js",
"1309": "content.inline.js",
"1310": "content.js",
"1311": "skin.js",
"1312": "skin.shadowdom.js",
"1313": "content.inline.js",
"1314": "content.js",
"1315": "skin.js",
"1316": "skin.shadowdom.js",
"1317": "content.inline.js",
"1318": "content.js",
"1319": "skin.js",
"1320": "skin.shadowdom.js",
"1323": "index.vue",
"1324": "index.vue",
"1325": "index.vue",
"1326": "route-parent.vue",
"1327": "setupSubpackSlipEditorTypeCheckboxes",
"1328": "修复",
"1329": "优化",
"1330": "新增",
"1331": "⚠️ 重要提示",
"1332": "重构",
"1333": "优化",
"1334": "修复",
"1335": "新增",
"1336": "升级",
"1337": "⚠️ 重要提示",
"1338": "修复",
"1339": "优化",
"1340": "新增",
"1341": "优化",
"1342": "修复",
"1343": "⚠️ 重要提示",
"1344": "升级",
"1345": "修复",
"1346": "优化",
"1347": "⚠️ 重要提示",
"1348": "新增",
"1349": "修复",
"1350": "优化",
"1351": "新增",
"1352": "优化",
"1353": "修复",
"1354": "新增",
"1355": "重构",
"1356": "优化",
"1357": "修复",
"1358": "移除",
"1359": "新增",
"1360": "优化",
"1361": "修复",
"1362": "新增",
"1363": "重构",
"1364": "升级",
"1365": "优化",
"1366": "修复",
"1367": "新增",
"1368": "优化",
"1369": "修复",
"1370": "优化",
"1371": "修复",
"1372": "新增",
"1373": "重构",
"1374": "升级",
"1375": "移除",
"1376": "修复",
"1377": "⚠️ 重要提示",
"1378": "重构",
"1379": "优化",
"1380": "修复",
"1381": "修复",
"1382": "新增",
"1383": "优化",
"1384": "修复",
"1385": "重构",
"1386": "优化",
"1387": "新增",
"1388": "重构",
"1389": "重构",
"1390": "优化",
"1391": "重构",
"1392": "优化",
"1393": "重构",
"1394": "重构",
"1395": "修复",
"1396": "重构",
"1397": "新增",
"1398": "优化",
"1399": "修复",
"1400": "⚠️ 重要提示",
"1401": "优化",
"1402": "修复",
"1403": "新增",
"1404": "优化",
"1405": "修复",
"1406": "重构",
"1407": "新增",
"1408": "优化",
"1409": "⚠️ 重要提示",
"1410": "code:block1 (crm/clue/)",
"1411": "code:typescript ({)",
"1412": "code:block3 (crm:clue:list # 线索列表查询)",
"1413": "code:bash (mysql -u root -p your_database < crm/sql/crm/12-CRM字典数据汇总.md)",
"9890": "README.md",
"9959": "Fixed",
"9960": "Fixed",
"9961": "Fixed",
"9962": "Fixed",
"9963": "Fixed",
"9964": "Fixed",
"9965": "Fixed",
"9966": "Fixed",
"9967": "Fixed",
"9968": "Fixed",
"9969": "Fixed",
"9970": "Fixed",
"9971": "Fixed",
"9972": "Fixed",
"9973": "Fixed",
"9974": "⚠️ Important Notice",
"9975": "⚠️ Important Notice",
"9976": "⚠️ Important Notice",
"9977": "⚠️ Important Notice",
"9978": "⚠️ Important Notice",
"9979": "⚠️ Important Notice",
"9980": "⚠️ Important Notice",
"9981": "Optimized",
"9982": "Optimized",
"9983": "Optimized",
"9984": "Optimized",
"9985": "Optimized",
"9986": "Optimized",
"9987": "Optimized",
"9988": "Optimized",
"9989": "Optimized",
"9990": "Optimized",
"9991": "Optimized",
"9992": "Optimized",
"9993": "Optimized",
"9994": "Optimized",
"9995": "Optimized",
"9996": "Optimized",
"9997": "Optimized",
"9998": "Optimized",
"9999": "Optimized",
"10000": "Optimized",
"10001": "Refactored",
"10002": "Refactored",
"10003": "Refactored",
"10004": "Refactored",
"10005": "Refactored",
"10006": "Refactored",
"10007": "Refactored",
"10008": "Refactored",
"10009": "Refactored",
"10010": "Refactored",
"10011": "Refactored",
"10012": "Refactored",
"10013": "Removed",
"10014": "Removed",
"10015": "Upgraded",
"10016": "Upgraded",
"10017": "Upgraded",
"10018": "Upgraded",
"10019": "优化",
"10020": "修复",
"10021": "⚠️ 重要提示",
"10022": "修复",
"10023": "优化",
"10024": "优化",
"10025": "⚠️ 重要提示",
"10026": "修复",
"10027": "优化",
"10028": "优化",
"10029": "修复",
"10030": "重构",
"10031": "优化",
"10032": "修复",
"10033": "新增",
"10034": "移除",
"10035": "优化",
"10036": "修复",
"10037": "重构",
"10038": "升级",
"10039": "优化",
"10040": "修复",
"10041": "优化",
"10042": "修复",
"10043": "修复",
"10044": "重构",
"10045": "升级",
"10046": "移除",
"10047": "修复",
"10048": "⚠️ 重要提示",
"10049": "⚠️ 重要提示",
"10050": "优化",
"10051": "修复",
"10052": "优化",
"10053": "修复",
"10054": "优化",
"10055": "新增",
"10056": "重构",
"10057": "优化",
"10058": "优化",
"10059": "重构",
"10060": "修复",
"10061": "新增",
"10062": "优化",
"10063": "修复",
"10064": "优化",
"10065": "⚠️ 重要提示",
"10066": "优化",
"10067": "修复",
"10068": "优化",
"10069": "修复",
"10070": "新增",
"10071": "优化",
"10072": "⚠️ 重要提示",
"10073": "修复",
"10074": "新增",
"10075": "升级",
"10076": "⚠️ 重要提示",
"10077": "修复",
"10078": "优化",
"10079": "code:bash (# Install dependencies)",
"10080": "code:bash (pnpm clean:dev)",
"10081": "code:bash (# 安装依赖)",
"10082": "code:bash (pnpm clean:dev)"
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+100 -34
View File
@@ -293,8 +293,22 @@
<el-button class="btn-ghost" @click="dialogs.add = false">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button class="btn-main" type="primary" :loading="loadingMap.addSubmit" @click="submitAdd">
<el-icon><Check /></el-icon>确定
<el-button
class="btn-ghost"
:loading="loadingMap.addSubmit"
:disabled="!!loadingMap.addApprove"
@click="submitAdd"
>
<el-icon><FolderChecked /></el-icon>保存草稿
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="loadingMap.addApprove"
:disabled="!!loadingMap.addSubmit"
@click="submitAddAndApprove"
>
<el-icon><Promotion /></el-icon>提交审批
</el-button>
</template>
</el-dialog>
@@ -432,11 +446,13 @@ import {
View,
Close,
Delete,
Check,
Search,
RefreshLeft
RefreshLeft,
FolderChecked,
Promotion
} from '@element-plus/icons-vue'
import { advanceApi, paymentApi } from '@/api/bx'
import { pickBxData } from '@/utils/http/bx'
import { canDeleteByCreator, allRowsDeletableByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
import {
statusLabel,
@@ -444,7 +460,6 @@ import {
formatMoney,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
@@ -552,16 +567,16 @@ const viewData = ref<Record<string, any>>({})
const viewMainKvFields = computed<ViewField[]>(() => {
const d = viewData.value
return [
bxViewKv('申请人', d.applicantName),
bxViewKv('申请人', d.applicantName, { long: false }),
bxViewKv('申请时间', d.applyTime, { long: false }),
bxViewKv('申请原因', d.reason, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0), { long: false }),
bxViewKvMoney(
'实际发放金额(元)',
d.actualAmount != null ? formatMoneyYuan(d.actualAmount) : '—'
d.actualAmount != null ? formatMoneyYuan(d.actualAmount) : '—',
{ long: false }
),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0)),
bxViewKvMoney('冲抵总金额(元)', formatMoneyYuan(d.offsetAmount || 0)),
bxViewKv('当前节点', workflowNodeDisplay(d.currentNode, d.status)),
bxViewKv('申请时间', d.applyTime),
bxViewKv('申请原因', d.reason, { long: false })
bxViewKvMoney('冲抵总金额(元)', formatMoneyYuan(d.offsetAmount || 0), { long: false })
]
})
const selectedRows = ref<any[]>([])
@@ -759,43 +774,94 @@ async function handleToolbarSubmit() {
}
}
async function submitAdd() {
type AddPayload = {
reason: string
amount: number
remark?: string
}
async function buildAddPayload(): Promise<AddPayload | null> {
const valid = await addFormRef.value?.validate().catch(() => false)
if (!valid) return
if (!valid) return null
const amountNum = Number(String(addForm.amount ?? '').trim())
if (Number.isNaN(amountNum) || amountNum <= 0) {
ElMessage.warning('请输入大于 0 的申请金额')
return
return null
}
return {
reason: addForm.reason?.trim() ?? '',
amount: amountNum,
remark: addForm.remark || undefined
}
}
function resetAddForm() {
dialogs.add = false
Object.assign(addForm, { reason: '', amount: '', remark: '' })
editingId.value = null
}
/** 保存备用金申请,成功返回 id */
async function saveAddForm(payload: AddPayload): Promise<string | null> {
if (editingId.value) {
await advanceApi.update(editingId.value, payload)
return String(editingId.value)
}
const res: any = await advanceApi.create(payload)
const data: any = pickBxData(res) || {}
const id = data.id != null ? String(data.id) : ''
return id || null
}
/** 保存草稿 */
async function submitAdd() {
const payload = await buildAddPayload()
if (!payload) return
const wasEdit = !!editingId.value
loadingMap.addSubmit = true
try {
const reason = addForm.reason?.trim() ?? ''
if (editingId.value) {
await advanceApi.update(editingId.value, {
reason,
amount: amountNum,
remark: addForm.remark || undefined
})
ElMessage.success('保存成功')
} else {
await advanceApi.create({
reason,
amount: amountNum,
remark: addForm.remark || undefined
})
ElMessage.success('新增成功')
const id = await saveAddForm(payload)
if (!id) {
ElMessage.error('保存成功但未返回申请单 ID,请从列表重新操作')
await refreshList()
return
}
dialogs.add = false
Object.assign(addForm, { reason: '', amount: '', remark: '' })
editingId.value = null
ElMessage.success(wasEdit ? '保存成功' : '新增成功')
resetAddForm()
await refreshList()
} catch (e: any) {
ElMessage.error(e.message || (editingId.value ? '保存失败' : '新增失败'))
ElMessage.error(e.message || (wasEdit ? '保存失败' : '新增失败'))
} finally {
loadingMap.addSubmit = false
}
}
/** 保存并提交审批 */
async function submitAddAndApprove() {
const payload = await buildAddPayload()
if (!payload) return
loadingMap.addApprove = true
try {
const id = await saveAddForm(payload)
if (!id) {
ElMessage.error('保存成功但未返回申请单 ID,请从列表重新提交审批')
await refreshList()
return
}
// 保存成功后记下 id,提交失败时再次操作会走更新而非重复新建
editingId.value = id
await advanceApi.submit(id)
ElMessage.success('提交成功')
resetAddForm()
await refreshList()
} catch (e: any) {
ElMessage.error(e.message || '提交失败')
await refreshList()
} finally {
loadingMap.addApprove = false
}
}
async function openView(row: any) {
try {
const res = await advanceApi.getById(row.id)
@@ -492,7 +492,6 @@ import {
statusTagType,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
@@ -613,7 +612,6 @@ const viewMainKvFields = computed<ViewField[]>(() => {
bxViewKv('申请人', d.applicantName),
bxViewKvLong('申请原因', d.reason),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0)),
bxViewKv('当前节点', workflowNodeDisplay(d.currentNode, d.status)),
bxViewKv('申请时间', d.applyTime)
]
})
@@ -696,11 +694,12 @@ function buildApprovedQuery() {
return q
}
onMounted(async () => {
onMounted(() => {
loadApplicantOptions()
await refreshMenuBadges(menuStore.menuList)
// 列表优先加载;角标刷新勿阻塞列表请求(否则页面已渲染却迟迟不发 pending 列表)
searchPending()
tabLoaded.pending = true
void refreshMenuBadges(menuStore.menuList)
})
function handlePendingSearch() {
@@ -851,6 +850,7 @@ async function handleConfirmApprove() {
}
dialogs.approve = false
dialogs.view = false
await refreshPending()
await refreshMenuBadges(menuStore.menuList)
} finally {
@@ -421,8 +421,22 @@
<el-button class="btn-ghost" @click="dialogs.add = false">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button class="btn-main" type="primary" :loading="loadingMap.addSubmit" @click="submitAdd">
<el-icon><Check /></el-icon>确定
<el-button
class="btn-ghost"
:loading="loadingMap.addSubmit"
:disabled="!!loadingMap.addApprove"
@click="submitAdd"
>
<el-icon><FolderChecked /></el-icon>保存草稿
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="loadingMap.addApprove"
:disabled="!!loadingMap.addSubmit"
@click="submitAddAndApprove"
>
<el-icon><Promotion /></el-icon>提交审批
</el-button>
</template>
</el-dialog>
@@ -584,10 +598,11 @@ import {
View,
Close,
Delete,
Check,
Search,
RefreshLeft,
FolderOpened,
FolderChecked,
Promotion,
VideoPlay,
Document,
Download
@@ -1205,23 +1220,33 @@ async function handleToolbarSubmit() {
}
}
async function submitAdd() {
type AddPayload = {
applicantId?: string
reimburseDate: string
title?: string
remark: string
invoiceIds: string[]
invoiceLinks: { invoiceId: string; attachmentId: string }[]
details: { expenseItemId: string; amount: number; remark: string }[]
}
function buildAddPayload(): AddPayload | null {
const validDetails = addForm.details.filter((d) => d.expenseItemId && d.amount)
if (validDetails.length === 0) {
ElMessage.warning('请至少填写一条报销明细')
return
return null
}
const missingReason = validDetails.some((d) => !String(d.remark ?? '').trim())
if (missingReason) {
ElMessage.warning('请为每条报销明细填写报销事由')
return
return null
}
const invoiceLinks = selectedInvoicePicks.value.map((p) => ({
invoiceId: String(p.invoiceId),
attachmentId: String(p.attachmentId)
}))
const invoiceIds = Array.from(new Set(invoiceLinks.map((p) => p.invoiceId)))
const payload = {
return {
applicantId: addForm.applicantId || undefined,
reimburseDate: addForm.reimburseDate,
title: addForm.title || undefined,
@@ -1234,31 +1259,80 @@ async function submitAdd() {
remark: String(d.remark).trim()
}))
}
}
function resetAddForm() {
dialogs.add = false
addForm.applicantId = currentUserId()
addForm.reimburseDate = todayYmd()
addForm.title = ''
addForm.remark = ''
addForm.details = [{ expenseItemId: '', amount: '', remark: '' }]
selectedInvoicePicks.value = []
editingId.value = null
}
/** 保存报销单,成功返回 id;校验失败返回 null */
async function saveAddForm(payload: AddPayload): Promise<string | null> {
if (editingId.value) {
await reimburseApi.update(editingId.value, payload)
return String(editingId.value)
}
const res: any = await reimburseApi.create(payload)
const data: any = pickBxData(res) || {}
const id = data.id != null ? String(data.id) : ''
return id || null
}
/** 保存草稿 */
async function submitAdd() {
const payload = buildAddPayload()
if (!payload) return
const wasEdit = !!editingId.value
loadingMap.addSubmit = true
try {
if (editingId.value) {
await reimburseApi.update(editingId.value, payload)
ElMessage.success('保存成功')
} else {
await reimburseApi.create(payload)
ElMessage.success('新增成功')
const id = await saveAddForm(payload)
if (!id) {
ElMessage.error('保存成功但未返回报销单 ID,请从列表重新操作')
await refreshList()
return
}
dialogs.add = false
addForm.applicantId = currentUserId()
addForm.reimburseDate = todayYmd()
addForm.title = ''
addForm.remark = ''
addForm.details = [{ expenseItemId: '', amount: '', remark: '' }]
selectedInvoicePicks.value = []
editingId.value = null
ElMessage.success(wasEdit ? '保存成功' : '新增成功')
resetAddForm()
await refreshList()
} catch (e: any) {
ElMessage.error(e.message || (editingId.value ? '保存失败' : '新增失败'))
ElMessage.error(e.message || (wasEdit ? '保存失败' : '新增失败'))
} finally {
loadingMap.addSubmit = false
}
}
/** 保存并提交审批 */
async function submitAddAndApprove() {
const payload = buildAddPayload()
if (!payload) return
loadingMap.addApprove = true
try {
const id = await saveAddForm(payload)
if (!id) {
ElMessage.error('保存成功但未返回报销单 ID,请从列表重新提交审批')
await refreshList()
return
}
// 保存成功后记下 id,提交失败时再次操作会走更新而非重复新建
editingId.value = id
await reimburseApi.submit(id)
ElMessage.success('提交成功')
resetAddForm()
await refreshList()
} catch (e: any) {
ElMessage.error(e.message || '提交失败')
await refreshList()
} finally {
loadingMap.addApprove = false
}
}
async function openView(row: any) {
try {
const res = await reimburseApi.getById(row.id)
@@ -886,11 +886,12 @@ function buildApprovedQuery() {
return q
}
onMounted(async () => {
onMounted(() => {
loadApplicantOptions()
await refreshMenuBadges(menuStore.menuList)
// 列表优先加载;角标刷新勿阻塞列表请求(否则页面已渲染却迟迟不发 pending 列表)
searchPending()
tabLoaded.pending = true
void refreshMenuBadges(menuStore.menuList)
})
function handleTabChange(tab: string | number) {
+543 -376
View File
@@ -4,7 +4,12 @@
<div class="page-container">
<section class="panel">
<div class="filter-block">
<el-form :model="filterForm" class="filter-form" @submit.prevent style="--filter-label-width: 110px">
<el-form
:model="filterForm"
class="filter-form"
@submit.prevent
style="--filter-label-width: 110px"
>
<div class="filter-grid">
<el-form-item label="单号">
<el-input v-model="filterForm.code" placeholder="请输入单号" clearable />
@@ -15,7 +20,12 @@
</el-select>
</el-form-item>
<el-form-item label="申请人">
<el-select v-model="filterForm.applicantId" placeholder="请选择申请人" clearable filterable>
<el-select
v-model="filterForm.applicantId"
placeholder="请选择申请人"
clearable
filterable
>
<el-option
v-for="opt in applicantOptions"
:key="opt.value"
@@ -86,7 +96,8 @@
<div class="list-body list-wrap">
<div ref="allTableWrapRef" class="table-scroll bx-list-table-wrap">
<ListTable table-key="bx-view-all"
<ListTable
table-key="bx-view-all"
class="list-table"
:data="pager.pagedRows.value"
v-loading="loading"
@@ -96,7 +107,13 @@
@header-dragend="() => allStatsRowRef?.resync?.()"
>
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
<el-table-column
type="index"
label="序号"
min-width="68"
align="center"
header-align="center"
/>
<el-table-column
v-if="isColumnVisible('applyTime')"
prop="applyTime"
@@ -228,53 +245,119 @@
<div class="dlg-view">
<div class="dlg-view-hero">
<div class="dlg-view-hero-top">
<h2 class="dlg-view-title">{{ currentRow?.applyCode || '-' }}</h2>
<h2 class="dlg-view-title">{{ viewHero.applyCode || '-' }}</h2>
<div class="dlg-view-tags">
<el-tag :type="bizTypeTagType(currentRow?.bizType)" size="small">
{{ currentRow?.bizType || '-' }}
<el-tag :type="bizTypeTagType(viewHero.bizType)" size="small">
{{ viewHero.bizType || '-' }}
</el-tag>
<el-tag v-if="currentRow?.status" :type="statusTagType(currentRow.status)" size="small">
{{ statusLabel(currentRow.status) }}
<el-tag v-if="viewHero.status" :type="statusTagType(viewHero.status)" size="small">
{{ statusLabel(viewHero.status) }}
</el-tag>
</div>
</div>
<p class="dlg-view-meta">
金额(元):<b class="money-em">{{ formatMoneyYuan(currentRow?.amount || 0) }}</b>
· 申请人:{{ currentRow?.applicantName || '-' }}
金额(元):<b class="money-em">{{ formatMoneyYuan(viewHero.amount || 0) }}</b> ·
申请人:{{ viewHero.applicantName || '-' }}
</p>
</div>
<div class="dlg-view-section">
<h4 class="dlg-view-section-title">基础信息</h4>
<BxViewKvTable :fields="viewDetailKvFields" mode="triple" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewLinkedInvoiceFiles.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">关联发票</h4>
<BxAttachmentReadonly :files="viewLinkedInvoiceFiles" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">历史附件</h4>
<BxAttachmentReadonly :files="viewAttachments" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewPayAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewPayAttachments" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewOffsetAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">冲抵附件</h4>
<BxAttachmentReadonly :files="viewOffsetAttachments" />
</div>
<template v-if="viewHero.bizType === '报销单'">
<div class="dlg-view-section">
<h4 class="dlg-view-section-title">报销明细</h4>
<el-table
:data="viewData.details || []"
border
size="small"
show-summary
:summary-method="viewDetailSummary"
class="view-detail-table"
>
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column prop="expenseName" label="费用项目" min-width="160" />
<el-table-column
prop="amount"
label="金额(元)"
min-width="120"
class-name="col-money"
>
<template #default="{ row }">
{{ formatMoneyYuan(row.amount || 0) }}
</template>
</el-table-column>
<el-table-column prop="remark" label="报销事由" min-width="140">
<template #default="{ row }">
{{ row.remark || '-' }}
</template>
</el-table-column>
</el-table>
</div>
<div v-if="viewLinkedInvoiceFiles.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">关联发票</h4>
<BxAttachmentReadonly :files="viewLinkedInvoiceFiles" />
</div>
<div v-if="viewAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">历史附件</h4>
<BxAttachmentReadonly :files="viewAttachments" />
</div>
<div v-if="viewPayAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewPayAttachments" />
</div>
<div v-if="viewOffsetAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">冲抵附件</h4>
<BxAttachmentReadonly :files="viewOffsetAttachments" />
</div>
</template>
<template v-else-if="viewHero.bizType === '备用金'">
<BaseDetailTableSection
title="冲抵记录"
:data="viewOffsetRecords"
empty-text="暂无冲抵记录"
>
<el-table :data="viewOffsetRecords" border size="small" class="view-detail-table">
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column
prop="reimburseApplyCode"
label="报销单号"
min-width="130"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="reimburseApplicantName"
label="报销申请人"
min-width="110"
align="center"
/>
<el-table-column
prop="reimburseTitle"
label="报销标题"
min-width="160"
align="left"
show-overflow-tooltip
/>
<el-table-column
label="冲抵金额(元)"
min-width="120"
class-name="col-money"
align="right"
>
<template #default="{ row: offsetRow }">
{{ formatMoneyYuan(offsetRow.offsetAmount || 0) }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="冲抵时间" min-width="160" align="center" />
<el-table-column prop="operator" label="操作人" min-width="100" align="center" />
</el-table>
</BaseDetailTableSection>
<div v-if="viewIssueAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewIssueAttachments" />
</div>
</template>
<BxApprovalFlowTabs
:nodes="viewFlowNodes"
:history="viewApprovalHistory"
@@ -286,366 +369,450 @@
</template>
<script setup lang="ts">
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
import type { StatsRowColumn } from '@/utils/list-column-stats'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { computed, onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { Close, Search, RefreshLeft } from '@element-plus/icons-vue'
import { advanceApi, reimburseApi } from '@/api/bx'
import {
bizTypeTagType,
statusLabel,
statusTagType,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
} from '@/utils/bx/format'
import BxApprovalFlowTabs from '@/components/bx/base/BxApprovalFlowTabs.vue'
import BxViewKvTable from '@/components/bx/base/BxViewKvTable.vue'
import BxAttachmentReadonly from '@/components/bx/base/BxAttachmentReadonly.vue'
import type { ViewField } from '@/components/business/system-view-dialog/types'
import { bxViewKv, bxViewKvMoney } from '@/utils/bx/view-kv'
import { type BxAttachmentItem, loadBxAttachments } from '@/utils/bx/attachment'
import { invoicesToLinkedAttachmentFiles } from '@/utils/bx/invoice-link-files'
import { matchesApplyDateRange, type ApplyDateRange } from '@/utils/bx/apply-date-filter'
import { usePagedTable } from '@/hooks/bx/usePagedTable'
import { useApplicantOptions } from '@/hooks/bx/useApplicantOptions'
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
import type { StatsRowColumn } from '@/utils/list-column-stats'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { computed, onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { Search, RefreshLeft } from '@element-plus/icons-vue'
import { advanceApi, paymentApi, reimburseApi } from '@/api/bx'
import {
bizTypeTagType,
statusLabel,
statusTagType,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
} from '@/utils/bx/format'
import BxApprovalFlowTabs from '@/components/bx/base/BxApprovalFlowTabs.vue'
import BxViewKvTable from '@/components/bx/base/BxViewKvTable.vue'
import BxAttachmentReadonly from '@/components/bx/base/BxAttachmentReadonly.vue'
import BaseDetailTableSection from '@/components/bx/base/BaseDetailTableSection.vue'
import type { ViewField } from '@/components/business/system-view-dialog/types'
import { bxViewKv, bxViewKvLong, bxViewKvMoney } from '@/utils/bx/view-kv'
import {
type BxAttachmentItem,
fillBxAttachmentPreviews,
loadBxAttachments
} from '@/utils/bx/attachment'
import { invoicesToLinkedAttachmentFiles } from '@/utils/bx/invoice-link-files'
import { matchesApplyDateRange, type ApplyDateRange } from '@/utils/bx/apply-date-filter'
import { usePagedTable } from '@/hooks/bx/usePagedTable'
import { useApplicantOptions } from '@/hooks/bx/useApplicantOptions'
type DialogKey = 'viewDetail'
type DialogKey = 'viewDetail'
const loading = ref(false)
const selectedRows = ref<any[]>([])
const dialogs = reactive<Record<DialogKey, boolean>>({
viewDetail: false
})
const loading = ref(false)
const selectedRows = ref<any[]>([])
const dialogs = reactive<Record<DialogKey, boolean>>({
viewDetail: false
})
const mergedRows = ref<any[]>([])
const { applicantOptions, loadApplicantOptions } = useApplicantOptions()
const mergedRows = ref<any[]>([])
const { applicantOptions, loadApplicantOptions } = useApplicantOptions()
const listColumnDefs = [
{ prop: 'applyTime', label: '申请时间' },
{ prop: 'bizType', label: '业务类型' },
{ prop: 'applicantName', label: '申请人' },
{ prop: 'title', label: '申请标题' },
{ prop: 'amount', label: '申请金额(元)' },
{ prop: 'status', label: '状态' },
{ prop: 'currentNode', label: '当前节点', defaultVisible: false }
]
const {
visibleColumns,
checkAll,
isIndeterminate,
isColumnVisible,
resetToDefault
} = usePersistedListColumns('bx-view-all-list-columns', listColumnDefs)
const allTableWrapRef = ref<HTMLElement | null>(null)
const allStatsRowRef = ref<{ resync?: () => void } | null>(null)
const allStatsRowColumns = computed((): StatsRowColumn[] => {
const cols: StatsRowColumn[] = [
{ key: '__selection', interactive: false },
{ key: '__index', interactive: false }
const listColumnDefs = [
{ prop: 'applyTime', label: '申请时间' },
{ prop: 'bizType', label: '业务类型' },
{ prop: 'applicantName', label: '申请人' },
{ prop: 'title', label: '申请标题' },
{ prop: 'amount', label: '申请金额(元)' },
{ prop: 'status', label: '状态' },
{ prop: 'currentNode', label: '当前节点', defaultVisible: false }
]
if (isColumnVisible('applyTime')) {
cols.push({ key: 'applyTime', interactive: true, prop: 'applyTime' })
}
cols.push({ key: 'applyCode', interactive: true, prop: 'applyCode' })
for (const def of listColumnDefs) {
if (def.prop === 'applyTime') continue
if (!isColumnVisible(def.prop)) continue
cols.push({
key: def.prop,
interactive: true,
prop: def.prop,
money: def.prop === 'amount'
})
}
return cols
})
const quickSearchKeyword = ref('')
const appliedQuickSearch = ref('')
const { visibleColumns, checkAll, isIndeterminate, isColumnVisible, resetToDefault } =
usePersistedListColumns('bx-view-all-list-columns', listColumnDefs)
const filterForm = reactive({
code: '',
bizType: '' as string,
applicantId: undefined as number | undefined,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: '',
currentNode: '' as string
})
const allTableWrapRef = ref<HTMLElement | null>(null)
const allStatsRowRef = ref<{ resync?: () => void } | null>(null)
const appliedFilter = reactive({
code: '',
bizType: '' as string,
applicantId: undefined as number | undefined,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: '',
currentNode: '' as string
})
function syncAppliedFilter() {
Object.assign(appliedFilter, { ...filterForm })
}
function filterMergedRows(rows: any[]) {
let list = [...rows]
const quickKw = appliedQuickSearch.value.trim().toLowerCase()
if (quickKw) {
list = list.filter(
(r: any) =>
String(r.applyCode || '')
.toLowerCase()
.includes(quickKw) ||
String(r.title || '')
.toLowerCase()
.includes(quickKw) ||
String(r.applicantName || '')
.toLowerCase()
.includes(quickKw)
)
}
const code = appliedFilter.code.trim()
if (code) list = list.filter((r: any) => String(r.applyCode || '').includes(code))
if (appliedFilter.bizType && appliedFilter.bizType !== '全部') {
list = list.filter((r: any) => r.bizType === appliedFilter.bizType)
}
if (appliedFilter.applicantId != null) {
list = list.filter((r: any) => Number(r.applicantId) === Number(appliedFilter.applicantId))
}
if (appliedFilter.applyDateRange?.[0] || appliedFilter.applyDateRange?.[1]) {
list = list.filter((r: any) => matchesApplyDateRange(r.applyTime, appliedFilter.applyDateRange))
}
if (appliedFilter.status && appliedFilter.status !== '全部') {
if (appliedFilter.status === '已发放') {
list = list.filter((r: any) => ['issued', 'paid', 'offset'].includes(r.status))
} else {
const map: Record<string, string> = {
待提交: 'draft',
审批中: 'pending',
审批通过: 'approved',
审批驳回: 'rejected'
}
const want = map[appliedFilter.status]
if (want) list = list.filter((r: any) => r.status === want)
const allStatsRowColumns = computed((): StatsRowColumn[] => {
const cols: StatsRowColumn[] = [
{ key: '__selection', interactive: false },
{ key: '__index', interactive: false }
]
if (isColumnVisible('applyTime')) {
cols.push({ key: 'applyTime', interactive: true, prop: 'applyTime' })
}
}
if (appliedFilter.currentNode && appliedFilter.currentNode !== '全部') {
list = list.filter((r: any) => (r.currentNode || '') === appliedFilter.currentNode)
}
if (appliedFilter.amountRange?.trim()) {
const parts = appliedFilter.amountRange.split(/[-–]/).map((x: string) => Number(String(x).trim()))
if (parts.length >= 2 && !parts.some((n) => Number.isNaN(n))) {
const lo = Math.min(parts[0], parts[1])
const hi = Math.max(parts[0], parts[1])
list = list.filter((r: any) => {
const amt = Number(r.amount || 0)
return amt >= lo && amt <= hi
cols.push({ key: 'applyCode', interactive: true, prop: 'applyCode' })
for (const def of listColumnDefs) {
if (def.prop === 'applyTime') continue
if (!isColumnVisible(def.prop)) continue
cols.push({
key: def.prop,
interactive: true,
prop: def.prop,
money: def.prop === 'amount'
})
}
}
return list
}
const filteredMergedRows = computed(() => filterMergedRows(mergedRows.value))
const pager = usePagedTable(() => filteredMergedRows.value, { initialPageSize: 20 })
const currentRow = ref<any>(null)
const viewDetailKvFields = computed<ViewField[]>(() => {
const r = currentRow.value
return [
bxViewKv('申请单号', r?.applyCode, { long: false }),
bxViewKv('业务类型', r?.bizType, { long: false, tagType: bizTypeTagType(r?.bizType) }),
bxViewKv('申请人', r?.applicantName, { long: false }),
bxViewKv('申请标题', r?.title, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(r?.amount || 0), { long: false }),
bxViewKv('状态', statusLabel(r?.status), { long: false, tagType: statusTagType(r?.status) }),
bxViewKv('当前节点', workflowNodeDisplay(r?.currentNode, r?.status), { long: false }),
bxViewKv('申请时间', r?.applyTime, { long: false })
]
})
const viewFlowNodes = ref<any[]>([])
const viewApprovalHistory = ref<any[]>([])
const viewFlowLoading = ref(false)
const viewLinkedInvoiceFiles = ref<BxAttachmentItem[]>([])
const viewAttachments = ref<BxAttachmentItem[]>([])
const viewPayAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetAttachments = ref<BxAttachmentItem[]>([])
const bizTypeOptions = ['全部', '报销单', '备用金']
const statusOptions = ['全部', '待提交', '审批中', '审批通过', '审批驳回', '已发放']
const nodeOptions = ['全部', '草稿', '发起人主管审批', '财务复核', '总经理审批', '已完成', '已驳回', '已发放']
async function loadData() {
loading.value = true
try {
const [advRes, reimRes]: any[] = await Promise.all([
advanceApi.list({ page: 1, pageSize: 999 }),
reimburseApi.list({ page: 1, pageSize: 999 })
])
const advRows = (advRes.data?.rows || []).map((r: any) => ({
...r,
bizType: '备用金',
title: r.reason,
applyCode: r.applyCode || r.code,
applicantName: r.applicantName || r.user,
applicantId: r.applicantId
}))
const reimRows = (reimRes.data?.rows || []).map((r: any) => ({
...r,
bizType: '报销单',
title: r.title,
applyCode: r.applyCode || r.code,
applicantName: r.applicantName || r.user,
applicantId: r.applicantId
}))
mergedRows.value = [...advRows, ...reimRows]
} catch {
// error handled by interceptor
} finally {
loading.value = false
}
}
function handleSearch() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
syncAppliedFilter()
pager.currentPage.value = 1
}
useDbInstantSearch(
() => ({
code: filterForm.code,
bizType: filterForm.bizType,
applicantId: filterForm.applicantId,
status: filterForm.status,
applyDateRange: filterForm.applyDateRange,
amountRange: filterForm.amountRange,
currentNode: filterForm.currentNode
}),
handleSearch
)
function handleReset() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
Object.assign(filterForm, {
code: '',
bizType: '',
applicantId: undefined,
status: '',
applyDateRange: null,
amountRange: '',
currentNode: ''
return cols
})
Object.assign(appliedFilter, {
const quickSearchKeyword = ref('')
const appliedQuickSearch = ref('')
const filterForm = reactive({
code: '',
bizType: '',
applicantId: undefined,
status: '',
applyDateRange: null,
bizType: '' as string,
applicantId: undefined as number | undefined,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: '',
currentNode: ''
currentNode: '' as string
})
pager.currentPage.value = 1
}
function handleQuickSearch() {
appliedQuickSearch.value = quickSearchKeyword.value.trim()
pager.currentPage.value = 1
}
const appliedFilter = reactive({
code: '',
bizType: '' as string,
applicantId: undefined as number | undefined,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: '',
currentNode: '' as string
})
function handleQuickSearchClear() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
pager.currentPage.value = 1
}
function syncAppliedFilter() {
Object.assign(appliedFilter, { ...filterForm })
}
function handleSelectionChange(rows: any[]) {
selectedRows.value = rows
}
async function openViewDetail(row: any) {
currentRow.value = row
viewFlowNodes.value = []
viewApprovalHistory.value = []
viewLinkedInvoiceFiles.value = []
viewAttachments.value = []
viewPayAttachments.value = []
viewOffsetAttachments.value = []
viewFlowLoading.value = true
dialogs.viewDetail = true
try {
const api = row.bizType === '备用金' ? advanceApi : reimburseApi
const tasks: Promise<any>[] = [
api.getApprovals(row.id),
api.getApprovalHistory(row.id)
]
if (row.bizType === '报销单') {
tasks.push(
reimburseApi
.getById(row.id)
.then((res: any) => {
const data = res?.data || res || {}
viewLinkedInvoiceFiles.value = invoicesToLinkedAttachmentFiles(data.invoices || [])
})
.catch(() => {
viewLinkedInvoiceFiles.value = []
}),
loadBxAttachments('reimburse_apply', row.id)
.then((files) => {
viewAttachments.value = files
})
.catch(() => {
viewAttachments.value = []
}),
loadBxAttachments('reimburse_pay', row.id)
.then((files) => {
viewPayAttachments.value = files
})
.catch(() => {
viewPayAttachments.value = []
}),
loadBxAttachments('reimburse_offset', row.id)
.then((files) => {
viewOffsetAttachments.value = files
})
.catch(() => {
viewOffsetAttachments.value = []
})
function filterMergedRows(rows: any[]) {
let list = [...rows]
const quickKw = appliedQuickSearch.value.trim().toLowerCase()
if (quickKw) {
list = list.filter(
(r: any) =>
String(r.applyCode || '')
.toLowerCase()
.includes(quickKw) ||
String(r.title || '')
.toLowerCase()
.includes(quickKw) ||
String(r.applicantName || '')
.toLowerCase()
.includes(quickKw)
)
}
const [flowRes, historyRes]: any[] = await Promise.all(tasks)
viewFlowNodes.value = (flowRes.data || []).sort((a: any, b: any) => a.nodeOrder - b.nodeOrder)
viewApprovalHistory.value = historyRes.data || []
} catch (e: any) {
ElMessage.error(e.message || '加载审批流程失败')
} finally {
viewFlowLoading.value = false
const code = appliedFilter.code.trim()
if (code) list = list.filter((r: any) => String(r.applyCode || '').includes(code))
if (appliedFilter.bizType && appliedFilter.bizType !== '全部') {
list = list.filter((r: any) => r.bizType === appliedFilter.bizType)
}
if (appliedFilter.applicantId != null) {
list = list.filter((r: any) => Number(r.applicantId) === Number(appliedFilter.applicantId))
}
if (appliedFilter.applyDateRange?.[0] || appliedFilter.applyDateRange?.[1]) {
list = list.filter((r: any) =>
matchesApplyDateRange(r.applyTime, appliedFilter.applyDateRange)
)
}
if (appliedFilter.status && appliedFilter.status !== '全部') {
if (appliedFilter.status === '已发放') {
list = list.filter((r: any) => ['issued', 'paid', 'offset'].includes(r.status))
} else {
const map: Record<string, string> = {
待提交: 'draft',
审批中: 'pending',
审批通过: 'approved',
审批驳回: 'rejected'
}
const want = map[appliedFilter.status]
if (want) list = list.filter((r: any) => r.status === want)
}
}
if (appliedFilter.currentNode && appliedFilter.currentNode !== '全部') {
list = list.filter((r: any) => (r.currentNode || '') === appliedFilter.currentNode)
}
if (appliedFilter.amountRange?.trim()) {
const parts = appliedFilter.amountRange
.split(/[-–]/)
.map((x: string) => Number(String(x).trim()))
if (parts.length >= 2 && !parts.some((n) => Number.isNaN(n))) {
const lo = Math.min(parts[0], parts[1])
const hi = Math.max(parts[0], parts[1])
list = list.filter((r: any) => {
const amt = Number(r.amount || 0)
return amt >= lo && amt <= hi
})
}
}
return list
}
}
onMounted(() => {
loadApplicantOptions()
loadData()
})
const filteredMergedRows = computed(() => filterMergedRows(mergedRows.value))
const pager = usePagedTable(() => filteredMergedRows.value, { initialPageSize: 20 })
const currentRow = ref<any>(null)
const viewData = ref<Record<string, any>>({})
const viewHero = computed(() => {
const row = currentRow.value || {}
const detail = viewData.value || {}
return {
...row,
...detail,
bizType: row.bizType || detail.bizType,
applyCode: detail.applyCode || row.applyCode,
applicantName: detail.applicantName || row.applicantName,
amount: detail.amount ?? row.amount,
currentNode: detail.currentNode ?? row.currentNode,
status: detail.status ?? row.status
}
})
const viewDetailKvFields = computed<ViewField[]>(() => {
const d = viewHero.value
if (d.bizType === '备用金') {
return [
bxViewKv('申请单号', d.applyCode, { long: false }),
bxViewKv('业务类型', d.bizType, { long: false, tagType: bizTypeTagType(d.bizType) }),
bxViewKv('申请人', d.applicantName, { long: false }),
bxViewKvMoney(
'实际发放金额(元)',
d.actualAmount != null ? formatMoneyYuan(d.actualAmount) : '—',
{ long: false }
),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0), { long: false }),
bxViewKvMoney('冲抵总金额(元)', formatMoneyYuan(d.offsetAmount || 0), { long: false }),
bxViewKv('状态', statusLabel(d.status), { long: false, tagType: statusTagType(d.status) }),
bxViewKv('申请时间', d.applyTime, { long: false }),
bxViewKv('申请原因', d.reason || d.title, { long: false })
]
}
return [
bxViewKv('申请单号', d.applyCode, { long: false }),
bxViewKv('业务类型', d.bizType, { long: false, tagType: bizTypeTagType(d.bizType) }),
bxViewKv('报销日期', d.reimburseDate, { long: false }),
bxViewKv('报销标题', d.title, { long: false }),
bxViewKv('申请人', d.applicantName, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0), { long: false }),
bxViewKv('状态', statusLabel(d.status), { long: false, tagType: statusTagType(d.status) }),
bxViewKv('当前节点', workflowNodeDisplay(d.currentNode, d.status), { long: false }),
bxViewKv('申请时间', d.applyTime, { long: false }),
bxViewKvLong('报销说明', d.remark, { fullSpan: true })
]
})
const viewFlowNodes = ref<any[]>([])
const viewApprovalHistory = ref<any[]>([])
const viewFlowLoading = ref(false)
const viewLinkedInvoiceFiles = ref<BxAttachmentItem[]>([])
const viewAttachments = ref<BxAttachmentItem[]>([])
const viewPayAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetAttachments = ref<BxAttachmentItem[]>([])
const viewIssueAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetRecords = ref<any[]>([])
function viewDetailSummary({ columns, data }: { columns: any[]; data: any[] }) {
const sums: string[] = []
columns.forEach((_: any, index: number) => {
if (index === 0) {
sums[index] = '合计'
return
}
if (index === 2) {
const total = data.reduce((sum: number, row: any) => sum + Number(row.amount || 0), 0)
sums[index] = formatMoneyYuan(total)
return
}
sums[index] = ''
})
return sums
}
const bizTypeOptions = ['全部', '报销单', '备用金']
const statusOptions = ['全部', '待提交', '审批中', '审批通过', '审批驳回', '已发放']
const nodeOptions = [
'全部',
'草稿',
'发起人主管审批',
'财务复核',
'总经理审批',
'已完成',
'已驳回',
'已发放'
]
async function loadData() {
loading.value = true
try {
const [advRes, reimRes]: any[] = await Promise.all([
advanceApi.list({ page: 1, pageSize: 999 }),
reimburseApi.list({ page: 1, pageSize: 999 })
])
const advRows = (advRes.data?.rows || []).map((r: any) => ({
...r,
bizType: '备用金',
title: r.reason,
applyCode: r.applyCode || r.code,
applicantName: r.applicantName || r.user,
applicantId: r.applicantId
}))
const reimRows = (reimRes.data?.rows || []).map((r: any) => ({
...r,
bizType: '报销单',
title: r.title,
applyCode: r.applyCode || r.code,
applicantName: r.applicantName || r.user,
applicantId: r.applicantId
}))
mergedRows.value = [...advRows, ...reimRows]
} catch {
// error handled by interceptor
} finally {
loading.value = false
}
}
function handleSearch() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
syncAppliedFilter()
pager.currentPage.value = 1
}
useDbInstantSearch(
() => ({
code: filterForm.code,
bizType: filterForm.bizType,
applicantId: filterForm.applicantId,
status: filterForm.status,
applyDateRange: filterForm.applyDateRange,
amountRange: filterForm.amountRange,
currentNode: filterForm.currentNode
}),
handleSearch
)
function handleReset() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
Object.assign(filterForm, {
code: '',
bizType: '',
applicantId: undefined,
status: '',
applyDateRange: null,
amountRange: '',
currentNode: ''
})
Object.assign(appliedFilter, {
code: '',
bizType: '',
applicantId: undefined,
status: '',
applyDateRange: null,
amountRange: '',
currentNode: ''
})
pager.currentPage.value = 1
}
function handleQuickSearch() {
appliedQuickSearch.value = quickSearchKeyword.value.trim()
pager.currentPage.value = 1
}
function handleQuickSearchClear() {
quickSearchKeyword.value = ''
appliedQuickSearch.value = ''
pager.currentPage.value = 1
}
function handleSelectionChange(rows: any[]) {
selectedRows.value = rows
}
async function openViewDetail(row: any) {
currentRow.value = row
viewData.value = {}
viewFlowNodes.value = []
viewApprovalHistory.value = []
viewLinkedInvoiceFiles.value = []
viewAttachments.value = []
viewPayAttachments.value = []
viewOffsetAttachments.value = []
viewIssueAttachments.value = []
viewOffsetRecords.value = []
viewFlowLoading.value = true
dialogs.viewDetail = true
const isAdvance = row.bizType === '备用金'
const api = isAdvance ? advanceApi : reimburseApi
try {
const detailRes: any = await api.getById(row.id)
viewData.value = detailRes?.data || detailRes || {}
const tasks: Promise<any>[] = [api.getApprovals(row.id), api.getApprovalHistory(row.id)]
if (isAdvance) {
tasks.push(
paymentApi
.advanceOffsetRecords(row.id)
.then((res: any) => {
viewOffsetRecords.value = res?.data || []
})
.catch(() => {
viewOffsetRecords.value = []
}),
loadBxAttachments('advance_issue', row.id)
.then((files) => {
viewIssueAttachments.value = files
})
.catch(() => {
viewIssueAttachments.value = []
})
)
} else {
const linked = invoicesToLinkedAttachmentFiles(viewData.value.invoices || [])
viewLinkedInvoiceFiles.value = linked
tasks.push(
fillBxAttachmentPreviews(linked).catch(() => undefined),
loadBxAttachments('reimburse_apply', row.id)
.then((files) => {
viewAttachments.value = files
})
.catch(() => {
viewAttachments.value = []
}),
loadBxAttachments('reimburse_pay', row.id)
.then((files) => {
viewPayAttachments.value = files
})
.catch(() => {
viewPayAttachments.value = []
}),
loadBxAttachments('reimburse_offset', row.id)
.then((files) => {
viewOffsetAttachments.value = files
})
.catch(() => {
viewOffsetAttachments.value = []
})
)
}
const [flowRes, historyRes]: any[] = await Promise.all(tasks)
viewFlowNodes.value = (flowRes.data || []).sort((a: any, b: any) => a.nodeOrder - b.nodeOrder)
viewApprovalHistory.value = historyRes.data || []
} catch (e: any) {
ElMessage.error(e.message || '加载详情失败')
} finally {
viewFlowLoading.value = false
}
}
onMounted(() => {
loadApplicantOptions()
loadData()
})
</script>
<style scoped lang="scss">
.bx-list-table-wrap {
min-width: 0;
}
.bx-list-table-wrap {
min-width: 0;
}
</style>
+531 -358
View File
@@ -4,7 +4,12 @@
<div class="page-container">
<section class="panel">
<div class="filter-block">
<el-form :model="filterForm" class="filter-form" @submit.prevent style="--filter-label-width: 110px">
<el-form
:model="filterForm"
class="filter-form"
@submit.prevent
style="--filter-label-width: 110px"
>
<div class="filter-grid">
<el-form-item label="单号">
<el-input v-model="filterForm.code" placeholder="请输入单号" clearable />
@@ -45,10 +50,21 @@
<div class="filter-actions">
<div class="filter-actions-start" />
<div class="filter-actions-end">
<el-button native-type="button" class="btn-ghost" :loading="searchLoading" @click="handleReset">
<el-button
native-type="button"
class="btn-ghost"
:loading="searchLoading"
@click="handleReset"
>
<el-icon><RefreshLeft /></el-icon>重置
</el-button>
<el-button native-type="button" class="btn-main" type="primary" :loading="searchLoading" @click="handleSearch">
<el-button
native-type="button"
class="btn-main"
type="primary"
:loading="searchLoading"
@click="handleSearch"
>
<el-icon><Search /></el-icon>搜索
</el-button>
</div>
@@ -78,7 +94,8 @@
<div class="list-body list-wrap">
<div ref="mineTableWrapRef" class="table-scroll bx-list-table-wrap">
<ListTable table-key="bx-view-mine"
<ListTable
table-key="bx-view-mine"
class="list-table"
:data="pagedRows"
v-loading="tableLoading"
@@ -88,7 +105,13 @@
@header-dragend="() => mineStatsRowRef?.resync?.()"
>
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
<el-table-column
type="index"
label="序号"
min-width="68"
align="center"
header-align="center"
/>
<el-table-column
v-if="isColumnVisible('applyTime')"
prop="applyTime"
@@ -211,52 +234,118 @@
<div class="dlg-view">
<div class="dlg-view-hero">
<div class="dlg-view-hero-top">
<h2 class="dlg-view-title">{{ currentRow?.applyCode || '-' }}</h2>
<h2 class="dlg-view-title">{{ viewHero.applyCode || '-' }}</h2>
<div class="dlg-view-tags">
<el-tag :type="statusTagType(currentRow?.status)" size="small">
{{ statusLabel(currentRow?.status) }}
<el-tag :type="statusTagType(viewHero.status)" size="small">
{{ statusLabel(viewHero.status) }}
</el-tag>
<el-tag :type="bizTypeTagType(currentRow?.bizType)" size="small">
{{ currentRow?.bizType || '-' }}
<el-tag :type="bizTypeTagType(viewHero.bizType)" size="small">
{{ viewHero.bizType || '-' }}
</el-tag>
</div>
</div>
<p class="dlg-view-meta">
金额(元):<b class="money-em">{{ formatMoneyYuan(currentRow?.amount || 0) }}</b>
金额(元):<b class="money-em">{{ formatMoneyYuan(viewHero.amount || 0) }}</b>
</p>
</div>
<div class="dlg-view-section">
<h4 class="dlg-view-section-title">基础信息</h4>
<BxViewKvTable :fields="viewDetailKvFields" mode="triple" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewLinkedInvoiceFiles.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">关联发票</h4>
<BxAttachmentReadonly :files="viewLinkedInvoiceFiles" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">历史附件</h4>
<BxAttachmentReadonly :files="viewAttachments" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewPayAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewPayAttachments" />
</div>
<div
v-if="currentRow?.bizType === '报销单' && viewOffsetAttachments.length"
class="dlg-view-section"
>
<h4 class="dlg-view-section-title">冲抵附件</h4>
<BxAttachmentReadonly :files="viewOffsetAttachments" />
</div>
<template v-if="viewHero.bizType === '报销单'">
<div class="dlg-view-section">
<h4 class="dlg-view-section-title">报销明细</h4>
<el-table
:data="viewData.details || []"
border
size="small"
show-summary
:summary-method="viewDetailSummary"
class="view-detail-table"
>
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column prop="expenseName" label="费用项目" min-width="160" />
<el-table-column
prop="amount"
label="金额(元)"
min-width="120"
class-name="col-money"
>
<template #default="{ row }">
{{ formatMoneyYuan(row.amount || 0) }}
</template>
</el-table-column>
<el-table-column prop="remark" label="报销事由" min-width="140">
<template #default="{ row }">
{{ row.remark || '-' }}
</template>
</el-table-column>
</el-table>
</div>
<div v-if="viewLinkedInvoiceFiles.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">关联发票</h4>
<BxAttachmentReadonly :files="viewLinkedInvoiceFiles" />
</div>
<div v-if="viewAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">历史附件</h4>
<BxAttachmentReadonly :files="viewAttachments" />
</div>
<div v-if="viewPayAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewPayAttachments" />
</div>
<div v-if="viewOffsetAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">冲抵附件</h4>
<BxAttachmentReadonly :files="viewOffsetAttachments" />
</div>
</template>
<template v-else-if="viewHero.bizType === '备用金'">
<BaseDetailTableSection
title="冲抵记录"
:data="viewOffsetRecords"
empty-text="暂无冲抵记录"
>
<el-table :data="viewOffsetRecords" border size="small" class="view-detail-table">
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column
prop="reimburseApplyCode"
label="报销单号"
min-width="130"
align="center"
show-overflow-tooltip
/>
<el-table-column
prop="reimburseApplicantName"
label="报销申请人"
min-width="110"
align="center"
/>
<el-table-column
prop="reimburseTitle"
label="报销标题"
min-width="160"
align="left"
show-overflow-tooltip
/>
<el-table-column
label="冲抵金额(元)"
min-width="120"
class-name="col-money"
align="right"
>
<template #default="{ row: offsetRow }">
{{ formatMoneyYuan(offsetRow.offsetAmount || 0) }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="冲抵时间" min-width="160" align="center" />
<el-table-column prop="operator" label="操作人" min-width="100" align="center" />
</el-table>
</BaseDetailTableSection>
<div v-if="viewIssueAttachments.length" class="dlg-view-section">
<h4 class="dlg-view-section-title">发放附件</h4>
<BxAttachmentReadonly :files="viewIssueAttachments" />
</div>
</template>
<BxApprovalFlowTabs
:nodes="viewFlowNodes"
:history="viewApprovalHistory"
@@ -268,343 +357,427 @@
</template>
<script setup lang="ts">
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
import type { StatsRowColumn } from '@/utils/list-column-stats'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { computed, onActivated, onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { Close, Search, RefreshLeft } from '@element-plus/icons-vue'
import { advanceApi, reimburseApi } from '@/api/bx'
import {
bizTypeTagType,
statusLabel,
statusTagType,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
} from '@/utils/bx/format'
import BxApprovalFlowTabs from '@/components/bx/base/BxApprovalFlowTabs.vue'
import BxViewKvTable from '@/components/bx/base/BxViewKvTable.vue'
import BxAttachmentReadonly from '@/components/bx/base/BxAttachmentReadonly.vue'
import type { ViewField } from '@/components/business/system-view-dialog/types'
import { bxViewKv, bxViewKvMoney } from '@/utils/bx/view-kv'
import { type BxAttachmentItem, loadBxAttachments } from '@/utils/bx/attachment'
import { invoicesToLinkedAttachmentFiles } from '@/utils/bx/invoice-link-files'
import { buildApplyDateRangeQuery, matchesApplyDateRange, type ApplyDateRange } from '@/utils/bx/apply-date-filter'
import { usePagedTable } from '@/hooks/bx/usePagedTable'
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
import type { StatsRowColumn } from '@/utils/list-column-stats'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { computed, onActivated, onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { Search, RefreshLeft } from '@element-plus/icons-vue'
import { advanceApi, paymentApi, reimburseApi } from '@/api/bx'
import {
bizTypeTagType,
statusLabel,
statusTagType,
formatMoneyYuan,
moneyTableFormatter,
workflowNodeDisplay,
workflowNodeLabel,
workflowNodeTagType,
shouldShowWorkflowNodeTag
} from '@/utils/bx/format'
import BxApprovalFlowTabs from '@/components/bx/base/BxApprovalFlowTabs.vue'
import BxViewKvTable from '@/components/bx/base/BxViewKvTable.vue'
import BxAttachmentReadonly from '@/components/bx/base/BxAttachmentReadonly.vue'
import BaseDetailTableSection from '@/components/bx/base/BaseDetailTableSection.vue'
import type { ViewField } from '@/components/business/system-view-dialog/types'
import { bxViewKv, bxViewKvLong, bxViewKvMoney } from '@/utils/bx/view-kv'
import {
type BxAttachmentItem,
fillBxAttachmentPreviews,
loadBxAttachments
} from '@/utils/bx/attachment'
import { invoicesToLinkedAttachmentFiles } from '@/utils/bx/invoice-link-files'
import { buildApplyDateRangeQuery, type ApplyDateRange } from '@/utils/bx/apply-date-filter'
import { usePagedTable } from '@/hooks/bx/usePagedTable'
type DialogKey = 'viewDetail'
type DialogKey = 'viewDetail'
const tableLoading = ref(false)
const searchLoading = ref(false)
const selectedRows = ref<any[]>([])
const dialogs = reactive<Record<DialogKey, boolean>>({
viewDetail: false
})
const tableLoading = ref(false)
const searchLoading = ref(false)
const selectedRows = ref<any[]>([])
const dialogs = reactive<Record<DialogKey, boolean>>({
viewDetail: false
})
const mergedRows = ref<any[]>([])
const mergedRows = ref<any[]>([])
const listColumnDefs = [
{ prop: 'applyTime', label: '申请时间' },
{ prop: 'bizType', label: '业务类型' },
{ prop: 'title', label: '申请标题' },
{ prop: 'amount', label: '申请金额(元)' },
{ prop: 'status', label: '状态' },
{ prop: 'currentNode', label: '当前节点', defaultVisible: false }
]
const {
visibleColumns,
checkAll,
isIndeterminate,
isColumnVisible,
resetToDefault
} = usePersistedListColumns('bx-view-mine-list-columns', listColumnDefs)
const mineTableWrapRef = ref<HTMLElement | null>(null)
const mineStatsRowRef = ref<{ resync?: () => void } | null>(null)
const mineStatsRowColumns = computed((): StatsRowColumn[] => {
const cols: StatsRowColumn[] = [
{ key: '__selection', interactive: false },
{ key: '__index', interactive: false }
const listColumnDefs = [
{ prop: 'applyTime', label: '申请时间' },
{ prop: 'bizType', label: '业务类型' },
{ prop: 'title', label: '申请标题' },
{ prop: 'amount', label: '申请金额(元)' },
{ prop: 'status', label: '状态' },
{ prop: 'currentNode', label: '当前节点', defaultVisible: false }
]
if (isColumnVisible('applyTime')) {
cols.push({ key: 'applyTime', interactive: true, prop: 'applyTime' })
}
cols.push({ key: 'applyCode', interactive: true, prop: 'applyCode' })
for (const def of listColumnDefs) {
if (def.prop === 'applyTime') continue
if (!isColumnVisible(def.prop)) continue
cols.push({
key: def.prop,
interactive: true,
prop: def.prop,
money: def.prop === 'amount'
})
}
return cols
})
const quickSearchKeyword = ref('')
const { visibleColumns, checkAll, isIndeterminate, isColumnVisible, resetToDefault } =
usePersistedListColumns('bx-view-mine-list-columns', listColumnDefs)
const filterForm = reactive({
code: '',
bizType: '' as string,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: ''
})
const mineTableWrapRef = ref<HTMLElement | null>(null)
const mineStatsRowRef = ref<{ resync?: () => void } | null>(null)
const appliedFilter = reactive({
code: '',
bizType: '' as string,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: ''
})
function syncAppliedFilter() {
Object.assign(appliedFilter, { ...filterForm })
}
function filterMineRows(rows: any[]) {
let list = [...rows]
const kw = appliedFilter.code.trim()
if (kw) {
list = list.filter(
(r: any) =>
String(r.applyCode || '').includes(kw) || String(r.title || '').includes(kw)
)
}
if (appliedFilter.bizType) {
list = list.filter((r: any) => r.bizType === appliedFilter.bizType)
}
if (appliedFilter.amountRange?.trim()) {
const parts = appliedFilter.amountRange.split(/[-–]/).map((x: string) => Number(String(x).trim()))
if (parts.length >= 2 && !parts.some((n) => Number.isNaN(n))) {
const lo = Math.min(parts[0], parts[1])
const hi = Math.max(parts[0], parts[1])
list = list.filter((r: any) => {
const amt = Number(r.amount || 0)
return amt >= lo && amt <= hi
const mineStatsRowColumns = computed((): StatsRowColumn[] => {
const cols: StatsRowColumn[] = [
{ key: '__selection', interactive: false },
{ key: '__index', interactive: false }
]
if (isColumnVisible('applyTime')) {
cols.push({ key: 'applyTime', interactive: true, prop: 'applyTime' })
}
cols.push({ key: 'applyCode', interactive: true, prop: 'applyCode' })
for (const def of listColumnDefs) {
if (def.prop === 'applyTime') continue
if (!isColumnVisible(def.prop)) continue
cols.push({
key: def.prop,
interactive: true,
prop: def.prop,
money: def.prop === 'amount'
})
}
return cols
})
const quickSearchKeyword = ref('')
const filterForm = reactive({
code: '',
bizType: '' as string,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: ''
})
const appliedFilter = reactive({
code: '',
bizType: '' as string,
status: '' as string,
applyDateRange: null as ApplyDateRange,
amountRange: ''
})
function syncAppliedFilter() {
Object.assign(appliedFilter, { ...filterForm })
}
return list
}
const filteredMergedRows = computed(() => filterMineRows(mergedRows.value))
const {
pagedRows,
total: filteredTotal,
currentPage,
pageSize,
rangeText,
onSizeChange
} = usePagedTable(() => filteredMergedRows.value, { initialPageSize: 20 })
const currentRow = ref<any>(null)
const viewDetailKvFields = computed<ViewField[]>(() => {
const r = currentRow.value
return [
bxViewKv('申请单号', r?.applyCode, { long: false }),
bxViewKv('业务类型', r?.bizType, { long: false, tagType: bizTypeTagType(r?.bizType) }),
bxViewKv('申请标题', r?.title, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(r?.amount || 0), { long: false }),
bxViewKv('状态', statusLabel(r?.status), { long: false, tagType: statusTagType(r?.status) }),
bxViewKv('当前节点', workflowNodeDisplay(r?.currentNode, r?.status), { long: false }),
bxViewKv('申请时间', r?.applyTime, { long: false })
]
})
const viewFlowNodes = ref<any[]>([])
const viewApprovalHistory = ref<any[]>([])
const viewFlowLoading = ref(false)
const viewLinkedInvoiceFiles = ref<BxAttachmentItem[]>([])
const viewAttachments = ref<BxAttachmentItem[]>([])
const viewPayAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetAttachments = ref<BxAttachmentItem[]>([])
function buildApiQuery() {
const q: Record<string, string> = {}
const code = appliedFilter.code.trim()
if (code) q.keyword = code
if (appliedFilter.status) q.status = appliedFilter.status
buildApplyDateRangeQuery(appliedFilter.applyDateRange, q)
return q
}
function mapAdvanceMineRow(r: any) {
return {
...r,
bizType: '备用金',
title: r.reason,
applyCode: r.applyCode || r.code
}
}
function mapReimburseMineRow(r: any) {
return {
...r,
bizType: '报销单',
title: r.title,
applyCode: r.applyCode || r.code
}
}
function sortMergedRows(rows: any[]) {
return [...rows].sort((a, b) => String(b.applyTime || '').localeCompare(String(a.applyTime || '')))
}
async function loadData(options: { buttonLoading?: boolean } = {}) {
if (options.buttonLoading) searchLoading.value = true
tableLoading.value = true
try {
const apiQuery = buildApiQuery()
const listParams = { page: 1, pageSize: 9999, ...apiQuery }
const [advRes, reimRes] = await Promise.allSettled([
advanceApi.my(listParams),
reimburseApi.my(listParams)
])
const advRows =
advRes.status === 'fulfilled'
? (advRes.value.data?.rows || []).map(mapAdvanceMineRow)
: []
const reimRows =
reimRes.status === 'fulfilled'
? (reimRes.value.data?.rows || []).map(mapReimburseMineRow)
: []
mergedRows.value = sortMergedRows([...advRows, ...reimRows])
} catch {
// error handled by interceptor
} finally {
if (options.buttonLoading) searchLoading.value = false
tableLoading.value = false
}
}
function handleSearch() {
quickSearchKeyword.value = ''
syncAppliedFilter()
currentPage.value = 1
loadData({ buttonLoading: true })
}
useDbInstantSearch(
() => ({
code: filterForm.code,
bizType: filterForm.bizType,
status: filterForm.status,
applyDateRange: filterForm.applyDateRange,
amountRange: filterForm.amountRange
}),
handleSearch
)
function handleReset() {
quickSearchKeyword.value = ''
Object.assign(filterForm, { code: '', bizType: '', status: '', applyDateRange: null, amountRange: '' })
Object.assign(appliedFilter, { code: '', bizType: '', status: '', applyDateRange: null, amountRange: '' })
currentPage.value = 1
loadData({ buttonLoading: true })
}
function handleQuickSearch() {
appliedFilter.code = quickSearchKeyword.value.trim()
currentPage.value = 1
loadData()
}
function handleQuickSearchClear() {
quickSearchKeyword.value = ''
appliedFilter.code = ''
currentPage.value = 1
loadData()
}
function handleSelectionChange(rows: any[]) {
selectedRows.value = rows
}
async function openViewDetail(row: any) {
currentRow.value = row
viewFlowNodes.value = []
viewApprovalHistory.value = []
viewLinkedInvoiceFiles.value = []
viewAttachments.value = []
viewPayAttachments.value = []
viewOffsetAttachments.value = []
viewFlowLoading.value = true
dialogs.viewDetail = true
try {
const api = row.bizType === '备用金' ? advanceApi : reimburseApi
const tasks: Promise<any>[] = [
api.getApprovals(row.id),
api.getApprovalHistory(row.id)
]
if (row.bizType === '报销单') {
tasks.push(
reimburseApi
.getById(row.id)
.then((res: any) => {
const data = res?.data || res || {}
viewLinkedInvoiceFiles.value = invoicesToLinkedAttachmentFiles(data.invoices || [])
})
.catch(() => {
viewLinkedInvoiceFiles.value = []
}),
loadBxAttachments('reimburse_apply', row.id)
.then((files) => {
viewAttachments.value = files
})
.catch(() => {
viewAttachments.value = []
}),
loadBxAttachments('reimburse_pay', row.id)
.then((files) => {
viewPayAttachments.value = files
})
.catch(() => {
viewPayAttachments.value = []
}),
loadBxAttachments('reimburse_offset', row.id)
.then((files) => {
viewOffsetAttachments.value = files
})
.catch(() => {
viewOffsetAttachments.value = []
})
function filterMineRows(rows: any[]) {
let list = [...rows]
const kw = appliedFilter.code.trim()
if (kw) {
list = list.filter(
(r: any) => String(r.applyCode || '').includes(kw) || String(r.title || '').includes(kw)
)
}
const [flowRes, historyRes]: any[] = await Promise.all(tasks)
viewFlowNodes.value = (flowRes.data || []).sort((a: any, b: any) => a.nodeOrder - b.nodeOrder)
viewApprovalHistory.value = historyRes.data || []
} catch (e: any) {
ElMessage.error(e.message || '加载审批流程失败')
} finally {
viewFlowLoading.value = false
if (appliedFilter.bizType) {
list = list.filter((r: any) => r.bizType === appliedFilter.bizType)
}
if (appliedFilter.amountRange?.trim()) {
const parts = appliedFilter.amountRange
.split(/[-–]/)
.map((x: string) => Number(String(x).trim()))
if (parts.length >= 2 && !parts.some((n) => Number.isNaN(n))) {
const lo = Math.min(parts[0], parts[1])
const hi = Math.max(parts[0], parts[1])
list = list.filter((r: any) => {
const amt = Number(r.amount || 0)
return amt >= lo && amt <= hi
})
}
}
return list
}
}
onMounted(() => {
loadData()
})
const filteredMergedRows = computed(() => filterMineRows(mergedRows.value))
onActivated(() => {
loadData()
})
const {
pagedRows,
total: filteredTotal,
currentPage,
pageSize,
rangeText,
onSizeChange
} = usePagedTable(() => filteredMergedRows.value, { initialPageSize: 20 })
const currentRow = ref<any>(null)
const viewData = ref<Record<string, any>>({})
const viewHero = computed(() => {
const row = currentRow.value || {}
const detail = viewData.value || {}
return {
...row,
...detail,
bizType: row.bizType || detail.bizType,
applyCode: detail.applyCode || row.applyCode,
applicantName: detail.applicantName || row.applicantName,
amount: detail.amount ?? row.amount,
currentNode: detail.currentNode ?? row.currentNode,
status: detail.status ?? row.status
}
})
const viewDetailKvFields = computed<ViewField[]>(() => {
const d = viewHero.value
if (d.bizType === '备用金') {
return [
bxViewKv('申请单号', d.applyCode, { long: false }),
bxViewKv('业务类型', d.bizType, { long: false, tagType: bizTypeTagType(d.bizType) }),
bxViewKv('申请人', d.applicantName, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0), { long: false }),
bxViewKvMoney(
'实际发放金额(元)',
d.actualAmount != null ? formatMoneyYuan(d.actualAmount) : '—',
{ long: false }
),
bxViewKvMoney('冲抵总金额(元)', formatMoneyYuan(d.offsetAmount || 0), { long: false }),
bxViewKv('状态', statusLabel(d.status), { long: false, tagType: statusTagType(d.status) }),
bxViewKv('申请时间', d.applyTime, { long: false }),
bxViewKv('申请原因', d.reason || d.title, { long: false })
]
}
return [
bxViewKv('申请单号', d.applyCode, { long: false }),
bxViewKv('业务类型', d.bizType, { long: false, tagType: bizTypeTagType(d.bizType) }),
bxViewKv('报销日期', d.reimburseDate, { long: false }),
bxViewKv('报销标题', d.title, { long: false }),
bxViewKv('申请人', d.applicantName, { long: false }),
bxViewKvMoney('申请金额(元)', formatMoneyYuan(d.amount || 0), { long: false }),
bxViewKv('状态', statusLabel(d.status), { long: false, tagType: statusTagType(d.status) }),
bxViewKv('当前节点', workflowNodeDisplay(d.currentNode, d.status), { long: false }),
bxViewKv('申请时间', d.applyTime, { long: false }),
bxViewKvLong('报销说明', d.remark, { fullSpan: true })
]
})
const viewFlowNodes = ref<any[]>([])
const viewApprovalHistory = ref<any[]>([])
const viewFlowLoading = ref(false)
const viewLinkedInvoiceFiles = ref<BxAttachmentItem[]>([])
const viewAttachments = ref<BxAttachmentItem[]>([])
const viewPayAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetAttachments = ref<BxAttachmentItem[]>([])
const viewIssueAttachments = ref<BxAttachmentItem[]>([])
const viewOffsetRecords = ref<any[]>([])
function viewDetailSummary({ columns, data }: { columns: any[]; data: any[] }) {
const sums: string[] = []
columns.forEach((_: any, index: number) => {
if (index === 0) {
sums[index] = '合计'
return
}
if (index === 2) {
const total = data.reduce((sum: number, row: any) => sum + Number(row.amount || 0), 0)
sums[index] = formatMoneyYuan(total)
return
}
sums[index] = ''
})
return sums
}
function buildApiQuery() {
const q: Record<string, string> = {}
const code = appliedFilter.code.trim()
if (code) q.keyword = code
if (appliedFilter.status) q.status = appliedFilter.status
buildApplyDateRangeQuery(appliedFilter.applyDateRange, q)
return q
}
function mapAdvanceMineRow(r: any) {
return {
...r,
bizType: '备用金',
title: r.reason,
applyCode: r.applyCode || r.code
}
}
function mapReimburseMineRow(r: any) {
return {
...r,
bizType: '报销单',
title: r.title,
applyCode: r.applyCode || r.code
}
}
function sortMergedRows(rows: any[]) {
return [...rows].sort((a, b) =>
String(b.applyTime || '').localeCompare(String(a.applyTime || ''))
)
}
async function loadData(options: { buttonLoading?: boolean } = {}) {
if (options.buttonLoading) searchLoading.value = true
tableLoading.value = true
try {
const apiQuery = buildApiQuery()
const listParams = { page: 1, pageSize: 9999, ...apiQuery }
const [advRes, reimRes] = await Promise.allSettled([
advanceApi.my(listParams),
reimburseApi.my(listParams)
])
const advRows =
advRes.status === 'fulfilled' ? (advRes.value.data?.rows || []).map(mapAdvanceMineRow) : []
const reimRows =
reimRes.status === 'fulfilled'
? (reimRes.value.data?.rows || []).map(mapReimburseMineRow)
: []
mergedRows.value = sortMergedRows([...advRows, ...reimRows])
} catch {
// error handled by interceptor
} finally {
if (options.buttonLoading) searchLoading.value = false
tableLoading.value = false
}
}
function handleSearch() {
quickSearchKeyword.value = ''
syncAppliedFilter()
currentPage.value = 1
loadData({ buttonLoading: true })
}
useDbInstantSearch(
() => ({
code: filterForm.code,
bizType: filterForm.bizType,
status: filterForm.status,
applyDateRange: filterForm.applyDateRange,
amountRange: filterForm.amountRange
}),
handleSearch
)
function handleReset() {
quickSearchKeyword.value = ''
Object.assign(filterForm, {
code: '',
bizType: '',
status: '',
applyDateRange: null,
amountRange: ''
})
Object.assign(appliedFilter, {
code: '',
bizType: '',
status: '',
applyDateRange: null,
amountRange: ''
})
currentPage.value = 1
loadData({ buttonLoading: true })
}
function handleQuickSearch() {
appliedFilter.code = quickSearchKeyword.value.trim()
currentPage.value = 1
loadData()
}
function handleQuickSearchClear() {
quickSearchKeyword.value = ''
appliedFilter.code = ''
currentPage.value = 1
loadData()
}
function handleSelectionChange(rows: any[]) {
selectedRows.value = rows
}
async function openViewDetail(row: any) {
currentRow.value = row
viewData.value = {}
viewFlowNodes.value = []
viewApprovalHistory.value = []
viewLinkedInvoiceFiles.value = []
viewAttachments.value = []
viewPayAttachments.value = []
viewOffsetAttachments.value = []
viewIssueAttachments.value = []
viewOffsetRecords.value = []
viewFlowLoading.value = true
dialogs.viewDetail = true
const isAdvance = row.bizType === '备用金'
const api = isAdvance ? advanceApi : reimburseApi
try {
const detailRes: any = await api.getById(row.id)
viewData.value = detailRes?.data || detailRes || {}
const tasks: Promise<any>[] = [api.getApprovals(row.id), api.getApprovalHistory(row.id)]
if (isAdvance) {
tasks.push(
paymentApi
.advanceOffsetRecords(row.id)
.then((res: any) => {
viewOffsetRecords.value = res?.data || []
})
.catch(() => {
viewOffsetRecords.value = []
}),
loadBxAttachments('advance_issue', row.id)
.then((files) => {
viewIssueAttachments.value = files
})
.catch(() => {
viewIssueAttachments.value = []
})
)
} else {
const linked = invoicesToLinkedAttachmentFiles(viewData.value.invoices || [])
viewLinkedInvoiceFiles.value = linked
tasks.push(
fillBxAttachmentPreviews(linked).catch(() => undefined),
loadBxAttachments('reimburse_apply', row.id)
.then((files) => {
viewAttachments.value = files
})
.catch(() => {
viewAttachments.value = []
}),
loadBxAttachments('reimburse_pay', row.id)
.then((files) => {
viewPayAttachments.value = files
})
.catch(() => {
viewPayAttachments.value = []
}),
loadBxAttachments('reimburse_offset', row.id)
.then((files) => {
viewOffsetAttachments.value = files
})
.catch(() => {
viewOffsetAttachments.value = []
})
)
}
const [flowRes, historyRes]: any[] = await Promise.all(tasks)
viewFlowNodes.value = (flowRes.data || []).sort((a: any, b: any) => a.nodeOrder - b.nodeOrder)
viewApprovalHistory.value = historyRes.data || []
} catch (e: any) {
ElMessage.error(e.message || '加载详情失败')
} finally {
viewFlowLoading.value = false
}
}
onMounted(() => {
loadData()
})
onActivated(() => {
loadData()
})
</script>
<style scoped lang="scss">
.bx-list-table-wrap {
min-width: 0;
}
.bx-list-table-wrap {
min-width: 0;
}
</style>
File diff suppressed because it is too large. Load diff
@@ -1843,6 +1843,8 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
const subtotal = parseFloat(String(product.subtotal || 0));
const taxAmount = parseFloat(String(product.taxAmount || 0));
const beforeTax = subtotal - taxAmount;
const taxRateNum = Number(product.taxRate);
const taxRateText = Number.isFinite(taxRateNum) ? `${taxRateNum}%` : '0%';
const pricingCells = isFrameworkContract
? '<td colspan="4" style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">随行就市</td>'
@@ -1859,13 +1861,14 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${getUnitLabel(product.unit)}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
${pricingCells}
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${product.packageSpec || ''}</td>
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${product.remark || ''}</td>
</tr>`;
})
.join('') ||
'<tr><td colspan="11" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
'<tr><td colspan="12" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
// 定义替换映射表
const getSettlementClauseContent = (): string =>
@@ -1931,9 +1934,17 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<th style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 8%;">品牌</th>`
)
}
// 旧模板表头无「税率」时,在「用量」后插入
if (!/用量(?:(吨))?<\/th>[\s\S]{0,200}?税率<\/th>/i.test(result)) {
result = result.replace(
/(<th[^>]*>\s*用量(?:(吨))?\s*<\/th>)/i,
`$1
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 5%;">税率</th>`
)
}
// 合计区(11 列):第 1 行左右对半运费/桶押金;第 2 行合计;第 3 行提示
// 合计区(12 列):第 1 行左右对半运费/桶押金;第 2 行合计;第 3 行提示
const freightRaw = Number(contractData.freight);
const freightAmount = Number.isFinite(freightRaw) && freightRaw > 0 ? freightRaw : 0;
const depositRaw = Number(contractData.barrelDeposit);
@@ -1953,14 +1964,14 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<td colspan="2" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">运费(元)</td>
<td colspan="4" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${freightText}</td>
<td colspan="2" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">桶押金(元)</td>
<td colspan="3" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${barrelDepositText}</td>
<td colspan="4" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${barrelDepositText}</td>
</tr>
<tr style="background-color: #fff; font-weight: bold;">
<td colspan="2" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">合计(人民币)</td>
<td colspan="9" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
<td colspan="10" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
</tr>
<tr>
<td colspan="11" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
<td colspan="12" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
${tipRowText}
</td>
</tr>
@@ -2234,6 +2245,8 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
const subtotal = parseFloat(String(product.subtotal || 0));
const taxAmount = parseFloat(String(product.taxAmount || 0));
const beforeTax = subtotal - taxAmount;
const taxRateNum = Number(product.taxRate);
const taxRateText = Number.isFinite(taxRateNum) ? `${taxRateNum}%` : '0%';
return `
<tr>
@@ -2242,6 +2255,7 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${getUnitLabel(product.unit)}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(product.price)}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(beforeTax)}</td>
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(taxAmount)}</td>
@@ -2251,7 +2265,7 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
</tr>`;
})
.join('') ||
'<tr><td colspan="11" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
'<tr><td colspan="12" style="padding: 5px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
return `
<div style="width: 210mm; margin: 0 auto; padding: 0 15mm 20mm 15mm; font-family: '宋体', SimSun, serif; line-height: 1.6; box-sizing: border-box;">
@@ -2295,13 +2309,14 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 6%;">规格</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 6%;">品牌</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 5%;">单位</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 10%;">用量</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 7%;">用量</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 5%;">税率</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 12%;">含税单价(元)</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 12%;">未含税金额(元)</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 10%;">税费(元)</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 12%;">含税金额(元)</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 7%;">包装规格</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 10%;">备注</th>
<th style="padding: 5px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; width: 8%;">备注</th>
</tr>
</thead>
<tbody>
@@ -2453,9 +2468,9 @@ const handleSaveTemplate = async () => {
);
const totalRowHtml = totalRowMatch ? totalRowMatch[0] : '';
// 3. 提取提示行(兼容一票制 / 客户自提文案,以及 colspan 10/11)
// 3. 提取提示行(兼容一票制 / 客户自提文案,以及 colspan 10/11/12)
const tipRowMatch = templateWithPlaceholders.match(
/<tr>[\s\S]*?<td colspan="1[01]"[\s\S]*?结算以实际到货吨位为准[\s\S]*?<\/td>[\s\S]*?<\/tr>/
/<tr>[\s\S]*?<td colspan="1[012]"[\s\S]*?结算以实际到货吨位为准[\s\S]*?<\/td>[\s\S]*?<\/tr>/
);
const tipRowHtml = tipRowMatch ? tipRowMatch[0] : '';
@@ -2480,7 +2495,7 @@ const handleSaveTemplate = async () => {
// 替换提示行(兼容旧一票制与客户自提提示)
if (tipRowHtml) {
const tipRowPattern =
/<tr>[\s\S]*?<td colspan="1[01]"[\s\S]*?>含税、(?:含运费|客户自提)[\s\S]*?<\/tr>/;
/<tr>[\s\S]*?<td colspan="1[012]"[\s\S]*?>含税、(?:含运费|客户自提)[\s\S]*?<\/tr>/;
if (tipRowPattern.test(finalTemplate)) {
finalTemplate = finalTemplate.replace(tipRowPattern, tipRowHtml);
}
+29 -14
View File
@@ -1587,6 +1587,8 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
const subtotal = parseFloat(String(product.subtotal || 0));
const taxAmount = parseFloat(String(product.taxAmount || 0));
const beforeTax = subtotal - taxAmount;
const taxRateNum = Number(product.taxRate);
const taxRateText = Number.isFinite(taxRateNum) ? `${taxRateNum}%` : '0%';
return `
<tr>
@@ -1595,6 +1597,7 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<td style="padding: 4px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
<td style="padding: 4px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${getUnitLabel(product.unit)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(product.price)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(beforeTax)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(taxAmount)}</td>
@@ -1604,7 +1607,7 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
</tr>`;
})
.join('') ||
'<tr><td colspan="11" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
'<tr><td colspan="12" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
// 定义替换映射表
const replacements: Record<string, string> = {
@@ -1664,8 +1667,16 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 8%;">品牌</th>`
)
}
// 旧模板表头无「税率」时,在「用量」后插入
if (!/用量(?:(吨))?<\/th>[\s\S]{0,200}?税率<\/th>/i.test(result)) {
result = result.replace(
/(<th[^>]*>\s*用量(?:(吨))?\s*<\/th>)/i,
`$1
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 5%;">税率</th>`
)
}
// 合计区(11 列):第 1 行左右对半运费/桶押金;第 2 行合计;第 3 行提示
// 合计区(12 列):第 1 行左右对半运费/桶押金;第 2 行合计;第 3 行提示
const freightRaw = Number(contractData.freight);
const freightAmount = Number.isFinite(freightRaw) && freightRaw > 0 ? freightRaw : 0;
const depositRaw = Number(contractData.barrelDeposit);
@@ -1686,14 +1697,14 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">运费(元)</td>
<td colspan="4" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${freightText}</td>
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">桶押金(元)</td>
<td colspan="3" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${barrelDepositText}</td>
<td colspan="4" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${barrelDepositText}</td>
</tr>
<tr style="background-color: #fff; font-weight: bold;">
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">合计(人民币)</td>
<td colspan="9" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
<td colspan="10" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
</tr>
<tr>
<td colspan="11" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
<td colspan="12" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
${tipRowText}
</td>
</tr>
@@ -1929,6 +1940,8 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
const subtotal = parseFloat(String(product.subtotal || 0));
const taxAmount = parseFloat(String(product.taxAmount || 0));
const beforeTax = subtotal - taxAmount;
const taxRateNum = Number(product.taxRate);
const taxRateText = Number.isFinite(taxRateNum) ? `${taxRateNum}%` : '0%';
return `
<tr>
@@ -1936,6 +1949,7 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
<td style="padding: 4px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${product.model || product.productModel || ''}</td>
<td style="padding: 4px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(product.price)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(beforeTax)}</td>
<td style="padding: 4px 3px; border: 1px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(taxAmount)}</td>
@@ -1945,7 +1959,7 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
</tr>`;
})
.join('') ||
'<tr><td colspan="10" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
'<tr><td colspan="11" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">暂无产品信息</td></tr>';
return `
<div style="width: 210mm; margin: 0 auto; padding: 0 15mm 20mm 15mm; font-family: '宋体', SimSun, serif; line-height: 1.6; box-sizing: border-box;">
@@ -1986,33 +2000,34 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
<thead>
<tr style="background-color: #fff;">
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 11%;">产品名称</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 9%;">规格</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 8%;">品牌</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 8%;">用量(吨)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 8%;">规格</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 7%;">品牌</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 7%;">用量(吨)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 5%;">税率</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 10%;">含税单价(元/吨)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 10%;">未含税金额(元)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 8%;">税费(元)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 11%;">含税金额(元)</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 7%;">包装规格</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 15%;">备注</th>
<th style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px; width: 13%;">备注</th>
</tr>
</thead>
<tbody>
${productRows}
<!-- 运费/桶押金一行(10 列对半),合计单独一行 -->
<!-- 运费/桶押金一行(11 列对半),合计单独一行 -->
<tr style="background-color: #fff; font-weight: bold;">
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">运费(元)</td>
<td colspan="3" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${freightText}</td>
<td colspan="4" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${freightText}</td>
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">桶押金(元)</td>
<td colspan="3" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${barrelDepositText}</td>
</tr>
<tr style="background-color: #fff; font-weight: bold;">
<td colspan="2" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">合计(人民币)</td>
<td colspan="8" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
<td colspan="9" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 12px;">${totalWithExtrasText}</td>
</tr>
<!-- 提示行 -->
<tr>
<td colspan="10" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
<td colspan="11" style="padding: 5px 6px; border: 1px solid #000; text-align: center; font-size: 11px; background-color: #fff;">
${tipRowText}
</td>
</tr>
@@ -11,9 +11,9 @@ export const SETTLEMENT_CLAUSE_LABELS: Record<string, string> = {
}
const ADVANCE_CLAUSE =
'款到发货。需方付款后安排发货,需方收到货物后,供方开具13%增值税专用发票。'
'款到发货。需方付款后安排发货,需方收到货物后,供方开具增值税专用发票。'
const ARRIVE_CLAUSE =
'货到付款,需方收到供方货物后,供方开具13%增值税专用发票,无异议后,以现汇方式月结。'
'货到付款,需方收到供方货物后,供方开具增值税专用发票,无异议后,以现汇方式月结。'
export function defaultSettlementClause(
settlementMethod?: string | null,
@@ -24,7 +24,7 @@ export function defaultSettlementClause(
if (method in SETTLEMENT_CLAUSE_LABELS) {
const label =
(labelResolver && labelResolver(method)) || SETTLEMENT_CLAUSE_LABELS[method]
return `请根据双方约定填写结算方式:${label}。供方开具13%增值税专用发票,无异议后,以现汇方式月结。`
return `请根据双方约定的结算方式:${label}。供方开具增值税专用发票,无异议后,以现汇方式月结。`
}
return ARRIVE_CLAUSE
}