|
|
@@ -263,8 +263,7 @@ const handleRejectToSpecifySubmit = () => {
|
|
|
message.success('驳回成功');
|
|
|
afterReject(dynamicMethods);
|
|
|
setTimeout(() => {
|
|
|
- //window.close();
|
|
|
- window.location.reload();
|
|
|
+ window.close();
|
|
|
}, 600);
|
|
|
} else {
|
|
|
message.error(res.message);
|
|
|
@@ -977,8 +976,8 @@ const handleReadFlow = () => {
|
|
|
if (res.success) {
|
|
|
message.success('已阅成功');
|
|
|
setTimeout(() => {
|
|
|
- //window.close();
|
|
|
- window.location.reload();
|
|
|
+ window.close();
|
|
|
+ //window.location.reload();
|
|
|
}, 600);
|
|
|
} else {
|
|
|
message.error(res.message);
|
|
|
@@ -1095,19 +1094,24 @@ const handleSubmit = () => {
|
|
|
WebSocketStore.send(JSON.stringify(socketMap));
|
|
|
submitService().then((s) => {
|
|
|
if (s.success === true) {
|
|
|
- // window.close();
|
|
|
- const routerAfter = router.resolve({
|
|
|
- path: '/MvcSheet/formWork',
|
|
|
- query: {
|
|
|
- flowCode: s.data.flowCode,
|
|
|
- flowVersion: s.data.flowVersion,
|
|
|
- bizObjectID: s.data.bizObjectid,
|
|
|
- taskID: s.data.taskid,
|
|
|
- retrieve: '1'//只有从已办列表查看时,才显示取回
|
|
|
- }
|
|
|
- })
|
|
|
- window.open(routerAfter.href,'_self')
|
|
|
- location.reload();
|
|
|
+ if (taskObj.value.activityCode == 'Task2') {
|
|
|
+ window.close();
|
|
|
+ } else {
|
|
|
+ //提交后 保持当前页面
|
|
|
+ const routerAfter = router.resolve({
|
|
|
+ path: '/MvcSheet/formWork',
|
|
|
+ query: {
|
|
|
+ flowCode: s.data.flowCode,
|
|
|
+ flowVersion: s.data.flowVersion,
|
|
|
+ bizObjectID: s.data.bizObjectid,
|
|
|
+ taskID: s.data.taskid,
|
|
|
+ retrieve: '1'//只有从已办列表查看时,才显示取回
|
|
|
+ }
|
|
|
+ })
|
|
|
+ window.open(routerAfter.href, '_self')
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -1293,8 +1297,8 @@ const rejectService = async () => {
|
|
|
message.success('驳回成功');
|
|
|
afterReject(dynamicMethods);
|
|
|
setTimeout(() => {
|
|
|
- //window.close();
|
|
|
- window.location.reload();
|
|
|
+ window.close();
|
|
|
+ //window.location.reload();
|
|
|
}, 600);
|
|
|
} else {
|
|
|
message.error(res.message);
|
|
|
@@ -1374,6 +1378,7 @@ const handleTurnOne = (user) => {
|
|
|
message.success('转发' + user.names + '成功');
|
|
|
setTimeout(() => {
|
|
|
window.close();
|
|
|
+ //location.reload();
|
|
|
}, 600);
|
|
|
} else {
|
|
|
message.error(res.message);
|
|
|
@@ -1536,76 +1541,77 @@ function exposeVm() {
|
|
|
}
|
|
|
},
|
|
|
//金额小写转大写
|
|
|
- lowerToUpperAmounts: (value) => {
|
|
|
- let amount = value * 100;
|
|
|
- if (typeof amount !== 'number' && typeof amount !== 'string') {
|
|
|
- return '输入金额格式不正确';
|
|
|
- }
|
|
|
+ lowerToUpperAmounts: (num) => {
|
|
|
+ // 1. 参数校验和初始化
|
|
|
+ if (isNaN(num) || num === null) return "零元整";
|
|
|
+ num = Number(num);
|
|
|
+ if (num === 0) return "零元整";
|
|
|
+
|
|
|
+ // 2. 数字和单位定义
|
|
|
+ const digits = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
|
|
|
+ const units = ["", "拾", "佰", "仟"];
|
|
|
+ const bigUnits = ["", "万", "亿"];
|
|
|
+ const decimalUnits = ["角", "分"];
|
|
|
+
|
|
|
+ // 3. 处理整数部分
|
|
|
+ let integerPart = Math.floor(num);
|
|
|
+ let integerStr = "";
|
|
|
+ let unitIndex = 0;
|
|
|
+
|
|
|
+ if (integerPart > 0) {
|
|
|
+ do {
|
|
|
+ let segment = integerPart % 10000;
|
|
|
+ let segmentStr = "";
|
|
|
+
|
|
|
+ for (let i = 0; i < 4 && segment > 0; i++) {
|
|
|
+ const digit = segment % 10;
|
|
|
+ segment = Math.floor(segment / 10);
|
|
|
+ if (digit !== 0) {
|
|
|
+ segmentStr = digits[digit] + units[i] + segmentStr;
|
|
|
+ } else if (segmentStr && !segmentStr.startsWith("零")) {
|
|
|
+ segmentStr = "零" + segmentStr;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- amount = String(amount);
|
|
|
- if (!/^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(amount)) {
|
|
|
- return '输入金额格式不正确';
|
|
|
- }
|
|
|
+ if (segmentStr) {
|
|
|
+ integerStr = segmentStr + bigUnits[unitIndex] + integerStr;
|
|
|
+ }
|
|
|
|
|
|
- const unit = '仟佰拾亿仟佰拾万仟佰拾元角分';
|
|
|
- const str = '零壹贰叁肆伍陆柒捌玖';
|
|
|
- let newAmount = amount.replace(/^0+/, ''); // 去除前面的0
|
|
|
+ integerPart = Math.floor(integerPart / 10000);
|
|
|
+ unitIndex++;
|
|
|
+ } while (integerPart > 0);
|
|
|
|
|
|
- if (newAmount === '') {
|
|
|
- return '零元整';
|
|
|
- }
|
|
|
-
|
|
|
- let fraction = ''; // 处理小数部分
|
|
|
- if (newAmount.indexOf('.') !== -1) {
|
|
|
- const parts = newAmount.split('.');
|
|
|
- newAmount = parts[0];
|
|
|
- fraction = parts[1];
|
|
|
- if (fraction.length === 1) {
|
|
|
- fraction += '0';
|
|
|
- }
|
|
|
+ // 清理多余的零
|
|
|
+ integerStr = integerStr.replace(/零+/g, "零")
|
|
|
+ .replace(/零([万|亿])/g, "$1")
|
|
|
+ .replace(/亿万/, "亿");
|
|
|
} else {
|
|
|
- fraction = '00';
|
|
|
+ integerStr = "零";
|
|
|
}
|
|
|
|
|
|
- let chineseStr = '';
|
|
|
- let unitIndex = unit.length - 1;
|
|
|
+ integerStr += "元";
|
|
|
|
|
|
- for (let i = newAmount.length - 1; i >= 0; i--) {
|
|
|
- if (newAmount[i] === '0') {
|
|
|
- if (chineseStr.charAt(0) !== '零') {
|
|
|
- chineseStr = '零' + chineseStr;
|
|
|
- }
|
|
|
- } else {
|
|
|
- chineseStr = str.charAt(parseInt(newAmount[i])) + unit.charAt(unitIndex) + chineseStr;
|
|
|
- }
|
|
|
- unitIndex--;
|
|
|
- }
|
|
|
+ // 4. 处理小数部分
|
|
|
+ let decimalStr = "";
|
|
|
+ const decimalPart = Math.round((num - Math.floor(num)) * 100);
|
|
|
|
|
|
- // 去除多余的零
|
|
|
- chineseStr = chineseStr.replace(/零(仟|佰|拾|角)/g, '零').replace(/(零)+/g, '零');
|
|
|
- chineseStr = chineseStr.replace(/零(万|亿)/g, '$1');
|
|
|
- chineseStr = chineseStr.replace(/亿万/g, '亿');
|
|
|
- chineseStr = chineseStr.replace(/^零+/g, ''); // 去掉开头的零
|
|
|
- chineseStr = chineseStr.replace(/零元/, '元');
|
|
|
- chineseStr = chineseStr.replace(/零角零分$/, '整');
|
|
|
- chineseStr = chineseStr.replace(/零[整角分]+/, '整');
|
|
|
- chineseStr = chineseStr.replace(/零角/, '零');
|
|
|
- chineseStr = chineseStr.replace(/零分/, '');
|
|
|
- chineseStr = chineseStr.replace(/元整/, '元'); // 防止'元整'变成'元'
|
|
|
-
|
|
|
- // 添加小数部分
|
|
|
- if (fraction !== '00') {
|
|
|
- chineseStr += str.charAt(parseInt(fraction[0])) + '角';
|
|
|
- if (fraction[1] !== '0') {
|
|
|
- chineseStr += str.charAt(parseInt(fraction[1])) + '分';
|
|
|
- }
|
|
|
- } else if (!chineseStr.includes('元')) {
|
|
|
- // 处理整数部分为0的情况
|
|
|
- chineseStr += '元整';
|
|
|
- } else if (!chineseStr.endsWith('整')) {
|
|
|
- chineseStr += '整';
|
|
|
+ if (decimalPart > 0) {
|
|
|
+ const jiao = Math.floor(decimalPart / 10);
|
|
|
+ const fen = decimalPart % 10;
|
|
|
+
|
|
|
+ if (jiao > 0) decimalStr += digits[jiao] + "角";
|
|
|
+ if (fen > 0) decimalStr += digits[fen] + "分";
|
|
|
}
|
|
|
- return chineseStr;
|
|
|
+
|
|
|
+ // 5. 组合结果
|
|
|
+ let result = integerStr + (decimalStr || "整");
|
|
|
+
|
|
|
+ // 最终清理
|
|
|
+ result = result.replace(/^零+/, "")
|
|
|
+ .replace(/零元整/, "零元整")
|
|
|
+ .replace(/零([角|分])/g, "$1");
|
|
|
+
|
|
|
+ return result || "零元整";
|
|
|
},
|
|
|
//部门过滤
|
|
|
//tab容器的表现也显示隐藏
|